Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2813802pxb; Sun, 15 Nov 2020 19:19:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJznfOXP610XL6Jm3B/wo1xNHEhwFUPR6vFdKbdE031f+HNseBEW3cvdm2cdJ+6NAQEq3z5Z X-Received: by 2002:a17:906:3d1:: with SMTP id c17mr12516207eja.187.1605496753786; Sun, 15 Nov 2020 19:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605496753; cv=none; d=google.com; s=arc-20160816; b=AoixU+Dbz/dmOSKiQaVr63himMV/mXlQyz1WZY3c2ARxBEDmWg5Ms/BxAu2NTL5hHN 23+zBqYckvOq78qlmo2jwZUSHA7Pek7+14wTMlD/wUJtqDLB0AKsz65yKqnyGPKBEE09 bCP1rSOvWmCGuHi8uW4ICkEZgUBX/+JnESt9J6wO3/M9e9MUXC3n90BEQeV3hafE/1oc QmC53uNyNNf//jiVmufmZYDbeT4XDJfRH/uJAQHEIh/WtOnydopgha//NUEiqdmOtdCv r6KoQ/nZx5Q3f4UYXtYY2J0jVsDz4X67gJW1d2c9OSzQUvmEANll9yNmJbcnhmMv3jWs JmVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rLL9X6jjJCna5p7PH8EM+yh73syISaST57XUG2k8t6o=; b=Vsywz36U8ZhAwplhjsauDNwB17uODl8d2/R/dUWvzqQo5LFghF7XD5rHOI2Vg1LSi8 aQUOAJYUHRP36f5pEJ7XefcVkn6F+z5NNOVXHgL8ij57YqPr09uoa672Xob/2mDroA1O mX/8QrPC7RpuTxiBDDm4ClMEi0DRCSg0Of8t01T8JoRcx8nbRL4BdY7KEl77RHjVAxXr LQeP4Mict9n/4VxFLuRx9IhWTynXNU/hnhmjg7avZGFTCnjBo9mU5NcpuqK8FH9gF92D 8fvgZzeYsMxdxNZl4x36tc4EMpvBWu8UkeBNkaiDirJclfeq5qLF/wrS9RyyA4q0wU36 ksag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=dMjzwsf1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a91si11522397edf.472.2020.11.15.19.18.51; Sun, 15 Nov 2020 19:19:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=dMjzwsf1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbgKPDR1 (ORCPT + 99 others); Sun, 15 Nov 2020 22:17:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbgKPDRZ (ORCPT ); Sun, 15 Nov 2020 22:17:25 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6658DC0613CF; Sun, 15 Nov 2020 19:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=rLL9X6jjJCna5p7PH8EM+yh73syISaST57XUG2k8t6o=; b=dMjzwsf13RWSgZG0yQSp+ZfBIO hZJ8SP9NPiwlYkvjNTYTl6o4xmcFzVqZWY2JcWZVoS+SyXAgS96FDE67uF9ebaaFzyH6pYVbluNBo KWJiBwLmHOu9QViMXNZSH7vmF6+k9XyMUOrKr9K0/EH64Ofgy2JIvJuxwk35NRJFZUfcVtL2WAYyF aLKgiOePUojFUbT9xntuGNikS9/fEztKX8e20/wAu6E3R1nqQRJh3/BrYZPnL6BGX1mcyU7X8mNAR rAkXwUfTJQwgbV8r5//S5I+6Z4EGSxdwmVLrww52f4z04ohIqfQTVhJm619MmftxpFCg798Wvudef 7uL286VQ==; Received: from [2601:1c0:6280:3f0::f32] (helo=smtpauth.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1keV17-0008Q3-J9; Mon, 16 Nov 2020 03:17:22 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , kernel test robot , Aleksandr Nogikh , Willem de Bruijn , Jakub Kicinski , linux-next@vger.kernel.org, netdev@vger.kernel.org, Matthieu Baerts Subject: [PATCH net-next v4] net: linux/skbuff.h: combine SKB_EXTENSIONS + KCOV handling Date: Sun, 15 Nov 2020 19:17:15 -0800 Message-Id: <20201116031715.7891-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The previous Kconfig patch led to some other build errors as reported by the 0day bot and my own overnight build testing. These are all in when KCOV is enabled but SKB_EXTENSIONS is not enabled, so fix those by combining those conditions in the header file. Also, add stubs for skb_ext_add() and skb_ext_find() to reduce the amount of ifdef-ery. (Jakub) Fixes: 6370cc3bbd8a ("net: add kcov handle to skb extensions") Fixes: 85ce50d337d1 ("net: kcov: don't select SKB_EXTENSIONS when there is no NET") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aleksandr Nogikh Cc: Willem de Bruijn Cc: Jakub Kicinski Cc: linux-next@vger.kernel.org Cc: netdev@vger.kernel.org Cc: Matthieu Baerts --- v4: The enum for SKB_EXT_KCOV_HANDLE needs to be exposed unconditionally because it is used in skb_get/set_kcov_handle(), which are always present since v3. v3: (as suggested by Jakub Kicinski ) add stubs for skb_ext_add() and skb_ext_find() to reduce the ifdef-ery v2: (as suggested by Matthieu Baerts ) drop an extraneous space in a comment; use CONFIG_SKB_EXTENSIONS instead of CONFIG_NET; include/linux/skbuff.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) --- linux-next-20201113.orig/include/linux/skbuff.h +++ linux-next-20201113/include/linux/skbuff.h @@ -4137,7 +4137,6 @@ static inline void skb_set_nfct(struct s #endif } -#ifdef CONFIG_SKB_EXTENSIONS enum skb_ext_id { #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) SKB_EXT_BRIDGE_NF, @@ -4151,12 +4150,11 @@ enum skb_ext_id { #if IS_ENABLED(CONFIG_MPTCP) SKB_EXT_MPTCP, #endif -#if IS_ENABLED(CONFIG_KCOV) SKB_EXT_KCOV_HANDLE, -#endif SKB_EXT_NUM, /* must be last */ }; +#ifdef CONFIG_SKB_EXTENSIONS /** * struct skb_ext - sk_buff extensions * @refcnt: 1 on allocation, deallocated on 0 @@ -4252,6 +4250,10 @@ static inline void skb_ext_del(struct sk static inline void __skb_ext_copy(struct sk_buff *d, const struct sk_buff *s) {} static inline void skb_ext_copy(struct sk_buff *dst, const struct sk_buff *s) {} static inline bool skb_has_extensions(struct sk_buff *skb) { return false; } +static inline void *skb_ext_add(struct sk_buff *skb, enum skb_ext_id id) +{ return NULL; } +static inline void *skb_ext_find(const struct sk_buff *skb, enum skb_ext_id id) +{ return NULL; } #endif /* CONFIG_SKB_EXTENSIONS */ static inline void nf_reset_ct(struct sk_buff *skb) @@ -4608,7 +4610,6 @@ static inline void skb_reset_redirect(st #endif } -#ifdef CONFIG_KCOV static inline void skb_set_kcov_handle(struct sk_buff *skb, const u64 kcov_handle) { @@ -4632,11 +4633,6 @@ static inline u64 skb_get_kcov_handle(st return kcov_handle ? *kcov_handle : 0; } -#else -static inline void skb_set_kcov_handle(struct sk_buff *skb, - const u64 kcov_handle) { } -static inline u64 skb_get_kcov_handle(struct sk_buff *skb) { return 0; } -#endif /* CONFIG_KCOV */ #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */