Skip to content

Commit b2aec4e

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 463ec95 + ee7d794 commit b2aec4e

File tree

9 files changed

+59
-27
lines changed

9 files changed

+59
-27
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,11 @@ iavf_vlan_filter *iavf_add_vlan(struct iavf_adapter *adapter,
773773
f->state = IAVF_VLAN_ADD;
774774
adapter->num_vlan_filters++;
775775
iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_VLAN_FILTER);
776+
} else if (f->state == IAVF_VLAN_REMOVE) {
777+
/* IAVF_VLAN_REMOVE means that VLAN wasn't yet removed.
778+
* We can safely only change the state here.
779+
*/
780+
f->state = IAVF_VLAN_ACTIVE;
776781
}
777782

778783
clearout:
@@ -793,8 +798,18 @@ static void iavf_del_vlan(struct iavf_adapter *adapter, struct iavf_vlan vlan)
793798

794799
f = iavf_find_vlan(adapter, vlan);
795800
if (f) {
796-
f->state = IAVF_VLAN_REMOVE;
797-
iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_DEL_VLAN_FILTER);
801+
/* IAVF_ADD_VLAN means that VLAN wasn't even added yet.
802+
* Remove it from the list.
803+
*/
804+
if (f->state == IAVF_VLAN_ADD) {
805+
list_del(&f->list);
806+
kfree(f);
807+
adapter->num_vlan_filters--;
808+
} else {
809+
f->state = IAVF_VLAN_REMOVE;
810+
iavf_schedule_aq_request(adapter,
811+
IAVF_FLAG_AQ_DEL_VLAN_FILTER);
812+
}
798813
}
799814

