public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber•org>
To: davem@davemloft•net
Cc: netdev@vger•kernel.org, Stephen Hemminger <sthemmin@microsoft•com>
Subject: [PATCH net-next 2/2] veth: set peer GSO values
Date: Thu,  7 Dec 2017 15:40:20 -0800	[thread overview]
Message-ID: <20171207234020.18783-3-sthemmin@microsoft.com> (raw)
In-Reply-To: <20171207234020.18783-1-sthemmin@microsoft.com>

When new veth is created, and GSO values have been configured
on one device, clone those values to the peer.

For example:
   # ip link add dev vm1 gso_max_size 65530 type veth peer name vm2

This should create vm1 <--> vm2 with both having GSO maximum
size set to 65530.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft•com>
---
 drivers/net/veth.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index f5438d0978ca..a69ad39ee57e 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -410,6 +410,9 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 	if (ifmp && (dev->ifindex != 0))
 		peer->ifindex = ifmp->ifi_index;
 
+	peer->gso_max_size = dev->gso_max_size;
+	peer->gso_max_segs = dev->gso_max_segs;
+
 	err = register_netdevice(peer);
 	put_net(net);
 	net = NULL;
-- 
2.11.0

  parent reply	other threads:[~2017-12-07 23:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 23:40 [PATCH net-next v3 0/2] veth and GSO maximums Stephen Hemminger
2017-12-07 23:40 ` [PATCH net-next 1/2] rtnetlink: allow GSO maximums to be set on device creation Stephen Hemminger
2017-12-07 23:40 ` Stephen Hemminger [this message]
2017-12-09 16:41   ` [PATCH net-next 2/2] veth: set peer GSO values David Ahern
2017-12-09 19:51     ` Solio Sarabia
2017-12-08 19:23 ` [PATCH net-next v3 0/2] veth and GSO maximums David Miller
2017-12-08 23:50   ` Solio Sarabia
2017-12-09  0:15     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171207234020.18783-3-sthemmin@microsoft.com \
    --to=stephen@networkplumber$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sthemmin@microsoft$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox