summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-06-01 17:34:57 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-01 17:34:57 -0400
commit0c34ca478ad5fa3a0abae5eae288afea422ddde5 (patch)
treea45ba1a54b080a3a71e4650f03d57ac3de3767e8 /include
parent0266f79778de0afadd070941aae493c28529d974 (diff)
parentfe47d563065c91cd30088d9b118b79d44905be6f (diff)
Merge branch 'dsa-tagger-simplification'
Vivien Didelot says: ==================== net: dsa: tagger simplification This series clarifies the hot path, removes the labels in tagging implementations, and frees the original SKB in the xmit caller. Changes in v3: - drop removal of usused rcv arguments because they will be used later - include the new ksz tagging implementation - add reviewers' tags Changes in v2: - do not remove tagger function copies - document hot path requirements - make netdev_uses_dsa simpler - add reviewers' tags ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/dsa.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 7de1234ba136..448d8bc77707 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -127,6 +127,8 @@ struct dsa_switch_tree {
* protocol to use.
*/
struct net_device *master_netdev;
+
+ /* Copy of tag_ops->rcv for faster access in hot path */
struct sk_buff * (*rcv)(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt,
@@ -465,16 +467,11 @@ struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
struct net_device *dsa_dev_to_net_device(struct device *dev);
-static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
-{
- return dst->rcv != NULL;
-}
-
+/* Keep inline for faster access in hot path */
static inline bool netdev_uses_dsa(struct net_device *dev)
{
#if IS_ENABLED(CONFIG_NET_DSA)
- if (dev->dsa_ptr != NULL)
- return dsa_uses_tagged_protocol(dev->dsa_ptr);
+ return dev->dsa_ptr && dev->dsa_ptr->rcv;
#endif
return false;
}