All of lore.kernel.org
 help / color / mirror / Atom feed
From: roopa <roopa@cumulusnetworks.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: Scott Feldman <sfeldma@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	netdev <netdev@vger.kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	"Samudrala, Sridhar" <sridhar.samudrala@intel.com>,
	"Arad, Ronen" <ronen.arad@intel.com>
Subject: Re: [PATCH net-next v3 01/26] switchdev: introduce get/set attrs ops
Date: Fri, 03 Apr 2015 18:44:05 -0700	[thread overview]
Message-ID: <551F41E5.9020600@cumulusnetworks.com> (raw)
In-Reply-To: <20150402181606.GF2613@nanopsycho.orion>

On 4/2/15, 11:16 AM, Jiri Pirko wrote:
> Thu, Apr 02, 2015 at 07:52:28PM CEST, sfeldma@gmail.com wrote:
>> On Thu, Apr 2, 2015 at 2:09 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>> [snip]
>>>
>>>> +       int err = -EOPNOTSUPP;
>>>> +
>>>> +       if (!(dev->features & NETIF_F_HW_SWITCH_OFFLOAD))
>>>> +               return err;
>>> That check is currently going to prevent DSA from working, since we do
>>> not yet advertise NETIF_HW_SWITCH_OFFLOAD (which should be fixed). In
>>> general, though I am not sure this is entirely desirable to check that
>>> here for multiple reasons:
>>>
>>> - stacked devices typically propagate lower devices dev->features, but
>>> if they are purposely not doing it, this might start breaking
>>> - is not that check, used as it is now, that unconditionally, end-up
>>> being redundant with e.g: getting the switch device id to identify
>>> this net_device as a switch port net_device?
>>>
>>> I kind of preferred when we had this moved into the
>>> __swdev_attr_{get,set} caller, such we had finer control over whether
>>> or not checking for these kinds of features makes sense for a
>>> particular operation.
>> I dropped it in my v1 patch set all together, but then it came back in
>> v2.  I understand how it works, giving the user the ability to turn
>> on/off offload support on a port at run-time, but I don't understand
>> the application.  I agree with you that we already have finer-grained
>> ability to know if a sub-feature is supported or not based on what the
>> driver implements (like switch ID or STP state).  I don't know what
>> this master switch is used for.  Why would the user turn off
>> offloading on a port at run-time after the device has already been
>> programmed with some offloading tasks?  What tells the device to stop
>> those offloads now.  And then later, the user flips the switch to turn
>> back on offloads on the port.   How do we restore the device?
>>
>> Roopa, can you help us understand how NETIF_F_HW_SWITCH_OFFLOAD is used?
> Documentation patch required?
I can provide a documentation patch.
The use for this today is:
a) to recognize a switch port, instead of walking lowerdevs all the time 
(sometimes this could be in the packet path).
b) There are drivers today that support bridge l2 ndo ops only via 
'self' (directly going to the nic driver).
the bridge driver vlan offload bridge_setlink/bridge_getlink switchdev 
calls also use the same ndo ops when you add a vlan to a bridge (this is 
from within the bridge driver. Same will be true for fdb). This flag 
also serves the purpose of not breaking those drivers because they dont 
advertise this flag
c) I see it as a nice switch to turn off offload in some environments. 
The driver has a choice to support this or simply reject it.
In the cases where it supports it, maybe it could flush all its tables 
and send pkts to software.

Agree that the use of swdev_get_parent_id in the same place is making it 
redundant.
In the initial days, if i remember correctly, we used an ndo op with a 
similar name that was also shared by other nic
devices... which made it difficult to rely on the op.

since the rest of the kernel has always used features on netdev instead 
of ops, seems like a feature check instead of a 'op' check will keep it 
consistent.

Thanks,
Roopa

  reply	other threads:[~2015-04-04  1:44 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02  8:09 [PATCH net-next v3 00/26] switchdev: spring cleanup sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 01/26] switchdev: introduce get/set attrs ops sfeldma
2015-04-02  9:09   ` Florian Fainelli
2015-04-02 17:52     ` Scott Feldman
2015-04-02 18:16       ` Jiri Pirko
2015-04-04  1:44         ` roopa [this message]
2015-04-02  8:09 ` [PATCH net-next v3 02/26] switchdev: convert parent_id_get to swdev attr get sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 03/26] switchdev: convert STP update to swdev attr set sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 04/26] switchdev: add bridge port flags attr sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 05/26] rocker: use swdev get/set attr for bridge port flags sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 06/26] switchdev: introduce swdev add/del obj ops sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 07/26] switchdev: add port vlan obj sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 08/26] rocker: use swdev add/del obj for bridge port vlans sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 09/26] switchdev: add new swdev bridge setlink sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 10/26] rocker: cut over to new swdev_port_bridge_setlink sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 11/26] bonding: " sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 12/26] team: " sfeldma
2015-04-02  8:09 ` [PATCH net-next v3 13/26] switchdev: remove old netdev_switch_port_bridge_setlink sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 14/26] switchdev: add new swdev_port_bridge_dellink sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 15/26] rocker: cut over to " sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 16/26] bonding: " sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 17/26] team: " sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 18/26] switchdev: remove unused netdev_switch_port_bridge_dellink sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 19/26] switchdev: add new swdev_port_bridge_getlink sfeldma
2015-04-04 16:56   ` Arad, Ronen
2015-04-06 21:13     ` Scott Feldman
2015-04-06 21:58       ` Arad, Ronen
2015-04-02  8:10 ` [PATCH net-next v3 20/26] rocker: cut over to " sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 21/26] bonding: " sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 22/26] team: " sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 23/26] switchdev: rename netdev_switch_fib_* to swdev_fib_* sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 24/26] switchdev: rename netdev_switch_notifier_* to swdev_notifier_* sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 25/26] switchdev: convert swdev_fib_ipv4_add/del over to swdev_port_obj_add/del sfeldma
2015-04-02  8:10 ` [PATCH net-next v3 26/26] switchdev: bring documentation up-to-date sfeldma
2015-04-02  8:15 ` [PATCH net-next v3 00/26] switchdev: spring cleanup Jiri Pirko

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=551F41E5.9020600@cumulusnetworks.com \
    --to=roopa@cumulusnetworks.com \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=ronen.arad@intel.com \
    --cc=sfeldma@gmail.com \
    --cc=sridhar.samudrala@intel.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.