mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-01-24 (idpf, ice, iavf) For idpf: Emil adds memory barrier when accessing control queue descriptors and restores call to idpf_vc_xn_shutdown() when resetting. Manoj Vishwanathan expands transaction lock to properly protect xn->salt value and adds additional debugging information. Marco Leogrande converts workqueues to be unbound. For ice: Przemek fixes incorrect size use for array. Mateusz removes reporting of invalid parameter and value. For iavf: Michal adjusts some VLAN changes to occur without a PF call to avoid timing issues with the calls. * '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: allow changing VLAN state without calling PF ice: remove invalid parameter of equalizer ice: fix ice_parser_rt::bst_key array size idpf: add more info during virtchnl transaction timeout/salt mismatch idpf: convert workqueues to unbound idpf: Acquire the lock before accessing the xn->salt idpf: fix transaction timeouts on reset idpf: add read memory barrier when checking descriptor done bit ==================== Link: https://patch.msgid.link/20250124213213.1328775-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
b2aec4efe8
|
|
@ -773,6 +773,11 @@ iavf_vlan_filter *iavf_add_vlan(struct iavf_adapter *adapter,
|
|||
f->state = IAVF_VLAN_ADD;
|
||||
adapter->num_vlan_filters++;
|
||||
iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_VLAN_FILTER);
|
||||
} else if (f->state == IAVF_VLAN_REMOVE) {
|
||||
/* IAVF_VLAN_REMOVE means that VLAN wasn't yet removed.
|
||||
* We can safely only change the state here.
|
||||
*/
|
||||
f->state = IAVF_VLAN_ACTIVE;
|
||||
}
|
||||
|
||||
clearout:
|
||||
|
|
@ -793,8 +798,18 @@ static void iavf_del_vlan(struct iavf_adapter *adapter, struct iavf_vlan vlan)
|
|||
|
||||
f = iavf_find_vlan(adapter, vlan);
|
||||
if (f) {
|
||||
f->state = IAVF_VLAN_REMOVE;
|
||||
iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_DEL_VLAN_FILTER);
|
||||
/* IAVF_ADD_VLAN means that VLAN wasn't even added yet.
|
||||
* Remove it from the list.
|
||||
*/
|
||||
if (f->state == IAVF_VLAN_ADD) {
|
||||
list_del(&f->list);
|
||||
kfree(f);
|
||||
adapter->num_vlan_filters--;
|
||||
} else {
|
||||
f->state = IAVF_VLAN_REMOVE;
|
||||
iavf_schedule_aq_request(adapter,
|
||||
IAVF_FLAG_AQ_DEL_VLAN_FILTER);
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_bh(&adapter->mac_vlan_list_lock);
|
||||
|
|
|
|||
|
|
@ -1498,7 +1498,6 @@ struct ice_aqc_dnl_equa_param {
|
|||
#define ICE_AQC_RX_EQU_POST1 (0x12 << ICE_AQC_RX_EQU_SHIFT)
|
||||
#define ICE_AQC_RX_EQU_BFLF (0x13 << ICE_AQC_RX_EQU_SHIFT)
|
||||
#define ICE_AQC_RX_EQU_BFHF (0x14 << ICE_AQC_RX_EQU_SHIFT)
|
||||
#define ICE_AQC_RX_EQU_DRATE (0x15 << ICE_AQC_RX_EQU_SHIFT)
|
||||
#define ICE_AQC_RX_EQU_CTLE_GAINHF (0x20 << ICE_AQC_RX_EQU_SHIFT)
|
||||
#define ICE_AQC_RX_EQU_CTLE_GAINLF (0x21 << ICE_AQC_RX_EQU_SHIFT)
|
||||
#define ICE_AQC_RX_EQU_CTLE_GAINDC (0x22 << ICE_AQC_RX_EQU_SHIFT)
|
||||
|
|
|
|||
|
|
@ -710,7 +710,6 @@ static int ice_get_tx_rx_equa(struct ice_hw *hw, u8 serdes_num,
|
|||
{ ICE_AQC_RX_EQU_POST1, rx, &ptr->rx_equ_post1 },
|
||||
{ ICE_AQC_RX_EQU_BFLF, rx, &ptr->rx_equ_bflf },
|
||||
{ ICE_AQC_RX_EQU_BFHF, rx, &ptr->rx_equ_bfhf },
|
||||
{ ICE_AQC_RX_EQU_DRATE, rx, &ptr->rx_equ_drate },
|
||||
{ ICE_AQC_RX_EQU_CTLE_GAINHF, rx, &ptr->rx_equ_ctle_gainhf },
|
||||
{ ICE_AQC_RX_EQU_CTLE_GAINLF, rx, &ptr->rx_equ_ctle_gainlf },
|
||||
{ ICE_AQC_RX_EQU_CTLE_GAINDC, rx, &ptr->rx_equ_ctle_gaindc },
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ struct ice_serdes_equalization_to_ethtool {
|
|||
int rx_equ_post1;
|
||||
int rx_equ_bflf;
|
||||
int rx_equ_bfhf;
|
||||
int rx_equ_drate;
|
||||
int rx_equ_ctle_gainhf;
|
||||
int rx_equ_ctle_gainlf;
|
||||
int rx_equ_ctle_gaindc;
|
||||
|
|
|
|||
|
|
@ -257,7 +257,6 @@ ice_pg_nm_cam_match(struct ice_pg_nm_cam_item *table, int size,
|
|||
/*** ICE_SID_RXPARSER_BOOST_TCAM and ICE_SID_LBL_RXPARSER_TMEM sections ***/
|
||||
#define ICE_BST_TCAM_TABLE_SIZE 256
|
||||
#define ICE_BST_TCAM_KEY_SIZE 20
|
||||
#define ICE_BST_KEY_TCAM_SIZE 19
|
||||
|
||||
/* Boost TCAM item */
|
||||
struct ice_bst_tcam_item {
|
||||
|
|
@ -401,7 +400,6 @@ u16 ice_xlt_kb_flag_get(struct ice_xlt_kb *kb, u64 pkt_flag);
|
|||
#define ICE_PARSER_GPR_NUM 128
|
||||
#define ICE_PARSER_FLG_NUM 64
|
||||
#define ICE_PARSER_ERR_NUM 16
|
||||
#define ICE_BST_KEY_SIZE 10
|
||||
#define ICE_MARKER_ID_SIZE 9
|
||||
#define ICE_MARKER_MAX_SIZE \
|
||||
(ICE_MARKER_ID_SIZE * BITS_PER_BYTE - 1)
|
||||
|
|
@ -431,13 +429,13 @@ struct ice_parser_rt {
|
|||
u8 pkt_buf[ICE_PARSER_MAX_PKT_LEN + ICE_PARSER_PKT_REV];
|
||||
u16 pkt_len;
|
||||
u16 po;
|
||||
u8 bst_key[ICE_BST_KEY_SIZE];
|
||||
u8 bst_key[ICE_BST_TCAM_KEY_SIZE];
|
||||
struct ice_pg_cam_key pg_key;
|
||||
u8 pg_prio;
|
||||
struct ice_alu *alu0;
|
||||
struct ice_alu *alu1;
|
||||
struct ice_alu *alu2;
|
||||
struct ice_pg_cam_action *action;
|
||||
u8 pg_prio;
|
||||
struct ice_gpr_pu pu;
|
||||
u8 markers[ICE_MARKER_ID_SIZE];
|
||||
bool protocols[ICE_PO_PAIR_SIZE];
|
||||
|
|
|
|||
|
|
@ -125,22 +125,20 @@ static void ice_bst_key_init(struct ice_parser_rt *rt,
|
|||
else
|
||||
key[idd] = imem->b_kb.prio;
|
||||
|
||||
idd = ICE_BST_KEY_TCAM_SIZE - 1;
|
||||
idd = ICE_BST_TCAM_KEY_SIZE - 2;
|
||||
for (i = idd; i >= 0; i--) {
|
||||
int j;
|
||||
|
||||
j = ho + idd - i;
|
||||
if (j < ICE_PARSER_MAX_PKT_LEN)
|
||||
key[i] = rt->pkt_buf[ho + idd - i];
|
||||
key[i] = rt->pkt_buf[j];
|
||||
else
|
||||
key[i] = 0;
|
||||
}
|
||||
|
||||
ice_debug(rt->psr->hw, ICE_DBG_PARSER, "Generated Boost TCAM Key:\n");
|
||||
ice_debug(rt->psr->hw, ICE_DBG_PARSER, "%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",
|
||||
key[0], key[1], key[2], key[3], key[4],
|
||||
key[5], key[6], key[7], key[8], key[9]);
|
||||
ice_debug(rt->psr->hw, ICE_DBG_PARSER, "\n");
|
||||
ice_debug_array_w_prefix(rt->psr->hw, ICE_DBG_PARSER,
|
||||
KBUILD_MODNAME ": Generated Boost TCAM Key",
|
||||
key, ICE_BST_TCAM_KEY_SIZE);
|
||||
}
|
||||
|
||||
static u16 ice_bit_rev_u16(u16 v, int len)
|
||||
|
|
|
|||
|
|
@ -376,6 +376,9 @@ int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,
|
|||
if (!(le16_to_cpu(desc->flags) & IDPF_CTLQ_FLAG_DD))
|
||||
break;
|
||||
|
||||
/* Ensure no other fields are read until DD flag is checked */
|
||||
dma_rmb();
|
||||
|
||||
/* strip off FW internal code */
|
||||
desc_err = le16_to_cpu(desc->ret_val) & 0xff;
|
||||
|
||||
|
|
@ -563,6 +566,9 @@ int idpf_ctlq_recv(struct idpf_ctlq_info *cq, u16 *num_q_msg,
|
|||
if (!(flags & IDPF_CTLQ_FLAG_DD))
|
||||
break;
|
||||
|
||||
/* Ensure no other fields are read until DD flag is checked */
|
||||
dma_rmb();
|
||||
|
||||
q_msg[i].vmvf_type = (flags &
|
||||
(IDPF_CTLQ_FLAG_FTYPE_VM |
|
||||
IDPF_CTLQ_FLAG_FTYPE_PF)) >>
|
||||
|
|
|
|||
|
|
@ -174,7 +174,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
pci_set_master(pdev);
|
||||
pci_set_drvdata(pdev, adapter);
|
||||
|
||||
adapter->init_wq = alloc_workqueue("%s-%s-init", 0, 0,
|
||||
adapter->init_wq = alloc_workqueue("%s-%s-init",
|
||||
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
|
||||
dev_driver_string(dev),
|
||||
dev_name(dev));
|
||||
if (!adapter->init_wq) {
|
||||
|
|
@ -183,7 +184,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
goto err_free;
|
||||
}
|
||||
|
||||
adapter->serv_wq = alloc_workqueue("%s-%s-service", 0, 0,
|
||||
adapter->serv_wq = alloc_workqueue("%s-%s-service",
|
||||
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
|
||||
dev_driver_string(dev),
|
||||
dev_name(dev));
|
||||
if (!adapter->serv_wq) {
|
||||
|
|
@ -192,7 +194,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
goto err_serv_wq_alloc;
|
||||
}
|
||||
|
||||
adapter->mbx_wq = alloc_workqueue("%s-%s-mbx", 0, 0,
|
||||
adapter->mbx_wq = alloc_workqueue("%s-%s-mbx",
|
||||
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
|
||||
dev_driver_string(dev),
|
||||
dev_name(dev));
|
||||
if (!adapter->mbx_wq) {
|
||||
|
|
@ -201,7 +204,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
goto err_mbx_wq_alloc;
|
||||
}
|
||||
|
||||
adapter->stats_wq = alloc_workqueue("%s-%s-stats", 0, 0,
|
||||
adapter->stats_wq = alloc_workqueue("%s-%s-stats",
|
||||
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
|
||||
dev_driver_string(dev),
|
||||
dev_name(dev));
|
||||
if (!adapter->stats_wq) {
|
||||
|
|
@ -210,7 +214,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
goto err_stats_wq_alloc;
|
||||
}
|
||||
|
||||
adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event", 0, 0,
|
||||
adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event",
|
||||
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
|
||||
dev_driver_string(dev),
|
||||
dev_name(dev));
|
||||
if (!adapter->vc_event_wq) {
|
||||
|
|
|
|||
|
|
@ -517,8 +517,10 @@ static ssize_t idpf_vc_xn_exec(struct idpf_adapter *adapter,
|
|||
retval = -ENXIO;
|
||||
goto only_unlock;
|
||||
case IDPF_VC_XN_WAITING:
|
||||
dev_notice_ratelimited(&adapter->pdev->dev, "Transaction timed-out (op %d, %dms)\n",
|
||||
params->vc_op, params->timeout_ms);
|
||||
dev_notice_ratelimited(&adapter->pdev->dev,
|
||||
"Transaction timed-out (op:%d cookie:%04x vc_op:%d salt:%02x timeout:%dms)\n",
|
||||
params->vc_op, cookie, xn->vc_op,
|
||||
xn->salt, params->timeout_ms);
|
||||
retval = -ETIME;
|
||||
break;
|
||||
case IDPF_VC_XN_COMPLETED_SUCCESS:
|
||||
|
|
@ -612,14 +614,16 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter,
|
|||
return -EINVAL;
|
||||
}
|
||||
xn = &adapter->vcxn_mngr->ring[xn_idx];
|
||||
idpf_vc_xn_lock(xn);
|
||||
salt = FIELD_GET(IDPF_VC_XN_SALT_M, msg_info);
|
||||
if (xn->salt != salt) {
|
||||
dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (%02x != %02x)\n",
|
||||
xn->salt, salt);
|
||||
dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (exp:%d@%02x(%d) != got:%d@%02x)\n",
|
||||
xn->vc_op, xn->salt, xn->state,
|
||||
ctlq_msg->cookie.mbx.chnl_opcode, salt);
|
||||
idpf_vc_xn_unlock(xn);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
idpf_vc_xn_lock(xn);
|
||||
switch (xn->state) {
|
||||
case IDPF_VC_XN_WAITING:
|
||||
/* success */
|
||||
|
|
@ -3077,12 +3081,21 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)
|
|||
*/
|
||||
void idpf_vc_core_deinit(struct idpf_adapter *adapter)
|
||||
{
|
||||
bool remove_in_prog;
|
||||
|
||||
if (!test_bit(IDPF_VC_CORE_INIT, adapter->flags))
|
||||
return;
|
||||
|
||||
/* Avoid transaction timeouts when called during reset */
|
||||
remove_in_prog = test_bit(IDPF_REMOVE_IN_PROG, adapter->flags);
|
||||
if (!remove_in_prog)
|
||||
idpf_vc_xn_shutdown(adapter->vcxn_mngr);
|
||||
|
||||
idpf_deinit_task(adapter);
|
||||
idpf_intr_rel(adapter);
|
||||
idpf_vc_xn_shutdown(adapter->vcxn_mngr);
|
||||
|
||||
if (remove_in_prog)
|
||||
idpf_vc_xn_shutdown(adapter->vcxn_mngr);
|
||||
|
||||
cancel_delayed_work_sync(&adapter->serv_task);
|
||||
cancel_delayed_work_sync(&adapter->mbx_task);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user