All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions
@ 2021-05-06 15:39 Tony Nguyen
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 02/13] ice: add extack when unable to read device caps Tony Nguyen
                   ` (12 more replies)
  0 siblings, 13 replies; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:39 UTC (permalink / raw)
  To: intel-wired-lan

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

Trivial:
The driver had previously attempted to use #define
macros to make functions that have no use in certain
configs disappear. Using static inlines instead allows
for certain static checkers to process the code better,
and results in no functional change.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_arfs.h     | 12 +++++-----
 drivers/net/ethernet/intel/ice/ice_dcb_lib.h  | 15 +++++++------
 drivers/net/ethernet/intel/ice/ice_dcb_nl.h   |  9 ++++----
 .../net/ethernet/intel/ice/ice_virtchnl_pf.h  | 22 ++++++++++---------
 drivers/net/ethernet/intel/ice/ice_xsk.h      |  4 ++--
 5 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_arfs.h b/drivers/net/ethernet/intel/ice/ice_arfs.h
index f39cd16403ed..80ed76f0cace 100644
--- a/drivers/net/ethernet/intel/ice/ice_arfs.h
+++ b/drivers/net/ethernet/intel/ice/ice_arfs.h
@@ -52,12 +52,12 @@ bool
 ice_is_arfs_using_perfect_flow(struct ice_hw *hw,
 			       enum ice_fltr_ptype flow_type);
 #else
-#define ice_sync_arfs_fltrs(pf) do {} while (0)
-#define ice_init_arfs(vsi) do {} while (0)
-#define ice_clear_arfs(vsi) do {} while (0)
-#define ice_remove_arfs(pf) do {} while (0)
-#define ice_free_cpu_rx_rmap(vsi) do {} while (0)
-#define ice_rebuild_arfs(pf) do {} while (0)
+static inline void ice_clear_arfs(struct ice_vsi *vsi) { }
+static inline void ice_free_cpu_rx_rmap(struct ice_vsi *vsi) { }
+static inline void ice_init_arfs(struct ice_vsi *vsi) { }
+static inline void ice_sync_arfs_fltrs(struct ice_pf *pf) { }
+static inline void ice_remove_arfs(struct ice_pf *pf) { }
+static inline void ice_rebuild_arfs(struct ice_pf *pf) { }
 
 static inline int ice_set_cpu_rx_rmap(struct ice_vsi __always_unused *vsi)
 {
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h
index 35c21d9ae009..261b6e2ed7bc 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h
+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h
@@ -60,7 +60,7 @@ static inline bool ice_is_dcb_active(struct ice_pf *pf)
 		test_bit(ICE_FLAG_DCB_ENA, pf->flags));
 }
 #else
-#define ice_dcb_rebuild(pf) do {} while (0)
+static inline void ice_dcb_rebuild(struct ice_pf *pf) { }
 
 static inline u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg __always_unused *dcbcfg)
 {
@@ -113,11 +113,12 @@ ice_is_pfc_causing_hung_q(struct ice_pf __always_unused *pf,
 	return false;
 }
 
-#define ice_update_dcb_stats(pf) do {} while (0)
-#define ice_pf_dcb_recfg(pf) do {} while (0)
-#define ice_vsi_cfg_dcb_rings(vsi) do {} while (0)
-#define ice_dcb_process_lldp_set_mib_change(pf, event) do {} while (0)
-#define ice_set_cgd_num(tlan_ctx, ring) do {} while (0)
-#define ice_vsi_cfg_netdev_tc(vsi, ena_tc) do {} while (0)
+static inline void ice_pf_dcb_recfg(struct ice_pf *pf) { }
+static inline void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi) { }
+static inline void ice_update_dcb_stats(struct ice_pf *pf) { }
+static inline void
+ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf, struct ice_rq_event_info *event) { }
+static inline void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc) { }
+static inline void ice_set_cgd_num(struct ice_tlan_ctx *tlan_ctx, struct ice_ring *ring) { }
 #endif /* CONFIG_DCB */
 #endif /* _ICE_DCB_LIB_H_ */
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_nl.h b/drivers/net/ethernet/intel/ice/ice_dcb_nl.h
index 6c630a362293..eac2f34bdcdd 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb_nl.h
+++ b/drivers/net/ethernet/intel/ice/ice_dcb_nl.h
@@ -11,9 +11,10 @@ void
 ice_dcbnl_flush_apps(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,
 		     struct ice_dcbx_cfg *new_cfg);
 #else
-#define ice_dcbnl_setup(vsi) do {} while (0)
-#define ice_dcbnl_set_all(vsi) do {} while (0)
-#define ice_dcbnl_flush_apps(pf, old_cfg, new_cfg) do {} while (0)
+static inline void ice_dcbnl_setup(struct ice_vsi *vsi) { }
+static inline void ice_dcbnl_set_all(struct ice_vsi *vsi) { }
+static inline void
+ice_dcbnl_flush_apps(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,
+		     struct ice_dcbx_cfg *new_cfg) { }
 #endif /* CONFIG_DCB */
-
 #endif /* _ICE_DCB_NL_H_ */
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h
index 77ff0023f7be..842cb077df86 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h
@@ -158,16 +158,18 @@ ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,
 		      enum virtchnl_status_code v_retval, u8 *msg, u16 msglen);
 bool ice_vc_isvalid_vsi_id(struct ice_vf *vf, u16 vsi_id);
 #else /* CONFIG_PCI_IOV */
-#define ice_process_vflr_event(pf) do {} while (0)
-#define ice_free_vfs(pf) do {} while (0)
-#define ice_vc_process_vf_msg(pf, event) do {} while (0)
-#define ice_vc_notify_link_state(pf) do {} while (0)
-#define ice_vc_notify_reset(pf) do {} while (0)
-#define ice_set_vf_state_qs_dis(vf) do {} while (0)
-#define ice_vf_lan_overflow_event(pf, event) do {} while (0)
-#define ice_print_vfs_mdd_events(pf) do {} while (0)
-#define ice_print_vf_rx_mdd_event(vf) do {} while (0)
-#define ice_restore_all_vfs_msi_state(pdev) do {} while (0)
+static inline void ice_process_vflr_event(struct ice_pf *pf) { }
+static inline void ice_free_vfs(struct ice_pf *pf) { }
+static inline
+void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event) { }
+static inline void ice_vc_notify_link_state(struct ice_pf *pf) { }
+static inline void ice_vc_notify_reset(struct ice_pf *pf) { }
+static inline void ice_set_vf_state_qs_dis(struct ice_vf *vf) { }
+static inline
+void ice_vf_lan_overflow_event(struct ice_pf *pf, struct ice_rq_event_info *event) { }
+static inline void ice_print_vfs_mdd_events(struct ice_pf *pf) { }
+static inline void ice_print_vf_rx_mdd_event(struct ice_vf *vf) { }
+static inline void ice_restore_all_vfs_msi_state(struct pci_dev *pdev) { }
 
 static inline bool
 ice_is_malicious_vf(struct ice_pf __always_unused *pf,
diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.h b/drivers/net/ethernet/intel/ice/ice_xsk.h
index fad783690134..ea208808623a 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.h
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.h
@@ -60,7 +60,7 @@ ice_xsk_wakeup(struct net_device __always_unused *netdev,
 	return -EOPNOTSUPP;
 }
 
-#define ice_xsk_clean_rx_ring(rx_ring) do {} while (0)
-#define ice_xsk_clean_xdp_ring(xdp_ring) do {} while (0)
+static inline void ice_xsk_clean_rx_ring(struct ice_ring *rx_ring) { }
+static inline void ice_xsk_clean_xdp_ring(struct ice_ring *xdp_ring) { }
 #endif /* CONFIG_XDP_SOCKETS */
 #endif /* !_ICE_XSK_H_ */
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 02/13] ice: add extack when unable to read device caps
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
@ 2021-05-06 15:39 ` Tony Nguyen
  2021-05-12 15:48   ` Brelinski, TonyX
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 03/13] ice: add error message when pldmfw_flash_image fails Tony Nguyen
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:39 UTC (permalink / raw)
  To: intel-wired-lan

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

When filling out information for the DEVLINK_CMD_INFO_GET, the driver
needs to read some device capabilities. Add an extack message to
properly inform the caller of the failure, as we do for other failures
in this function.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_devlink.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
index ecefab6368f8..63a8718586b3 100644
--- a/drivers/net/ethernet/intel/ice/ice_devlink.c
+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
@@ -283,6 +283,9 @@ static int ice_devlink_info_get(struct devlink *devlink,
 	/* discover capabilities first */
 	status = ice_discover_dev_caps(hw, &ctx->dev_caps);
 	if (status) {
+		dev_dbg(dev, "Failed to discover device capabilities, status %s aq_err %s\n",
+			ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status));
+		NL_SET_ERR_MSG_MOD(extack, "Unable to discover device capabilities");
 		err = -EIO;
 		goto out_free_ctx;
 	}
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 03/13] ice: add error message when pldmfw_flash_image fails
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 02/13] ice: add extack when unable to read device caps Tony Nguyen
@ 2021-05-06 15:39 ` Tony Nguyen
  2021-05-19 21:34   ` Brelinski, TonyX
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 04/13] ice: wait for reset before reporting devlink info Tony Nguyen
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:39 UTC (permalink / raw)
  To: intel-wired-lan

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

When flashing a new firmware image onto the device, the pldmfw library
parses the image contents looking for a matching record. If no record
can be found, the function reports an error of -ENOENT. This can produce
a very confusing error message and experience for the user:

  $devlink dev flash pci/0000:ab:00.0 file image.bin
  devlink answers: No such file or directory

This is because the ENOENT error code is interpreted as a missing file
or directory. The pldmfw library does not have direct access to the
extack pointer as it is generic and non-netdevice specific. The only way
that ENOENT is returned by the pldmfw library is when no record matches.

Catch this specific error and report a suitable extended ack message:

  $devlink dev flash pci/0000:ab:00.0 file image.bin
  Error: ice: Firmware image has no record matching this device
  devlink answers: No such file or directory

In addition, ensure that we log an error message to the console whenever
this function fails. Because our driver specific PLDM operation
functions potentially set the extended ACK message, avoid overwriting
this with a generic message.

This change should result in an improved experience when attempting to
flash an image that does not have a compatible record.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_fw_update.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_fw_update.c b/drivers/net/ethernet/intel/ice/ice_fw_update.c
index dcec0360ce55..f8601d5b0b19 100644
--- a/drivers/net/ethernet/intel/ice/ice_fw_update.c
+++ b/drivers/net/ethernet/intel/ice/ice_fw_update.c
@@ -702,6 +702,16 @@ int ice_flash_pldm_image(struct ice_pf *pf, const struct firmware *fw,
 	}
 
 	err = pldmfw_flash_image(&priv.context, fw);
+	if (err == -ENOENT) {
+		dev_err(dev, "Firmware image has no record matching this device\n");
+		NL_SET_ERR_MSG_MOD(extack, "Firmware image has no record matching this device");
+	} else if (err) {
+		/* Do not set a generic extended ACK message here. A more
+		 * specific message may already have been set by one of our
+		 * ops.
+		 */
+		dev_err(dev, "Failed to flash PLDM image, err %d", err);
+	}
 
 	ice_release_nvm(hw);
 
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 04/13] ice: wait for reset before reporting devlink info
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 02/13] ice: add extack when unable to read device caps Tony Nguyen
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 03/13] ice: add error message when pldmfw_flash_image fails Tony Nguyen
@ 2021-05-06 15:39 ` Tony Nguyen
  2021-05-12 16:09   ` Brelinski, TonyX
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 05/13] ice: (re)initialize NVM fields when rebuilding Tony Nguyen
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:39 UTC (permalink / raw)
  To: intel-wired-lan

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

Requesting device firmware information while the device is busy cleaning
up after a reset can result in an unexpected failure:

This occurs because the command is attempting to access the device
AdminQ while it is down. Resolve this by having the command wait for
a while until the reset is complete. To do this, introduce
a reset_wait_queue and associated helper function "ice_wait_for_reset".

This helper will use the wait queue to sleep until the driver is done
rebuilding. Use of a wait queue is preferred because the potential sleep
duration can be several seconds.

To ensure that the thread wakes up properly, a new wake_up call is added
during all code paths which clear the reset state bits associated with
the driver rebuild flow.

Using this ensures that tools can request device information without
worrying about whether the driver is cleaning up from a reset.
Specifically, it is expected that a flash update could result in
a device reset, and it is better to delay the response for information
until the reset is complete rather than exit with an immediate failure.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/ice/ice.h         |  2 ++
 drivers/net/ethernet/intel/ice/ice_devlink.c |  6 +++++
 drivers/net/ethernet/intel/ice/ice_lib.c     | 28 ++++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_lib.h     |  1 +
 drivers/net/ethernet/intel/ice/ice_main.c    |  5 ++++
 5 files changed, 42 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index 3d672f92a2bc..f78466fa7150 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -443,6 +443,8 @@ struct ice_pf {
 	struct hlist_head aq_wait_list;
 	wait_queue_head_t aq_wait_queue;
 
+	wait_queue_head_t reset_wait_queue;
+
 	u32 hw_csum_rx_error;
 	u16 oicr_idx;		/* Other interrupt cause MSIX vector index */
 	u16 num_avail_sw_msix;	/* remaining MSIX SW vectors left unclaimed */
diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
index 63a8718586b3..364977ca7fe3 100644
--- a/drivers/net/ethernet/intel/ice/ice_devlink.c
+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
@@ -276,6 +276,12 @@ static int ice_devlink_info_get(struct devlink *devlink,
 	size_t i;
 	int err;
 
+	err = ice_wait_for_reset(pf, 10 * HZ);
+	if (err) {
+		NL_SET_ERR_MSG_MOD(extack, "Device is busy resetting");
+		return err;
+	}
+
 	ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 9b1d22f6a8eb..6ee1d1994a23 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -3219,6 +3219,34 @@ bool ice_is_reset_in_progress(unsigned long *state)
 	       test_bit(ICE_GLOBR_REQ, state);
 }
 
+/**
+ * ice_wait_for_reset - Wait for driver to finish reset and rebuild
+ * @pf: pointer to the PF structure
+ * @timeout: length of time to wait, in jiffies
+ *
+ * Wait (sleep) for a short time until the driver finishes cleaning up from
+ * a device reset. The caller must be able to sleep. Use this to delay
+ * operations that could fail while the driver is cleaning up after a device
+ * reset.
+ *
+ * Returns 0 on success, -EBUSY if the reset is not finished within the
+ * timeout, and -ERESTARTSYS if the thread was interrupted.
+ */
+int ice_wait_for_reset(struct ice_pf *pf, unsigned long timeout)
+{
+	long ret;
+
+	ret = wait_event_interruptible_timeout(pf->reset_wait_queue,
+					       !ice_is_reset_in_progress(pf->state),
+					       timeout);
+	if (ret < 0)
+		return ret;
+	else if (!ret)
+		return -EBUSY;
+	else
+		return 0;
+}
+
 #ifdef CONFIG_DCB
 /**
  * ice_vsi_update_q_map - update our copy of the VSI info with new queue map
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h
index e5c46213b0b1..35ccf3e2f721 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.h
+++ b/drivers/net/ethernet/intel/ice/ice_lib.h
@@ -77,6 +77,7 @@ ice_get_res(struct ice_pf *pf, struct ice_res_tracker *res, u16 needed, u16 id);
 int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi);
 
 bool ice_is_reset_in_progress(unsigned long *state);
+int ice_wait_for_reset(struct ice_pf *pf, unsigned long timeout);
 
 void
 ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio);
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index f033a4dbdaa6..9ae9197c12a9 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -514,6 +514,7 @@ static void ice_do_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
 		clear_bit(ICE_PFR_REQ, pf->state);
 		clear_bit(ICE_CORER_REQ, pf->state);
 		clear_bit(ICE_GLOBR_REQ, pf->state);
+		wake_up(&pf->reset_wait_queue);
 		return;
 	}
 
@@ -526,6 +527,7 @@ static void ice_do_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
 		ice_rebuild(pf, reset_type);
 		clear_bit(ICE_PREPARED_FOR_RESET, pf->state);
 		clear_bit(ICE_PFR_REQ, pf->state);
+		wake_up(&pf->reset_wait_queue);
 		ice_reset_all_vfs(pf, true);
 	}
 }
@@ -576,6 +578,7 @@ static void ice_reset_subtask(struct ice_pf *pf)
 			clear_bit(ICE_PFR_REQ, pf->state);
 			clear_bit(ICE_CORER_REQ, pf->state);
 			clear_bit(ICE_GLOBR_REQ, pf->state);
+			wake_up(&pf->reset_wait_queue);
 			ice_reset_all_vfs(pf, true);
 		}
 
@@ -3340,6 +3343,8 @@ static int ice_init_pf(struct ice_pf *pf)
 	spin_lock_init(&pf->aq_wait_lock);
 	init_waitqueue_head(&pf->aq_wait_queue);
 
+	init_waitqueue_head(&pf->reset_wait_queue);
+
 	/* setup service timer and periodic service task */
 	timer_setup(&pf->serv_tmr, ice_service_timer, 0);
 	pf->serv_tmr_period = HZ;
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 05/13] ice: (re)initialize NVM fields when rebuilding
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (2 preceding siblings ...)
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 04/13] ice: wait for reset before reporting devlink info Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-05-12 21:56   ` Brelinski, TonyX
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 06/13] ice: Detect and report unsupported module power levels Tony Nguyen
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

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

