DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/iavf: add segment-length check to Tx prep
@ 2024-11-11 16:42 Bruce Richardson
  2024-11-11 17:46 ` Medvedkin, Vladimir
  0 siblings, 1 reply; 5+ messages in thread
From: Bruce Richardson @ 2024-11-11 16:42 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Padraig Connolly, Vladimir Medvedkin,
	Ian Stokes, Qi Zhang, Kevin Liu

In the Tx prep function, the metadata checks were only checking the
packet length and ignoring the data length. For single-buffer packets we
can quickly check that the data length is the packet length.

Fixes: 19ee91c6bd9a ("net/iavf: check illegal packet sizes")
Cc: stable@dpdk.org

Reported-by: Padraig Connolly <padraig.j.connolly@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 4850b9e381..6a093c6746 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -3677,7 +3677,11 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-		if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) {
+		/* valid packets are greater than min size, and single-buffer pkts
+		 * must have data_len == pkt_len
+		 */
+		if (m->pkt_len < IAVF_TX_MIN_PKT_LEN ||
+				(m->nb_segs == 1 && m->data_len != m->pkt_len)) {
 			rte_errno = EINVAL;
 			return i;
 		}
-- 
2.43.0


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

* Re: [PATCH] net/iavf: add segment-length check to Tx prep
  2024-11-11 16:42 [PATCH] net/iavf: add segment-length check to Tx prep Bruce Richardson
@ 2024-11-11 17:46 ` Medvedkin, Vladimir
  2024-11-19  9:17   ` Connolly, Padraig J
  0 siblings, 1 reply; 5+ messages in thread
From: Medvedkin, Vladimir @ 2024-11-11 17:46 UTC (permalink / raw)
  To: Bruce Richardson, dev
  Cc: stable, Padraig Connolly, Ian Stokes, Qi Zhang, Kevin Liu

Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

On 11/11/2024 16:42, Bruce Richardson wrote:
> In the Tx prep function, the metadata checks were only checking the
> packet length and ignoring the data length. For single-buffer packets we
> can quickly check that the data length is the packet length.
>
> Fixes: 19ee91c6bd9a ("net/iavf: check illegal packet sizes")
> Cc: stable@dpdk.org
>
> Reported-by: Padraig Connolly <padraig.j.connolly@intel.com>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   drivers/net/iavf/iavf_rxtx.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
> index 4850b9e381..6a093c6746 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -3677,7 +3677,11 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
>   			return i;
>   		}
>   
> -		if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) {
> +		/* valid packets are greater than min size, and single-buffer pkts
> +		 * must have data_len == pkt_len
> +		 */
> +		if (m->pkt_len < IAVF_TX_MIN_PKT_LEN ||
> +				(m->nb_segs == 1 && m->data_len != m->pkt_len)) {
>   			rte_errno = EINVAL;
>   			return i;
>   		}

-- 
Regards,
Vladimir


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

* Re: [PATCH] net/iavf: add segment-length check to Tx prep
  2024-11-11 17:46 ` Medvedkin, Vladimir
@ 2024-11-19  9:17   ` Connolly, Padraig J
  2024-11-19  9:54     ` Connolly, Padraig J
  2024-11-19 11:41     ` Bruce Richardson
  0 siblings, 2 replies; 5+ messages in thread
From: Connolly, Padraig J @ 2024-11-19  9:17 UTC (permalink / raw)
  To: Medvedkin, Vladimir, Richardson, Bruce, dev
  Cc: stable, Stokes, Ian, Zhang, Qi Z, Kevin Liu

[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]



________________________________
From: Medvedkin, Vladimir <vladimir.medvedkin@intel.com>
Sent: Monday 11 November 2024 5:46 pm
To: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org <dev@dpdk.org>
Cc: stable@dpdk.org <stable@dpdk.org>; Connolly, Padraig J <padraig.j.connolly@intel.com>; Stokes, Ian <ian.stokes@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Kevin Liu <kevinx.liu@intel.com>
Subject: Re: [PATCH] net/iavf: add segment-length check to Tx prep

Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

On 11/11/2024 16:42, Bruce Richardson wrote:
> In the Tx prep function, the metadata checks were only checking the
> packet length and ignoring the data length. For single-buffer packets we
> can quickly check that the data length is the packet length.
>
> Fixes: 19ee91c6bd9a ("net/iavf: check illegal packet sizes")
> Cc: stable@dpdk.org
>
> Reported-by: Padraig Connolly <padraig.j.connolly@intel.com>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   drivers/net/iavf/iavf_rxtx.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
> index 4850b9e381..6a093c6746 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -3677,7 +3677,11 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
>                        return i;
>                }
>
> -             if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) {
> +             /* valid packets are greater than min size, and single-buffer pkts
> +              * must have data_len == pkt_len
> +              */
> +             if (m->pkt_len < IAVF_TX_MIN_PKT_LEN ||
> +                             (m->nb_segs == 1 && m->data_len != m->pkt_len)) {
>                        rte_errno = EINVAL;
>                        return i;
>                }

--
Regards,
Vladimir
Tested-by: Padraig Connolly <padraig.j.connolly@intel.com>

[-- Attachment #2: Type: text/html, Size: 4316 bytes --]

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

* Re: [PATCH] net/iavf: add segment-length check to Tx prep
  2024-11-19  9:17   ` Connolly, Padraig J
