linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS
@ 2018-11-02 15:36 Arnd Bergmann
  2018-11-04  2:29 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-11-02 15:36 UTC (permalink / raw)
  To: Pravin B Shelar, David S. Miller
  Cc: Arnd Bergmann, Pablo Neira Ayuso, Florian Westphal,
	Flavio Leitner, Gao Feng, Thierry Du Tre, Yi-Hung Wei, Ed Swierk,
	Julia Lawall, netdev, dev, linux-kernel

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 <arnd@arndb.de>
---
 net/openvswitch/conntrack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 6bec37ab4472..a4660c48ff01 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -1203,7 +1203,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)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS
  2018-11-02 15:36 [PATCH] openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS Arnd Bergmann
@ 2018-11-04  2:29 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-11-04  2:29 UTC (permalink / raw)
  To: arnd
  Cc: pshelar, pablo, fw, fbl, gfree.wind, thierry, yihung.wei,
	eswierk, Julia.Lawall, netdev, dev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Fri,  2 Nov 2018 16:36:55 +0100

> 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 <arnd@arndb.de>

Applied, thanks Arnd.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-04  2:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02 15:36 [PATCH] openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS Arnd Bergmann
2018-11-04  2:29 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).