Skip to content

Commit 22ee378

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2024-10-08 (ice, iavf, igb, e1000e, e1000) This series contains updates to ice, iavf, igb, e1000e, and e1000 drivers. For ice: Wojciech adds support for ethtool reset. Paul adds support for hardware based VF mailbox limits for E830 devices. Jake adjusts to a common iterator in ice_vc_cfg_qs_msg() and moves storing of max_frame and rx_buf_len from VSI struct to the ring structure. Hongbo Li uses assign_bit() to replace an open-coded instance. Markus Elfring adjusts a couple of PTP error paths to use a common, shared exit point. Yue Haibing removes unused declarations. For iavf: Yue Haibing removes unused declarations. For igb: Yue Haibing removes unused declarations. For e1000e: Takamitsu Iwai removes unneccessary writel() calls. Joe Damato adds support for netdev-genl support to query IRQ, NAPI, and queue information. For e1000: Joe Damato adds support for netdev-genl support to query IRQ, NAPI, and queue information. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: e1000: Link NAPI instances to queues and IRQs e1000e: Link NAPI instances to queues and IRQs e1000e: Remove duplicated writel() in e1000_configure_tx/rx() igb: Cleanup unused declarations iavf: Remove unused declarations ice: Cleanup unused declarations ice: Use common error handling code in two functions ice: Make use of assign_bit() API ice: store max_frame and rx_buf_len only in ice_rx_ring ice: consistently use q_idx in ice_vc_cfg_qs_msg() ice: add E830 HW VF mailbox message limit support ice: Implement ethtool reset support ==================== Link: https://patch.msgid.link/20241008233441.928802-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 80c549c + 8f7ff18 commit 22ee378

File tree

25 files changed

+269
-100
lines changed

25 files changed

+269
-100
lines changed

Documentation/networking/device_drivers/ethernet/intel/ice.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,37 @@ example, if Rx packets are 10 and Netdev (software statistics) displays
101101
rx_bytes as "X", then ethtool (hardware statistics) will display rx_bytes as
102102
"X+40" (4 bytes CRC x 10 packets).
103103

104+
ethtool reset
105+
-------------
106+
The driver supports 3 types of resets:
107+
108+
- PF reset - resets only components associated with the given PF, does not
109+
impact other PFs
110+
111+
- CORE reset - whole adapter is affected, reset all PFs
112+
113+
- GLOBAL reset - same as CORE but mac and phy components are also reinitialized
114+
115+
These are mapped to ethtool reset flags as follow:
116+
117+
- PF reset:
118+
119+
# ethtool --reset <ethX> irq dma filter offload
120+
121+
- CORE reset:
122+
123+
# ethtool --reset <ethX> irq-shared dma-shared filter-shared offload-shared \
124+
ram-shared
125+
126+
- GLOBAL reset:
127+
128+
# ethtool --reset <ethX> irq-shared dma-shared filter-shared offload-shared \
129+
mac-shared phy-shared ram-shared
130+
131+
In switchdev mode you can reset a VF using port representor:
132+
133+
# ethtool --reset <repr> irq dma filter offload
134+
104135

105136
Viewing Link Messages
106137
---------------------

drivers/net/ethernet/intel/e1000/e1000_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,8 @@ void e1000_down(struct e1000_adapter *adapter)
513513
*/
514514
netif_carrier_off(netdev);
515515

516+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, NULL);
517+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, NULL);
516518
napi_disable(&adapter->napi);
517519

518520
e1000_irq_disable(adapter);
@@ -1392,7 +1394,10 @@ int e1000_open(struct net_device *netdev)
13921394
/* From here on the code is the same as e1000_up() */
13931395
clear_bit(__E1000_DOWN, &adapter->flags);
13941396

1397+
netif_napi_set_irq(&adapter->napi, adapter->pdev->irq);
13951398
napi_enable(&adapter->napi);
1399+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, &adapter->napi);
1400+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, &adapter->napi);
13961401

