Skip to content

Commit d94ae64

Browse files
Amit Cohenkuba-moo
authored andcommitted
mlxsw: pci: Use napi_consume_skb() to free SKB as part of Tx completion
Currently, as part of Tx completion, the driver calls dev_kfree_skb_any() to free the SKB. For this flow, the correct function is napi_consume_skb(). This function and dev_consume_skb_any() were added to be used for consumed SKBs, which were not dropped, so the skb:kfree_skb tracepoint is not triggered, and we can get better diagnostics about dropped packets. Signed-off-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/a9f9f3dc884c0d1be4bd4c9d72030c88c7ac004f.1718709196.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e8441b1 commit d94ae64

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+3
-3
lines changed

drivers/net/ethernet/mellanox/mlxsw/pci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ static void mlxsw_pci_cqe_sdq_handle(struct mlxsw_pci *mlxsw_pci,
541541
struct mlxsw_pci_queue *q,
542542
u16 consumer_counter_limit,
543543
enum mlxsw_pci_cqe_v cqe_v,
544-
char *cqe)
544+
char *cqe, int budget)
545545
{
546546
struct pci_dev *pdev = mlxsw_pci->pdev;
547547
struct mlxsw_pci_queue_elem_info *elem_info;
@@ -567,7 +567,7 @@ static void mlxsw_pci_cqe_sdq_handle(struct mlxsw_pci *mlxsw_pci,
567567
}
568568

569569
if (skb)
570-
dev_kfree_skb_any(skb);
570+
napi_consume_skb(skb, budget);
571571
elem_info->sdq.skb = NULL;
572572

573573
if (q->consumer_counter++ != consumer_counter_limit)
@@ -819,7 +819,7 @@ static int mlxsw_pci_napi_poll_cq_tx(struct napi_struct *napi, int budget)
819819
mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
820820

821821
mlxsw_pci_cqe_sdq_handle(mlxsw_pci, sdq,
822-
wqe_counter, q->u.cq.v, ncqe);
822+
wqe_counter, q->u.cq.v, ncqe, budget);
823823

824824
work_done++;
825825
}

0 commit comments

Comments
 (0)