From patchwork Wed Nov 18 19:44:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 11915755 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 D3D6FC5519F for ; Wed, 18 Nov 2020 19:44:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2DA97246AB for ; Wed, 18 Nov 2020 19:44:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="de6nFAXC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725948AbgKRToq (ORCPT ); Wed, 18 Nov 2020 14:44:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgKRTop (ORCPT ); Wed, 18 Nov 2020 14:44:45 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7D23C0613D4 for ; Wed, 18 Nov 2020 11:44:45 -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=tZKPGKSmmymGtXeC01Q9elUkxGGGyHcAJWQbaIKvDiE=; b=de6nFAXCaYzzhFAyhMcuGWgeiX Is+KH9FFxdk3HbwBqr0HEsL5iPVtVtNzb8YgKk1UNUgEVW6SFWt0fDGaO9CrL7hvn8FMCKKLBavVl n/hUCe38DTeJ9YTi/cmD8Kme1Ah6QSOXQyQ6Im1v0Eg3JArbSUbwFvkzAQbfDsOLFvvqTEA6rHE6U PWoszB6MXbFVlKD8+iwNCV2TeR1r/YxHMbnU5jse6ux40HKHcerBToq7UchhI8mBivpOTpDsZ5JI2 0Uc8ty8uS1CAasz18PFX7Nb7ynlBNPauWv75n14ZLY890XDdFcqOaXAd0z/hmLutZYZ/lBp/jrueg GTgzzVCw==; Received: from [2601:1c0:6280:3f0::bcc4] (helo=smtpauth.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfTNi-0007k7-Ib; Wed, 18 Nov 2020 19:44:43 +0000 From: Randy Dunlap To: netdev@vger.kernel.org Cc: Randy Dunlap , Eric Dumazet , Jakub Kicinski Subject: [PATCH net-next] net: stream: fix TCP references when INET is not enabled Date: Wed, 18 Nov 2020 11:44:38 -0800 Message-Id: <20201118194438.674-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Fix build of net/core/stream.o when CONFIG_INET is not enabled. Fixes these build errors (sample): ld: net/core/stream.o: in function `sk_stream_write_space': (.text+0x27e): undefined reference to `tcp_stream_memory_free' ld: (.text+0x29c): undefined reference to `tcp_stream_memory_free' ld: (.text+0x2ab): undefined reference to `tcp_stream_memory_free' ld: net/core/stream.o: in function `sk_stream_wait_memory': (.text+0x5a1): undefined reference to `tcp_stream_memory_free' ld: (.text+0x5bf): undefined reference to `tcp_stream_memory_free' Fixes: 1c5f2ced136a ("tcp: avoid indirect call to tcp_stream_memory_free()") Signed-off-by: Randy Dunlap Reported-by: Randy Dunlap Cc: Eric Dumazet Cc: Jakub Kicinski --- include/net/sock.h | 5 +++++ 1 file changed, 5 insertions(+) --- linux-next-20201118.orig/include/net/sock.h +++ linux-next-20201118/include/net/sock.h @@ -1271,10 +1271,15 @@ static inline bool __sk_stream_memory_fr if (READ_ONCE(sk->sk_wmem_queued) >= READ_ONCE(sk->sk_sndbuf)) return false; +#ifdef CONFIG_INET return sk->sk_prot->stream_memory_free ? INDIRECT_CALL_1(sk->sk_prot->stream_memory_free, tcp_stream_memory_free, sk, wake) : true; +#else + return sk->sk_prot->stream_memory_free ? + sk->sk_prot->stream_memory_free(sk, wake) : true; +#endif } static inline bool sk_stream_memory_free(const struct sock *sk)