Skip to contentSkip to conversation

ice: add E830 Earliest TxTime First Offload support

PATCH Superseded Paul Greenwalt 2 participants 3 messages Mar 11, 2025 – Mar 12, 2025

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ice: add E830 Earliest TxTime First Offload support

E830 supports Earliest TxTime First (ETF) hardware offload, which is configured via the ETF Qdisc (see tc-etf(8)). ETF introduces a new Tx flow mechanism that utilizes a timestamp ring (tstamp_ring) alongside the standard Tx ring. This timestamp ring is used to indicate when hardware will transmit a packet.

The allocation and initialization of the timestamp ring occur when the feature is enabled via tc-etf. Since the timestamp ring and Tx ring are tightly coupled, both must be configured simultaneously.

To support ETF, the following flags are introduced:

- ICE_F_TXTIME: Device feature flag set for E830 NICs, indicating ETF support.
- ICE_FLAG_TXTIME: PF-level flag indicating whether ETF is enabled on any Tx queue. It is checked during ring allocation to determine if timestamp rings should be allocated and is also referenced when modifying queue count via ethtool -G.
- ICE_TX_FLAGS_TXTIME: Per-ring flag set when ETF is enabled and cleared when disabled for a specific Tx queue. It helps determine ETF status when transmitting timestamped packets and is used by ice_is_txtime_ena() to check if ETF is enabled on any Tx queue.

Due to a hardware issue that can result in a malicious driver detection event, additional timestamp descriptors are required when wrapping the timestamp ring. Up to 64 additional timestamp descriptors are reserved, reducing the available Tx descriptors.

To accommodate this, ICE_MAX_NUM_DESC_BY_MAC is introduced, defining:

- E830: Maximum Tx descriptor length of 8096 (8K - 32 - 64 for timestamp fetch descriptors).
- E810 and E82X: Maximum Tx descriptor length of 8160 (8K - 32) .

---
Changelog:
v0->v1:
- Resolve patch apply isue.
- Fixes RCT, zero struct initialization, move bailout condition to top
of function, removed unnecessary newlines, and added use of
str_enable_disable.
v0: https://patchwork.ozlabs.org/project/intel-wired-lan/patch/[email protected]/

---
 drivers/net/ethernet/intel/ice/ice.h          |   9 +-
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  53 +++++
 drivers/net/ethernet/intel/ice/ice_base.c     | 210 +++++++++++++++---
 drivers/net/ethernet/intel/ice/ice_base.h     |   1 +
 drivers/net/ethernet/intel/ice/ice_common.c   | 118 ++++++++++
 drivers/net/ethernet/intel/ice/ice_common.h   |  10 +
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |  61 ++++-
 .../net/ethernet/intel/ice/ice_hw_autogen.h   |   3 +
 .../net/ethernet/intel/ice/ice_lan_tx_rx.h    |  42 ++++
 drivers/net/ethernet/intel/ice/ice_lib.c      |  45 +++-
 drivers/net/ethernet/intel/ice/ice_main.c     | 174 ++++++++++++++-
 drivers/net/ethernet/intel/ice/ice_txrx.c     | 129 ++++++++++-
 drivers/net/ethernet/intel/ice/ice_txrx.h     |   4 +
 drivers/net/ethernet/intel/ice/ice_txrx_lib.h |  14 ++
 drivers/net/ethernet/intel/ice/ice_virtchnl.c |   2 +-
 15 files changed, 822 insertions(+), 53 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +8 -1
index 2694951a0b1d..43a34e3fa762 100644
@@ -83,7 +83,11 @@
 #define ICE_BAR0		0
 #define ICE_REQ_DESC_MULTIPLE	32
 #define ICE_MIN_NUM_DESC	64
-#define ICE_MAX_NUM_DESC	8160
+#define ICE_MAX_NUM_DESC_E810	8160
+#define ICE_MAX_NUM_DESC_E830	8096
+#define ICE_MAX_NUM_DESC_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? \
+				     ICE_MAX_NUM_DESC_E830 : \
+				     ICE_MAX_NUM_DESC_E810)
 #define ICE_DFLT_MIN_RX_DESC	512
 #define ICE_DFLT_NUM_TX_DESC	256
 #define ICE_DFLT_NUM_RX_DESC	2048
