[PATCH v3 19/19] net/xsc: add dev basic stats ops
WanRenyong
wanry at yunsilicon.com
Sat Sep 21 09:21:36 CEST 2024
On 2024/9/20 3:05, Stephen Hemminger wrote:
> On Wed, 18 Sep 2024 14:09:36 +0800
> "WanRenyong" <wanry at yunsilicon.com> wrote:
>
>> @@ -166,6 +169,7 @@ xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
>> /* Fill wqe */
>> wqe->va = rte_cpu_to_le_64(rte_pktmbuf_iova(rep));
>> rte_pktmbuf_data_len(seg) = len;
>> + rxq->stats.rx_bytes += rte_pktmbuf_pkt_len(pkt);
>>
>> *(pkts++) = pkt;
>> pkt = NULL;
>> @@ -200,6 +204,7 @@ xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
>> rxq->nb_rx_hold = 0;
>> }
>>
>> + rxq->stats.rx_pkts += nb_pkts;
>> return nb_pkts;
>> }
> You can a small performance boost by keeping a total_bytes counter in rx_burst function
> and only add it to rx_bytes after the loop.
Hello, Stephen,
Thanks for review. This a good suggestion, I'll take it.
--
Thanks,
WanRenyong
More information about the dev
mailing list