* RE: [PATCH] net/iavf: fix Tx preparation
2023-11-02 12:05 [PATCH] net/iavf: fix Tx preparation Qi Zhang
@ 2023-11-02 6:44 ` Yang, Qiming
2023-11-06 1:40 ` Zhang, Qi Z
0 siblings, 1 reply; 3+ messages in thread
From: Yang, Qiming @ 2023-11-02 6:44 UTC (permalink / raw)
To: Zhang, Qi Z, Xing, Beilei; +Cc: dev, Zhang, Qi Z, stable
Hi,
> -----Original Message-----
> From: Qi Zhang <qi.z.zhang@intel.com>
> Sent: Thursday, November 2, 2023 8:05 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/iavf: fix Tx preparation
>
> 1. check nb_segs > Tx ring size for TSO case.
> 2. report nb_mtu_seg_max and nb_seg_max in dev_info.
>
> Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
> Cc: stable@dpdk.org
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> drivers/net/iavf/iavf_ethdev.c | 2 ++
> drivers/net/iavf/iavf_rxtx.c | 3 ++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index 98cc5c8ea8..0c6ab4ac5a 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -1207,6 +1207,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct
> rte_eth_dev_info *dev_info)
> .nb_max = IAVF_MAX_RING_DESC,
> .nb_min = IAVF_MIN_RING_DESC,
> .nb_align = IAVF_ALIGN_RING_DESC,
> + .nb_mtu_seg_max = IAVF_TX_MAX_MTU_SEG,
> + .nb_seg_max = IAVF_MAX_RING_DESC,
> };
>
> dev_info->err_handle_mode =
> RTE_ETH_ERROR_HANDLE_MODE_PASSIVE;
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index
> 610912f635..45f638c1d2 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -3656,7 +3656,8 @@ iavf_prep_pkts(__rte_unused void *tx_queue,
> struct rte_mbuf **tx_pkts,
> return i;
> }
> } else if ((m->tso_segsz < IAVF_MIN_TSO_MSS) ||
> - (m->tso_segsz > IAVF_MAX_TSO_MSS)) {
> + (m->tso_segsz > IAVF_MAX_TSO_MSS) ||
> + (m->nb_segs > txq->nb_tx_desc)) {
> /* MSS outside the range are considered malicious */
> rte_errno = EINVAL;
> return i;
> --
> 2.31.1
Acked-by: Qiming Yang <qiming.yang@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] net/iavf: fix Tx preparation
@ 2023-11-02 12:05 Qi Zhang
2023-11-02 6:44 ` Yang, Qiming
0 siblings, 1 reply; 3+ messages in thread
From: Qi Zhang @ 2023-11-02 12:05 UTC (permalink / raw)
To: beilei.xing; +Cc: dev, Qi Zhang, stable
1. check nb_segs > Tx ring size for TSO case.
2. report nb_mtu_seg_max and nb_seg_max in dev_info.
Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/iavf/iavf_ethdev.c | 2 ++
drivers/net/iavf/iavf_rxtx.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 98cc5c8ea8..0c6ab4ac5a 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1207,6 +1207,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
.nb_max = IAVF_MAX_RING_DESC,
.nb_min = IAVF_MIN_RING_DESC,
.nb_align = IAVF_ALIGN_RING_DESC,
+ .nb_mtu_seg_max = IAVF_TX_MAX_MTU_SEG,
+ .nb_seg_max = IAVF_MAX_RING_DESC,
};
dev_info->err_handle_mode = RTE_ETH_ERROR_HANDLE_MODE_PASSIVE;
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 610912f635..45f638c1d2 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -3656,7 +3656,8 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
return i;
}
} else if ((m->tso_segsz < IAVF_MIN_TSO_MSS) ||
- (m->tso_segsz > IAVF_MAX_TSO_MSS)) {
+ (m->tso_segsz > IAVF_MAX_TSO_MSS) ||
+ (m->nb_segs > txq->nb_tx_desc)) {
/* MSS outside the range are considered malicious */
rte_errno = EINVAL;
return i;
--
2.31.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] net/iavf: fix Tx preparation
2023-11-02 6:44 ` Yang, Qiming
@ 2023-11-06 1:40 ` Zhang, Qi Z
0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2023-11-06 1:40 UTC (permalink / raw)
To: Yang, Qiming, Xing, Beilei; +Cc: dev, stable
> -----Original Message-----
> From: Yang, Qiming <qiming.yang@intel.com>
> Sent: Thursday, November 2, 2023 2:45 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: RE: [PATCH] net/iavf: fix Tx preparation
>
> Hi,
>
> > -----Original Message-----
> > From: Qi Zhang <qi.z.zhang@intel.com>
> > Sent: Thursday, November 2, 2023 8:05 PM
> > To: Xing, Beilei <beilei.xing@intel.com>
> > Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> > Subject: [PATCH] net/iavf: fix Tx preparation
> >
> > 1. check nb_segs > Tx ring size for TSO case.
> > 2. report nb_mtu_seg_max and nb_seg_max in dev_info.
> >
> > Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > ---
> > drivers/net/iavf/iavf_ethdev.c | 2 ++
> > drivers/net/iavf/iavf_rxtx.c | 3 ++-
> > 2 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index 98cc5c8ea8..0c6ab4ac5a 100644
> > --- a/drivers/net/iavf/iavf_ethdev.c
> > +++ b/drivers/net/iavf/iavf_ethdev.c
> > @@ -1207,6 +1207,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev,
> > struct rte_eth_dev_info *dev_info)
> > .nb_max = IAVF_MAX_RING_DESC,
> > .nb_min = IAVF_MIN_RING_DESC,
> > .nb_align = IAVF_ALIGN_RING_DESC,
> > + .nb_mtu_seg_max = IAVF_TX_MAX_MTU_SEG,
> > + .nb_seg_max = IAVF_MAX_RING_DESC,
> > };
> >
> > dev_info->err_handle_mode =
> > RTE_ETH_ERROR_HANDLE_MODE_PASSIVE;
> > diff --git a/drivers/net/iavf/iavf_rxtx.c
> > b/drivers/net/iavf/iavf_rxtx.c index
> > 610912f635..45f638c1d2 100644
> > --- a/drivers/net/iavf/iavf_rxtx.c
> > +++ b/drivers/net/iavf/iavf_rxtx.c
> > @@ -3656,7 +3656,8 @@ iavf_prep_pkts(__rte_unused void *tx_queue,
> > struct rte_mbuf **tx_pkts,
> > return i;
> > }
> > } else if ((m->tso_segsz < IAVF_MIN_TSO_MSS) ||
> > - (m->tso_segsz > IAVF_MAX_TSO_MSS)) {
> > + (m->tso_segsz > IAVF_MAX_TSO_MSS) ||
> > + (m->nb_segs > txq->nb_tx_desc)) {
> > /* MSS outside the range are considered malicious */
> > rte_errno = EINVAL;
> > return i;
> > --
> > 2.31.1
>
> Acked-by: Qiming Yang <qiming.yang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-06 1:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02 12:05 [PATCH] net/iavf: fix Tx preparation Qi Zhang
2023-11-02 6:44 ` Yang, Qiming
2023-11-06 1:40 ` Zhang, Qi Z
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).