13971402
e1000_irq_enable(adapter);
13981403

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,11 +2928,8 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
29282928
tx_ring->head = adapter->hw.hw_addr + E1000_TDH(0);
29292929
tx_ring->tail = adapter->hw.hw_addr + E1000_TDT(0);
29302930

2931-
writel(0, tx_ring->head);
29322931
if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA)
29332932
e1000e_update_tdt_wa(tx_ring, 0);
2934-
else
2935-
writel(0, tx_ring->tail);
29362933

29372934
/* Set the Tx Interrupt Delay register */
29382935
ew32(TIDV, adapter->tx_int_delay);
@@ -3253,11 +3250,8 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
32533250
rx_ring->head = adapter->hw.hw_addr + E1000_RDH(0);
32543251
rx_ring->tail = adapter->hw.hw_addr + E1000_RDT(0);
32553252

3256-
writel(0, rx_ring->head);
32573253
if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA)
32583254
e1000e_update_rdt_wa(rx_ring, 0);
3259-
else
3260-
writel(0, rx_ring->tail);
32613255

32623256
/* Enable Receive Checksum Offload for TCP and UDP */
32633257
rxcsum = er32(RXCSUM);
@@ -4613,6 +4607,7 @@ int e1000e_open(struct net_device *netdev)
46134607
struct e1000_hw *hw = &adapter->hw;
46144608
struct pci_dev *pdev = adapter->pdev;
46154609
int err;
4610+
int irq;
46164611

46174612
/* disallow open during test */
46184613
if (test_bit(__E1000_TESTING, &adapter->state))
@@ -4676,7 +4671,15 @@ int e1000e_open(struct net_device *netdev)
46764671
/* From here on the code is the same as e1000e_up() */
46774672
clear_bit(__E1000_DOWN, &adapter->state);
46784673

4674+
if (adapter->int_mode == E1000E_INT_MODE_MSIX)
4675+
irq = adapter->msix_entries[0].vector;
4676+
else
4677+
irq = adapter->pdev->irq;
4678+
4679+
netif_napi_set_irq(&adapter->napi, irq);
46794680
napi_enable(&adapter->napi);
4681+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, &adapter->napi);
4682+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, &adapter->napi);
46804683

46814684
e1000_irq_enable(adapter);
46824685

@@ -4735,6 +4738,8 @@ int e1000e_close(struct net_device *netdev)
47354738
netdev_info(netdev, "NIC Link is Down\n");
47364739
}
47374740

4741+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, NULL);
4742+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, NULL);
47384743
napi_disable(&adapter->napi);
47394744

47404745
e1000e_free_tx_resources(adapter->tx_ring);

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -529,22 +529,16 @@ static inline void iavf_change_state(struct iavf_adapter *adapter,
529529
iavf_state_str(adapter->state));
530530
}
531531

532-
int iavf_up(struct iavf_adapter *adapter);
533532
void iavf_down(struct iavf_adapter *adapter);
534533
int iavf_process_config(struct iavf_adapter *adapter);
535534
int iavf_parse_vf_resource_msg(struct iavf_adapter *adapter);
536535
void iavf_schedule_reset(struct iavf_adapter *adapter, u64 flags);
537536
void iavf_schedule_aq_request(struct iavf_adapter *adapter, u64 flags);
538537
void iavf_schedule_finish_config(struct iavf_adapter *adapter);
539-
void iavf_reset(struct iavf_adapter *adapter);
540538
void iavf_set_ethtool_ops(struct net_device *netdev);
541-
void iavf_update_stats(struct iavf_adapter *adapter);
542539
void iavf_free_all_tx_resources(struct iavf_adapter *adapter);
543540
void iavf_free_all_rx_resources(struct iavf_adapter *adapter);
544541

