Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73a7ece8 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller
Browse files

net: dsa: comment hot path requirements



The DSA layer uses inline helpers and copy of the tagging functions for
faster access in hot path. Add comments to detail that.

Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0266f797
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -127,6 +127,8 @@ struct dsa_switch_tree {
	 * protocol to use.
	 * protocol to use.
	 */
	 */
	struct net_device	*master_netdev;
	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 sk_buff *	(*rcv)(struct sk_buff *skb,
				       struct net_device *dev,
				       struct net_device *dev,
				       struct packet_type *pt,
				       struct packet_type *pt,
@@ -465,6 +467,7 @@ struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);


struct net_device *dsa_dev_to_net_device(struct device *dev);
struct net_device *dsa_dev_to_net_device(struct device *dev);


/* Keep inline for faster access in hot path */
static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
{
{
	return dst->rcv != NULL;
	return dst->rcv != NULL;
+1 −0
Original line number Original line Diff line number Diff line
@@ -73,6 +73,7 @@ struct dsa_device_ops {
};
};


struct dsa_slave_priv {
struct dsa_slave_priv {
	/* Copy of dp->ds->dst->tag_ops->xmit for faster access in hot path */
	struct sk_buff *	(*xmit)(struct sk_buff *skb,
	struct sk_buff *	(*xmit)(struct sk_buff *skb,
					struct net_device *dev);
					struct net_device *dev);