diff mbox series

net/igc: fix speed configuration

Message ID 20210512082826.39680-1-alvinx.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers show
Series net/igc: fix speed configuration | expand

Checks

Context Check Description
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/github-robot success github build: passed
ci/checkpatch success coding style OK

Commit Message

Alvin Zhang May 12, 2021, 8:28 a.m. UTC
Fixed speed mode is not supported currently, this patch
removes configurations for this mode and adds fault handling
for ETH_LINK_SPEED_FIXED.

Fixes: 4f09bc55ac3d ("net/igc: implement device base operations")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/igc/igc_ethdev.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

Comments

Guo, Junfeng May 12, 2021, 9:20 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, AlvinX <alvinx.zhang@intel.com>
> Sent: Wednesday, May 12, 2021 17:16
> To: Guo, Junfeng <junfeng.guo@intel.com>
> Subject: [DPDK] net/igc: fix speed configuration
> 
> Fixed speed mode is not supported currently, this patch removes
> configurations for this mode and adds fault handling for
> ETH_LINK_SPEED_FIXED.
> 
> Fixes: 4f09bc55ac3d ("net/igc: implement device base operations")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>

Acked-by: Junfeng Guo < junfeng.guo@intel.com>

Regards,
Junfeng Guo
Zhang, Qi Z May 12, 2021, 10:36 a.m. UTC | #2
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guo, Junfeng
> Sent: Wednesday, May 12, 2021 5:20 PM
> To: dev@dpdk.org
> Cc: Zhang, AlvinX <alvinx.zhang@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>
> Subject: Re: [dpdk-dev] [DPDK] net/igc: fix speed configuration
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, AlvinX <alvinx.zhang@intel.com>
> > Sent: Wednesday, May 12, 2021 17:16
> > To: Guo, Junfeng <junfeng.guo@intel.com>
> > Subject: [DPDK] net/igc: fix speed configuration
> >
> > Fixed speed mode is not supported currently, this patch removes
> > configurations for this mode and adds fault handling for
> > ETH_LINK_SPEED_FIXED.
> >
> > Fixes: 4f09bc55ac3d ("net/igc: implement device base operations")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> 
> Acked-by: Junfeng Guo < junfeng.guo@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
> 
> Regards,
> Junfeng Guo
diff mbox series

Patch

diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c
index b1c58fb..224a095 100644
--- a/drivers/net/igc/igc_ethdev.c
+++ b/drivers/net/igc/igc_ethdev.c
@@ -989,15 +989,20 @@  static int eth_igc_vlan_tpid_set(struct rte_eth_dev *dev,
 		hw->mac.autoneg = 1;
 	} else {
 		int num_speeds = 0;
-		bool autoneg = (*speeds & ETH_LINK_SPEED_FIXED) == 0;
 
-		/* Reset */
+		if (*speeds & ETH_LINK_SPEED_FIXED) {
+			PMD_DRV_LOG(ERR,
+				    "Force speed mode currently not supported");
+			igc_dev_clear_queues(dev);
+			return -EINVAL;
+		}
+
 		hw->phy.autoneg_advertised = 0;
+		hw->mac.autoneg = 1;
 
 		if (*speeds & ~(ETH_LINK_SPEED_10M_HD | ETH_LINK_SPEED_10M |
 				ETH_LINK_SPEED_100M_HD | ETH_LINK_SPEED_100M |
-				ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G |
-				ETH_LINK_SPEED_FIXED)) {
+				ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G)) {
 			num_speeds = -1;
 			goto error_invalid_config;
 		}
@@ -1025,19 +1030,8 @@  static int eth_igc_vlan_tpid_set(struct rte_eth_dev *dev,
 			hw->phy.autoneg_advertised |= ADVERTISE_2500_FULL;
 			num_speeds++;
 		}
-		if (num_speeds == 0 || (!autoneg && num_speeds > 1))
+		if (num_speeds == 0)
 			goto error_invalid_config;
-
-		/* Set/reset the mac.autoneg based on the link speed,
-		 * fixed or not
-		 */
-		if (!autoneg) {
-			hw->mac.autoneg = 0;
-			hw->mac.forced_speed_duplex =
-					hw->phy.autoneg_advertised;
-		} else {
-			hw->mac.autoneg = 1;
-		}
 	}
 
 	igc_setup_link(hw);