Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

octeontx2-pf: TC flower offload support for rxqueue mapping

TC rule support to offload rx queue mapping rules.

Eg:
tc filter add dev eth2 ingress protocol ip flower \
dst_ip 192.168.8.100 \
action skbedit queue_mapping 4 skip_sw
action mirred ingress redirect dev eth5

Packets destined to 192.168.8.100 will be forwarded to rx
queue 4 of eth5 interface.

tc filter add dev eth2 ingress protocol ip flower \
dst_ip 192.168.8.100 \
action skbedit queue_mapping 9 skip_sw

Packets destined to 192.168.8.100 will be forwarded to rx
queue 4 of eth2 interface.

Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Link: https://lore.kernel.org/r/20230619060638.1032304-1-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ratheesh Kannoth and committed by
Jakub Kicinski
365eb32e f0d95264

+12 -2
+12 -2
drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c
··· 396 396 return -EOPNOTSUPP; 397 397 } 398 398 req->vf = priv->pcifunc & RVU_PFVF_FUNC_MASK; 399 - req->op = NIX_RX_ACTION_DEFAULT; 400 - return 0; 399 + 400 + /* if op is already set; avoid overwriting the same */ 401 + if (!req->op) 402 + req->op = NIX_RX_ACTION_DEFAULT; 403 + break; 404 + 401 405 case FLOW_ACTION_VLAN_POP: 402 406 req->vtag0_valid = true; 403 407 /* use RX_VTAG_TYPE7 which is initialized to strip vlan tag */ ··· 437 433 case FLOW_ACTION_MARK: 438 434 mark = act->mark; 439 435 break; 436 + 437 + case FLOW_ACTION_RX_QUEUE_MAPPING: 438 + req->op = NIX_RX_ACTIONOP_UCAST; 439 + req->index = act->rx_queue; 440 + break; 441 + 440 442 default: 441 443 return -EOPNOTSUPP; 442 444 }