After performing a flash update, a device EMP reset may occur. This
reset will cause the newly downloaded firmware to be initialized. When
this happens, the driver still reports the previous NVM version
information.

This is because the NVM versions are cached within the hw structure.
This can be confusing, as the new firmware is in fact running in this
case.

Handle this by calling ice_init_nvm when rebuilding the driver state.
This will update the flash version information and ensures that the
current values are displayed when reporting the NVM versions to the
stack.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 9ae9197c12a9..a7c359335cb0 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -6151,6 +6151,12 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
 
 	ice_clear_pxe_mode(hw);
 
+	ret = ice_init_nvm(hw);
+	if (ret) {
+		dev_err(dev, "ice_init_nvm failed %s\n", ice_stat_str(ret));
+		goto err_init_ctrlq;
+	}
+
 	ret = ice_get_caps(hw);
 	if (ret) {
 		dev_err(dev, "ice_get_caps failed %s\n", ice_stat_str(ret));
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 06/13] ice: Detect and report unsupported module power levels
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (3 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 05/13] ice: (re)initialize NVM fields when rebuilding Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-05-19 21:35   ` Brelinski, TonyX
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 07/13] ice: Remove boolean vlan_promisc flag from function Tony Nguyen
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>

Determine whether an unsupported power configuration is preventing link
establishment by storing and checking the link_cfg_err_byte. Print error
messages when module power levels are unsupported. Also add a new flag
bit to prevent spamming said error messages.

Co-developed-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice.h          |  1 +
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  6 ++-
 drivers/net/ethernet/intel/ice/ice_common.c   |  2 +
 drivers/net/ethernet/intel/ice/ice_main.c     | 40 +++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_type.h     |  1 +
 5 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index f78466fa7150..a36e42a4348b 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -382,6 +382,7 @@ enum ice_pf_flags {
 	ICE_FLAG_TOTAL_PORT_SHUTDOWN_ENA,
 	ICE_FLAG_NO_MEDIA,
 	ICE_FLAG_FW_LLDP_AGENT,
+	ICE_FLAG_MOD_POWER_UNSUPPORTED,
 	ICE_FLAG_ETHTOOL_CTXT,		/* set when ethtool holds RTNL lock */
 	ICE_FLAG_LEGACY_RX,
 	ICE_FLAG_VF_TRUE_PROMISC_ENA,
diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
index 5cdfe406af84..e760f48ed07b 100644
--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
@@ -1122,7 +1122,9 @@ struct ice_aqc_get_link_status_data {
 #define ICE_AQ_LINK_TOPO_UNDRUTIL_PRT	BIT(5)
 #define ICE_AQ_LINK_TOPO_UNDRUTIL_MEDIA	BIT(6)
 #define ICE_AQ_LINK_TOPO_UNSUPP_MEDIA	BIT(7)
-	u8 reserved1;
+	u8 link_cfg_err;
+#define ICE_AQ_LINK_MODULE_POWER_UNSUPPORTED	BIT(5)
+#define ICE_AQ_LINK_INVAL_MAX_POWER_LIMIT	BIT(7)
 	u8 link_info;
 #define ICE_AQ_LINK_UP			BIT(0)	/* Link Status */
 #define ICE_AQ_LINK_FAULT		BIT(1)
@@ -1165,7 +1167,7 @@ struct ice_aqc_get_link_status_data {
 #define ICE_AQ_CFG_PACING_TYPE_FIXED	ICE_AQ_CFG_PACING_TYPE_M
 	/* External Device Power Ability */
 	u8 power_desc;
-#define ICE_AQ_PWR_CLASS_M		0x3
+#define ICE_AQ_PWR_CLASS_M		0x3F
 #define ICE_AQ_LINK_PWR_BASET_LOW_HIGH	0
 #define ICE_AQ_LINK_PWR_BASET_HIGH	1
 #define ICE_AQ_LINK_PWR_QSFP_CLASS_1	0
diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
index e93b1e40f627..a327371e78b4 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -424,6 +424,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,
 	li->phy_type_high = le64_to_cpu(link_data.phy_type_high);
 	*hw_media_type = ice_get_media_type(pi);
 	li->link_info = link_data.link_info;
+	li->link_cfg_err = link_data.link_cfg_err;
 	li->an_info = link_data.an_info;
 	li->ext_info = link_data.ext_info;
 	li->max_frame_size = le16_to_cpu(link_data.max_frame_size);
@@ -454,6 +455,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,
 		  (unsigned long long)li->phy_type_high);
 	ice_debug(hw, ICE_DBG_LINK, "	media_type = 0x%x\n", *hw_media_type);
 	ice_debug(hw, ICE_DBG_LINK, "	link_info = 0x%x\n", li->link_info);
+	ice_debug(hw, ICE_DBG_LINK, "	link_cfg_err = 0x%x\n", li->link_cfg_err);
 	ice_debug(hw, ICE_DBG_LINK, "	an_info = 0x%x\n", li->an_info);
 	ice_debug(hw, ICE_DBG_LINK, "	ext_info = 0x%x\n", li->ext_info);
 	ice_debug(hw, ICE_DBG_LINK, "	fec_info = 0x%x\n", li->fec_info);
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index a7c359335cb0..0bf3b9bd9ef8 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -875,6 +875,38 @@ static void ice_set_dflt_mib(struct ice_pf *pf)
 	kfree(lldpmib);
 }
 
+/**
+ * ice_check_module_power
+ * @pf: pointer to PF struct
+ * @link_cfg_err: bitmap from the link info structure
+ *
+ * check module power level returned by a previous call to aq_get_link_info
+ * and print error messages if module power level is not supported
+ */
+static void ice_check_module_power(struct ice_pf *pf, u8 link_cfg_err)
+{
+	/* if module power level is supported, clear the flag */
+	if (!(link_cfg_err & (ICE_AQ_LINK_INVAL_MAX_POWER_LIMIT |
+			      ICE_AQ_LINK_MODULE_POWER_UNSUPPORTED))) {
+		clear_bit(ICE_FLAG_MOD_POWER_UNSUPPORTED, pf->flags);
+		return;
+	}
+
+	/* if ICE_FLAG_MOD_POWER_UNSUPPORTED was previously set and the
+	 * above block didn't clear this bit, there's nothing to do
+	 */
+	if (test_bit(ICE_FLAG_MOD_POWER_UNSUPPORTED, pf->flags))
+		return;
+
+	if (link_cfg_err & ICE_AQ_LINK_INVAL_MAX_POWER_LIMIT) {
+		dev_err(ice_pf_to_dev(pf), "The installed module is incompatible with the device's NVM image. Cannot start link\n");
+		set_bit(ICE_FLAG_MOD_POWER_UNSUPPORTED, pf->flags);
+	} else if (link_cfg_err & ICE_AQ_LINK_MODULE_POWER_UNSUPPORTED) {
+		dev_err(ice_pf_to_dev(pf), "The module's power requirements exceed the device's power supply. Cannot start link\n");
+		set_bit(ICE_FLAG_MOD_POWER_UNSUPPORTED, pf->flags);
+	}
+}
+
 /**
  * ice_link_event - process the link event
  * @pf: PF that the link event is associated with
@@ -910,6 +942,8 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,
 			pi->lport, ice_stat_str(status),
 			ice_aq_str(pi->hw->adminq.sq_last_status));
 
+	ice_check_module_power(pf, pi->phy.link_info.link_cfg_err);
+
 	/* Check if the link state is up after updating link info, and treat
 	 * this event as an UP event since the link is actually UP now.
 	 */
@@ -2024,6 +2058,8 @@ static void ice_check_media_subtask(struct ice_pf *pf)
 	if (err)
 		return;
 
+	ice_check_module_power(pf, pi->phy.link_info.link_cfg_err);
+
 	if (pi->phy.link_info.link_info & ICE_AQ_MEDIA_AVAILABLE) {
 		if (!test_bit(ICE_PHY_INIT_COMPLETE, pf->state))
 			ice_init_phy_user_cfg(pi);
@@ -4225,6 +4261,8 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
 
 	ice_init_link_dflt_override(pf->hw.port_info);
 
+	ice_check_module_power(pf, pf->hw.port_info->phy.link_info.link_cfg_err);
+
 	/* if media available, initialize PHY settings */
 	if (pf->hw.port_info->phy.link_info.link_info &
 	    ICE_AQ_MEDIA_AVAILABLE) {
@@ -6847,6 +6885,8 @@ int ice_open_internal(struct net_device *netdev)
 		return -EIO;
 	}
 
+	ice_check_module_power(pf, pi->phy.link_info.link_cfg_err);
+
 	/* Set PHY if there is media, otherwise, turn off PHY */
 	if (pi->phy.link_info.link_info & ICE_AQ_MEDIA_AVAILABLE) {
 		clear_bit(ICE_FLAG_NO_MEDIA, pf->flags);
diff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h
index a925273c2cca..f322c8415a2c 100644
--- a/drivers/net/ethernet/intel/ice/ice_type.h
+++ b/drivers/net/ethernet/intel/ice/ice_type.h
@@ -146,6 +146,7 @@ struct ice_link_status {
 	u16 max_frame_size;
 	u16 link_speed;
 	u16 req_speeds;
+	u8 link_cfg_err;
 	u8 lse_ena;	/* Link Status Event notification */
 	u8 link_info;
 	u8 an_info;
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 07/13] ice: Remove boolean vlan_promisc flag from function
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (4 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 06/13] ice: Detect and report unsupported module power levels Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-10-29 20:57   ` Brelinski, Tony
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 08/13] ice: Fix replacing VF hardware MAC to existing MAC filter Tony Nguyen
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

