All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: "Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"Ivan Vecera" <ivecera@redhat.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	Networking <netdev@vger.kernel.org>,
	ivan.khoronzhuk@linaro.org, "Sekhar Nori" <nsekhar@ti.com>,
	"Jiří Pírko" <jiri@resnulli.us>,
	"Francois Ozog" <francois.ozog@linaro.org>,
	yogeshs@ti.com, spatton@ti.com, Jose.Abreu@synopsys.com
Subject: Re: [RFC v2, net-next, PATCH 4/4] net/cpsw_switchdev: add switchdev mode of operation on cpsw driver
Date: Thu, 28 Jun 2018 09:53:07 +0200	[thread overview]
Message-ID: <CAK8P3a1eLUL3qHZ6P3txEkgFWuiOxTPm8jXagG2nD-3Y+Rwagw@mail.gmail.com> (raw)
In-Reply-To: <88e01f4c-202e-565a-de22-d0ef20b6c989@ti.com>

On Thu, Jun 28, 2018 at 1:03 AM, Grygorii Strashko
<grygorii.strashko@ti.com> wrote:
>
>
> On 06/27/2018 03:40 PM, Arnd Bergmann wrote:
>> On Wed, Jun 27, 2018 at 9:18 PM, Grygorii Strashko
>> <grygorii.strashko@ti.com> wrote:
>>> On 06/22/2018 02:45 AM, Ilias Apalodimas wrote:
>>>> On Thu, Jun 21, 2018 at 05:31:31PM +0200, Arnd Bergmann wrote:
>>>>> On Thu, Jun 21, 2018 at 2:45 PM, Ilias Apalodimas
>>>>> <ilias.apalodimas@linaro.org> wrote:
>>>>>> On Thu, Jun 21, 2018 at 02:19:55PM +0200, Ivan Vecera wrote:
>>>>>
>>>>
>>>> If people like this idea, i can send a V3 with these changes.
>>>
>>> Nop. I do not think this is good idea, because "dual_mac" mode has very strict
>>> meaning and requirements. In "dual_mac" mode both port should be teated and work
>>> as *separate network devices" (like two, not connected PCI eth cards) - the fact that
>>> it's implemented on top of hw, which can do packet switching doesn't matter here and just a
>>> technical solution.
>>> Main requirements:
>>> 1) No packet forwarding is allowed inside hw under any circumstances, only Linux
>>>     Host SW can consume or forward packets
>>> 2) One interface should not block another inside CPSW hw which implies special FIFOs/HW
>>>   configuration
>>
>> Could you explain the reasoning behind those requirements? I honestly don't
>> see what difference it makes, given that a new driver with switchdev support
>> would look exactly like the dual_emac mode as long as you don't add the
>> two interfaces into a bridge, and the user-visible behavior is already required
>> to be the same.
>
> Am not aware of all details - it's custom filtering/routing/firewalling applications.
> (Like Industrial Ethernet (EtherCAT) to Ethernet converter on one port and
>  another port is for control/monitoring purposes)
> And yes, it looks similar. But, as I mentioned, dual_mac mode required CPSW to be
> configured differently and reconfiguration during attaching to the bridge
> is very (very) problematic - first, FIFOs/HW configuration not expected to be done on the fly,
> second vlans 1/2 reserved for this mode while bridge uses vid 1 by default.
> In dual_mac mode port just switched to promiscuous mode when attached to the bridge.
> Using kernel configuration option will break multi-platform support as
> all CPSW instances will start behaving as switch.

I was referring to dynamically reconfiguring the device during switch
attachment (which you say is hard in the current driver, and I can believe that,
but it does seem like a problem that can be solved with a proper design),
and the kernel configuration must have no impact on the default behavior
in that case.

This would still meet the requirements for the use case you mention,
as one would definitely never want to bridge between an EtherCAT
interface and a management interface.

