On 6/25/19 4:27 PM, Jakub Kicinski wrote:
On Thu, 20 Jun 2019 13:24:15 -0700, Shannon Nelson wrote:
+static int ionic_set_features(struct net_device *netdev,
+ netdev_features_t features)
+{
+ struct lif *lif = netdev_priv(netdev);
+ int err;
+
+ netdev_dbg(netdev, "%s: lif->features=0x%08llx new_features=0x%08llx\n",
+ __func__, (u64)lif->netdev->features, (u64)features);
+
+ err = ionic_set_nic_features(lif, features);
Presumably something gets added here in later patch?
This is a pass-through to the lif-specific function which does most of
the work.
+ return err;
+}
+
+static int ionic_set_mac_address(struct net_device *netdev, void *sa)
+{
+ netdev_info(netdev, "%s: stubbed\n", __func__);
+ return 0;
+}
+
+static int ionic_change_mtu(struct net_device *netdev, int new_mtu)
+{
+ struct lif *lif = netdev_priv(netdev);
+ struct ionic_admin_ctx ctx = {
+ .work = COMPLETION_INITIALIZER_ONSTACK(ctx.work),
+ .cmd.lif_setattr = {
+ .opcode = CMD_OPCODE_LIF_SETATTR,
+ .index = cpu_to_le16(lif->index),
+ .attr = IONIC_LIF_ATTR_MTU,
+ .mtu = cpu_to_le32(new_mtu),
+ },
+ };
+ int err;
+
+ if (new_mtu < IONIC_MIN_MTU || new_mtu > IONIC_MAX_MTU) {
+ netdev_err(netdev, "Invalid MTU %d\n", new_mtu);
+ return -EINVAL;
+ }
We do the min/max checks in the core now (netdev->min_mtu,
netdev->max_mtu). You'll have to keep this if out of tree,
unfortunately.
Got it.
+ err = ionic_adminq_post_wait(lif, &ctx);
+ if (err)
+ return err;
+
+ netdev->mtu = new_mtu;
+ err = ionic_reset_queues(lif);
+
+ return err;
+}