Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2025-04-02 (igc, e1000e, ixgbe, idpf)

For igc:
Joe Damato removes unmapping of XSK queues from NAPI instance.

Zdenek Bouska swaps condition checks/call to prevent AF_XDP Tx drops
with low budget value.

For e1000e:
Vitaly adjusts Kumeran interface configuration to prevent MDI errors.

For ixgbe:
Piotr clears PHY high values on media type detection to ensure stale
values are not used.

For idpf:
Emil adjusts shutdown calls to prevent NULL pointer dereference.

* '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
idpf: fix adapter NULL pointer dereference on reboot
ixgbe: fix media type detection for E610 device
e1000e: change k1 configuration on MTP and later platforms
igc: Fix TX drops in XDP ZC
igc: Fix XSK queue NAPI ID mapping
====================

Link: https://patch.msgid.link/20250402173900.1957261-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+93 -14
+3
drivers/net/ethernet/intel/e1000e/defines.h
··· 803 803 /* SerDes Control */ 804 804 #define E1000_GEN_POLL_TIMEOUT 640 805 805 806 + #define E1000_FEXTNVM12_PHYPD_CTRL_MASK 0x00C00000 807 + #define E1000_FEXTNVM12_PHYPD_CTRL_P1 0x00800000 808 + 806 809 #endif /* _E1000_DEFINES_H_ */
+75 -5
drivers/net/ethernet/intel/e1000e/ich8lan.c
··· 286 286 } 287 287 288 288 /** 289 + * e1000_reconfigure_k1_exit_timeout - reconfigure K1 exit timeout to 290 + * align to MTP and later platform requirements. 291 + * @hw: pointer to the HW structure 292 + * 293 + * Context: PHY semaphore must be held by caller. 294 + * Return: 0 on success, negative on failure 295 + */ 296 + static s32 e1000_reconfigure_k1_exit_timeout(struct e1000_hw *hw) 297 + { 298 + u16 phy_timeout; 299 + u32 fextnvm12; 300 + s32 ret_val; 301 + 302 + if (hw->mac.type < e1000_pch_mtp) 303 + return 0; 304 + 305 + /* Change Kumeran K1 power down state from P0s to P1 */ 306 + fextnvm12 = er32(FEXTNVM12); 307 + fextnvm12 &= ~E1000_FEXTNVM12_PHYPD_CTRL_MASK; 308 + fextnvm12 |= E1000_FEXTNVM12_PHYPD_CTRL_P1; 309 + ew32(FEXTNVM12, fextnvm12); 310 + 311 + /* Wait for the interface the settle */ 312 + usleep_range(1000, 1100); 313 + 314 + /* Change K1 exit timeout */ 315 + ret_val = e1e_rphy_locked(hw, I217_PHY_TIMEOUTS_REG, 316 + &phy_timeout); 317 + if (ret_val) 318 + return ret_val; 319 + 320 + phy_timeout &= ~I217_PHY_TIMEOUTS_K1_EXIT_TO_MASK; 321 + phy_timeout |= 0xF00; 322 + 323 + return e1e_wphy_locked(hw, I217_PHY_TIMEOUTS_REG, 324 + phy_timeout); 325 + } 326 + 327 + /** 289 328 * e1000_init_phy_workarounds_pchlan - PHY initialization workarounds 290 329 * @hw: pointer to the HW structure 291 330 * ··· 366 327 * LANPHYPC Value bit to force the interconnect to PCIe mode. 367 328 */ 368 329 switch (hw->mac.type) { 330 + case e1000_pch_mtp: 331 + case e1000_pch_lnp: 332 + case e1000_pch_ptp: 333 + case e1000_pch_nvp: 334 + /* At this point the PHY might be inaccessible so don't 335 + * propagate the failure 336 + */ 337 + if (e1000_reconfigure_k1_exit_timeout(hw)) 338 + e_dbg("Failed to reconfigure K1 exit timeout\n"); 339 + 340 + fallthrough; 369 341 case e1000_pch_lpt: 370 342 case e1000_pch_spt: 371 343 case e1000_pch_cnp: 372 344 case e1000_pch_tgp: 373 345 case e1000_pch_adp: 374 - case e1000_pch_mtp: 375 - case e1000_pch_lnp: 376 - case e1000_pch_ptp: 377 - case e1000_pch_nvp: 378 346 if (e1000_phy_is_accessible_pchlan(hw)) 379 347 break; 380 348 ··· 465 419 * the PHY is in. 466 420 */ 467 421 ret_val = hw->phy.ops.check_reset_block(hw); 468 - if (ret_val) 422 + if (ret_val) { 469 423 e_err("ME blocked access to PHY after reset\n"); 424 + goto out; 425 + } 426 + 427 + if (hw->mac.type >= e1000_pch_mtp) { 428 + ret_val = hw->phy.ops.acquire(hw); 429 + if (ret_val) { 430 + e_err("Failed to reconfigure K1 exit timeout\n"); 431 + goto out; 432 + } 433 + ret_val = e1000_reconfigure_k1_exit_timeout(hw); 434 + hw->phy.ops.release(hw); 435 + } 470 436 } 471 437 472 438 out: ··· 4946 4888 u16 i; 4947 4889 4948 4890 e1000_initialize_hw_bits_ich8lan(hw); 4891 + if (hw->mac.type >= e1000_pch_mtp) { 4892 + ret_val = hw->phy.ops.acquire(hw); 4893 + if (ret_val) 4894 + return ret_val; 4895 + 4896 + ret_val = e1000_reconfigure_k1_exit_timeout(hw); 4897 + hw->phy.ops.release(hw); 4898 + if (ret_val) { 4899 + e_dbg("Error failed to reconfigure K1 exit timeout\n"); 4900 + return ret_val; 4901 + } 4902 + } 4949 4903 4950 4904 /* Initialize identification LED */ 4951 4905 ret_val = mac->ops.id_led_init(hw);
+4
drivers/net/ethernet/intel/e1000e/ich8lan.h
··· 219 219 #define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28) 220 220 #define I217_PLL_CLOCK_GATE_MASK 0x07FF 221 221 222 + /* PHY Timeouts */ 223 + #define I217_PHY_TIMEOUTS_REG PHY_REG(770, 21) 224 + #define I217_PHY_TIMEOUTS_K1_EXIT_TO_MASK 0x0FC0 225 + 222 226 #define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */ 223 227 224 228 /* Inband Control */
+5 -1
drivers/net/ethernet/intel/idpf/idpf_main.c
··· 87 87 */ 88 88 static void idpf_shutdown(struct pci_dev *pdev) 89 89 { 90 - idpf_remove(pdev); 90 + struct idpf_adapter *adapter = pci_get_drvdata(pdev); 91 + 92 + cancel_delayed_work_sync(&adapter->vc_event_task); 93 + idpf_vc_core_deinit(adapter); 94 + idpf_deinit_dflt_mbx(adapter); 91 95 92 96 if (system_state == SYSTEM_POWER_OFF) 93 97 pci_set_power_state(pdev, PCI_D3hot);
-2
drivers/net/ethernet/intel/igc/igc.h
··· 337 337 struct igc_led_classdev *leds; 338 338 }; 339 339 340 - void igc_set_queue_napi(struct igc_adapter *adapter, int q_idx, 341 - struct napi_struct *napi); 342 340 void igc_up(struct igc_adapter *adapter); 343 341 void igc_down(struct igc_adapter *adapter); 344 342 int igc_open(struct net_device *netdev);
+3 -3
drivers/net/ethernet/intel/igc/igc_main.c
··· 3042 3042 * descriptors. Therefore, to be safe, we always ensure we have at least 3043 3043 * 4 descriptors available. 3044 3044 */ 3045 - while (xsk_tx_peek_desc(pool, &xdp_desc) && budget >= 4) { 3045 + while (budget >= 4 && xsk_tx_peek_desc(pool, &xdp_desc)) { 3046 3046 struct igc_metadata_request meta_req; 3047 3047 struct xsk_tx_metadata *meta = NULL; 3048 3048 struct igc_tx_buffer *bi; ··· 5022 5022 return 0; 5023 5023 } 5024 5024 5025 - void igc_set_queue_napi(struct igc_adapter *adapter, int vector, 5026 - struct napi_struct *napi) 5025 + static void igc_set_queue_napi(struct igc_adapter *adapter, int vector, 5026 + struct napi_struct *napi) 5027 5027 { 5028 5028 struct igc_q_vector *q_vector = adapter->q_vector[vector]; 5029 5029
-2
drivers/net/ethernet/intel/igc/igc_xdp.c
··· 97 97 napi_disable(napi); 98 98 } 99 99 100 - igc_set_queue_napi(adapter, queue_id, NULL); 101 100 set_bit(IGC_RING_FLAG_AF_XDP_ZC, &rx_ring->flags); 102 101 set_bit(IGC_RING_FLAG_AF_XDP_ZC, &tx_ring->flags); 103 102 ··· 146 147 xsk_pool_dma_unmap(pool, IGC_RX_DMA_ATTR); 147 148 clear_bit(IGC_RING_FLAG_AF_XDP_ZC, &rx_ring->flags); 148 149 clear_bit(IGC_RING_FLAG_AF_XDP_ZC, &tx_ring->flags); 149 - igc_set_queue_napi(adapter, queue_id, napi); 150 150 151 151 if (needs_reset) { 152 152 napi_enable(napi);
+3 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
··· 1453 1453 hw->link.link_info.phy_type_low = 0; 1454 1454 } else { 1455 1455 highest_bit = fls64(le64_to_cpu(pcaps.phy_type_low)); 1456 - if (highest_bit) 1456 + if (highest_bit) { 1457 1457 hw->link.link_info.phy_type_low = 1458 1458 BIT_ULL(highest_bit - 1); 1459 + hw->link.link_info.phy_type_high = 0; 1460 + } 1459 1461 } 1460 1462 } 1461 1463