Netdev List
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: f.fainelli@gmail.com, andrew@lunn.ch, davem@davemloft.net,
	netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>
Subject: Re: [PATCH net-next v2 1/9] net: dsa: Call driver's setup callback after setting up its switchdev notifier
Date: Sat, 4 May 2019 16:44:04 -0400	[thread overview]
Message-ID: <20190504164404.GB21656@t480s.localdomain> (raw)
In-Reply-To: <20190504135919.23185-2-olteanv@gmail.com>

On Sat,  4 May 2019 16:59:11 +0300, Vladimir Oltean <olteanv@gmail.com> wrote:
> This allows the driver to perform some manipulations of its own during
> setup, using generic switchdev calls. Having the notifiers registered at
> setup time is important because otherwise any switchdev transaction
> emitted during this time would be ignored (dispatched to an empty call
> chain).
> 
> One current usage scenario is for the driver to request DSA to set up
> 802.1Q based switch tagging for its ports.
> 
> There is no danger for the driver setup code to start racing now with
> switchdev events emitted from the network stack (such as bridge core)
> even if the notifier is registered earlier. This is because the network
> stack needs a net_device as a vehicle to perform switchdev operations,
> and the slave net_devices are registered later than the core driver
> setup anyway (ds->ops->setup in dsa_switch_setup vs dsa_port_setup).
> 
> Luckily DSA doesn't need a net_device to carry out switchdev callbacks,
> and therefore drivers shouldn't assume either that net_devices are
> available at the time their switchdev callbacks get invoked.
> 
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>

  reply	other threads:[~2019-05-04 20:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 13:59 [PATCH net-next v2 0/9] Traffic support for SJA1105 DSA driver Vladimir Oltean
2019-05-04 13:59 ` [PATCH net-next v2 1/9] net: dsa: Call driver's setup callback after setting up its switchdev notifier Vladimir Oltean
2019-05-04 20:44   ` Vivien Didelot [this message]
2019-05-04 13:59 ` [PATCH net-next v2 2/9] net: dsa: Optional VLAN-based port separation for switches without tagging Vladimir Oltean
2019-05-04 20:57   ` Vivien Didelot
2019-05-05  6:35   ` kbuild test robot
2019-05-04 13:59 ` [PATCH net-next v2 3/9] net: dsa: Allow drivers to filter packets they can decode source port from Vladimir Oltean
2019-05-04 22:49   ` Vivien Didelot
2019-05-04 23:23     ` Vladimir Oltean
2019-05-04 13:59 ` [PATCH net-next v2 4/9] net: dsa: Keep private info in the skb->cb Vladimir Oltean
2019-05-04 13:59 ` [PATCH net-next v2 5/9] net: dsa: Add support for deferred xmit Vladimir Oltean
2019-05-04 13:59 ` [PATCH net-next v2 6/9] net: dsa: Add a private structure pointer to dsa_port Vladimir Oltean
2019-05-04 21:26   ` Vivien Didelot
2019-05-04 13:59 ` [PATCH net-next v2 7/9] net: dsa: sja1105: Add support for traffic through standalone ports Vladimir Oltean
2019-05-04 13:59 ` [PATCH net-next v2 8/9] net: dsa: sja1105: Add support for Spanning Tree Protocol Vladimir Oltean
2019-05-04 13:59 ` [PATCH net-next v2 9/9] Documentation: net: dsa: sja1105: Add info about supported traffic modes Vladimir Oltean

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=20190504164404.GB21656@t480s.localdomain \
    --to=vivien.didelot@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@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