Skip to content

Commit 365eb32

Browse files
rkannoth1kuba-moo
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f0d9526 commit 365eb32

File tree

1 file changed

+12
-2
lines changed
  • drivers/net/ethernet/marvell/octeontx2/nic

1 file changed

+12
-2
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,12 @@ static int otx2_tc_parse_actions(struct otx2_nic *nic,
396396
return -EOPNOTSUPP;
397397
}
398398
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+
401405
case FLOW_ACTION_VLAN_POP:
402406
req->vtag0_valid = true;
403407
/* use RX_VTAG_TYPE7 which is initialized to strip vlan tag */
@@ -433,6 +437,12 @@ static int otx2_tc_parse_actions(struct otx2_nic *nic,
433437
case FLOW_ACTION_MARK:
434438
mark = act->mark;
435439
break;
440+
441+
case FLOW_ACTION_RX_QUEUE_MAPPING:
442+
req->op = NIX_RX_ACTIONOP_UCAST;
443+
req->index = act->rx_queue;
444+
break;
445+
436446
default:
437447
return -EOPNOTSUPP;
438448
}

0 commit comments

Comments
 (0)