Skip to content

Commit 85aabd1

Browse files
CHKDSK88kuba-moo
authored andcommitted
net: dsa: prepare 'dsa_tag_8021q_bridge_join' for standalone use
The 'dsa_tag_8021q_bridge_join' could be used as a generic implementation of the 'ds->ops->port_bridge_join()' function. However, it is necessary to synchronize their arguments. This patch also moves the 'tx_fwd_offload' flag configuration line into 'dsa_tag_8021q_bridge_join' body. Currently, every (sja1105) driver sets it, and the future vsc73xx implementation will also need it for simplification. Suggested-by: Vladimir Oltean <[email protected]> Signed-off-by: Pawel Dembicki <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ce20fdd commit 85aabd1

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

drivers/net/dsa/sja1105/sja1105_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,14 +2133,13 @@ static int sja1105_bridge_join(struct dsa_switch *ds, int port,
21332133
if (rc)
21342134
return rc;
21352135

2136-
rc = dsa_tag_8021q_bridge_join(ds, port, bridge);
2136+
rc = dsa_tag_8021q_bridge_join(ds, port, bridge, tx_fwd_offload,
2137+
extack);
21372138
if (rc) {
21382139
sja1105_bridge_member(ds, port, bridge, false);
21392140
return rc;
21402141
}
21412142

2142-
*tx_fwd_offload = true;
2143-
21442143
return 0;
21452144
}
21462145

include/linux/dsa/8021q.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ int dsa_tag_8021q_register(struct dsa_switch *ds, __be16 proto);
1818
void dsa_tag_8021q_unregister(struct dsa_switch *ds);
1919

2020
int dsa_tag_8021q_bridge_join(struct dsa_switch *ds, int port,
21-
struct dsa_bridge bridge);
21+
struct dsa_bridge bridge, bool *tx_fwd_offload,
22+
struct netlink_ext_ack *extack);
2223

2324
void dsa_tag_8021q_bridge_leave(struct dsa_switch *ds, int port,
2425
struct dsa_bridge bridge);

net/dsa/tag_8021q.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ int dsa_switch_tag_8021q_vlan_del(struct dsa_switch *ds,
286286
* be used for VLAN-unaware bridging.
287287
*/
288288
int dsa_tag_8021q_bridge_join(struct dsa_switch *ds, int port,
289-
struct dsa_bridge bridge)
289+
struct dsa_bridge bridge, bool *tx_fwd_offload,
290+
struct netlink_ext_ack *extack)
290291
{
291292
struct dsa_port *dp = dsa_to_port(ds, port);
292293
u16 standalone_vid, bridge_vid;
@@ -304,6 +305,8 @@ int dsa_tag_8021q_bridge_join(struct dsa_switch *ds, int port,
304305

305306
dsa_port_tag_8021q_vlan_del(dp, standalone_vid, false);
306307

308+
*tx_fwd_offload = true;
309+
307310
return 0;
308311
}
309312
EXPORT_SYMBOL_GPL(dsa_tag_8021q_bridge_join);

0 commit comments

Comments
 (0)