[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGykzh1LgjV+liKh@shredder>
Date: Tue, 23 May 2023 14:34:38 +0300
From: Ido Schimmel <idosch@...dia.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Jakub Kicinski <kuba@...nel.org>, razor@...ckwall.org,
netdev@...r.kernel.org, bridge@...ts.linux-foundation.org,
davem@...emloft.net, edumazet@...gle.com, roopa@...dia.com,
taras.chornyi@...ision.eu, saeedm@...dia.com, leon@...nel.org,
petrm@...dia.com, vladimir.oltean@....com, claudiu.manoil@....com,
alexandre.belloni@...tlin.com, UNGLinuxDriver@...rochip.com,
jhs@...atatu.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
taspelund@...dia.com
Subject: Re: [PATCH net-next 1/5] skbuff: bridge: Add layer 2 miss indication
On Tue, May 23, 2023 at 11:04:27AM +0200, Paolo Abeni wrote:
> I think you would only need to set/add the extension when l2_miss is
> true, right? (with no extension l2 hit is assumed). That will avoid
> unneeded overhead for br_dev_xmit().
If an extension is already present (possibly with 'l2_miss' being 'true'
because the packet was flooded by a different bridge earlier in the
pipeline), then we need to clear it when the packet enters the bridge.
IMO, this is quite unlikely. However, if the extension is missing, then
you are correct and there is no point in allocating one.
IOW, I can squash the following diff to the first patch:
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index fb6525553a8a..32115d76a6de 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -764,10 +764,16 @@ static inline void br_tc_skb_miss_set(struct sk_buff *skb, bool miss)
return;
ext = skb_ext_find(skb, TC_SKB_EXT);
- if (!ext)
- ext = tc_skb_ext_alloc(skb);
- if (ext)
+ if (ext) {
ext->l2_miss = miss;
+ return;
+ }
+ if (!miss)
+ return;
+ ext = tc_skb_ext_alloc(skb);
+ if (!ext)
+ return;
+ ext->l2_miss = miss;
}
#else
static inline void br_tc_skb_miss_set(struct sk_buff *skb, bool miss)
Thanks
Powered by blists - more mailing lists