From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mail.toke.dk (Postfix) with ESMTPS id 22F0999DD1C for ; Wed, 7 Sep 2022 17:45:33 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QbKQu7y3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662565532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cwk6GCxz2fKCIof6GdQC9jP34T0np9Gb9y3RuN9eduo=; b=QbKQu7y3pQwNjmN1FZi5SoZMNCkMjTeU7VPK2XDWJ/c40sMvmyUxQLYRFSZFpB2lblOD1Q xFIOLhrneSUMbdPe2vNdrCOh6wdrVpS45WKmgjeTkdYnP3XLMJAHDL14y2DbLGCDyF4RI7 mqo9GZRucX+04NP1ONGhhf+gSJj3og4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-eux9cWw2Mh2tz_-Td3XKTQ-1; Wed, 07 Sep 2022 11:45:27 -0400 X-MC-Unique: eux9cWw2Mh2tz_-Td3XKTQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3C3E1C05EAE; Wed, 7 Sep 2022 15:45:26 +0000 (UTC) Received: from firesoul.localdomain (unknown [10.40.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99697492C3B; Wed, 7 Sep 2022 15:45:26 +0000 (UTC) Received: from [192.168.42.3] (localhost [IPv6:::1]) by firesoul.localdomain (Postfix) with ESMTP id E009630721A6C; Wed, 7 Sep 2022 17:45:25 +0200 (CEST) From: Jesper Dangaard Brouer To: bpf@vger.kernel.org Date: Wed, 07 Sep 2022 17:45:25 +0200 Message-ID: <166256552588.1434226.9247778254069745452.stgit@firesoul> In-Reply-To: <166256538687.1434226.15760041133601409770.stgit@firesoul> References: <166256538687.1434226.15760041133601409770.stgit@firesoul> User-Agent: StGit/1.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Message-ID-Hash: 5OST3LN3H7TWTJLL73EEPGEGIWO3SRSL X-Message-ID-Hash: 5OST3LN3H7TWTJLL73EEPGEGIWO3SRSL X-MailFrom: brouer@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jesper Dangaard Brouer , netdev@vger.kernel.org, xdp-hints@xdp-project.net, larysa.zaremba@intel.com, memxor@gmail.com, Lorenzo Bianconi , mtahhan@redhat.com, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , dave@dtucker.co.uk, Magnus Karlsson , bjorn@kernel.org X-Mailman-Version: 3.3.5 Precedence: list Subject: [xdp-hints] [PATCH RFCv2 bpf-next 05/18] net: add net_device feature flag for XDP-hints List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Make it possible to turnoff XDP-hints for a given net_device. It is recommended that drivers default turn on XDP-hints as the overhead is generally low, extracting these hardware hints, and the benefit is usually higher than this small overhead e.g. getting HW to do RX checksumming are usually a higher gain. Some XDP use-case are not ready to take this small overhead. Thus, the possibility to turn off XDP-hints is need to keep performance of these use-cases intact. Signed-off-by: Jesper Dangaard Brouer --- include/linux/netdev_features.h | 3 ++- net/ethtool/common.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 7c2d77d75a88..713f04eab497 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -14,7 +14,7 @@ typedef u64 netdev_features_t; enum { NETIF_F_SG_BIT, /* Scatter/gather IO. */ NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over IPv4. */ - __UNUSED_NETIF_F_1, + NETIF_F_XDP_HINTS_BIT, /* Populates XDP-hints metadata */ NETIF_F_HW_CSUM_BIT, /* Can checksum all the packets. */ NETIF_F_IPV6_CSUM_BIT, /* Can checksum TCP/UDP over IPV6 */ NETIF_F_HIGHDMA_BIT, /* Can DMA to high memory. */ @@ -168,6 +168,7 @@ enum { #define NETIF_F_HW_HSR_TAG_RM __NETIF_F(HW_HSR_TAG_RM) #define NETIF_F_HW_HSR_FWD __NETIF_F(HW_HSR_FWD) #define NETIF_F_HW_HSR_DUP __NETIF_F(HW_HSR_DUP) +#define NETIF_F_XDP_HINTS __NETIF_F(XDP_HINTS) /* Finds the next feature with the highest number of the range of start-1 till 0. */ diff --git a/net/ethtool/common.c b/net/ethtool/common.c index 566adf85e658..a9c62482220f 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -11,6 +11,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = { [NETIF_F_SG_BIT] = "tx-scatter-gather", [NETIF_F_IP_CSUM_BIT] = "tx-checksum-ipv4", + [NETIF_F_XDP_HINTS_BIT] = "xdp-hints", [NETIF_F_HW_CSUM_BIT] = "tx-checksum-ip-generic", [NETIF_F_IPV6_CSUM_BIT] = "tx-checksum-ipv6", [NETIF_F_HIGHDMA_BIT] = "highdma",