From: Vadym Kochan <vadym.kochan@plvision.eu>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
Serhiy Boiko <serhiy.boiko@plvision.eu>,
Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>
Cc: Vadym Kochan <vadym.kochan@plvision.eu>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Boris Sukholitko <boris.sukholitko@broadcom.com>
Subject: [PATCH net-next] net/sched: cls_flower: fix resetting of ether proto mask
Date: Thu, 17 Jun 2021 19:14:35 +0300 [thread overview]
Message-ID: <20210617161435.8853-1-vadym.kochan@plvision.eu> (raw)
In case of matching 'protocol' the rule does not work:
tc filter add dev $DEV ingress prio 1 protocol $PROTO flower skip_sw action drop
so clear the ether proto mask only for CVLAN case.
The issue was observed by testing on Marvell Prestera Switchdev driver
with recent 'flower' offloading feature.
Fixes: 0dca2c7404a9 ("net/sched: cls_flower: Remove match on n_proto")
CC: Boris Sukholitko <boris.sukholitko@broadcom.com>
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
---
RFC -> PATCH:
Removed extra empty line.
net/sched/cls_flower.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 2e704c7a105a..3e1b0012bce4 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -1534,10 +1534,12 @@ static int fl_set_key(struct net *net, struct nlattr **tb,
mask->basic.n_proto = cpu_to_be16(0);
} else {
key->basic.n_proto = ethertype;
+ mask->basic.n_proto = cpu_to_be16(~0);
}
}
} else {
key->basic.n_proto = ethertype;
+ mask->basic.n_proto = cpu_to_be16(~0);
}
}
--
2.17.1
next reply other threads:[~2021-06-17 16:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 16:14 Vadym Kochan [this message]
2021-06-17 16:41 ` [PATCH net-next] net/sched: cls_flower: fix resetting of ether proto mask Vladimir Oltean
2021-06-17 19:51 ` Vladimir Oltean
2021-06-21 8:32 ` Boris Sukholitko
2021-06-21 10:09 ` Vladimir Oltean
2021-06-21 14:04 ` Jamal Hadi Salim
2021-06-22 13:13 ` Boris Sukholitko
2021-06-22 14:17 ` Jamal Hadi Salim
2021-06-22 15:22 ` Boris Sukholitko
2021-06-24 20:07 ` Jamal Hadi Salim
2021-06-28 6:24 ` Boris Sukholitko
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=20210617161435.8853-1-vadym.kochan@plvision.eu \
--to=vadym.kochan@plvision.eu \
--cc=andrew@lunn.ch \
--cc=boris.sukholitko@broadcom.com \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=serhiy.boiko@plvision.eu \
--cc=volodymyr.mytnyk@plvision.eu \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).