mbox series

[net-next,0/8] net: ethernet: ti: am65-cpsw: add multi port support in mac-only mode

Message ID 20201001105258.2139-1-grygorii.strashko@ti.com (mailing list archive)
Headers show
Series net: ethernet: ti: am65-cpsw: add multi port support in mac-only mode | expand

Message

Grygorii Strashko Oct. 1, 2020, 10:52 a.m. UTC
Hi

This series adds multi-port support in mac-only mode (multi MAC mode) to TI
AM65x CPSW driver in preparation for enabling support for multi-port devices,
like Main CPSW0 on K3 J721E SoC or future CPSW3g on K3 AM64x SoC.

The multi MAC mode is implemented by configuring every enabled port in "mac-only"
mode (all ingress packets are sent only to the Host port and egress packets
directed to target Ext. Port) and creating separate net_device for
every enabled Ext. port.

Patches 1-3: Preparation patches to improve K3 CPSW configuration depending on DT
Patches 4-5: Fix VLAN offload for multi MAC mode
Patch 6: Fixes CPTS context lose issue during PM runtime transition
Patches 7-8: add multi-port support to TI AM65x CPSW

Grygorii Strashko (8):
  net: ethernet: ti: am65-cpsw: move ale selection in pdata
  net: ethernet: ti: am65-cpsw: move free desc queue mode selection in pdata
  net: ethernet: ti: am65-cpsw: use cppi5_desc_is_tdcm()
  net: ethernet: ti: cpsw_ale: add cpsw_ale_vlan_del_modify()
  net: ethernet: ti: am65-cpsw: fix vlan offload for multi mac mode
  net: ethernet: ti: am65-cpsw: keep active if cpts enabled
  net: ethernet: ti: am65-cpsw: prepare xmit/rx path for multi-port
    devices in mac-only mode
  net: ethernet: ti: am65-cpsw: add multi port support in mac-only mode

 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 179 ++++++++++++++---------
 drivers/net/ethernet/ti/am65-cpsw-nuss.h |   4 +
 drivers/net/ethernet/ti/cpsw_ale.c       |  41 +++++-
 drivers/net/ethernet/ti/cpsw_ale.h       |   1 +
 drivers/net/ethernet/ti/cpsw_switchdev.c |   2 +-
 5 files changed, 153 insertions(+), 74 deletions(-)

Comments

Jakub Kicinski Oct. 1, 2020, 11:08 p.m. UTC | #1
On Thu, 1 Oct 2020 13:52:50 +0300 Grygorii Strashko wrote:
> This series adds multi-port support in mac-only mode (multi MAC mode) to TI
> AM65x CPSW driver in preparation for enabling support for multi-port devices,
> like Main CPSW0 on K3 J721E SoC or future CPSW3g on K3 AM64x SoC.
> 
> The multi MAC mode is implemented by configuring every enabled port in "mac-only"
> mode (all ingress packets are sent only to the Host port and egress packets
> directed to target Ext. Port) and creating separate net_device for
> every enabled Ext. port.

Do I get it right that you select the mode based on platform? Can the
other mode still be supported on these platforms?

Is this a transition to normal DSA mode where ports always have netdevs?
Grygorii Strashko Oct. 2, 2020, 9:56 a.m. UTC | #2
On 02/10/2020 02:08, Jakub Kicinski wrote:
> On Thu, 1 Oct 2020 13:52:50 +0300 Grygorii Strashko wrote:
>> This series adds multi-port support in mac-only mode (multi MAC mode) to TI
>> AM65x CPSW driver in preparation for enabling support for multi-port devices,
>> like Main CPSW0 on K3 J721E SoC or future CPSW3g on K3 AM64x SoC.
>>
>> The multi MAC mode is implemented by configuring every enabled port in "mac-only"
>> mode (all ingress packets are sent only to the Host port and egress packets
>> directed to target Ext. Port) and creating separate net_device for
>> every enabled Ext. port.
> 
> Do I get it right that you select the mode based on platform? Can the
> other mode still be supported on these platforms?
> 
> Is this a transition to normal DSA mode where ports always have netdevs?
> 

