All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24
@ 2021-06-24 18:14 Tony Nguyen
  2021-06-24 18:14 ` [PATCH net 1/4] i40e: Fix error handling in i40e_vsi_open Tony Nguyen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-06-24 18:14 UTC (permalink / raw)
  To: davem, kuba; +Cc: Tony Nguyen, netdev, sassmann

This series contains updates to i40e driver only.

Dinghao Liu corrects error handling for failed i40e_vsi_request_irq()
call.

Mateusz allows for disabling of autonegotiation for all BaseT media.

Jesse corrects the multiplier being used on 5Gb speeds for PTP.

Jan adds locking in paths calling i40e_setup_pf_switch() that were
missing it.

The following are changes since commit c2f5c57d99debf471a1b263cdf227e55f1364e95:
  Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE

Dinghao Liu (1):
  i40e: Fix error handling in i40e_vsi_open

Jan Sokolowski (1):
  i40e: Fix missing rtnl locking when setting up pf switch

Jesse Brandeburg (1):
  i40e: fix PTP on 5Gb links

Mateusz Palczewski (1):
  i40e: Fix autoneg disabling for non-10GBaseT links

 drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  3 +--
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 17 +++++++++++++----
 drivers/net/ethernet/intel/i40e/i40e_ptp.c     |  8 ++++++--
 3 files changed, 20 insertions(+), 8 deletions(-)

-- 
2.26.2


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

* [PATCH net 1/4] i40e: Fix error handling in i40e_vsi_open
  2021-06-24 18:14 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 Tony Nguyen
@ 2021-06-24 18:14 ` Tony Nguyen
  2021-06-24 18:14 ` [PATCH net 2/4] i40e: Fix autoneg disabling for non-10GBaseT links Tony Nguyen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-06-24 18:14 UTC (permalink / raw)
  To: davem, kuba
  Cc: Dinghao Liu, netdev, anthony.l.nguyen, sassmann, Tony Brelinski

From: Dinghao Liu <dinghao.liu@zju.edu.cn>

When vsi->type == I40E_VSI_FDIR, we have caught the return value of
i40e_vsi_request_irq() but without further handling. Check and execute
memory clean on failure just like the other i40e_vsi_request_irq().

Fixes: 8a9eb7d3cbcab ("i40e: rework fdir setup and teardown")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 704e474879c5..526fa0a791ea 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8703,6 +8703,8 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
 			 dev_driver_string(&pf->pdev->dev),
 			 dev_name(&pf->pdev->dev));
 		err = i40e_vsi_request_irq(vsi, int_name);
+		if (err)
+			goto err_setup_rx;
 
 	} else {
 		err = -EINVAL;
-- 
2.26.2


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

* [PATCH net 2/4] i40e: Fix autoneg disabling for non-10GBaseT links
  2021-06-24 18:14 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 Tony Nguyen
  2021-06-24 18:14 ` [PATCH net 1/4] i40e: Fix error handling in i40e_vsi_open Tony Nguyen
@ 2021-06-24 18:14 ` Tony Nguyen
  2021-06-24 18:14 ` [PATCH net 3/4] i40e: fix PTP on 5Gb links Tony Nguyen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-06-24 18:14 UTC (permalink / raw)
  To: davem, kuba
  Cc: Mateusz Palczewski, netdev, anthony.l.nguyen, sassmann,
	Aleksandr Loktionov, Karen Sornek, Dawid Lukwinski,
	Tony Brelinski

From: Mateusz Palczewski <mateusz.palczewski@intel.com>

Disabling autonegotiation was allowed only for 10GBaseT PHY.
The condition was changed to check if link media type is BaseT.

