All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: roopa@cumulusnetworks.com, jiri@resnulli.us, sfeldma@gmail.com,
	bcrl@kvack.org, tgraf@suug.ch, john.fastabend@gmail.com,
	stephen@networkplumber.org, linville@tuxdriver.com,
	nhorman@tuxdriver.com, nicolas.dichtel@6wind.com,
	vyasevic@redhat.com, f.fainelli@gmail.com,
	buytenh@wantstofly.org, aviadr@mellanox.com
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	shm@cumulusnetworks.com, gospo@cumulusnetworks.com
Subject: Re: [PATCH 2/3] bridge: offload bridge port attributes to switch asic if feature flag set
Date: Fri, 05 Dec 2014 07:07:05 -0500	[thread overview]
Message-ID: <54819FE9.6030801@mojatatu.com> (raw)
In-Reply-To: <1417746401-8140-3-git-send-email-roopa@cumulusnetworks.com>

On 12/04/14 21:26, roopa@cumulusnetworks.com wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>

Ok, so this one maintains status quo. Looks reasonable
to me.

cheers,
jamal

> This allows offloading to switch asic without having the user to set
> any flag. And this is done in the bridge driver to rollback kernel settings
> on hw offload failure if required in the future.
>
> With this, it also makes sure a notification goes out only after the
> attributes are set both in the kernel and hw.
> ---
>   net/bridge/br_netlink.c |   27 ++++++++++++++++++++++++++-
>   1 file changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index 9f5eb55..ce173f0 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -407,9 +407,21 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh)
>   				afspec, RTM_SETLINK);
>   	}
>
> +	if ((dev->features & NETIF_F_HW_SWITCH_OFFLOAD) &&
> +			dev->netdev_ops->ndo_bridge_setlink) {
> +		int ret = dev->netdev_ops->ndo_bridge_setlink(dev, nlh);
> +		if (ret && ret != -EOPNOTSUPP) {
> +			/* XXX Fix this in the future to rollback
> +			 * kernel settings and return error
> +			 */
> +			br_warn(p->br, "error offloading bridge attributes "
> +					"on port %u(%s)\n", (unsigned int) p->port_no,
> +					p->dev->name);
> +		}
> +	}
> +
>   	if (err == 0)
>   		br_ifinfo_notify(RTM_NEWLINK, p);
> -
>   out:
>   	return err;
>   }
> @@ -433,6 +445,19 @@ int br_dellink(struct net_device *dev, struct nlmsghdr *nlh)
>   	err = br_afspec((struct net_bridge *)netdev_priv(dev), p,
>   			afspec, RTM_DELLINK);
>
> +	if (dev->features & NETIF_F_HW_SWITCH_OFFLOAD
> +			&& dev->netdev_ops->ndo_bridge_setlink) {
> +		int ret = dev->netdev_ops->ndo_bridge_dellink(dev, nlh);
> +		if (ret && ret != -EOPNOTSUPP) {
> +			/* XXX Fix this in the future to rollback
> +			 * kernel settings and return error
> +			 */
> +			br_warn(p->br, "error offloading bridge attributes "
> +					"on port %u(%s)\n", (unsigned int) p->port_no,
> +					p->dev->name);
> +		}
> +	}
> +
>   	return err;
>   }
>   static int br_validate(struct nlattr *tb[], struct nlattr *data[])
>

  parent reply	other threads:[~2014-12-05 12:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05  2:26 [PATCH 2/3] bridge: offload bridge port attributes to switch asic if feature flag set roopa
2014-12-05  6:41 ` Scott Feldman
2014-12-05  6:55   ` John Fastabend
2014-12-05  7:10     ` Roopa Prabhu
2014-12-05 12:41       ` Jamal Hadi Salim
2014-12-05 14:03         ` Roopa Prabhu
2014-12-05  7:02   ` Roopa Prabhu
2014-12-05 23:21     ` Arad, Ronen
2014-12-06  1:04       ` Arad, Ronen
2014-12-06  2:46         ` John Fastabend
2014-12-06  3:06           ` Arad, Ronen
2014-12-06  3:21             ` John Fastabend
2014-12-06  6:29         ` Scott Feldman
2014-12-06  8:05           ` Arad, Ronen
2014-12-07 17:33             ` Roopa Prabhu
2014-12-06  6:54       ` Scott Feldman
2014-12-07 20:24         ` Roopa Prabhu
2014-12-08  4:56           ` Roopa Prabhu
2014-12-08 11:14           ` Jiri Pirko
2014-12-08 18:40           ` Arad, Ronen
2014-12-07 19:13       ` Roopa Prabhu
2014-12-05  7:38 ` Jiri Pirko
2014-12-05 13:44   ` Roopa Prabhu
2014-12-05 14:37   ` Roopa Prabhu
2014-12-05 12:07 ` Jamal Hadi Salim [this message]
2014-12-05 13:21 ` Sergei Shtylyov
2014-12-05 14:04   ` Roopa Prabhu

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=54819FE9.6030801@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=aviadr@mellanox.com \
    --cc=bcrl@kvack.org \
    --cc=buytenh@wantstofly.org \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=gospo@cumulusnetworks.com \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=nicolas.dichtel@6wind.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=sfeldma@gmail.com \
    --cc=shm@cumulusnetworks.com \
    --cc=stephen@networkplumber.org \
    --cc=tgraf@suug.ch \
    --cc=vyasevic@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.