From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8CBA0FF8855 for ; Tue, 5 May 2026 15:30:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 47D08608B4; Tue, 5 May 2026 15:30:44 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id at_LkYbwSZeq; Tue, 5 May 2026 15:30:43 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org ED4FE608AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1777995043; bh=Ds87HGN7IQDfv6nGIuiWqTWCrKMliJ9sV8CMXNKypmo=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rZj2UpL+56WS4V1EeEEnJ+NzRGAon81eZrr9WlPEosxHlJzbZ0OeASceix8+J29y9 VI1ZDtLBYwns+nZnTcfpkSeml95f6EI8RPcR3lOGqXL8z3vPGZc7OG3V+yWm/3LhVZ KRnfOtGpElT3ojMMELtDM/xRLta8dN+OaEuxQFV58rc7cgoAIzZKrIOw0IlRT8y+yz EXluEiNcTa0xJxdbUK2Fkq8fS1Rbs9q6qR7AKSZJrrxRokPVXrvwTwi2XjKNmhHcVj 8JtK/oeP53KzWumMGhi5KyuNTVkEk/d01xJDw6N5chtT4JQX8wtx1HoI0+R9QuKZph sIgjavpmjD/fw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id ED4FE608AF; Tue, 5 May 2026 15:30:42 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 95AA02A8 for ; Tue, 5 May 2026 15:30:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7BED2608AF for ; Tue, 5 May 2026 15:30:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5zhqRH9462Gi for ; Tue, 5 May 2026 15:30:40 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.7; helo=mgamail.intel.com; envelope-from=aleksander.lobakin@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 518DB607CE DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 518DB607CE Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by smtp3.osuosl.org (Postfix) with ESMTPS id 518DB607CE for ; Tue, 5 May 2026 15:30:40 +0000 (UTC) X-CSE-ConnectionGUID: sBzqKwCqShOsZkjTvW+3ng== X-CSE-MsgGUID: PTEwkfc6QAa1y+SJ0sgfnw== X-IronPort-AV: E=McAfee;i="6800,10657,11777"; a="104316987" X-IronPort-AV: E=Sophos;i="6.23,217,1770624000"; d="scan'208";a="104316987" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2026 08:30:40 -0700 X-CSE-ConnectionGUID: DPpiulblQlSzb/mGUFNU0A== X-CSE-MsgGUID: /Zc38cuQQ0iWTsCfszR98g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,217,1770624000"; d="scan'208";a="234971544" Received: from newjersey.igk.intel.com ([10.102.20.203]) by orviesa010.jf.intel.com with ESMTP; 05 May 2026 08:30:37 -0700 From: Alexander Lobakin To: intel-wired-lan@lists.osuosl.org Cc: Alexander Lobakin , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Kohei Enju , Jacob Keller , Aleksandr Loktionov , nxne.cnse.osdt.itp.upstreaming@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 5 May 2026 17:29:19 +0200 Message-ID: <20260505152923.1040589-2-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260505152923.1040589-1-aleksander.lobakin@intel.com> References: <20260505152923.1040589-1-aleksander.lobakin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777995040; x=1809531040; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kWcwf0Pqoi1nF34RkwExtM44zrZTcgqZcEE8ex7b8QM=; b=T5oMEE+siq4lMsU0NG1T4ZSOSDUBrKwZ7dD7EAnl6WE4RN0b5qKloCPq FKumK7T7VMutPYpWlZ1MVceVP3fyr3T4AiphC+dDEj7Iae+ttydqDY8AG 26Rz56rDEPPTQ57nNz76V+MDyHrc/RkOUQcpfy3pgOaSOYQQGcB2jJDx/ 5okg91jCgw8BtH+PfyeLPrpW6mX47xfHaNOdhY4Id/ziS272Rvvsk9yYZ MEGf5XQO94xqTyh34bMy00ygOypQRWL3R+bgFpZjfKlyhbauE34/E06u+ nvZUxxa03C6GVgdgaVFnU5CHrSm2L2y5Hw/LxklWOPHOyPwhRfU1fbyqZ Q==; X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=T5oMEE+s Subject: [Intel-wired-lan] [PATCH iwl-next v5 1/5] libeth: pass Rx queue index to PP when creating a fill queue X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Since recently, page_pool_create() accepts optional stack index of the Rx queue which the pool will be created for. It can then be used on control path for stuff like memory providers. Add the same field to libeth_fq and pass the index from all the drivers using libeth for managing Rx to simplify implementing MP support later. idpf has one libeth_fq per buffer/fill queue and each Rx queue has two fill queues, but since fill queues can never be shared, we can store the corresponding Rx queue index there during the initialization to pass it to libeth. Reviewed-by: Jacob Keller Reviewed-by: Aleksandr Loktionov Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/intel/idpf/idpf_txrx.h | 2 ++ include/net/libeth/rx.h | 2 ++ drivers/net/ethernet/intel/iavf/iavf_txrx.c | 1 + drivers/net/ethernet/intel/ice/ice_base.c | 2 ++ drivers/net/ethernet/intel/idpf/idpf_txrx.c | 13 +++++++++++++ drivers/net/ethernet/intel/libeth/rx.c | 1 + 6 files changed, 21 insertions(+) diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b/drivers/net/ethernet/intel/idpf/idpf_txrx.h index 4be5b3b6d3ed..a0d92adf11c4 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h @@ -748,6 +748,7 @@ libeth_cacheline_set_assert(struct idpf_tx_queue, 64, * @size: Length of descriptor ring in bytes * @dma: Physical address of ring * @q_vector: Backreference to associated vector + * @rxq_idx: stack index of the corresponding Rx queue * @rx_buffer_low_watermark: RX buffer low watermark * @rx_hbuf_size: Header buffer size * @rx_buf_size: Buffer size @@ -791,6 +792,7 @@ struct idpf_buf_queue { dma_addr_t dma; struct idpf_q_vector *q_vector; + u16 rxq_idx; u16 rx_buffer_low_watermark; u16 rx_hbuf_size; diff --git a/include/net/libeth/rx.h b/include/net/libeth/rx.h index 5d991404845e..3b3d7acd13c9 100644 --- a/include/net/libeth/rx.h +++ b/include/net/libeth/rx.h @@ -71,6 +71,7 @@ enum libeth_fqe_type { * @xdp: flag indicating whether XDP is enabled * @buf_len: HW-writeable length per each buffer * @nid: ID of the closest NUMA node with memory + * @idx: stack index of the corresponding Rx queue */ struct libeth_fq { struct_group_tagged(libeth_fq_fp, fp, @@ -88,6 +89,7 @@ struct libeth_fq { u32 buf_len; int nid; + u32 idx; }; int libeth_rx_fq_create(struct libeth_fq *fq, struct napi_struct *napi); diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c index 363c42bf3dcf..d3c68659162b 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c @@ -771,6 +771,7 @@ int iavf_setup_rx_descriptors(struct iavf_ring *rx_ring) .count = rx_ring->count, .buf_len = LIBIE_MAX_RX_BUF_LEN, .nid = NUMA_NO_NODE, + .idx = rx_ring->queue_index, }; int ret; diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c index 1667f686ff75..f162cdfc62a7 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.c +++ b/drivers/net/ethernet/intel/ice/ice_base.c @@ -609,6 +609,7 @@ static int ice_rxq_pp_create(struct ice_rx_ring *rq) struct libeth_fq fq = { .count = rq->count, .nid = NUMA_NO_NODE, + .idx = rq->q_index, .hsplit = rq->vsi->hsplit, .xdp = ice_is_xdp_ena_vsi(rq->vsi), .buf_len = LIBIE_MAX_RX_BUF_LEN, @@ -631,6 +632,7 @@ static int ice_rxq_pp_create(struct ice_rx_ring *rq) .count = rq->count, .type = LIBETH_FQE_HDR, .nid = NUMA_NO_NODE, + .idx = rq->q_index, .xdp = ice_is_xdp_ena_vsi(rq->vsi), }; diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index f6b3b15364ff..95930edc566f 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -557,6 +557,7 @@ static int idpf_rx_hdr_buf_alloc_all(struct idpf_buf_queue *bufq) .type = LIBETH_FQE_HDR, .xdp = idpf_xdp_enabled(bufq->q_vector->vport), .nid = idpf_q_vector_to_mem(bufq->q_vector), + .idx = bufq->rxq_idx, }; int ret; @@ -699,6 +700,7 @@ static int idpf_rx_bufs_init_singleq(struct idpf_rx_queue *rxq) .type = LIBETH_FQE_MTU, .buf_len = IDPF_RX_MAX_BUF_SZ, .nid = idpf_q_vector_to_mem(rxq->q_vector), + .idx = rxq->idx, }; int ret; @@ -759,6 +761,7 @@ static int idpf_rx_bufs_init(struct idpf_buf_queue *bufq, .hsplit = idpf_queue_has(HSPLIT_EN, bufq), .xdp = idpf_xdp_enabled(bufq->q_vector->vport), .nid = idpf_q_vector_to_mem(bufq->q_vector), + .idx = bufq->rxq_idx, }; int ret; @@ -1913,6 +1916,16 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport, LIBETH_RX_LL_LEN; idpf_rxq_set_descids(rsrc, q); } + + if (!idpf_is_queue_model_split(rsrc->rxq_model)) + continue; + + for (u32 j = 0; j < rsrc->num_bufqs_per_qgrp; j++) { + struct idpf_buf_queue *bufq; + + bufq = &rx_qgrp->splitq.bufq_sets[j].bufq; + bufq->rxq_idx = rx_qgrp->splitq.rxq_sets[0]->rxq.idx; + } } err_alloc: diff --git a/drivers/net/ethernet/intel/libeth/rx.c b/drivers/net/ethernet/intel/libeth/rx.c index 62521a1f4ec9..8874b714cdcc 100644 --- a/drivers/net/ethernet/intel/libeth/rx.c +++ b/drivers/net/ethernet/intel/libeth/rx.c @@ -156,6 +156,7 @@ int libeth_rx_fq_create(struct libeth_fq *fq, struct napi_struct *napi) .order = LIBETH_RX_PAGE_ORDER, .pool_size = fq->count, .nid = fq->nid, + .queue_idx = fq->idx, .dev = napi->dev->dev.parent, .netdev = napi->dev, .napi = napi, -- 2.54.0