net/i40e: rework maximum frame size configuration

Message ID 20230116105318.19412-1-simei.su@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/i40e: rework maximum frame size configuration |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Simei Su Jan. 16, 2023, 10:53 a.m. UTC
  This patch removes unnecessary link status check.

Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port level")
Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port level")
Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")
Cc: stable@dpdk.org

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 47 +++++++++---------------------------------
 1 file changed, 10 insertions(+), 37 deletions(-)
  

Comments

David Marchand Jan. 16, 2023, 11:18 a.m. UTC | #1
On Mon, Jan 16, 2023 at 11:54 AM Simei Su <simei.su@intel.com> wrote:
>
> This patch removes unnecessary link status check.
>
> Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port level")
> Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port level")
> Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")
> Cc: stable@dpdk.org
>
> Signed-off-by: Simei Su <simei.su@intel.com>

Thanks for looking into the issue.

This is rather close to what I had tried [1] along my original report,
but it failed in the CI.
Let's see how the validation of your patch goes.

1: https://patchwork.dpdk.org/project/dpdk/patch/20221212143715.29649-1-david.marchand@redhat.com/
  
Simei Su Jan. 16, 2023, 12:15 p.m. UTC | #2
Hi David,

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Monday, January 16, 2023 7:19 PM
> To: Su, Simei <simei.su@intel.com>
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [PATCH] net/i40e: rework maximum frame size configuration
> 
> On Mon, Jan 16, 2023 at 11:54 AM Simei Su <simei.su@intel.com> wrote:
> >
> > This patch removes unnecessary link status check.
> >
> > Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port
> > level")
> > Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port
> > level")
> > Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Simei Su <simei.su@intel.com>
> 
> Thanks for looking into the issue.
> 
> This is rather close to what I had tried [1] along my original report, but it failed
> in the CI.
> Let's see how the validation of your patch goes.
> 
> 1:
> https://patchwork.dpdk.org/project/dpdk/patch/20221212143715.29649-1-d
> avid.marchand@redhat.com/
> 

OK. We will find one environment to see why the unit test failed.

Thanks,
Simei

> 
> --
> David Marchand
  
David Marchand Jan. 20, 2023, 7:33 a.m. UTC | #3
On Mon, Jan 16, 2023 at 1:15 PM Su, Simei <simei.su@intel.com> wrote:
>
> Hi David,
>
> > -----Original Message-----
> > From: David Marchand <david.marchand@redhat.com>
> > Sent: Monday, January 16, 2023 7:19 PM
> > To: Su, Simei <simei.su@intel.com>
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> > <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> > stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> > Subject: Re: [PATCH] net/i40e: rework maximum frame size configuration
> >
> > On Mon, Jan 16, 2023 at 11:54 AM Simei Su <simei.su@intel.com> wrote:
> > >
> > > This patch removes unnecessary link status check.
> > >
> > > Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port
> > > level")
> > > Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port
> > > level")
> > > Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Simei Su <simei.su@intel.com>
> >
> > Thanks for looking into the issue.
> >
> > This is rather close to what I had tried [1] along my original report, but it failed
> > in the CI.
> > Let's see how the validation of your patch goes.
> >
> > 1:
> > https://patchwork.dpdk.org/project/dpdk/patch/20221212143715.29649-1-d
> > avid.marchand@redhat.com/
> >
>
> OK. We will find one environment to see why the unit test failed.

Any update?
  
Simei Su Jan. 20, 2023, 1:57 p.m. UTC | #4
Hi David,

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, January 20, 2023 3:34 PM
> To: Su, Simei <simei.su@intel.com>
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [PATCH] net/i40e: rework maximum frame size configuration
> 
> On Mon, Jan 16, 2023 at 1:15 PM Su, Simei <simei.su@intel.com> wrote:
> >
> > Hi David,
> >
> > > -----Original Message-----
> > > From: David Marchand <david.marchand@redhat.com>
> > > Sent: Monday, January 16, 2023 7:19 PM
> > > To: Su, Simei <simei.su@intel.com>
> > > Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> > > <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > > <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> > > stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> > > Subject: Re: [PATCH] net/i40e: rework maximum frame size
> > > configuration
> > >
> > > On Mon, Jan 16, 2023 at 11:54 AM Simei Su <simei.su@intel.com> wrote:
> > > >
> > > > This patch removes unnecessary link status check.
> > > >
> > > > Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port
> > > > level")
> > > > Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port
> > > > level")
> > > > Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")
> > > > Cc: stable@dpdk.org
> > > >
> > > > Signed-off-by: Simei Su <simei.su@intel.com>
> > >
> > > Thanks for looking into the issue.
> > >
> > > This is rather close to what I had tried [1] along my original
> > > report, but it failed in the CI.
> > > Let's see how the validation of your patch goes.
> > >
> > > 1:
> > >
> https://patchwork.dpdk.org/project/dpdk/patch/20221212143715.29649-1
> > > -d
> > > avid.marchand@redhat.com/
> > >
> >
> > OK. We will find one environment to see why the unit test failed.
> 
> Any update?

