netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11
@ 2018-05-11 19:47 Jeff Kirsher
  2018-05-11 19:47 ` [net 1/4] ice: Set rq_last_status when cleaning rq Jeff Kirsher
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jeff Kirsher @ 2018-05-11 19:47 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

This series contains fixes to the ice, ixgbe and ixgbevf drivers.

Jeff Shaw provides a fix to ensure rq_last_status gets set, whether or
not the hardware responds with an error in the ice driver.

Emil adds a check for unsupported module during the reset routine for
ixgbe.

Luc Van Oostenryck fixes ixgbevf_xmit_frame() where it was not using the
correct return value (int).

Colin Ian King fixes a potential resource leak in ixgbe, where we were
not freeing ipsec in our cleanup path.

The following are changes since commit 5ae4bbf76928b401fe467e837073d939300adbf0:
  Merge tag 'mlx5-fixes-2018-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue 10GbE

Colin Ian King (1):
  ixgbe: fix memory leak on ipsec allocation

Emil Tantilov (1):
  ixgbe: return error on unsupported SFP module when resetting

Jeff Shaw (1):
  ice: Set rq_last_status when cleaning rq

Luc Van Oostenryck (1):
  ixgbevf: fix ixgbevf_xmit_frame()'s return type

 drivers/net/ethernet/intel/ice/ice_controlq.c     | 2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c    | 2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c     | 3 +++
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

-- 
2.17.0

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

* [net 1/4] ice: Set rq_last_status when cleaning rq
  2018-05-11 19:47 [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 Jeff Kirsher
@ 2018-05-11 19:47 ` Jeff Kirsher
  2018-05-11 19:47 ` [net 2/4] ixgbe: return error on unsupported SFP module when resetting Jeff Kirsher
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2018-05-11 19:47 UTC (permalink / raw)
  To: davem
  Cc: Jeff Shaw, netdev, nhorman, sassmann, jogreene,
	Anirudh Venkataramanan, Jeff Kirsher

From: Jeff Shaw <jeffrey.b.shaw@intel.com>

Prior to this commit, the rq_last_status was only set when hardware
responded with an error. This leads to rq_last_status being invalid
in the future when hardware eventually responds without error. This
commit resolves the issue by unconditionally setting rq_last_status
with the value returned in the descriptor.

Fixes: 940b61af02f4 ("ice: Initialize PF and setup miscellaneous
interrupt")

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_controlq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_controlq.c b/drivers/net/ethernet/intel/ice/ice_controlq.c
index 5909a4407e38..7c511f144ed6 100644
--- a/drivers/net/ethernet/intel/ice/ice_controlq.c
+++ b/drivers/net/ethernet/intel/ice/ice_controlq.c
@@ -1014,10 +1014,10 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
 	desc = ICE_CTL_Q_DESC(cq->rq, ntc);
 	desc_idx = ntc;
 
+	cq->rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval);
 	flags = le16_to_cpu(desc->flags);
 	if (flags & ICE_AQ_FLAG_ERR) {
 		ret_code = ICE_ERR_AQ_ERROR;
-		cq->rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval);
 		ice_debug(hw, ICE_DBG_AQ_MSG,
 			  "Control Receive Queue Event received with error 0x%x\n",
 			  cq->rq_last_status);
-- 
2.17.0

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

* [net 2/4] ixgbe: return error on unsupported SFP module when resetting
  2018-05-11 19:47 [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 Jeff Kirsher
  2018-05-11 19:47 ` [net 1/4] ice: Set rq_last_status when cleaning rq Jeff Kirsher
@ 2018-05-11 19:47 ` Jeff Kirsher
  2018-05-11 19:47 ` [net 3/4] ixgbevf: fix ixgbevf_xmit_frame()'s return type Jeff Kirsher
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2018-05-11 19:47 UTC (permalink / raw)
  To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

Add check for unsupported module and return the error code.
This fixes a Coverity hit due to unused return status from setup_sfp.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index 3123267dfba9..9592f3e3e42e 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -3427,6 +3427,9 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
 		hw->phy.sfp_setup_needed = false;
 	}
 
