patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v3] net/ixgbe: add vector Rx parameter check
       [not found] <20211202092001.1830481-2-zhengbin.89740@bytedance.com>
@ 2021-12-10  8:22 ` Bin Zheng
  2021-12-13  3:02   ` Rong, Leyi
  2021-12-15  8:07   ` Liang Ma
  0 siblings, 2 replies; 6+ messages in thread
From: Bin Zheng @ 2021-12-10  8:22 UTC (permalink / raw)
  To: dev; +Cc: haiyue.wang, liangma, stable, leyi.rong, Bin Zheng, jia.guo

Under the circumstance that `rx_tail` wrap back to zero
and the advance speed of `rx_tail` is greater than `rxrearm_start`,
`rx_tail` will catch up with `rxrearm_start` and surpass it.
This may cause some mbufs be reused by application.

So we need to make some restrictions to ensure that
 `rx_tail` will not exceed `rxrearm_start`.

e.g.

RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95
...
RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994

when `rx_tail` catches up with `rxrearm_start`,
2(994 - 992) mbufs be reused by application !

Bugzilla ID: 882
Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx")
Cc: jia.guo@intel.com
Cc: stable@dpdk.org

Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
---
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 1eed949495..4654d0adec 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -364,6 +364,17 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	uint8_t vlan_flags;
 	uint16_t udp_p_flag = 0; /* Rx Descriptor UDP header present */
 
+	/*
+	 * Under the circumstance that `rx_tail` wrap back to zero
+	 * and the advance speed of `rx_tail` is greater than `rxrearm_start`,
+	 * `rx_tail` will catch up with `rxrearm_start` and surpass it.
+	 * This may cause some mbufs be reused by application.
+	 *
+	 * So we need to make some restrictions to ensure that
+	 * `rx_tail` will not exceed `rxrearm_start`.
+	 */
+	nb_pkts = RTE_MIN(nb_pkts, RTE_IXGBE_RXQ_REARM_THRESH);
+
 	/* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */
 	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP);
 
-- 
2.25.1


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

* RE: [PATCH v3] net/ixgbe: add vector Rx parameter check
  2021-12-10  8:22 ` [PATCH v3] net/ixgbe: add vector Rx parameter check Bin Zheng
@ 2021-12-13  3:02   ` Rong, Leyi
  2021-12-14  7:29     ` Wang, Haiyue
  2021-12-15  8:07   ` Liang Ma
  1 sibling, 1 reply; 6+ messages in thread
From: Rong, Leyi @ 2021-12-13  3:02 UTC (permalink / raw)
  To: Bin Zheng, dev; +Cc: Wang, Haiyue, liangma, stable, jia.guo


> -----Original Message-----
> From: Bin Zheng <zhengbin.89740@bytedance.com>
> Sent: Friday, December 10, 2021 4:22 PM
> To: dev@dpdk.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; liangma@liangbit.com;
> stable@dpdk.org; Rong, Leyi <leyi.rong@intel.com>; Bin Zheng
> <zhengbin.89740@bytedance.com>; jia.guo@intel.com
> Subject: [PATCH v3] net/ixgbe: add vector Rx parameter check
> 
> Under the circumstance that `rx_tail` wrap back to zero and the advance speed
> of `rx_tail` is greater than `rxrearm_start`, `rx_tail` will catch up with
> `rxrearm_start` and surpass it.
> This may cause some mbufs be reused by application.
> 
> So we need to make some restrictions to ensure that  `rx_tail` will not exceed
> `rxrearm_start`.
> 
> e.g.
> 
> RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
> RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
> RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
> RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
> RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
> RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95 ...
> RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
> RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
> RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
> RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994
> 
> when `rx_tail` catches up with `rxrearm_start`,
> 2(994 - 992) mbufs be reused by application !
> 
> Bugzilla ID: 882
> Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx")
> Cc: jia.guo@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
> ---
>  drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> index 1eed949495..4654d0adec 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> @@ -364,6 +364,17 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq,
> struct rte_mbuf **rx_pkts,
>  	uint8_t vlan_flags;
>  	uint16_t udp_p_flag = 0; /* Rx Descriptor UDP header present */
> 
> +	/*
> +	 * Under the circumstance that `rx_tail` wrap back to zero
> +	 * and the advance speed of `rx_tail` is greater than `rxrearm_start`,
> +	 * `rx_tail` will catch up with `rxrearm_start` and surpass it.
> +	 * This may cause some mbufs be reused by application.
> +	 *
> +	 * So we need to make some restrictions to ensure that
> +	 * `rx_tail` will not exceed `rxrearm_start`.
> +	 */
> +	nb_pkts = RTE_MIN(nb_pkts, RTE_IXGBE_RXQ_REARM_THRESH);
> +
>  	/* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */
>  	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP);
> 
> --
> 2.25.1

Acked-by: Leyi Rong <leyi.rong@intel.com>

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

* RE: [PATCH v3] net/ixgbe: add vector Rx parameter check
  2021-12-13  3:02   ` Rong, Leyi
