From: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: anthony.l.nguyen@intel.com, netdev@vger.kernel.org,
Jedrzej Jagielski <jedrzej.jagielski@intel.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Subject: [PATCH iwl-next v1 1/6] ixgbe: E610: init Link Status Events mask just once
Date: Thu, 2 Jul 2026 11:15:48 +0200 [thread overview]
Message-ID: <20260702091553.57112-2-jedrzej.jagielski@intel.com> (raw)
In-Reply-To: <20260702091553.57112-1-jedrzej.jagielski@intel.com>
Current approach is that LSE mask is configured each time the LSE feature
itself is toggled. The set of bits corresponding to LSE trigger causes
remain the same for the whole ixgbe lifecycle. There's no support for
enabling or disabling specific bits within LSE mask.
This is redundant; there's no need to configure LSE mask over and over.
The mask persists in hardware and only needs to be set once so should
be separated from the LSE toggling logic.
Do it just once at the init phase.
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 -
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 34 ++++++++++++-------
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h | 3 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 28 +++------------
4 files changed, 27 insertions(+), 39 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 30f62174acf2..17e0a9824777 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -821,7 +821,6 @@ struct ixgbe_adapter {
struct ixgbe_mac_addr *mac_table;
u8 tx_hang_count[IXGBE_MAX_TX_QUEUES];
struct kobject *info_kobj;
- u16 lse_mask;
#ifdef CONFIG_IXGBE_HWMON
struct hwmon_buff *ixgbe_hwmon_buff;
#endif /* CONFIG_IXGBE_HWMON */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
index 831cfe9a4697..d451da68fd6d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
@@ -1536,7 +1536,7 @@ int ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse,
*
* Return: the exit code of the operation.
*/
-int ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask)
+static int ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask)
{
struct ixgbe_aci_cmd_set_event_mask *cmd;
struct libie_aq_desc desc;
@@ -1551,25 +1551,25 @@ int ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask)
return ixgbe_aci_send_cmd(hw, &desc, NULL, 0);
}
+static int ixgbe_aci_init_event_mask(struct ixgbe_hw *hw)
+{
+ u16 mask = ~((u16)(IXGBE_ACI_LINK_EVENT_UPDOWN |
+ IXGBE_ACI_LINK_EVENT_MEDIA_NA |
+ IXGBE_ACI_LINK_EVENT_MODULE_QUAL_FAIL |
+ IXGBE_ACI_LINK_EVENT_PHY_FW_LOAD_FAIL));
+
+ return ixgbe_aci_set_event_mask(hw, (u8)hw->bus.func, mask);
+}
+
/**
* ixgbe_configure_lse - enable/disable link status events
* @hw: pointer to the HW struct
* @activate: true for enable lse, false otherwise
- * @mask: event mask to be set; a set bit means deactivation of the
- * corresponding event
- *
- * Set the event mask and then enable or disable link status events
*
* Return: the exit code of the operation.
*/
-int ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate, u16 mask)
+int ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate)
{
- int err;
-
- err = ixgbe_aci_set_event_mask(hw, (u8)hw->bus.func, mask);
- if (err)
- return err;
-
/* Enabling link status events generation by fw. */
return ixgbe_aci_get_link_info(hw, activate, NULL);
}
@@ -1597,6 +1597,16 @@ static int ixgbe_start_hw_e610(struct ixgbe_hw *hw)
ixgbe_start_hw_gen2(hw);
+ err = ixgbe_aci_init_event_mask(hw);
+ /* In case of error just log it, don't fail the whole init */
+ if (err) {
+ struct ixgbe_adapter *adapter =
+ container_of(hw, struct ixgbe_adapter, hw);
+
+ e_dev_err("Cannot configure Link Status Event mask, err = %d\n",
+ err);
+ }
+
return 0;
}
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h
index 2cb76a3d30ae..ecda35a77adb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h
@@ -34,8 +34,7 @@ int ixgbe_update_link_info(struct ixgbe_hw *hw);
int ixgbe_get_link_status(struct ixgbe_hw *hw, bool *link_up);
int ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse,
struct ixgbe_link_status *link);
-int ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask);
-int ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate, u16 mask);
+int ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate);
int ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode);
enum ixgbe_media_type ixgbe_get_media_type_e610(struct ixgbe_hw *hw);
int ixgbe_setup_link_e610(struct ixgbe_hw *hw, ixgbe_link_speed speed,
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 7a0783c1abc1..2c8968b9b86c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -5969,23 +5969,14 @@ static void ixgbe_configure(struct ixgbe_adapter *adapter)
/**
* ixgbe_enable_link_status_events - enable link status events
* @adapter: pointer to the adapter structure
- * @mask: event mask to be set
*
* Enables link status events by invoking ixgbe_configure_lse()
*
* Return: the exit code of the operation.
*/
-static int ixgbe_enable_link_status_events(struct ixgbe_adapter *adapter,
- u16 mask)
+static int ixgbe_enable_link_status_events(struct ixgbe_adapter *adapter)
{
- int err;
-
- err = ixgbe_configure_lse(&adapter->hw, true, mask);
- if (err)
- return err;
-
- adapter->lse_mask = mask;
- return 0;
+ return ixgbe_configure_lse(&adapter->hw, true);
}
/**
@@ -5998,14 +5989,7 @@ static int ixgbe_enable_link_status_events(struct ixgbe_adapter *adapter,
*/
static int ixgbe_disable_link_status_events(struct ixgbe_adapter *adapter)
{
- int err;
-
- err = ixgbe_configure_lse(&adapter->hw, false, adapter->lse_mask);
- if (err)
- return err;
-
- adapter->lse_mask = 0;
- return 0;
+ return ixgbe_configure_lse(&adapter->hw, false);
}
/**
@@ -6039,10 +6023,6 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
{
struct ixgbe_adapter *adapter = container_of(hw, struct ixgbe_adapter,
hw);
- u16 mask = ~((u16)(IXGBE_ACI_LINK_EVENT_UPDOWN |
- IXGBE_ACI_LINK_EVENT_MEDIA_NA |
- IXGBE_ACI_LINK_EVENT_MODULE_QUAL_FAIL |
- IXGBE_ACI_LINK_EVENT_PHY_FW_LOAD_FAIL));
bool autoneg, link_up = false;
int ret = -EIO;
u32 speed;
@@ -6070,7 +6050,7 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
if (hw->mac.ops.setup_link) {
if (adapter->hw.mac.type == ixgbe_mac_e610) {
- ret = ixgbe_enable_link_status_events(adapter, mask);
+ ret = ixgbe_enable_link_status_events(adapter);
if (ret)
return ret;
}
--
2.31.1
next prev parent reply other threads:[~2026-07-02 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 9:15 [PATCH iwl-next v1 0/6] ixgbe: improve FW/SW data synchronization Jedrzej Jagielski
2026-07-02 9:15 ` Jedrzej Jagielski [this message]
2026-07-02 9:15 ` [PATCH iwl-next v1 2/6] ixgbe: E610: prevent from disabling LSE Jedrzej Jagielski
2026-07-02 9:15 ` [PATCH iwl-next v1 3/6] ixgbe: E610: do not disable LSE on driver down/remove Jedrzej Jagielski
2026-07-02 9:15 ` [PATCH iwl-next v1 4/6] ixgbe: E610: re-enable LSE unconditionally Jedrzej Jagielski
2026-07-02 9:15 ` [PATCH iwl-next v1 5/6] ixgbe: E610: add MAC address runtime refresh Jedrzej Jagielski
2026-07-02 9:15 ` [PATCH iwl-next v1 6/6] ixgbe: take rtnl lock before ixgbe_reset() is called Jedrzej Jagielski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260702091553.57112-2-jedrzej.jagielski@intel.com \
--to=jedrzej.jagielski@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox