All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-03-03
@ 2021-03-04  1:06 Tony Nguyen
  2021-03-04  1:06 ` [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init() Tony Nguyen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-03-04  1:06 UTC (permalink / raw)
  To: davem, kuba; +Cc: Tony Nguyen, netdev, sassmann

This series contains updates to ixgbe and ixgbevf drivers.

Bartosz Golaszewski does not error on -ENODEV from ixgbe_mii_bus_init()
as this is valid for some devices with a shared bus for ixgbe.

Antony Antony adds a check to fail for non transport mode SA with
offload as this is not supported for ixgbe and ixgbevf.

Dinghao Liu fixes a memory leak on failure to program a perfect filter
for ixgbe.

The following are changes since commit dbbe7c962c3a8163bf724dbc3c9fdfc9b16d3117:
  docs: networking: drop special stable handling
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 10GbE

Antony Antony (1):
  ixgbe: fail to create xfrm offload of IPsec tunnel mode SA

Bartosz Golaszewski (1):
  net: ethernet: ixgbe: don't propagate -ENODEV from
    ixgbe_mii_bus_init()

Dinghao Liu (1):
  ixgbe: Fix memleak in ixgbe_configure_clsu32

 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 5 +++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  | 8 +++++---
 drivers/net/ethernet/intel/ixgbevf/ipsec.c     | 5 +++++
 3 files changed, 15 insertions(+), 3 deletions(-)

-- 
2.26.2


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

* [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init()
  2021-03-04  1:06 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-03-03 Tony Nguyen
@ 2021-03-04  1:06 ` Tony Nguyen
  2021-03-04 18:50   ` Jakub Kicinski
  2021-03-04  1:06 ` [PATCH net 2/3] ixgbe: fail to create xfrm offload of IPsec tunnel mode SA Tony Nguyen
  2021-03-04  1:06 ` [PATCH net 3/3] ixgbe: Fix memleak in ixgbe_configure_clsu32 Tony Nguyen
  2 siblings, 1 reply; 6+ messages in thread
From: Tony Nguyen @ 2021-03-04  1:06 UTC (permalink / raw)
  To: davem, kuba
  Cc: Bartosz Golaszewski, netdev, sassmann, anthony.l.nguyen,
	Yongxin Liu, Tony Brelinski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

It's a valid use-case for ixgbe_mii_bus_init() to return -ENODEV - we
still want to finalize the registration of the ixgbe device. Check the
error code and don't bail out if err == -ENODEV.

This fixes an issue on C3000 family of SoCs where four ixgbe devices
share a single MDIO bus and ixgbe_mii_bus_init() returns -ENODEV for
three of them but we still want to register them.

Fixes: 09ef193fef7e ("net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()")
Reported-by: Yongxin Liu <yongxin.liu@windriver.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index fae84202d870..aa3b0a7ab786 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -11033,7 +11033,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			true);
 
 	err = ixgbe_mii_bus_init(hw);
-	if (err)
+	if (err && err != -ENODEV)
 		goto err_netdev;
 
 	return 0;
-- 
2.26.2


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

* [PATCH net 2/3] ixgbe: fail to create xfrm offload of IPsec tunnel mode SA
  2021-03-04  1:06 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-03-03 Tony Nguyen
  2021-03-04  1:06 ` [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init() Tony Nguyen
@ 2021-03-04  1:06 ` Tony Nguyen
  2021-03-04  1:06 ` [PATCH net 3/3] ixgbe: Fix memleak in ixgbe_configure_clsu32 Tony Nguyen
  2 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-03-04  1:06 UTC (permalink / raw)
  To: davem, kuba
  Cc: Antony Antony, netdev, sassmann, anthony.l.nguyen,
	Shannon Nelson, Tony Brelinski

From: Antony Antony <antony@phenome.org>

Based on talks and indirect references ixgbe IPsec offlod do not
support IPsec tunnel mode offload. It can only support IPsec transport
mode offload. Now explicitly fail when creating non transport mode SA
with offload to avoid false performance expectations.

Fixes: 63a67fe229ea ("ixgbe: add ipsec offload add and remove SA")
Signed-off-by: Antony Antony <antony@phenome.org>
Acked-by: Shannon Nelson <snelson@pensando.io>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 5 +++++
 drivers/net/ethernet/intel/ixgbevf/ipsec.c     | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
index eca73526ac86..54d47265a7ac 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
@@ -575,6 +575,11 @@ static int ixgbe_ipsec_add_sa(struct xfrm_state *xs)
 		return -EINVAL;
 	}
 
+	if (xs->props.mode != XFRM_MODE_TRANSPORT) {
+		netdev_err(dev, "Unsupported mode for ipsec offload\n");
+		return -EINVAL;
+	}
+
 	if (ixgbe_ipsec_check_mgmt_ip(xs)) {
 		netdev_err(dev, "IPsec IP addr clash with mgmt filters\n");
 		return -EINVAL;
diff --git a/drivers/net/ethernet/intel/ixgbevf/ipsec.c b/drivers/net/ethernet/intel/ixgbevf/ipsec.c
index 5170dd9d8705..caaea2c920a6 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ipsec.c
@@ -272,6 +272,11 @@ static int ixgbevf_ipsec_add_sa(struct xfrm_state *xs)
 		return -EINVAL;
 	}
 
+	if (xs->props.mode != XFRM_MODE_TRANSPORT) {
+		netdev_err(dev, "Unsupported mode for ipsec offload\n");
+		return -EINVAL;
+	}
+
 	if (xs->xso.flags & XFRM_OFFLOAD_INBOUND) {
 		struct rx_sa rsa;
 
-- 
2.26.2


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

* [PATCH net 3/3] ixgbe: Fix memleak in ixgbe_configure_clsu32
  2021-03-04  1:06 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-03-03 Tony Nguyen
  2021-03-04  1:06 ` [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init() Tony Nguyen
  2021-03-04  1:06 ` [PATCH net 2/3] ixgbe: fail to create xfrm offload of IPsec tunnel mode SA Tony Nguyen
@ 2021-03-04  1:06 ` Tony Nguyen
  2 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-03-04  1:06 UTC (permalink / raw)
  To: davem, kuba
  Cc: Dinghao Liu, netdev, sassmann, anthony.l.nguyen, Paul Menzel,
	Tony Brelinski

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

When ixgbe_fdir_write_perfect_filter_82599() fails,
input allocated by kzalloc() has not been freed,
which leads to memleak.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index aa3b0a7ab786..ae1837331a8f 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9565,8 +9565,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
 	ixgbe_atr_compute_perfect_hash_82599(&input->filter, mask);
 	err = ixgbe_fdir_write_perfect_filter_82599(hw, &input->filter,
 						    input->sw_idx, queue);
-	if (!err)
-		ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
+	if (err)
+		goto err_out_w_lock;
+
+	ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
 	spin_unlock(&adapter->fdir_perfect_lock);
 
 	if ((uhtid != 0x800) && (adapter->jump_tables[uhtid]))
-- 
2.26.2


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

* Re: [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init()
  2021-03-04  1:06 ` [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init() Tony Nguyen
@ 2021-03-04 18:50   ` Jakub Kicinski
  2021-03-04 19:00     ` Nguyen, Anthony L
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2021-03-04 18:50 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, Bartosz Golaszewski, netdev, sassmann, Yongxin Liu,
	Tony Brelinski

On Wed,  3 Mar 2021 17:06:47 -0800 Tony Nguyen wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> It's a valid use-case for ixgbe_mii_bus_init() to return -ENODEV - we
> still want to finalize the registration of the ixgbe device. Check the
> error code and don't bail out if err == -ENODEV.
> 
> This fixes an issue on C3000 family of SoCs where four ixgbe devices
> share a single MDIO bus and ixgbe_mii_bus_init() returns -ENODEV for
> three of them but we still want to register them.
> 
> Fixes: 09ef193fef7e ("net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()")
> Reported-by: Yongxin Liu <yongxin.liu@windriver.com>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

Are you sure this is not already fixed upstream by:

bd7f14df9492 ("ixgbe: fix probing of multi-port devices with one MDIO")

?

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

* Re: [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init()
  2021-03-04 18:50   ` Jakub Kicinski
@ 2021-03-04 19:00     ` Nguyen, Anthony L
  0 siblings, 0 replies; 6+ messages in thread
From: Nguyen, Anthony L @ 2021-03-04 19:00 UTC (permalink / raw)
  To: kuba; +Cc: davem, netdev, yongxin.liu, sassmann, Brelinski, TonyX, bgolaszewski

On Thu, 2021-03-04 at 10:50 -0800, Jakub Kicinski wrote:
> On Wed,  3 Mar 2021 17:06:47 -0800 Tony Nguyen wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > 
> > It's a valid use-case for ixgbe_mii_bus_init() to return -ENODEV -
> > we
> > still want to finalize the registration of the ixgbe device. Check
> > the
> > error code and don't bail out if err == -ENODEV.
> > 
> > This fixes an issue on C3000 family of SoCs where four ixgbe
> > devices
> > share a single MDIO bus and ixgbe_mii_bus_init() returns -ENODEV
> > for
> > three of them but we still want to register them.
> > 
> > Fixes: 09ef193fef7e ("net: ethernet: ixgbe: check the return value
> > of ixgbe_mii_bus_init()")
> > Reported-by: Yongxin Liu <yongxin.liu@windriver.com>
> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
> > Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> 
> Are you sure this is not already fixed upstream by:
> 
> bd7f14df9492 ("ixgbe: fix probing of multi-port devices with one
> MDIO")
> 
> ?

That looks to solve this issue. I'll drop this patch and resend the
series.

Thanks,
Tony

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

end of thread, other threads:[~2021-03-04 19:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04  1:06 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-03-03 Tony Nguyen
2021-03-04  1:06 ` [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init() Tony Nguyen
2021-03-04 18:50   ` Jakub Kicinski
2021-03-04 19:00     ` Nguyen, Anthony L
2021-03-04  1:06 ` [PATCH net 2/3] ixgbe: fail to create xfrm offload of IPsec tunnel mode SA Tony Nguyen
2021-03-04  1:06 ` [PATCH net 3/3] ixgbe: Fix memleak in ixgbe_configure_clsu32 Tony Nguyen

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.