From nobody Sat Nov 23 11:41:36 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 2C2E42141AB; Wed, 13 Nov 2024 15:25:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731511558; cv=none; b=jghuYz1cSnzrxUCnXGety9H5GSuX5R6rPawkPVbREf/3dSO1asTn4KdQufXI0vlw1GKq/BQHTIO5mY0ZJY6OgfAZ/RnpPC8RiE+pHFPfH7PbMH2CDJpEK07iNmXR2V11kcnqiiPdJzTT0NCgvy0wfV5fBGsJiJ29S1/16ZAMW8M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731511558; c=relaxed/simple; bh=O+ZcPvQeQyS8JRU5HG6GQbO8AhKShZuu+h1CEOZZVdA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AoEJPTS466/OcdwAWoKClH60QAKUrWdNM24qMpGHk3puWNoWySHMnLkz18o3+ZHrsUryn7kSF3Eo2zgNWB2IyyucW7ay8zJc0Tbj3+dlq7CRb20fVOiTlL1eu3xp9ubIKqKLDSoaahLYBAn8RZJht9uTKcVheVGpHu+TRTM0Ooc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OBBGM+bV; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OBBGM+bV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1731511557; x=1763047557; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=O+ZcPvQeQyS8JRU5HG6GQbO8AhKShZuu+h1CEOZZVdA=; b=OBBGM+bVIRMqbOmx01oFo9TjcOqebmDsynOtQkMBqVjkItD97Mv7mKZG ZOpc27FrBBa1LLM839nqhteJJbgHbNcxRZ8XmANl4KvyqmKrRa7oeeI5M kvuZ98zJFjEwJs9kD46RMPO1iCpWpE4SxrXHcfcB9AyrHLfAQWnTLAtbN YO8r1IVRRPogjqsoKDR4xbGni5f/4Iqzxtw1j5kG9VltqMi5zPsPh0/Io D1SDdBplgGVIKy0r/GIIzObwNCuR4W0YwwJ+dqUrgG2CG5PCzC9X+pCsu MjZXtIGUEEOrtSU5FzmE4+ArLQBEfcK2rOoQ6pZv3OGL6Yj7/mXT224YU Q==; X-CSE-ConnectionGUID: zuq32msRTKWI/n0/S3o43Q== X-CSE-MsgGUID: Bg5BdTF5RPu/2sz99S0Fqg== X-IronPort-AV: E=McAfee;i="6700,10204,11254"; a="42799401" X-IronPort-AV: E=Sophos;i="6.12,151,1728975600"; d="scan'208";a="42799401" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2024 07:25:57 -0800 X-CSE-ConnectionGUID: HrWfWtebSxGxqAaF9sShxQ== X-CSE-MsgGUID: OP1VQ0G/SM6eP6DbQ1jVyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,151,1728975600"; d="scan'208";a="118726991" Received: from newjersey.igk.intel.com ([10.102.20.203]) by orviesa002.jf.intel.com with ESMTP; 13 Nov 2024 07:25:53 -0800 From: Alexander Lobakin To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Maciej Fijalkowski , Stanislav Fomichev , Magnus Karlsson , nex.sw.ncis.osdt.itp.upstreaming@intel.com, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v5 14/19] xsk: allow attaching XSk pool via xdp_rxq_info_reg_mem_model() Date: Wed, 13 Nov 2024 16:24:37 +0100 Message-ID: <20241113152442.4000468-15-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241113152442.4000468-1-aleksander.lobakin@intel.com> References: <20241113152442.4000468-1-aleksander.lobakin@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable When you register an XSk pool as XDP Rxq info memory model, you then need to manually attach it after the registration. Let the user combine both actions into one by just passing a pointer to the pool directly to xdp_rxq_info_reg_mem_model(), which will take care of calling xsk_pool_set_rxq_info(). This looks similar to how a &page_pool gets registered and reduce repeating driver code. Acked-by: Maciej Fijalkowski Reviewed-by: Toke H=C3=B8iland-J=C3=B8rgensen Signed-off-by: Alexander Lobakin --- net/core/xdp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/core/xdp.c b/net/core/xdp.c index 3a9a3c14b080..f046b93faaa0 100644 --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -358,6 +358,9 @@ int xdp_rxq_info_reg_mem_model(struct xdp_rxq_info *xdp= _rxq, if (IS_ERR(xdp_alloc)) return PTR_ERR(xdp_alloc); =20 + if (type =3D=3D MEM_TYPE_XSK_BUFF_POOL && allocator) + xsk_pool_set_rxq_info(allocator, xdp_rxq); + if (trace_mem_connect_enabled() && xdp_alloc) trace_mem_connect(xdp_alloc, xdp_rxq); return 0; --=20 2.47.0