diff options
author | David S. Miller <davem@davemloft.net> | 2008-12-03 00:05:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-03 00:05:06 +0100 |
commit | 68024541e2e5a8f35e281daaa5068a29e2a538a5 (patch) | |
tree | 81345f6259fc90f12aa15569c3000cf4b829247b | |
parent | mac8390: update to net_device_ops (diff) | |
parent | virtio_net: large tx MTU support (diff) | |
download | linux-68024541e2e5a8f35e281daaa5068a29e2a538a5.tar.xz linux-68024541e2e5a8f35e281daaa5068a29e2a538a5.zip |
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
-rw-r--r-- | drivers/net/virtio_net.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index e6b5d6ef9ea8..71ca29cc184d 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -613,6 +613,17 @@ static struct ethtool_ops virtnet_ethtool_ops = { .set_tso = ethtool_op_set_tso, }; +#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 int virtnet_probe(struct virtio_device *vdev) { int err; @@ -628,6 +639,7 @@ static int virtnet_probe(struct virtio_device *vdev) dev->open = virtnet_open; dev->stop = virtnet_close; dev->hard_start_xmit = start_xmit; + dev->change_mtu = virtnet_change_mtu; dev->features = NETIF_F_HIGHDMA; #ifdef CONFIG_NET_POLL_CONTROLLER dev->poll_controller = virtnet_netpoll; |