@ 2021-12-14  7:29     ` Wang, Haiyue
  2022-01-11  0:31       ` Zhang, Qi Z
  0 siblings, 1 reply; 6+ messages in thread
From: Wang, Haiyue @ 2021-12-14  7:29 UTC (permalink / raw)
  To: Rong, Leyi, Bin Zheng, dev; +Cc: liangma, stable, jia.guo

> -----Original Message-----
> From: Rong, Leyi <leyi.rong@intel.com>
> Sent: Monday, December 13, 2021 11:03
> To: Bin Zheng <zhengbin.89740@bytedance.com>; dev@dpdk.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; liangma@liangbit.com; stable@dpdk.org; jia.guo@intel.com
> Subject: RE: [PATCH v3] net/ixgbe: add vector Rx parameter check
> 
> 
> > -----Original Message-----
> > From: Bin Zheng <zhengbin.89740@bytedance.com>
> > Sent: Friday, December 10, 2021 4:22 PM
> > To: dev@dpdk.org
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>; liangma@liangbit.com;
> > stable@dpdk.org; Rong, Leyi <leyi.rong@intel.com>; Bin Zheng
> > <zhengbin.89740@bytedance.com>; jia.guo@intel.com
> > Subject: [PATCH v3] net/ixgbe: add vector Rx parameter check
> >
> > Under the circumstance that `rx_tail` wrap back to zero and the advance speed
> > of `rx_tail` is greater than `rxrearm_start`, `rx_tail` will catch up with
> > `rxrearm_start` and surpass it.
> > This may cause some mbufs be reused by application.
> >
> > So we need to make some restrictions to ensure that  `rx_tail` will not exceed
> > `rxrearm_start`.
> >
> > e.g.
> >
> > RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
> > RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
> > RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
> > RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
> > RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
> > RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95 ...
> > RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
> > RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
> > RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
> > RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994
> >
> > when `rx_tail` catches up with `rxrearm_start`,
> > 2(994 - 992) mbufs be reused by application !
> >
> > Bugzilla ID: 882
> > Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx")
> > Cc: jia.guo@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >


> 
> Acked-by: Leyi Rong <leyi.rong@intel.com>

Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>

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

* Re: [PATCH v3] net/ixgbe: add vector Rx parameter check
  2021-12-10  8:22 ` [PATCH v3] net/ixgbe: add vector Rx parameter check Bin Zheng
  2021-12-13  3:02   ` Rong, Leyi
@ 2021-12-15  8:07   ` Liang Ma
  1 sibling, 0 replies; 6+ messages in thread
From: Liang Ma @ 2021-12-15  8:07 UTC (permalink / raw)
  To: Bin Zheng; +Cc: dev, haiyue.wang, stable, leyi.rong, jia.guo

On Fri, Dec 10, 2021 at 04:22:09PM +0800, Bin Zheng wrote:
> Under the circumstance that `rx_tail` wrap back to zero
> and the advance speed of `rx_tail` is greater than `rxrearm_start`,
> `rx_tail` will catch up with `rxrearm_start` and surpass it.
> This may cause some mbufs be reused by application.
> 
> So we need to make some restrictions to ensure that
>  `rx_tail` will not exceed `rxrearm_start`.
> 
> e.g.
> 
> RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
> RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
> RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
> RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
> RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
> RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95
> ...
> RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
> RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
> RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
> RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994
> 
> when `rx_tail` catches up with `rxrearm_start`,
> 2(994 - 992) mbufs be reused by application !
> 
> Bugzilla ID: 882
> Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx")
> Cc: jia.guo@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
> ---
>  drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> index 1eed949495..4654d0adec 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> @@ -364,6 +364,17 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
>  	uint8_t vlan_flags;
>  	uint16_t udp_p_flag = 0; /* Rx Descriptor UDP header present */
>  
> +	/*
> +	 * Under the circumstance that `rx_tail` wrap back to zero
> +	 * and the advance speed of `rx_tail` is greater than `rxrearm_start`,
> +	 * `rx_tail` will catch up with `rxrearm_start` and surpass it.
> +	 * This may cause some mbufs be reused by application.
> +	 *
> +	 * So we need to make some restrictions to ensure that
> +	 * `rx_tail` will not exceed `rxrearm_start`.
> +	 */
> +	nb_pkts = RTE_MIN(nb_pkts, RTE_IXGBE_RXQ_REARM_THRESH);
> +
>  	/* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */
>  	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP);
>  
> -- 
> 2.25.1
> 
Reviewed-by Liang Ma <liangma@liangbit.com>

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

* RE: [PATCH v3] net/ixgbe: add vector Rx parameter check
  2021-12-14  7:29     ` Wang, Haiyue
