All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17
@ 2021-06-17 17:01 Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 1/8] ice: fix incorrect payload indicator on PTYPE Tony Nguyen
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Tony Nguyen, netdev

This series contains updates to ice driver only.

Jake corrects a couple of entries in the PTYPE table to properly
reflect the datasheet and removes unneeded NULL checks for some
PTP calls.

Paul reduces the scope of variables and removes the use of a local
variable.

Shaokun Zhang removes a duplicate function declaration.

Lorenzo Bianconi fixes a compilation warning if PTP_1588_CLOCK is
disabled.

Colin Ian King changes a for loop to remove an unneeded 'continue'.

The following are changes since commit 0c33795231bff5df410bd405b569c66851e92d4b:
  Merge tag 'wireless-drivers-next-2021-06-16' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 100GbE

Colin Ian King (1):
  ice: remove redundant continue statement in a for-loop

Jacob Keller (3):
  ice: fix incorrect payload indicator on PTYPE
  ice: mark PTYPE 2 as reserved
  ice: remove unnecessary NULL checks before ptp_read_system_*

Lorenzo Bianconi (1):
  net: ice: ptp: fix compilation warning if PTP_1588_CLOCK is disabled

Paul M Stillwell Jr (2):
  ice: reduce scope of variables
  ice: remove local variable

Shaokun Zhang (1):
  ice: Remove the repeated declaration

 drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h |  4 ++--
 drivers/net/ethernet/intel/ice/ice_lib.c       |  8 ++++----
 drivers/net/ethernet/intel/ice/ice_main.c      |  7 +++----
 drivers/net/ethernet/intel/ice/ice_ptp.c       | 12 ++++--------
 drivers/net/ethernet/intel/ice/ice_ptp.h       |  2 +-
 drivers/net/ethernet/intel/ice/ice_ptp_hw.c    | 10 ++++------
 drivers/net/ethernet/intel/ice/ice_switch.h    |  1 -
 7 files changed, 18 insertions(+), 26 deletions(-)

-- 
2.26.2


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

* [PATCH net-next 1/8] ice: fix incorrect payload indicator on PTYPE
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
@ 2021-06-17 17:01 ` Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 2/8] ice: mark PTYPE 2 as reserved Tony Nguyen
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Jacob Keller, netdev, anthony.l.nguyen, Tony Brelinski

From: Jacob Keller <jacob.e.keller@intel.com>

The entry for PTYPE 90 indicates that the payload is layer 3. This does
not match the specification in the datasheet which indicates the packet
is a MAC, IPv6, UDP packet, with a payload in layer 4.

Fix the lookup table to match the data sheet.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
index 21329ed3087e..fc3b56c13786 100644
--- a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
+++ b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
@@ -744,7 +744,7 @@ static const struct ice_rx_ptype_decoded ice_ptype_lkup[] = {
 	/* Non Tunneled IPv6 */
 	ICE_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3),
 	ICE_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3),
-	ICE_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP,  PAY3),
+	ICE_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP,  PAY4),
 	ICE_PTT_UNUSED_ENTRY(91),
 	ICE_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP,  PAY4),
 	ICE_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4),
-- 
2.26.2


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

* [PATCH net-next 2/8] ice: mark PTYPE 2 as reserved
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 1/8] ice: fix incorrect payload indicator on PTYPE Tony Nguyen
@ 2021-06-17 17:01 ` Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 3/8] ice: reduce scope of variables Tony Nguyen
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Jacob Keller, netdev, anthony.l.nguyen, Tony Brelinski

From: Jacob Keller <jacob.e.keller@intel.com>

The entry for PTYPE 2 in the ice_ptype_lkup table incorrectly states
that this is an L2 packet with no payload. According to the datasheet,
this PTYPE is actually unused and reserved.

