Skip to content

Commit

Permalink
net/mlx5e: Add tc chains offload support for nic flows
Browse files Browse the repository at this point in the history
Allow adding nic tc flow rules with goto chain action.

Connecting the nic flows to the mlx5 chains infrastructure in previous
patches allows us to support the creation of chained flow tables and
rules that direct to another chain for further packet processing.
This is a required preparation to support CT offloads for nic tc flows.

We allow the creation of 256 different chains for nic flows since we
have 8 bits available for the chain restore tag in case of a miss.

Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Ariel Levkovich authored and Saeed Mahameed committed Sep 23, 2020
1 parent c620b77 commit c756909
Show file tree
Hide file tree
Showing 4 changed files with 250 additions and 57 deletions.
10 changes: 10 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,11 @@ static void mlx5e_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
}

mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb);

if (mlx5e_cqe_regb_chain(cqe))
if (!mlx5e_tc_update_skb(cqe, skb))
goto free_wqe;

napi_gro_receive(rq->cq.napi, skb);

free_wqe:
Expand Down Expand Up @@ -1521,6 +1526,11 @@ static void mlx5e_handle_rx_cqe_mpwrq(struct mlx5e_rq *rq, struct mlx5_cqe64 *cq
goto mpwrq_cqe_out;

mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb);

if (mlx5e_cqe_regb_chain(cqe))
if (!mlx5e_tc_update_skb(cqe, skb))
goto mpwrq_cqe_out;

napi_gro_receive(rq->cq.napi, skb);

mpwrq_cqe_out:
Expand Down
Loading

0 comments on commit c756909

Please sign in to comment.