Intel Wired LAN Driver Updates 2024-10-08 (ice, iavf, igb, e1000e, e1000)
Subsystems (4)
Tony Nguyen
maintainerThis 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.
The following are changes since commit 42b2331081178785d50d116c85ca40d728b48291:
tools: ynl-gen: refactor check validation for TypeBinary
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 100GbE
Hongbo Li (1):
ice: Make use of assign_bit() API
Jacob Keller (2):
ice: consistently use q_idx in ice_vc_cfg_qs_msg()
ice: store max_frame and rx_buf_len only in ice_rx_ring
Joe Damato (2):
e1000e: Link NAPI instances to queues and IRQs
e1000: Link NAPI instances to queues and IRQs
Markus Elfring (1):
ice: Use common error handling code in two functions
Paul Greenwalt (1):
ice: add E830 HW VF mailbox message limit support
Takamitsu Iwai (1):
e1000e: Remove duplicated writel() in e1000_configure_tx/rx()
Wojciech Drewek (1):
ice: Implement ethtool reset support
Yue Haibing (3):
ice: Cleanup unused declarations
iavf: Remove unused declarations
igb: Cleanup unused declarations
.../device_drivers/ethernet/intel/ice.rst | 31 ++++++++ drivers/net/ethernet/intel/e1000/e1000_main.c | 5 ++ drivers/net/ethernet/intel/e1000e/netdev.c | 17 ++-- drivers/net/ethernet/intel/iavf/iavf.h | 10 --- .../net/ethernet/intel/iavf/iavf_prototype.h | 3 - drivers/net/ethernet/intel/ice/ice.h | 4 +- drivers/net/ethernet/intel/ice/ice_base.c | 34 ++++---- drivers/net/ethernet/intel/ice/ice_eswitch.h | 5 -- drivers/net/ethernet/intel/ice/ice_ethtool.c | 77 +++++++++++++++++++ .../net/ethernet/intel/ice/ice_flex_pipe.h | 3 - .../net/ethernet/intel/ice/ice_hw_autogen.h | 3 + drivers/net/ethernet/intel/ice/ice_lib.c | 3 + drivers/net/ethernet/intel/ice/ice_lib.h | 2 - drivers/net/ethernet/intel/ice/ice_main.c | 27 +++++-- drivers/net/ethernet/intel/ice/ice_ptp.c | 32 ++++---- drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 3 - drivers/net/ethernet/intel/ice/ice_sriov.c | 3 +- drivers/net/ethernet/intel/ice/ice_txrx.h | 3 +- drivers/net/ethernet/intel/ice/ice_txrx_lib.h | 1 - drivers/net/ethernet/intel/ice/ice_vf_lib.c | 26 ++++++- drivers/net/ethernet/intel/ice/ice_vf_mbx.c | 32 ++++++++ drivers/net/ethernet/intel/ice/ice_vf_mbx.h | 9 +++ drivers/net/ethernet/intel/ice/ice_virtchnl.c | 34 ++++---- drivers/net/ethernet/intel/igb/e1000_mac.h | 1 - drivers/net/ethernet/intel/igb/e1000_nvm.h | 1 - 25 files changed, 269 insertions(+), 100 deletions(-)
Signature · 1 line
2.42.0
Tony Nguyen
maintainerPATCH 1/12 ice: Implement ethtool reset support
From: Wojciech Drewek <[email protected]>
Enable ethtool reset support. Ethtool reset flags are mapped to the E810 reset type:
PF reset:
$ ethtool --reset <ethX> irq dma filter offload
CORE reset:
$ ethtool --reset <ethX> irq-shared dma-shared filter-shared \
offload-shared ram-shared
GLOBAL reset:
$ ethtool --reset <ethX> irq-shared dma-shared filter-shared \
offload-shared mac-shared phy-shared ram-sharedCalling the same set of flags as in PF reset case on port representor triggers VF reset.
--- .../device_drivers/ethernet/intel/ice.rst | 31 ++++++++ drivers/net/ethernet/intel/ice/ice_ethtool.c | 77 +++++++++++++++++++ 2 files changed, 108 insertions(+)
Documentation/networking/device_drivers/ethernet/intel/ice.rst +31 -0
@@ -101,6 +101,37 @@ example, if Rx packets are 10 and Netdev (software statistics) displays rx_bytes as "X", then ethtool (hardware statistics) will display rx_bytes as "X+40" (4 bytes CRC x 10 packets). +ethtool reset +------------- +The driver supports 3 types of resets: + +- PF reset - resets only components associated with the given PF, does not + impact other PFs + +- CORE reset - whole adapter is affected, reset all PFs + +- GLOBAL reset - same as CORE but mac and phy components are also reinitialized + +These are mapped to ethtool reset flags as follow: + +- PF reset: + + # ethtool --reset <ethX> irq dma filter offload + +- CORE reset: + + # ethtool --reset <ethX> irq-shared dma-shared filter-shared offload-shared \ + ram-shared + +- GLOBAL reset: + + # ethtool --reset <ethX> irq-shared dma-shared filter-shared offload-shared \ + mac-shared phy-shared ram-shared + +In switchdev mode you can reset a VF using port representor: + + # ethtool --reset <repr> irq dma filter offload + Viewing Link Messages ---------------------
drivers/net/ethernet/intel/ice/ice_ethtool.c +77 -0
95 lines not on this page · raw message
Signature · 1 line
2.42.0
Tony Nguyen
maintainerPATCH 2/12 ice: add E830 HW VF mailbox message limit support
In reply to Tony NguyenFrom: Paul Greenwalt <[email protected]>
E830 adds hardware support to prevent the VF from overflowing the PF mailbox with VIRTCHNL messages. E830 will use the hardware feature (ICE_F_MBX_LIMIT) instead of the software solution ice_is_malicious_vf().
To prevent a VF from overflowing the PF, the PF sets the number of messages per VF that can be in the PF's mailbox queue (ICE_MBX_OVERFLOW_WATERMARK). When the PF processes a message from a VF, the PF decrements the per VF message count using the E830_MBX_VF_DEC_TRIG register.
--- drivers/net/ethernet/intel/ice/ice.h | 1 + .../net/ethernet/intel/ice/ice_hw_autogen.h | 3 ++ drivers/net/ethernet/intel/ice/ice_lib.c | 3 ++ drivers/net/ethernet/intel/ice/ice_main.c | 24 ++++++++++---- drivers/net/ethernet/intel/ice/ice_sriov.c | 3 +- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 26 +++++++++++++-- drivers/net/ethernet/intel/ice/ice_vf_mbx.c | 32 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_vf_mbx.h | 9 ++++++ drivers/net/ethernet/intel/ice/ice_virtchnl.c | 8 +++-- 9 files changed, 96 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +1 -0
@@ -207,6 +207,7 @@ enum ice_feature {ICE_F_GNSS ,ICE_F_ROCE_LAG ,ICE_F_SRIOV_LAG , +ICE_F_MBX_LIMIT , ICE_F_MAX };
drivers/net/ethernet/intel/ice/ice_hw_autogen.h +3 -0
@@ -539,5 +539,8 @@#define E830_PRTMAC_CL01_QNT_THR_CL0_M GENMASK(15, 0)#define VFINT_DYN_CTLN (_i) (0x00003800 + ((_i) * 4))#define VFINT_DYN_CTLN_CLEARPBA_M BIT(1) +#define E830_MBX_PF_IN_FLIGHT_VF_MSGS_THRESH 0x00234000 +#define E830_MBX_VF_DEC_TRIG (_VF) (0x00233800 + (_VF) * 4) +#define E830_MBX_VF_IN_FLIGHT_MSGS_AT_PF_CNT (_VF) (0x00233000 + (_VF) * 4)#endif /* _ICE_HW_AUTOGEN_H_ */
drivers/net/ethernet/intel/ice/ice_lib.c +3 -0
@@ -3880,6 +3880,9 @@ void ice_init_feature_support(struct ice_pf *pf)default :break ; } + +if (pf->hw.mac_type ==ICE_MAC_E830 ) +ice_set_feature_support (pf,ICE_F_MBX_LIMIT ); }/**
drivers/net/ethernet/intel/ice/ice_main.c +18 -6
@@ -1563,12 +1563,20 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)ice_vf_lan_overflow_event (pf, &event);break ;case ice_mbx_opc_send_msg_to_pf: - data.num_msg_proc = i; - data.num_pending_arq = pending; - data.max_num_msgs_mbx = hw->mailboxq.num_rq_entries; - data.async_watermark_val =ICE_MBX_OVERFLOW_WATERMARK ; +if (ice_is_feature_supported (pf,ICE_F_MBX_LIMIT )) { +ice_vc_process_vf_msg (pf, &event,NULL ); +ice_mbx_vf_dec_trig_e830 (hw, &event); + }else { +u16 val = hw->mailboxq.num_rq_entries; + + data.max_num_msgs_mbx = val; + val =ICE_MBX_OVERFLOW_WATERMARK ; + data.async_watermark_val = val; + data.num_msg_proc = i; + data.num_pending_arq = pending; -ice_vc_process_vf_msg (pf, &event, &data); +ice_vc_process_vf_msg (pf, &event, &data); + }break ;case ice_aqc_opc_fw_logs_event:ice_get_fwlog_data (pf, &event);
@@ -4099,7 +4107,11 @@ static int ice_init_pf(struct ice_pf *pf)mutex_init (&pf->vfs.table_lock);hash_init (pf->vfs.table); -ice_mbx_init_snapshot (&pf->hw); +if (ice_is_feature_supported (pf,ICE_F_MBX_LIMIT )) +wr32 (&pf->hw,E830_MBX_PF_IN_FLIGHT_VF_MSGS_THRESH , +ICE_MBX_OVERFLOW_WATERMARK ); +else +ice_mbx_init_snapshot (&pf->hw);xa_init (&pf->dyn_ports);xa_init (&pf->sf_nums);
drivers/net/ethernet/intel/ice/ice_sriov.c +2 -1
@@ -194,7 +194,8 @@ void ice_free_vfs(struct ice_pf *pf) }/* clear malicious info since the VF is getting released */ -list_del (&vf->mbx_info.list_entry); +if (!ice_is_feature_supported (pf,ICE_F_MBX_LIMIT )) +list_del (&vf->mbx_info.list_entry);mutex_unlock (&vf->cfg_lock); }
drivers/net/ethernet/intel/ice/ice_vf_lib.c +23 -3
@@ -709,6 +709,23 @@ ice_vf_clear_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m)return 0 ; } +/** +* ice_reset_vf_mbx_cnt - reset VF mailbox message count +* @vf: pointer to the VF structure +* +* This function clears the VF mailbox message count, and should be called on +* VF reset. +*/ +static void ice_reset_vf_mbx_cnt (struct ice_vf *vf) +{ +struct ice_pf *pf = vf->pf; + +if (ice_is_feature_supported (pf,ICE_F_MBX_LIMIT )) +ice_mbx_vf_clear_cnt_e830 (&pf->hw, vf->vf_id); +else +ice_mbx_clear_malvf (&vf->mbx_info); +} +/** * ice_reset_all_vfs - reset all allocated VFs in one go * @pf: pointer to the PF structure
@@ -735,7 +752,7 @@ void ice_reset_all_vfs(struct ice_pf *pf)/* clear all malicious info if the VFs are getting reset */ ice_for_each_vf (pf, bkt, vf) -ice_mbx_clear_malvf (&vf->mbx_info); +ice_reset_vf_mbx_cnt (vf);/* If VFs have been disabled, there is no need to reset */ if (test_and_set_bit (ICE_VF_DIS , pf->state)) {
@@ -951,7 +968,7 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)ice_eswitch_update_repr (&vf->repr_id, vsi);/* if the VF has been reset allow it to come up again */ -ice_mbx_clear_malvf (&vf->mbx_info); +ice_reset_vf_mbx_cnt (vf); out_unlock: if (lag && lag->bonded && lag->primary &&
@@ -1004,7 +1021,10 @@ void ice_initialize_vf_entry(struct ice_vf *vf)ice_vf_fdir_init (vf);/* Initialize mailbox info for this VF */ -ice_mbx_init_vf_info (&pf->hw, &vf->mbx_info); +if (ice_is_feature_supported (pf,ICE_F_MBX_LIMIT )) +ice_mbx_vf_clear_cnt_e830 (&pf->hw, vf->vf_id); +else +ice_mbx_init_vf_info (&pf->hw, &vf->mbx_info);mutex_init (&vf->cfg_lock); }
drivers/net/ethernet/intel/ice/ice_vf_mbx.c +32 -0
@@ -210,6 +210,38 @@ ice_mbx_detect_malvf(struct ice_hw *hw, struct ice_mbx_vf_info *vf_info,return 0 ; } +/** +* ice_mbx_vf_dec_trig_e830 - Decrements the VF mailbox queue counter +* @hw: pointer to the HW struct +* @event: pointer to the control queue receive event +* +* This function triggers to decrement the counter +* MBX_VF_IN_FLIGHT_MSGS_AT_PF_CNT when the driver replenishes +* the buffers at the PF mailbox queue. +*/ +void ice_mbx_vf_dec_trig_e830 (const struct ice_hw *hw, +const struct ice_rq_event_info *event) +{ +u16 vfid =le16_to_cpu (event->desc.retval); + +wr32 (hw,E830_MBX_VF_DEC_TRIG (vfid),1 ); +} + +/** +* ice_mbx_vf_clear_cnt_e830 - Clear the VF mailbox queue count +* @hw: pointer to the HW struct +* @vf_id: VF ID in the PF space +* +* This function clears the counter MBX_VF_IN_FLIGHT_MSGS_AT_PF_CNT, and should +* be called when a VF is created and on VF reset. +*/ +void ice_mbx_vf_clear_cnt_e830 (const struct ice_hw *hw,u16 vf_id) +{ +u32 reg =rd32 (hw,E830_MBX_VF_IN_FLIGHT_MSGS_AT_PF_CNT (vf_id)); + +wr32 (hw,E830_MBX_VF_DEC_TRIG (vf_id), reg); +} +/** * ice_mbx_vf_state_handler - Handle states of the overflow algorithm * @hw: pointer to the HW struct
drivers/net/ethernet/intel/ice/ice_vf_mbx.h +9 -0
@@ -19,6 +19,9 @@ ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen, struct ice_sq_cd *cd);u32 ice_conv_link_speed_to_virtchnl (bool adv_link_support,u16 link_speed); +void ice_mbx_vf_dec_trig_e830 (const struct ice_hw *hw, +const struct ice_rq_event_info *event); +void ice_mbx_vf_clear_cnt_e830 (const struct ice_hw *hw,u16 vf_id);int ice_mbx_vf_state_handler (struct ice_hw *hw,struct ice_mbx_data *mbx_data,struct ice_mbx_vf_info *vf_info,bool *report_malvf);
@@ -47,5 +50,11 @@ static inline void ice_mbx_init_snapshot(struct ice_hw *hw) { } +static inline void +ice_mbx_vf_dec_trig_e830 (const struct ice_hw *hw, +const struct ice_rq_event_info *event) +{ +} +#endif /* CONFIG_PCI_IOV */ #endif /* _ICE_VF_MBX_H_ */
drivers/net/ethernet/intel/ice/ice_virtchnl.c +5 -3
@@ -4009,8 +4009,10 @@ ice_is_malicious_vf(struct ice_vf *vf, struct ice_mbx_data *mbxdata)* @event: pointer to the AQ event * @mbxdata: information used to detect VF attempting mailbox overflow * -* called from the common asq/arq handler to -* process request from VF +* Called from the common asq/arq handler to process request from VF. When this +* flow is used for devices with hardware VF to PF message queue overflow +* support (ICE_F_MBX_LIMIT) mbxdata is set to NULL and ice_is_malicious_vf +* check is skipped. */ void ice_vc_process_vf_msg (struct ice_pf *pf,struct ice_rq_event_info *event,struct ice_mbx_data *mbxdata)
@@ -4036,7 +4038,7 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event,mutex_lock (&vf->cfg_lock);/* Check if the VF is trying to overflow the mailbox */ -if (ice_is_malicious_vf (vf, mbxdata)) +if (mbxdata &&ice_is_malicious_vf (vf, mbxdata)) goto finish;/* Check if VF is disabled. */
Signature · 1 line
2.42.0
Tony Nguyen
maintainerPATCH 3/12 ice: consistently use q_idx in ice_vc_cfg_qs_msg()
In reply to Tony NguyenFrom: Jacob Keller <[email protected]>
The ice_vc_cfg_qs_msg() function is used to configure VF queues in response to a VIRTCHNL_OP_CONFIG_VSI_QUEUES command.
The virtchnl command contains an array of queue pair data for configuring Tx and Rx queues. This data includes a queue ID. When configuring the queues, the driver generally uses this queue ID to determine which Tx and Rx ring to program. However, a handful of places use the index into the queue pair data from the VF. While most VF implementations appear to send this data in order, it is not mandated by the virtchnl and it is not verified that the queue pair data comes in order.
Fix the driver to consistently use the q_idx field instead of the 'i' iterator value when accessing the rings. For the Rx case, introduce a local ring variable to keep lines short.
--- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/ice/ice_virtchnl.c +10 -11
@@ -1715,8 +1715,8 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)/* copy Tx queue info from VF into VSI */ if (qpi->txq.ring_len >0 ) { - vsi->tx_rings[i]->dma = qpi->txq.dma_ring_addr; - vsi->tx_rings[i]->count = qpi->txq.ring_len; + vsi->tx_rings[q_idx]->dma = qpi->txq.dma_ring_addr; + vsi->tx_rings[q_idx]->count = qpi->txq.ring_len;/* Disable any existing queue first */ if (ice_vf_vsi_dis_single_txq (vf, vsi, q_idx))
@@ -1725,7 +1725,7 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)/* Configure a queue with the requested settings */ if (ice_vsi_cfg_single_txq (vsi, vsi->tx_rings, q_idx)) {dev_warn (ice_pf_to_dev (pf),"VF-%d failed to configure TX queue %d\n" , - vf->vf_id, i); + vf->vf_id, q_idx); goto error_param; } }
@@ -1733,24 +1733,23 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)/* copy Rx queue info from VF into VSI */ if (qpi->rxq.ring_len >0 ) {u16 max_frame_size =ice_vc_get_max_frame_size (vf); +struct ice_rx_ring *ring = vsi->rx_rings[q_idx];u32 rxdid; - vsi->rx_rings[i]->dma = qpi->rxq.dma_ring_addr; - vsi->rx_rings[i]->count = qpi->rxq.ring_len; + ring->dma = qpi->rxq.dma_ring_addr; + ring->count = qpi->rxq.ring_len;if (qpi->rxq.crc_disable) - vsi->rx_rings[q_idx]->flags |= -ICE_RX_FLAGS_CRC_STRIP_DIS ; + ring->flags |=ICE_RX_FLAGS_CRC_STRIP_DIS ;else - vsi->rx_rings[q_idx]->flags &= - ~ICE_RX_FLAGS_CRC_STRIP_DIS ; + ring->flags &= ~ICE_RX_FLAGS_CRC_STRIP_DIS ;if (qpi->rxq.databuffer_size !=0 && (qpi->rxq.databuffer_size > ((16 *1024 ) -128 ) || qpi->rxq.databuffer_size <1024 )) goto error_param; vsi->rx_buf_len = qpi->rxq.databuffer_size; - vsi->rx_rings[i]->rx_buf_len = vsi->rx_buf_len; + ring->rx_buf_len = vsi->rx_buf_len;if (qpi->rxq.max_pkt_size > max_frame_size || qpi->rxq.max_pkt_size <64 ) goto error_param;
@@ -1765,7 +1764,7 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)if (ice_vsi_cfg_single_rxq (vsi, q_idx)) {dev_warn (ice_pf_to_dev (pf),"VF-%d failed to configure RX queue %d\n" , - vf->vf_id, i); + vf->vf_id, q_idx); goto error_param; }
Signature · 1 line
2.42.0
Tony Nguyen
maintainerPATCH 4/12 ice: store max_frame and rx_buf_len only in ice_rx_ring
In reply to Tony NguyenFrom: Jacob Keller <[email protected]>
The max_frame and rx_buf_len fields of the VSI set the maximum frame size for packets on the wire, and configure the size of the Rx buffer. In the hardware, these are per-queue configuration. Most VSI types use a simple method to determine the size of the buffers for all queues.
However, VFs may potentially configure different values for each queue. While the Linux iAVF driver does not do this, it is allowed by the virtchnl interface.
The current virtchnl code simply sets the per-VSI fields inbetween calls to ice_vsi_cfg_single_rxq(). This technically works, as these fields are only ever used when programming the Rx ring, and otherwise not checked again. However, it is confusing to maintain.
The Rx ring also already has an rx_buf_len field in order to access the buffer length in the hotpath. It also has extra unused bytes in the ring structure which we can make use of to store the maximum frame size.
Drop the VSI max_frame and rx_buf_len fields. Add max_frame to the Rx ring, and slightly re-order rx_buf_len to better fit into the gaps in the structure layout.
Change the ice_vsi_cfg_frame_size function so that it writes to the ring fields. Call this function once per ring in ice_vsi_cfg_rxqs(). This is done over calling it inside the ice_vsi_cfg_rxq(), because ice_vsi_cfg_rxq() is called in the virtchnl flow where the max_frame and rx_buf_len have already been configured.
Change the accesses for rx_buf_len and max_frame to all point to the ring structure. This has the added benefit that ice_vsi_cfg_rxq() no longer has the surprise side effect of updating ring->rx_buf_len based on the VSI field.
Update the virtchnl ice_vc_cfg_qs_msg() function to set the ring values directly, and drop references to the removed VSI fields.
This now makes the VF logic clear, as the ring fields are obviously per-queue. This reduces the required cognitive load when reasoning about this logic.
Note that removing the VSI fields does leave a 4 byte gap, but the ice_vsi structure has many gaps, and its layout is not as critical in the hot path. The structure may benefit from a more thorough repacking, but no attempt was made in this change.
--- drivers/net/ethernet/intel/ice/ice.h | 3 -- drivers/net/ethernet/intel/ice/ice_base.c | 34 ++++++++++--------- drivers/net/ethernet/intel/ice/ice_txrx.h | 3 +- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 7 ++-- 4 files changed, 23 insertions(+), 24 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +0 -3
@@ -372,9 +372,6 @@ struct ice_vsi {spinlock_t arfs_lock;/* protects aRFS hash table and filter state */ atomic_t *arfs_last_fltr_id; -u16 max_frame; -u16 rx_buf_len; -struct ice_aqc_vsi_props info;/* VSI properties */ struct ice_vsi_vlan_info vlan_info;/* vlan config to be restored */
drivers/net/ethernet/intel/ice/ice_base.c +18 -16
@@ -445,7 +445,7 @@ static int ice_setup_rx_ctx(struct ice_rx_ring *ring)/* Max packet size for this queue - must not be set to a larger value * than 5 x DBUF */ - rlan_ctx.rxmax =min_t (u32, vsi->max_frame, + rlan_ctx.rxmax =min_t (u32, ring->max_frame,ICE_MAX_CHAINED_RX_BUFS * ring->rx_buf_len);/* Rx queue threshold in units of 64 */
@@ -541,8 +541,6 @@ static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)u32 num_bufs =ICE_RX_DESC_UNUSED (ring);int err; - ring->rx_buf_len = ring->vsi->rx_buf_len; -if (ring->vsi->type ==ICE_VSI_PF || ring->vsi->type ==ICE_VSI_SF ) {if (!xdp_rxq_info_is_reg (&ring->xdp_rxq)) { 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)/** * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length * @vsi: VSI +* @ring: Rx ring to configure +* +* Determine the maximum frame size and Rx buffer length to use for a PF VSI. +* Set these in the associated Rx ring structure. */ -static void ice_vsi_cfg_frame_size (struct ice_vsi *vsi) +static void ice_vsi_cfg_frame_size (struct ice_vsi *vsi,struct ice_rx_ring *ring) {if (!vsi->netdev ||test_bit (ICE_FLAG_LEGACY_RX , vsi->back->flags)) { - vsi->max_frame =ICE_MAX_FRAME_LEGACY_RX ; - vsi->rx_buf_len =ICE_RXBUF_1664 ; + ring->max_frame =ICE_MAX_FRAME_LEGACY_RX ; + ring->rx_buf_len =ICE_RXBUF_1664 ;#if (PAGE_SIZE <8192 ) } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && (vsi->netdev->mtu <=ETH_DATA_LEN )) { - vsi->max_frame =ICE_RXBUF_1536 -NET_IP_ALIGN ; - vsi->rx_buf_len =ICE_RXBUF_1536 -NET_IP_ALIGN ; + ring->max_frame =ICE_RXBUF_1536 -NET_IP_ALIGN ; + ring->rx_buf_len =ICE_RXBUF_1536 -NET_IP_ALIGN ;#endif }else { - vsi->max_frame =ICE_AQ_SET_MAC_FRAME_SIZE_MAX ; - vsi->rx_buf_len =ICE_RXBUF_3072 ; + ring->max_frame =ICE_AQ_SET_MAC_FRAME_SIZE_MAX ; + ring->rx_buf_len =ICE_RXBUF_3072 ; } }
@@ -670,15 +672,15 @@ int ice_vsi_cfg_rxqs(struct ice_vsi *vsi) {u16 i; -if (vsi->type ==ICE_VSI_VF ) - goto setup_rings; - -ice_vsi_cfg_frame_size (vsi); -setup_rings:/* set up individual rings */ ice_for_each_rxq (vsi, i) { -int err =ice_vsi_cfg_rxq (vsi->rx_rings[i]); +struct ice_rx_ring *ring = vsi->rx_rings[i]; +int err; + +if (vsi->type !=ICE_VSI_VF ) +ice_vsi_cfg_frame_size (vsi, ring); + err =ice_vsi_cfg_rxq (ring);if (err)return err; }
drivers/net/ethernet/intel/ice/ice_txrx.h +2 -1
@@ -359,8 +359,9 @@ struct ice_rx_ring {struct ice_rx_ring *next;/* pointer to next ring in q_vector */ struct xsk_buff_pool *xsk_pool;u32 nr_frags; -dma_addr_t dma;/* physical address of ring */ +u16 max_frame;u16 rx_buf_len; +dma_addr_t dma;/* physical address of ring */ u8 dcb_tc;/* Traffic class of ring */ u8 ptp_rx;#define ICE_RX_FLAGS_RING_BUILD_SKB BIT(1)
drivers/net/ethernet/intel/ice/ice_virtchnl.c +3 -4
@@ -1748,19 +1748,18 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg) (qpi->rxq.databuffer_size > ((16 * 1024) - 128) || qpi->rxq.databuffer_size < 1024)) goto error_param; - vsi->rx_buf_len = qpi->rxq.databuffer_size; - ring->rx_buf_len = vsi->rx_buf_len; + ring->rx_buf_len = qpi->rxq.databuffer_size;if (qpi->rxq.max_pkt_size > max_frame_size || qpi->rxq.max_pkt_size <64 ) goto error_param; - vsi->max_frame = qpi->rxq.max_pkt_size; + ring->max_frame = qpi->rxq.max_pkt_size;/* add space for the port VLAN since the VF driver is * not expected to account for it in the MTU * calculation */ if (ice_vf_is_port_vlan_ena (vf)) - vsi->max_frame +=VLAN_HLEN ; + ring->max_frame +=VLAN_HLEN ;if (ice_vsi_cfg_single_rxq (vsi, q_idx)) { dev_warn(ice_pf_to_dev(pf), "VF-%d failed to configure RX queue %d\n",
Signature · 1 line
2.42.0
Tony Nguyen
maintainerPATCH 5/12 ice: Make use of assign_bit() API
In reply to Tony NguyenFrom: Hongbo Li <[email protected]>
We have for some time the assign_bit() API to replace open coded
if (foo)
set_bit(n, bar);
else
clear_bit(n, bar);Use this API to clean the code. No functional change intended.
--- drivers/net/ethernet/intel/ice/ice_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +1 -2
@@ -6549,8 +6549,7 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)if (changed &NETIF_F_HW_TC ) {bool ena = !!(features &NETIF_F_HW_TC ); - ena ?set_bit (ICE_FLAG_CLS_FLOWER , pf->flags) : -clear_bit (ICE_FLAG_CLS_FLOWER , pf->flags); +assign_bit (ICE_FLAG_CLS_FLOWER , pf->flags, ena); }if (changed &NETIF_F_LOOPBACK )
Signature · 1 line
2.42.0
Tony Nguyen
maintainerPATCH 6/12 ice: Use common error handling code in two functions
In reply to Tony NguyenFrom: Markus Elfring <[email protected]>
Add jump targets so that a bit of exception handling can be better reused at the end of two function implementations.
This issue was detected by using the Coccinelle software.
--- drivers/net/ethernet/intel/ice/ice_ptp.c | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/net/ethernet/intel/ice/ice_ptp.c +16 -16
@@ -2857,10 +2857,8 @@ static int ice_ptp_rebuild_owner(struct ice_pf *pf)/* Write the increment time value to PHY and LAN */ err =ice_ptp_write_incval (hw,ice_base_incval (pf)); -if (err) { -ice_ptp_unlock (hw); -return err; - } +if (err) + goto err_unlock;/* Write the initial Time value to PHY and LAN using the cached PHC * time before the reset and time difference between stopping and
@@ -2873,10 +2871,8 @@ static int ice_ptp_rebuild_owner(struct ice_pf *pf) ts =ktime_to_timespec64 (ktime_get_real ()); } err =ice_ptp_write_init (pf, &ts); -if (err) { -ice_ptp_unlock (hw); -return err; - } +if (err) + goto err_unlock;/* Release the global hardware lock */ ice_ptp_unlock (hw);
@@ -2900,6 +2896,10 @@ static int ice_ptp_rebuild_owner(struct ice_pf *pf)ice_ptp_enable_all_extts (pf);return 0 ; + +err_unlock: +ice_ptp_unlock (hw); +return err; }/**
@@ -3032,18 +3032,14 @@ static int ice_ptp_init_owner(struct ice_pf *pf)/* Write the increment time value to PHY and LAN */ err =ice_ptp_write_incval (hw,ice_base_incval (pf)); -if (err) { -ice_ptp_unlock (hw); - goto err_exit; - } +if (err) + goto err_unlock; ts =ktime_to_timespec64 (ktime_get_real ());/* Write the initial Time value to PHY and LAN */ err =ice_ptp_write_init (pf, &ts); -if (err) { -ice_ptp_unlock (hw); - goto err_exit; - } +if (err) + goto err_unlock;/* Release the global hardware lock */ ice_ptp_unlock (hw);
@@ -3063,6 +3059,10 @@ static int ice_ptp_init_owner(struct ice_pf *pf) pf->ptp.clock =NULL ; err_exit:return err; + +err_unlock: +ice_ptp_unlock (hw); +return err; }/**
Signature · 1 line
2.42.0
Re: [PATCH net-next 06/12] ice: Use common error handling code in two functions
Quoted 6 lines · Tony Nguyen
From: Markus Elfring <[email protected]>
Add jump targets so that a bit of exception handling can be better reused at the end of two function implementations.
Quoted 6 lines
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>Reviewed-by Jacob Keller <[email protected]>Signed-off-by Tony Nguyen <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Tony Nguyen
maintainerPATCH 7/12 ice: Cleanup unused declarations
In reply to Tony NguyenFrom: Yue Haibing <[email protected]>
Since commit fff292b47ac1 ("ice: add VF representors one by one") ice_eswitch_configure() is not used anymore.
Commit 1b8f15b64a00 ("ice: refactor filter functions") removed ice_vsi_cfg_mac_fltr() but leave declaration.
Commit a24b4c6e9aab ("ice: xsk: Do not convert to buff to frame for XDP_TX") leave ice_xmit_xdp_buff() declaration.
Commit 7cab44f1c35f ("ice: Introduce ETH56G PHY model for E825C products") declared ice_phy_cfg_{rx,tx}_offset_eth56g(), commit a1ffafb0b4a4 ("ice: Support configuring the device to Double VLAN Mode") declared ice_pkg_buf_get_free_space(), and commit 8a3a565ff210 ("ice: add admin commands to access cgu configuration") declared ice_is_pca9575_present(), but all these never be implemented.
--- drivers/net/ethernet/intel/ice/ice_eswitch.h | 5 ----- drivers/net/ethernet/intel/ice/ice_flex_pipe.h | 3 --- drivers/net/ethernet/intel/ice/ice_lib.h | 2 -- drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 3 --- drivers/net/ethernet/intel/ice/ice_txrx_lib.h | 1 - 5 files changed, 14 deletions(-)
drivers/net/ethernet/intel/ice/ice_eswitch.h +0 -5
@@ -60,11 +60,6 @@ ice_eswitch_set_target_vsi(struct sk_buff *skb,static inline void ice_eswitch_update_repr (unsigned long *repr_id,struct ice_vsi *vsi) { } -static inline int ice_eswitch_configure (struct ice_pf *pf) -{ -return 0 ; -} -static inline int ice_eswitch_mode_get (struct devlink *devlink,u16 *mode) {return DEVLINK_ESWITCH_MODE_LEGACY ;
drivers/net/ethernet/intel/ice/ice_flex_pipe.h +0 -3
@@ -23,9 +23,6 @@ int ice_get_sw_fv_list(struct ice_hw *hw, struct ice_prot_lkup_ext *lkups, unsigned long *bm, struct list_head *fv_list);int -ice_pkg_buf_unreserve_section (struct ice_buf_build *bld,u16 count); -u16 ice_pkg_buf_get_free_space (struct ice_buf_build *bld); -int ice_aq_upload_section (struct ice_hw *hw,struct ice_buf_hdr *pkg_buf,u16 buf_size,struct ice_sq_cd *cd);bool
drivers/net/ethernet/intel/ice/ice_lib.h +0 -2
@@ -88,8 +88,6 @@ void ice_write_intrl(struct ice_q_vector *q_vector, u8 intrl);void ice_write_itr (struct ice_ring_container *rc,u16 itr);void ice_set_q_vector_intrl (struct ice_q_vector *q_vector); -int ice_vsi_cfg_mac_fltr (struct ice_vsi *vsi,const u8 *macaddr,bool set); -bool ice_is_safe_mode (struct ice_pf *pf);bool ice_is_rdma_ena (struct ice_pf *pf);bool ice_is_dflt_vsi_in_use (struct ice_port_info *pi);
drivers/net/ethernet/intel/ice/ice_ptp_hw.h +0 -3
@@ -405,7 +405,6 @@ int ice_phy_cfg_intr_e82x(struct ice_hw *hw, u8 quad, bool ena, u8 threshold);int ice_read_sma_ctrl (struct ice_hw *hw,u8 *data);int ice_write_sma_ctrl (struct ice_hw *hw,u8 data);int ice_read_pca9575_reg (struct ice_hw *hw,u8 offset,u8 *data); -bool ice_is_pca9575_present (struct ice_hw *hw);int ice_ptp_read_sdp_ac (struct ice_hw *hw,__le16 *entries,uint *num_entries);enum dpll_pin_type ice_cgu_get_pin_type (struct ice_hw *hw,u8 pin,bool input); struct dpll_pin_frequency *
@@ -423,8 +422,6 @@ int ice_cgu_get_output_pin_state_caps(struct ice_hw *hw, u8 pin_id,int ice_ptp_read_tx_hwtstamp_status_eth56g (struct ice_hw *hw,u32 *ts_status);int ice_stop_phy_timer_eth56g (struct ice_hw *hw,u8 port,bool soft_reset);int ice_start_phy_timer_eth56g (struct ice_hw *hw,u8 port); -int ice_phy_cfg_tx_offset_eth56g (struct ice_hw *hw,u8 port); -int ice_phy_cfg_rx_offset_eth56g (struct ice_hw *hw,u8 port);int ice_phy_cfg_intr_eth56g (struct ice_hw *hw,u8 port,bool ena,u8 threshold);int ice_phy_cfg_ptp_1step_eth56g (struct ice_hw *hw,u8 port);
drivers/net/ethernet/intel/ice/ice_txrx_lib.h +0 -1
@@ -154,7 +154,6 @@ static inline u32 ice_set_rs_bit(const struct ice_tx_ring *xdp_ring) }void ice_finalize_xdp_rx (struct ice_tx_ring *xdp_ring,unsigned int xdp_res,u32 first_idx); -int ice_xmit_xdp_buff (struct xdp_buff *xdp,struct ice_tx_ring *xdp_ring);int __ice_xmit_xdp_ring (struct xdp_buff *xdp,struct ice_tx_ring *xdp_ring,bool frame);void ice_release_rx_desc (struct ice_rx_ring *rx_ring,u16 val);
Signature · 1 line
2.42.0
Re: [PATCH net-next 07/12] ice: Cleanup unused declarations
Quoted 18 lines · Tony Nguyen
From: Yue Haibing <[email protected]>
Since commit
fff292b47ac1("ice: add VF representors one by one")ice_eswitch_configure()is not used anymore.
Commit1b8f15b64a00("ice: refactor filter functions") removedice_vsi_cfg_mac_fltr()but leave declaration.
Commita24b4c6e9aab("ice: xsk: Do not convert to buff to frame forXDP_TX") leaveice_xmit_xdp_buff()declaration.Commit
7cab44f1c35f("ice: Introduce ETH56G PHY model for E825C products") declared ice_phy_cfg_{rx,tx}_offset_eth56g(), commita1ffafb0b4a4("ice: Support configuring the device to Double VLAN Mode") declaredice_pkg_buf_get_free_space(), and commit8a3a565ff210("ice: add admin commands to access cgu configuration") declaredice_is_pca9575_present(), but all these never be implemented.
Quoted 3 lines
Signed-off-by Yue Haibing <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>Signed-off-by Tony Nguyen <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Tony Nguyen
maintainerPATCH 8/12 iavf: Remove unused declarations
In reply to Tony NguyenFrom: Yue Haibing <[email protected]>
There is no caller and implementation in tree.
--- drivers/net/ethernet/intel/iavf/iavf.h | 10 ---------- drivers/net/ethernet/intel/iavf/iavf_prototype.h | 3 --- 2 files changed, 13 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +0 -10
@@ -529,22 +529,16 @@ static inline void iavf_change_state(struct iavf_adapter *adapter, iavf_state_str(adapter->state)); } -int iavf_up (struct iavf_adapter *adapter);void iavf_down (struct iavf_adapter *adapter);int iavf_process_config (struct iavf_adapter *adapter);int iavf_parse_vf_resource_msg (struct iavf_adapter *adapter);void iavf_schedule_reset (struct iavf_adapter *adapter,u64 flags);void iavf_schedule_aq_request (struct iavf_adapter *adapter,u64 flags);void iavf_schedule_finish_config (struct iavf_adapter *adapter); -void iavf_reset (struct iavf_adapter *adapter);void iavf_set_ethtool_ops (struct net_device *netdev); -void iavf_update_stats (struct iavf_adapter *adapter);void iavf_free_all_tx_resources (struct iavf_adapter *adapter);void iavf_free_all_rx_resources (struct iavf_adapter *adapter); -void iavf_napi_add_all (struct iavf_adapter *adapter); -void iavf_napi_del_all (struct iavf_adapter *adapter); -int iavf_send_api_ver (struct iavf_adapter *adapter);int iavf_verify_api_ver (struct iavf_adapter *adapter);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);u16 iavf_get_num_vlans_added (struct iavf_adapter *adapter);void iavf_irq_enable (struct iavf_adapter *adapter,bool flush);void iavf_configure_queues (struct iavf_adapter *adapter); -void iavf_deconfigure_queues (struct iavf_adapter *adapter);void iavf_enable_queues (struct iavf_adapter *adapter);void iavf_disable_queues (struct iavf_adapter *adapter);void iavf_map_queues (struct iavf_adapter *adapter); -int iavf_request_queues (struct iavf_adapter *adapter,int num);void iavf_add_ether_addrs (struct iavf_adapter *adapter);void iavf_del_ether_addrs (struct iavf_adapter *adapter);void iavf_add_vlans (struct iavf_adapter *adapter);
@@ -579,8 +571,6 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,enum virtchnl_ops v_opcode, enum iavf_status v_retval, u8 *msg, u16 msglen);int iavf_config_rss (struct iavf_adapter *adapter); -int iavf_lan_add_device (struct iavf_adapter *adapter); -int iavf_lan_del_device (struct iavf_adapter *adapter);void iavf_enable_channels (struct iavf_adapter *adapter);void iavf_disable_channels (struct iavf_adapter *adapter);void iavf_add_cloud_filter (struct iavf_adapter *adapter);
drivers/net/ethernet/intel/iavf/iavf_prototype.h +0 -3
@@ -18,7 +18,6 @@/* adminq functions */ enum iavf_status iavf_init_adminq (struct iavf_hw *hw);enum iavf_status iavf_shutdown_adminq (struct iavf_hw *hw); -void iavf_adminq_init_ring_data (struct iavf_hw *hw);enum iavf_status iavf_clean_arq_element (struct iavf_hw *hw,struct iavf_arq_event_info *e,u16 *events_pending);
@@ -33,8 +32,6 @@ bool iavf_asq_done(struct iavf_hw *hw);void iavf_debug_aq (struct iavf_hw *hw,enum iavf_debug_mask mask,void *desc,void *buffer,u16 buf_len); -void iavf_idle_aq (struct iavf_hw *hw); -void iavf_resume_aq (struct iavf_hw *hw);bool iavf_check_asq_alive (struct iavf_hw *hw);enum iavf_status iavf_aq_queue_shutdown (struct iavf_hw *hw,bool unloading);const char *iavf_aq_str (struct iavf_hw *hw,enum iavf_admin_queue_err aq_err);
Signature · 1 line
2.42.0
Re: [PATCH net-next 08/12] iavf: Remove unused declarations
Quoted 8 lines · Tony Nguyen
From: Yue Haibing <[email protected]>
There is no caller and implementation in tree.
Signed-off-by Yue Haibing <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>Signed-off-by Tony Nguyen <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Tony Nguyen
maintainerPATCH 9/12 igb: Cleanup unused declarations
In reply to Tony NguyenFrom: Yue Haibing <[email protected]>
e1000_init_function_pointers_82575() is never implemented and used since commit 9d5c824399de ("igb: PCI-Express 82575 Gigabit Ethernet driver"). And commit 9835fd7321a6 ("igb: Add new function to read part number from EEPROM in string format") removed igb_read_part_num() implementation.
--- drivers/net/ethernet/intel/igb/e1000_mac.h | 1 - drivers/net/ethernet/intel/igb/e1000_nvm.h | 1 - 2 files changed, 2 deletions(-)
drivers/net/ethernet/intel/igb/e1000_mac.h +0 -1
@@ -63,6 +63,5 @@ enum e1000_mng_mode {#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN 0x2 -void e1000_init_function_pointers_82575 (struct e1000_hw *hw);#endif
drivers/net/ethernet/intel/igb/e1000_nvm.h +0 -1
@@ -7,7 +7,6 @@s32 igb_acquire_nvm (struct e1000_hw *hw);void igb_release_nvm (struct e1000_hw *hw);s32 igb_read_mac_addr (struct e1000_hw *hw); -s32 igb_read_part_num (struct e1000_hw *hw,u32 *part_num);s32 igb_read_part_string (struct e1000_hw *hw,u8 *part_num,u32 part_num_size);s32 igb_read_nvm_eerd (struct e1000_hw *hw,u16 offset,u16 words,u16 *data);
Signature · 1 line
2.42.0
Re: [PATCH net-next 09/12] igb: Cleanup unused declarations
Quoted 11 lines · Tony Nguyen
From: Yue Haibing <[email protected]>
e1000_init_function_pointers_82575()is never implemented and used since commit9d5c824399de("igb: PCI-Express 82575 Gigabit Ethernet driver"). And commit9835fd7321a6("igb: Add new function to read part number from EEPROM in string format") removedigb_read_part_num()implementation.Signed-off-by Yue Haibing <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>Signed-off-by Tony Nguyen <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Tony Nguyen
maintainerPATCH 10/12 e1000e: Remove duplicated writel() in e1000_configure_tx/rx()
In reply to Tony NguyenFrom: Takamitsu Iwai <[email protected]>
Duplicated register initialization codes exist in e1000_configure_tx() and e1000_configure_rx().
For example, writel(0, tx_ring->head) writes 0 to tx_ring->head, which is adapter->hw.hw_addr + E1000_TDH(0).
This initialization is already done in ew32(TDH(0), 0).
ew32(TDH(0), 0) is equivalent to __ew32(hw, E1000_TDH(0), 0). It executes writel(0, hw->hw_addr + E1000_TDH(0)). Since variable hw is set to &adapter->hw, it is equal to writel(0, tx_ring->head).
We can remove similar four writel() in e1000_configure_tx() and e1000_configure_rx().
commit 0845d45e900c ("e1000e: Modify Tx/Rx configurations to avoid null pointer dereferences in e1000_open") has introduced these writel(). This commit moved register writing to e1000_configure_tx/rx(), and as result, it caused duplication in e1000_configure_tx/rx().
This patch modifies the sequence of register writing, but removing these writes is safe because the same writes were already there before the commit.
I also have checked the datasheets [0] [1] and have not found any description that we need to write RDH, RDT, TDH and TDT registers twice at initialization. Furthermore, we have tested this patch on an I219-V device physically.
--- drivers/net/ethernet/intel/e1000e/netdev.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/net/ethernet/intel/e1000e/netdev.c +0 -6
@@ -2928,11 +2928,8 @@ static void e1000_configure_tx(struct e1000_adapter *adapter) tx_ring->head = adapter->hw.hw_addr +E1000_TDH (0 ); tx_ring->tail = adapter->hw.hw_addr +E1000_TDT (0 ); -writel (0 , tx_ring->head);if (adapter->flags2 &FLAG2_PCIM2PCI_ARBITER_WA )e1000e_update_tdt_wa (tx_ring,0 ); -else -writel (0 , tx_ring->tail);/* Set the Tx Interrupt Delay register */ ew32 (TIDV , adapter->tx_int_delay);
@@ -3253,11 +3250,8 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) rx_ring->head = adapter->hw.hw_addr +E1000_RDH (0 ); rx_ring->tail = adapter->hw.hw_addr +E1000_RDT (0 ); -writel (0 , rx_ring->head);if (adapter->flags2 &FLAG2_PCIM2PCI_ARBITER_WA )e1000e_update_rdt_wa (rx_ring,0 ); -else -writel (0 , rx_ring->tail);/* Enable Receive Checksum Offload for TCP and UDP */ rxcsum =er32 (RXCSUM );
Signature · 1 line
2.42.0
Tony Nguyen
maintainerPATCH 11/12 e1000e: Link NAPI instances to queues and IRQs
In reply to Tony NguyenFrom: Joe Damato <[email protected]>
Add support for netdev-genl, allowing users to query IRQ, NAPI, and queue information.
After this patch is applied, note the IRQs assigned to my NIC:
$ cat /proc/interrupts | grep ens | cut -f1 --delimiter=':' 50 51 52
While e1000e allocates 3 IRQs (RX, TX, and other), it looks like e1000e only has a single NAPI, so I've associated the NAPI with the RX IRQ (50 on my system, seen above).
Note the output from the cli:
$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
--dump napi-get --json='{"ifindex": 2}'
[{'id': 145, 'ifindex': 2, 'irq': 50}]This device supports only 1 rx and 1 tx queue. so querying that:
$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
--dump queue-get --json='{"ifindex": 2}'
[{'id': 0, 'ifindex': 2, 'napi-id': 145, 'type': 'rx'},
{'id': 0, 'ifindex': 2, 'napi-id': 145, 'type': 'tx'}]--- drivers/net/ethernet/intel/e1000e/netdev.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/ethernet/intel/e1000e/netdev.c +11 -0
@@ -4607,6 +4607,7 @@ int e1000e_open(struct net_device *netdev)struct e1000_hw *hw = &adapter->hw;struct pci_dev *pdev = adapter->pdev;int err; +int irq;/* disallow open during test */ if (test_bit (__E1000_TESTING, &adapter->state))
@@ -4670,7 +4671,15 @@ int e1000e_open(struct net_device *netdev)/* From here on the code is the same as e1000e_up() */ clear_bit (__E1000_DOWN, &adapter->state); +if (adapter->int_mode ==E1000E_INT_MODE_MSIX ) + irq = adapter->msix_entries[0 ].vector; +else + irq = adapter->pdev->irq; + +netif_napi_set_irq (&adapter->napi, irq);napi_enable (&adapter->napi); +netif_queue_set_napi (netdev,0 ,NETDEV_QUEUE_TYPE_RX , &adapter->napi); +netif_queue_set_napi (netdev,0 ,NETDEV_QUEUE_TYPE_TX , &adapter->napi);e1000_irq_enable (adapter);
@@ -4729,6 +4738,8 @@ int e1000e_close(struct net_device *netdev)netdev_info (netdev,"NIC Link is Down\n" ); } +netif_queue_set_napi (netdev,0 ,NETDEV_QUEUE_TYPE_RX ,NULL ); +netif_queue_set_napi (netdev,0 ,NETDEV_QUEUE_TYPE_TX ,NULL );napi_disable (&adapter->napi);e1000e_free_tx_resources (adapter->tx_ring);
Signature · 1 line
2.42.0
Tony Nguyen
maintainerPATCH 12/12 e1000: Link NAPI instances to queues and IRQs
In reply to Tony NguyenFrom: Joe Damato <[email protected]>
Add support for netdev-genl, allowing users to query IRQ, NAPI, and queue information.
After this patch is applied, note the IRQ assigned to my NIC:
$ cat /proc/interrupts | grep enp0s8 | cut -f1 --delimiter=':' 18
Note the output from the cli:
$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
--dump napi-get --json='{"ifindex": 2}'
[{'id': 513, 'ifindex': 2, 'irq': 18}]This device supports only 1 rx and 1 tx queue, so querying that:
$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
--dump queue-get --json='{"ifindex": 2}'
[{'id': 0, 'ifindex': 2, 'napi-id': 513, 'type': 'rx'},
{'id': 0, 'ifindex': 2, 'napi-id': 513, 'type': 'tx'}]--- drivers/net/ethernet/intel/e1000/e1000_main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/e1000/e1000_main.c +5 -0
@@ -513,6 +513,8 @@ void e1000_down(struct e1000_adapter *adapter)*/ netif_carrier_off (netdev); +netif_queue_set_napi (netdev,0 ,NETDEV_QUEUE_TYPE_RX ,NULL ); +netif_queue_set_napi (netdev,0 ,NETDEV_QUEUE_TYPE_TX ,NULL );napi_disable (&adapter->napi);e1000_irq_disable (adapter);
@@ -1392,7 +1394,10 @@ int e1000_open(struct net_device *netdev)/* From here on the code is the same as e1000_up() */ clear_bit (__E1000_DOWN, &adapter->flags); +netif_napi_set_irq (&adapter->napi, adapter->pdev->irq);napi_enable (&adapter->napi); +netif_queue_set_napi (netdev,0 ,NETDEV_QUEUE_TYPE_RX , &adapter->napi); +netif_queue_set_napi (netdev,0 ,NETDEV_QUEUE_TYPE_TX , &adapter->napi);e1000_irq_enable (adapter);
Signature · 1 line
2.42.0
This series was applied to netdev/net-next.git (main) by Tony Nguyen <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Tony Nguyen <[email protected]>:
Quoted 8 lines · On Tue, 8 Oct 2024 16:34:26 -0700 you wrote:
This series contains updates to ice, iavf, igb, e1000e, and e1000 drivers.
For ice:
Wojciech adds support for ethtool reset.
[...]
Here is the summary with links:
- [net-next,01/12] ice: Implement ethtool reset support
https://git.kernel.org/netdev/net-next/c/b699c81af068 - [net-next,02/12] ice: add E830 HW VF mailbox message limit support https://git.kernel.org/netdev/net-next/c/59f4d59b25ae - [net-next,03/12] ice: consistently use q_idx in ice_vc_cfg_qs_msg() https://git.kernel.org/netdev/net-next/c/a884c304e18a - [net-next,04/12] ice: store max_frame and rx_buf_len only in ice_rx_ring https://git.kernel.org/netdev/net-next/c/7e61c89c6065 - [net-next,05/12] ice: Make use of assign_bit() API https://git.kernel.org/netdev/net-next/c/8d873ccd8a07 - [net-next,06/12] ice: Use common error handling code in two functions https://git.kernel.org/netdev/net-next/c/5f4493f06e81 - [net-next,07/12] ice: Cleanup unused declarations https://git.kernel.org/netdev/net-next/c/ac532f4f4251 - [net-next,08/12] iavf: Remove unused declarations https://git.kernel.org/netdev/net-next/c/cb31d19a0292 - [net-next,09/12] igb: Cleanup unused declarations https://git.kernel.org/netdev/net-next/c/c3c50d4c62a2 - [net-next,10/12] e1000e: Remove duplicated writel() in e1000_configure_tx/rx() https://git.kernel.org/netdev/net-next/c/0cab3b0f8306 - [net-next,11/12] e1000e: Link NAPI instances to queues and IRQs https://git.kernel.org/netdev/net-next/c/c6b8cd699128 - [net-next,12/12] e1000: Link NAPI instances to queues and IRQs https://git.kernel.org/netdev/net-next/c/8f7ff18a5ec7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html