net: Add GRO support for UDP encapsulating protocols
[cascardo/linux.git] / net / core / dev.c
index b2c1869..da92305 100644 (file)
@@ -2083,7 +2083,7 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
 }
 EXPORT_SYMBOL(netif_set_real_num_tx_queues);
 
-#ifdef CONFIG_RPS
+#ifdef CONFIG_SYSFS
 /**
  *     netif_set_real_num_rx_queues - set actual number of RX queues used
  *     @dev: Network device
@@ -2778,8 +2778,9 @@ int dev_loopback_xmit(struct sk_buff *skb)
 EXPORT_SYMBOL(dev_loopback_xmit);
 
 /**
- *     dev_queue_xmit - transmit a buffer
+ *     __dev_queue_xmit - transmit a buffer
  *     @skb: buffer to transmit
+ *     @accel_priv: private data used for L2 forwarding offload
  *
  *     Queue a buffer for transmission to a network device. The caller must
  *     have set the device and priority and built the buffer before calling
@@ -3892,6 +3893,7 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
                NAPI_GRO_CB(skb)->same_flow = 0;
                NAPI_GRO_CB(skb)->flush = 0;
                NAPI_GRO_CB(skb)->free = 0;
+               NAPI_GRO_CB(skb)->udp_mark = 0;
 
                pp = ptype->callbacks.gro_receive(&napi->gro_list, skb);
                break;
@@ -5392,6 +5394,11 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
        if (!netif_device_present(dev))
                return -ENODEV;
 
+       err = call_netdevice_notifiers(NETDEV_PRECHANGEMTU, dev);
+       err = notifier_to_errno(err);
+       if (err)
+               return err;
+
        orig_mtu = dev->mtu;
        err = __dev_set_mtu(dev, new_mtu);
 
@@ -5759,7 +5766,7 @@ void netif_stacked_transfer_operstate(const struct net_device *rootdev,
 }
 EXPORT_SYMBOL(netif_stacked_transfer_operstate);
 
-#ifdef CONFIG_RPS
+#ifdef CONFIG_SYSFS
 static int netif_alloc_rx_queues(struct net_device *dev)
 {
        unsigned int i, count = dev->num_rx_queues;
@@ -6304,7 +6311,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
                return NULL;
        }
 
-#ifdef CONFIG_RPS
+#ifdef CONFIG_SYSFS
        if (rxqs < 1) {
                pr_err("alloc_netdev: Unable to allocate device with zero RX queues\n");
                return NULL;
@@ -6360,7 +6367,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
        if (netif_alloc_netdev_queues(dev))
                goto free_all;
 
-#ifdef CONFIG_RPS
+#ifdef CONFIG_SYSFS
        dev->num_rx_queues = rxqs;
        dev->real_num_rx_queues = rxqs;
        if (netif_alloc_rx_queues(dev))
@@ -6380,7 +6387,7 @@ free_all:
 free_pcpu:
        free_percpu(dev->pcpu_refcnt);
        netif_free_tx_queues(dev);
-#ifdef CONFIG_RPS
+#ifdef CONFIG_SYSFS
        kfree(dev->_rx);
 #endif
 
@@ -6405,7 +6412,7 @@ void free_netdev(struct net_device *dev)
        release_net(dev_net(dev));
 
        netif_free_tx_queues(dev);
-#ifdef CONFIG_RPS
+#ifdef CONFIG_SYSFS
        kfree(dev->_rx);
 #endif
 
@@ -6992,28 +6999,18 @@ static int __init net_dev_init(void)
        for_each_possible_cpu(i) {
                struct softnet_data *sd = &per_cpu(softnet_data, i);
 
-               memset(sd, 0, sizeof(*sd));
                skb_queue_head_init(&sd->input_pkt_queue);
                skb_queue_head_init(&sd->process_queue);
-               sd->completion_queue = NULL;
                INIT_LIST_HEAD(&sd->poll_list);
-               sd->output_queue = NULL;
                sd->output_queue_tailp = &sd->output_queue;
 #ifdef CONFIG_RPS
                sd->csd.func = rps_trigger_softirq;
                sd->csd.info = sd;
-               sd->csd.flags = 0;
                sd->cpu = i;
 #endif
 
                sd->backlog.poll = process_backlog;
                sd->backlog.weight = weight_p;
-               sd->backlog.gro_list = NULL;
-               sd->backlog.gro_count = 0;
-
-#ifdef CONFIG_NET_FLOW_LIMIT
-               sd->flow_limit = NULL;
-#endif
        }
 
        dev_boot_phase = 0;