Commit 2e8cb1b3 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: dsa: make the .flow_dissect tagger callback return void

There is no tagger that returns anything other than zero, so just change
the return type appropriately.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5124197c
...@@ -74,8 +74,8 @@ struct dsa_device_ops { ...@@ -74,8 +74,8 @@ struct dsa_device_ops {
struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev); struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev);
struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev, struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt); struct packet_type *pt);
int (*flow_dissect)(const struct sk_buff *skb, __be16 *proto, void (*flow_dissect)(const struct sk_buff *skb, __be16 *proto,
int *offset); int *offset);
/* Used to determine which traffic should match the DSA filter in /* Used to determine which traffic should match the DSA filter in
* eth_type_trans, and which, if any, should bypass it and be processed * eth_type_trans, and which, if any, should bypass it and be processed
* as regular on the master net device. * as regular on the master net device.
......
...@@ -932,8 +932,8 @@ bool __skb_flow_dissect(const struct net *net, ...@@ -932,8 +932,8 @@ bool __skb_flow_dissect(const struct net *net,
int offset = 0; int offset = 0;
ops = skb->dev->dsa_ptr->tag_ops; ops = skb->dev->dsa_ptr->tag_ops;
if (ops->flow_dissect && if (ops->flow_dissect) {
!ops->flow_dissect(skb, &proto, &offset)) { ops->flow_dissect(skb, &proto, &offset);
hlen -= offset; hlen -= offset;
nhoff += offset; nhoff += offset;
} }
......
...@@ -150,8 +150,8 @@ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb, ...@@ -150,8 +150,8 @@ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb,
return skb; return skb;
} }
static int brcm_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, static void brcm_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
int *offset) int *offset)
{ {
/* We have been called on the DSA master network device after /* We have been called on the DSA master network device after
* eth_type_trans() which pulled the Ethernet header already. * eth_type_trans() which pulled the Ethernet header already.
...@@ -168,7 +168,6 @@ static int brcm_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, ...@@ -168,7 +168,6 @@ static int brcm_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
*/ */
*offset = BRCM_TAG_LEN; *offset = BRCM_TAG_LEN;
*proto = ((__be16 *)skb->data)[1]; *proto = ((__be16 *)skb->data)[1];
return 0;
} }
#endif #endif
......
...@@ -142,12 +142,11 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -142,12 +142,11 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
return skb; return skb;
} }
static int dsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, static void dsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
int *offset) int *offset)
{ {
*offset = 4; *offset = 4;
*proto = ((__be16 *)skb->data)[1]; *proto = ((__be16 *)skb->data)[1];
return 0;
} }
static const struct dsa_device_ops dsa_netdev_ops = { static const struct dsa_device_ops dsa_netdev_ops = {
......
...@@ -192,12 +192,11 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -192,12 +192,11 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
return skb; return skb;
} }
static int edsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, static void edsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
int *offset) int *offset)
{ {
*offset = 8; *offset = 8;
*proto = ((__be16 *)skb->data)[3]; *proto = ((__be16 *)skb->data)[3];
return 0;
} }
static const struct dsa_device_ops edsa_netdev_ops = { static const struct dsa_device_ops edsa_netdev_ops = {
......
...@@ -105,13 +105,11 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -105,13 +105,11 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
return skb; return skb;
} }
static int mtk_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, static void mtk_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
int *offset) int *offset)
{ {
*offset = 4; *offset = 4;
*proto = ((__be16 *)skb->data)[1]; *proto = ((__be16 *)skb->data)[1];
return 0;
} }
static const struct dsa_device_ops mtk_netdev_ops = { static const struct dsa_device_ops mtk_netdev_ops = {
......
...@@ -89,13 +89,11 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -89,13 +89,11 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
return skb; return skb;
} }
static int qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, static void qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
int *offset) int *offset)
{ {
*offset = QCA_HDR_LEN; *offset = QCA_HDR_LEN;
*proto = ((__be16 *)skb->data)[0]; *proto = ((__be16 *)skb->data)[0];
return 0;
} }
static const struct dsa_device_ops qca_netdev_ops = { static const struct dsa_device_ops qca_netdev_ops = {
......
...@@ -106,14 +106,12 @@ static struct sk_buff *rtl4a_tag_rcv(struct sk_buff *skb, ...@@ -106,14 +106,12 @@ static struct sk_buff *rtl4a_tag_rcv(struct sk_buff *skb,
return skb; return skb;
} }
static int rtl4a_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, static void rtl4a_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
int *offset) int *offset)
{ {
*offset = RTL4_A_HDR_LEN; *offset = RTL4_A_HDR_LEN;
/* Skip past the tag and fetch the encapsulated Ethertype */ /* Skip past the tag and fetch the encapsulated Ethertype */
*proto = ((__be16 *)skb->data)[1]; *proto = ((__be16 *)skb->data)[1];
return 0;
} }
static const struct dsa_device_ops rtl4a_netdev_ops = { static const struct dsa_device_ops rtl4a_netdev_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment