[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210807120726.1063225-4-dqfext@gmail.com>
Date: Sat, 7 Aug 2021 20:07:26 +0800
From: DENG Qingfang <dqfext@...il.com>
To: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Russell King <linux@...linux.org.uk>,
netdev@...r.kernel.org (open list:NETWORKING DRIVERS),
linux-kernel@...r.kernel.org (open list)
Cc: Ansuel Smith <ansuelsmth@...il.com>,
Jonathan McDowell <noodles@...th.li>,
Michal Vokáč <vokac.m@...il.com>,
Christian Lamparter <chunkeey@...il.com>,
Nishka Dasgupta <nishkadg.linux@...il.com>,
Xiaofei Shen <xiaofeis@...eaurora.org>,
John Crispin <john@...ozen.org>,
Stefan Lippers-Hollmann <s.l-h@....de>,
Hannu Nyman <hannu.nyman@....fi>,
Imran Khan <gururug@...il.com>,
Frank Wunderlich <frank-w@...lic-files.de>,
Nick Lowe <nick.lowe@...il.com>,
André Valentin <avalentin@....kalnet.hooya.de>
Subject: [RFC net-next 3/3] net: dsa: tag_qca: set offload_fwd_mark
As we offload flooding and forwarding, set offload_fwd_mark according to
Atheros header's type.
Signed-off-by: DENG Qingfang <dqfext@...il.com>
---
net/dsa/tag_qca.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index 6e3136990491..ee5c1fdfef47 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -50,7 +50,7 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev)
{
- u8 ver;
+ u8 ver, type;
u16 hdr;
int port;
__be16 *phdr;
@@ -82,6 +82,15 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev)
if (!skb->dev)
return NULL;
+ type = (hdr & QCA_HDR_RECV_TYPE_MASK) >> QCA_HDR_RECV_TYPE_S;
+ switch (type) {
+ case 0x00: /* Normal packet */
+ case 0x19: /* Flooding to CPU */
+ case 0x1a: /* Forwarding to CPU */
+ dsa_default_offload_fwd_mark(skb);
+ break;
+ }
+
return skb;
}
--
2.25.1
Powered by blists - more mailing lists