Fix the lookup entry to indicate this is an unused entry that is
reserved.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
index fc3b56c13786..4238ab0433ee 100644
--- a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
+++ b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
@@ -630,7 +630,7 @@ static const struct ice_rx_ptype_decoded ice_ptype_lkup[] = {
 	/* L2 Packet types */
 	ICE_PTT_UNUSED_ENTRY(0),
 	ICE_PTT(1, L2, NONE, NOF, NONE, NONE, NOF, NONE, PAY2),
-	ICE_PTT(2, L2, NONE, NOF, NONE, NONE, NOF, NONE, NONE),
+	ICE_PTT_UNUSED_ENTRY(2),
 	ICE_PTT_UNUSED_ENTRY(3),
 	ICE_PTT_UNUSED_ENTRY(4),
 	ICE_PTT_UNUSED_ENTRY(5),
-- 
2.26.2


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

* [PATCH net-next 3/8] ice: reduce scope of variables
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 1/8] ice: fix incorrect payload indicator on PTYPE Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 2/8] ice: mark PTYPE 2 as reserved Tony Nguyen
@ 2021-06-17 17:01 ` Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 4/8] ice: remove local variable Tony Nguyen
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Paul M Stillwell Jr, netdev, anthony.l.nguyen, Tony Brelinski

From: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>

There are some places where the scope of a variable can
be reduced so do that.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c  | 8 ++++----
 drivers/net/ethernet/intel/ice/ice_main.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index a46aba5e9c12..cb858be8f4de 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1205,11 +1205,11 @@ static int ice_vsi_setup_vector_base(struct ice_vsi *vsi)
 	num_q_vectors = vsi->num_q_vectors;
 	/* reserve slots from OS requested IRQs */
 	if (vsi->type == ICE_VSI_CTRL && vsi->vf_id != ICE_INVAL_VFID) {
-		struct ice_vf *vf;
 		int i;
 
 		ice_for_each_vf(pf, i) {
-			vf = &pf->vf[i];
+			struct ice_vf *vf = &pf->vf[i];
+
 			if (i != vsi->vf_id && vf->ctrl_vsi_idx != ICE_NO_VSI) {
 				base = pf->vsi[vf->ctrl_vsi_idx]->base_vector;
 				break;
@@ -2873,11 +2873,11 @@ int ice_vsi_release(struct ice_vsi *vsi)
 	 * cleared in the same manner.
 	 */
 	if (vsi->type == ICE_VSI_CTRL && vsi->vf_id != ICE_INVAL_VFID) {
-		struct ice_vf *vf;
 		int i;
 
 		ice_for_each_vf(pf, i) {
-			vf = &pf->vf[i];
+			struct ice_vf *vf = &pf->vf[i];
+
 			if (i != vsi->vf_id && vf->ctrl_vsi_idx != ICE_NO_VSI)
 				break;
 		}
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 96276533822e..dbf4a5493ea7 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5631,7 +5631,6 @@ ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi, struct ice_ring **rings,
 static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
 {
 	struct rtnl_link_stats64 *vsi_stats = &vsi->net_stats;
-	struct ice_ring *ring;
 	u64 pkts, bytes;
 	int i;
 
@@ -5655,7 +5654,8 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
 
 	/* update Rx rings counters */
 	ice_for_each_rxq(vsi, i) {
-		ring = READ_ONCE(vsi->rx_rings[i]);
+		struct ice_ring *ring = READ_ONCE(vsi->rx_rings[i]);
+
 		ice_fetch_u64_stats_per_ring(ring, &pkts, &bytes);
 		vsi_stats->rx_packets += pkts;
 		vsi_stats->rx_bytes += bytes;
-- 
2.26.2


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

* [PATCH net-next 4/8] ice: remove local variable
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
                   ` (2 preceding siblings ...)
  2021-06-17 17:01 ` [PATCH net-next 3/8] ice: reduce scope of variables Tony Nguyen
@ 2021-06-17 17:01 ` Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 5/8] ice: Remove the repeated declaration Tony Nguyen
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Paul M Stillwell Jr, netdev, anthony.l.nguyen, Tony Brelinski

From: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>

