aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2018-12-06 05:36:04 -0500
committerDavid S. Miller <davem@davemloft.net>2018-12-06 15:18:16 -0500
commita5dd308778a4e05e7b0b927cf18b89d1ebbff59c (patch)
tree719e191c23600a465a6281f0ee79dcc23bfa78d4 /net/dsa
parent5c327f673d2f134ac01c068b511c6ab816b4b41c (diff)
net: dsa: Add overhead to tag protocol ops.
Each DSA tag protocol needs to add additional headers to the Ethernet frame in order to direct it towards a specific switch egress port. It must also remove the head from a frame received from a switch. Indicate the maximum size of these headers in the tag protocol ops structure, so the core can take these overheads into account. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/tag_brcm.c2
-rw-r--r--net/dsa/tag_dsa.c1
-rw-r--r--net/dsa/tag_edsa.c1
-rw-r--r--net/dsa/tag_gswip.c1
-rw-r--r--net/dsa/tag_ksz.c1
-rw-r--r--net/dsa/tag_lan9303.c1
-rw-r--r--net/dsa/tag_mtk.c1
-rw-r--r--net/dsa/tag_qca.c1
-rw-r--r--net/dsa/tag_trailer.c1
9 files changed, 10 insertions, 0 deletions
diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c
index 2b06bb91318b..4aa1d368a5ae 100644
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -174,6 +174,7 @@ static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
174const struct dsa_device_ops brcm_netdev_ops = { 174const struct dsa_device_ops brcm_netdev_ops = {
175 .xmit = brcm_tag_xmit, 175 .xmit = brcm_tag_xmit,
176 .rcv = brcm_tag_rcv, 176 .rcv = brcm_tag_rcv,
177 .overhead = BRCM_TAG_LEN,
177}; 178};
178#endif 179#endif
179 180
@@ -196,5 +197,6 @@ static struct sk_buff *brcm_tag_rcv_prepend(struct sk_buff *skb,
196const struct dsa_device_ops brcm_prepend_netdev_ops = { 197const struct dsa_device_ops brcm_prepend_netdev_ops = {
197 .xmit = brcm_tag_xmit_prepend, 198 .xmit = brcm_tag_xmit_prepend,
198 .rcv = brcm_tag_rcv_prepend, 199 .rcv = brcm_tag_rcv_prepend,
200 .overhead = BRCM_TAG_LEN,
199}; 201};
200#endif 202#endif
diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c
index cd13cfc542ce..8b2f92e3f3a2 100644
--- a/net/dsa/tag_dsa.c
+++ b/net/dsa/tag_dsa.c
@@ -149,4 +149,5 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
149const struct dsa_device_ops dsa_netdev_ops = { 149const struct dsa_device_ops dsa_netdev_ops = {
150 .xmit = dsa_xmit, 150 .xmit = dsa_xmit,
151 .rcv = dsa_rcv, 151 .rcv = dsa_rcv,
152 .overhead = DSA_HLEN,
152}; 153};
diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
index 4083326b806e..f5b87ee5c94e 100644
--- a/net/dsa/tag_edsa.c
+++ b/net/dsa/tag_edsa.c
@@ -168,4 +168,5 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
168const struct dsa_device_ops edsa_netdev_ops = { 168const struct dsa_device_ops edsa_netdev_ops = {
169 .xmit = edsa_xmit, 169 .xmit = edsa_xmit,
170 .rcv = edsa_rcv, 170 .rcv = edsa_rcv,
171 .overhead = EDSA_HLEN,
171}; 172};
diff --git a/net/dsa/tag_gswip.c b/net/dsa/tag_gswip.c
index 49e9b73f1be3..cb6f82ffe5eb 100644
--- a/net/dsa/tag_gswip.c
+++ b/net/dsa/tag_gswip.c
@@ -106,4 +106,5 @@ static struct sk_buff *gswip_tag_rcv(struct sk_buff *skb,
106const struct dsa_device_ops gswip_netdev_ops = { 106const struct dsa_device_ops gswip_netdev_ops = {
107 .xmit = gswip_tag_xmit, 107 .xmit = gswip_tag_xmit,
108 .rcv = gswip_tag_rcv, 108 .rcv = gswip_tag_rcv,
109 .overhead = GSWIP_RX_HEADER_LEN,
109}; 110};
diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c
index 0f62effad88f..96411f70ab9f 100644
--- a/net/dsa/tag_ksz.c
+++ b/net/dsa/tag_ksz.c
@@ -99,4 +99,5 @@ static struct sk_buff *ksz_rcv(struct sk_buff *skb, struct net_device *dev,
99const struct dsa_device_ops ksz_netdev_ops = { 99const struct dsa_device_ops ksz_netdev_ops = {
100 .xmit = ksz_xmit, 100 .xmit = ksz_xmit,
101 .rcv = ksz_rcv, 101 .rcv = ksz_rcv,
102 .overhead = KSZ_INGRESS_TAG_LEN,
102}; 103};
diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c
index 548c00254c07..f48889e46ff7 100644
--- a/net/dsa/tag_lan9303.c
+++ b/net/dsa/tag_lan9303.c
@@ -140,4 +140,5 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
140const struct dsa_device_ops lan9303_netdev_ops = { 140const struct dsa_device_ops lan9303_netdev_ops = {
141 .xmit = lan9303_xmit, 141 .xmit = lan9303_xmit,
142 .rcv = lan9303_rcv, 142 .rcv = lan9303_rcv,
143 .overhead = LAN9303_TAG_LEN,
143}; 144};
diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
index 11535bc70743..f39f4dfeda34 100644
--- a/net/dsa/tag_mtk.c
+++ b/net/dsa/tag_mtk.c
@@ -109,4 +109,5 @@ const struct dsa_device_ops mtk_netdev_ops = {
109 .xmit = mtk_tag_xmit, 109 .xmit = mtk_tag_xmit,
110 .rcv = mtk_tag_rcv, 110 .rcv = mtk_tag_rcv,
111 .flow_dissect = mtk_tag_flow_dissect, 111 .flow_dissect = mtk_tag_flow_dissect,
112 .overhead = MTK_HDR_LEN,
112}; 113};
diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index 613f4ee97771..ed4f6dc26365 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -101,4 +101,5 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
101const struct dsa_device_ops qca_netdev_ops = { 101const struct dsa_device_ops qca_netdev_ops = {
102 .xmit = qca_tag_xmit, 102 .xmit = qca_tag_xmit,
103 .rcv = qca_tag_rcv, 103 .rcv = qca_tag_rcv,
104 .overhead = QCA_HDR_LEN,
104}; 105};
diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c
index 56197f0d9608..b40756ed6e57 100644
--- a/net/dsa/tag_trailer.c
+++ b/net/dsa/tag_trailer.c
@@ -84,4 +84,5 @@ static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev,
84const struct dsa_device_ops trailer_netdev_ops = { 84const struct dsa_device_ops trailer_netdev_ops = {
85 .xmit = trailer_xmit, 85 .xmit = trailer_xmit,
86 .rcv = trailer_rcv, 86 .rcv = trailer_rcv,
87 .overhead = 4,
87}; 88};