545-
void iavf_napi_add_all(struct iavf_adapter *adapter);
546-
void iavf_napi_del_all(struct iavf_adapter *adapter);
547-
548542
int iavf_send_api_ver(struct iavf_adapter *adapter);
549543
int iavf_verify_api_ver(struct iavf_adapter *adapter);
550544
int iavf_send_vf_config_msg(struct iavf_adapter *adapter);
@@ -555,11 +549,9 @@ void iavf_set_queue_vlan_tag_loc(struct iavf_adapter *adapter);
555549
u16 iavf_get_num_vlans_added(struct iavf_adapter *adapter);
556550
void iavf_irq_enable(struct iavf_adapter *adapter, bool flush);
557551
void iavf_configure_queues(struct iavf_adapter *adapter);
558-
void iavf_deconfigure_queues(struct iavf_adapter *adapter);
559552
void iavf_enable_queues(struct iavf_adapter *adapter);
560553
void iavf_disable_queues(struct iavf_adapter *adapter);
561554
void iavf_map_queues(struct iavf_adapter *adapter);
562-
int iavf_request_queues(struct iavf_adapter *adapter, int num);
563555
void iavf_add_ether_addrs(struct iavf_adapter *adapter);
564556
void iavf_del_ether_addrs(struct iavf_adapter *adapter);
565557
void iavf_add_vlans(struct iavf_adapter *adapter);
@@ -579,8 +571,6 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
579571
enum virtchnl_ops v_opcode,
580572
enum iavf_status v_retval, u8 *msg, u16 msglen);
581573
int iavf_config_rss(struct iavf_adapter *adapter);
582-
int iavf_lan_add_device(struct iavf_adapter *adapter);
583-
int iavf_lan_del_device(struct iavf_adapter *adapter);
584574
void iavf_enable_channels(struct iavf_adapter *adapter);
585575
void iavf_disable_channels(struct iavf_adapter *adapter);
586576
void iavf_add_cloud_filter(struct iavf_adapter *adapter);

drivers/net/ethernet/intel/iavf/iavf_prototype.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
/* adminq functions */
1919
enum iavf_status iavf_init_adminq(struct iavf_hw *hw);
2020
enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw);
21-
void iavf_adminq_init_ring_data(struct iavf_hw *hw);
2221
enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw,
2322
struct iavf_arq_event_info *e,
2423
u16 *events_pending);
@@ -33,8 +32,6 @@ bool iavf_asq_done(struct iavf_hw *hw);
3332
void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask,
3433
void *desc, void *buffer, u16 buf_len);
3534

36-
void iavf_idle_aq(struct iavf_hw *hw);
37-
void iavf_resume_aq(struct iavf_hw *hw);
3835
bool iavf_check_asq_alive(struct iavf_hw *hw);
3936
enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading);
4037
const char *iavf_aq_str(struct iavf_hw *hw, enum iavf_admin_queue_err aq_err);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ enum ice_feature {
207207
ICE_F_GNSS,
208208
ICE_F_ROCE_LAG,
209209
ICE_F_SRIOV_LAG,
210+
ICE_F_MBX_LIMIT,
210211
ICE_F_MAX
211212
};
212213