Remove the local variable since it's only used once. Instead, use it
directly.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index dbf4a5493ea7..5ca6c0356499 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -3078,7 +3078,6 @@ static void ice_set_netdev_features(struct net_device *netdev)
  */
 static int ice_cfg_netdev(struct ice_vsi *vsi)
 {
-	struct ice_pf *pf = vsi->back;
 	struct ice_netdev_priv *np;
 	struct net_device *netdev;
 	u8 mac_addr[ETH_ALEN];
@@ -3098,7 +3097,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
 	ice_set_ops(netdev);
 
 	if (vsi->type == ICE_VSI_PF) {
-		SET_NETDEV_DEV(netdev, ice_pf_to_dev(pf));
+		SET_NETDEV_DEV(netdev, ice_pf_to_dev(vsi->back));
 		ether_addr_copy(mac_addr, vsi->port_info->mac.perm_addr);
 		ether_addr_copy(netdev->dev_addr, mac_addr);
 		ether_addr_copy(netdev->perm_addr, mac_addr);
-- 
2.26.2


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

* [PATCH net-next 5/8] ice: Remove the repeated declaration
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
                   ` (3 preceding siblings ...)
  2021-06-17 17:01 ` [PATCH net-next 4/8] ice: remove local variable Tony Nguyen
@ 2021-06-17 17:01 ` Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 6/8] ice: remove unnecessary NULL checks before ptp_read_system_* Tony Nguyen
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Shaokun Zhang, netdev, anthony.l.nguyen, Jesse Brandeburg

From: Shaokun Zhang <zhangshaokun@hisilicon.com>

Function 'ice_is_vsi_valid' is declared twice, remove the
repeated declaration.

Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_switch.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_switch.h b/drivers/net/ethernet/intel/ice/ice_switch.h
index 6bb7358ff67b..c5db8d56133f 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.h
+++ b/drivers/net/ethernet/intel/ice/ice_switch.h
@@ -247,7 +247,6 @@ ice_set_vlan_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,
 
 enum ice_status ice_init_def_sw_recp(struct ice_hw *hw);
 u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle);
-bool ice_is_vsi_valid(struct ice_hw *hw, u16 vsi_handle);
 
 enum ice_status ice_replay_vsi_all_fltr(struct ice_hw *hw, u16 vsi_handle);
 void ice_rm_all_sw_replay_rule_info(struct ice_hw *hw);
-- 
2.26.2


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

* [PATCH net-next 6/8] ice: remove unnecessary NULL checks before ptp_read_system_*
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
                   ` (4 preceding siblings ...)
  2021-06-17 17:01 ` [PATCH net-next 5/8] ice: Remove the repeated declaration Tony Nguyen
@ 2021-06-17 17:01 ` Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 7/8] net: ice: ptp: fix compilation warning if PTP_1588_CLOCK is disabled Tony Nguyen
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Jacob Keller, netdev, anthony.l.nguyen

From: Jacob Keller <jacob.e.keller@intel.com>

The ptp_read_system_prets and ptp_read_system_postts functions already
check for the NULL value of the ptp_system_timestamp structure pointer.
There is no need to check this manually in the ice driver code. Remove
the checks.

Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index e14f81321768..609f433a4b96 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -219,14 +219,12 @@ ice_ptp_read_src_clk_reg(struct ice_pf *pf, struct ptp_system_timestamp *sts)
 
 	tmr_idx = ice_get_ptp_src_clock_index(hw);
 	/* Read the system timestamp pre PHC read */
-	if (sts)
-		ptp_read_system_prets(sts);
+	ptp_read_system_prets(sts);
 
 	lo = rd32(hw, GLTSYN_TIME_L(tmr_idx));
 
 	/* Read the system timestamp post PHC read */
-	if (sts)
-		ptp_read_system_postts(sts);
+	ptp_read_system_postts(sts);
 
 	hi = rd32(hw, GLTSYN_TIME_H(tmr_idx));
 	lo2 = rd32(hw, GLTSYN_TIME_L(tmr_idx));
@@ -235,11 +233,9 @@ ice_ptp_read_src_clk_reg(struct ice_pf *pf, struct ptp_system_timestamp *sts)
 		/* if TIME_L rolled over read TIME_L again and update
 		 * system timestamps
 		 */
-		if (sts)
-			ptp_read_system_prets(sts);
+		ptp_read_system_prets(sts);
 		lo = rd32(hw, GLTSYN_TIME_L(tmr_idx));
-		if (sts)
-			ptp_read_system_postts(sts);
+		ptp_read_system_postts(sts);
 		hi = rd32(hw, GLTSYN_TIME_H(tmr_idx));
 	}
 
-- 
2.26.2


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

* [PATCH net-next 7/8] net: ice: ptp: fix compilation warning if PTP_1588_CLOCK is disabled
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
                   ` (5 preceding siblings ...)
  2021-06-17 17:01 ` [PATCH net-next 6/8] ice: remove unnecessary NULL checks before ptp_read_system_* Tony Nguyen
