DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/pcap: fix byte stats for drop Tx
@ 2021-02-03 17:30 Ferruh Yigit
  2021-02-04 15:47 ` Ferriter, Cian
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2021-02-03 17:30 UTC (permalink / raw)
  To: Cian Ferriter; +Cc: Ferruh Yigit, dev, stable

Drop Tx path in pcap is Tx that just drops the packets, which is used
for the case only Rx from a pcap file is requested/matters.

The byte stats was calculated using first mbuf segment, which gives
wrong values for multi segmented mbufs, updated to use packet length
instead.

Bugzilla ID: 597
Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
Cc: stable@dpdk.org

Reported-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/pcap/rte_eth_pcap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index ff02ade70d1a..c7751b7ba742 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -386,7 +386,7 @@ eth_tx_drop(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		return 0;
 
 	for (i = 0; i < nb_pkts; i++) {
-		tx_bytes += bufs[i]->data_len;
+		tx_bytes += bufs[i]->pkt_len;
 		rte_pktmbuf_free(bufs[i]);
 	}
 
-- 
2.29.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/pcap: fix byte stats for drop Tx
  2021-02-03 17:30 [dpdk-dev] [PATCH] net/pcap: fix byte stats for drop Tx Ferruh Yigit
@ 2021-02-04 15:47 ` Ferriter, Cian
  2021-02-04 16:24   ` Ferriter, Cian
  2021-02-04 16:40   ` Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: Ferriter, Cian @ 2021-02-04 15:47 UTC (permalink / raw)
  To: Yigit, Ferruh; +Cc: dev, stable



> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Wednesday 3 February 2021 17:30
> To: Ferriter, Cian <cian.ferriter@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/pcap: fix byte stats for drop Tx
> 
> Drop Tx path in pcap is Tx that just drops the packets, which is used
> for the case only Rx from a pcap file is requested/matters.
> 
> The byte stats was calculated using first mbuf segment, which gives
> wrong values for multi segmented mbufs, updated to use packet length
> instead.
> 
> Bugzilla ID: 597
> Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
> Cc: stable@dpdk.org
> 
> Reported-by: Cian Ferriter <cian.ferriter@intel.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---

Acked-by: Cian Ferriter <cian.ferriter@intel.com>

Tested this with 2 large PCAPs and it works as expected:

testpmd> show port stats all

  ######################## NIC statistics for port 0  ########################
  RX-packets: 2          RX-missed: 0          RX-bytes:  131070
  RX-errors: 0
  RX-nombuf:  0
  TX-packets: 2          TX-errors: 0          TX-bytes:  131070

  Throughput (since last show)
  Rx-pps:            0          Rx-bps:            0
  Tx-pps:            0          Tx-bps:            0
  ############################################################################

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/pcap: fix byte stats for drop Tx
  2021-02-04 15:47 ` Ferriter, Cian
@ 2021-02-04 16:24   ` Ferriter, Cian
  2021-02-04 16:40   ` Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Ferriter, Cian @ 2021-02-04 16:24 UTC (permalink / raw)
  To: Yigit, Ferruh; +Cc: dev, stable



> -----Original Message-----
> From: Ferriter, Cian
> Sent: Thursday 4 February 2021 15:48
> To: Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: RE: [PATCH] net/pcap: fix byte stats for drop Tx
> 
> 
> 
> > -----Original Message-----
> > From: Yigit, Ferruh <ferruh.yigit@intel.com>
> > Sent: Wednesday 3 February 2021 17:30
> > To: Ferriter, Cian <cian.ferriter@intel.com>
> > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org;
> stable@dpdk.org
> > Subject: [PATCH] net/pcap: fix byte stats for drop Tx
> >
> > Drop Tx path in pcap is Tx that just drops the packets, which is used
> > for the case only Rx from a pcap file is requested/matters.
> >
> > The byte stats was calculated using first mbuf segment, which gives
> > wrong values for multi segmented mbufs, updated to use packet length
> > instead.
> >
> > Bugzilla ID: 597
> > Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
> > Cc: stable@dpdk.org
> >
> > Reported-by: Cian Ferriter <cian.ferriter@intel.com>
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> 
> Acked-by: Cian Ferriter <cian.ferriter@intel.com>
> 
> Tested this with 2 large PCAPs and it works as expected:
> 
> testpmd> show port stats all
> 
>   ######################## NIC statistics for port 0
> ########################
>   RX-packets: 2          RX-missed: 0          RX-bytes:  131070
>   RX-errors: 0
>   RX-nombuf:  0
>   TX-packets: 2          TX-errors: 0          TX-bytes:  131070
> 
>   Throughput (since last show)
>   Rx-pps:            0          Rx-bps:            0
>   Tx-pps:            0          Tx-bps:            0
> 
> ##########################################################
> ##################

[Cian Ferriter] 
Just to clarify, the Testpmd CMD used to get the stats I pasted above is:

dpdk-testpmd -l 1,2 -w 0:00.0 --vdev net_pcap0,rx_pcap=/root/udp_2_max_jumbo.pcap -- --no-flush-rx --i

This means that tx_drop was enabled because no tx_pcap file was passed to the PCAP PMD as an arg.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/pcap: fix byte stats for drop Tx
  2021-02-04 15:47 ` Ferriter, Cian
  2021-02-04 16:24   ` Ferriter, Cian
@ 2021-02-04 16:40   ` Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2021-02-04 16:40 UTC (permalink / raw)
  To: Ferriter, Cian; +Cc: dev, stable

On 2/4/2021 3:47 PM, Ferriter, Cian wrote:
> 
> 
>> -----Original Message-----
>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>> Sent: Wednesday 3 February 2021 17:30
>> To: Ferriter, Cian <cian.ferriter@intel.com>
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; stable@dpdk.org
>> Subject: [PATCH] net/pcap: fix byte stats for drop Tx
>>
>> Drop Tx path in pcap is Tx that just drops the packets, which is used
>> for the case only Rx from a pcap file is requested/matters.
>>
>> The byte stats was calculated using first mbuf segment, which gives
>> wrong values for multi segmented mbufs, updated to use packet length
>> instead.
>>
>> Bugzilla ID: 597
>> Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
>> Cc: stable@dpdk.org
>>
>> Reported-by: Cian Ferriter <cian.ferriter@intel.com>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
> 
> Acked-by: Cian Ferriter <cian.ferriter@intel.com>
> 
> Tested this with 2 large PCAPs and it works as expected:

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-04 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 17:30 [dpdk-dev] [PATCH] net/pcap: fix byte stats for drop Tx Ferruh Yigit
2021-02-04 15:47 ` Ferriter, Cian
2021-02-04 16:24   ` Ferriter, Cian
2021-02-04 16:40   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).