History

net: dsa: eliminate dsa_switch_ops :: port_bridge_tx_fwd_{,un}offload

We don't really need new switch API for these, and with new switches which intend to add support for this feature, it will become cumbersome to maintain. The change consists in restructuring the two drivers that implement this offload (sja1105 and mv88e6xxx) such that the offload is enabled and disabled from the ->port_bridge_{join,leave} methods instead of the old ->port_bridge_tx_fwd_{,un}offload. The only non-trivial change is that mv88e6xxx_map_virtual_bridge_to_pvt() has been moved to avoid a forward declaration, and the mv88e6xxx_reg_lock() calls from inside it have been removed, since locking is now done from mv88e6xxx_port_bridge_{join,leave}.

Vladimir Oltean committed 4 years ago

Commit 857fdd71 parent b0799224 files · +45 −83Browse files

Showing the changes to include (1 of 4 files). Show all

Unified · Split

include/net/dsa.h+1−6
@@ -222,6 +222,7 @@ struct dsa_mall_tc_entry { · 221 unmodified lines
222struct dsa_bridge {222struct dsa_bridge {
223 struct net_device *dev;223 struct net_device *dev;
224 unsigned int num;224 unsigned int num;
225 bool tx_fwd_offload;
225 refcount_t refcount;226 refcount_t refcount;
226};227};
227 228
@@ -826,12 +827,6 @@ struct dsa_switch_ops { · 598 unmodified lines
826 bool *tx_fwd_offload);827 bool *tx_fwd_offload);
827 void (*port_bridge_leave)(struct dsa_switch *ds, int port,828 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
828 struct dsa_bridge bridge);829 struct dsa_bridge bridge);
829 /* Called right after .port_bridge_join() */
830 int (*port_bridge_tx_fwd_offload)(struct dsa_switch *ds, int port,
831 struct dsa_bridge bridge);
832 /* Called right before .port_bridge_leave() */
833 void (*port_bridge_tx_fwd_unoffload)(struct dsa_switch *ds, int port,
834 struct dsa_bridge bridge);
835 void (*port_stp_state_set)(struct dsa_switch *ds, int port,830 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
836 u8 state);831 u8 state);
837 void (*port_fast_age)(struct dsa_switch *ds, int port);832 void (*port_fast_age)(struct dsa_switch *ds, int port);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t