From: Brett Creeley <brett.creeley@intel.com>

Currently, the vlan_promisc flag is used exclusively by VF VSI to
determine whether or not to toggle VLAN pruning along with
trusted/true-promiscuous mode. This is not needed for a couple of
reasons. First, trusted/true-promiscuous mode is only supposed to allow
all MAC filters within VLANs that a VF has added filters for, so VLAN
pruning should not be disabled. Second, the boolean argument makes the
function confusing and unintuitive. Remove this flag.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c         |  7 ++-----
 drivers/net/ethernet/intel/ice/ice_lib.h         |  2 +-
 drivers/net/ethernet/intel/ice/ice_main.c        | 12 ++++++------
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c |  9 ++++++---
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 6ee1d1994a23..20daa8c8fb07 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -2102,11 +2102,10 @@ bool ice_vsi_is_vlan_pruning_ena(struct ice_vsi *vsi)
  * ice_cfg_vlan_pruning - enable or disable VLAN pruning on the VSI
  * @vsi: VSI to enable or disable VLAN pruning on
  * @ena: set to true to enable VLAN pruning and false to disable it
- * @vlan_promisc: enable valid security flags if not in VLAN promiscuous mode
  *
  * returns 0 if VSI is updated, negative otherwise
  */
-int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc)
+int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena)
 {
 	struct ice_vsi_ctx *ctxt;
 	struct ice_pf *pf;
@@ -2134,9 +2133,7 @@ int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc)
 	else
 		ctxt->info.sw_flags2 &= ~ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA;
 
