* [PATCH v1 0/5] Update ixgbe base code
@ 2025-06-09 10:25 Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 1/5] net/ixgbe: remove PTP by PHY cap Anatoly Burakov
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Anatoly Burakov @ 2025-06-09 10:25 UTC (permalink / raw)
To: dev
Update IXGBE base code snapshot to version 2025-06-04.
Aleksandr Loktionov (1):
net/ixgbe: remove PTP by PHY cap
Anatoly Burakov (1):
net/ixgbe: update README
Jedrzej Jagielski (1):
net/ixgbe: add VF mailbox op for link status
Piotr Kwapulinski (1):
net/ixgbe: add ACI debug printouts
Piotr Pietruszewski (1):
net/ixgbe: add support for toggling VF Tx queues
drivers/net/intel/ixgbe/base/README | 2 +-
drivers/net/intel/ixgbe/base/ixgbe_api.c | 13 ++
drivers/net/intel/ixgbe/base/ixgbe_api.h | 1 +
drivers/net/intel/ixgbe/base/ixgbe_common.c | 56 ++++++++
drivers/net/intel/ixgbe/base/ixgbe_common.h | 1 +
drivers/net/intel/ixgbe/base/ixgbe_e610.c | 112 +++++++++++++++-
drivers/net/intel/ixgbe/base/ixgbe_e610.h | 2 +
drivers/net/intel/ixgbe/base/ixgbe_mbx.h | 4 +
drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 1 +
drivers/net/intel/ixgbe/base/ixgbe_type.h | 1 +
.../net/intel/ixgbe/base/ixgbe_type_e610.h | 1 +
drivers/net/intel/ixgbe/base/ixgbe_vf.c | 126 ++++++++++++++----
drivers/net/intel/ixgbe/base/ixgbe_vf.h | 2 +
13 files changed, 293 insertions(+), 29 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 1/5] net/ixgbe: remove PTP by PHY cap
2025-06-09 10:25 [PATCH v1 0/5] Update ixgbe base code Anatoly Burakov
@ 2025-06-09 10:25 ` Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 2/5] net/ixgbe: add VF mailbox op for link status Anatoly Burakov
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Anatoly Burakov @ 2025-06-09 10:25 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
From: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Disable PTP by PHY capability support.
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ixgbe/base/ixgbe_e610.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_e610.c b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
index 7420c78d07..cf45db3bc4 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
@@ -752,7 +752,7 @@ ixgbe_parse_common_caps(struct ixgbe_hw *hw, struct ixgbe_hw_common_caps *caps,
prefix, caps->next_cluster_id_support);
break;
case IXGBE_ACI_CAPS_PTP_BY_PHY:
- caps->ptp_by_phy_support = (number == 1);
+ caps->ptp_by_phy_support = 0;
DEBUGOUT2("%s: ptp_by_phy_support = %d\n", prefix,
caps->ptp_by_phy_support);
break;
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 2/5] net/ixgbe: add VF mailbox op for link status
2025-06-09 10:25 [PATCH v1 0/5] Update ixgbe base code Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 1/5] net/ixgbe: remove PTP by PHY cap Anatoly Burakov
@ 2025-06-09 10:25 ` Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 3/5] net/ixgbe: add support for toggling VF Tx queues Anatoly Burakov
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Anatoly Burakov @ 2025-06-09 10:25 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
From: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
E610 adapter no longer uses the VFLINKS register to read PF's link speed
and linkup state. Currently this leads to mismatch between actual link
status and that what VF driver shows to the OS.
Add new mailbox operation to let the VF driver request the PF driver
to provide the actual link data. Update the mailbox api to v1.6.
Incorporate both ways of getting link status within the legacy
ixgbe_check_mac_link_vf() function.
Signed-off-by: Andrzej Wilczynski <andrzejx.wilczynski@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ixgbe/base/ixgbe_mbx.h | 4 +
drivers/net/intel/ixgbe/base/ixgbe_vf.c | 126 ++++++++++++++++++-----
drivers/net/intel/ixgbe/base/ixgbe_vf.h | 2 +
3 files changed, 105 insertions(+), 27 deletions(-)
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_mbx.h b/drivers/net/intel/ixgbe/base/ixgbe_mbx.h
index 434f7c6a69..e3b4338fb1 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_mbx.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_mbx.h
@@ -101,6 +101,7 @@ enum ixgbe_pfvf_api_rev {
/* API 1.4 is being used in the upstream for IPsec */
ixgbe_mbox_api_14, /* API version 1.4, linux/freebsd VF driver */
ixgbe_mbox_api_15, /* API version 1.5, linux/freebsd VF driver */
+ ixgbe_mbox_api_16, /* API version 1.6, linux/freebsd VF driver */
/* This value should always be last */
ixgbe_mbox_api_unknown, /* indicates that API version is not known */
};
@@ -125,6 +126,9 @@ enum ixgbe_pfvf_api_rev {
#define IXGBE_VF_UPDATE_XCAST_MODE 0x0c
#define IXGBE_VF_GET_LINK_STATE 0x10 /* get vf link state */
+/* mailbox API, version 1.6 VF requests */
+#define IXGBE_VF_GET_PF_LINK_STATE 0x11 /* get status of the link on PF */
+
/* mode choices for IXGBE_VF_UPDATE_XCAST_MODE */
enum ixgbevf_xcast_modes {
IXGBEVF_XCAST_MODE_NONE = 0,
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_vf.c b/drivers/net/intel/ixgbe/base/ixgbe_vf.c
index 37556a9300..46a62bb851 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_vf.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_vf.c
@@ -409,6 +409,7 @@ s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
/* Fall through */
case ixgbe_mbox_api_13:
case ixgbe_mbox_api_15:
+ case ixgbe_mbox_api_16:
break;
default:
return IXGBE_ERR_FEATURE_NOT_SUPPORTED;
@@ -455,6 +456,47 @@ s32 ixgbe_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state)
return ret_val;
}
+/**
+ * ixgbevf_get_pf_link_state - Get PF's link status
+ * @hw: pointer to the HW structure
+ * @speed - link speed
+ * @link_up - indicate if link is up/down
+ *
+ * Ask PF to provide link_up state and speed of the link.
+ *
+ * Return: IXGBE_ERR_MBX in the case of mailbox error,
+ * IXGBE_ERR_FEATURE_NOT_SUPPORTED if the op is not supported or 0 on success.
+ */
+int ixgbevf_get_pf_link_state(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+ bool *link_up)
+{
+ u32 msgbuf[3] = {};
+ int err;
+
+ switch (hw->api_version) {
+ case ixgbe_mbox_api_16:
+ break;
+ default:
+ return IXGBE_ERR_FEATURE_NOT_SUPPORTED;
+ }
+
+ msgbuf[0] = IXGBE_VF_GET_PF_LINK_STATE;
+
+ err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 6);
+ if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) {
+ err = IXGBE_ERR_MBX;
+ *speed = IXGBE_LINK_SPEED_UNKNOWN;
+ /* No need to set @link_up to false as it will be done in
+ * ixgbe_check_mac_link_vf().
+ */
+ } else {
+ *speed = msgbuf[1];
+ *link_up = msgbuf[2];
+ }
+
+ return err;
+}
+
/**
* ixgbe_set_vfta_vf - Set/Unset vlan filter table address
* @hw: pointer to the HW structure
@@ -569,36 +611,25 @@ s32 ixgbe_setup_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed speed,
}
/**
- * ixgbe_check_mac_link_vf - Get link/speed status
- * @hw: pointer to hardware structure
- * @speed: pointer to link speed
- * @link_up: true is link is up, false otherwise
- * @autoneg_wait_to_complete: true when waiting for completion is needed
+ * ixgbe_read_vflinks - Read VFLINKS register
+ * @hw: pointer to the HW structure
+ * @speed - link speed
+ * @link_up - indicate if link is up/down
*
- * Reads the links register to determine if link is up and the current speed
- **/
-s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
- bool *link_up, bool autoneg_wait_to_complete)
+ * Get linkup status and link speed from the VFLINKS register.
+ */
+static void ixgbe_read_vflinks(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+ bool *link_up)
{
- struct ixgbe_mbx_info *mbx = &hw->mbx;
struct ixgbe_mac_info *mac = &hw->mac;
- s32 ret_val = IXGBE_SUCCESS;
- u32 in_msg = 0;
u32 links_reg;
- UNREFERENCED_1PARAMETER(autoneg_wait_to_complete);
-
- /* If we were hit with a reset drop the link */
- if (!mbx->ops[0].check_for_rst(hw, 0) || !mbx->timeout)
- mac->get_link_status = true;
-
- if (!mac->get_link_status)
- goto out;
-
/* if link status is down no point in checking to see if pf is up */
links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
- if (!(links_reg & IXGBE_LINKS_UP))
- goto out;
+ if (!(links_reg & IXGBE_LINKS_UP)) {
+ *link_up = false;
+ return;
+ }
/* for SFP+ modules and DA cables on 82599 it can take up to 500usecs
* before the link status is correct
@@ -610,10 +641,14 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
usec_delay(100);
links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
- if (!(links_reg & IXGBE_LINKS_UP))
- goto out;
+ if (!(links_reg & IXGBE_LINKS_UP)) {
+ *link_up = false;
+ return;
+ }
}
}
+ /* We have link at this point */
+ *link_up = true;
switch (links_reg & IXGBE_LINKS_SPEED_82599) {
case IXGBE_LINKS_SPEED_10G_82599:
@@ -628,8 +663,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
break;
case IXGBE_LINKS_SPEED_100_82599:
*speed = IXGBE_LINK_SPEED_100_FULL;
- if (hw->mac.type == ixgbe_mac_X550_vf ||
- hw->mac.type == ixgbe_mac_E610_vf) {
+ if (hw->mac.type == ixgbe_mac_X550_vf) {
if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
*speed = IXGBE_LINK_SPEED_5GB_FULL;
}
@@ -643,6 +677,43 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
default:
*speed = IXGBE_LINK_SPEED_UNKNOWN;
}
+}
+
+/**
+ * ixgbe_check_mac_link_vf - Get link/speed status
+ * @hw: pointer to hardware structure
+ * @speed: pointer to link speed
+ * @link_up: true is link is up, false otherwise
+ * @autoneg_wait_to_complete: true when waiting for completion is needed
+ *
+ * Reads the links register to determine if link is up and the current speed
+ */
+s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+ bool *link_up, bool autoneg_wait_to_complete)
+{
+ struct ixgbe_mbx_info *mbx = &hw->mbx;
+ struct ixgbe_mac_info *mac = &hw->mac;
+ s32 ret_val = IXGBE_SUCCESS;
+ u32 in_msg = 0;
+
+ UNREFERENCED_1PARAMETER(autoneg_wait_to_complete);
+
+ /* If we were hit with a reset drop the link */
+ if (!mbx->ops[0].check_for_rst(hw, 0) || !mbx->timeout)
+ mac->get_link_status = true;
+
+ if (!mac->get_link_status)
+ goto out;
+
+ if (hw->mac.type != ixgbe_mac_E610_vf) {
+ ixgbe_read_vflinks(hw, speed, link_up);
+ if (*link_up == false)
+ goto out;
+ } else {
+ ret_val = ixgbevf_get_pf_link_state(hw, speed, link_up);
+ if (ret_val)
+ goto out;
+ }
/* if the read failed it could just be a mailbox collision, best wait
* until we are called again and don't report an error
@@ -742,6 +813,7 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
case ixgbe_mbox_api_12:
case ixgbe_mbox_api_13:
case ixgbe_mbox_api_15:
+ case ixgbe_mbox_api_16:
break;
default:
return 0;
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_vf.h b/drivers/net/intel/ixgbe/base/ixgbe_vf.h
index bd10865d57..ca532fae07 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_vf.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_vf.h
@@ -113,5 +113,7 @@ s32 ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size);
int ixgbevf_negotiate_api_version(struct ixgbe_hw *hw, int api);
int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
unsigned int *default_tc);
+int ixgbevf_get_pf_link_state(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+ bool *link_up);
#endif /* __IXGBE_VF_H__ */
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 3/5] net/ixgbe: add support for toggling VF Tx queues
2025-06-09 10:25 [PATCH v1 0/5] Update ixgbe base code Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 1/5] net/ixgbe: remove PTP by PHY cap Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 2/5] net/ixgbe: add VF mailbox op for link status Anatoly Burakov
@ 2025-06-09 10:25 ` Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 4/5] net/ixgbe: add ACI debug printouts Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 5/5] net/ixgbe: update README Anatoly Burakov
4 siblings, 0 replies; 6+ messages in thread
From: Anatoly Burakov @ 2025-06-09 10:25 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
From: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Add method to toggle VF's TX queues to work around silicon errata.
Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ixgbe/base/ixgbe_api.c | 13 +++++
drivers/net/intel/ixgbe/base/ixgbe_api.h | 1 +
drivers/net/intel/ixgbe/base/ixgbe_common.c | 56 +++++++++++++++++++++
drivers/net/intel/ixgbe/base/ixgbe_common.h | 1 +
drivers/net/intel/ixgbe/base/ixgbe_type.h | 1 +
5 files changed, 72 insertions(+)
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_api.c b/drivers/net/intel/ixgbe/base/ixgbe_api.c
index ffff670dd3..6caa68b5c5 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_api.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_api.c
@@ -1116,6 +1116,19 @@ s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on,
IXGBE_NOT_IMPLEMENTED);
}
+/**
+ * ixgbe_toggle_txdctl - Toggle VF's queues
+ * @hw: pointer to hardware structure
+ * @vind: VMDq pool index
+ *
+ * Enable and disable each queue in VF.
+ */
+s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vind)
+{
+ return ixgbe_call_func(hw, hw->mac.ops.toggle_txdctl, (hw,
+ vind), IXGBE_NOT_IMPLEMENTED);
+}
+
/**
* ixgbe_fc_enable - Enable flow control
* @hw: pointer to hardware structure
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_api.h b/drivers/net/intel/ixgbe/base/ixgbe_api.h
index 5d2b2313eb..4f166f729a 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_api.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_api.h
@@ -102,6 +102,7 @@ s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan,
s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind,
bool vlan_on, u32 *vfta_delta, u32 vfta,
bool vlvf_bypass);
+s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vind);
s32 ixgbe_fc_enable(struct ixgbe_hw *hw);
s32 ixgbe_setup_fc(struct ixgbe_hw *hw);
s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build,
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_common.c b/drivers/net/intel/ixgbe/base/ixgbe_common.c
index fbc9605e4d..099bdce568 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_common.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_common.c
@@ -104,6 +104,7 @@ s32 ixgbe_init_ops_generic(struct ixgbe_hw *hw)
mac->ops.init_uta_tables = NULL;
mac->ops.enable_rx = ixgbe_enable_rx_generic;
mac->ops.disable_rx = ixgbe_disable_rx_generic;
+ mac->ops.toggle_txdctl = ixgbe_toggle_txdctl_generic;
/* Flow Control */
mac->ops.fc_enable = ixgbe_fc_enable_generic;
@@ -4107,6 +4108,61 @@ s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw)
return IXGBE_SUCCESS;
}
+/**
+ * ixgbe_toggle_txdctl_generic - Toggle VF's queues
+ * @hw: pointer to hardware structure
+ * @vf_number: VF index
+ *
+ * Enable and disable each queue in VF.
+ */
+s32 ixgbe_toggle_txdctl_generic(struct ixgbe_hw *hw, u32 vf_number)
+{
+ u8 queue_count, i;
+ u32 offset, reg;
+
+ if (vf_number > 63)
+ return IXGBE_ERR_PARAM;
+
+ /*
+ * Determine number of queues by checking
+ * number of virtual functions
+ */
+ reg = IXGBE_READ_REG(hw, IXGBE_GCR_EXT);
+ switch (reg & IXGBE_GCR_EXT_VT_MODE_MASK) {
+ case IXGBE_GCR_EXT_VT_MODE_64:
+ queue_count = 2;
+ break;
+ case IXGBE_GCR_EXT_VT_MODE_32:
+ queue_count = 4;
+ break;
+ case IXGBE_GCR_EXT_VT_MODE_16:
+ queue_count = 8;
+ break;
+ default:
+ return IXGBE_ERR_CONFIG;
+ }
+
+ /* Toggle queues */
+ for (i = 0; i < queue_count; ++i) {
+ /* Calculate offset of current queue */
+ offset = queue_count * vf_number + i;
+
+ /* Enable queue */
+ reg = IXGBE_READ_REG(hw, IXGBE_PVFTXDCTL(offset));
+ reg |= IXGBE_TXDCTL_ENABLE;
+ IXGBE_WRITE_REG(hw, IXGBE_PVFTXDCTL(offset), reg);
+ IXGBE_WRITE_FLUSH(hw);
+
+ /* Disable queue */
+ reg = IXGBE_READ_REG(hw, IXGBE_PVFTXDCTL(offset));
+ reg &= ~IXGBE_TXDCTL_ENABLE;
+ IXGBE_WRITE_REG(hw, IXGBE_PVFTXDCTL(offset), reg);
+ IXGBE_WRITE_FLUSH(hw);
+ }
+
+ return IXGBE_SUCCESS;
+}
+
/**
* ixgbe_need_crosstalk_fix - Determine if we need to do cross talk fix
* @hw: pointer to hardware structure
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_common.h b/drivers/net/intel/ixgbe/base/ixgbe_common.h
index bc4466ddf3..b4f469500f 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_common.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_common.h
@@ -111,6 +111,7 @@ s32 ixgbe_set_vlvf_generic(struct ixgbe_hw *hw, u32 vlan, u32 vind,
bool vlvf_bypass);
s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw);
s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan, bool vlvf_bypass);
+s32 ixgbe_toggle_txdctl_generic(struct ixgbe_hw *hw, u32 vind);
s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw,
ixgbe_link_speed *speed,
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_type.h b/drivers/net/intel/ixgbe/base/ixgbe_type.h
index 99ae823119..73f7eeabab 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_type.h
@@ -4026,6 +4026,7 @@ struct ixgbe_mac_operations {
void (*set_vlan_anti_spoofing)(struct ixgbe_hw *, bool, int);
s32 (*update_xcast_mode)(struct ixgbe_hw *, int);
s32 (*set_rlpml)(struct ixgbe_hw *, u16);
+ s32 (*toggle_txdctl)(struct ixgbe_hw *hw, u32 vf_index);
/* Flow Control */
s32 (*fc_enable)(struct ixgbe_hw *);
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 4/5] net/ixgbe: add ACI debug printouts
2025-06-09 10:25 [PATCH v1 0/5] Update ixgbe base code Anatoly Burakov
` (2 preceding siblings ...)
2025-06-09 10:25 ` [PATCH v1 3/5] net/ixgbe: add support for toggling VF Tx queues Anatoly Burakov
@ 2025-06-09 10:25 ` Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 5/5] net/ixgbe: update README Anatoly Burakov
4 siblings, 0 replies; 6+ messages in thread
From: Anatoly Burakov @ 2025-06-09 10:25 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Add more verbose printouts for ACI when debugging is enabled.
Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ixgbe/base/ixgbe_e610.c | 110 ++++++++++++++++++
drivers/net/intel/ixgbe/base/ixgbe_e610.h | 2 +
drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 1 +
.../net/intel/ixgbe/base/ixgbe_type_e610.h | 1 +
4 files changed, 114 insertions(+)
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_e610.c b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
index cf45db3bc4..06a69d1d62 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
@@ -31,6 +31,99 @@ void ixgbe_shutdown_aci(struct ixgbe_hw *hw)
ixgbe_destroy_lock(&hw->aci.lock);
}
+/**
+ * ixgbe_aci_debug_array - dump a buffer of data row by row
+ * @row_size: size in bytes of data dumped in a single row
+ * @buf: data to be dumped into the debug log
+ * @buf_size: size of buffer
+ *
+ * Debug function for dumping a binary blob of data row by row.
+ */
+STATIC void ixgbe_aci_debug_array(struct ixgbe_hw *hw, u16 row_size, u8 *buf,
+ u16 buf_size)
+{
+ char debug_portion[IXGBE_ACI_MAX_DEBUG_STRING_LENGTH] = {'\0'};
+ char debug_string[IXGBE_ACI_MAX_DEBUG_STRING_LENGTH] = {'\0'};
+ u16 i = 0, j = 0;
+ s16 remaining_space = IXGBE_ACI_MAX_DEBUG_STRING_LENGTH - 1;
+ s16 nbytes = 0;
+ if (!hw)
+ return;
+ if (buf && buf_size && row_size) {
+ if (buf_size >= row_size) {
+ for (i = 0; i < (buf_size - row_size); i += row_size) {
+ nbytes = snprintf(debug_string, sizeof(debug_string), "0x%04X : ", i);
+ remaining_space = IXGBE_ACI_MAX_DEBUG_STRING_LENGTH - nbytes - 1;
+ for (j = 0; j < row_size; j++) {
+ nbytes = snprintf(debug_portion, sizeof(debug_portion), "0x%02X ", buf[i + j]);
+ strncat(debug_string, debug_portion, remaining_space);
+ remaining_space -= nbytes;
+ if (remaining_space <= 0) break;
+ }
+ strncat(debug_string, "\n", remaining_space);
+ DEBUGOUT1("%s", debug_string);
+ memset(debug_string, 0, IXGBE_ACI_MAX_DEBUG_STRING_LENGTH);
+ }
+ }
+ if (i < buf_size) {
+ nbytes = snprintf(debug_string, sizeof(debug_string), "0x%04X : ", i);
+ remaining_space = IXGBE_ACI_MAX_DEBUG_STRING_LENGTH - nbytes - 1;
+ for (j = 0; j < (buf_size - i); j++) {
+ nbytes = snprintf(debug_portion, sizeof(debug_portion), "0x%02X ", buf[i + j]);
+ strncat(debug_string, debug_portion, remaining_space);
+ remaining_space -= nbytes;
+ if (remaining_space <= 0) break;
+ }
+ strncat(debug_string, "\n", remaining_space);
+ DEBUGOUT1("%s", debug_string);
+ }
+ }
+}
+
+/**
+ * ixgbe_aci_debug - dump the ACI data with the descriptor contents.
+ * @hw: pointer to the hardware structure
+ * @desc: pointer to control queue descriptor
+ * @buf: pointer to command buffer
+ * @buf_len: max length of buf
+ *
+ * Debug function for dumping logs about ACI command with descriptor contents.
+ */
+void ixgbe_aci_debug(struct ixgbe_hw *hw, void *desc, void *buf, u16 buf_len)
+{
+ struct ixgbe_aci_desc *aci_desc = (struct ixgbe_aci_desc *)desc;
+ u16 datalen, flags;
+
+ if (!hw || !desc)
+ return;
+
+ datalen = IXGBE_LE16_TO_CPU(aci_desc->datalen);
+ flags = IXGBE_LE16_TO_CPU(aci_desc->flags);
+
+ DEBUGOUT4("CQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",
+ IXGBE_LE16_TO_CPU(aci_desc->opcode), flags, datalen,
+ IXGBE_LE16_TO_CPU(aci_desc->retval));
+ DEBUGOUT2("\tcookie (h,l) 0x%08X 0x%08X\n",
+ IXGBE_LE32_TO_CPU(aci_desc->cookie_high),
+ IXGBE_LE32_TO_CPU(aci_desc->cookie_low));
+ DEBUGOUT2("\tparam (0,1) 0x%08X 0x%08X\n",
+ IXGBE_LE32_TO_CPU(aci_desc->params.generic.param0),
+ IXGBE_LE32_TO_CPU(aci_desc->params.generic.param1));
+ DEBUGOUT2("\taddr (h,l) 0x%08X 0x%08X\n",
+ IXGBE_LE32_TO_CPU(aci_desc->params.generic.addr_high),
+ IXGBE_LE32_TO_CPU(aci_desc->params.generic.addr_low));
+
+ /* Dump buffer if 1) one exists and 2) is either a response indicated
+ * by the DD and/or CMP flag set or a command with the RD flag set.
+ */
+ if (buf && aci_desc->datalen != 0 &&
+ (flags & (IXGBE_ACI_FLAG_DD | IXGBE_ACI_FLAG_CMP) ||
+ flags & IXGBE_ACI_FLAG_RD)) {
+ DEBUGOUT("Buffer:\n");
+ ixgbe_aci_debug_array(hw, 16, (u8 *)buf, min(buf_len, datalen));
+ }
+}
+
/**
* ixgbe_should_retry_aci_send_cmd_execute - decide if ACI command should
* be resent
@@ -94,10 +187,12 @@ ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
/* It's necessary to check if mechanism is enabled */
hicr = IXGBE_READ_REG(hw, PF_HICR);
if (!(hicr & PF_HICR_EN)) {
+ DEBUGOUT("CSR mechanism is not enabled\n");
status = IXGBE_ERR_ACI_DISABLED;
break;
}
if (hicr & PF_HICR_C) {
+ DEBUGOUT("CSR mechanism is busy\n");
hw->aci.last_status = IXGBE_ACI_RC_EBUSY;
status = IXGBE_ERR_ACI_BUSY;
break;
@@ -105,6 +200,7 @@ ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
opcode = desc->opcode;
if (buf_size > IXGBE_ACI_MAX_BUFFER_SIZE) {
+ DEBUGOUT("buf_size is too big\n");
status = IXGBE_ERR_PARAM;
break;
}
@@ -117,6 +213,7 @@ ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
if ((buf && buf_size == 0) ||
(buf == NULL && buf_size)) {
status = IXGBE_ERR_PARAM;
+ DEBUGOUT("Error: Invalid argument buf or buf_size\n");
break;
}
if (buf && buf_size)
@@ -156,6 +253,8 @@ ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
}
}
+ ixgbe_aci_debug(hw, (void *)desc, tmp_buf, (u16)tmp_buf_size);
+
/* Descriptor is written to specific registers */
for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++)
IXGBE_WRITE_REG(hw, PF_HIDA(i),
@@ -195,6 +294,7 @@ ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
raw_desc[i] = IXGBE_READ_REG(hw, PF_HIDA(i));
raw_desc[i] = IXGBE_CPU_TO_LE32(raw_desc[i]);
}
+ ixgbe_aci_debug(hw, (void *)raw_desc, NULL, 0);
}
/* Read async Admin Command response */
@@ -203,13 +303,18 @@ ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
raw_desc[i] = IXGBE_READ_REG(hw, PF_HIDA_2(i));
raw_desc[i] = IXGBE_CPU_TO_LE32(raw_desc[i]);
}
+ ixgbe_aci_debug(hw, (void *)raw_desc, NULL, 0);
}
/* Handle timeout and invalid state of HICR register */
if (hicr & PF_HICR_C) {
+ DEBUGOUT1("Error: Admin Command 0x%X command timeout\n",
+ desc->opcode);
status = IXGBE_ERR_ACI_TIMEOUT;
break;
} else if (!(hicr & PF_HICR_SV) && !(hicr & PF_HICR_EV)) {
+ DEBUGOUT1("Error: Admin Command 0x%X invalid state of HICR register\n",
+ desc->opcode);
status = IXGBE_ERR_ACI_ERROR;
break;
}
@@ -221,11 +326,14 @@ ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
*/
if (desc->opcode != opcode &&
opcode != IXGBE_CPU_TO_LE16(ixgbe_aci_opc_get_fw_event)) {
+ DEBUGOUT("Error: Admin Command failed because of bad opcode was returned\n");
status = IXGBE_ERR_ACI_ERROR;
break;
}
if (desc->retval != IXGBE_ACI_RC_OK) {
+ DEBUGOUT1("Error: Admin Command failed with error %x\n",
+ desc->retval);
hw->aci.last_status = (enum ixgbe_aci_err)desc->retval;
status = IXGBE_ERR_ACI_ERROR;
break;
@@ -239,6 +347,8 @@ ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
tmp_buf[i] = IXGBE_CPU_TO_LE32(tmp_buf[i]);
}
memcpy(buf, tmp_buf, buf_size);
+ ixgbe_aci_debug(hw, (void *)raw_desc, tmp_buf,
+ (u16)tmp_buf_size);
}
} while (0);
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_e610.h b/drivers/net/intel/ixgbe/base/ixgbe_e610.h
index f60268cf91..e950f89e80 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_e610.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_e610.h
@@ -10,6 +10,8 @@
void ixgbe_init_aci(struct ixgbe_hw *hw);
void ixgbe_shutdown_aci(struct ixgbe_hw *hw);
+void ixgbe_aci_debug(struct ixgbe_hw *hw, void *desc, void *buf, u16 buf_len);
+
s32 ixgbe_aci_send_cmd(struct ixgbe_hw *hw, struct ixgbe_aci_desc *desc,
void *buf, u16 buf_size);
bool ixgbe_aci_check_event_pending(struct ixgbe_hw *hw);
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index 53d0422193..4dfed02137 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -39,6 +39,7 @@
#define DEBUGOUT1(S, ...) DEBUGOUT(S, ##__VA_ARGS__)
#define DEBUGOUT2(S, ...) DEBUGOUT(S, ##__VA_ARGS__)
#define DEBUGOUT3(S, ...) DEBUGOUT(S, ##__VA_ARGS__)
+#define DEBUGOUT4(S, ...) DEBUGOUT(S, ##__VA_ARGS__)
#define DEBUGOUT6(S, ...) DEBUGOUT(S, ##__VA_ARGS__)
#define DEBUGOUT7(S, ...) DEBUGOUT(S, ##__VA_ARGS__)
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_type_e610.h b/drivers/net/intel/ixgbe/base/ixgbe_type_e610.h
index e804172252..9348294735 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_type_e610.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_type_e610.h
@@ -361,6 +361,7 @@
#define IXGBE_ACI_DESC_COOKIE_L_DWORD_OFFSET 3
#define IXGBE_ACI_SEND_DELAY_TIME_MS 10
#define IXGBE_ACI_SEND_MAX_EXECUTE 3
+#define IXGBE_ACI_MAX_DEBUG_STRING_LENGTH 128
/* [ms] timeout of waiting for sync response */
#define IXGBE_ACI_SYNC_RESPONSE_TIMEOUT 100000
/* [ms] timeout of waiting for async response */
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 5/5] net/ixgbe: update README
2025-06-09 10:25 [PATCH v1 0/5] Update ixgbe base code Anatoly Burakov
` (3 preceding siblings ...)
2025-06-09 10:25 ` [PATCH v1 4/5] net/ixgbe: add ACI debug printouts Anatoly Burakov
@ 2025-06-09 10:25 ` Anatoly Burakov
4 siblings, 0 replies; 6+ messages in thread
From: Anatoly Burakov @ 2025-06-09 10:25 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
Update readme with new base code snapshot update date.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ixgbe/base/README | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/intel/ixgbe/base/README b/drivers/net/intel/ixgbe/base/README
index 8693c4ebc1..b48438f1db 100644
--- a/drivers/net/intel/ixgbe/base/README
+++ b/drivers/net/intel/ixgbe/base/README
@@ -6,7 +6,7 @@ Intel® IXGBE driver
===================
This directory contains source code of ixgbe base driver generated on
-2024-12-20 released by the team which develops
+2025-06-04 released by the team which develops
basic drivers for any ixgbe NIC. The sub-directory of base/
contains the original source package.
This driver is valid for the product(s) listed below
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-09 10:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-09 10:25 [PATCH v1 0/5] Update ixgbe base code Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 1/5] net/ixgbe: remove PTP by PHY cap Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 2/5] net/ixgbe: add VF mailbox op for link status Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 3/5] net/ixgbe: add support for toggling VF Tx queues Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 4/5] net/ixgbe: add ACI debug printouts Anatoly Burakov
2025-06-09 10:25 ` [PATCH v1 5/5] net/ixgbe: update README Anatoly Burakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).