Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1503616
| From | Jarod Wilson <jarod@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers |
| Date | 2016-10-19 16:20 +0200 |
| Message-ID | <stZSP-2nd-93@gated-at.bofh.it> (permalink) |
| References | <stOXn-2Tk-9@gated-at.bofh.it> <stOXn-2Tk-21@gated-at.bofh.it> <stZSP-2nd-95@gated-at.bofh.it> <stZSP-2nd-97@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Oct 19, 2016 at 05:03:43PM +0300, Michael S. Tsirkin wrote:
> On Wed, Oct 19, 2016 at 04:59:46PM +0300, Michael S. Tsirkin wrote:
> > On Tue, Oct 18, 2016 at 10:33:32PM -0400, Jarod Wilson wrote:
> > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > > index fad84f3..4885a42 100644
> > > --- a/drivers/net/virtio_net.c
> > > +++ b/drivers/net/virtio_net.c
> > > @@ -1419,17 +1419,6 @@ static const struct ethtool_ops virtnet_ethtool_ops = {
> > > .set_settings = virtnet_set_settings,
> > > };
> > >
> > > -#define MIN_MTU 68
> > > -#define MAX_MTU 65535
> > > -
> > > -static int virtnet_change_mtu(struct net_device *dev, int new_mtu)
> > > -{
> > > - if (new_mtu < MIN_MTU || new_mtu > MAX_MTU)
> > > - return -EINVAL;
> > > - dev->mtu = new_mtu;
> > > - return 0;
> > > -}
> > > -
> > > static const struct net_device_ops virtnet_netdev = {
> > > .ndo_open = virtnet_open,
> > > .ndo_stop = virtnet_close,
> > > @@ -1437,7 +1426,6 @@ static const struct net_device_ops virtnet_netdev = {
> > > .ndo_validate_addr = eth_validate_addr,
> > > .ndo_set_mac_address = virtnet_set_mac_address,
> > > .ndo_set_rx_mode = virtnet_set_rx_mode,
> > > - .ndo_change_mtu = virtnet_change_mtu,
> > > .ndo_get_stats64 = virtnet_stats,
> > > .ndo_vlan_rx_add_vid = virtnet_vlan_rx_add_vid,
> > > .ndo_vlan_rx_kill_vid = virtnet_vlan_rx_kill_vid,
> > > @@ -1748,6 +1736,9 @@ static bool virtnet_validate_features(struct virtio_device *vdev)
> > > return true;
> > > }
> > >
> > > +#define MIN_MTU ETH_MIN_MTU
> > > +#define MAX_MTU 65535
> > > +
> >
> > Do we need a common macro for this?
>
> I think it's actually IP_MAX_MTU.
Ah, yes, it is. I'm not sure why I didn't use that...
--
Jarod Wilson
jarod@redhat.com
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net-next 5/6] net: use core MTU range checking in virt drivers Jarod Wilson <jarod@redhat.com> - 2016-10-19 04:40 +0200
Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers Jarod Wilson <jarod@redhat.com> - 2016-10-19 16:20 +0200
Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers Jarod Wilson <jarod@redhat.com> - 2016-10-19 16:20 +0200
Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers "Michael S. Tsirkin" <mst@redhat.com> - 2016-10-19 16:20 +0200
Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers "Michael S. Tsirkin" <mst@redhat.com> - 2016-10-19 18:20 +0200
Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers Jarod Wilson <jarod@redhat.com> - 2016-10-19 16:30 +0200
Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers Aaron Conole <aconole@bytheb.org> - 2016-10-19 17:10 +0200
RE: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers Haiyang Zhang <haiyangz@microsoft.com> - 2016-10-19 17:50 +0200
Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers Shrikrishna Khare <skhare@shri-linux.eng.vmware.com> - 2016-10-20 00:30 +0200
csiph-web