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 62F2AD0EE11 for ; Tue, 25 Nov 2025 17:36:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 260A861223; Tue, 25 Nov 2025 17:36:48 +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 H3TWRFPxTz0z; Tue, 25 Nov 2025 17:36:46 +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 6A92661253 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1764092206; bh=ML/uC5mQPYQu+SFXTn8utiD8R17xSYMbs0BdBttRmd4=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FUJCQtZjESn9YOuQ8qj5k4rZFefrJc1p0xPae17DC/MGxiMLgTzFMcaQqIKrcS4k9 HZKlojhbD3ktoXSig0aPEKjzHuVxIjJSHmUOcP07tp8sXRtLODy0xndIULRU4opjS0 bkJuVLop8305HnBZdNn7aBtz478QMuC98usHKh5zU1pVodMc6OWs2sCvKNnyMeT+sU TB2gYEKRVdQKhHaQLVJJ3qeNJNd6ldG5ClQNMmColzXfUvjMGVvFer4YUEc1EDQW7P otpFlAnri3gNf74IG2tf4c7akgXNPo0qob+tvZjRClkioSVAkK1iwLn/hMxY9rDcMO cwwZFnK2k8YHA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 6A92661253; Tue, 25 Nov 2025 17:36:46 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists1.osuosl.org (Postfix) with ESMTP id BAE5B359 for ; Tue, 25 Nov 2025 17:36:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9F9A54041A for ; Tue, 25 Nov 2025 17:36:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MdMnf-u6sZi9 for ; Tue, 25 Nov 2025 17:36:43 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.12; helo=mgamail.intel.com; envelope-from=aleksander.lobakin@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org ECC4340446 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org ECC4340446 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by smtp2.osuosl.org (Postfix) with ESMTPS id ECC4340446 for ; Tue, 25 Nov 2025 17:36:42 +0000 (UTC) X-CSE-ConnectionGUID: 4dVAJqENSJqDHuHcfBlUfw== X-CSE-MsgGUID: f1xpgz+QQA2SQrNY15kZ+w== X-IronPort-AV: E=McAfee;i="6800,10657,11624"; a="69979882" X-IronPort-AV: E=Sophos;i="6.20,226,1758610800"; d="scan'208";a="69979882" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2025 09:36:38 -0800 X-CSE-ConnectionGUID: oDga+snDRSe9QN1Pz3pnew== X-CSE-MsgGUID: lls53vmoQ7ytKkRrLVdvhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,226,1758610800"; d="scan'208";a="216040337" Received: from newjersey.igk.intel.com ([10.102.20.203]) by fmviesa002.fm.intel.com with ESMTP; 25 Nov 2025 09:36:34 -0800 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 , Jacob Keller , Aleksandr Loktionov , nxne.cnse.osdt.itp.upstreaming@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 25 Nov 2025 18:35:59 +0100 Message-ID: <20251125173603.3834486-2-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251125173603.3834486-1-aleksander.lobakin@intel.com> References: <20251125173603.3834486-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=1764092203; x=1795628203; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+DFq6dbzD3lc+CDVNerVm77IALgzgfxpNZyKVSb2ApU=; b=KhflTuD8B7slphfbL7MutoKptvzRfc6FTDbHKF9L86KuKOtBIQt38Y24 DcC/IBuyIn+Lyi1EweYt03iwXxkwMjela4Zf4HEPBm5YJRO88fbEfGxNO HX1jvN1Nk4D4kItoAKxF0MqvKRVyd3jMZK8lO4h0OQtiaKgEi5MqWxLeV DeNbGaS2vX82lql8U4yuKTjwTwUR2ADWDd+szGw0qD4a/IvgQuvqPHLqg wBSP9xlCroJlhP3SJRhpTT2pwaLlMjVCxdBhCj3OmnNWMKkqkxq2gI4M/ Kj6N9ulNDlXlSthfjsfoAg/ObvdjNHddFWt3xcuQjG6QILnjdkU3eRi4v w==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KhflTuD8 Subject: [Intel-wired-lan] [PATCH iwl-next 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 75b977094741..1f368c4e0a76 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h @@ -744,6 +744,7 @@ libeth_cacheline_set_assert(struct idpf_tx_queue, 64, * @q_id: Queue id * @size: Length of descriptor ring in bytes * @dma: Physical address of ring + * @rxq_idx: stack index of the corresponding Rx queue * @q_vector: Backreference to associated vector * @rx_buffer_low_watermark: RX buffer low watermark * @rx_hbuf_size: Header buffer size @@ -788,6 +789,7 @@ struct idpf_buf_queue { dma_addr_t dma; struct idpf_q_vector *q_vector; + u16 rxq_ixd; 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 eadb1e3d12b3..1aa40f13947e 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.c +++ b/drivers/net/ethernet/intel/ice/ice_base.c @@ -607,6 +607,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, @@ -629,6 +630,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 828f7c444d30..5e397560a515 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_ixd, }; int ret; @@ -698,6 +699,7 @@ static int idpf_rx_bufs_init_singleq(struct idpf_rx_queue *rxq) .count = rxq->desc_count, .type = LIBETH_FQE_MTU, .nid = idpf_q_vector_to_mem(rxq->q_vector), + .idx = rxq->idx, }; int ret; @@ -757,6 +759,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_ixd, }; int ret; @@ -1900,6 +1903,16 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport, u16 num_rxq) LIBETH_RX_LL_LEN; idpf_rxq_set_descids(vport, q); } + + if (!idpf_is_queue_model_split(vport->rxq_model)) + continue; + + for (j = 0; j < vport->num_bufqs_per_qgrp; j++) { + struct idpf_buf_queue *bufq; + + bufq = &rx_qgrp->splitq.bufq_sets[j].bufq; + bufq->rxq_ixd = 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.51.1