2021-01-23 16:26:31

by Horatiu Vultur

[permalink] [raw]
Subject: [PATCH net-next 0/4] bridge: mrp: Extend br_mrp_switchdev_*

This patch series extends MRP switchdev to allow the SW to have a better
understanding if the HW can implment the MRP functionality or it needs to
help the HW to run it. There are 3 cases:
- when HW can't implement at all the functionality.
- when HW can implement a part of the functionality but needs the SW
implement the rest. For example if it can't detect when it stops
receiving MRP Test frames but it can copy the MRP frames to CPU to
allow the SW to determin this. Another example is generating the MRP
Test frames. If HW can't do that then the SW is used as backup.
- when HW can implement completely the functionality.

So, initially the SW tries to offload the entire functionality in HW, if
that fails it tries offload parts of the functionality in HW and use the
SW as helper and if also this fails then MRP can't run on this HW.

Horatiu Vultur (4):
switchdev: mrp: Extend ring_role_mrp and in_role_mrp
bridge: mrp: Add 'enum br_mrp_hw_support'
bridge: mrp: Extend br_mrp_switchdev to detect better the errors
bridge: mrp: Update br_mrp to use new return values of
br_mrp_switchdev

include/net/switchdev.h | 2 +
net/bridge/br_mrp.c | 43 +++++---
net/bridge/br_mrp_switchdev.c | 189 +++++++++++++++++++++++++---------
net/bridge/br_private_mrp.h | 38 +++++--
4 files changed, 195 insertions(+), 77 deletions(-)

--
2.27.0


2021-01-23 16:27:35

by Horatiu Vultur

[permalink] [raw]
Subject: [PATCH net-next 1/4] switchdev: mrp: Extend ring_role_mrp and in_role_mrp

Add the member sw_backup to the structures switchdev_obj_ring_role_mrp
and switchdev_obj_in_role_mrp. In this way the SW can call the driver in
2 ways, once when sw_backup is set to false, meaning that the driver
should implement this completely in HW. And if that is not supported the
SW will call again but with sw_backup set to true, meaning that the
HW should help or allow the SW to run the protocol.

For example when role is MRM, if the HW can't detect when it stops
receiving MRP Test frames but it can trap these frames to CPU, then it
needs to return -EOPNOTSUPP when sw_backup is false and return 0 when
sw_backup is true.

Signed-off-by: Horatiu Vultur <[email protected]>
---
include/net/switchdev.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 88fcac140966..3f236eaa4f3e 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -132,6 +132,7 @@ struct switchdev_obj_ring_role_mrp {
struct switchdev_obj obj;
u8 ring_role;
u32 ring_id;
+ u8 sw_backup;
};

#define SWITCHDEV_OBJ_RING_ROLE_MRP(OBJ) \
@@ -166,6 +167,7 @@ struct switchdev_obj_in_role_mrp {
u32 ring_id;
u16 in_id;
u8 in_role;
+ u8 sw_backup;
};

#define SWITCHDEV_OBJ_IN_ROLE_MRP(OBJ) \
--
2.27.0