diff options
author | Jarod Wilson <jarod@redhat.com> | 2016-10-20 13:55:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-20 14:51:09 -0400 |
commit | d0c2c9973ecd267307543526ae93855e3a3e4b23 (patch) | |
tree | 6f06f6170c38dda14759a59f474c582004d72c67 /drivers/net/xen-netback/interface.c | |
parent | 91572088e3fdbf4fe31cf397926d8b890fdb3237 (diff) |
net: use core MTU range checking in virt drivers
hyperv_net:
- set min/max_mtu, per Haiyang, after rndis_filter_device_add
virtio_net:
- set min/max_mtu
- remove virtnet_change_mtu
vmxnet3:
- set min/max_mtu
xen-netback:
- min_mtu = 0, max_mtu = 65517
xen-netfront:
- min_mtu = 0, max_mtu = 65535
unisys/visor:
- clean up defines a little to not clash with network core or add
redundat definitions
CC: netdev@vger.kernel.org
CC: virtualization@lists.linux-foundation.org
CC: "K. Y. Srinivasan" <kys@microsoft.com>
CC: Haiyang Zhang <haiyangz@microsoft.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
CC: Shrikrishna Khare <skhare@vmware.com>
CC: "VMware, Inc." <pv-drivers@vmware.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Paul Durrant <paul.durrant@citrix.com>
CC: David Kershner <david.kershner@unisys.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
-rw-r--r-- | drivers/net/xen-netback/interface.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 74dc2bf71428..e30ffd29b7e9 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -302,7 +302,7 @@ static int xenvif_close(struct net_device *dev) | |||
302 | static int xenvif_change_mtu(struct net_device *dev, int mtu) | 302 | static int xenvif_change_mtu(struct net_device *dev, int mtu) |
303 | { | 303 | { |
304 | struct xenvif *vif = netdev_priv(dev); | 304 | struct xenvif *vif = netdev_priv(dev); |
305 | int max = vif->can_sg ? 65535 - VLAN_ETH_HLEN : ETH_DATA_LEN; | 305 | int max = vif->can_sg ? ETH_MAX_MTU - VLAN_ETH_HLEN : ETH_DATA_LEN; |
306 | 306 | ||
307 | if (mtu > max) | 307 | if (mtu > max) |
308 | return -EINVAL; | 308 | return -EINVAL; |
@@ -471,6 +471,9 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
471 | 471 | ||
472 | dev->tx_queue_len = XENVIF_QUEUE_LENGTH; | 472 | dev->tx_queue_len = XENVIF_QUEUE_LENGTH; |
473 | 473 | ||
474 | dev->min_mtu = 0; | ||
475 | dev->max_mtu = ETH_MAX_MTU - VLAN_ETH_HLEN; | ||
476 | |||
474 | /* | 477 | /* |
475 | * Initialise a dummy MAC address. We choose the numerically | 478 | * Initialise a dummy MAC address. We choose the numerically |
476 | * largest non-broadcast address to prevent the address getting | 479 | * largest non-broadcast address to prevent the address getting |