Thread (12 messages) flat view 12 messages, 4 authors, 2021-01-26

Re: [RFC PATCH net-next 2/3] net: hsr: add DSA offloading support

From: Vladimir Oltean <olteanv@gmail.com>
Date: 2021-01-24 17:30:25

On Fri, Jan 22, 2021 at 09:59:47AM -0600, George McCollister wrote:
quoted hunk ↗ jump to hunk
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index f2fb433f3828..fc7e3ff11c5c 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1924,6 +1924,19 @@ static int dsa_slave_changeupper(struct net_device *dev,
 			dsa_port_lag_leave(dp, info->upper_dev);
 			err = NOTIFY_OK;
 		}
+	} else if (netif_is_hsr_master(info->upper_dev)) {
+		if (info->linking) {
+			err = dsa_port_hsr_join(dp, info->upper_dev);
+			if (err == -EOPNOTSUPP) {
+				NL_SET_ERR_MSG_MOD(info->info.extack,
+						   "Offloading not supported");
+				err = 0;
+			}
+			err = notifier_from_errno(err);
+		} else {
+			dsa_port_hsr_leave(dp, info->upper_dev);
+			err = NOTIFY_OK;
+		}
 	}
How is the RedBox use case handled with the Linux hsr driver (i.e. a
HSR-unaware SAN endpoint attached to a HSR ring)? I would expect
something like this:

                   +---------+
                   |         |
                   |   SAN   |
                   |         |
                   +---------+
                        |
                        |
                        |
 +-----------------+---------+------------------+
 |                 |         |                  |
 |  Your           |   swp0  |                  |
 |  board          |         |                  |
 |                 +---------+                  |
 |                    |   ^                     |
 |                    |   |                     |
 |                    |   | br0                 |
 |                    |   |                     |
 |                    v   |                     |
 |       +-----------------------------+        |
 |       |                             |        |
 |       |             hsr0            |        |
 |       |                             |        |
 |       +---------+---------+---------+        |
 |       |         |         |         |        |
 |       |   swp1  |  DAN-H  |  swp2   |        |
 |       |         |         |         |        |
 +-------+---------+---------+---------+--------+
            |   ^               |   ^
    to/from |   |               |   | to/from
     ring   |   |               |   |  ring
            v   |               v   |

Therefore, aren't you interested in offloading this setup as well?
I.e. the case where the hsr0 interface joins a bridge that also
contains other DSA switch ports. This would be similar to the LAG
offload recently added by Tobias.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help