We can reproduce CI error, but "ifconfig interface up" needs to be done firstly
to reproduce it otherwise this error won't exist. The specific reason hasn't been
found currently. We will discuss it after Chinese New Year about how to handle it
more reasonably.

> 
> 
> --
> David Marchand
  
David Marchand Jan. 20, 2023, 2:46 p.m. UTC | #5
On Fri, Jan 20, 2023 at 2:58 PM Su, Simei <simei.su@intel.com> wrote:
>
> Hi David,
>
> > -----Original Message-----
> > From: David Marchand <david.marchand@redhat.com>
> > Sent: Friday, January 20, 2023 3:34 PM
> > To: Su, Simei <simei.su@intel.com>
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> > <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> > stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> > Subject: Re: [PATCH] net/i40e: rework maximum frame size configuration
> >
> > On Mon, Jan 16, 2023 at 1:15 PM Su, Simei <simei.su@intel.com> wrote:
> > >
> > > Hi David,
> > >
> > > > -----Original Message-----
> > > > From: David Marchand <david.marchand@redhat.com>
> > > > Sent: Monday, January 16, 2023 7:19 PM
> > > > To: Su, Simei <simei.su@intel.com>
> > > > Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> > > > <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > > > <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> > > > stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> > > > Subject: Re: [PATCH] net/i40e: rework maximum frame size
> > > > configuration
> > > >
> > > > On Mon, Jan 16, 2023 at 11:54 AM Simei Su <simei.su@intel.com> wrote:
> > > > >
> > > > > This patch removes unnecessary link status check.
> > > > >
> > > > > Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port
> > > > > level")
> > > > > Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port
> > > > > level")
> > > > > Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")
> > > > > Cc: stable@dpdk.org
> > > > >
> > > > > Signed-off-by: Simei Su <simei.su@intel.com>
> > > >
> > > > Thanks for looking into the issue.
> > > >
> > > > This is rather close to what I had tried [1] along my original
> > > > report, but it failed in the CI.
> > > > Let's see how the validation of your patch goes.
> > > >
> > > > 1:
> > > >
> > https://patchwork.dpdk.org/project/dpdk/patch/20221212143715.29649-1
> > > > -d
> > > > avid.marchand@redhat.com/
> > > >
> > >
> > > OK. We will find one environment to see why the unit test failed.
> >
> > Any update?
>
> We can reproduce CI error, but "ifconfig interface up" needs to be done firstly
> to reproduce it otherwise this error won't exist. The specific reason hasn't been
> found currently. We will discuss it after Chinese New Year about how to handle it
> more reasonably.

We have regressions in stable releases.
Please put priority when the team is back so that this topic is fixed in 23.03.


Thanks.
  
