[PATCH net-next 0/6] prestera: add basic router driver support

Yevhen Orlov posted 6 patches 4 years, 6 months ago
There is a newer version of this series
.../net/ethernet/marvell/prestera/Makefile    |   3 +-
.../net/ethernet/marvell/prestera/prestera.h  |  38 ++++
.../ethernet/marvell/prestera/prestera_hw.c   | 139 ++++++++++++
.../ethernet/marvell/prestera/prestera_hw.h   |  11 +
.../ethernet/marvell/prestera/prestera_main.c |   8 +-
.../marvell/prestera/prestera_router.c        | 183 +++++++++++++++
.../marvell/prestera/prestera_router_hw.c     | 209 ++++++++++++++++++
.../marvell/prestera/prestera_router_hw.h     |  36 +++
8 files changed, 625 insertions(+), 2 deletions(-)
create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_router.c
create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_router_hw.c
create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_router_hw.h
[PATCH net-next 0/6] prestera: add basic router driver support
Posted by Yevhen Orlov 4 years, 6 months ago
Add initial router support for Marvell Prestera driver.
Subscribe on inetaddr notifications. TRAP packets, that has to be routed
(if packet has router's destination MAC address).

Add features:
 - Support ip address adding on port.
   e.g.: "ip address add PORT 1.1.1.1/24"

Limitations:
 - Only regular port supported. Vlan will be added soon.
 - It is routing through CPU. Offloading will be added in
   next patches.

Co-developed-by: Taras Chornyi <tchornyi@marvell.com>
Signed-off-by: Taras Chornyi <tchornyi@marvell.com>
Co-developed-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: Yevhen Orlov <yevhen.orlov@plvision.eu>

Yevhen Orlov (6):
  net: marvell: prestera: add virtual router ABI
  net: marvell: prestera: Add router interface ABI
  net: marvell: prestera: Add prestera router infra
  net: marvell: prestera: add hardware router objects accounting
  net: marvell: prestera: Register inetaddr stub notifiers
  net: marvell: prestera: Implement initial inetaddr notifiers

 .../net/ethernet/marvell/prestera/Makefile    |   3 +-
 .../net/ethernet/marvell/prestera/prestera.h  |  38 ++++
 .../ethernet/marvell/prestera/prestera_hw.c   | 139 ++++++++++++
 .../ethernet/marvell/prestera/prestera_hw.h   |  11 +
 .../ethernet/marvell/prestera/prestera_main.c |   8 +-
 .../marvell/prestera/prestera_router.c        | 183 +++++++++++++++
 .../marvell/prestera/prestera_router_hw.c     | 209 ++++++++++++++++++
 .../marvell/prestera/prestera_router_hw.h     |  36 +++
 8 files changed, 625 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_router.c
 create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_router_hw.c
 create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_router_hw.h

-- 
2.17.1

Re: [PATCH net-next 0/6] prestera: add basic router driver support
Posted by Andrew Lunn 4 years, 6 months ago
On Fri, Dec 17, 2021 at 09:54:32PM +0200, Yevhen Orlov wrote:
> Add initial router support for Marvell Prestera driver.
> Subscribe on inetaddr notifications. TRAP packets, that has to be routed
> (if packet has router's destination MAC address).

I must be missing something here. Why do you need to tell it the IP
address in order to perform software routing? All the switch needs to
know is the MAC address. Any packets for that MAC address should be
trapped to the host. The host can then decide what to do with it,
router, bridge, or consume it itself.

> Add features:
>  - Support ip address adding on port.
>    e.g.: "ip address add PORT 1.1.1.1/24"

This should just work already. If it does not, you have something
wrong in your current support.

	Andrew
Re: [PATCH net-next 0/6] prestera: add basic router driver support
Posted by Yevhen Orlov 4 years, 6 months ago
On Sat, Dec 18, 2021 at 05:52:55PM +0100, Andrew Lunn wrote:
> On Fri, Dec 17, 2021 at 09:54:32PM +0200, Yevhen Orlov wrote:
> > Add initial router support for Marvell Prestera driver.
> > Subscribe on inetaddr notifications. TRAP packets, that has to be routed
> > (if packet has router's destination MAC address).
> 
> I must be missing something here. Why do you need to tell it the IP
> address in order to perform software routing? All the switch needs to
> know is the MAC address. Any packets for that MAC address should be
> trapped to the host. The host can then decide what to do with it,
> router, bridge, or consume it itself.

You are right. We don't pass IP address. Subscription is only needed
to enable rif. IP address is not used here.

> 
> > Add features:
> >  - Support ip address adding on port.
> >    e.g.: "ip address add PORT 1.1.1.1/24"
> 
> This should just work already. If it does not, you have something
> wrong in your current support.
> 
> 	Andrew

Yes. For now we has just enabled TRAP's for every port. This is good for
software routing. But in order to implement routes offloading - we need
to control, on which port packets is routed. So, this patchset
prepares infrastructure for future routes offloading implementation.