800815
spin_unlock_bh(&adapter->mac_vlan_list_lock);

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,6 @@ struct ice_aqc_dnl_equa_param {
14981498
#define ICE_AQC_RX_EQU_POST1 (0x12 << ICE_AQC_RX_EQU_SHIFT)
14991499
#define ICE_AQC_RX_EQU_BFLF (0x13 << ICE_AQC_RX_EQU_SHIFT)
15001500
#define ICE_AQC_RX_EQU_BFHF (0x14 << ICE_AQC_RX_EQU_SHIFT)
1501-
#define ICE_AQC_RX_EQU_DRATE (0x15 << ICE_AQC_RX_EQU_SHIFT)
15021501
#define ICE_AQC_RX_EQU_CTLE_GAINHF (0x20 << ICE_AQC_RX_EQU_SHIFT)
15031502
#define ICE_AQC_RX_EQU_CTLE_GAINLF (0x21 << ICE_AQC_RX_EQU_SHIFT)
15041503
#define ICE_AQC_RX_EQU_CTLE_GAINDC (0x22 << ICE_AQC_RX_EQU_SHIFT)

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,6 @@ static int ice_get_tx_rx_equa(struct ice_hw *hw, u8 serdes_num,
710710
{ ICE_AQC_RX_EQU_POST1, rx, &ptr->rx_equ_post1 },
711711
{ ICE_AQC_RX_EQU_BFLF, rx, &ptr->rx_equ_bflf },
712712
{ ICE_AQC_RX_EQU_BFHF, rx, &ptr->rx_equ_bfhf },
713-
{ ICE_AQC_RX_EQU_DRATE, rx, &ptr->rx_equ_drate },
714713
{ ICE_AQC_RX_EQU_CTLE_GAINHF, rx, &ptr->rx_equ_ctle_gainhf },
715714
{ ICE_AQC_RX_EQU_CTLE_GAINLF, rx, &ptr->rx_equ_ctle_gainlf },
716715
{ ICE_AQC_RX_EQU_CTLE_GAINDC, rx, &ptr->rx_equ_ctle_gaindc },

drivers/net/ethernet/intel/ice/ice_ethtool.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ struct ice_serdes_equalization_to_ethtool {
1515
int rx_equ_post1;
1616
int rx_equ_bflf;
1717
int rx_equ_bfhf;
18-
int rx_equ_drate;
1918
int rx_equ_ctle_gainhf;
2019
int rx_equ_ctle_gainlf;
2120
int rx_equ_ctle_gaindc;

drivers/net/ethernet/intel/ice/ice_parser.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ ice_pg_nm_cam_match(struct ice_pg_nm_cam_item *table, int size,
257257
/*** ICE_SID_RXPARSER_BOOST_TCAM and ICE_SID_LBL_RXPARSER_TMEM sections ***/
258258
#define ICE_BST_TCAM_TABLE_SIZE 256
259259
#define ICE_BST_TCAM_KEY_SIZE 20
260-
#define ICE_BST_KEY_TCAM_SIZE 19
261260

262261
/* Boost TCAM item */
263262
struct ice_bst_tcam_item {
@@ -401,7 +400,6 @@ u16 ice_xlt_kb_flag_get(struct ice_xlt_kb *kb, u64 pkt_flag);
401400
#define ICE_PARSER_GPR_NUM 128
402401
#define ICE_PARSER_FLG_NUM 64
403402
#define ICE_PARSER_ERR_NUM 16
404-
#define ICE_BST_KEY_SIZE 10
405403
#define ICE_MARKER_ID_SIZE 9
406404
#define ICE_MARKER_MAX_SIZE \
407405
(ICE_MARKER_ID_SIZE * BITS_PER_BYTE - 1)
@@ -431,13 +429,13 @@ struct ice_parser_rt {
431429
u8 pkt_buf[ICE_PARSER_MAX_PKT_LEN + ICE_PARSER_PKT_REV];
432430
u16 pkt_len;
433431
u16 po;
434-
u8 bst_key[ICE_BST_KEY_SIZE];
432+
u8 bst_key[ICE_BST_TCAM_KEY_SIZE];
435433
struct ice_pg_cam_key pg_key;
434+
u8 pg_prio;
436435
struct ice_alu *alu0;
437436
struct ice_alu *alu1;
438437
struct ice_alu *alu2;
439438
struct ice_pg_cam_action *action;
440-
u8 pg_prio;
441439
struct ice_gpr_pu pu;
442440
u8 markers[ICE_MARKER_ID_SIZE];
443441
bool protocols[ICE_PO_PAIR_SIZE];

drivers/net/ethernet/intel/ice/ice_parser_rt.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,20 @@ static void ice_bst_key_init(struct ice_parser_rt *rt,
125125
else
126126
key[idd] = imem->b_kb.prio;
127127

128-
idd = ICE_BST_KEY_TCAM_SIZE - 1;
128+
idd = ICE_BST_TCAM_KEY_SIZE - 2;
129129
for (i = idd; i >= 0; i--) {
130130
int j;
131131

132132
j = ho + idd - i;
133133
if (j < ICE_PARSER_MAX_PKT_LEN)
134-
key[i] = rt->pkt_buf[ho + idd - i];
134+
key[i] = rt->pkt_buf[j];
135135
else
136136
key[i] = 0;
137137
}
138138

139-
ice_debug(rt->psr->hw, ICE_DBG_PARSER, "Generated Boost TCAM Key:\n");
140-
ice_debug(rt->psr->hw, ICE_DBG_PARSER, "%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",
141-
key[0], key[1], key[2], key[3], key[4],
142-
key[5], key[6], key[7], key[8], key[9]);
143-
ice_debug(rt->psr->hw, ICE_DBG_PARSER, "\n");
139+
ice_debug_array_w_prefix(rt->psr->hw, ICE_DBG_PARSER,
140+
KBUILD_MODNAME ": Generated Boost TCAM Key",
141+
key, ICE_BST_TCAM_KEY_SIZE);
144142
}
145143

146144
static u16 ice_bit_rev_u16(u16 v, int len)

drivers/net/ethernet/intel/idpf/idpf_controlq.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,
376376
if (!(le16_to_cpu(desc->flags) & IDPF_CTLQ_FLAG_DD))
377377
break;
378378

379+
/* Ensure no other fields are read until DD flag is checked */
380+
dma_rmb();
381+
379382
/* strip off FW internal code */
380383
desc_err = le16_to_cpu(desc->ret_val) & 0xff;
381384

@@ -563,6 +566,9 @@ int idpf_ctlq_recv(struct idpf_ctlq_info *cq, u16 *num_q_msg,
563566
if (!(flags & IDPF_CTLQ_FLAG_DD))
564567
break;
565568

569+
/* Ensure no other fields are read until DD flag is checked */
570+
dma_rmb();
571+
566572
q_msg[i].vmvf_type = (flags &
567573
(IDPF_CTLQ_FLAG_FTYPE_VM |
568574
IDPF_CTLQ_FLAG_FTYPE_PF)) >>

drivers/net/ethernet/intel/idpf/idpf_main.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
174174
pci_set_master(pdev);
175175
pci_set_drvdata(pdev, adapter);
176176

177-
adapter->init_wq = alloc_workqueue("%s-%s-init", 0, 0,
177+
adapter->init_wq = alloc_workqueue("%s-%s-init",
178+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
178179
dev_driver_string(dev),
179180
dev_name(dev));
180181
if (!adapter->init_wq) {
@@ -183,7 +184,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
183184
goto err_free;
184185
}
185186

186-
adapter->serv_wq = alloc_workqueue("%s-%s-service", 0, 0,
187+
adapter->serv_wq = alloc_workqueue("%s-%s-service",
188+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
187189
dev_driver_string(dev),
188190
dev_name(dev));
189191
if (!adapter->serv_wq) {
@@ -192,7 +194,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
192194
goto err_serv_wq_alloc;
193195
}
194196

195-
adapter->mbx_wq = alloc_workqueue("%s-%s-mbx", 0, 0,
197+
adapter->mbx_wq = alloc_workqueue("%s-%s-mbx",
198+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
196199
dev_driver_string(dev),
197200
dev_name(dev));
198201
if (!adapter->mbx_wq) {
@@ -201,7 +204,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
201204
goto err_mbx_wq_alloc;
202205
}
203206

204-
adapter->stats_wq = alloc_workqueue("%s-%s-stats", 0, 0,
207+
adapter->stats_wq = alloc_workqueue("%s-%s-stats",
208+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
205209
dev_driver_string(dev),
206210
dev_name(dev));
207211
if (!adapter->stats_wq) {
@@ -210,7 +214,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
210214
goto err_stats_wq_alloc;
211215
}
212216

213-
adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event", 0, 0,
217+
adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event",
218+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
214219
dev_driver_string(dev),
215220
dev_name(dev));
216221
if (!adapter->vc_event_wq) {

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,10 @@ static ssize_t idpf_vc_xn_exec(struct idpf_adapter *adapter,
517517
retval = -ENXIO;
518518
goto only_unlock;
519519
case IDPF_VC_XN_WAITING:
520-
dev_notice_ratelimited(&adapter->pdev->dev, "Transaction timed-out (op %d, %dms)\n",
521-
params->vc_op, params->timeout_ms);
520+
dev_notice_ratelimited(&adapter->pdev->dev,
521+
"Transaction timed-out (op:%d cookie:%04x vc_op:%d salt:%02x timeout:%dms)\n",
522+
params->vc_op, cookie, xn->vc_op,
523+
xn->salt, params->timeout_ms);
522524
retval = -ETIME;
523525
break;
524526
case IDPF_VC_XN_COMPLETED_SUCCESS:
@@ -612,14 +614,16 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter,
612614
return -EINVAL;
613615
}
614616
xn = &adapter->vcxn_mngr->ring[xn_idx];
617+
idpf_vc_xn_lock(xn);
615618
salt = FIELD_GET(IDPF_VC_XN_SALT_M, msg_info);
616619
if (xn->salt != salt) {
617-
dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (%02x != %02x)\n",
618-
xn->salt, salt);
620+
dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (exp:%d@%02x(%d) != got:%d@%02x)\n",
621+
xn->vc_op, xn->salt, xn->state,
622+
ctlq_msg->cookie.mbx.chnl_opcode, salt);
623+
idpf_vc_xn_unlock(xn);
619624
return -EINVAL;
620625
}
621626

622-
idpf_vc_xn_lock(xn);
623627
switch (xn->state) {
624628
case IDPF_VC_XN_WAITING:
625629
/* success */
@@ -3077,12 +3081,21 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)
30773081
*/
30783082
void idpf_vc_core_deinit(struct idpf_adapter *adapter)
30793083
{
3084+
bool remove_in_prog;
3085+
30803086
if (!test_bit(IDPF_VC_CORE_INIT, adapter->flags))
30813087
return;
30823088

3089+
/* Avoid transaction timeouts when called during reset */
3090+
remove_in_prog = test_bit(IDPF_REMOVE_IN_PROG, adapter->flags);
3091+
if (!remove_in_prog)
3092+
idpf_vc_xn_shutdown(adapter->vcxn_mngr);
3093+
30833094
idpf_deinit_task(adapter);
30843095
idpf_intr_rel(adapter);
3085-
idpf_vc_xn_shutdown(adapter->vcxn_mngr);
3096+
3097+
if (remove_in_prog)
3098+
idpf_vc_xn_shutdown(adapter->vcxn_mngr);
30863099

30873100
cancel_delayed_work_sync(&adapter->serv_task);
30883101
cancel_delayed_work_sync(&adapter->mbx_task);

0 commit comments

Comments
 (0)