Simei Su Jan. 20, 2023, 3:37 p.m. UTC | #6
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, January 20, 2023 10:47 PM
> To: Su, Simei <simei.su@intel.com>
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>; Mcnamara, John
> <john.mcnamara@intel.com>
> Subject: Re: [PATCH] net/i40e: rework maximum frame size configuration
> 
> On Fri, Jan 20, 2023 at 2:58 PM Su, Simei <simei.su@intel.com> wrote:
> >
> > Hi David,
> >
> > > -----Original Message-----
> > > From: David Marchand <david.marchand@redhat.com>
> > > Sent: Friday, January 20, 2023 3:34 PM
> > > To: Su, Simei <simei.su@intel.com>
> > > Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> > > <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > > <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> > > stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> > > Subject: Re: [PATCH] net/i40e: rework maximum frame size
> > > configuration
> > >
> > > On Mon, Jan 16, 2023 at 1:15 PM Su, Simei <simei.su@intel.com> wrote:
> > > >
> > > > Hi David,
> > > >
> > > > > -----Original Message-----
> > > > > From: David Marchand <david.marchand@redhat.com>
> > > > > Sent: Monday, January 16, 2023 7:19 PM
> > > > > To: Su, Simei <simei.su@intel.com>
> > > > > Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> > > > > <yuying.zhang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > > > > <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>;
> > > > > stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> > > > > Subject: Re: [PATCH] net/i40e: rework maximum frame size
> > > > > configuration
> > > > >
> > > > > On Mon, Jan 16, 2023 at 11:54 AM Simei Su <simei.su@intel.com>
> wrote:
> > > > > >
> > > > > > This patch removes unnecessary link status check.
> > > > > >
> > > > > > Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at
> > > > > > port
> > > > > > level")
> > > > > > Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at
> > > > > > port
> > > > > > level")
> > > > > > Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")
> > > > > > Cc: stable@dpdk.org
> > > > > >
> > > > > > Signed-off-by: Simei Su <simei.su@intel.com>
> > > > >
> > > > > Thanks for looking into the issue.
> > > > >
> > > > > This is rather close to what I had tried [1] along my original
> > > > > report, but it failed in the CI.
> > > > > Let's see how the validation of your patch goes.
> > > > >
> > > > > 1:
> > > > >
> > >
> https://patchwork.dpdk.org/project/dpdk/patch/20221212143715.29649-1
> > > > > -d
> > > > > avid.marchand@redhat.com/
> > > > >
> > > >
> > > > OK. We will find one environment to see why the unit test failed.
> > >
> > > Any update?
> >
> > We can reproduce CI error, but "ifconfig interface up" needs to be
> > done firstly to reproduce it otherwise this error won't exist. The
> > specific reason hasn't been found currently. We will discuss it after
> > Chinese New Year about how to handle it more reasonably.
> 
> We have regressions in stable releases.
> Please put priority when the team is back so that this topic is fixed in 23.03.
> 
> 
> Thanks.
> 
> --
> David Marchand

Sorry for any inconvenience. OK, we will handle it as soon as possible when we are back
and fix it in 23.03.

Thanks,
Simei
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7726a89d..e21e4d9 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -387,7 +387,6 @@  static int i40e_set_default_mac_addr(struct rte_eth_dev *dev,
 				      struct rte_ether_addr *mac_addr);
 
 static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
-static void i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size);
 
 static int i40e_ethertype_filter_convert(
 	const struct rte_eth_ethertype_filter *input,
@@ -2467,8 +2466,16 @@  i40e_dev_start(struct rte_eth_dev *dev)
 			    "please call hierarchy_commit() "
 			    "before starting the port");
 
-	max_frame_size = dev->data->mtu + I40E_ETH_OVERHEAD;
-	i40e_set_mac_max_frame(dev, max_frame_size);
+	max_frame_size = dev->data->mtu ?
+		dev->data->mtu + I40E_ETH_OVERHEAD :
+		I40E_FRAME_SIZE_MAX;
+
+	/* Set the max frame size to HW*/
+	ret = i40e_aq_set_mac_config(hw, max_frame_size, TRUE, false, 0, NULL);
+	if (ret) {
+		PMD_DRV_LOG(ERR, "Fail to set mac config");
+		return ret;
+	}
 
 	return I40E_SUCCESS;
 
@@ -12123,40 +12130,6 @@  i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
 	return ret;
 }
 
-static void
-i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size)
-{
-	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t rep_cnt = MAX_REPEAT_TIME;
-	struct rte_eth_link link;
-	enum i40e_status_code status;
-	bool can_be_set = true;
-
-	/*
-	 * I40E_MEDIA_TYPE_BASET link up can be ignored
-	 * I40E_MEDIA_TYPE_BASET link down that hw->phy.media_type
-	 * is I40E_MEDIA_TYPE_UNKNOWN
-	 */
-	if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET &&
-	    hw->phy.media_type != I40E_MEDIA_TYPE_UNKNOWN) {
-		do {
-			update_link_reg(hw, &link);
-			if (link.link_status)
-				break;
-			rte_delay_ms(CHECK_INTERVAL);
-		} while (--rep_cnt);
-		can_be_set = !!link.link_status;
-	}
-
-	if (can_be_set) {
-		status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
-		if (status != I40E_SUCCESS)
-			PMD_DRV_LOG(ERR, "Failed to set max frame size at port level");
-	} else {
-		PMD_DRV_LOG(ERR, "Set max frame size at port level not applicable on link down");
-	}
-}
-
 RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE);
 RTE_LOG_REGISTER_SUFFIX(i40e_logtype_driver, driver, NOTICE);
 #ifdef RTE_ETHDEV_DEBUG_RX