Skip to content

Commit

Permalink
octeontx2-pf: TC flower offload support for rxqueue mapping
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ratheesh Kannoth authored and Jakub Kicinski committed Jun 21, 2023
1 parent f0d9526 commit 365eb32
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,12 @@ static int otx2_tc_parse_actions(struct otx2_nic *nic,
return -EOPNOTSUPP;
}
req->vf = priv->pcifunc & RVU_PFVF_FUNC_MASK;
req->op = NIX_RX_ACTION_DEFAULT;
return 0;

/* if op is already set; avoid overwriting the same */
if (!req->op)
req->op = NIX_RX_ACTION_DEFAULT;
break;

case FLOW_ACTION_VLAN_POP:
req->vtag0_valid = true;
/* use RX_VTAG_TYPE7 which is initialized to strip vlan tag */
Expand Down Expand Up @@ -433,6 +437,12 @@ static int otx2_tc_parse_actions(struct otx2_nic *nic,
case FLOW_ACTION_MARK:
mark = act->mark;
break;

case FLOW_ACTION_RX_QUEUE_MAPPING:
req->op = NIX_RX_ACTIONOP_UCAST;
req->index = act->rx_queue;
break;

default:
return -EOPNOTSUPP;
}
Expand Down

0 comments on commit 365eb32

Please sign in to comment.