]> www.infradead.org Git - users/willy/linux.git/commitdiff
net: dsa: make the .flow_dissect tagger callback return void
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 26 Sep 2020 19:32:05 +0000 (22:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Sep 2020 21:17:59 +0000 (14:17 -0700)
There is no tagger that returns anything other than zero, so just change
the return type appropriately.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h
net/core/flow_dissector.c
net/dsa/tag_brcm.c
net/dsa/tag_dsa.c
net/dsa/tag_edsa.c
net/dsa/tag_mtk.c
net/dsa/tag_qca.c
net/dsa/tag_rtl4_a.c

index 46019edc32cb969cfcdedfb60ec1d8bef773151d..98d339311898b8658e3f78dac6bce9a97ac66b26 100644 (file)
@@ -74,8 +74,8 @@ struct dsa_device_ops {
        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 packet_type *pt);
-       int (*flow_dissect)(const struct sk_buff *skb, __be16 *proto,
-                           int *offset);
+       void (*flow_dissect)(const struct sk_buff *skb, __be16 *proto,
+                            int *offset);
        /* Used to determine which traffic should match the DSA filter in
         * eth_type_trans, and which, if any, should bypass it and be processed
         * as regular on the master net device.
index 29806eb765cf1a815b50296cbcb8e793b48777c0..13cc4c0a8863269e17a74c3c2709796b0d6a6721 100644 (file)
@@ -932,8 +932,8 @@ bool __skb_flow_dissect(const struct net *net,
                        int offset = 0;
 
                        ops = skb->dev->dsa_ptr->tag_ops;
-                       if (ops->flow_dissect &&
-                           !ops->flow_dissect(skb, &proto, &offset)) {
+                       if (ops->flow_dissect) {
+                               ops->flow_dissect(skb, &proto, &offset);
                                hlen -= offset;
                                nhoff += offset;
                        }
index 1dab212a294fa87af5762333cda7e804b067f78f..610bc746966718f4aa5c07d9a04d3a57e6fa16d6 100644 (file)
@@ -150,8 +150,8 @@ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb,
        return skb;
 }
 
-static int brcm_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
-                                int *offset)
+static void brcm_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+                                 int *offset)
 {
        /* We have been called on the DSA master network device after
         * 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,
         */
        *offset = BRCM_TAG_LEN;
        *proto = ((__be16 *)skb->data)[1];
-       return 0;
 }
 #endif
 
index 7ddec9794477c1f0798ea58bf85740843bf3d960..ef15aee58dfcef6b233fc4903fb1b7260cc36ff6 100644 (file)
@@ -142,12 +142,11 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
        return skb;
 }
 
-static int dsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
-                               int *offset)
+static void dsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+                                int *offset)
 {
        *offset = 4;
        *proto = ((__be16 *)skb->data)[1];
-       return 0;
 }
 
 static const struct dsa_device_ops dsa_netdev_ops = {
index d6200ff98200733943363091d69b800d63c8c4e9..275e7d931b1abe01891a4a6b573f30ebcb8d105a 100644 (file)
@@ -192,12 +192,11 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
        return skb;
 }
 
-static int edsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
-                                int *offset)
+static void edsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+                                 int *offset)
 {
        *offset = 8;
        *proto = ((__be16 *)skb->data)[3];
-       return 0;
 }
 
 static const struct dsa_device_ops edsa_netdev_ops = {
index f602fc758d68dbd685c31e900bb745029d40abcc..2aba17b43e69ee08f819be8a4e561713c9b81734 100644 (file)
@@ -105,13 +105,11 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
        return skb;
 }
 
-static int mtk_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
-                               int *offset)
+static void mtk_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+                                int *offset)
 {
        *offset = 4;
        *proto = ((__be16 *)skb->data)[1];
-
-       return 0;
 }
 
 static const struct dsa_device_ops mtk_netdev_ops = {
index 7066f5e697d7fccdc768c56f94dc21896d3d1cd4..a75c6b20c2153583968b9c1a705df67a5b950e27 100644 (file)
@@ -89,13 +89,11 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
        return skb;
 }
 
-static int qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
-                                int *offset)
+static void qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+                                int *offset)
 {
        *offset = QCA_HDR_LEN;
        *proto = ((__be16 *)skb->data)[0];
-
-       return 0;
 }
 
 static const struct dsa_device_ops qca_netdev_ops = {
index 7b63010fa87ba4afdfd2616399bd23e08f0f1513..868980ba1fcd977f889c6889c1576a14929d3383 100644 (file)
@@ -106,14 +106,12 @@ static struct sk_buff *rtl4a_tag_rcv(struct sk_buff *skb,
        return skb;
 }
 
-static int rtl4a_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
-                                 int *offset)
+static void rtl4a_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+                                  int *offset)
 {
        *offset = RTL4_A_HDR_LEN;
        /* Skip past the tag and fetch the encapsulated Ethertype */
        *proto = ((__be16 *)skb->data)[1];
-
-       return 0;
 }
 
 static const struct dsa_device_ops rtl4a_netdev_ops = {