DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/igc: remove MTU setting limitation
       [not found] <220210219085407.97265-1-dapengx.yu@intel.com>
@ 2021-02-19 10:01 ` dapengx.yu
  2021-02-24  3:40   ` Guo, Jia
  0 siblings, 1 reply; 3+ messages in thread
From: dapengx.yu @ 2021-02-19 10:01 UTC (permalink / raw)
  To: jia.guo, haiyue.wang; +Cc: dev, Dapeng Yu, stable

From: Dapeng Yu <dapengx.yu@intel.com>

Currently, if requested MTU is bigger than mbuf size and scattered
receive is not enabled, setting MTU to that value fails.

This patch allows setting this special MTU when device is stopped,
because scattered_rx will be re-configured during next port start
and driver may enable scattered receive according new MTU value.

After this patch, driver may select different receive function
automatically after MTU set, according MTU values selected.

Fixes: a5aeb2b9e225 ("net/igc: support Rx and Tx")
Cc: stable@dpdk.org

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
---
 drivers/net/igc/igc_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c
index dbaa7a83e..0ea6e2a04 100644
--- a/drivers/net/igc/igc_ethdev.c
+++ b/drivers/net/igc/igc_ethdev.c
@@ -1590,12 +1590,14 @@ eth_igc_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		return -EINVAL;
 
 	/*
-	 * refuse mtu that requires the support of scattered packets when
-	 * this feature has not been enabled before.
+	 * If device is started, refuse mtu that requires the support of
+	 * scattered packets when this feature has not been enabled before.
 	 */
-	if (!dev->data->scattered_rx &&
-	    frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)
+	if (dev->data->dev_started && !dev->data->scattered_rx &&
+	    frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) {
+		PMD_INIT_LOG(ERR, "Stop port first.");
 		return -EINVAL;
+	}
 
 	rctl = IGC_READ_REG(hw, IGC_RCTL);
 
-- 
2.27.0


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

* Re: [dpdk-dev] [PATCH v2] net/igc: remove MTU setting limitation
  2021-02-19 10:01 ` [dpdk-dev] [PATCH v2] net/igc: remove MTU setting limitation dapengx.yu
@ 2021-02-24  3:40   ` Guo, Jia
  2021-02-24 12:23     ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Guo, Jia @ 2021-02-24  3:40 UTC (permalink / raw)
  To: Yu, DapengX, Wang, Haiyue; +Cc: dev, stable

Seems that v2 is the same as v1, but v1 exposure the coding style issue. 
Anyway please add the change when update new version. Thanks.

Acked-by: Jeff Guo <jia.guo@intel.com>

> -----Original Message-----
> From: Yu, DapengX <dapengx.yu@intel.com>
> Sent: Friday, February 19, 2021 6:01 PM
> To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; Yu, DapengX <dapengx.yu@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/igc: remove MTU setting limitation
> 
> From: Dapeng Yu <dapengx.yu@intel.com>
> 
> Currently, if requested MTU is bigger than mbuf size and scattered receive is
> not enabled, setting MTU to that value fails.
> 
> This patch allows setting this special MTU when device is stopped, because
> scattered_rx will be re-configured during next port start and driver may
> enable scattered receive according new MTU value.
> 
> After this patch, driver may select different receive function automatically
> after MTU set, according MTU values selected.
> 
> Fixes: a5aeb2b9e225 ("net/igc: support Rx and Tx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
> ---
>  drivers/net/igc/igc_ethdev.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index
> dbaa7a83e..0ea6e2a04 100644
> --- a/drivers/net/igc/igc_ethdev.c
> +++ b/drivers/net/igc/igc_ethdev.c
> @@ -1590,12 +1590,14 @@ eth_igc_mtu_set(struct rte_eth_dev *dev,
> uint16_t mtu)
>  		return -EINVAL;
> 
>  	/*
> -	 * refuse mtu that requires the support of scattered packets when
> -	 * this feature has not been enabled before.
> +	 * If device is started, refuse mtu that requires the support of
> +	 * scattered packets when this feature has not been enabled before.
>  	 */
> -	if (!dev->data->scattered_rx &&
> -	    frame_size > dev->data->min_rx_buf_size -
> RTE_PKTMBUF_HEADROOM)
> +	if (dev->data->dev_started && !dev->data->scattered_rx &&
> +	    frame_size > dev->data->min_rx_buf_size -
> RTE_PKTMBUF_HEADROOM) {
> +		PMD_INIT_LOG(ERR, "Stop port first.");
>  		return -EINVAL;
> +	}
> 
>  	rctl = IGC_READ_REG(hw, IGC_RCTL);
> 
> --
> 2.27.0


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

* Re: [dpdk-dev] [PATCH v2] net/igc: remove MTU setting limitation
  2021-02-24  3:40   ` Guo, Jia
@ 2021-02-24 12:23     ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2021-02-24 12:23 UTC (permalink / raw)
  To: Guo, Jia, Yu, DapengX, Wang, Haiyue; +Cc: dev, stable



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guo, Jia
> Sent: Wednesday, February 24, 2021 11:41 AM
> To: Yu, DapengX <dapengx.yu@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] net/igc: remove MTU setting limitation
> 
> Seems that v2 is the same as v1, but v1 exposure the coding style issue.
> Anyway please add the change when update new version. Thanks.
> 
> Acked-by: Jeff Guo <jia.guo@intel.com>
> 
> > -----Original Message-----
> > From: Yu, DapengX <dapengx.yu@intel.com>
> > Sent: Friday, February 19, 2021 6:01 PM
> > To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
> > Cc: dev@dpdk.org; Yu, DapengX <dapengx.yu@intel.com>; stable@dpdk.org
> > Subject: [PATCH v2] net/igc: remove MTU setting limitation
> >
> > From: Dapeng Yu <dapengx.yu@intel.com>
> >
> > Currently, if requested MTU is bigger than mbuf size and scattered
> > receive is not enabled, setting MTU to that value fails.
> >
> > This patch allows setting this special MTU when device is stopped,
> > because scattered_rx will be re-configured during next port start and
> > driver may enable scattered receive according new MTU value.
> >
> > After this patch, driver may select different receive function
> > automatically after MTU set, according MTU values selected.
> >
> > Fixes: a5aeb2b9e225 ("net/igc: support Rx and Tx")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2021-02-24 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <220210219085407.97265-1-dapengx.yu@intel.com>
2021-02-19 10:01 ` [dpdk-dev] [PATCH v2] net/igc: remove MTU setting limitation dapengx.yu
2021-02-24  3:40   ` Guo, Jia
2021-02-24 12:23     ` 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).