Fixes: 3ce12ee9d8f9 ("i40e: Fix order of checks when enabling/disabling autoneg in ethtool")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Karen Sornek <karen.sornek@intel.com>
Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index ccd5b9486ea9..3e822bad4851 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1262,8 +1262,7 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
 			if (ethtool_link_ksettings_test_link_mode(&safe_ks,
 								  supported,
 								  Autoneg) &&
-			    hw->phy.link_info.phy_type !=
-			    I40E_PHY_TYPE_10GBASE_T) {
+			    hw->phy.media_type != I40E_MEDIA_TYPE_BASET) {
 				netdev_info(netdev, "Autoneg cannot be disabled on this phy\n");
 				err = -EINVAL;
 				goto done;
-- 
2.26.2


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

* [PATCH net 3/4] i40e: fix PTP on 5Gb links
  2021-06-24 18:14 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 Tony Nguyen
  2021-06-24 18:14 ` [PATCH net 1/4] i40e: Fix error handling in i40e_vsi_open Tony Nguyen
  2021-06-24 18:14 ` [PATCH net 2/4] i40e: Fix autoneg disabling for non-10GBaseT links Tony Nguyen
@ 2021-06-24 18:14 ` Tony Nguyen
  2021-06-24 18:14 ` [PATCH net 4/4] i40e: Fix missing rtnl locking when setting up pf switch Tony Nguyen
  2021-06-24 20:00 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-06-24 18:14 UTC (permalink / raw)
  To: davem, kuba
  Cc: Jesse Brandeburg, netdev, anthony.l.nguyen, sassmann, stable,
	Alex Sergeev, Tony Brelinski

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

As reported by Alex Sergeev, the i40e driver is incrementing the PTP
clock at 40Gb speeds when linked at 5Gb. Fix this bug by making
sure that the right multiplier is selected when linked at 5Gb.

Fixes: 3dbdd6c2f70a ("i40e: Add support for 5Gbps cards")
Cc: stable@vger.kernel.org
Reported-by: Alex Sergeev <asergeev@carbonrobotics.com>
Suggested-by: Alex Sergeev <asergeev@carbonrobotics.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ptp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index f1f6fc3744e9..7b971b205d36 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -11,13 +11,14 @@
  * operate with the nanosecond field directly without fear of overflow.
  *
  * Much like the 82599, the update period is dependent upon the link speed:
- * At 40Gb link or no link, the period is 1.6ns.
- * At 10Gb link, the period is multiplied by 2. (3.2ns)
+ * At 40Gb, 25Gb, or no link, the period is 1.6ns.
+ * At 10Gb or 5Gb link, the period is multiplied by 2. (3.2ns)
  * At 1Gb link, the period is multiplied by 20. (32ns)
  * 1588 functionality is not supported at 100Mbps.
  */
 #define I40E_PTP_40GB_INCVAL		0x0199999999ULL
 #define I40E_PTP_10GB_INCVAL_MULT	2
+#define I40E_PTP_5GB_INCVAL_MULT	2
 #define I40E_PTP_1GB_INCVAL_MULT	20
 
 #define I40E_PRTTSYN_CTL1_TSYNTYPE_V1  BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
@@ -465,6 +466,9 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
 	case I40E_LINK_SPEED_10GB:
 		mult = I40E_PTP_10GB_INCVAL_MULT;
 		break;
+	case I40E_LINK_SPEED_5GB:
+		mult = I40E_PTP_5GB_INCVAL_MULT;
+		break;
 	case I40E_LINK_SPEED_1GB:
 		mult = I40E_PTP_1GB_INCVAL_MULT;
 		break;
-- 
2.26.2


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

* [PATCH net 4/4] i40e: Fix missing rtnl locking when setting up pf switch
  2021-06-24 18:14 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 Tony Nguyen
                   ` (2 preceding siblings ...)
  2021-06-24 18:14 ` [PATCH net 3/4] i40e: fix PTP on 5Gb links Tony Nguyen
@ 2021-06-24 18:14 ` Tony Nguyen
  2021-06-24 20:00 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-06-24 18:14 UTC (permalink / raw)
  To: davem, kuba
  Cc: Jan Sokolowski, netdev, anthony.l.nguyen, sassmann,
	Mateusz Palczewski, Tony Brelinski

From: Jan Sokolowski <jan.sokolowski@intel.com>

A recent change that made i40e use new udp_tunnel infrastructure
uses a method that expects to be called under rtnl lock.

However, not all codepaths do the lock prior to calling
i40e_setup_pf_switch.

Fix that by adding additional rtnl locking and unlocking.

Fixes: 40a98cb6f01f ("i40e: convert to new udp_tunnel infrastructure")
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 526fa0a791ea..f9fe500d4ec4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -32,7 +32,7 @@ static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi);
 static void i40e_handle_reset_warning(struct i40e_pf *pf, bool lock_acquired);
 static int i40e_add_vsi(struct i40e_vsi *vsi);
 static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi);
-static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit);
+static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acquired);
 static int i40e_setup_misc_vector(struct i40e_pf *pf);
 static void i40e_determine_queue_usage(struct i40e_pf *pf);
 static int i40e_setup_pf_filter_control(struct i40e_pf *pf);
@@ -10571,7 +10571,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
 #endif /* CONFIG_I40E_DCB */
 	if (!lock_acquired)
 		rtnl_lock();
-	ret = i40e_setup_pf_switch(pf, reinit);
+	ret = i40e_setup_pf_switch(pf, reinit, true);
 	if (ret)
 		goto end_unlock;
 
@@ -14629,10 +14629,11 @@ int i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
  * i40e_setup_pf_switch - Setup the HW switch on startup or after reset
  * @pf: board private structure
  * @reinit: if the Main VSI needs to re-initialized.
+ * @lock_acquired: indicates whether or not the lock has been acquired
  *
  * Returns 0 on success, negative value on failure
  **/
-static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)
+static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acquired)
 {
 	u16 flags = 0;
 	int ret;
@@ -14734,9 +14735,15 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)
 
 	i40e_ptp_init(pf);
 
+	if (!lock_acquired)
+		rtnl_lock();
+
 	/* repopulate tunnel port filters */
 	udp_tunnel_nic_reset_ntf(pf->vsi[pf->lan_vsi]->netdev);
 
+	if (!lock_acquired)
+		rtnl_unlock();
+
 	return ret;
 }
 
@@ -15530,7 +15537,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
 	}
 #endif
-	err = i40e_setup_pf_switch(pf, false);
+	err = i40e_setup_pf_switch(pf, false, false);
 	if (err) {
 		dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err);
 		goto err_vsis;
-- 
2.26.2


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

* Re: [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24
  2021-06-24 18:14 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 Tony Nguyen
                   ` (3 preceding siblings ...)
  2021-06-24 18:14 ` [PATCH net 4/4] i40e: Fix missing rtnl locking when setting up pf switch Tony Nguyen
@ 2021-06-24 20:00 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-24 20:00 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, netdev, sassmann

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Thu, 24 Jun 2021 11:14:30 -0700 you wrote:
> This series contains updates to i40e driver only.
> 
> Dinghao Liu corrects error handling for failed i40e_vsi_request_irq()
> call.
> 
> Mateusz allows for disabling of autonegotiation for all BaseT media.
> 
> [...]

Here is the summary with links:
  - [net,1/4] i40e: Fix error handling in i40e_vsi_open
    https://git.kernel.org/netdev/net/c/9c04cfcd4aad
  - [net,2/4] i40e: Fix autoneg disabling for non-10GBaseT links
    https://git.kernel.org/netdev/net/c/9262793e59f0
  - [net,3/4] i40e: fix PTP on 5Gb links
    https://git.kernel.org/netdev/net/c/26b0ce8dd3dd
  - [net,4/4] i40e: Fix missing rtnl locking when setting up pf switch
    https://git.kernel.org/netdev/net/c/956e759d5f8e

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-06-24 20:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24 18:14 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 Tony Nguyen
2021-06-24 18:14 ` [PATCH net 1/4] i40e: Fix error handling in i40e_vsi_open Tony Nguyen
2021-06-24 18:14 ` [PATCH net 2/4] i40e: Fix autoneg disabling for non-10GBaseT links Tony Nguyen
2021-06-24 18:14 ` [PATCH net 3/4] i40e: fix PTP on 5Gb links Tony Nguyen
2021-06-24 18:14 ` [PATCH net 4/4] i40e: Fix missing rtnl locking when setting up pf switch Tony Nguyen
2021-06-24 20:00 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-06-24 patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.