diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-01-10 15:25:57 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-01-10 15:49:35 +0300 |
commit | ccbdc596f4f6f6795956d46bb4b5f58c7e4bc3c8 (patch) | |
tree | 15f3d4fd452961906eb5cd078c7ea4b557926a89 /drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | |
parent | c4f7730be580f8c39decc058246a83ddf7d7b3cb (diff) | |
download | linux-ccbdc596f4f6f6795956d46bb4b5f58c7e4bc3c8.tar.xz |
nfp: bpf: don't allow changing MTU above BPF offload limit when active
When BPF offload is active we need may need to restrict the MTU
changes more than just to the limitation of the kernel XDP datapath.
Allow the BPF code to veto a MTU change.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.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 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c index f50aa119570a..317f87cc3cc6 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c @@ -186,6 +186,13 @@ nfp_repr_get_offload_stats(int attr_id, const struct net_device *dev, return -EINVAL; } +static int nfp_repr_change_mtu(struct net_device *netdev, int new_mtu) +{ + struct nfp_repr *repr = netdev_priv(netdev); + + return nfp_app_change_mtu(repr->app, netdev, new_mtu); +} + static netdev_tx_t nfp_repr_xmit(struct sk_buff *skb, struct net_device *netdev) { struct nfp_repr *repr = netdev_priv(netdev); @@ -240,6 +247,7 @@ const struct net_device_ops nfp_repr_netdev_ops = { .ndo_open = nfp_repr_open, .ndo_stop = nfp_repr_stop, .ndo_start_xmit = nfp_repr_xmit, + .ndo_change_mtu = nfp_repr_change_mtu, .ndo_get_stats64 = nfp_repr_get_stats64, .ndo_has_offload_stats = nfp_repr_has_offload_stats, .ndo_get_offload_stats = nfp_repr_get_offload_stats, |