DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/tap: fix Rx miss the packets
@ 2019-07-12 10:20 Donald_Lee
  2019-07-12 13:50 ` Wiles, Keith
  0 siblings, 1 reply; 4+ messages in thread
From: Donald_Lee @ 2019-07-12 10:20 UTC (permalink / raw)
  To: thomas; +Cc: dev

From: Donald Lee <donald_lee@trendmicro.com>



After pmd_rx_burst be triggered, it doesn't retrieve all the frames.

It may leave some pending frames there.



Signed-off-by: Donald Lee <donald_lee@trendmicro.com>

---

drivers/net/tap/rte_eth_tap.c | 7 ++++++-

drivers/net/tap/rte_eth_tap.h | 1 +

2 files changed, 7 insertions(+), 1 deletion(-)



diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c

index 3841842f0..e2785e011 100644

--- a/drivers/net/tap/rte_eth_tap.c

+++ b/drivers/net/tap/rte_eth_tap.c

@@ -353,10 +353,11 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)

               unsigned long num_rx_bytes = 0;

               uint32_t trigger = tap_trigger;



-              if (trigger == rxq->trigger_seen)

+             if (trigger == rxq->trigger_seen && !rxq->keep_trigger)

                               return 0;

               if (trigger)

                               rxq->trigger_seen = trigger;

+             rxq->keep_trigger = 0;

               process_private = rte_eth_devices[rxq->in_port].process_private;

               rte_compiler_barrier();

               for (num_rx = 0; num_rx < nb_pkts; ) {

@@ -431,6 +432,9 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)

                               bufs[num_rx++] = mbuf;

                               num_rx_bytes += mbuf->pkt_len;

               }

+             /* may have pending packets, keep trigger */

+             if (num_rx == nb_pkts)

+                             rxq->keep_trigger = 1;

end:

               rxq->stats.ipackets += num_rx;

               rxq->stats.ibytes += num_rx_bytes;

@@ -1352,6 +1356,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,



                rxq->mp = mp;

               rxq->trigger_seen = 1; /* force initial burst */

+             rxq->keep_trigger = 0;

               rxq->in_port = dev->data->port_id;

               rxq->queue_id = rx_queue_id;

               rxq->nb_rx_desc = nb_desc;

diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h

index 8d6d53dc0..842e8c0b7 100644

--- a/drivers/net/tap/rte_eth_tap.h

+++ b/drivers/net/tap/rte_eth_tap.h

@@ -45,6 +45,7 @@ struct pkt_stats {

struct rx_queue {

               struct rte_mempool *mp;         /* Mempool for RX packets */

               uint32_t trigger_seen;          /* Last seen Rx trigger value */

+             uint16_t keep_trigger;          /* Keep trigger state */

               uint16_t in_port;               /* Port ID */

               uint16_t queue_id;                         /* queue ID*/

               struct pkt_stats stats;         /* Stats for this RX queue */

--

2.19.1




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

* Re: [dpdk-dev] [PATCH] net/tap: fix Rx miss the packets
  2019-07-12 10:20 [dpdk-dev] [PATCH] net/tap: fix Rx miss the packets Donald_Lee
@ 2019-07-12 13:50 ` Wiles, Keith
  0 siblings, 0 replies; 4+ messages in thread
From: Wiles, Keith @ 2019-07-12 13:50 UTC (permalink / raw)
  To: Donald_Lee; +Cc: thomas, dev



> On Jul 12, 2019, at 5:20 AM, Donald_Lee@trendmicro.com wrote:
> 
> From: Donald Lee <donald_lee@trendmicro.com>
> 
> 
> 
> After pmd_rx_burst be triggered, it doesn't retrieve all the frames.
> 
> It may leave some pending frames there.
> 
> 
> 
> Signed-off-by: Donald Lee <donald_lee@trendmicro.com>
> 
> ---
> 
> drivers/net/tap/rte_eth_tap.c | 7 ++++++-
> 
> drivers/net/tap/rte_eth_tap.h | 1 +
> 
> 2 files changed, 7 insertions(+), 1 deletion(-)
> 

Acked-by: Keith Wiles <keith.wiles@intel.com>

Regards,
Keith


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

* Re: [dpdk-dev] [PATCH] net/tap: fix Rx miss the packets
  2019-07-04 16:11 Donald_Lee
@ 2019-07-04 16:42 ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2019-07-04 16:42 UTC (permalink / raw)
  To: Donald_Lee; +Cc: dev, keith.wiles

04/07/2019 18:11, Donald_Lee@trendmicro.com:
> After pmd_rx_burst be triggered, it doesn't retrieve all the frames.
> It may leave some pending frames there.
> 
> Signed-off-by: Donald Lee <donald_lee@trendmicro.com>

Thank you for the patch.

There are two issues which may prevent from merging this patch:

1/ It was not received by others because you are not registered
in the mailing-list. I unblocked this patch from moderation queue.
Please consider registering in the mailing-list.

2/ The footer legally discourages from using this code
because of the confidential clause.

> TREND MICRO EMAIL NOTICE
> The information contained in this email and any attachments is confidential 
> and may be subject to copyright or other intellectual property protection. 
> If you are not the intended recipient, you are not authorized to use or 
> disclose this information, and we request that you notify us by reply mail or
> telephone and delete the original message from your mail system.





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

* [dpdk-dev] [PATCH] net/tap: fix Rx miss the packets
@ 2019-07-04 16:11 Donald_Lee
  2019-07-04 16:42 ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Donald_Lee @ 2019-07-04 16:11 UTC (permalink / raw)
  To: thomas; +Cc: dev

From: Donald Lee <donald_lee@trendmicro.com>



After pmd_rx_burst be triggered, it doesn't retrieve all the frames.

It may leave some pending frames there.



Signed-off-by: Donald Lee <donald_lee@trendmicro.com>

---

drivers/net/tap/rte_eth_tap.c | 7 ++++++-

drivers/net/tap/rte_eth_tap.h | 1 +

2 files changed, 7 insertions(+), 1 deletion(-)



diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c

index 3841842f0..e2785e011 100644

--- a/drivers/net/tap/rte_eth_tap.c

+++ b/drivers/net/tap/rte_eth_tap.c

@@ -353,10 +353,11 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)

               unsigned long num_rx_bytes = 0;

               uint32_t trigger = tap_trigger;

-              if (trigger == rxq->trigger_seen)

+             if (trigger == rxq->trigger_seen && !rxq->keep_trigger)

                               return 0;

               if (trigger)

                               rxq->trigger_seen = trigger;

+             rxq->keep_trigger = 0;

               process_private = rte_eth_devices[rxq->in_port].process_private;

               rte_compiler_barrier();

               for (num_rx = 0; num_rx < nb_pkts; ) {

@@ -431,6 +432,9 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)

                               bufs[num_rx++] = mbuf;

                               num_rx_bytes += mbuf->pkt_len;

               }

+             /* may have pending packets, keep trigger */

+             if (num_rx == nb_pkts)

+                             rxq->keep_trigger = 1;

end:

               rxq->stats.ipackets += num_rx;

               rxq->stats.ibytes += num_rx_bytes;

@@ -1352,6 +1356,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,

                rxq->mp = mp;

               rxq->trigger_seen = 1; /* force initial burst */

+             rxq->keep_trigger = 0;

               rxq->in_port = dev->data->port_id;

               rxq->queue_id = rx_queue_id;

               rxq->nb_rx_desc = nb_desc;

diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h

index 8d6d53dc0..842e8c0b7 100644

--- a/drivers/net/tap/rte_eth_tap.h

+++ b/drivers/net/tap/rte_eth_tap.h

@@ -45,6 +45,7 @@ struct pkt_stats {

struct rx_queue {

               struct rte_mempool *mp;         /* Mempool for RX packets */

               uint32_t trigger_seen;          /* Last seen Rx trigger value */

+             uint16_t keep_trigger;          /* Keep trigger state */

               uint16_t in_port;               /* Port ID */

               uint16_t queue_id;                         /* queue ID*/

               struct pkt_stats stats;         /* Stats for this RX queue */

--

2.19.1




<table class="TM_EMAIL_NOTICE"><tr><td><pre>
TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential 
and may be subject to copyright or other intellectual property protection. 
If you are not the intended recipient, you are not authorized to use or 
disclose this information, and we request that you notify us by reply mail or
telephone and delete the original message from your mail system.
</pre></td></tr></table>

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

end of thread, other threads:[~2019-07-12 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12 10:20 [dpdk-dev] [PATCH] net/tap: fix Rx miss the packets Donald_Lee
2019-07-12 13:50 ` Wiles, Keith
  -- strict thread matches above, loose matches on Subject: below --
2019-07-04 16:11 Donald_Lee
2019-07-04 16:42 ` Thomas Monjalon

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).