@@ -371,9 +372,6 @@ struct ice_vsi {
371372
spinlock_t arfs_lock; /* protects aRFS hash table and filter state */
372373
atomic_t *arfs_last_fltr_id;
373374

374-
u16 max_frame;
375-
u16 rx_buf_len;
376-
377375
struct ice_aqc_vsi_props info; /* VSI properties */
378376
struct ice_vsi_vlan_info vlan_info; /* vlan config to be restored */
379377

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ static int ice_setup_rx_ctx(struct ice_rx_ring *ring)
445445
/* Max packet size for this queue - must not be set to a larger value
446446
* than 5 x DBUF
447447
*/
448-
rlan_ctx.rxmax = min_t(u32, vsi->max_frame,
448+
rlan_ctx.rxmax = min_t(u32, ring->max_frame,
449449
ICE_MAX_CHAINED_RX_BUFS * ring->rx_buf_len);
450450

451451
/* Rx queue threshold in units of 64 */
@@ -541,8 +541,6 @@ static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
541541
u32 num_bufs = ICE_RX_DESC_UNUSED(ring);
542542
int err;
543543

544-
ring->rx_buf_len = ring->vsi->rx_buf_len;
545-
546544
if (ring->vsi->type == ICE_VSI_PF || ring->vsi->type == ICE_VSI_SF) {
547545
if (!xdp_rxq_info_is_reg(&ring->xdp_rxq)) {
548546
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
@@ -641,21 +639,25 @@ int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx)
641639
/**
642640
* ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length
643641
* @vsi: VSI
642+
* @ring: Rx ring to configure
643+
*
644+
* Determine the maximum frame size and Rx buffer length to use for a PF VSI.
645+
* Set these in the associated Rx ring structure.
644646
*/
645-
static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi)
647+
static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi, struct ice_rx_ring *ring)
646648
{
647649
if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) {
648-
vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX;
649-
vsi->rx_buf_len = ICE_RXBUF_1664;
650+
ring->max_frame = ICE_MAX_FRAME_LEGACY_RX;
651+
ring->rx_buf_len = ICE_RXBUF_1664;
650652
#if (PAGE_SIZE < 8192)
651653
} else if (!ICE_2K_TOO_SMALL_WITH_PADDING &&
652654
(vsi->netdev->mtu <= ETH_DATA_LEN)) {
653-
vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN;
654-
vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN;
655+
ring->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN;
656+
ring->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN;
655657
#endif
656658
} else {
657-
vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX;
658-
vsi->rx_buf_len = ICE_RXBUF_3072;
659+
ring->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX;
660+
ring->rx_buf_len = ICE_RXBUF_3072;
659661
}
660662
}
661663

@@ -670,15 +672,15 @@ int ice_vsi_cfg_rxqs(struct ice_vsi *vsi)
670672
{
671673
u16 i;
672674

673-
if (vsi->type == ICE_VSI_VF)
674-
goto setup_rings;
675-
676-
ice_vsi_cfg_frame_size(vsi);
677-
setup_rings:
678675
/* set up individual rings */
679676
ice_for_each_rxq(vsi, i) {
680-
int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]);
677+
struct ice_rx_ring *ring = vsi->rx_rings[i];
678+
int err;
679+
680+
if (vsi->type != ICE_VSI_VF)
681+
ice_vsi_cfg_frame_size(vsi, ring);
681682

