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>
Cc: Vadym Kochan <vadym.kochan@plvision.eu>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Boris Sukholitko <boris.sukholitko@broadcom.com>
Subject: [RFC net-next] net/sched: cls_flower: fix resetting of ether proto mask
Date: Wed, 16 Jun 2021 20:09:22 +0300 [thread overview]
Message-ID: <20210616170922.26515-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.
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>
---
I am still in testing process of the patch but reverting of
referrenced commit solved the issue.
The issue was observed on Marvel Prestera ACL patches
with HW offloaded TC rules.
net/sched/cls_flower.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 2e704c7a105a..997ca0549c45 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -1534,10 +1534,13 @@ 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
reply other threads:[~2021-06-16 17:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210616170922.26515-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=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).