Skip to content

Commit 10a0176

Browse files
Mintz, Yuvaldavem330
authored andcommitted
qede: Update receive statistic once per NAPI
Currently, each time an ingress packet is passed to networking stack the driver increments a per-queue SW statistic. As we want to have additional fields in the first cache-line of the Rx-queue struct, change flow so this statistic would be updated once per NAPI run. We will later push the statistic to a different cache line. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1ca2212 commit 10a0176

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

drivers/net/ethernet/qlogic/qede/qede_fp.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ static inline void qede_skb_receive(struct qede_dev *edev,
624624
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
625625

626626
napi_gro_receive(&fp->napi, skb);
627-
rxq->rcv_pkts++;
628627
}
629628

630629
static void qede_set_gro_params(struct qede_dev *edev,
@@ -884,9 +883,9 @@ static inline void qede_tpa_cont(struct qede_dev *edev,
884883
"Strange - TPA cont with more than a single len_list entry\n");
885884
}
886885

887-
static void qede_tpa_end(struct qede_dev *edev,
888-
struct qede_fastpath *fp,
889-
struct eth_fast_path_rx_tpa_end_cqe *cqe)
886+
static int qede_tpa_end(struct qede_dev *edev,
887+
struct qede_fastpath *fp,
888+
struct eth_fast_path_rx_tpa_end_cqe *cqe)
890889
{
891890
struct qede_rx_queue *rxq = fp->rxq;
892891
struct qede_agg_info *tpa_info;
@@ -934,11 +933,12 @@ static void qede_tpa_end(struct qede_dev *edev,
934933

935934
tpa_info->state = QEDE_AGG_STATE_NONE;
936935

937-
return;
936+
return 1;
938937
err:
939938
tpa_info->state = QEDE_AGG_STATE_NONE;
940939
dev_kfree_skb_any(tpa_info->skb);
941940
tpa_info->skb = NULL;
941+
return 0;
942942
}
943943

944944
static u8 qede_check_notunn_csum(u16 flag)
@@ -1178,8 +1178,7 @@ static int qede_rx_process_tpa_cqe(struct qede_dev *edev,
11781178
qede_tpa_cont(edev, rxq, &cqe->fast_path_tpa_cont);
11791179
return 0;
11801180
case ETH_RX_CQE_TYPE_TPA_END:
1181-
qede_tpa_end(edev, fp, &cqe->fast_path_tpa_end);
1182-
return 1;
1181+
return qede_tpa_end(edev, fp, &cqe->fast_path_tpa_end);
11831182
default:
11841183
return 0;
11851184
}
@@ -1229,7 +1228,7 @@ static int qede_rx_process_cqe(struct qede_dev *edev,
12291228
/* Run eBPF program if one is attached */
12301229
if (xdp_prog)
12311230
if (!qede_rx_xdp(edev, fp, rxq, xdp_prog, bd, fp_cqe))
1232-
return 1;
1231+
return 0;
12331232

12341233
/* If this is an error packet then drop it */
12351234
flags = cqe->fast_path_regular.pars_flags.flags;
@@ -1290,8 +1289,8 @@ static int qede_rx_int(struct qede_fastpath *fp, int budget)
12901289
{
12911290
struct qede_rx_queue *rxq = fp->rxq;
12921291
struct qede_dev *edev = fp->edev;
1292+
int work_done = 0, rcv_pkts = 0;
12931293
u16 hw_comp_cons, sw_comp_cons;
1294-
int work_done = 0;
12951294

12961295
hw_comp_cons = le16_to_cpu(*rxq->hw_cons_ptr);
12971296
sw_comp_cons = qed_chain_get_cons_idx(&rxq->rx_comp_ring);
@@ -1305,12 +1304,14 @@ static int qede_rx_int(struct qede_fastpath *fp, int budget)
13051304

13061305
/* Loop to complete all indicated BDs */
13071306
while ((sw_comp_cons != hw_comp_cons) && (work_done < budget)) {
1308-
qede_rx_process_cqe(edev, fp, rxq);
1307+
rcv_pkts += qede_rx_process_cqe(edev, fp, rxq);
13091308
qed_chain_recycle_consumed(&rxq->rx_comp_ring);
13101309
sw_comp_cons = qed_chain_get_cons_idx(&rxq->rx_comp_ring);
13111310
work_done++;
13121311
}
13131312

1313+
rxq->rcv_pkts += rcv_pkts;
1314+
13141315
/* Allocate replacement buffers */
13151316
while (rxq->num_rx_buffers - rxq->filled_buffers)
13161317
if (qede_alloc_rx_buffer(rxq, false))

0 commit comments

Comments
 (0)