@@ -201,6 +205,7 @@ enum ice_feature {
 	ICE_F_SMA_CTRL,
 	ICE_F_CGU,
 	ICE_F_GNSS,
+	ICE_F_TXTIME,
 	ICE_F_GCS,
 	ICE_F_ROCE_LAG,
 	ICE_F_SRIOV_LAG,
@@ -332,6 +337,7 @@ struct ice_vsi {
 	struct ice_pf *back;		 /* back pointer to PF */
 	struct ice_rx_ring **rx_rings;	 /* Rx ring array */
 	struct ice_tx_ring **tx_rings;	 /* Tx ring array */
+	struct ice_tx_ring **tstamp_rings; /* Time stamp ring array */
 	struct ice_q_vector **q_vectors; /* q_vector array */
 
 	irqreturn_t (*irq_handler)(int irq, void *data);
@@ -516,6 +522,7 @@ enum ice_pf_flags {
 	ICE_FLAG_GNSS,			/* GNSS successfully initialized */
 	ICE_FLAG_DPLL,			/* SyncE/PTP dplls initialized */
 	ICE_FLAG_LLDP_AQ_FLTR,
+	ICE_FLAG_TXTIME,
 	ICE_PF_FLAGS_NBITS		/* must be last */
 };
 
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +53 -0

80 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_base.c +177 -33

294 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_base.h +1 -0
index b711bc921928..a55653ad85de 100644
@@ -32,4 +32,5 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,
 void
 ice_fill_txq_meta(const struct ice_vsi *vsi, struct ice_tx_ring *ring,
 		  struct ice_txq_meta *txq_meta);
+u16 ice_calc_ts_ring_count(struct ice_hw *hw, u16 tx_desc_count);
 #endif /* _ICE_BASE_H_ */
drivers/net/ethernet/intel/ice/ice_common.c +118 -0

130 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_common.h +10 -0
index 64c530b39191..aefcf719e460 100644
@@ -228,6 +228,16 @@ int ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);
 void ice_replay_post(struct ice_hw *hw);
 struct ice_q_ctx *
 ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle);
+int
+ice_aq_set_txtimeq(struct ice_hw *hw, u16 txtimeq, u8 q_count,
+		   struct ice_aqc_set_txtime_qgrp *txtime_qg,
+		   u16 buf_size, struct ice_sq_cd *cd);
+int
+ice_aq_ena_dis_txtimeq(struct ice_hw *hw, u16 txtimeq, u16 q_count, bool q_ena,
+		       struct ice_aqc_ena_dis_txtime_qgrp *txtime_qg,
+		       struct ice_sq_cd *cd);
+void ice_pack_txtime_ctx(const struct ice_txtime_ctx *ctx,
+			 ice_txtime_ctx_buf_t *buf);
 int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in, u16 flag);
 int
 ice_aq_get_cgu_abilities(struct ice_hw *hw,
drivers/net/ethernet/intel/ice/ice_ethtool.c +54 -7

123 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_hw_autogen.h +3 -0
index aa4bfbcf85d2..fa4b2b92f5da 100644
@@ -18,6 +18,7 @@
 #define QTX_COMM_HEAD(_DBQM)			(0x000E0000 + ((_DBQM) * 4))
 #define QTX_COMM_HEAD_HEAD_S			0
 #define QTX_COMM_HEAD_HEAD_M			ICE_M(0x1FFF, 0)
+#define E830_GLQTX_TXTIME_DBELL_LSB(_DBQM)	(0x002E0000 + ((_DBQM) * 8))
 #define PF_FW_ARQBAH				0x00080180
 #define PF_FW_ARQBAL				0x00080080
 #define PF_FW_ARQH				0x00080380
@@ -559,6 +560,8 @@
 #define E830_PFPTM_SEM_BUSY_M			BIT(0)
 #define VFINT_DYN_CTLN(_i)			(0x00003800 + ((_i) * 4))
 #define VFINT_DYN_CTLN_CLEARPBA_M		BIT(1)
+#define E830_GLTXTIME_FETCH_PROFILE(_i, _j)     (0x002D3500 + ((_i) * 4 + (_j) * 64))
+#define E830_GLTXTIME_FETCH_PROFILE_FETCH_TS_DESC_M ICE_M(0x1FF, 0)
 #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)
drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h +42 -0

46 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_lib.c +44 -1

89 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_main.c +172 -2

205 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_txrx.c +121 -8

181 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_txrx.h +4 -0
index a4b1e9514632..4b63081629d0 100644
@@ -406,6 +406,7 @@ struct ice_tx_ring {
 #define ICE_TX_FLAGS_RING_XDP		BIT(0)
 #define ICE_TX_FLAGS_RING_VLAN_L2TAG1	BIT(1)
 #define ICE_TX_FLAGS_RING_VLAN_L2TAG2	BIT(2)
+#define ICE_TX_FLAGS_TXTIME		BIT(3)
 	u8 flags;
 	u8 dcb_tc;			/* Traffic class of ring */
 	u16 quanta_prof_id;
@@ -497,10 +498,13 @@ u16
 ice_select_queue(struct net_device *dev, struct sk_buff *skb,
 		 struct net_device *sb_dev);
 void ice_clean_tx_ring(struct ice_tx_ring *tx_ring);
+int ice_setup_tstamp_ring(struct ice_tx_ring *tstamp_ring);
+void ice_clean_tstamp_ring(struct ice_tx_ring *tstamp_ring);
 void ice_clean_rx_ring(struct ice_rx_ring *rx_ring);
 int ice_setup_tx_ring(struct ice_tx_ring *tx_ring);
 int ice_setup_rx_ring(struct ice_rx_ring *rx_ring);
 void ice_free_tx_ring(struct ice_tx_ring *tx_ring);
+void ice_free_tstamp_ring(struct ice_tx_ring *tstamp_ring);
 void ice_free_rx_ring(struct ice_rx_ring *rx_ring);
 int ice_napi_poll(struct napi_struct *napi, int budget);
 int
drivers/net/ethernet/intel/ice/ice_txrx_lib.h +14 -0
index 6cf32b404127..99717730f21a 100644
@@ -53,6 +53,20 @@ ice_build_ctob(u64 td_cmd, u64 td_offset, unsigned int size, u64 td_tag)
 			   (td_tag    << ICE_TXD_QW1_L2TAG1_S));
 }
 
+/**
+ * ice_build_tstamp_desc - build Tx time stamp descriptor
+ * @tx_desc: Tx LAN descriptor index
+ * @tstamp: time stamp
+ *
+ * Return: Tx time stamp descriptor
+ */
+static inline __le32
+ice_build_tstamp_desc(u16 tx_desc, u32 tstamp)
+{
+	return cpu_to_le32(FIELD_PREP(ICE_TXTIME_TX_DESC_IDX_M, tx_desc) |
+			   FIELD_PREP(ICE_TXTIME_STAMP_M, tstamp));
+}
+
 /**
  * ice_get_vlan_tci - get VLAN TCI from Rx flex descriptor
  * @rx_desc: Rx 32b flex descriptor with RXDID=2
drivers/net/ethernet/intel/ice/ice_virtchnl.c +1 -1
index b147f6cf2615..25a283c93f55 100644
@@ -582,7 +582,7 @@ static bool ice_vc_isvalid_ring_len(u16 ring_len)
 {
 	return ring_len == 0 ||
 	       (ring_len >= ICE_MIN_NUM_DESC &&
-		ring_len <= ICE_MAX_NUM_DESC &&
+		ring_len <= ICE_MAX_NUM_DESC_E810 &&
 		!(ring_len % ICE_REQ_DESC_MULTIPLE));
 }
 
Signature · 1 line
2.47.0
#1 lore raw
kernel test robot noticed the following build errors:

Hi Paul,

kernel test robot noticed the following build errors:

[auto build test ERROR on tnguy-next-queue/dev-queue]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Greenwalt/ice-add-E830-Earliest-TxTime-First-Offload-support/20250312-051400
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
patch link:    https://lore.kernel.org/r/20250311132327.76804-1-paul.greenwalt%40intel.com
patch subject: [PATCH iwl-next v2] ice: add E830 Earliest TxTime First Offload support
config: arm-randconfig-003-20250312 (https://download.01.org/0day-ci/archive/20250312/[email protected]/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250312/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/intel/ice/ice_base.c:1023:39: error: passing 'const struct ice_vsi *' to parameter of type 'struct ice_vsi *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    1023 |         ring->q_handle = ice_calc_txq_handle(vsi, ring, tc);
         |                                              ^~~

drivers/net/ethernet/intel/ice/ice_base.c:245:48: note: passing argument to parameter 'vsi' here
245 | static u16 ice_calc_txq_handle(struct ice_vsi *vsi, struct ice_tx_ring *ring, u8 tc)
| ^
1 error generated.

vim +1023 drivers/net/ethernet/intel/ice/ice_base.c

eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   974  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   975  /**
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   976   * ice_vsi_cfg_txq - Configure single Tx queue
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   977   * @vsi: the VSI that queue belongs to
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   978   * @ring: Tx ring to be configured
51900dfcf194b39 Paul Greenwalt         2025-03-11   979   * @tstamp_ring: time stamp ring to be configured
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   980   * @qg_buf: queue group buffer
51900dfcf194b39 Paul Greenwalt         2025-03-11   981   * @txtime_qg_buf: Tx Time queue group buffer
51900dfcf194b39 Paul Greenwalt         2025-03-11   982   *
51900dfcf194b39 Paul Greenwalt         2025-03-11   983   * Return: 0 on success and a negative value on error.
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   984   */
a292ba981324ec7 Maciej Fijalkowski     2024-01-23   985  static int
51900dfcf194b39 Paul Greenwalt         2025-03-11   986  ice_vsi_cfg_txq(const struct ice_vsi *vsi, struct ice_tx_ring *ring,
51900dfcf194b39 Paul Greenwalt         2025-03-11   987  		struct ice_tx_ring *tstamp_ring,
51900dfcf194b39 Paul Greenwalt         2025-03-11   988  		struct ice_aqc_add_tx_qgrp *qg_buf,
51900dfcf194b39 Paul Greenwalt         2025-03-11   989  		struct ice_aqc_set_txtime_qgrp *txtime_qg_buf)
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   990  {
66486d8943bac36 Bruce Allan            2020-06-29   991  	u8 buf_len = struct_size(qg_buf, txqs, 1);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   992  	struct ice_tlan_ctx tlan_ctx = { 0 };
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   993  	struct ice_aqc_add_txqs_perq *txq;
0754d65bd4be5bb Kiran Patil            2021-10-15   994  	struct ice_channel *ch = ring->ch;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   995  	struct ice_pf *pf = vsi->back;
7e34786a74e1403 Bruce Allan            2020-05-15   996  	struct ice_hw *hw = &pf->hw;
5e24d5984c805c6 Tony Nguyen            2021-10-07   997  	int status;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   998  	u16 pf_q;
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24   999  	u8 tc;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1000  
634da4c118434cf Benita Bose            2021-03-02  1001  	/* Configure XPS */
634da4c118434cf Benita Bose            2021-03-02  1002  	ice_cfg_xps_tx_ring(ring);
634da4c118434cf Benita Bose            2021-03-02  1003  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1004  	pf_q = ring->reg_idx;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1005  	ice_setup_tx_ctx(ring, &tlan_ctx, pf_q);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1006  	/* copy context contents into the qg_buf */
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1007  	qg_buf->txqs[0].txq_id = cpu_to_le16(pf_q);
dc4305be467a6f8 Jacob Keller           2024-12-10  1008  	ice_pack_txq_ctx(&tlan_ctx, &qg_buf->txqs[0].txq_ctx);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1009  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1010  	/* init queue specific tail reg. It is referred as
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1011  	 * transmit comm scheduler queue doorbell.
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1012  	 */
7e34786a74e1403 Bruce Allan            2020-05-15  1013  	ring->tail = hw->hw_addr + QTX_COMM_DBELL(pf_q);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1014  
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1015  	if (IS_ENABLED(CONFIG_DCB))
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1016  		tc = ring->dcb_tc;
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1017  	else
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1018  		tc = 0;
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1019  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1020  	/* Add unique software queue handle of the Tx queue per
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1021  	 * TC into the VSI Tx ring
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1022  	 */
e72bba21355dbb6 Maciej Fijalkowski     2021-08-19 @1023  	ring->q_handle = ice_calc_txq_handle(vsi, ring, tc);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1024  
0754d65bd4be5bb Kiran Patil            2021-10-15  1025  	if (ch)
0754d65bd4be5bb Kiran Patil            2021-10-15  1026  		status = ice_ena_vsi_txq(vsi->port_info, ch->ch_vsi->idx, 0,
0754d65bd4be5bb Kiran Patil            2021-10-15  1027  					 ring->q_handle, 1, qg_buf, buf_len,
0754d65bd4be5bb Kiran Patil            2021-10-15  1028  					 NULL);
0754d65bd4be5bb Kiran Patil            2021-10-15  1029  	else
0754d65bd4be5bb Kiran Patil            2021-10-15  1030  		status = ice_ena_vsi_txq(vsi->port_info, vsi->idx, tc,
0754d65bd4be5bb Kiran Patil            2021-10-15  1031  					 ring->q_handle, 1, qg_buf, buf_len,
0754d65bd4be5bb Kiran Patil            2021-10-15  1032  					 NULL);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1033  	if (status) {
5f87ec4861aa1b8 Tony Nguyen            2021-10-07  1034  		dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %d\n",
5f87ec4861aa1b8 Tony Nguyen            2021-10-07  1035  			status);
c14846914ed6b57 Tony Nguyen            2021-10-07  1036  		return status;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1037  	}
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1038  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1039  	/* Add Tx Queue TEID into the VSI Tx ring from the
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1040  	 * response. This will complete configuring and
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1041  	 * enabling the queue.
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1042  	 */
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1043  	txq = &qg_buf->txqs[0];
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1044  	if (pf_q == le16_to_cpu(txq->txq_id))
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1045  		ring->txq_teid = le32_to_cpu(txq->q_teid);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1046  
51900dfcf194b39 Paul Greenwalt         2025-03-11  1047  	if (tstamp_ring) {
51900dfcf194b39 Paul Greenwalt         2025-03-11  1048  		u8 txtime_buf_len = struct_size(txtime_qg_buf, txtimeqs, 1);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1049  		struct ice_txtime_ctx txtime_ctx = {};
51900dfcf194b39 Paul Greenwalt         2025-03-11  1050  
51900dfcf194b39 Paul Greenwalt         2025-03-11  1051  		ice_setup_txtime_ctx(tstamp_ring, &txtime_ctx,
51900dfcf194b39 Paul Greenwalt         2025-03-11  1052  				     !!(ring->flags & ICE_TX_FLAGS_TXTIME));
51900dfcf194b39 Paul Greenwalt         2025-03-11  1053  		ice_pack_txtime_ctx(&txtime_ctx,
51900dfcf194b39 Paul Greenwalt         2025-03-11  1054  				    &txtime_qg_buf->txtimeqs[0].txtime_ctx);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1055  
51900dfcf194b39 Paul Greenwalt         2025-03-11  1056  		tstamp_ring->tail =
51900dfcf194b39 Paul Greenwalt         2025-03-11  1057  			 hw->hw_addr + E830_GLQTX_TXTIME_DBELL_LSB(pf_q);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1058  
51900dfcf194b39 Paul Greenwalt         2025-03-11  1059  		status = ice_aq_set_txtimeq(hw, pf_q, 1, txtime_qg_buf,
51900dfcf194b39 Paul Greenwalt         2025-03-11  1060  					    txtime_buf_len, NULL);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1061  		if (status) {
51900dfcf194b39 Paul Greenwalt         2025-03-11  1062  			dev_err(ice_pf_to_dev(pf), "Failed to set Tx Time queue context, error: %d\n",
51900dfcf194b39 Paul Greenwalt         2025-03-11  1063  				status);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1064  			return status;
51900dfcf194b39 Paul Greenwalt         2025-03-11  1065  		}
51900dfcf194b39 Paul Greenwalt         2025-03-11  1066  	}
51900dfcf194b39 Paul Greenwalt         2025-03-11  1067  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1068  	return 0;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1069  }
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1070  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#2 lore raw
In reply to Paul Greenwalt
kernel test robot noticed the following build warnings:

Hi Paul,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tnguy-next-queue/dev-queue]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Greenwalt/ice-add-E830-Earliest-TxTime-First-Offload-support/20250312-051400
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
patch link:    https://lore.kernel.org/r/20250311132327.76804-1-paul.greenwalt%40intel.com
patch subject: [PATCH iwl-next v2] ice: add E830 Earliest TxTime First Offload support
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20250312/[email protected]/config)
compiler: s390-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250312/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/net/ethernet/intel/ice/ice_base.c: In function 'ice_vsi_cfg_txq':

>> drivers/net/ethernet/intel/ice/ice_base.c:1023:46: warning: passing argument 1 of 'ice_calc_txq_handle' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1023 |         ring->q_handle = ice_calc_txq_handle(vsi, ring, tc);
         |                                              ^~~

drivers/net/ethernet/intel/ice/ice_base.c:245:48: note: expected 'struct ice_vsi *' but argument is of type 'const struct ice_vsi *'
245 | static u16 ice_calc_txq_handle(struct ice_vsi *vsi, struct ice_tx_ring *ring, u8 tc)
| ~~~~~~~~~~~~~~~~^~~

vim +1023 drivers/net/ethernet/intel/ice/ice_base.c

eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   974  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   975  /**
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   976   * ice_vsi_cfg_txq - Configure single Tx queue
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   977   * @vsi: the VSI that queue belongs to
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   978   * @ring: Tx ring to be configured
51900dfcf194b39 Paul Greenwalt         2025-03-11   979   * @tstamp_ring: time stamp ring to be configured
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   980   * @qg_buf: queue group buffer
51900dfcf194b39 Paul Greenwalt         2025-03-11   981   * @txtime_qg_buf: Tx Time queue group buffer
51900dfcf194b39 Paul Greenwalt         2025-03-11   982   *
51900dfcf194b39 Paul Greenwalt         2025-03-11   983   * Return: 0 on success and a negative value on error.
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   984   */
a292ba981324ec7 Maciej Fijalkowski     2024-01-23   985  static int
51900dfcf194b39 Paul Greenwalt         2025-03-11   986  ice_vsi_cfg_txq(const struct ice_vsi *vsi, struct ice_tx_ring *ring,
51900dfcf194b39 Paul Greenwalt         2025-03-11   987  		struct ice_tx_ring *tstamp_ring,
51900dfcf194b39 Paul Greenwalt         2025-03-11   988  		struct ice_aqc_add_tx_qgrp *qg_buf,
51900dfcf194b39 Paul Greenwalt         2025-03-11   989  		struct ice_aqc_set_txtime_qgrp *txtime_qg_buf)
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   990  {
66486d8943bac36 Bruce Allan            2020-06-29   991  	u8 buf_len = struct_size(qg_buf, txqs, 1);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   992  	struct ice_tlan_ctx tlan_ctx = { 0 };
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   993  	struct ice_aqc_add_txqs_perq *txq;
0754d65bd4be5bb Kiran Patil            2021-10-15   994  	struct ice_channel *ch = ring->ch;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   995  	struct ice_pf *pf = vsi->back;
7e34786a74e1403 Bruce Allan            2020-05-15   996  	struct ice_hw *hw = &pf->hw;
5e24d5984c805c6 Tony Nguyen            2021-10-07   997  	int status;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24   998  	u16 pf_q;
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24   999  	u8 tc;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1000  
634da4c118434cf Benita Bose            2021-03-02  1001  	/* Configure XPS */
634da4c118434cf Benita Bose            2021-03-02  1002  	ice_cfg_xps_tx_ring(ring);
634da4c118434cf Benita Bose            2021-03-02  1003  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1004  	pf_q = ring->reg_idx;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1005  	ice_setup_tx_ctx(ring, &tlan_ctx, pf_q);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1006  	/* copy context contents into the qg_buf */
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1007  	qg_buf->txqs[0].txq_id = cpu_to_le16(pf_q);
dc4305be467a6f8 Jacob Keller           2024-12-10  1008  	ice_pack_txq_ctx(&tlan_ctx, &qg_buf->txqs[0].txq_ctx);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1009  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1010  	/* init queue specific tail reg. It is referred as
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1011  	 * transmit comm scheduler queue doorbell.
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1012  	 */
7e34786a74e1403 Bruce Allan            2020-05-15  1013  	ring->tail = hw->hw_addr + QTX_COMM_DBELL(pf_q);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1014  
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1015  	if (IS_ENABLED(CONFIG_DCB))
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1016  		tc = ring->dcb_tc;
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1017  	else
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1018  		tc = 0;
e75d1b2c3731999 Maciej Fijalkowski     2019-10-24  1019  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1020  	/* Add unique software queue handle of the Tx queue per
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1021  	 * TC into the VSI Tx ring
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1022  	 */
e72bba21355dbb6 Maciej Fijalkowski     2021-08-19 @1023  	ring->q_handle = ice_calc_txq_handle(vsi, ring, tc);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1024  
0754d65bd4be5bb Kiran Patil            2021-10-15  1025  	if (ch)
0754d65bd4be5bb Kiran Patil            2021-10-15  1026  		status = ice_ena_vsi_txq(vsi->port_info, ch->ch_vsi->idx, 0,
0754d65bd4be5bb Kiran Patil            2021-10-15  1027  					 ring->q_handle, 1, qg_buf, buf_len,
0754d65bd4be5bb Kiran Patil            2021-10-15  1028  					 NULL);
0754d65bd4be5bb Kiran Patil            2021-10-15  1029  	else
0754d65bd4be5bb Kiran Patil            2021-10-15  1030  		status = ice_ena_vsi_txq(vsi->port_info, vsi->idx, tc,
0754d65bd4be5bb Kiran Patil            2021-10-15  1031  					 ring->q_handle, 1, qg_buf, buf_len,
0754d65bd4be5bb Kiran Patil            2021-10-15  1032  					 NULL);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1033  	if (status) {
5f87ec4861aa1b8 Tony Nguyen            2021-10-07  1034  		dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %d\n",
5f87ec4861aa1b8 Tony Nguyen            2021-10-07  1035  			status);
c14846914ed6b57 Tony Nguyen            2021-10-07  1036  		return status;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1037  	}
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1038  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1039  	/* Add Tx Queue TEID into the VSI Tx ring from the
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1040  	 * response. This will complete configuring and
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1041  	 * enabling the queue.
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1042  	 */
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1043  	txq = &qg_buf->txqs[0];
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1044  	if (pf_q == le16_to_cpu(txq->txq_id))
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1045  		ring->txq_teid = le32_to_cpu(txq->q_teid);
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1046  
51900dfcf194b39 Paul Greenwalt         2025-03-11  1047  	if (tstamp_ring) {
51900dfcf194b39 Paul Greenwalt         2025-03-11  1048  		u8 txtime_buf_len = struct_size(txtime_qg_buf, txtimeqs, 1);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1049  		struct ice_txtime_ctx txtime_ctx = {};
51900dfcf194b39 Paul Greenwalt         2025-03-11  1050  
51900dfcf194b39 Paul Greenwalt         2025-03-11  1051  		ice_setup_txtime_ctx(tstamp_ring, &txtime_ctx,
51900dfcf194b39 Paul Greenwalt         2025-03-11  1052  				     !!(ring->flags & ICE_TX_FLAGS_TXTIME));
51900dfcf194b39 Paul Greenwalt         2025-03-11  1053  		ice_pack_txtime_ctx(&txtime_ctx,
51900dfcf194b39 Paul Greenwalt         2025-03-11  1054  				    &txtime_qg_buf->txtimeqs[0].txtime_ctx);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1055  
51900dfcf194b39 Paul Greenwalt         2025-03-11  1056  		tstamp_ring->tail =
51900dfcf194b39 Paul Greenwalt         2025-03-11  1057  			 hw->hw_addr + E830_GLQTX_TXTIME_DBELL_LSB(pf_q);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1058  
51900dfcf194b39 Paul Greenwalt         2025-03-11  1059  		status = ice_aq_set_txtimeq(hw, pf_q, 1, txtime_qg_buf,
51900dfcf194b39 Paul Greenwalt         2025-03-11  1060  					    txtime_buf_len, NULL);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1061  		if (status) {
51900dfcf194b39 Paul Greenwalt         2025-03-11  1062  			dev_err(ice_pf_to_dev(pf), "Failed to set Tx Time queue context, error: %d\n",
51900dfcf194b39 Paul Greenwalt         2025-03-11  1063  				status);
51900dfcf194b39 Paul Greenwalt         2025-03-11  1064  			return status;
51900dfcf194b39 Paul Greenwalt         2025-03-11  1065  		}
51900dfcf194b39 Paul Greenwalt         2025-03-11  1066  	}
51900dfcf194b39 Paul Greenwalt         2025-03-11  1067  
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1068  	return 0;
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1069  }
eff380aaffedb27 Anirudh Venkataramanan 2019-10-24  1070  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki