From patchwork Thu Jan 16 19:11:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13942140 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C043622CBDC; Thu, 16 Jan 2025 19:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737054720; cv=none; b=oFiMWB/O5FeX19D/n8gPDQlJGhcblP6ARTkcrzbcUWjo41Y912c6YUCvOmjU70QOmlcwl26f0jnqMbmOKSzQIoDuiqxz8ajJd657jnS+qiEYgRsZOZW0nMkdDxpuufWiKgViJIS+He3yQ326RYJAM1MqYDeDQ/PZATLFQeKJzEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737054720; c=relaxed/simple; bh=KQRLjCL80LspFuD73s/fJNROwZ35qu7TF4XWedkgf2g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FYukaL6w4TV68kDeTeOmGX8Sp3r1VgxK6Dkiu+JR9YdktgJwxVBUuqNcT0STEuyF4v9ThQM/uPiLyLsk5gPz/e08rVZa+/8Y3euiuRBJFZXbjLausm6aslhk/LppRK1xqe6IAOd9uaEr+q6J96corLMzOoh07JalHalRid/EK2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=OOtSFwok; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="OOtSFwok" Received: from pps.filterd (m0431383.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50GGAsJ5031247; Thu, 16 Jan 2025 11:11:40 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=K jfkt9Wnnk6nh/2EsEGZjSOfC5dO9pMd+Lh48lopMeo=; b=OOtSFwok10i0znX7R Hg+BxzHwPMVQRfAlRABl+60JfG/PcW/4Bhcos7RW46dfvyZJchOuCKVcJeON1771 uwcxeGytKEeFba6ucblHEtWZZPafBwgohMmWDI8dSn5jMw38Isp1hr0uEQbXTTD+ Bc2OjB4WHECXgkavfl7Vws8+IYthLd4lI2PGMeSLeXp5W/H13KLQLUw5cwfCvNPb /CC8E4UJDrtdz1VrJZD81X1b1M8Ns2bsjx9+p+ZSuGP+3uFDgWvU2sv5I/cnQgVw hTxkWsphM+KdHuMbD81fF5FmMkr3Wq+eSuni9uuF12meu4yQTxMfcsC+cceDQwXh pWh5g== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 4475dd0dyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Jan 2025 11:11:40 -0800 (PST) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 16 Jan 2025 11:11:38 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 16 Jan 2025 11:11:38 -0800 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id 05A623F7088; Thu, 16 Jan 2025 11:11:32 -0800 (PST) From: Suman Ghosh To: , , , , , , , , , , , , , , , , , , , CC: Suman Ghosh Subject: [net-next PATCH v4 2/6] octeontx2-pf: Add AF_XDP non-zero copy support Date: Fri, 17 Jan 2025 00:41:12 +0530 Message-ID: <20250116191116.3357181-3-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250116191116.3357181-1-sumang@marvell.com> References: <20250116191116.3357181-1-sumang@marvell.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: fyKtG5ug0NNMzjrVNREjfgbdu4rBAPg1 X-Proofpoint-ORIG-GUID: fyKtG5ug0NNMzjrVNREjfgbdu4rBAPg1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-16_08,2025-01-16_01,2024-11-22_01 X-Patchwork-Delegate: kuba@kernel.org For XDP, page_pool APIs are getting used now. But the memory type was not getting set due to which XDP_REDIRECT and hence AF_XDP was not working. This patch ads the memory type MEM_TYPE_PAGE_POOL as the memory model of the XDP program. Fixes: 06059a1a9a4a ("octeontx2-pf: Add XDP support to netdev PF") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c index 2b49bfec7869..161cf33ef89e 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -1047,6 +1047,7 @@ static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx) int err, pool_id, non_xdp_queues; struct nix_aq_enq_req *aq; struct otx2_cq_queue *cq; + struct otx2_pool *pool; cq = &qset->cq[qidx]; cq->cq_idx = qidx; @@ -1055,8 +1056,13 @@ static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx) cq->cq_type = CQ_RX; cq->cint_idx = qidx; cq->cqe_cnt = qset->rqe_cnt; - if (pfvf->xdp_prog) + if (pfvf->xdp_prog) { + pool = &qset->pool[qidx]; xdp_rxq_info_reg(&cq->xdp_rxq, pfvf->netdev, qidx, 0); + xdp_rxq_info_reg_mem_model(&cq->xdp_rxq, + MEM_TYPE_PAGE_POOL, + pool->page_pool); + } } else if (qidx < non_xdp_queues) { cq->cq_type = CQ_TX; cq->cint_idx = qidx - pfvf->hw.rx_queues;