@ 2022-01-11  0:31       ` Zhang, Qi Z
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Qi Z @ 2022-01-11  0:31 UTC (permalink / raw)
  To: Wang, Haiyue, Rong, Leyi, Bin Zheng, dev; +Cc: liangma, stable, jia.guo



> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang@intel.com>
> Sent: Tuesday, December 14, 2021 3:29 PM
> To: Rong, Leyi <leyi.rong@intel.com>; Bin Zheng
> <zhengbin.89740@bytedance.com>; dev@dpdk.org
> Cc: liangma@liangbit.com; stable@dpdk.org; jia.guo@intel.com
> Subject: RE: [PATCH v3] net/ixgbe: add vector Rx parameter check
> 
> > -----Original Message-----
> > From: Rong, Leyi <leyi.rong@intel.com>
> > Sent: Monday, December 13, 2021 11:03
> > To: Bin Zheng <zhengbin.89740@bytedance.com>; dev@dpdk.org
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>; liangma@liangbit.com;
> > stable@dpdk.org; jia.guo@intel.com
> > Subject: RE: [PATCH v3] net/ixgbe: add vector Rx parameter check
> >
> >
> > > -----Original Message-----
> > > From: Bin Zheng <zhengbin.89740@bytedance.com>
> > > Sent: Friday, December 10, 2021 4:22 PM
> > > To: dev@dpdk.org
> > > Cc: Wang, Haiyue <haiyue.wang@intel.com>; liangma@liangbit.com;
> > > stable@dpdk.org; Rong, Leyi <leyi.rong@intel.com>; Bin Zheng
> > > <zhengbin.89740@bytedance.com>; jia.guo@intel.com
> > > Subject: [PATCH v3] net/ixgbe: add vector Rx parameter check
> > >
> > > Under the circumstance that `rx_tail` wrap back to zero and the
> > > advance speed of `rx_tail` is greater than `rxrearm_start`,
> > > `rx_tail` will catch up with `rxrearm_start` and surpass it.
> > > This may cause some mbufs be reused by application.
> > >
> > > So we need to make some restrictions to ensure that  `rx_tail` will
> > > not exceed `rxrearm_start`.
> > >
> > > e.g.
> > >
> > > RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
> > > RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
> > > RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
> > > RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
> > > RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
> > > RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95 ...
> > > RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
> > > RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
> > > RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
> > > RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994
> > >
> > > when `rx_tail` catches up with `rxrearm_start`,
> > > 2(994 - 992) mbufs be reused by application !
> > >
> > > Bugzilla ID: 882
> > > Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx")
> > > Cc: jia.guo@intel.com
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
> > > ---
> > >  drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++
> > >  1 file changed, 11 insertions(+)
> > >
> 
> 
> >
> > Acked-by: Leyi Rong <leyi.rong@intel.com>
> 
> Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

* [PATCH v3] net/ixgbe: add vector Rx parameter check
@ 2021-12-10  7:58 Bin Zheng
  0 siblings, 0 replies; 6+ messages in thread
From: Bin Zheng @ 2021-12-10  7:58 UTC (permalink / raw)
  To: dev; +Cc: haiyue.wang, liangma, stable, leyi.rong, Bin Zheng, jia.guo

Under the circumstance that `rx_tail` wrap back to zero
and the advance speed of `rx_tail` is greater than `rxrearm_start`,
`rx_tail` will catch up with `rxrearm_start` and surpass it.
This may cause some mbufs be reused by application.

So we need to make some restrictions to ensure that
 `rx_tail` will not exceed `rxrearm_start`.

e.g.

RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95
...
RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994

when `rx_tail` catches up with `rxrearm_start`,
2(994 - 992) mbufs be reused by application !

Bugzilla ID: 882
Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx")
Cc: jia.guo@intel.com
Cc: stable@dpdk.org

Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
---
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 1eed949495..4654d0adec 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -364,6 +364,17 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	uint8_t vlan_flags;
 	uint16_t udp_p_flag = 0; /* Rx Descriptor UDP header present */
 
+	/*
+	 * Under the circumstance that `rx_tail` wrap back to zero
+	 * and the advance speed of `rx_tail` is greater than `rxrearm_start`,
+	 * `rx_tail` will catch up with `rxrearm_start` and surpass it.
+	 * This may cause some mbufs be reused by application.
+	 *
+	 * So we need to make some restrictions to ensure that
+	 * `rx_tail` will not exceed `rxrearm_start`.
+	 */
+	nb_pkts = RTE_MIN(nb_pkts, RTE_IXGBE_RXQ_REARM_THRESH);
+
 	/* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */
 	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP);
 
-- 
2.25.1


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

end of thread, other threads:[~2022-01-11  0:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211202092001.1830481-2-zhengbin.89740@bytedance.com>
2021-12-10  8:22 ` [PATCH v3] net/ixgbe: add vector Rx parameter check Bin Zheng
2021-12-13  3:02   ` Rong, Leyi
2021-12-14  7:29     ` Wang, Haiyue
2022-01-11  0:31       ` Zhang, Qi Z
2021-12-15  8:07   ` Liang Ma
2021-12-10  7:58 Bin Zheng

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