@ 2021-06-17 17:01 ` Tony Nguyen
  2021-06-17 17:01 ` [PATCH net-next 8/8] ice: remove redundant continue statement in a for-loop Tony Nguyen
  2021-06-17 19:20 ` [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Lorenzo Bianconi, netdev, anthony.l.nguyen, Jacob Keller

From: Lorenzo Bianconi <lorenzo@kernel.org>

Fix the following compilation warning if PTP_1588_CLOCK is not enabled

drivers/net/ethernet/intel/ice/ice_ptp.h:149:1:
   error: return type defaults to ‘int’ [-Werror=return-type]
   ice_ptp_request_ts(struct ice_ptp_tx *tx, struct sk_buff *skb)

Fixes: ea9b847cda647 ("ice: enable transmit timestamps for E810 devices")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h
index 41e14f98f0e6..d01507eba036 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.h
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.h
@@ -145,7 +145,7 @@ static inline int ice_get_ptp_clock_index(struct ice_pf *pf)
 	return -1;
 }
 
-static inline
+static inline s8
 ice_ptp_request_ts(struct ice_ptp_tx *tx, struct sk_buff *skb)
 {
 	return -1;
-- 
2.26.2


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

* [PATCH net-next 8/8] ice: remove redundant continue statement in a for-loop
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
                   ` (6 preceding siblings ...)
  2021-06-17 17:01 ` [PATCH net-next 7/8] net: ice: ptp: fix compilation warning if PTP_1588_CLOCK is disabled Tony Nguyen
@ 2021-06-17 17:01 ` Tony Nguyen
  2021-06-17 19:20 ` [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2021-06-17 17:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: Colin Ian King, netdev, anthony.l.nguyen, Jacob Keller

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

The continue statement in the for-loop is redundant. Re-work the hw_lock
check to remove it.

Addresses-Coverity: ("Continue has no effect")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
index 267312fad59a..3eca0e4eab0b 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
@@ -410,13 +410,11 @@ bool ice_ptp_lock(struct ice_hw *hw)
 	for (i = 0; i < MAX_TRIES; i++) {
 		hw_lock = rd32(hw, PFTSYN_SEM + (PFTSYN_SEM_BYTES * hw->pf_id));
 		hw_lock = hw_lock & PFTSYN_SEM_BUSY_M;
-		if (hw_lock) {
-			/* Somebody is holding the lock */
-			usleep_range(10000, 20000);
-			continue;
-		} else {
+		if (!hw_lock)
 			break;
-		}
+
+		/* Somebody is holding the lock */
+		usleep_range(10000, 20000);
 	}
 
 	return !hw_lock;
-- 
2.26.2


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

* Re: [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17
  2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
                   ` (7 preceding siblings ...)
  2021-06-17 17:01 ` [PATCH net-next 8/8] ice: remove redundant continue statement in a for-loop Tony Nguyen
@ 2021-06-17 19:20 ` patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-17 19:20 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, netdev

Hello:

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

On Thu, 17 Jun 2021 10:01:37 -0700 you wrote:
> This series contains updates to ice driver only.
> 
> Jake corrects a couple of entries in the PTYPE table to properly
> reflect the datasheet and removes unneeded NULL checks for some
> PTP calls.
> 
> Paul reduces the scope of variables and removes the use of a local
> variable.
> 
> [...]

Here is the summary with links:
  - [net-next,1/8] ice: fix incorrect payload indicator on PTYPE
    https://git.kernel.org/netdev/net-next/c/638a0c8c8861
  - [net-next,2/8] ice: mark PTYPE 2 as reserved
    https://git.kernel.org/netdev/net-next/c/0c526d440f76
  - [net-next,3/8] ice: reduce scope of variables
    https://git.kernel.org/netdev/net-next/c/b6b0501d8d9a
  - [net-next,4/8] ice: remove local variable
    https://git.kernel.org/netdev/net-next/c/c73bf3bd83e8
  - [net-next,5/8] ice: Remove the repeated declaration
    https://git.kernel.org/netdev/net-next/c/b13ad3e08df7
  - [net-next,6/8] ice: remove unnecessary NULL checks before ptp_read_system_*
    https://git.kernel.org/netdev/net-next/c/1e00113413a4
  - [net-next,7/8] net: ice: ptp: fix compilation warning if PTP_1588_CLOCK is disabled
    https://git.kernel.org/netdev/net-next/c/4d7f75fe8006
  - [net-next,8/8] ice: remove redundant continue statement in a for-loop
    https://git.kernel.org/netdev/net-next/c/587b839de733

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] 10+ messages in thread

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 17:01 [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 Tony Nguyen
2021-06-17 17:01 ` [PATCH net-next 1/8] ice: fix incorrect payload indicator on PTYPE Tony Nguyen
2021-06-17 17:01 ` [PATCH net-next 2/8] ice: mark PTYPE 2 as reserved Tony Nguyen
2021-06-17 17:01 ` [PATCH net-next 3/8] ice: reduce scope of variables Tony Nguyen
2021-06-17 17:01 ` [PATCH net-next 4/8] ice: remove local variable Tony Nguyen
2021-06-17 17:01 ` [PATCH net-next 5/8] ice: Remove the repeated declaration Tony Nguyen
2021-06-17 17:01 ` [PATCH net-next 6/8] ice: remove unnecessary NULL checks before ptp_read_system_* Tony Nguyen
2021-06-17 17:01 ` [PATCH net-next 7/8] net: ice: ptp: fix compilation warning if PTP_1588_CLOCK is disabled Tony Nguyen
2021-06-17 17:01 ` [PATCH net-next 8/8] ice: remove redundant continue statement in a for-loop Tony Nguyen
2021-06-17 19:20 ` [PATCH net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2021-06-17 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.