From: Stephen Hemminger <stephen@networkplumber•org>
To: davem@davemloft•net, stephen@networkplumber•org
Cc: netdev@vger•kernel.org, Stephen Hemminger <sthemmin@microsoft•com>
Subject: [PATCH RFC 1/2] br: add notifier for when bridge changes it GSO maximums
Date: Sun, 26 Nov 2017 10:17:48 -0800 [thread overview]
Message-ID: <20171126181749.19288-2-sthemmin@microsoft.com> (raw)
In-Reply-To: <20171126181749.19288-1-sthemmin@microsoft.com>
Add a callback notifier for when the minimum GSO values calculated
across all the bridge ports changes. This allows for veth to adjust
based on the devices in the bridge.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft•com>
---
include/linux/netdevice.h | 1 +
net/bridge/br_if.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ef789e1d679e..0da966ffec70 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2326,6 +2326,7 @@ struct netdev_lag_lower_state_info {
#define NETDEV_UDP_TUNNEL_PUSH_INFO 0x001C
#define NETDEV_UDP_TUNNEL_DROP_INFO 0x001D
#define NETDEV_CHANGE_TX_QUEUE_LEN 0x001E
+#define NETDEV_CHANGE_GSO_MAX 0x001F
int register_netdevice_notifier(struct notifier_block *nb);
int unregister_netdevice_notifier(struct notifier_block *nb);
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 9ba4ed65c52b..ca4ccadd78d0 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -453,8 +453,15 @@ static void br_set_gso_limits(struct net_bridge *br)
gso_max_size = min(gso_max_size, p->dev->gso_max_size);
gso_max_segs = min(gso_max_segs, p->dev->gso_max_segs);
}
+
+ if (br->dev->gso_max_size == gso_max_size &&
+ br->dev->gso_max_segs == gso_max_segs)
+ return;
+
br->dev->gso_max_size = gso_max_size;
br->dev->gso_max_segs = gso_max_segs;
+
+ call_netdevice_notifiers(NETDEV_CHANGE_GSO_MAX, br->dev);
}
/*
--
2.11.0
next prev parent reply other threads:[~2017-11-26 18:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-26 18:17 [PATCH RFC 0/2] veth, bridge, and GSO maximums Stephen Hemminger
2017-11-26 18:17 ` Stephen Hemminger [this message]
2017-11-26 18:17 ` [PATCH RFC 2/2] veth: propagate bridge GSO to peer Stephen Hemminger
2017-11-27 3:13 ` David Ahern
2017-11-27 7:07 ` Stephen Hemminger
2017-11-27 20:14 ` Solio Sarabia
2017-11-27 21:15 ` Stephen Hemminger
2017-11-28 1:42 ` Solio Sarabia
2017-11-28 2:02 ` David Ahern
2017-11-30 0:35 ` Solio Sarabia
2017-11-30 17:10 ` Stephen Hemminger
2017-11-30 17:26 ` Eric Dumazet
2017-11-30 17:36 ` Stephen Hemminger
2017-11-30 17:38 ` David Miller
2017-11-30 17:49 ` Stephen Hemminger
2017-11-30 17:59 ` Eric Dumazet
2017-11-30 18:08 ` Stephen Hemminger
2017-11-30 18:10 ` Eric Dumazet
2017-12-01 20:30 ` Stephen Hemminger
2017-11-30 15:47 ` [PATCH RFC 0/2] veth, bridge, and GSO maximums David Miller
2017-11-30 17:11 ` Stephen Hemminger
2017-11-30 20:50 ` Alexander Duyck
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=20171126181749.19288-2-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