netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>, netdev@vger.kernel.org
Cc: davem@davemloft.net, vivien.didelot@savoirfairelinux.com,
	jerome.oufella@savoirfairelinux.com, andrew@lunn.ch,
	cphealy@gmail.com
Subject: Re: [PATCH RFC 1/2] net: dsa: integrate with SWITCHDEV for HW bridging
Date: Tue, 17 Feb 2015 12:24:26 -0800	[thread overview]
Message-ID: <54E3A37A.50104@gmail.com> (raw)
In-Reply-To: <54E3A0D5.5020801@roeck-us.net>

On 17/02/15 12:13, Guenter Roeck wrote:
> On 02/17/2015 11:26 AM, Florian Fainelli wrote:
>> In order to support bridging offloads in DSA switch drivers, select
>> NET_SWITCHDEV to get access to the port_stp_update and parent_get_id
>> NDOs that we are required to implement.
>>
>> To facilitate the integratation at the DSA driver level, we implement 3
>> types of operations:
>>
>> - port_join_bridge
>> - port_leave_bridge
>> - port_stp_update
>>
>> DSA will resolve which switch ports that are currently bridge port
>> members as some Switch hardware/drivers need to know about that to limit
>> the register programming to just the relevant registers (especially for
>> slow MDIO buses).
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>   include/net/dsa.h  |  10 +++++
>>   net/dsa/Kconfig    |   1 +
>>   net/dsa/dsa.c      |   7 ++++
>>   net/dsa/dsa_priv.h |   2 +
>>   net/dsa/slave.c    | 117
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>   5 files changed, 137 insertions(+)
>>
>> diff --git a/include/net/dsa.h b/include/net/dsa.h
>> index ed3c34bbb67a..92be34791963 100644
>> --- a/include/net/dsa.h
>> +++ b/include/net/dsa.h
>> @@ -275,6 +275,16 @@ struct dsa_switch_driver {
>>       int    (*get_regs_len)(struct dsa_switch *ds, int port);
>>       void    (*get_regs)(struct dsa_switch *ds, int port,
>>                   struct ethtool_regs *regs, void *p);
>> +
>> +    /*
>> +     * Bridge integration
>> +     */
>> +    int    (*port_join_bridge)(struct dsa_switch *ds, int port,
>> +                    u32 br_port_mask);
>> +    int    (*port_leave_bridge)(struct dsa_switch *ds, int port,
>> +                     u32 br_port_mask);
>> +    int    (*port_stp_update)(struct dsa_switch *ds, int port,
>> +                   u8 state);
>>   };
>>
>>   void register_switch_driver(struct dsa_switch_driver *type);
>> diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
>> index 5f8ac404535b..b45206e8dd3e 100644
>> --- a/net/dsa/Kconfig
>> +++ b/net/dsa/Kconfig
>> @@ -8,6 +8,7 @@ config NET_DSA
>>       tristate
>>       depends on HAVE_NET_DSA
>>       select PHYLIB
>> +    select NET_SWITCHDEV
> 
> Should this be "select" or "depends on" ?
> 
> Downside of depends is that we'll need some ifdefs in the code,
> but on the other side it would let people disable it if it is
> not needed.

The code overhead is not huge, and I would think that by enforcing
NET_SWITCHDEV we encourage better DSA driver practices and promote HW
bridging, if you think this should be made conditional, I guess we can
do that.
-- 
Florian

  reply	other threads:[~2015-02-17 20:24 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-17 19:26 [PATCH RFC 0/2] net: dsa: integration with SWITCHDEV for HW bridging Florian Fainelli
2015-02-17 19:26 ` [PATCH RFC 1/2] net: dsa: integrate " Florian Fainelli
2015-02-17 20:13   ` Guenter Roeck
2015-02-17 20:24     ` Florian Fainelli [this message]
2015-02-17 20:28       ` Guenter Roeck
2015-02-18  1:19   ` Andrew Lunn
2015-02-18  1:43     ` Florian Fainelli
2015-02-18  3:53     ` Guenter Roeck
2015-02-18  4:53       ` Florian Fainelli
2015-02-18  6:14         ` Guenter Roeck
2015-02-18 13:49         ` Andrew Lunn
2015-02-18 14:05           ` Guenter Roeck
2015-02-23  2:20   ` Guenter Roeck
2015-02-23  3:14     ` Andrew Lunn
2015-02-23  4:07       ` Guenter Roeck
2015-02-23  4:22         ` Andrew Lunn
2015-02-23  4:33           ` Florian Fainelli
2015-02-23  4:38           ` Guenter Roeck
2015-02-23  4:43             ` Florian Fainelli
2015-02-23  6:19               ` Guenter Roeck
2015-02-23 13:34               ` Andrew Lunn
2015-02-23 14:23                 ` Guenter Roeck
2015-02-23 16:01                   ` Andrew Lunn
2015-02-23 18:05                     ` Florian Fainelli
2015-02-23 18:35                       ` Guenter Roeck
2015-02-25 13:43                         ` Andrey Volkov
2015-02-25 14:25                           ` Guenter Roeck
2015-02-25 16:05                             ` Andrey Volkov
2015-02-25 17:41                               ` Guenter Roeck
2015-02-26  1:18                                 ` Andrey Volkov
2015-02-27 17:09                             ` Andrey Volkov
2015-02-28  7:53                               ` Guenter Roeck
2015-03-02 14:38                                 ` Andrey Volkov
2015-03-02 14:49                                   ` Guenter Roeck
2015-03-02 15:27                                     ` Andrey Volkov
2015-03-02 17:16                                       ` Guenter Roeck
2015-03-04 10:07                                         ` Andrey Volkov
2015-02-17 19:26 ` [PATCH RFC 2/2] net: dsa: bcm_sf2: implement HW bridging operations Florian Fainelli
2015-02-19  2:48   ` Florian Fainelli
2015-02-19  5:59     ` Guenter Roeck
2015-02-19 17:27       ` Florian Fainelli
2015-02-19 17:46         ` Guenter Roeck
2015-02-19 23:50           ` Florian Fainelli
2015-02-20  0:09             ` Guenter Roeck
2015-02-20  0:51               ` roopa
2015-02-20  1:03                 ` Guenter Roeck
2015-02-20  1:46                   ` roopa
2015-02-20  2:00                     ` Florian Fainelli
2015-02-20  2:41                       ` roopa
2015-02-20  4:05                         ` Guenter Roeck
2015-02-20  4:58                           ` Scott Feldman
2015-02-20  4:59                           ` roopa
2015-02-20  3:20                       ` Andy Gospodarek
2015-02-20  3:53                         ` Viswanath Bandaru
2015-02-20  3:56                         ` Andy Gospodarek
2015-02-20  2:18                     ` Andrew Lunn
2015-02-20  2:51                       ` roopa
2015-02-20  3:52                         ` Andrew Lunn
2015-02-20  4:07                           ` Guenter Roeck
2015-02-20  2:02               ` Andrew Lunn
2015-02-20  3:55                 ` Guenter Roeck
2015-02-20  2:03               ` Florian Fainelli
2015-02-20  2:46                 ` roopa
2015-02-18  0:48 ` [PATCH RFC 0/2] net: dsa: integration with SWITCHDEV for HW bridging Scott Feldman
2015-02-18  1:09   ` Florian Fainelli

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=54E3A37A.50104@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jerome.oufella@savoirfairelinux.com \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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;
as well as URLs for NNTP newsgroup(s).