From patchwork Mon Dec 19 15:41:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13076725 X-Patchwork-Delegate: bpf@iogearbox.net 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A42C2C3DA71 for ; Mon, 19 Dec 2022 15:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232387AbiLSPmn (ORCPT ); Mon, 19 Dec 2022 10:42:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbiLSPmi (ORCPT ); Mon, 19 Dec 2022 10:42:38 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2385825FE; Mon, 19 Dec 2022 07:42:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DB2A7B80EA6; Mon, 19 Dec 2022 15:42:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 244DDC43392; Mon, 19 Dec 2022 15:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671464555; bh=AFHGA4/VUtLtWks3taPMr6hCqmlIuVlvJjAohqShmBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kv95OSOUNhxRPvuXoUI8nLwdmB4hfbglAEdpHGx2N2itWrIz1p2QrRi6yVFE5nJTz SJt5DNlrhMoPvPdzdbm9Z4zARUxcVOZmDMR4U2RY5io9H0ARlUbcp7YVo6HLHSVlXQ /U7Z1/qvuDogfjLzxLzNEIoHh4t/KpJqk7m4R99mwA8wWdsE8MiDKto5M6CykOobx1 /5mbOqLmbwz2OElf55twBEhtMOb0qQPJFXd850tqPRugmf9M1bw5CwV9qDxP/X/RC1 2oNFRLOpvBrSCC0VTdLD6558JMcLQUahqm+XDdKOG3/cPO4/5rfzj3ndHC9rjuL2XB r4LY71/02A8SA== From: Lorenzo Bianconi To: bpf@vger.kernel.org Cc: netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, davem@davemloft.net, kuba@kernel.org, hawk@kernel.org, pabeni@redhat.com, edumazet@google.com, toke@redhat.com, memxor@gmail.com, alardam@gmail.com, saeedm@nvidia.com, anthony.l.nguyen@intel.com, gospo@broadcom.com, vladimir.oltean@nxp.com, nbd@nbd.name, john@phrozen.org, leon@kernel.org, simon.horman@corigine.com, aelior@marvell.com, christophe.jaillet@wanadoo.fr, ecree.xilinx@gmail.com, grygorii.strashko@ti.com, mst@redhat.com, bjorn@kernel.org, magnus.karlsson@intel.com, maciej.fijalkowski@intel.com, intel-wired-lan@lists.osuosl.org, lorenzo.bianconi@redhat.com Subject: [RFC bpf-next 4/8] xsk: add usage of XDP features flags Date: Mon, 19 Dec 2022 16:41:33 +0100 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net X-Patchwork-State: RFC From: Marek Majtyka Change necessary condition check for XSK from ndo functions to xdp features flags. Signed-off-by: Marek Majtyka Signed-off-by: Lorenzo Bianconi --- net/xdp/xsk_buff_pool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index ed6c71826d31..7afd12dd69cc 100644 --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -178,8 +178,7 @@ int xp_assign_dev(struct xsk_buff_pool *pool, /* For copy-mode, we are done. */ return 0; - if (!netdev->netdev_ops->ndo_bpf || - !netdev->netdev_ops->ndo_xsk_wakeup) { + if ((netdev->xdp_features & XDP_F_FULL_ZC) != XDP_F_FULL_ZC) { err = -EOPNOTSUPP; goto err_unreg_pool; }