From patchwork Sat Jan 9 02:49:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Somerville X-Patchwork-Id: 12007899 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=-11.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 61BDDC433E6 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 2CB0123A82 for ; Sat, 9 Jan 2021 02:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726514AbhAICvE (ORCPT ); Fri, 8 Jan 2021 21:51:04 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:37279 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbhAICvE (ORCPT ); Fri, 8 Jan 2021 21:51:04 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id BF5EC1802; Fri, 8 Jan 2021 21:50:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 08 Jan 2021 21:50:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=mYovwe9oInWI5Fw2i cHkOgVtg7KrK8HUXyZ0QtWyLmg=; b=M93hzpellZeiGh5oLdGQszd332c6S/cBU 4KozUjTBIFh7nrbtDDVX2pstjzXZGPereg4NbRMXOZSYpph/LHlcPNqZ6sNHVJuH eFBaQKmulGHa2PacANjKp9cx2+DSOS8wOxfzKo+rXMRJSG+agK55nbqJge8s0JJs cMFnE6+PYQDokvR7Na82zbjfyQsz/TkDwZXgLxpFpNTfaDYhQm4ma6m7WOepX6VU kBa2B6uWLv9YzaW+HLDZK0f7FiS2JiIpHbse58FTeZGoUTMdQgULcShpGIUzRdKQ WglxicgfIibtmY95kkw5d1hpYKZvor01hftoKmBjyJQF7JmGpokGw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdeghedgudegjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeevhhgrrhhlihgvucfuohhmvghrvhhilhhlvgcuoegthhgrrhhl ihgvsegthhgrrhhlihgvrdgsiieqnecuggftrfgrthhtvghrnhepleefffegveefffduke dvgffgteevkefftedutedvhfelieehieefheefffetkedunecukfhppedvtddvrdduheef rddvvddtrdejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegthhgrrhhlihgvsegthhgrrhhlihgvrdgsii 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 6F9AC24005B; Fri, 8 Jan 2021 21:50:14 -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 0/2] Introduce XDP_FLAGS_NO_TX flag Date: Sat, 9 Jan 2021 13:49:48 +1100 Message-Id: <20210109024950.4043819-1-charlie@charlie.bz> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch series introduces a new flag XDP_FLAGS_NO_TX which prevents the allocation of additional send queues for XDP programs. Included in this patch series is an implementation of XDP_FLAGS_NO_TX for the virtio_net driver. This flag is intended to be advisory - not all drivers must implement support for it. Many virtualised environments only provide enough virtio_net send queues for the number of processors allocated to the VM: # nproc 8 # ethtool --show-channels ens3 Channel parameters for ens3: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 8 In this configuration XDP is unusable because the virtio_net driver always tries to allocate an extra send queue for each processor - even if the XDP the program never uses the XDP_TX functionality. While XDP_TX is still unavailable in these environments, this new flag expands the set of XDP programs that can be used. This is my first contribution to the kernel, so apologies if I've sent this to the wrong list. I have tried to cc relevant maintainers but it's possible I may have missed some people. I'm looking forward to receiving feedback on this change. Charlie Somerville (2): xdp: Add XDP_FLAGS_NO_TX flag virtio_net: Implement XDP_FLAGS_NO_TX support drivers/net/virtio_net.c | 17 +++++++++++++---- include/uapi/linux/if_link.h | 5 ++++- 2 files changed, 17 insertions(+), 5 deletions(-)