]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/core/dev.c
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mv-sheeva.git] / net / core / dev.c
index 033d7ca28e6ea3a3e81ca656df62c436272bfc95..052dd478d3e112b769b66ab83db5b82996d88061 100644 (file)
 /* This should be increased if a protocol with a bigger head is added. */
 #define GRO_MAX_HEAD (MAX_HEADER + 128)
 
-enum {
-       GRO_MERGED,
-       GRO_MERGED_FREE,
-       GRO_HELD,
-       GRO_NORMAL,
-       GRO_DROP,
-};
-
 /*
  *     The list of packet types we will receive (as opposed to discard)
  *     and the routines to invoke.
@@ -1678,7 +1670,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
        const struct net_device_ops *ops = dev->netdev_ops;
        int rc;
 
-       prefetch(&dev->netdev_ops->ndo_start_xmit);
        if (likely(!skb->next)) {
                if (!list_empty(&ptype_all))
                        dev_queue_xmit_nit(skb, dev);
@@ -1733,7 +1724,7 @@ out_kfree_skb:
 
 static u32 skb_tx_hashrnd;
 
-static u16 skb_tx_hash(struct net_device *dev, struct sk_buff *skb)
+u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb)
 {
        u32 hash;
 
@@ -1748,6 +1739,7 @@ static u16 skb_tx_hash(struct net_device *dev, struct sk_buff *skb)
 
        return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);
 }
+EXPORT_SYMBOL(skb_tx_hash);
 
 static struct netdev_queue *dev_pick_tx(struct net_device *dev,
                                        struct sk_buff *skb)
@@ -2474,6 +2466,9 @@ static int __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
 {
        struct sk_buff *p;
 
+       if (netpoll_rx_on(skb))
+               return GRO_NORMAL;
+
        for (p = napi->gro_list; p; p = p->next) {
                NAPI_GRO_CB(p)->same_flow = !compare_ether_header(
                        skb_mac_header(p), skb_gro_mac_header(skb));
@@ -2487,9 +2482,6 @@ int napi_skb_finish(int ret, struct sk_buff *skb)
 {
        int err = NET_RX_SUCCESS;
 
-       if (netpoll_receive_skb(skb))
-               return NET_RX_DROP;
-
        switch (ret) {
        case GRO_NORMAL:
                return netif_receive_skb(skb);
@@ -2587,9 +2579,6 @@ int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret)
 {
        int err = NET_RX_SUCCESS;
 
-       if (netpoll_receive_skb(skb))
-               return NET_RX_DROP;
-
        switch (ret) {
        case GRO_NORMAL:
        case GRO_HELD:
@@ -2638,9 +2627,9 @@ static int process_backlog(struct napi_struct *napi, int quota)
                local_irq_disable();
                skb = __skb_dequeue(&queue->input_pkt_queue);
                if (!skb) {
-                       __napi_complete(napi);
                        local_irq_enable();
-                       break;
+                       napi_complete(napi);
+                       goto out;
                }
                local_irq_enable();
 
@@ -2649,6 +2638,7 @@ static int process_backlog(struct napi_struct *napi, int quota)
 
        napi_gro_flush(napi);
 
+out:
        return work;
 }
 
@@ -2722,7 +2712,7 @@ void netif_napi_del(struct napi_struct *napi)
        struct sk_buff *skb, *next;
 
        list_del_init(&napi->dev_list);
-       kfree(napi->skb);
+       kfree_skb(napi->skb);
 
        for (skb = napi->gro_list; skb; skb = next) {
                next = skb->next;