Skip to content

Commit

Permalink
net: dsa: remove the struct packet_type argument from dsa_device_ops:…
Browse files Browse the repository at this point in the history
…:rcv()

No tagging driver uses this.

Signed-off-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vladimiroltean authored and davem330 committed Aug 2, 2021
1 parent 35d7a6f commit 29a097b
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 49 deletions.
7 changes: 2 additions & 5 deletions include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ enum dsa_tag_protocol {
DSA_TAG_PROTO_SJA1110 = DSA_TAG_PROTO_SJA1110_VALUE,
};

struct packet_type;
struct dsa_switch;

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 sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev);
void (*flow_dissect)(const struct sk_buff *skb, __be16 *proto,
int *offset);
unsigned int needed_headroom;
Expand Down Expand Up @@ -239,8 +237,7 @@ struct dsa_port {

/* Copies for faster access in master receive hot path */
struct dsa_switch_tree *dst;
struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt);
struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev);

enum {
DSA_PORT_TYPE_UNUSED = 0,
Expand Down
2 changes: 1 addition & 1 deletion net/dsa/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
if (!skb)
return 0;

nskb = cpu_dp->rcv(skb, dev, pt);
nskb = cpu_dp->rcv(skb, dev);
if (!nskb) {
kfree_skb(skb);
return 0;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_ar9331.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff *skb,
}

static struct sk_buff *ar9331_tag_rcv(struct sk_buff *skb,
struct net_device *ndev,
struct packet_type *pt)
struct net_device *ndev)
{
u8 ver, port;
u16 hdr;
Expand Down
14 changes: 5 additions & 9 deletions net/dsa/tag_brcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *skb,
*/
static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt,
unsigned int offset)
{
int source_port;
Expand Down Expand Up @@ -182,13 +181,12 @@ static struct sk_buff *brcm_tag_xmit(struct sk_buff *skb,
}


static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev)
{
struct sk_buff *nskb;

/* skb->data points to the EtherType, the tag is right before it */
nskb = brcm_tag_rcv_ll(skb, dev, pt, 2);
nskb = brcm_tag_rcv_ll(skb, dev, 2);
if (!nskb)
return nskb;

Expand Down Expand Up @@ -251,8 +249,7 @@ static struct sk_buff *brcm_leg_tag_xmit(struct sk_buff *skb,
}

static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt)
struct net_device *dev)
{
int source_port;
u8 *brcm_tag;
Expand Down Expand Up @@ -302,11 +299,10 @@ static struct sk_buff *brcm_tag_xmit_prepend(struct sk_buff *skb,
}

static struct sk_buff *brcm_tag_rcv_prepend(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt)
struct net_device *dev)
{
/* tag is prepended to the packet */
return brcm_tag_rcv_ll(skb, dev, pt, ETH_HLEN);
return brcm_tag_rcv_ll(skb, dev, ETH_HLEN);
}

static const struct dsa_device_ops brcm_prepend_netdev_ops = {
Expand Down
6 changes: 2 additions & 4 deletions net/dsa/tag_dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev)
return dsa_xmit_ll(skb, dev, 0);
}

static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev)
{
if (unlikely(!pskb_may_pull(skb, DSA_HLEN)))
return NULL;
Expand Down Expand Up @@ -373,8 +372,7 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev)
return skb;
}

static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev)
{
if (unlikely(!pskb_may_pull(skb, EDSA_HLEN)))
return NULL;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_gswip.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ static struct sk_buff *gswip_tag_xmit(struct sk_buff *skb,
}

static struct sk_buff *gswip_tag_rcv(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt)
struct net_device *dev)
{
int port;
u8 *gswip_tag;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_hellcreek.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ static struct sk_buff *hellcreek_xmit(struct sk_buff *skb,
}

static struct sk_buff *hellcreek_rcv(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt)
struct net_device *dev)
{
/* Tag decoding */
u8 *tag = skb_tail_pointer(skb) - HELLCREEK_TAG_LEN;
Expand Down
6 changes: 2 additions & 4 deletions net/dsa/tag_ksz.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ static struct sk_buff *ksz8795_xmit(struct sk_buff *skb, struct net_device *dev)
return skb;
}

static struct sk_buff *ksz8795_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *ksz8795_rcv(struct sk_buff *skb, struct net_device *dev)
{
u8 *tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;

Expand Down Expand Up @@ -134,8 +133,7 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb,
return skb;
}

static struct sk_buff *ksz9477_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *ksz9477_rcv(struct sk_buff *skb, struct net_device *dev)
{
/* Tag decoding */
u8 *tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_lan9303.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ static struct sk_buff *lan9303_xmit(struct sk_buff *skb, struct net_device *dev)
return skb;
}

static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev)
{
__be16 *lan9303_tag;
u16 lan9303_tag1;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_mtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
return skb;
}

static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev)
{
u16 hdr;
int port;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_ocelot.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ static struct sk_buff *seville_xmit(struct sk_buff *skb,
}

static struct sk_buff *ocelot_rcv(struct sk_buff *skb,
struct net_device *netdev,
struct packet_type *pt)
struct net_device *netdev)
{
u64 src_port, qos_class;
u64 vlan_tci, tag_type;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_ocelot_8021q.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ static struct sk_buff *ocelot_xmit(struct sk_buff *skb,
}

static struct sk_buff *ocelot_rcv(struct sk_buff *skb,
struct net_device *netdev,
struct packet_type *pt)
struct net_device *netdev)
{
int src_port, switch_id;

Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_qca.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
return skb;
}

static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev)
{
u8 ver;
u16 hdr;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_rtl4_a.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb,
}

static struct sk_buff *rtl4a_tag_rcv(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt)
struct net_device *dev)
{
u16 protport;
__be16 *p;
Expand Down
6 changes: 2 additions & 4 deletions net/dsa/tag_sja1105.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ static void sja1105_vlan_rcv(struct sk_buff *skb, int *source_port,
}

static struct sk_buff *sja1105_rcv(struct sk_buff *skb,
struct net_device *netdev,
struct packet_type *pt)
struct net_device *netdev)
{
int source_port = -1, switch_id = -1;
struct sja1105_meta meta = {0};
Expand Down Expand Up @@ -546,8 +545,7 @@ static struct sk_buff *sja1110_rcv_inband_control_extension(struct sk_buff *skb,
}

static struct sk_buff *sja1110_rcv(struct sk_buff *skb,
struct net_device *netdev,
struct packet_type *pt)
struct net_device *netdev)
{
int source_port = -1, switch_id = -1;
bool host_only = false;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_trailer.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ static struct sk_buff *trailer_xmit(struct sk_buff *skb, struct net_device *dev)
return skb;
}

static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev)
{
u8 *trailer;
int source_port;
Expand Down
3 changes: 1 addition & 2 deletions net/dsa/tag_xrs700x.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ static struct sk_buff *xrs700x_xmit(struct sk_buff *skb, struct net_device *dev)
return skb;
}

static struct sk_buff *xrs700x_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
static struct sk_buff *xrs700x_rcv(struct sk_buff *skb, struct net_device *dev)
{
int source_port;
u8 *trailer;
Expand Down

0 comments on commit 29a097b

Please sign in to comment.