From patchwork Tue Oct 15 17:27:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi-Hung Wei X-Patchwork-Id: 1177247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BstBtEcj"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46t2kZ35tvz9sP4 for ; Wed, 16 Oct 2019 04:40:06 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3DE34EBC; Tue, 15 Oct 2019 17:39:21 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 06B84EB8 for ; Tue, 15 Oct 2019 17:39:20 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9AA346C5 for ; Tue, 15 Oct 2019 17:39:19 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id b128so12952102pfa.1 for ; Tue, 15 Oct 2019 10:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h/PwRTmw5pn3GOxN5e6qVO56WLPreKSphSwiDpOF2pU=; b=BstBtEcjOwOkxuQx8Lqv5gRv+QzVDq7v+rZI7gylNbvgCL42fPcP5gazSlZtnugQb8 jjIlPPrj17my/wBY8/aacYtvIaxJfE73CnXe2KFqEBLp9HwXy2ST67VineLS/IOwDy+a DfPMrEiN+6Ep9k6iVZdTiHlgA3zX2UPYjIBVOaOPlqbXfBTOTkgSAY3ZK7r6dlUl71Pq O+bl2eEekeAqYosm1X98LDtON8xmECLYjoxrxdTEYKXN0jQXjUM46kwzu77/8pCll8XK Qiikj0xLYDX+M3CYI6SFNhc23ZeMHEPLT9MvBr373xTVO/kH05E4fVgBn9hwuIKgAcB9 HItw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=h/PwRTmw5pn3GOxN5e6qVO56WLPreKSphSwiDpOF2pU=; b=iYURzIhbgHzs+ss1YIvJEVuV9JXpa4/PLR0ieqCAuNdauheRimg9XvO3dPZITtoGLY ZBkCuJkCz8yKnJ4ithAFze1VzMO3qJZ35ObtCg6XYiF1uf22hW6R4ch4Eb4mNh8uzX/p cY39Trx0m/Tlbdmq7PdclRm0Txw1ipUW6aMHGnkEwLEzh8aH/AEYbNti819GfG8wi+Oa bKsI3C1LXQHRb1/OSYLyx9e1RbS01KtzXArcUyvbI8oCsPopvb4spQ4E2VUoe+PTpWyP UXOXUTgIq2nqC73eQQBwYF9Nm3ZKniwTFePMHZsUvknW986izGJXToMuzN2h/C0R+Wgl X2ZA== X-Gm-Message-State: APjAAAU3USsDDqtzGBYcgYVb6kqHg/xVukHsneJt+osK1kFUGwhPXilu eValy/VXl4/Dn+O0X2yF0/wwT3OK8kw= X-Google-Smtp-Source: APXvYqxpeeLtyZr8Dj1aFFg4Mg4tikML6Zvj+Hcl2lGK4wcISrq8RNiVNqSVq/JWb9UQJqdzbicZiQ== X-Received: by 2002:aa7:9295:: with SMTP id j21mr39295583pfa.87.1571161158790; Tue, 15 Oct 2019 10:39:18 -0700 (PDT) Received: from Husky.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id q204sm25590311pfc.11.2019.10.15.10.39.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Oct 2019 10:39:17 -0700 (PDT) From: Yi-Hung Wei To: dev@openvswitch.org Date: Tue, 15 Oct 2019 10:27:42 -0700 Message-Id: <1571160473-46132-2-git-send-email-yihung.wei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1571160473-46132-1-git-send-email-yihung.wei@gmail.com> References: <1571160473-46132-1-git-send-email-yihung.wei@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Arnd Bergmann Subject: [ovs-dev] [PATCH v2 01/12] datapath: Fix linking without CONFIG_NF_CONNTRACK_LABELS X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Arnd Bergmann upstream commit: commit a277d516de5f498c91d91189717ef7e01102ad27 Author: Arnd Bergmann Date: Fri Nov 2 16:36:55 2018 +0100 openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS When CONFIG_CC_OPTIMIZE_FOR_DEBUGGING is enabled, the compiler fails to optimize out a dead code path, which leads to a link failure: net/openvswitch/conntrack.o: In function `ovs_ct_set_labels': conntrack.c:(.text+0x2e60): undefined reference to `nf_connlabels_replace' In this configuration, we can take a shortcut, and completely remove the contrack label code. This may also help the regular optimization. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Yi-Hung Wei Reviewed-by: Yifeng Sun --- datapath/conntrack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datapath/conntrack.c b/datapath/conntrack.c index c6d523758ff1..e328afe1ad15 100644 --- a/datapath/conntrack.c +++ b/datapath/conntrack.c @@ -1263,7 +1263,8 @@ static int ovs_ct_commit(struct net *net, struct sw_flow_key *key, &info->labels.mask); if (err) return err; - } else if (labels_nonzero(&info->labels.mask)) { + } else if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && + labels_nonzero(&info->labels.mask)) { err = ovs_ct_set_labels(ct, key, &info->labels.value, &info->labels.mask); if (err)