-	if (!vlan_promisc)
-		ctxt->info.valid_sections =
-			cpu_to_le16(ICE_AQ_VSI_PROP_SW_VALID);
+	ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_SW_VALID);
 
 	status = ice_update_vsi(&pf->hw, vsi->idx, ctxt, NULL);
 	if (status) {
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h
index 35ccf3e2f721..7eb0f879067e 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.h
+++ b/drivers/net/ethernet/intel/ice/ice_lib.h
@@ -45,7 +45,7 @@ int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi);
 
 bool ice_vsi_is_vlan_pruning_ena(struct ice_vsi *vsi);
 
-int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc);
+int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena);
 
 void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create);
 
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 0bf3b9bd9ef8..eaebffdb6257 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -378,7 +378,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
 						~IFF_PROMISC;
 					goto out_promisc;
 				}
-				ice_cfg_vlan_pruning(vsi, false, false);
+				ice_cfg_vlan_pruning(vsi, false);
 			}
 		} else {
 			/* Clear Rx filter to remove traffic from wire */
@@ -392,7 +392,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
 					goto out_promisc;
 				}
 				if (vsi->num_vlan > 1)
-					ice_cfg_vlan_pruning(vsi, true, false);
+					ice_cfg_vlan_pruning(vsi, true);
 			}
 		}
 	}
@@ -3144,7 +3144,7 @@ ice_vlan_rx_add_vid(struct net_device *netdev, __always_unused __be16 proto,
 
 	/* Enable VLAN pruning when a VLAN other than 0 is added */
 	if (!ice_vsi_is_vlan_pruning_ena(vsi)) {
-		ret = ice_cfg_vlan_pruning(vsi, true, false);
+		ret = ice_cfg_vlan_pruning(vsi, true);
 		if (ret)
 			return ret;
 	}
@@ -3188,7 +3188,7 @@ ice_vlan_rx_kill_vid(struct net_device *netdev, __always_unused __be16 proto,
 
 	/* Disable pruning when VLAN 0 is the only VLAN rule */
 	if (vsi->num_vlan == 1 && ice_vsi_is_vlan_pruning_ena(vsi))
-		ret = ice_cfg_vlan_pruning(vsi, false, false);
+		ret = ice_cfg_vlan_pruning(vsi, false);
 
 	set_bit(ICE_VSI_VLAN_FLTR_CHANGED, vsi->state);
 	return ret;
@@ -5199,10 +5199,10 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)
 
 	if ((features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
 	    !(netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
-		ret = ice_cfg_vlan_pruning(vsi, true, false);
+		ret = ice_cfg_vlan_pruning(vsi, true);
 	else if (!(features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
 		 (netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
-		ret = ice_cfg_vlan_pruning(vsi, false, false);
+		ret = ice_cfg_vlan_pruning(vsi, false);
 
 	if ((features & NETIF_F_NTUPLE) &&
 	    !(netdev->features & NETIF_F_NTUPLE)) {
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index fa038834cc29..3c9bff68b05e 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -2971,7 +2971,10 @@ static int ice_vc_cfg_promiscuous_mode_msg(struct ice_vf *vf, u8 *msg)
 	rm_promisc = !allmulti && !alluni;
 
 	if (vsi->num_vlan || vf->port_vlan_info) {
-		ret = ice_cfg_vlan_pruning(vsi, true, !rm_promisc);
+		if (rm_promisc)
+			ret = ice_cfg_vlan_pruning(vsi, true);
+		else
+			ret = ice_cfg_vlan_pruning(vsi, false);
 		if (ret) {
 			dev_err(dev, "Failed to configure VLAN pruning in promiscuous mode\n");
 			v_ret = VIRTCHNL_STATUS_ERR_PARAM;
@@ -4161,7 +4164,7 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)
 			/* Enable VLAN pruning when non-zero VLAN is added */
 			if (!vlan_promisc && vid &&
 			    !ice_vsi_is_vlan_pruning_ena(vsi)) {
-				status = ice_cfg_vlan_pruning(vsi, true, false);
+				status = ice_cfg_vlan_pruning(vsi, true);
 				if (status) {
 					v_ret = VIRTCHNL_STATUS_ERR_PARAM;
 					dev_err(dev, "Enable VLAN pruning on VLAN ID: %d failed error-%d\n",
@@ -4215,7 +4218,7 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)
 			/* Disable VLAN pruning when only VLAN 0 is left */
 			if (vsi->num_vlan == 1 &&
 			    ice_vsi_is_vlan_pruning_ena(vsi))
-				ice_cfg_vlan_pruning(vsi, false, false);
+				ice_cfg_vlan_pruning(vsi, false);
 
 			/* Disable Unicast/Multicast VLAN promiscuous mode */
 			if (vlan_promisc) {
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 08/13] ice: Fix replacing VF hardware MAC to existing MAC filter
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (5 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 07/13] ice: Remove boolean vlan_promisc flag from function Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-10-29 20:57   ` Brelinski, Tony
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 09/13] ice: fix incorrect payload indicator on PTYPE Tony Nguyen
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

From: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>

VF was not able to change its hardware MAC address in case
the new address was already present in the MAC filter list.
Change the handling of VF add mac request to not return
if requested MAC address is already present on the list
and check if its hardware MAC needs to be updated in this case.

Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index 3c9bff68b05e..ef00f3e6522f 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -3719,6 +3719,7 @@ ice_vc_add_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi,
 	struct device *dev = ice_pf_to_dev(vf->pf);
 	u8 *mac_addr = vc_ether_addr->addr;
 	enum ice_status status;
+	int ret = 0;
 
 	/* device MAC already added */
 	if (ether_addr_equal(mac_addr, vf->dev_lan_addr.addr))
@@ -3731,20 +3732,23 @@ ice_vc_add_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi,
 
 	status = ice_fltr_add_mac(vsi, mac_addr, ICE_FWD_TO_VSI);
 	if (status == ICE_ERR_ALREADY_EXISTS) {
-		dev_err(dev, "MAC %pM already exists for VF %d\n", mac_addr,
+		dev_dbg(dev, "MAC %pM already exists for VF %d\n", mac_addr,
 			vf->vf_id);
-		return -EEXIST;
+		/* don't return since we might need to update
+		 * the primary MAC in ice_vfhw_mac_add() below
+		 */
+		ret = -EEXIST;
 	} else if (status) {
 		dev_err(dev, "Failed to add MAC %pM for VF %d\n, error %s\n",
 			mac_addr, vf->vf_id, ice_stat_str(status));
 		return -EIO;
+	} else {
+		vf->num_mac++;
 	}
 
 	ice_vfhw_mac_add(vf, vc_ether_addr);
 
-	vf->num_mac++;
-
-	return 0;
+	return ret;
 }
 
 /**
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 09/13] ice: fix incorrect payload indicator on PTYPE
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (6 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 08/13] ice: Fix replacing VF hardware MAC to existing MAC filter Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-05-12 22:01   ` Brelinski, TonyX
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 10/13] ice: mark PTYPE 2 as reserved Tony Nguyen
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

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>
---
 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 2bf4c9605db1..72334a2de64f 100644
--- a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
+++ b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
@@ -766,7 +766,7 @@ static const struct ice_rx_ptype_decoded ice_ptype_lkup[BIT(10)] = {
 	/* 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.20.1


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

* [Intel-wired-lan] [PATCH S59 10/13] ice: mark PTYPE 2 as reserved
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (7 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 09/13] ice: fix incorrect payload indicator on PTYPE Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-05-12 22:01   ` Brelinski, TonyX
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 11/13] ice: downgrade error print to debug print Tony Nguyen
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

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>
---
 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 72334a2de64f..80736e0ec0dc 100644
--- a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
+++ b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
@@ -652,7 +652,7 @@ static const struct ice_rx_ptype_decoded ice_ptype_lkup[BIT(10)] = {
 	/* 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.20.1


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

* [Intel-wired-lan] [PATCH S59 11/13] ice: downgrade error print to debug print
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (8 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 10/13] ice: mark PTYPE 2 as reserved Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-05-12 22:02   ` Brelinski, TonyX
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 12/13] ice: reduce scope of variables Tony Nguyen
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>

Failing to add or remove LLDP filter doesn't seem to be a fatal
error, so downgrade the dev_err message to a dev_dbg message.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 20daa8c8fb07..3291fe194ba1 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -2237,7 +2237,7 @@ void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create)
 	}
 
 	if (status)
-		dev_err(dev, "Fail %s %s LLDP rule on VSI %i error: %s\n",
+		dev_dbg(dev, "Fail %s %s LLDP rule on VSI %i error: %s\n",
 			create ? "adding" : "removing", tx ? "TX" : "RX",
 			vsi->vsi_num, ice_stat_str(status));
 }
-- 
2.20.1


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

* [Intel-wired-lan] [PATCH S59 12/13] ice: reduce scope of variables
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (9 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 11/13] ice: downgrade error print to debug print Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-05-12 22:04   ` Brelinski, TonyX
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 13/13] ice: remove local variable Tony Nguyen
  2021-05-12 15:46 ` [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Brelinski, TonyX
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

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>
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 3291fe194ba1..454432ed7a3f 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1194,11 +1194,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;
@@ -2852,11 +2852,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 eaebffdb6257..0034bbe9c9b3 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5498,7 +5498,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;
 
@@ -5522,7 +5521,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.20.1


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

* [Intel-wired-lan] [PATCH S59 13/13] ice: remove local variable
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (10 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 12/13] ice: reduce scope of variables Tony Nguyen
@ 2021-05-06 15:40 ` Tony Nguyen
  2021-05-12 22:05   ` Brelinski, TonyX
  2021-05-12 15:46 ` [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Brelinski, TonyX
  12 siblings, 1 reply; 26+ messages in thread
From: Tony Nguyen @ 2021-05-06 15:40 UTC (permalink / raw)
  To: intel-wired-lan

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>
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 0034bbe9c9b3..101fa9d06477 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -3026,7 +3026,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];
@@ -3046,7 +3045,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.20.1


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

* [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions
  2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
                   ` (11 preceding siblings ...)
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 13/13] ice: remove local variable Tony Nguyen
@ 2021-05-12 15:46 ` Brelinski, TonyX
  12 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 15:46 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy
> functions
> 
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
> 
> Trivial:
> The driver had previously attempted to use #define macros to make
> functions that have no use in certain configs disappear. Using static inlines
> instead allows for certain static checkers to process the code better, and
> results in no functional change.
> 
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_arfs.h     | 12 +++++-----
>  drivers/net/ethernet/intel/ice/ice_dcb_lib.h  | 15 +++++++------
>  drivers/net/ethernet/intel/ice/ice_dcb_nl.h   |  9 ++++----
>  .../net/ethernet/intel/ice/ice_virtchnl_pf.h  | 22 ++++++++++---------
>  drivers/net/ethernet/intel/ice/ice_xsk.h      |  4 ++--
>  5 files changed, 33 insertions(+), 29 deletions(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 02/13] ice: add extack when unable to read device caps
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 02/13] ice: add extack when unable to read device caps Tony Nguyen
@ 2021-05-12 15:48   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 15:48 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 02/13] ice: add extack when unable to
> read device caps
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> When filling out information for the DEVLINK_CMD_INFO_GET, the driver
> needs to read some device capabilities. Add an extack message to properly
> inform the caller of the failure, as we do for other failures in this function.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_devlink.c | 3 +++
>  1 file changed, 3 insertions(+)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 04/13] ice: wait for reset before reporting devlink info
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 04/13] ice: wait for reset before reporting devlink info Tony Nguyen
@ 2021-05-12 16:09   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 16:09 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 04/13] ice: wait for reset before
> reporting devlink info
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> Requesting device firmware information while the device is busy cleaning up
> after a reset can result in an unexpected failure:
> 
> This occurs because the command is attempting to access the device AdminQ
> while it is down. Resolve this by having the command wait for a while until
> the reset is complete. To do this, introduce a reset_wait_queue and
> associated helper function "ice_wait_for_reset".
> 
> This helper will use the wait queue to sleep until the driver is done
> rebuilding. Use of a wait queue is preferred because the potential sleep
> duration can be several seconds.
> 
> To ensure that the thread wakes up properly, a new wake_up call is added
> during all code paths which clear the reset state bits associated with the
> driver rebuild flow.
> 
> Using this ensures that tools can request device information without
> worrying about whether the driver is cleaning up from a reset.
> Specifically, it is expected that a flash update could result in a device reset,
> and it is better to delay the response for information until the reset is
> complete rather than exit with an immediate failure.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice.h         |  2 ++
>  drivers/net/ethernet/intel/ice/ice_devlink.c |  6 +++++
>  drivers/net/ethernet/intel/ice/ice_lib.c     | 28 ++++++++++++++++++++
>  drivers/net/ethernet/intel/ice/ice_lib.h     |  1 +
>  drivers/net/ethernet/intel/ice/ice_main.c    |  5 ++++
>  5 files changed, 42 insertions(+)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 05/13] ice: (re)initialize NVM fields when rebuilding
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 05/13] ice: (re)initialize NVM fields when rebuilding Tony Nguyen
@ 2021-05-12 21:56   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 21:56 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 05/13] ice: (re)initialize NVM fields
> when rebuilding
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> After performing a flash update, a device EMP reset may occur. This reset will
> cause the newly downloaded firmware to be initialized. When this happens,
> the driver still reports the previous NVM version information.
> 
> This is because the NVM versions are cached within the hw structure.
> This can be confusing, as the new firmware is in fact running in this case.
> 
> Handle this by calling ice_init_nvm when rebuilding the driver state.
> This will update the flash version information and ensures that the current
> values are displayed when reporting the NVM versions to the stack.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)


 


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

* [Intel-wired-lan] [PATCH S59 09/13] ice: fix incorrect payload indicator on PTYPE
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 09/13] ice: fix incorrect payload indicator on PTYPE Tony Nguyen
@ 2021-05-12 22:01   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 22:01 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 09/13] ice: fix incorrect payload
> indicator on PTYPE
> 
> 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>
> ---
>  drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 10/13] ice: mark PTYPE 2 as reserved
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 10/13] ice: mark PTYPE 2 as reserved Tony Nguyen
@ 2021-05-12 22:01   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 22:01 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 10/13] ice: mark PTYPE 2 as reserved
> 
> 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>
> ---
>  drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 11/13] ice: downgrade error print to debug print
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 11/13] ice: downgrade error print to debug print Tony Nguyen
@ 2021-05-12 22:02   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 22:02 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 11/13] ice: downgrade error print to
> debug print
> 
> From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
> 
> Failing to add or remove LLDP filter doesn't seem to be a fatal error, so
> downgrade the dev_err message to a dev_dbg message.
> 
> Signed-off-by: Anirudh Venkataramanan
> <anirudh.venkataramanan@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_lib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 12/13] ice: reduce scope of variables
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 12/13] ice: reduce scope of variables Tony Nguyen
@ 2021-05-12 22:04   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 22:04 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 12/13] ice: reduce scope of variables
> 
> 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>
> 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(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 13/13] ice: remove local variable
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 13/13] ice: remove local variable Tony Nguyen
@ 2021-05-12 22:05   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-12 22:05 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 13/13] ice: remove local variable
> 
> 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>
> 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(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 03/13] ice: add error message when pldmfw_flash_image fails
  2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 03/13] ice: add error message when pldmfw_flash_image fails Tony Nguyen
@ 2021-05-19 21:34   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-19 21:34 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 03/13] ice: add error message when
> pldmfw_flash_image fails
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> When flashing a new firmware image onto the device, the pldmfw library
> parses the image contents looking for a matching record. If no record can be
> found, the function reports an error of -ENOENT. This can produce a very
> confusing error message and experience for the user:
> 
>   $devlink dev flash pci/0000:ab:00.0 file image.bin
>   devlink answers: No such file or directory
> 
> This is because the ENOENT error code is interpreted as a missing file or
> directory. The pldmfw library does not have direct access to the extack
> pointer as it is generic and non-netdevice specific. The only way that ENOENT
> is returned by the pldmfw library is when no record matches.
> 
> Catch this specific error and report a suitable extended ack message:
> 
>   $devlink dev flash pci/0000:ab:00.0 file image.bin
>   Error: ice: Firmware image has no record matching this device
>   devlink answers: No such file or directory
> 
> In addition, ensure that we log an error message to the console whenever
> this function fails. Because our driver specific PLDM operation functions
> potentially set the extended ACK message, avoid overwriting this with a
> generic message.
> 
> This change should result in an improved experience when attempting to
> flash an image that does not have a compatible record.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_fw_update.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 06/13] ice: Detect and report unsupported module power levels
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 06/13] ice: Detect and report unsupported module power levels Tony Nguyen
@ 2021-05-19 21:35   ` Brelinski, TonyX
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, TonyX @ 2021-05-19 21:35 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 06/13] ice: Detect and report
> unsupported module power levels
> 
> From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
> 
> Determine whether an unsupported power configuration is preventing link
> establishment by storing and checking the link_cfg_err_byte. Print error
> messages when module power levels are unsupported. Also add a new flag
> bit to prevent spamming said error messages.
> 
> Co-developed-by: Jeb Cramer <jeb.j.cramer@intel.com>
> Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
> Signed-off-by: Anirudh Venkataramanan
> <anirudh.venkataramanan@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice.h          |  1 +
>  .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  6 ++-
>  drivers/net/ethernet/intel/ice/ice_common.c   |  2 +
>  drivers/net/ethernet/intel/ice/ice_main.c     | 40 +++++++++++++++++++
>  drivers/net/ethernet/intel/ice/ice_type.h     |  1 +
>  5 files changed, 48 insertions(+), 2 deletions(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

* [Intel-wired-lan] [PATCH S59 07/13] ice: Remove boolean vlan_promisc flag from function
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 07/13] ice: Remove boolean vlan_promisc flag from function Tony Nguyen
@ 2021-10-29 20:57   ` Brelinski, Tony
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, Tony @ 2021-10-29 20:57 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Nguyen, Anthony L
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 07/13] ice: Remove boolean
> vlan_promisc flag from function
> 
> From: Brett Creeley <brett.creeley@intel.com>
> 
> Currently, the vlan_promisc flag is used exclusively by VF VSI to determine
> whether or not to toggle VLAN pruning along with trusted/true-promiscuous
> mode. This is not needed for a couple of reasons. First, trusted/true-
> promiscuous mode is only supposed to allow all MAC filters within VLANs
> that a VF has added filters for, so VLAN pruning should not be disabled.
> Second, the boolean argument makes the function confusing and
> unintuitive. Remove this flag.
> 
> Signed-off-by: Brett Creeley <brett.creeley@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_lib.c         |  7 ++-----
>  drivers/net/ethernet/intel/ice/ice_lib.h         |  2 +-
>  drivers/net/ethernet/intel/ice/ice_main.c        | 12 ++++++------
>  drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c |  9 ++++++---
>  4 files changed, 15 insertions(+), 15 deletions(-)

Tested-by: Tony Brelinski <tony.brelinski@intel.com>



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

* [Intel-wired-lan] [PATCH S59 08/13] ice: Fix replacing VF hardware MAC to existing MAC filter
  2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 08/13] ice: Fix replacing VF hardware MAC to existing MAC filter Tony Nguyen
@ 2021-10-29 20:57   ` Brelinski, Tony
  0 siblings, 0 replies; 26+ messages in thread
From: Brelinski, Tony @ 2021-10-29 20:57 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Nguyen, Anthony L
> Sent: Thursday, May 6, 2021 8:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S59 08/13] ice: Fix replacing VF hardware
> MAC to existing MAC filter
> 
> From: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
> 
> VF was not able to change its hardware MAC address in case the new
> address was already present in the MAC filter list.
> Change the handling of VF add mac request to not return if requested MAC
> address is already present on the list and check if its hardware MAC needs to
> be updated in this case.
> 
> Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)

Tested-by: Tony Brelinski <tony.brelinski@intel.com>



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

end of thread, other threads:[~2021-10-29 20:57 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 15:39 [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Tony Nguyen
2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 02/13] ice: add extack when unable to read device caps Tony Nguyen
2021-05-12 15:48   ` Brelinski, TonyX
2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 03/13] ice: add error message when pldmfw_flash_image fails Tony Nguyen
2021-05-19 21:34   ` Brelinski, TonyX
2021-05-06 15:39 ` [Intel-wired-lan] [PATCH S59 04/13] ice: wait for reset before reporting devlink info Tony Nguyen
2021-05-12 16:09   ` Brelinski, TonyX
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 05/13] ice: (re)initialize NVM fields when rebuilding Tony Nguyen
2021-05-12 21:56   ` Brelinski, TonyX
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 06/13] ice: Detect and report unsupported module power levels Tony Nguyen
2021-05-19 21:35   ` Brelinski, TonyX
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 07/13] ice: Remove boolean vlan_promisc flag from function Tony Nguyen
2021-10-29 20:57   ` Brelinski, Tony
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 08/13] ice: Fix replacing VF hardware MAC to existing MAC filter Tony Nguyen
2021-10-29 20:57   ` Brelinski, Tony
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 09/13] ice: fix incorrect payload indicator on PTYPE Tony Nguyen
2021-05-12 22:01   ` Brelinski, TonyX
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 10/13] ice: mark PTYPE 2 as reserved Tony Nguyen
2021-05-12 22:01   ` Brelinski, TonyX
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 11/13] ice: downgrade error print to debug print Tony Nguyen
2021-05-12 22:02   ` Brelinski, TonyX
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 12/13] ice: reduce scope of variables Tony Nguyen
2021-05-12 22:04   ` Brelinski, TonyX
2021-05-06 15:40 ` [Intel-wired-lan] [PATCH S59 13/13] ice: remove local variable Tony Nguyen
2021-05-12 22:05   ` Brelinski, TonyX
2021-05-12 15:46 ` [Intel-wired-lan] [PATCH S59 01/13] ice: use static inline for dummy functions Brelinski, TonyX

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.