683+
err = ice_vsi_cfg_rxq(ring);
682684
if (err)
683685
return err;
684686
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ ice_eswitch_set_target_vsi(struct sk_buff *skb,
6060
static inline void
6161
ice_eswitch_update_repr(unsigned long *repr_id, struct ice_vsi *vsi) { }
6262

63-
static inline int ice_eswitch_configure(struct ice_pf *pf)
64-
{
65-
return 0;
66-
}
67-
6863
static inline int ice_eswitch_mode_get(struct devlink *devlink, u16 *mode)
6964
{
7065
return DEVLINK_ESWITCH_MODE_LEGACY;

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

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4716,6 +4716,81 @@ static void ice_get_fec_stats(struct net_device *netdev,
47164716
pi->lport, err);
47174717
}
47184718

4719+
#define ICE_ETHTOOL_PFR (ETH_RESET_IRQ | ETH_RESET_DMA | \
4720+
ETH_RESET_FILTER | ETH_RESET_OFFLOAD)
4721+
4722+
#define ICE_ETHTOOL_CORER ((ICE_ETHTOOL_PFR | ETH_RESET_RAM) << \
4723+
ETH_RESET_SHARED_SHIFT)
4724+
4725+
#define ICE_ETHTOOL_GLOBR (ICE_ETHTOOL_CORER | \
4726+
(ETH_RESET_MAC << ETH_RESET_SHARED_SHIFT) | \
4727+
(ETH_RESET_PHY << ETH_RESET_SHARED_SHIFT))
4728+
4729+
#define ICE_ETHTOOL_VFR ICE_ETHTOOL_PFR
4730+
4731+
/**
4732+
* ice_ethtool_reset - triggers a given type of reset
4733+
* @dev: network interface device structure
4734+
* @flags: set of reset flags
4735+
*
4736+
* Return: 0 on success, -EOPNOTSUPP when using unsupported set of flags.
4737+
*/
4738+
static int ice_ethtool_reset(struct net_device *dev, u32 *flags)
4739+
{
4740+
struct ice_netdev_priv *np = netdev_priv(dev);
4741+
struct ice_pf *pf = np->vsi->back;
4742+
enum ice_reset_req reset;
4743+
4744+
switch (*flags) {
4745+
case ICE_ETHTOOL_CORER:
4746+
reset = ICE_RESET_CORER;
4747+
break;
4748+
case ICE_ETHTOOL_GLOBR:
4749+
reset = ICE_RESET_GLOBR;
4750+
break;
4751+
case ICE_ETHTOOL_PFR:
4752+
reset = ICE_RESET_PFR;
4753+
break;
4754+
default:
4755+
netdev_info(dev, "Unsupported set of ethtool flags");
4756+
return -EOPNOTSUPP;
4757+
}
4758+
4759+
ice_schedule_reset(pf, reset);
4760+
4761+
*flags = 0;
4762+
4763+
return 0;
4764+
}
4765+
4766+
/**
4767+
* ice_repr_ethtool_reset - triggers a VF reset
4768+
* @dev: network interface device structure
4769+
* @flags: set of reset flags
4770+
*
4771+
* Return: 0 on success,
4772+
* -EOPNOTSUPP when using unsupported set of flags
4773+
* -EBUSY when VF is not ready for reset.
4774+
*/
4775+
static int ice_repr_ethtool_reset(struct net_device *dev, u32 *flags)
4776+
{
4777+
struct ice_repr *repr = ice_netdev_to_repr(dev);
4778+
struct ice_vf *vf;
4779+
4780+
if (repr->type != ICE_REPR_TYPE_VF ||
4781+
*flags != ICE_ETHTOOL_VFR)
4782+
return -EOPNOTSUPP;
4783+
4784+
vf = repr->vf;
4785+
4786+
if (ice_check_vf_ready_for_cfg(vf))
4787+
return -EBUSY;
4788+
4789+
*flags = 0;
4790+
4791+
return ice_reset_vf(vf, ICE_VF_RESET_VFLR | ICE_VF_RESET_LOCK);
4792+
}
4793+
47194794
static const struct ethtool_ops ice_ethtool_ops = {
47204795
.cap_rss_ctx_supported = true,
47214796
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
@@ -4752,6 +4827,7 @@ static const struct ethtool_ops ice_ethtool_ops = {
47524827
.nway_reset = ice_nway_reset,
47534828
.get_pauseparam = ice_get_pauseparam,
47544829
.set_pauseparam = ice_set_pauseparam,
4830+
.reset = ice_ethtool_reset,
47554831
.get_rxfh_key_size = ice_get_rxfh_key_size,
47564832
.get_rxfh_indir_size = ice_get_rxfh_indir_size,
47574833
.get_rxfh = ice_get_rxfh,
@@ -4804,6 +4880,7 @@ static const struct ethtool_ops ice_ethtool_repr_ops = {
48044880
.get_strings = ice_repr_get_strings,
48054881
.get_ethtool_stats = ice_repr_get_ethtool_stats,
48064882
.get_sset_count = ice_repr_get_sset_count,
4883+
.reset = ice_repr_ethtool_reset,
48074884
};
48084885

48094886
/**

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ int
2323
ice_get_sw_fv_list(struct ice_hw *hw, struct ice_prot_lkup_ext *lkups,
2424
unsigned long *bm, struct list_head *fv_list);
2525
int
26-
ice_pkg_buf_unreserve_section(struct ice_buf_build *bld, u16 count);
27-
u16 ice_pkg_buf_get_free_space(struct ice_buf_build *bld);
28-
int
2926
ice_aq_upload_section(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,
3027
u16 buf_size, struct ice_sq_cd *cd);
3128
bool

0 commit comments

Comments
 (0)