All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net/sched: cls_flower: fix resetting of ether proto mask
@ 2021-06-17 16:14 Vadym Kochan
  2021-06-17 16:41 ` Vladimir Oltean
  0 siblings, 1 reply; 11+ messages in thread
From: Vadym Kochan @ 2021-06-17 16:14 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Jamal Hadi Salim, Cong Wang,
	Andrew Lunn, Vladimir Oltean, Serhiy Boiko, Volodymyr Mytnyk
  Cc: Vadym Kochan, netdev, linux-kernel, Boris Sukholitko

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-06-28  6:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 16:14 [PATCH net-next] net/sched: cls_flower: fix resetting of ether proto mask Vadym Kochan
2021-06-17 16:41 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.