Skip to content

Commit

Permalink
net: qualcomm: rmnet: Add support for GRO
Browse files Browse the repository at this point in the history
Add gro_cells so that rmnet devices can call gro_cells_receive
instead of netif_receive_skb.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Subash Abhinov Kasiviswanathan authored and David S. Miller committed Oct 27, 2017
1 parent 192c4b5 commit ca32fb0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/net/ethernet/qualcomm/rmnet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
menuconfig RMNET
tristate "RmNet MAP driver"
default n
select GRO_CELLS
---help---
If you select this, you will enable the RMNET module which is used
for handling data in the multiplexing and aggregation protocol (MAP)
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

#include <linux/skbuff.h>
#include <net/gro_cells.h>

#ifndef _RMNET_CONFIG_H_
#define _RMNET_CONFIG_H_
Expand Down Expand Up @@ -58,6 +59,7 @@ struct rmnet_priv {
u8 mux_id;
struct net_device *real_dev;
struct rmnet_pcpu_stats __percpu *pcpu_stats;
struct gro_cells gro_cells;
};

struct rmnet_port *rmnet_get_port(struct net_device *real_dev);
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ static void rmnet_set_skb_proto(struct sk_buff *skb)
static void
rmnet_deliver_skb(struct sk_buff *skb)
{
struct rmnet_priv *priv = netdev_priv(skb->dev);

skb_reset_transport_header(skb);
skb_reset_network_header(skb);
rmnet_vnd_rx_fixup(skb, skb->dev);

skb->pkt_type = PACKET_HOST;
skb_set_mac_header(skb, 0);
netif_receive_skb(skb);
gro_cells_receive(&priv->gro_cells, skb);
}

/* MAP handler */
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,26 @@ static int rmnet_vnd_get_iflink(const struct net_device *dev)
static int rmnet_vnd_init(struct net_device *dev)
{
struct rmnet_priv *priv = netdev_priv(dev);
int err;

priv->pcpu_stats = alloc_percpu(struct rmnet_pcpu_stats);
if (!priv->pcpu_stats)
return -ENOMEM;

err = gro_cells_init(&priv->gro_cells, dev);
if (err) {
free_percpu(priv->pcpu_stats);
return err;
}

return 0;
}

static void rmnet_vnd_uninit(struct net_device *dev)
{
struct rmnet_priv *priv = netdev_priv(dev);

gro_cells_destroy(&priv->gro_cells);
free_percpu(priv->pcpu_stats);
}

Expand Down

0 comments on commit ca32fb0

Please sign in to comment.