The idea here is to start in multi mac mode by default, as we still have pretty high demand for this.
Then, and we are working on it, the switchdev mode is going to be introduces (not DSA).
The switch between modes will happen by using devlink option -
the approach is similar to what was used for Sitara CPSW cpsw_new.c driver [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/ti/cpsw_new.c
Jakub Kicinski Oct. 2, 2020, 11:04 p.m. UTC | #3
On Fri, 2 Oct 2020 12:56:43 +0300 Grygorii Strashko wrote:
> On 02/10/2020 02:08, Jakub Kicinski wrote:
> > On Thu, 1 Oct 2020 13:52:50 +0300 Grygorii Strashko wrote:  
> >> This series adds multi-port support in mac-only mode (multi MAC mode) to TI
> >> AM65x CPSW driver in preparation for enabling support for multi-port devices,
> >> like Main CPSW0 on K3 J721E SoC or future CPSW3g on K3 AM64x SoC.
> >>
> >> The multi MAC mode is implemented by configuring every enabled port in "mac-only"
> >> mode (all ingress packets are sent only to the Host port and egress packets
> >> directed to target Ext. Port) and creating separate net_device for
> >> every enabled Ext. port.  
> > 
> > Do I get it right that you select the mode based on platform? Can the
> > other mode still be supported on these platforms?
> > 
> > Is this a transition to normal DSA mode where ports always have netdevs?
>
> The idea here is to start in multi mac mode by default, as we still
> have pretty high demand for this. Then, and we are working on it, the
> switchdev mode is going to be introduces (not DSA). The switch
> between modes will happen by using devlink option - the approach is
> similar to what was used for Sitara CPSW cpsw_new.c driver [1].

What's unclear from the patches is whether the default configuration
for already supported platforms will change?

All the patches sound like they are "in preparation for support of K3
J721E" etc. So this is just code restructuring with no user-visible
changes?
Jakub Kicinski Oct. 2, 2020, 11:07 p.m. UTC | #4
On Fri, 2 Oct 2020 16:04:21 -0700 Jakub Kicinski wrote:
> On Fri, 2 Oct 2020 12:56:43 +0300 Grygorii Strashko wrote:
> > On 02/10/2020 02:08, Jakub Kicinski wrote:  
> > > On Thu, 1 Oct 2020 13:52:50 +0300 Grygorii Strashko wrote:    
> > >> This series adds multi-port support in mac-only mode (multi MAC mode) to TI
> > >> AM65x CPSW driver in preparation for enabling support for multi-port devices,
> > >> like Main CPSW0 on K3 J721E SoC or future CPSW3g on K3 AM64x SoC.
> > >>
> > >> The multi MAC mode is implemented by configuring every enabled port in "mac-only"
> > >> mode (all ingress packets are sent only to the Host port and egress packets
> > >> directed to target Ext. Port) and creating separate net_device for
> > >> every enabled Ext. port.    
> > > 
> > > Do I get it right that you select the mode based on platform? Can the
> > > other mode still be supported on these platforms?
> > > 
> > > Is this a transition to normal DSA mode where ports always have netdevs?  
> >
> > The idea here is to start in multi mac mode by default, as we still
> > have pretty high demand for this. Then, and we are working on it, the
> > switchdev mode is going to be introduces (not DSA). The switch
> > between modes will happen by using devlink option - the approach is
> > similar to what was used for Sitara CPSW cpsw_new.c driver [1].  
> 
> What's unclear from the patches is whether the default configuration
> for already supported platforms will change?
> 
> All the patches sound like they are "in preparation for support of K3
> J721E" etc. So this is just code restructuring with no user-visible
> changes?

Another way of putting the question perhaps would be - is num_ports
always 1 for existing platforms?
Grygorii Strashko Oct. 5, 2020, 10:16 a.m. UTC | #5
On 03/10/2020 02:07, Jakub Kicinski wrote:
> On Fri, 2 Oct 2020 16:04:21 -0700 Jakub Kicinski wrote:
>> On Fri, 2 Oct 2020 12:56:43 +0300 Grygorii Strashko wrote:
>>> On 02/10/2020 02:08, Jakub Kicinski wrote:
>>>> On Thu, 1 Oct 2020 13:52:50 +0300 Grygorii Strashko wrote:
>>>>> This series adds multi-port support in mac-only mode (multi MAC mode) to TI
>>>>> AM65x CPSW driver in preparation for enabling support for multi-port devices,
>>>>> like Main CPSW0 on K3 J721E SoC or future CPSW3g on K3 AM64x SoC.
>>>>>
>>>>> The multi MAC mode is implemented by configuring every enabled port in "mac-only"
>>>>> mode (all ingress packets are sent only to the Host port and egress packets
>>>>> directed to target Ext. Port) and creating separate net_device for
>>>>> every enabled Ext. port.
>>>>
>>>> Do I get it right that you select the mode based on platform? Can the
>>>> other mode still be supported on these platforms?
>>>>
>>>> Is this a transition to normal DSA mode where ports always have netdevs?
>>>
>>> The idea here is to start in multi mac mode by default, as we still
>>> have pretty high demand for this. Then, and we are working on it, the
>>> switchdev mode is going to be introduces (not DSA). The switch
>>> between modes will happen by using devlink option - the approach is
>>> similar to what was used for Sitara CPSW cpsw_new.c driver [1].
>>
>> What's unclear from the patches is whether the default configuration
>> for already supported platforms will change?
>>
>> All the patches sound like they are "in preparation for support of K3
>> J721E" etc. So this is just code restructuring with no user-visible
>> changes?
> 
> Another way of putting the question perhaps would be - is num_ports
> always 1 for existing platforms?
> 

Yes. Sorry for confusion - all now supported K3 CPSW instances have 1 external port and
these changes should not have affect on them.