@ 2024-11-19  9:54     ` Connolly, Padraig J
  2024-11-19 11:41     ` Bruce Richardson
  1 sibling, 0 replies; 5+ messages in thread
From: Connolly, Padraig J @ 2024-11-19  9:54 UTC (permalink / raw)
  To: Medvedkin, Vladimir, Richardson, Bruce, dev
  Cc: stable, Stokes, Ian, Zhang, Qi Z, Kevin Liu

[-- Attachment #1: Type: text/plain, Size: 1661 bytes --]


 Tested-by: Padraig Connolly <padraig.j.connolly@intel.com>
> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

>On 11/11/2024 16:42, Bruce Richardson wrote:
> > In the Tx prep function, the metadata checks were only checking the
> > packet length and ignoring the data length. For single-buffer packets we
> > can quickly check that the data length is the packet length.
> >
> > Fixes: 19ee91c6bd9a ("net/iavf: check illegal packet sizes")
> > Cc: stable@dpdk.org
> >
> > Reported-by: Padraig Connolly <padraig.j.connolly@intel.com>
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >   drivers/net/iavf/iavf_rxtx.c | 6 +++++-
> >   1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
> > index 4850b9e381..6a093c6746 100644
> > --- a/drivers/net/iavf/iavf_rxtx.c
> > +++ b/drivers/net/iavf/iavf_rxtx.c
> > @@ -3677,7 +3677,11 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
> >                        return i;
> >                }
> >
> > -             if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) {
> > +             /* valid packets are greater than min size, and single-buffer pkts
> > +              * must have data_len == pkt_len
> > +              */
> > +             if (m->pkt_len < IAVF_TX_MIN_PKT_LEN ||
> > +                             (m->nb_segs == 1 && m->data_len != m->pkt_len)) {
> >                        rte_errno = EINVAL;
> >                        return i;
> >                }

--
Regards,
Vladimir
Tested-by: Padraig Connolly <padraig.j.connolly@intel.com>

[-- Attachment #2: Type: text/html, Size: 3803 bytes --]

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

* Re: [PATCH] net/iavf: add segment-length check to Tx prep
  2024-11-19  9:17   ` Connolly, Padraig J
  2024-11-19  9:54     ` Connolly, Padraig J
@ 2024-11-19 11:41     ` Bruce Richardson
  1 sibling, 0 replies; 5+ messages in thread
From: Bruce Richardson @ 2024-11-19 11:41 UTC (permalink / raw)
  To: Connolly, Padraig J
  Cc: Medvedkin, Vladimir, dev, stable, Stokes, Ian, Zhang, Qi Z, Kevin Liu

On Tue, Nov 19, 2024 at 09:17:57AM +0000, Connolly, Padraig J wrote:
>      __________________________________________________________________
> 
>    From: Medvedkin, Vladimir <vladimir.medvedkin@intel.com>
>    Sent: Monday 11 November 2024 5:46 pm
>    To: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org
>    <dev@dpdk.org>
>    Cc: stable@dpdk.org <stable@dpdk.org>; Connolly, Padraig J
>    <padraig.j.connolly@intel.com>; Stokes, Ian <ian.stokes@intel.com>;
>    Zhang, Qi Z <qi.z.zhang@intel.com>; Kevin Liu <kevinx.liu@intel.com>
>    Subject: Re: [PATCH] net/iavf: add segment-length check to Tx prep
> 
>    On 11/11/2024 16:42, Bruce Richardson wrote:
>    > In the Tx prep function, the metadata checks were only checking the
>    > packet length and ignoring the data length. For single-buffer packets
>    we
>    > can quickly check that the data length is the packet length.
>    >
>    > Fixes: 19ee91c6bd9a ("net/iavf: check illegal packet sizes")
>    > Cc: stable@dpdk.org
>    >
>    > Reported-by: Padraig Connolly <padraig.j.connolly@intel.com>
>    > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>    Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
>    Tested-by: Padraig Connolly <padraig.j.connolly@intel.com>

Applied to dpdk-next-net-intel

/Bruce

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

end of thread, other threads:[~2024-11-19 11:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-11 16:42 [PATCH] net/iavf: add segment-length check to Tx prep Bruce Richardson
2024-11-11 17:46 ` Medvedkin, Vladimir
2024-11-19  9:17   ` Connolly, Padraig J
2024-11-19  9:54     ` Connolly, Padraig J
2024-11-19 11:41     ` Bruce Richardson

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