>>> As per, above switchdev functionality doesn't make too much sense in "dual_mac" mode and
>>> introducing dual meaning for this mode is not a good choice either.
>>>
>>> Again, as discussed, option 4 is considered as preferred.
>>
>> Do you mean creating an incompatible binding that could be implemented by
>> the same driver, or duplicating the driver with one copy of the old binding
>> and one copy for the new binding?
>
> The idea is to keep dual_mac and one port mode (60% of use cases) as is
> while create new driver for two port switch mode by refactoring existing driver and
> re-using generic parts as max as possible. Also, update bindings as there are
> a lot of ancient and obsolete DT definitions which still supported for compatibility
> reasons. And, yes, possibility to mix dual_mac and switchdev in one driver is
> considered, but postponed as it hard to implement now, and as the main target is
> to drop custom ioctl and switch to standard Linux interfaces for switch.
> One step at time.

But wouldn't that new driver have the exact same problem with reconfiguring
the device between the boot-time configuration that behaves like
dual_emac and the switch configuration once the switchdev gets attached?

      Arnd

  reply	other threads:[~2018-06-28  7:53 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 11:11 [RFC v2, net-next, PATCH 0/4] Add switchdev on TI-CPSW Ilias Apalodimas
2018-06-14 11:11 ` [RFC v2, net-next, PATCH 1/4] net/cpsw: move common headers definitions to cpsw_priv.h Ilias Apalodimas
2018-06-14 11:11 ` [RFC v2, net-next, PATCH 2/4] net/cpsw_ale: add functions to modify VLANs/MDBs Ilias Apalodimas
2018-06-14 11:11 ` [RFC v2, net-next, PATCH 3/4] net/cpsw: prepare cpsw for switchdev support Ilias Apalodimas
2018-06-14 11:11 ` [RFC v2, net-next, PATCH 4/4] net/cpsw_switchdev: add switchdev mode of operation on cpsw driver Ilias Apalodimas
2018-06-14 11:23   ` Jiri Pirko
2018-06-14 11:32     ` Ilias Apalodimas
2018-06-14 11:30   ` Jiri Pirko
2018-06-14 11:34     ` Ilias Apalodimas
2018-06-14 11:39       ` Jiri Pirko
2018-06-14 11:43         ` Ilias Apalodimas
2018-06-18 23:19           ` Grygorii Strashko
2018-06-20  7:08             ` Jiri Pirko
2018-06-20 12:53               ` Ivan Vecera
2018-06-20 12:59                 ` Ilias Apalodimas
2018-06-20 13:54                   ` Ivan Vecera
2018-06-18 16:16   ` Andrew Lunn
2018-06-18 20:19     ` Ilias Apalodimas
2018-06-18 23:20       ` Grygorii Strashko
2018-06-20 12:56       ` Ivan Vecera
2018-06-20 17:51         ` Ilias Apalodimas
2018-06-20 17:57           ` Andrew Lunn
2018-06-20 17:58           ` Florian Fainelli
2018-06-20 18:03             ` Ilias Apalodimas
2018-06-21 12:19               ` Ivan Vecera
2018-06-21 12:45                 ` Ilias Apalodimas
2018-06-21 15:31                   ` Arnd Bergmann
2018-06-22  7:45                     ` Ilias Apalodimas
2018-06-27 19:18                       ` Grygorii Strashko
2018-06-27 20:40                         ` Arnd Bergmann
2018-06-27 23:03                           ` Grygorii Strashko
2018-06-28  7:53                             ` Arnd Bergmann [this message]
2018-06-18 15:04 ` [RFC v2, net-next, PATCH 0/4] Add switchdev on TI-CPSW Andrew Lunn
2018-06-18 16:04   ` Ilias Apalodimas
2018-06-18 16:28     ` Andrew Lunn
2018-06-18 16:46       ` Ilias Apalodimas
2018-06-18 17:30         ` Andrew Lunn
2018-06-18 17:49           ` Ilias Apalodimas
2018-06-27 21:05             ` Grygorii Strashko

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=CAK8P3a1eLUL3qHZ6P3txEkgFWuiOxTPm8jXagG2nD-3Y+Rwagw@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=Jose.Abreu@synopsys.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=francois.ozog@linaro.org \
    --cc=grygorii.strashko@ti.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=ivan.khoronzhuk@linaro.org \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=spatton@ti.com \
    --cc=yogeshs@ti.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.