Commit bbabce5d authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2026-01-26 (ice, idpf)

For ice:
Jake converts ring stats to utilize u64_stats APIs and performs some
cleanups along the way.

Alexander reorganizes layout of Tx and Rx rings for cacheline
locality and utilizes __cacheline_group* macros on the new layouts.

For idpf:
YiFei Zhu adds support for BPF kfunc reporting of hardware Rx timestamps.

* '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  idpf: export RX hardware timestamping information to XDP
  ice: reshuffle and group Rx and Tx queue fields by cachelines
  ice: convert all ring stats to u64_stats_t
  ice: shorten ring stat names and add accessors
  ice: use u64_stats API to access pkts/bytes in dim sample
  ice: remove ice_q_stats struct and use struct_group
  ice: pass pointer to ice_fetch_u64_stats_per_ring
====================

Link: https://patch.msgid.link/20260126224313.3847849-1-anthony.l.nguyen@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 1f6b527b 13a4be41
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -957,9 +957,6 @@ u16 ice_get_avail_rxq_count(struct ice_pf *pf);
int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked);
void ice_update_vsi_stats(struct ice_vsi *vsi);
void ice_update_pf_stats(struct ice_pf *pf);
void
ice_fetch_u64_stats_per_ring(struct u64_stats_sync *syncp,
			     struct ice_q_stats stats, u64 *pkts, u64 *bytes);
int ice_up(struct ice_vsi *vsi);
int ice_down(struct ice_vsi *vsi);
int ice_down_up(struct ice_vsi *vsi);
+2 −2
Original line number Diff line number Diff line
@@ -1414,8 +1414,8 @@ static void ice_qp_reset_stats(struct ice_vsi *vsi, u16 q_idx)
	if (!vsi_stat)
		return;

	memset(&vsi_stat->rx_ring_stats[q_idx]->rx_stats, 0,
	       sizeof(vsi_stat->rx_ring_stats[q_idx]->rx_stats));
	memset(&vsi_stat->rx_ring_stats[q_idx]->stats, 0,
	       sizeof(vsi_stat->rx_ring_stats[q_idx]->stats));
	memset(&vsi_stat->tx_ring_stats[q_idx]->stats, 0,
	       sizeof(vsi_stat->tx_ring_stats[q_idx]->stats));
	if (vsi->xdp_rings)
+20 −11
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ static int ice_q_stats_len(struct net_device *netdev)
{
	struct ice_netdev_priv *np = netdev_priv(netdev);

	return ((np->vsi->alloc_txq + np->vsi->alloc_rxq) *
		(sizeof(struct ice_q_stats) / sizeof(u64)));
	/* One packets and one bytes count per queue */
	return ((np->vsi->alloc_txq + np->vsi->alloc_rxq) * 2);
}