+	if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
+		return status;
+
 	/* Reset PHY */
 	if (!hw->phy.reset_disable && hw->phy.ops.reset)
 		hw->phy.ops.reset(hw);
-- 
2.17.0

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

* [net 3/4] ixgbevf: fix ixgbevf_xmit_frame()'s return type
  2018-05-11 19:47 [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 Jeff Kirsher
  2018-05-11 19:47 ` [net 1/4] ice: Set rq_last_status when cleaning rq Jeff Kirsher
  2018-05-11 19:47 ` [net 2/4] ixgbe: return error on unsupported SFP module when resetting Jeff Kirsher
@ 2018-05-11 19:47 ` Jeff Kirsher
  2018-05-11 19:47 ` [net 4/4] ixgbe: fix memory leak on ipsec allocation Jeff Kirsher
  2018-05-11 19:57 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2018-05-11 19:47 UTC (permalink / raw)
  To: davem
  Cc: Luc Van Oostenryck, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index e3d04f226d57..850f8af95e49 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -4137,7 +4137,7 @@ static int ixgbevf_xmit_frame_ring(struct sk_buff *skb,
 	return NETDEV_TX_OK;
 }
 
-static int ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
+static netdev_tx_t ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 {
 	struct ixgbevf_adapter *adapter = netdev_priv(netdev);
 	struct ixgbevf_ring *tx_ring;
-- 
2.17.0

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

* [net 4/4] ixgbe: fix memory leak on ipsec allocation
  2018-05-11 19:47 [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2018-05-11 19:47 ` [net 3/4] ixgbevf: fix ixgbevf_xmit_frame()'s return type Jeff Kirsher
@ 2018-05-11 19:47 ` Jeff Kirsher
  2018-05-11 19:57 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2018-05-11 19:47 UTC (permalink / raw)
  To: davem; +Cc: Colin Ian King, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Colin Ian King <colin.king@canonical.com>

The error clean up path kfree's adapter->ipsec and should be
instead kfree'ing ipsec. Fix this.  Also, the err1 error exit path
does not need to kfree ipsec because this failure path was for
the failed allocation of ipsec.

Detected by CoverityScan, CID#146424 ("Resource Leak")

Fixes: 63a67fe229ea ("ixgbe: add ipsec offload add and remove SA")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
index 68af127987bc..cead23e3db0c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
@@ -943,8 +943,8 @@ void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter)
 	kfree(ipsec->ip_tbl);
 	kfree(ipsec->rx_tbl);
 	kfree(ipsec->tx_tbl);
+	kfree(ipsec);
 err1:
-	kfree(adapter->ipsec);
 	netdev_err(adapter->netdev, "Unable to allocate memory for SA tables");
 }
 
-- 
2.17.0

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

* Re: [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11
  2018-05-11 19:47 [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2018-05-11 19:47 ` [net 4/4] ixgbe: fix memory leak on ipsec allocation Jeff Kirsher
@ 2018-05-11 19:57 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-05-11 19:57 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 11 May 2018 12:47:18 -0700

> This series contains fixes to the ice, ixgbe and ixgbevf drivers.
 ...
> The following are changes since commit 5ae4bbf76928b401fe467e837073d939300adbf0:
>   Merge tag 'mlx5-fixes-2018-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
> and are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue 10GbE

Pulled, thanks Jeff.

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

end of thread, other threads:[~2018-05-11 19:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11 19:47 [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 Jeff Kirsher
2018-05-11 19:47 ` [net 1/4] ice: Set rq_last_status when cleaning rq Jeff Kirsher
2018-05-11 19:47 ` [net 2/4] ixgbe: return error on unsupported SFP module when resetting Jeff Kirsher
2018-05-11 19:47 ` [net 3/4] ixgbevf: fix ixgbevf_xmit_frame()'s return type Jeff Kirsher
2018-05-11 19:47 ` [net 4/4] ixgbe: fix memory leak on ipsec allocation Jeff Kirsher
2018-05-11 19:57 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2018-05-11 David Miller

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).