diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-09-29 23:19:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-01 05:15:07 +0200 |
commit | 3e41f93b358a8800194b87995ad076fc50919719 (patch) | |
tree | e52fda006ba52faba0bed468dbc275799b1d30cb /net/dsa/dsa2.c | |
parent | net: dsa: add tagging ops to port (diff) | |
download | linux-3e41f93b358a8800194b87995ad076fc50919719.tar.xz linux-3e41f93b358a8800194b87995ad076fc50919719.zip |
net: dsa: prepare master receive hot path
In preparation to make DSA master devices point to their corresponding
CPU port instead of the whole tree, add copies of dst and rcv in the
dsa_port structure so that we keep fast access in the receive hot path.
Also keep the copies at the beginning of the dsa_port structure in order
to ensure they are available in cacheline 1.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r-- | net/dsa/dsa2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index 9eac4726dc0c..b71e3bb478e4 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -524,7 +524,11 @@ static int dsa_cpu_parse(struct dsa_port *port, u32 index, dst->cpu_dp->tag_ops = tag_ops; dst->tag_ops = tag_ops; + + /* Make a few copies for faster access in master receive hot path */ + dst->cpu_dp->rcv = dst->cpu_dp->tag_ops->rcv; dst->rcv = dst->tag_ops->rcv; + dst->cpu_dp->dst = dst; return 0; } |