]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
octeontx2-pf: cn20k: Add TC rules support
authorSubbaraya Sundeep <sbhatta@marvell.com>
Tue, 24 Feb 2026 08:00:07 +0000 (13:30 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 28 Feb 2026 18:29:27 +0000 (10:29 -0800)
commit0d12d26701b0d35fd992551cf5608485a706e686
tree5d1fcff9a12fd2157d30032c86a3120f0ac305d1
parent9000cada7aa9593df9b0c105f906fdfb43a5b341
octeontx2-pf: cn20k: Add TC rules support

Unlike previous silicons, MCAM entries required for TC rules in CN20K
are allocated dynamically. The key size can also be dynamic, i.e., X2 or
X4. Based on the size of the TC rule match criteria, the AF driver
allocates an X2 or X4 rule. This patch implements the required changes
for CN20K TC by requesting an MCAM entry from the AF driver on the fly
when the user installs a rule. Based on the TC rule priority added or
deleted by the user, the PF driver shifts MCAM entries accordingly. If
there is a mix of X2 and X4 rules and the user tries to install a rule
in the middle of existing rules, the PF driver detects this and rejects
the rule since X2 and X4 rules cannot be shifted in hardware.

Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Link: https://patch.msgid.link/20260224080009.4147301-12-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/mbox.h
drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c
drivers/net/ethernet/marvell/octeontx2/nic/cn20k.h
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c