提交 ca32fb03 编写于 作者: S Subash Abhinov Kasiviswanathan 提交者: David S. Miller

net: qualcomm: rmnet: Add support for GRO

Add gro_cells so that rmnet devices can call gro_cells_receive
instead of netif_receive_skb.
Signed-off-by: NSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 192c4b5d
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
menuconfig RMNET menuconfig RMNET
tristate "RmNet MAP driver" tristate "RmNet MAP driver"
default n default n
select GRO_CELLS
---help--- ---help---
If you select this, you will enable the RMNET module which is used If you select this, you will enable the RMNET module which is used
for handling data in the multiplexing and aggregation protocol (MAP) for handling data in the multiplexing and aggregation protocol (MAP)
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <net/gro_cells.h>
#ifndef _RMNET_CONFIG_H_ #ifndef _RMNET_CONFIG_H_
#define _RMNET_CONFIG_H_ #define _RMNET_CONFIG_H_
...@@ -58,6 +59,7 @@ struct rmnet_priv { ...@@ -58,6 +59,7 @@ struct rmnet_priv {
u8 mux_id; u8 mux_id;
struct net_device *real_dev; struct net_device *real_dev;
struct rmnet_pcpu_stats __percpu *pcpu_stats; struct rmnet_pcpu_stats __percpu *pcpu_stats;
struct gro_cells gro_cells;
}; };
struct rmnet_port *rmnet_get_port(struct net_device *real_dev); struct rmnet_port *rmnet_get_port(struct net_device *real_dev);
......
...@@ -46,13 +46,15 @@ static void rmnet_set_skb_proto(struct sk_buff *skb) ...@@ -46,13 +46,15 @@ static void rmnet_set_skb_proto(struct sk_buff *skb)
static void static void
rmnet_deliver_skb(struct sk_buff *skb) rmnet_deliver_skb(struct sk_buff *skb)
{ {
struct rmnet_priv *priv = netdev_priv(skb->dev);
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
skb_reset_network_header(skb); skb_reset_network_header(skb);
rmnet_vnd_rx_fixup(skb, skb->dev); rmnet_vnd_rx_fixup(skb, skb->dev);
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
skb_set_mac_header(skb, 0); skb_set_mac_header(skb, 0);
netif_receive_skb(skb); gro_cells_receive(&priv->gro_cells, skb);
} }
/* MAP handler */ /* MAP handler */
......
...@@ -87,11 +87,18 @@ static int rmnet_vnd_get_iflink(const struct net_device *dev) ...@@ -87,11 +87,18 @@ static int rmnet_vnd_get_iflink(const struct net_device *dev)
static int rmnet_vnd_init(struct net_device *dev) static int rmnet_vnd_init(struct net_device *dev)
{ {
struct rmnet_priv *priv = netdev_priv(dev); struct rmnet_priv *priv = netdev_priv(dev);
int err;
priv->pcpu_stats = alloc_percpu(struct rmnet_pcpu_stats); priv->pcpu_stats = alloc_percpu(struct rmnet_pcpu_stats);
if (!priv->pcpu_stats) if (!priv->pcpu_stats)
return -ENOMEM; return -ENOMEM;
err = gro_cells_init(&priv->gro_cells, dev);
if (err) {
free_percpu(priv->pcpu_stats);
return err;
}
return 0; return 0;
} }
...@@ -99,6 +106,7 @@ static void rmnet_vnd_uninit(struct net_device *dev) ...@@ -99,6 +106,7 @@ static void rmnet_vnd_uninit(struct net_device *dev)
{ {
struct rmnet_priv *priv = netdev_priv(dev); struct rmnet_priv *priv = netdev_priv(dev);
gro_cells_destroy(&priv->gro_cells);
free_percpu(priv->pcpu_stats); free_percpu(priv->pcpu_stats);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册