diff options
author | John Hurley <john.hurley@netronome.com> | 2018-03-28 18:50:06 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-30 10:18:54 -0400 |
commit | 167cebeffadd45ce1e786889ab9346c15d64389b (patch) | |
tree | 23c2a23679e34361ddb03a2c694302c0af638c7a /drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | |
parent | 44465c47a4a3adba98588b081e6880e9b2071fa8 (diff) |
nfp: modify app MTU setting callbacks
Rename the 'change_mtu' app callback to 'check_mtu'. This is called
whenever an MTU change is requested on a netdev. It can reject the
change but is not responsible for implementing it.
Introduce a new 'repr_change_mtu' app callback that is hit when the MTU
of a repr is to be changed. This is responsible for performing the MTU
change and verifying it.
Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_net_repr.c')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c index 619570524d2a..0cd077addb26 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c @@ -196,8 +196,19 @@ nfp_repr_get_offload_stats(int attr_id, const struct net_device *dev, static int nfp_repr_change_mtu(struct net_device *netdev, int new_mtu) { struct nfp_repr *repr = netdev_priv(netdev); + int err; - return nfp_app_change_mtu(repr->app, netdev, new_mtu); + err = nfp_app_check_mtu(repr->app, netdev, new_mtu); + if (err) + return err; + + err = nfp_app_repr_change_mtu(repr->app, netdev, new_mtu); + if (err) + return err; + + netdev->mtu = new_mtu; + + return 0; } static netdev_tx_t nfp_repr_xmit(struct sk_buff *skb, struct net_device *netdev) |