From patchwork Sat Jan 9 02:49:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Somerville X-Patchwork-Id: 12007901 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98299C43381 for ; Sat, 9 Jan 2021 02:52:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5AEE223A9A for ; Sat, 9 Jan 2021 02:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbhAICvZ (ORCPT ); Fri, 8 Jan 2021 21:51:25 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:46565 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbhAICvZ (ORCPT ); Fri, 8 Jan 2021 21:51:25 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 391591807; Fri, 8 Jan 2021 21:50:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 08 Jan 2021 21:50:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=TKxLOk0ITfiW1ObEdccDY/hqYVDKnZJrGqHUBvg9iyI=; b=MHf/AVhn 5dB90+rQojhg+v3QEKjTOuFwqQzknKgan2aEuH8UJ8rnhvjh/H+HrO3kYST/6Ftp uajSUr29l8UHiTClxjXf6tkybp4AoQZPzRhBz7zUGMQELjULK+I3Eder+YMxbw4N VNu01O9NM2oTGrIKuEJowma2uaVszu3qaa8U5SZr6Mbf4T0HfP1d2qgwuv14o+yY hR5NhmhyM4P60b2JgmKLeImWkYF6N+OAYU5kZTgTqnhvBOHTLEzi5WfYXCq2Qsqx OaD0QJkCJrB1F/3kSn3NUj+2UyBZXPHNN4HVXX7H8C37tCQCgbvXZjoLYFr/OMsj rKH/LGdgGHSBbg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdeghedgudegjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeevhhgrrhhlihgvucfuohhmvghrvhhilhhlvgcuoegthhgr rhhlihgvsegthhgrrhhlihgvrdgsiieqnecuggftrfgrthhtvghrnhepkedtleduudehhe dvfeehvefgvdehffdvveeftdevhfejfffhteelffevueduteeunecukfhppedvtddvrddu heefrddvvddtrdejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegthhgrrhhlihgvsegthhgrrhhlihgvrdgsii X-ME-Proxy: Received: from charlie-arch.home.charlie.bz (202-153-220-71.ca99dc.mel.static.aussiebb.net [202.153.220.71]) by mail.messagingengine.com (Postfix) with ESMTPA id A5B31240057; Fri, 8 Jan 2021 21:50:16 -0500 (EST) From: Charlie Somerville To: davem@davemloft.net, kuba@kernel.org, mst@redhat.com, jasowang@redhat.com Cc: netdev@vger.kernel.org, Charlie Somerville Subject: [PATCH net-next 1/2] xdp: Add XDP_FLAGS_NO_TX flag Date: Sat, 9 Jan 2021 13:49:49 +1100 Message-Id: <20210109024950.4043819-2-charlie@charlie.bz> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210109024950.4043819-1-charlie@charlie.bz> References: <20210109024950.4043819-1-charlie@charlie.bz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Some network interfaces must allocate additional hardware resources to support XDP filters retransmitting packets with XDP_TX. However not all XDP filters do use XDP_TX, and there may not be any additional send queues available for use. XDP filters can indicate that they will never transmit by setting the XDP_FLAGS_NO_TX flag in the IFLA_XDP_FLAGS attribute. This flag is only advisory - some network drivers may still allocate send queues. Signed-off-by: Charlie Somerville --- include/uapi/linux/if_link.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 874cc12a34d9..b4ba4427cd98 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h @@ -1168,11 +1168,14 @@ enum { #define XDP_FLAGS_DRV_MODE (1U << 2) #define XDP_FLAGS_HW_MODE (1U << 3) #define XDP_FLAGS_REPLACE (1U << 4) +#define XDP_FLAGS_NO_TX (1U << 5) #define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \ XDP_FLAGS_DRV_MODE | \ XDP_FLAGS_HW_MODE) #define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \ - XDP_FLAGS_MODES | XDP_FLAGS_REPLACE) + XDP_FLAGS_MODES | \ + XDP_FLAGS_REPLACE | \ + XDP_FLAGS_NO_TX) /* These are stored into IFLA_XDP_ATTACHED on dump. */ enum {