dsa: remove unused net_device arg from handlers
Subsystems (8)
PATCH 1/1 dsa: remove unused net_device arg from handlers
compile tested only, but saw no warnings/errors with allmodconfig build.
--- include/net/dsa.h | 6 ++---- net/dsa/dsa.c | 4 ++-- net/dsa/tag_brcm.c | 3 +-- net/dsa/tag_dsa.c | 3 +-- net/dsa/tag_edsa.c | 3 +-- net/dsa/tag_ksz.c | 3 +-- net/dsa/tag_lan9303.c | 2 +- net/dsa/tag_mtk.c | 3 +-- net/dsa/tag_qca.c | 3 +-- net/dsa/tag_trailer.c | 3 +-- 10 files changed, 12 insertions(+), 21 deletions(-)
include/net/dsa.h +2 -4
@@ -104,8 +104,7 @@ struct packet_type;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, -struct net_device *orig_dev); +struct packet_type *pt);int (*flow_dissect)(const struct sk_buff *skb,__be16 *proto,int *offset); };
@@ -134,8 +133,7 @@ struct dsa_switch_tree {/* Copy of tag_ops->rcv for faster access in hot path */ struct sk_buff * (*rcv)(struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt, -struct net_device *orig_dev); +struct packet_type *pt);/* * The switch port to which the CPU is attached.
net/dsa/dsa.c +2 -2
@@ -186,7 +186,7 @@ struct net_device *dsa_dev_to_net_device(struct device *dev)EXPORT_SYMBOL_GPL (dsa_dev_to_net_device);static int dsa_switch_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt,struct net_device *orig_dev) +struct packet_type *pt,struct net_device *unused) {struct dsa_switch_tree *dst = dev->dsa_ptr;struct sk_buff *nskb =NULL ;
@@ -202,7 +202,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,if (!skb)return 0 ; - nskb = dst->rcv (skb, dev, pt, orig_dev); + nskb = dst->rcv (skb, dev, pt);if (!nskb) {kfree_skb (skb);return 0 ;
net/dsa/tag_brcm.c +1 -2
@@ -89,8 +89,7 @@ static struct sk_buff *brcm_tag_xmit(struct sk_buff *skb, struct net_device *dev }static struct sk_buff *brcm_tag_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt, -struct net_device *orig_dev) +struct packet_type *pt) {struct dsa_switch_tree *dst = dev->dsa_ptr;struct dsa_port *cpu_dp =dsa_get_cpu_port (dst);
net/dsa/tag_dsa.c +1 -2
@@ -65,8 +65,7 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev) }static struct sk_buff *dsa_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt, -struct net_device *orig_dev) +struct packet_type *pt) {struct dsa_switch_tree *dst = dev->dsa_ptr;struct dsa_switch *ds;
net/dsa/tag_edsa.c +1 -2
@@ -78,8 +78,7 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev) }static struct sk_buff *edsa_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt, -struct net_device *orig_dev) +struct packet_type *pt) {struct dsa_switch_tree *dst = dev->dsa_ptr;struct dsa_switch *ds;
net/dsa/tag_ksz.c +1 -2
@@ -76,8 +76,7 @@ static struct sk_buff *ksz_xmit(struct sk_buff *skb, struct net_device *dev) }static struct sk_buff *ksz_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt, -struct net_device *orig_dev) +struct packet_type *pt) {struct dsa_switch_tree *dst = dev->dsa_ptr;struct dsa_port *cpu_dp =dsa_get_cpu_port (dst);
net/dsa/tag_lan9303.c +1 -1
@@ -68,7 +68,7 @@ static struct sk_buff *lan9303_xmit(struct sk_buff *skb, struct net_device *dev) }static struct sk_buff *lan9303_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt,struct net_device *orig_dev) +struct packet_type *pt) {u16 *lan9303_tag;struct dsa_switch_tree *dst = dev->dsa_ptr;
net/dsa/tag_mtk.c +1 -2
@@ -44,8 +44,7 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb, }static struct sk_buff *mtk_tag_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt, -struct net_device *orig_dev) +struct packet_type *pt) {struct dsa_switch_tree *dst = dev->dsa_ptr;struct dsa_switch *ds;
net/dsa/tag_qca.c +1 -2
@@ -63,8 +63,7 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev) }static struct sk_buff *qca_tag_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt, -struct net_device *orig_dev) +struct packet_type *pt) {struct dsa_switch_tree *dst = dev->dsa_ptr;struct dsa_port *cpu_dp =dsa_get_cpu_port (dst);
net/dsa/tag_trailer.c +1 -2
@@ -56,8 +56,7 @@ static struct sk_buff *trailer_xmit(struct sk_buff *skb, struct net_device *dev) }static struct sk_buff *trailer_rcv (struct sk_buff *skb,struct net_device *dev, -struct packet_type *pt, -struct net_device *orig_dev) +struct packet_type *pt) {struct dsa_switch_tree *dst = dev->dsa_ptr;struct dsa_port *cpu_dp =dsa_get_cpu_port (dst);
Signature · 1 line
2.13.0
Andrew Lunn
maintainernet/dsa/dsa.c struct net_device *dsa_dev_to_net_device(struct device *dev) · line 189
Quoted 6 lines · Florian Westphal
compile tested only, but saw no warnings/errors with allmodconfig build.
static int dsa_switch_rcv(struct
sk_buff*skb, structnet_device*dev,net/dsa/dsa.c +1
-1- struct packet_type *pt, struct net_device *orig_dev) + struct packet_type *pt, struct net_device *unused)
Hi Florian
Looks O.K. to me. I can test it out later.
Is there a bigger picture here? Do you plan to remove the second net_device parameter everywhere?
Andrew
Quoted 10 lines · Andrew Lunn
net/dsa/dsa.c struct net_device *dsa_dev_to_net_device(struct device *dev) · line 189
Quoted 6 lines · Florian Westphal
compile tested only, but saw no warnings/errors with allmodconfig build.
static int dsa_switch_rcv(struct
sk_buff*skb, structnet_device*dev,net/dsa/dsa.c +1
-1- struct packet_type *pt, struct net_device *orig_dev) + struct packet_type *pt, struct net_device *unused)Hi Florian
Quoted 4 lines
Looks O.K. to me. I can test it out later.
Is there a bigger picture here? Do you plan to remove the second
net_deviceparameter everywhere?
Its tempting, seems only af_packet uses it. I'll see if there is another (simpler) way of getting the orig ifindex into af_packet.
Quoted 11 lines · Florian Westphal
Quoted 10 lines · Andrew Lunn
net/dsa/dsa.c struct net_device *dsa_dev_to_net_device(struct device *dev) · line 189
Quoted 6 lines · Florian Westphal
compile tested only, but saw no warnings/errors with allmodconfig build.
static int dsa_switch_rcv(struct
sk_buff*skb, structnet_device*dev,net/dsa/dsa.c +1
-1- struct packet_type *pt, struct net_device *orig_dev) + struct packet_type *pt, struct net_device *unused)Hi Florian
Quoted 8 lines
Quoted 4 lines
Looks O.K. to me. I can test it out later.
Is there a bigger picture here? Do you plan to remove the second
net_deviceparameter everywhere?Its tempting, seems only
af_packetuses it. I'll see if there is another (simpler) way of getting the orig ifindex intoaf_packet.
FWIW, I still have some changes queued locally that make use of orig_dev to support the switch tag HW insertion/extraction, but I think "dev" here is equally suitable since it still points to the DSA master network device.
Signature · 1 line
Florian
David Miller
maintainerFrom: Florian Westphal <[email protected]>
Date: Thu, 17 Aug 2017 16:47:00 +0200
Quoted 4 lines
compile tested only, but saw no warnings/errors with allmodconfig build.
Signed-off-by Florian Westphal <[email protected]>
I'll apply this for now.
Andrew says it looks OK, and if Florian F. needs it for his tag changes we can revert.