#define ICE_PF_STATS_LEN	ARRAY_SIZE(ice_gstrings_pf_stats)
@@ -1942,25 +1942,35 @@ __ice_get_ethtool_stats(struct net_device *netdev,
	rcu_read_lock();

	ice_for_each_alloc_txq(vsi, j) {
		u64 pkts, bytes;

		tx_ring = READ_ONCE(vsi->tx_rings[j]);
		if (tx_ring && tx_ring->ring_stats) {
			data[i++] = tx_ring->ring_stats->stats.pkts;
			data[i++] = tx_ring->ring_stats->stats.bytes;
		} else {
		if (!tx_ring || !tx_ring->ring_stats) {
			data[i++] = 0;
			data[i++] = 0;
			continue;
		}

		ice_fetch_tx_ring_stats(tx_ring, &pkts, &bytes);

		data[i++] = pkts;
		data[i++] = bytes;
	}

	ice_for_each_alloc_rxq(vsi, j) {
		u64 pkts, bytes;

		rx_ring = READ_ONCE(vsi->rx_rings[j]);
		if (rx_ring && rx_ring->ring_stats) {
			data[i++] = rx_ring->ring_stats->stats.pkts;
			data[i++] = rx_ring->ring_stats->stats.bytes;
		} else {
		if (!rx_ring || !rx_ring->ring_stats) {
			data[i++] = 0;
			data[i++] = 0;
			continue;
		}

		ice_fetch_rx_ring_stats(rx_ring, &pkts, &bytes);

		data[i++] = pkts;
		data[i++] = bytes;
	}

	rcu_read_unlock();
@@ -3378,7 +3388,6 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring,
				 */
				rx_rings[i].next_to_use = 0;
				rx_rings[i].next_to_clean = 0;
				rx_rings[i].next_to_alloc = 0;
				*vsi->rx_rings[i] = rx_rings[i];
			}
			kfree(rx_rings);
+40 −16
Original line number Diff line number Diff line
@@ -3432,20 +3432,6 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
	return ret;
}

/**
 * ice_update_ring_stats - Update ring statistics
 * @stats: stats to be updated
 * @pkts: number of processed packets
 * @bytes: number of processed bytes
 *
 * This function assumes that caller has acquired a u64_stats_sync lock.
 */
static void ice_update_ring_stats(struct ice_q_stats *stats, u64 pkts, u64 bytes)
{
	stats->bytes += bytes;
	stats->pkts += pkts;
}

/**
 * ice_update_tx_ring_stats - Update Tx ring specific counters
 * @tx_ring: ring to update
@@ -3455,7 +3441,8 @@ static void ice_update_ring_stats(struct ice_q_stats *stats, u64 pkts, u64 bytes
void ice_update_tx_ring_stats(struct ice_tx_ring *tx_ring, u64 pkts, u64 bytes)
{
	u64_stats_update_begin(&tx_ring->ring_stats->syncp);
	ice_update_ring_stats(&tx_ring->ring_stats->stats, pkts, bytes);
	u64_stats_add(&tx_ring->ring_stats->pkts, pkts);
	u64_stats_add(&tx_ring->ring_stats->bytes, bytes);
	u64_stats_update_end(&tx_ring->ring_stats->syncp);
}

@@ -3468,10 +3455,47 @@ void ice_update_tx_ring_stats(struct ice_tx_ring *tx_ring, u64 pkts, u64 bytes)
void ice_update_rx_ring_stats(struct ice_rx_ring *rx_ring, u64 pkts, u64 bytes)
{
	u64_stats_update_begin(&rx_ring->ring_stats->syncp);
	ice_update_ring_stats(&rx_ring->ring_stats->stats, pkts, bytes);
	u64_stats_add(&rx_ring->ring_stats->pkts, pkts);
	u64_stats_add(&rx_ring->ring_stats->bytes, bytes);
	u64_stats_update_end(&rx_ring->ring_stats->syncp);
}

/**
 * ice_fetch_tx_ring_stats - Fetch Tx ring packet and byte counters
 * @ring: ring to update
 * @pkts: number of processed packets
 * @bytes: number of processed bytes
 */
void ice_fetch_tx_ring_stats(const struct ice_tx_ring *ring,
			     u64 *pkts, u64 *bytes)
{
	unsigned int start;

	do  {
		start = u64_stats_fetch_begin(&ring->ring_stats->syncp);
		*pkts = u64_stats_read(&ring->ring_stats->pkts);
		*bytes = u64_stats_read(&ring->ring_stats->bytes);
	} while (u64_stats_fetch_retry(&ring->ring_stats->syncp, start));
}

/**
 * ice_fetch_rx_ring_stats - Fetch Rx ring packet and byte counters
 * @ring: ring to read
 * @pkts: number of processed packets
 * @bytes: number of processed bytes
 */
void ice_fetch_rx_ring_stats(const struct ice_rx_ring *ring,
			     u64 *pkts, u64 *bytes)
{
	unsigned int start;

	do  {
		start = u64_stats_fetch_begin(&ring->ring_stats->syncp);
		*pkts = u64_stats_read(&ring->ring_stats->pkts);
		*bytes = u64_stats_read(&ring->ring_stats->bytes);
	} while (u64_stats_fetch_retry(&ring->ring_stats->syncp, start));
}

/**
 * ice_is_dflt_vsi_in_use - check if the default forwarding VSI is being used
 * @pi: port info of the switch with default VSI
+6 −0
Original line number Diff line number Diff line
@@ -92,6 +92,12 @@ void ice_update_tx_ring_stats(struct ice_tx_ring *ring, u64 pkts, u64 bytes);

void ice_update_rx_ring_stats(struct ice_rx_ring *ring, u64 pkts, u64 bytes);

void ice_fetch_tx_ring_stats(const struct ice_tx_ring *ring,
			     u64 *pkts, u64 *bytes);

void ice_fetch_rx_ring_stats(const struct ice_rx_ring *ring,
			     u64 *pkts, u64 *bytes);

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);
Loading