Netdev List
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Scott Feldman <sfeldma@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>, Or Gerlitz <ogerlitz@mellanox.com>
Subject: [PATCH net-next] net/bridge: Enable bridge also when switchdev can't be built
Date: Wed, 13 May 2015 13:08:43 +0300	[thread overview]
Message-ID: <1431511723-26323-1-git-send-email-ogerlitz@mellanox.com> (raw)

Currently switchdev doesn't build on older gcc version such as 4.4.6

The reason for the compile error is such that it causes a failure
to build the bridge too, even when switchdev isn't configured (the
stub isn't enough), fix it.

CC [M]  net/bridge/br_stp.o
net/bridge/br_stp.c: In function 'br_set_state':
net/bridge/br_stp.c:44: error: unknown field 'stp_state' specified in initializer

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 net/bridge/br_stp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index b9300da..752783a 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -39,17 +39,19 @@ void br_log_state(const struct net_bridge_port *p)
 
 void br_set_state(struct net_bridge_port *p, unsigned int state)
 {
+#ifdef CONFIG_NET_SWITCHDEV
 	struct switchdev_attr attr = {
 		.id = SWITCHDEV_ATTR_PORT_STP_STATE,
 		.stp_state = state,
 	};
 	int err;
 
-	p->state = state;
 	err = switchdev_port_attr_set(p->dev, &attr);
 	if (err && err != -EOPNOTSUPP)
 		br_warn(p->br, "error setting offload STP state on port %u(%s)\n",
 				(unsigned int) p->port_no, p->dev->name);
+#endif
+	p->state = state;
 }
 
 /* called under bridge lock */
-- 
1.7.1

             reply	other threads:[~2015-05-13 10:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 10:08 Or Gerlitz [this message]
2015-05-13 15:44 ` [PATCH net-next] net/bridge: Enable bridge also when switchdev can't be built Scott Feldman
2015-05-13 15:47   ` Jiri Pirko
2015-05-13 15:54     ` Scott Feldman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431511723-26323-1-git-send-email-ogerlitz@mellanox.com \
    --to=ogerlitz@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=sfeldma@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox