diff options
118 files changed, 623 insertions, 453 deletions
diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt index c9074f9b78bb..1a77a3cfae54 100644 --- a/Documentation/networking/operstates.txt +++ b/Documentation/networking/operstates.txt | |||
@@ -38,9 +38,6 @@ ifinfomsg::if_flags & IFF_LOWER_UP: | |||
38 | ifinfomsg::if_flags & IFF_DORMANT: | 38 | ifinfomsg::if_flags & IFF_DORMANT: |
39 | Driver has signaled netif_dormant_on() | 39 | Driver has signaled netif_dormant_on() |
40 | 40 | ||
41 | These interface flags can also be queried without netlink using the | ||
42 | SIOCGIFFLAGS ioctl. | ||
43 | |||
44 | TLV IFLA_OPERSTATE | 41 | TLV IFLA_OPERSTATE |
45 | 42 | ||
46 | contains RFC2863 state of the interface in numeric representation: | 43 | contains RFC2863 state of the interface in numeric representation: |
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index cb8943da4f12..34d54e7281fd 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -1069,7 +1069,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb) | |||
1069 | lp = isdn_net_get_locked_lp(nd); | 1069 | lp = isdn_net_get_locked_lp(nd); |
1070 | if (!lp) { | 1070 | if (!lp) { |
1071 | printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name); | 1071 | printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name); |
1072 | return 1; | 1072 | return NETDEV_TX_BUSY; |
1073 | } | 1073 | } |
1074 | /* we have our lp locked from now on */ | 1074 | /* we have our lp locked from now on */ |
1075 | 1075 | ||
@@ -1273,14 +1273,14 @@ isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
1273 | spin_unlock_irqrestore(&dev->lock, flags); | 1273 | spin_unlock_irqrestore(&dev->lock, flags); |
1274 | isdn_net_dial(); /* Initiate dialing */ | 1274 | isdn_net_dial(); /* Initiate dialing */ |
1275 | netif_stop_queue(ndev); | 1275 | netif_stop_queue(ndev); |
1276 | return 1; /* let upper layer requeue skb packet */ | 1276 | return NETDEV_TX_BUSY; /* let upper layer requeue skb packet */ |
1277 | } | 1277 | } |
1278 | #endif | 1278 | #endif |
1279 | /* Initiate dialing */ | 1279 | /* Initiate dialing */ |
1280 | spin_unlock_irqrestore(&dev->lock, flags); | 1280 | spin_unlock_irqrestore(&dev->lock, flags); |
1281 | isdn_net_dial(); | 1281 | isdn_net_dial(); |
1282 | isdn_net_device_stop_queue(lp); | 1282 | isdn_net_device_stop_queue(lp); |
1283 | return 1; | 1283 | return NETDEV_TX_BUSY; |
1284 | } else { | 1284 | } else { |
1285 | isdn_net_unreachable(ndev, skb, | 1285 | isdn_net_unreachable(ndev, skb, |
1286 | "No phone number"); | 1286 | "No phone number"); |
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index c2804f26cb44..a9e48e28b1dc 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c | |||
@@ -703,7 +703,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev) | |||
703 | 703 | ||
704 | printk (KERN_ERR "%s: no tx context available: %u\n", | 704 | printk (KERN_ERR "%s: no tx context available: %u\n", |
705 | __func__, priv->mpt_txfidx_tail); | 705 | __func__, priv->mpt_txfidx_tail); |
706 | return 1; | 706 | return NETDEV_TX_BUSY; |
707 | } | 707 | } |
708 | 708 | ||
709 | mf = mpt_get_msg_frame(LanCtx, mpt_dev); | 709 | mf = mpt_get_msg_frame(LanCtx, mpt_dev); |
@@ -713,7 +713,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev) | |||
713 | 713 | ||
714 | printk (KERN_ERR "%s: Unable to alloc request frame\n", | 714 | printk (KERN_ERR "%s: Unable to alloc request frame\n", |
715 | __func__); | 715 | __func__); |
716 | return 1; | 716 | return NETDEV_TX_BUSY; |
717 | } | 717 | } |
718 | 718 | ||
719 | ctx = priv->mpt_txfidx[priv->mpt_txfidx_tail--]; | 719 | ctx = priv->mpt_txfidx[priv->mpt_txfidx_tail--]; |
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index 6faefcffcb53..8d1c60a3f0df 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c | |||
@@ -450,7 +450,8 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
450 | "packet\n", sizeof(struct xpnet_pending_msg)); | 450 | "packet\n", sizeof(struct xpnet_pending_msg)); |
451 | 451 | ||
452 | dev->stats.tx_errors++; | 452 | dev->stats.tx_errors++; |
453 | return -ENOMEM; | 453 | dev_kfree_skb(skb); |
454 | return NETDEV_TX_OK; | ||
454 | } | 455 | } |
455 | 456 | ||
456 | /* get the beginning of the first cacheline and end of last */ | 457 | /* get the beginning of the first cacheline and end of last */ |
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c index b28499459cd6..f71b35402755 100644 --- a/drivers/net/3c505.c +++ b/drivers/net/3c505.c | |||
@@ -1088,7 +1088,7 @@ static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1088 | pr_debug("%s: failed to transmit packet\n", dev->name); | 1088 | pr_debug("%s: failed to transmit packet\n", dev->name); |
1089 | } | 1089 | } |
1090 | spin_unlock_irqrestore(&adapter->lock, flags); | 1090 | spin_unlock_irqrestore(&adapter->lock, flags); |
1091 | return 1; | 1091 | return NETDEV_TX_BUSY; |
1092 | } | 1092 | } |
1093 | if (elp_debug >= 3) | 1093 | if (elp_debug >= 3) |
1094 | pr_debug("%s: packet of length %d sent\n", dev->name, (int) skb->len); | 1094 | pr_debug("%s: packet of length %d sent\n", dev->name, (int) skb->len); |
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index 7fd0ff743757..3e00fa8ea65f 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c | |||
@@ -1014,7 +1014,7 @@ static int corkscrew_start_xmit(struct sk_buff *skb, | |||
1014 | int i; | 1014 | int i; |
1015 | 1015 | ||
1016 | if (vp->tx_full) /* No room to transmit with */ | 1016 | if (vp->tx_full) /* No room to transmit with */ |
1017 | return 1; | 1017 | return NETDEV_TX_BUSY; |
1018 | if (vp->cur_tx != 0) | 1018 | if (vp->cur_tx != 0) |
1019 | prev_entry = &vp->tx_ring[(vp->cur_tx - 1) % TX_RING_SIZE]; | 1019 | prev_entry = &vp->tx_ring[(vp->cur_tx - 1) % TX_RING_SIZE]; |
1020 | else | 1020 | else |
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index c10ca30458f6..aaa8a9f405d4 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c | |||
@@ -1030,7 +1030,7 @@ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1030 | netif_stop_queue(dev); | 1030 | netif_stop_queue(dev); |
1031 | 1031 | ||
1032 | if(atomic_read(&lp->tx_count)==0) { | 1032 | if(atomic_read(&lp->tx_count)==0) { |
1033 | return 1; | 1033 | return NETDEV_TX_BUSY; |
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | if (skb_padto(skb, ETH_ZLEN)) { | 1036 | if (skb_padto(skb, ETH_ZLEN)) { |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index a6e8a2da3bcd..c34aee91250b 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -2107,7 +2107,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2107 | pr_warning("%s: BUG! Tx Ring full, refusing to send buffer.\n", | 2107 | pr_warning("%s: BUG! Tx Ring full, refusing to send buffer.\n", |
2108 | dev->name); | 2108 | dev->name); |
2109 | netif_stop_queue(dev); | 2109 | netif_stop_queue(dev); |
2110 | return 1; | 2110 | return NETDEV_TX_BUSY; |
2111 | } | 2111 | } |
2112 | 2112 | ||
2113 | vp->tx_skbuff[entry] = skb; | 2113 | vp->tx_skbuff[entry] = skb; |
diff --git a/drivers/net/7990.c b/drivers/net/7990.c index 7a331acc34ad..69f5b7d298a6 100644 --- a/drivers/net/7990.c +++ b/drivers/net/7990.c | |||
@@ -541,7 +541,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
541 | unsigned long flags; | 541 | unsigned long flags; |
542 | 542 | ||
543 | if (!TX_BUFFS_AVAIL) | 543 | if (!TX_BUFFS_AVAIL) |
544 | return -1; | 544 | return NETDEV_TX_LOCKED; |
545 | 545 | ||
546 | netif_stop_queue (dev); | 546 | netif_stop_queue (dev); |
547 | 547 | ||
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index c9fc0ff14a4d..50efde11ea6c 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -756,7 +756,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
756 | spin_unlock_irqrestore(&cp->lock, intr_flags); | 756 | spin_unlock_irqrestore(&cp->lock, intr_flags); |
757 | pr_err(PFX "%s: BUG! Tx Ring full when queue awake!\n", | 757 | pr_err(PFX "%s: BUG! Tx Ring full when queue awake!\n", |
758 | dev->name); | 758 | dev->name); |
759 | return 1; | 759 | return NETDEV_TX_BUSY; |
760 | } | 760 | } |
761 | 761 | ||
762 | #if CP_VLAN_TAG_USED | 762 | #if CP_VLAN_TAG_USED |
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index 02f64d578641..85a18175730b 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
@@ -564,7 +564,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
564 | 564 | ||
565 | if (!TX_BUFFS_AVAIL){ | 565 | if (!TX_BUFFS_AVAIL){ |
566 | local_irq_restore(flags); | 566 | local_irq_restore(flags); |
567 | return -1; | 567 | return NETDEV_TX_LOCKED; |
568 | } | 568 | } |
569 | 569 | ||
570 | #ifdef DEBUG_DRIVER | 570 | #ifdef DEBUG_DRIVER |
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 7f4bc8ae5462..2e7419a61191 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -829,7 +829,7 @@ static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
829 | dev->trans_start = jiffies; | 829 | dev->trans_start = jiffies; |
830 | } else { | 830 | } else { |
831 | printk(KERN_ERR "at91_ether.c: at91ether_start_xmit() called, but device is busy!\n"); | 831 | printk(KERN_ERR "at91_ether.c: at91ether_start_xmit() called, but device is busy!\n"); |
832 | return 1; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb) | 832 | return NETDEV_TX_BUSY; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb) |
833 | on this skb, he also reports -ENETDOWN and printk's, so either | 833 | on this skb, he also reports -ENETDOWN and printk's, so either |
834 | we free and return(0) or don't free and return 1 */ | 834 | we free and return(0) or don't free and return 1 */ |
835 | } | 835 | } |
diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c index ec8a1ae1e887..455037134aa3 100644 --- a/drivers/net/arm/ether3.c +++ b/drivers/net/arm/ether3.c | |||
@@ -526,7 +526,7 @@ ether3_sendpacket(struct sk_buff *skb, struct net_device *dev) | |||
526 | 526 | ||
527 | if (priv(dev)->tx_tail == next_ptr) { | 527 | if (priv(dev)->tx_tail == next_ptr) { |
528 | local_irq_restore(flags); | 528 | local_irq_restore(flags); |
529 | return 1; /* unable to queue */ | 529 | return NETDEV_TX_BUSY; /* unable to queue */ |
530 | } | 530 | } |
531 | 531 | ||
532 | dev->trans_start = jiffies; | 532 | dev->trans_start = jiffies; |
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index d58c105fc779..d3c734f4d679 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -957,7 +957,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev) | |||
957 | /* We've wrapped around and the transmitter is still busy */ | 957 | /* We've wrapped around and the transmitter is still busy */ |
958 | netif_stop_queue(dev); | 958 | netif_stop_queue(dev); |
959 | aup->tx_full = 1; | 959 | aup->tx_full = 1; |
960 | return 1; | 960 | return NETDEV_TX_BUSY; |
961 | } | 961 | } |
962 | else if (buff_stat & TX_T_DONE) { | 962 | else if (buff_stat & TX_T_DONE) { |
963 | update_tx_stats(dev, ptxd->status); | 963 | update_tx_stats(dev, ptxd->status); |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index f5222764061c..eb066673c2a0 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -2934,7 +2934,7 @@ static int cas_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2934 | * individual queues. | 2934 | * individual queues. |
2935 | */ | 2935 | */ |
2936 | if (cas_xmit_tx_ringN(cp, ring++ & N_TX_RINGS_MASK, skb)) | 2936 | if (cas_xmit_tx_ringN(cp, ring++ & N_TX_RINGS_MASK, skb)) |
2937 | return 1; | 2937 | return NETDEV_TX_BUSY; |
2938 | dev->trans_start = jiffies; | 2938 | dev->trans_start = jiffies; |
2939 | return 0; | 2939 | return 0; |
2940 | } | 2940 | } |
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 7433b88eed7e..3eee666a9cd2 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c | |||
@@ -1551,7 +1551,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1551 | 1551 | ||
1552 | spin_unlock_irq(&lp->lock); | 1552 | spin_unlock_irq(&lp->lock); |
1553 | if (net_debug) printk("cs89x0: Tx buffer not free!\n"); | 1553 | if (net_debug) printk("cs89x0: Tx buffer not free!\n"); |
1554 | return 1; | 1554 | return NETDEV_TX_BUSY; |
1555 | } | 1555 | } |
1556 | /* Write the contents of the packet */ | 1556 | /* Write the contents of the packet */ |
1557 | writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1); | 1557 | writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1); |
diff --git a/drivers/net/de600.c b/drivers/net/de600.c index c866ca99a068..e1af089064bc 100644 --- a/drivers/net/de600.c +++ b/drivers/net/de600.c | |||
@@ -168,14 +168,14 @@ static int de600_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
168 | if (free_tx_pages <= 0) { /* Do timeouts, to avoid hangs. */ | 168 | if (free_tx_pages <= 0) { /* Do timeouts, to avoid hangs. */ |
169 | tickssofar = jiffies - dev->trans_start; | 169 | tickssofar = jiffies - dev->trans_start; |
170 | if (tickssofar < 5) | 170 | if (tickssofar < 5) |
171 | return 1; | 171 | return NETDEV_TX_BUSY; |
172 | /* else */ | 172 | /* else */ |
173 | printk(KERN_WARNING "%s: transmit timed out (%d), %s?\n", dev->name, tickssofar, "network cable problem"); | 173 | printk(KERN_WARNING "%s: transmit timed out (%d), %s?\n", dev->name, tickssofar, "network cable problem"); |
174 | /* Restart the adapter. */ | 174 | /* Restart the adapter. */ |
175 | spin_lock_irqsave(&de600_lock, flags); | 175 | spin_lock_irqsave(&de600_lock, flags); |
176 | if (adapter_init(dev)) { | 176 | if (adapter_init(dev)) { |
177 | spin_unlock_irqrestore(&de600_lock, flags); | 177 | spin_unlock_irqrestore(&de600_lock, flags); |
178 | return 1; | 178 | return NETDEV_TX_BUSY; |
179 | } | 179 | } |
180 | spin_unlock_irqrestore(&de600_lock, flags); | 180 | spin_unlock_irqrestore(&de600_lock, flags); |
181 | } | 181 | } |
@@ -199,7 +199,7 @@ static int de600_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
199 | if (was_down || (de600_read_byte(READ_DATA, dev) != 0xde)) { | 199 | if (was_down || (de600_read_byte(READ_DATA, dev) != 0xde)) { |
200 | if (adapter_init(dev)) { | 200 | if (adapter_init(dev)) { |
201 | spin_unlock_irqrestore(&de600_lock, flags); | 201 | spin_unlock_irqrestore(&de600_lock, flags); |
202 | return 1; | 202 | return NETDEV_TX_BUSY; |
203 | } | 203 | } |
204 | } | 204 | } |
205 | } | 205 | } |
diff --git a/drivers/net/de620.c b/drivers/net/de620.c index 039bc1acadd3..55d2bb67cffa 100644 --- a/drivers/net/de620.c +++ b/drivers/net/de620.c | |||
@@ -531,7 +531,7 @@ static int de620_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
531 | case (TXBF0 | TXBF1): /* NONE!!! */ | 531 | case (TXBF0 | TXBF1): /* NONE!!! */ |
532 | printk(KERN_WARNING "%s: No tx-buffer available!\n", dev->name); | 532 | printk(KERN_WARNING "%s: No tx-buffer available!\n", dev->name); |
533 | spin_unlock_irqrestore(&de620_lock, flags); | 533 | spin_unlock_irqrestore(&de620_lock, flags); |
534 | return 1; | 534 | return NETDEV_TX_BUSY; |
535 | } | 535 | } |
536 | de620_write_block(dev, buffer, skb->len, len-skb->len); | 536 | de620_write_block(dev, buffer, skb->len, len-skb->len); |
537 | 537 | ||
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c index 4ec055dc7174..102b8d439714 100644 --- a/drivers/net/defxx.c +++ b/drivers/net/defxx.c | |||
@@ -3318,7 +3318,7 @@ static int dfx_xmt_queue_pkt( | |||
3318 | { | 3318 | { |
3319 | skb_pull(skb,3); | 3319 | skb_pull(skb,3); |
3320 | spin_unlock_irqrestore(&bp->lock, flags); | 3320 | spin_unlock_irqrestore(&bp->lock, flags); |
3321 | return(1); /* requeue packet for later */ | 3321 | return NETDEV_TX_BUSY; /* requeue packet for later */ |
3322 | } | 3322 | } |
3323 | 3323 | ||
3324 | /* | 3324 | /* |
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 9301eb28d9e2..97ea2d6d3fe1 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
@@ -957,7 +957,7 @@ static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
957 | if (TX_BUFFS_AVAIL) | 957 | if (TX_BUFFS_AVAIL) |
958 | netif_start_queue(dev); | 958 | netif_start_queue(dev); |
959 | } else | 959 | } else |
960 | status = -1; | 960 | status = NETDEV_TX_LOCKED; |
961 | 961 | ||
962 | out: | 962 | out: |
963 | return status; | 963 | return status; |
@@ -1839,7 +1839,7 @@ static int load_packet(struct net_device *dev, struct sk_buff *skb) | |||
1839 | 1839 | ||
1840 | lp->tx_new = (++end) & lp->txRingMask; /* update current pointers */ | 1840 | lp->tx_new = (++end) & lp->txRingMask; /* update current pointers */ |
1841 | } else { | 1841 | } else { |
1842 | status = -1; | 1842 | status = NETDEV_TX_LOCKED; |
1843 | } | 1843 | } |
1844 | 1844 | ||
1845 | return status; | 1845 | return status; |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index e402e91bf188..dd771dea6ae6 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -756,7 +756,7 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
756 | dm9000_dbg(db, 3, "%s:\n", __func__); | 756 | dm9000_dbg(db, 3, "%s:\n", __func__); |
757 | 757 | ||
758 | if (db->tx_pkt_cnt > 1) | 758 | if (db->tx_pkt_cnt > 1) |
759 | return 1; | 759 | return NETDEV_TX_BUSY; |
760 | 760 | ||
761 | spin_lock_irqsave(&db->lock, flags); | 761 | spin_lock_irqsave(&db->lock, flags); |
762 | 762 | ||
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 119dc5300f9d..e52a2018e91e 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -1716,7 +1716,7 @@ static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1716 | /* This is a hard error - log it. */ | 1716 | /* This is a hard error - log it. */ |
1717 | DPRINTK(TX_ERR, DEBUG, "Out of Tx resources, returning skb\n"); | 1717 | DPRINTK(TX_ERR, DEBUG, "Out of Tx resources, returning skb\n"); |
1718 | netif_stop_queue(netdev); | 1718 | netif_stop_queue(netdev); |
1719 | return 1; | 1719 | return NETDEV_TX_BUSY; |
1720 | } | 1720 | } |
1721 | 1721 | ||
1722 | netdev->trans_start = jiffies; | 1722 | netdev->trans_start = jiffies; |
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 91a9b1a33764..ceb6a9c357ad 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c | |||
@@ -811,7 +811,7 @@ static int ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
811 | 811 | ||
812 | if (unlikely(skb->len > ETHOC_BUFSIZ)) { | 812 | if (unlikely(skb->len > ETHOC_BUFSIZ)) { |
813 | priv->stats.tx_errors++; | 813 | priv->stats.tx_errors++; |
814 | return -EMSGSIZE; | 814 | goto out; |
815 | } | 815 | } |
816 | 816 | ||
817 | entry = priv->cur_tx % priv->num_tx; | 817 | entry = priv->cur_tx % priv->num_tx; |
@@ -840,9 +840,9 @@ static int ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
840 | } | 840 | } |
841 | 841 | ||
842 | dev->trans_start = jiffies; | 842 | dev->trans_start = jiffies; |
843 | dev_kfree_skb(skb); | ||
844 | |||
845 | spin_unlock_irq(&priv->lock); | 843 | spin_unlock_irq(&priv->lock); |
844 | out: | ||
845 | dev_kfree_skb(skb); | ||
846 | return NETDEV_TX_OK; | 846 | return NETDEV_TX_OK; |
847 | } | 847 | } |
848 | 848 | ||
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c index 1a685a04d4b2..1e9723281405 100644 --- a/drivers/net/ewrk3.c +++ b/drivers/net/ewrk3.c | |||
@@ -873,7 +873,7 @@ static int ewrk3_queue_pkt (struct sk_buff *skb, struct net_device *dev) | |||
873 | err_out: | 873 | err_out: |
874 | ENABLE_IRQs; | 874 | ENABLE_IRQs; |
875 | spin_unlock_irq (&lp->hw_lock); | 875 | spin_unlock_irq (&lp->hw_lock); |
876 | return 1; | 876 | return NETDEV_TX_BUSY; |
877 | } | 877 | } |
878 | 878 | ||
879 | /* | 879 | /* |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 28db6919c526..0f19b743749b 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -290,7 +290,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
290 | 290 | ||
291 | if (!fep->link) { | 291 | if (!fep->link) { |
292 | /* Link is down or autonegotiation is in progress. */ | 292 | /* Link is down or autonegotiation is in progress. */ |
293 | return 1; | 293 | return NETDEV_TX_BUSY; |
294 | } | 294 | } |
295 | 295 | ||
296 | spin_lock_irqsave(&fep->hw_lock, flags); | 296 | spin_lock_irqsave(&fep->hw_lock, flags); |
@@ -305,7 +305,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
305 | */ | 305 | */ |
306 | printk("%s: tx queue full!.\n", dev->name); | 306 | printk("%s: tx queue full!.\n", dev->name); |
307 | spin_unlock_irqrestore(&fep->hw_lock, flags); | 307 | spin_unlock_irqrestore(&fep->hw_lock, flags); |
308 | return 1; | 308 | return NETDEV_TX_BUSY; |
309 | } | 309 | } |
310 | 310 | ||
311 | /* Clear all of the status flags */ | 311 | /* Clear all of the status flags */ |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 26151fa35df5..9d5b62cb30f7 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -1280,7 +1280,7 @@ static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1280 | status=readw(hmp->base + TxStatus); | 1280 | status=readw(hmp->base + TxStatus); |
1281 | if( !(status & 0x0001) || (status & 0x0002)) | 1281 | if( !(status & 0x0001) || (status & 0x0002)) |
1282 | writew(0x0001, hmp->base + TxCmd); | 1282 | writew(0x0001, hmp->base + TxCmd); |
1283 | return 1; | 1283 | return NETDEV_TX_BUSY; |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | /* Caution: the write order is important here, set the field | 1286 | /* Caution: the write order is important here, set the field |
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index bb78c11559cd..5e4b7afd0683 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
@@ -777,7 +777,7 @@ static int baycom_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
777 | return 0; | 777 | return 0; |
778 | } | 778 | } |
779 | if (bc->skb) | 779 | if (bc->skb) |
780 | return -1; | 780 | return NETDEV_TX_LOCKED; |
781 | /* strip KISS byte */ | 781 | /* strip KISS byte */ |
782 | if (skb->len >= HDLCDRV_MAXFLEN+1 || skb->len < 3) { | 782 | if (skb->len >= HDLCDRV_MAXFLEN+1 || skb->len < 3) { |
783 | dev_kfree_skb(skb); | 783 | dev_kfree_skb(skb); |
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index d509b371a562..5105548ad50c 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -274,7 +274,7 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
274 | if ((newskb = skb_realloc_headroom(skb, AX25_BPQ_HEADER_LEN)) == NULL) { | 274 | if ((newskb = skb_realloc_headroom(skb, AX25_BPQ_HEADER_LEN)) == NULL) { |
275 | printk(KERN_WARNING "bpqether: out of memory\n"); | 275 | printk(KERN_WARNING "bpqether: out of memory\n"); |
276 | kfree_skb(skb); | 276 | kfree_skb(skb); |
277 | return -ENOMEM; | 277 | return NETDEV_TX_OK; |
278 | } | 278 | } |
279 | 279 | ||
280 | if (skb->sk != NULL) | 280 | if (skb->sk != NULL) |
@@ -294,7 +294,7 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
294 | if ((dev = bpq_get_ether_dev(dev)) == NULL) { | 294 | if ((dev = bpq_get_ether_dev(dev)) == NULL) { |
295 | dev->stats.tx_dropped++; | 295 | dev->stats.tx_dropped++; |
296 | kfree_skb(skb); | 296 | kfree_skb(skb); |
297 | return -ENODEV; | 297 | return NETDEV_TX_OK; |
298 | } | 298 | } |
299 | 299 | ||
300 | skb->protocol = ax25_type_trans(skb, dev); | 300 | skb->protocol = ax25_type_trans(skb, dev); |
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index 61de56e45eed..d034f8ca63cb 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -409,7 +409,7 @@ static int hdlcdrv_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
409 | return 0; | 409 | return 0; |
410 | } | 410 | } |
411 | if (sm->skb) | 411 | if (sm->skb) |
412 | return -1; | 412 | return NETDEV_TX_LOCKED; |
413 | netif_stop_queue(dev); | 413 | netif_stop_queue(dev); |
414 | sm->skb = skb; | 414 | sm->skb = skb; |
415 | return 0; | 415 | return 0; |
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 032c0db4c410..fda2fc83e9a1 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -531,7 +531,7 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev) | |||
531 | 531 | ||
532 | if (!netif_running(dev)) { | 532 | if (!netif_running(dev)) { |
533 | printk(KERN_ERR "mkiss: %s: xmit call when iface is down\n", dev->name); | 533 | printk(KERN_ERR "mkiss: %s: xmit call when iface is down\n", dev->name); |
534 | return 1; | 534 | return NETDEV_TX_BUSY; |
535 | } | 535 | } |
536 | 536 | ||
537 | if (netif_queue_stopped(dev)) { | 537 | if (netif_queue_stopped(dev)) { |
@@ -541,7 +541,7 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev) | |||
541 | */ | 541 | */ |
542 | if (time_before(jiffies, dev->trans_start + 20 * HZ)) { | 542 | if (time_before(jiffies, dev->trans_start + 20 * HZ)) { |
543 | /* 20 sec timeout not reached */ | 543 | /* 20 sec timeout not reached */ |
544 | return 1; | 544 | return NETDEV_TX_BUSY; |
545 | } | 545 | } |
546 | 546 | ||
547 | printk(KERN_ERR "mkiss: %s: transmit timed out, %s?\n", dev->name, | 547 | printk(KERN_ERR "mkiss: %s: transmit timed out, %s?\n", dev->name, |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 806533c831c7..beb84213b671 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -1484,7 +1484,7 @@ static int emac_start_xmit_sg(struct sk_buff *skb, struct net_device *ndev) | |||
1484 | stop_queue: | 1484 | stop_queue: |
1485 | netif_stop_queue(ndev); | 1485 | netif_stop_queue(ndev); |
1486 | DBG2(dev, "stopped TX queue" NL); | 1486 | DBG2(dev, "stopped TX queue" NL); |
1487 | return 1; | 1487 | return NETDEV_TX_BUSY; |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | /* Tx lock BHs */ | 1490 | /* Tx lock BHs */ |
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c index c25bc0bc0b25..448098d3b39b 100644 --- a/drivers/net/ibmlana.c +++ b/drivers/net/ibmlana.c | |||
@@ -815,7 +815,7 @@ static int ibmlana_close(struct net_device *dev) | |||
815 | static int ibmlana_tx(struct sk_buff *skb, struct net_device *dev) | 815 | static int ibmlana_tx(struct sk_buff *skb, struct net_device *dev) |
816 | { | 816 | { |
817 | ibmlana_priv *priv = netdev_priv(dev); | 817 | ibmlana_priv *priv = netdev_priv(dev); |
818 | int retval = 0, tmplen, addr; | 818 | int tmplen, addr; |
819 | unsigned long flags; | 819 | unsigned long flags; |
820 | tda_t tda; | 820 | tda_t tda; |
821 | int baddr; | 821 | int baddr; |
@@ -824,7 +824,6 @@ static int ibmlana_tx(struct sk_buff *skb, struct net_device *dev) | |||
824 | the upper layer is in deep desperation and we simply ignore the frame. */ | 824 | the upper layer is in deep desperation and we simply ignore the frame. */ |
825 | 825 | ||
826 | if (priv->txusedcnt >= TXBUFCNT) { | 826 | if (priv->txusedcnt >= TXBUFCNT) { |
827 | retval = -EIO; | ||
828 | dev->stats.tx_dropped++; | 827 | dev->stats.tx_dropped++; |
829 | goto tx_done; | 828 | goto tx_done; |
830 | } | 829 | } |
@@ -874,7 +873,7 @@ static int ibmlana_tx(struct sk_buff *skb, struct net_device *dev) | |||
874 | spin_unlock_irqrestore(&priv->lock, flags); | 873 | spin_unlock_irqrestore(&priv->lock, flags); |
875 | tx_done: | 874 | tx_done: |
876 | dev_kfree_skb(skb); | 875 | dev_kfree_skb(skb); |
877 | return retval; | 876 | return NETDEV_TX_OK; |
878 | } | 877 | } |
879 | 878 | ||
880 | /* switch receiver mode. */ | 879 | /* switch receiver mode. */ |
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index 269153eedd26..c4361d466597 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c | |||
@@ -512,13 +512,13 @@ static int au1k_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
512 | printk(KERN_DEBUG "%s: tx_full\n", dev->name); | 512 | printk(KERN_DEBUG "%s: tx_full\n", dev->name); |
513 | netif_stop_queue(dev); | 513 | netif_stop_queue(dev); |
514 | aup->tx_full = 1; | 514 | aup->tx_full = 1; |
515 | return 1; | 515 | return NETDEV_TX_BUSY; |
516 | } | 516 | } |
517 | else if (((aup->tx_head + 1) & (NUM_IR_DESC - 1)) == aup->tx_tail) { | 517 | else if (((aup->tx_head + 1) & (NUM_IR_DESC - 1)) == aup->tx_tail) { |
518 | printk(KERN_DEBUG "%s: tx_full\n", dev->name); | 518 | printk(KERN_DEBUG "%s: tx_full\n", dev->name); |
519 | netif_stop_queue(dev); | 519 | netif_stop_queue(dev); |
520 | aup->tx_full = 1; | 520 | aup->tx_full = 1; |
521 | return 1; | 521 | return NETDEV_TX_BUSY; |
522 | } | 522 | } |
523 | 523 | ||
524 | pDB = aup->tx_db_inuse[aup->tx_head]; | 524 | pDB = aup->tx_db_inuse[aup->tx_head]; |
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 6b6548b9fda0..9a0346e751ac 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -994,11 +994,11 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev) | |||
994 | 994 | ||
995 | /* change speed pending, wait for its execution */ | 995 | /* change speed pending, wait for its execution */ |
996 | if (self->new_speed) | 996 | if (self->new_speed) |
997 | return -EBUSY; | 997 | return NETDEV_TX_BUSY; |
998 | 998 | ||
999 | /* device stopped (apm) wait for restart */ | 999 | /* device stopped (apm) wait for restart */ |
1000 | if (self->stopped) | 1000 | if (self->stopped) |
1001 | return -EBUSY; | 1001 | return NETDEV_TX_BUSY; |
1002 | 1002 | ||
1003 | toshoboe_checkstuck (self); | 1003 | toshoboe_checkstuck (self); |
1004 | 1004 | ||
@@ -1049,7 +1049,7 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev) | |||
1049 | if (self->txpending) | 1049 | if (self->txpending) |
1050 | { | 1050 | { |
1051 | spin_unlock_irqrestore(&self->spinlock, flags); | 1051 | spin_unlock_irqrestore(&self->spinlock, flags); |
1052 | return -EBUSY; | 1052 | return NETDEV_TX_BUSY; |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | /* If in SIR mode we need to generate a string of XBOFs */ | 1055 | /* If in SIR mode we need to generate a string of XBOFs */ |
@@ -1105,7 +1105,7 @@ dumpbufs(skb->data,skb->len,'>'); | |||
1105 | ,skb->len, self->ring->tx[self->txs].control, self->txpending); | 1105 | ,skb->len, self->ring->tx[self->txs].control, self->txpending); |
1106 | toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); | 1106 | toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); |
1107 | spin_unlock_irqrestore(&self->spinlock, flags); | 1107 | spin_unlock_irqrestore(&self->spinlock, flags); |
1108 | return -EBUSY; | 1108 | return NETDEV_TX_BUSY; |
1109 | } | 1109 | } |
1110 | 1110 | ||
1111 | if (INB (OBOE_ENABLEH) & OBOE_ENABLEH_SIRON) | 1111 | if (INB (OBOE_ENABLEH) & OBOE_ENABLEH_SIRON) |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 394b2b17075e..0c0831c03f64 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -389,7 +389,6 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
389 | s32 speed; | 389 | s32 speed; |
390 | s16 xbofs; | 390 | s16 xbofs; |
391 | int res, mtt; | 391 | int res, mtt; |
392 | int err = 1; /* Failed */ | ||
393 | 392 | ||
394 | IRDA_DEBUG(4, "%s() on %s\n", __func__, netdev->name); | 393 | IRDA_DEBUG(4, "%s() on %s\n", __func__, netdev->name); |
395 | 394 | ||
@@ -430,7 +429,6 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
430 | irda_usb_change_speed_xbofs(self); | 429 | irda_usb_change_speed_xbofs(self); |
431 | netdev->trans_start = jiffies; | 430 | netdev->trans_start = jiffies; |
432 | /* Will netif_wake_queue() in callback */ | 431 | /* Will netif_wake_queue() in callback */ |
433 | err = 0; /* No error */ | ||
434 | goto drop; | 432 | goto drop; |
435 | } | 433 | } |
436 | } | 434 | } |
@@ -542,7 +540,7 @@ drop: | |||
542 | /* Drop silently the skb and exit */ | 540 | /* Drop silently the skb and exit */ |
543 | dev_kfree_skb(skb); | 541 | dev_kfree_skb(skb); |
544 | spin_unlock_irqrestore(&self->lock, flags); | 542 | spin_unlock_irqrestore(&self->lock, flags); |
545 | return err; /* Usually 1 */ | 543 | return NETDEV_TX_OK; |
546 | } | 544 | } |
547 | 545 | ||
548 | /*------------------------------------------------------------------*/ | 546 | /*------------------------------------------------------------------*/ |
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c index 9d813bc4502e..c3e4e2c435ba 100644 --- a/drivers/net/irda/kingsun-sir.c +++ b/drivers/net/irda/kingsun-sir.c | |||
@@ -156,9 +156,6 @@ static int kingsun_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
156 | int wraplen; | 156 | int wraplen; |
157 | int ret = 0; | 157 | int ret = 0; |
158 | 158 | ||
159 | if (skb == NULL || netdev == NULL) | ||
160 | return -EINVAL; | ||
161 | |||
162 | netif_stop_queue(netdev); | 159 | netif_stop_queue(netdev); |
163 | 160 | ||
164 | /* the IRDA wrapping routines don't deal with non linear skb */ | 161 | /* the IRDA wrapping routines don't deal with non linear skb */ |
@@ -197,7 +194,7 @@ static int kingsun_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
197 | dev_kfree_skb(skb); | 194 | dev_kfree_skb(skb); |
198 | spin_unlock(&kingsun->lock); | 195 | spin_unlock(&kingsun->lock); |
199 | 196 | ||
200 | return ret; | 197 | return NETDEV_TX_OK; |
201 | } | 198 | } |
202 | 199 | ||
203 | /* Receive callback function */ | 200 | /* Receive callback function */ |
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index b6ffe9715b61..d73b8b64fcb9 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c | |||
@@ -391,9 +391,6 @@ static int ks959_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
391 | unsigned int wraplen; | 391 | unsigned int wraplen; |
392 | int ret = 0; | 392 | int ret = 0; |
393 | 393 | ||
394 | if (skb == NULL || netdev == NULL) | ||
395 | return -EINVAL; | ||
396 | |||
397 | netif_stop_queue(netdev); | 394 | netif_stop_queue(netdev); |
398 | 395 | ||
399 | /* the IRDA wrapping routines don't deal with non linear skb */ | 396 | /* the IRDA wrapping routines don't deal with non linear skb */ |
@@ -428,7 +425,7 @@ static int ks959_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
428 | dev_kfree_skb(skb); | 425 | dev_kfree_skb(skb); |
429 | spin_unlock(&kingsun->lock); | 426 | spin_unlock(&kingsun->lock); |
430 | 427 | ||
431 | return ret; | 428 | return NETDEV_TX_OK; |
432 | } | 429 | } |
433 | 430 | ||
434 | /* Receive callback function */ | 431 | /* Receive callback function */ |
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c index 64df27f2bfd4..1ef45ec74422 100644 --- a/drivers/net/irda/ksdazzle-sir.c +++ b/drivers/net/irda/ksdazzle-sir.c | |||
@@ -304,9 +304,6 @@ static int ksdazzle_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
304 | unsigned int wraplen; | 304 | unsigned int wraplen; |
305 | int ret = 0; | 305 | int ret = 0; |
306 | 306 | ||
307 | if (skb == NULL || netdev == NULL) | ||
308 | return -EINVAL; | ||
309 | |||
310 | netif_stop_queue(netdev); | 307 | netif_stop_queue(netdev); |
311 | 308 | ||
312 | /* the IRDA wrapping routines don't deal with non linear skb */ | 309 | /* the IRDA wrapping routines don't deal with non linear skb */ |
@@ -341,7 +338,7 @@ static int ksdazzle_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
341 | dev_kfree_skb(skb); | 338 | dev_kfree_skb(skb); |
342 | spin_unlock(&kingsun->lock); | 339 | spin_unlock(&kingsun->lock); |
343 | 340 | ||
344 | return ret; | 341 | return NETDEV_TX_OK; |
345 | } | 342 | } |
346 | 343 | ||
347 | /* Receive callback function */ | 344 | /* Receive callback function */ |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index fac504d0cfd8..f4df1001983c 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -824,10 +824,6 @@ static int mcs_hard_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
824 | int wraplen; | 824 | int wraplen; |
825 | int ret = 0; | 825 | int ret = 0; |
826 | 826 | ||
827 | |||
828 | if (skb == NULL || ndev == NULL) | ||
829 | return -EINVAL; | ||
830 | |||
831 | netif_stop_queue(ndev); | 827 | netif_stop_queue(ndev); |
832 | mcs = netdev_priv(ndev); | 828 | mcs = netdev_priv(ndev); |
833 | 829 | ||
@@ -870,7 +866,7 @@ static int mcs_hard_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
870 | 866 | ||
871 | dev_kfree_skb(skb); | 867 | dev_kfree_skb(skb); |
872 | spin_unlock_irqrestore(&mcs->lock, flags); | 868 | spin_unlock_irqrestore(&mcs->lock, flags); |
873 | return ret; | 869 | return NETDEV_TX_OK; |
874 | } | 870 | } |
875 | 871 | ||
876 | static const struct net_device_ops mcs_netdev_ops = { | 872 | static const struct net_device_ops mcs_netdev_ops = { |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index d940809762ec..fd0796c3db3c 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
@@ -607,7 +607,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
607 | * stopped so the network layer will retry after the | 607 | * stopped so the network layer will retry after the |
608 | * fsm completes and wakes the queue. | 608 | * fsm completes and wakes the queue. |
609 | */ | 609 | */ |
610 | return 1; | 610 | return NETDEV_TX_BUSY; |
611 | } | 611 | } |
612 | else if (unlikely(err)) { | 612 | else if (unlikely(err)) { |
613 | /* other fatal error - forget the speed change and | 613 | /* other fatal error - forget the speed change and |
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c index 789b6cb744b2..f28c23343009 100644 --- a/drivers/net/lib8390.c +++ b/drivers/net/lib8390.c | |||
@@ -370,7 +370,7 @@ static int __ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
370 | spin_unlock(&ei_local->page_lock); | 370 | spin_unlock(&ei_local->page_lock); |
371 | enable_irq_lockdep_irqrestore(dev->irq, &flags); | 371 | enable_irq_lockdep_irqrestore(dev->irq, &flags); |
372 | dev->stats.tx_errors++; | 372 | dev->stats.tx_errors++; |
373 | return 1; | 373 | return NETDEV_TX_BUSY; |
374 | } | 374 | } |
375 | 375 | ||
376 | /* | 376 | /* |
diff --git a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c index e24175a39460..dab45339d3a8 100644 --- a/drivers/net/mac89x0.c +++ b/drivers/net/mac89x0.c | |||
@@ -400,7 +400,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
400 | /* Gasp! It hasn't. But that shouldn't happen since | 400 | /* Gasp! It hasn't. But that shouldn't happen since |
401 | we're waiting for TxOk, so return 1 and requeue this packet. */ | 401 | we're waiting for TxOk, so return 1 and requeue this packet. */ |
402 | local_irq_restore(flags); | 402 | local_irq_restore(flags); |
403 | return 1; | 403 | return NETDEV_TX_BUSY; |
404 | } | 404 | } |
405 | 405 | ||
406 | /* Write the contents of the packet */ | 406 | /* Write the contents of the packet */ |
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 722265920da8..5b5c25368d1e 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -645,7 +645,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
645 | "BUG! Tx Ring full when queue awake!\n"); | 645 | "BUG! Tx Ring full when queue awake!\n"); |
646 | dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n", | 646 | dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n", |
647 | bp->tx_head, bp->tx_tail); | 647 | bp->tx_head, bp->tx_tail); |
648 | return 1; | 648 | return NETDEV_TX_BUSY; |
649 | } | 649 | } |
650 | 650 | ||
651 | entry = bp->tx_head; | 651 | entry = bp->tx_head; |
diff --git a/drivers/net/mace.c b/drivers/net/mace.c index 1ad740bc8878..1427755c224d 100644 --- a/drivers/net/mace.c +++ b/drivers/net/mace.c | |||
@@ -547,7 +547,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev) | |||
547 | netif_stop_queue(dev); | 547 | netif_stop_queue(dev); |
548 | mp->tx_fullup = 1; | 548 | mp->tx_fullup = 1; |
549 | spin_unlock_irqrestore(&mp->lock, flags); | 549 | spin_unlock_irqrestore(&mp->lock, flags); |
550 | return 1; /* can't take it at the moment */ | 550 | return NETDEV_TX_BUSY; /* can't take it at the moment */ |
551 | } | 551 | } |
552 | spin_unlock_irqrestore(&mp->lock, flags); | 552 | spin_unlock_irqrestore(&mp->lock, flags); |
553 | 553 | ||
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index c9a30d3a66fb..1f6e36ea669e 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -2687,7 +2687,7 @@ again: | |||
2687 | /* we are out of transmit resources */ | 2687 | /* we are out of transmit resources */ |
2688 | tx->stop_queue++; | 2688 | tx->stop_queue++; |
2689 | netif_tx_stop_queue(netdev_queue); | 2689 | netif_tx_stop_queue(netdev_queue); |
2690 | return 1; | 2690 | return NETDEV_TX_BUSY; |
2691 | } | 2691 | } |
2692 | 2692 | ||
2693 | /* Setup checksum offloading, if needed */ | 2693 | /* Setup checksum offloading, if needed */ |
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index 9a802adba9a3..5f0758bda6b3 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c | |||
@@ -640,7 +640,7 @@ static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
640 | 640 | ||
641 | if (!TX_BUFFS_AVAIL(head, tail)) { | 641 | if (!TX_BUFFS_AVAIL(head, tail)) { |
642 | DTX(("no buffs available, returning 1\n")); | 642 | DTX(("no buffs available, returning 1\n")); |
643 | return 1; | 643 | return NETDEV_TX_BUSY; |
644 | } | 644 | } |
645 | 645 | ||
646 | spin_lock_irqsave(&mp->irq_lock, flags); | 646 | spin_lock_irqsave(&mp->irq_lock, flags); |
diff --git a/drivers/net/ni65.c b/drivers/net/ni65.c index 6474f02bf783..1f10ed603e20 100644 --- a/drivers/net/ni65.c +++ b/drivers/net/ni65.c | |||
@@ -1165,7 +1165,7 @@ static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1165 | 1165 | ||
1166 | if (test_and_set_bit(0, (void*)&p->lock)) { | 1166 | if (test_and_set_bit(0, (void*)&p->lock)) { |
1167 | printk(KERN_ERR "%s: Queue was locked.\n", dev->name); | 1167 | printk(KERN_ERR "%s: Queue was locked.\n", dev->name); |
1168 | return 1; | 1168 | return NETDEV_TX_BUSY; |
1169 | } | 1169 | } |
1170 | 1170 | ||
1171 | { | 1171 | { |
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 940962ae8f23..1576ac07216e 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -1097,7 +1097,7 @@ again: | |||
1097 | if (unlikely(dev->CFG_cache & CFG_LNKSTS)) { | 1097 | if (unlikely(dev->CFG_cache & CFG_LNKSTS)) { |
1098 | netif_stop_queue(ndev); | 1098 | netif_stop_queue(ndev); |
1099 | if (unlikely(dev->CFG_cache & CFG_LNKSTS)) | 1099 | if (unlikely(dev->CFG_cache & CFG_LNKSTS)) |
1100 | return 1; | 1100 | return NETDEV_TX_BUSY; |
1101 | netif_start_queue(ndev); | 1101 | netif_start_queue(ndev); |
1102 | } | 1102 | } |
1103 | 1103 | ||
@@ -1115,7 +1115,7 @@ again: | |||
1115 | netif_start_queue(ndev); | 1115 | netif_start_queue(ndev); |
1116 | goto again; | 1116 | goto again; |
1117 | } | 1117 | } |
1118 | return 1; | 1118 | return NETDEV_TX_BUSY; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | if (free_idx == dev->tx_intr_idx) { | 1121 | if (free_idx == dev->tx_intr_idx) { |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 15b8fe61695b..0e38d80fd255 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1130,7 +1130,7 @@ static int axnet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1130 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); | 1130 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); |
1131 | spin_unlock_irqrestore(&ei_local->page_lock, flags); | 1131 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1132 | dev->stats.tx_errors++; | 1132 | dev->stats.tx_errors++; |
1133 | return 1; | 1133 | return NETDEV_TX_BUSY; |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | /* | 1136 | /* |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 81e6660a433a..479d5b494371 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -877,7 +877,7 @@ static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
877 | if (length > ETH_FRAME_LEN) { | 877 | if (length > ETH_FRAME_LEN) { |
878 | printk(KERN_NOTICE "%s: Attempting to send a large packet" | 878 | printk(KERN_NOTICE "%s: Attempting to send a large packet" |
879 | " (%d bytes).\n", dev->name, length); | 879 | " (%d bytes).\n", dev->name, length); |
880 | return 1; | 880 | return NETDEV_TX_BUSY; |
881 | } | 881 | } |
882 | 882 | ||
883 | DEBUG(4, "%s: Transmitting a packet of length %lu.\n", | 883 | DEBUG(4, "%s: Transmitting a packet of length %lu.\n", |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 48dbb35747d8..37e05d3ab893 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -1388,7 +1388,7 @@ static int smc_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1388 | dev->stats.tx_aborted_errors++; | 1388 | dev->stats.tx_aborted_errors++; |
1389 | printk(KERN_DEBUG "%s: Internal error -- sent packet while busy.\n", | 1389 | printk(KERN_DEBUG "%s: Internal error -- sent packet while busy.\n", |
1390 | dev->name); | 1390 | dev->name); |
1391 | return 1; | 1391 | return NETDEV_TX_BUSY; |
1392 | } | 1392 | } |
1393 | smc->saved_skb = skb; | 1393 | smc->saved_skb = skb; |
1394 | 1394 | ||
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index a3685c0d22fc..ef37d22c7e1d 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -1399,7 +1399,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1399 | DEBUG(2 + (okay ? 2 : 0), "%s: avail. tx space=%u%s\n", | 1399 | DEBUG(2 + (okay ? 2 : 0), "%s: avail. tx space=%u%s\n", |
1400 | dev->name, freespace, okay ? " (okay)":" (not enough)"); | 1400 | dev->name, freespace, okay ? " (okay)":" (not enough)"); |
1401 | if (!okay) { /* not enough space */ | 1401 | if (!okay) { /* not enough space */ |
1402 | return 1; /* upper layer may decide to requeue this packet */ | 1402 | return NETDEV_TX_BUSY; /* upper layer may decide to requeue this packet */ |
1403 | } | 1403 | } |
1404 | /* send the packet */ | 1404 | /* send the packet */ |
1405 | PutWord(XIRCREG_EDP, (u_short)pktlen); | 1405 | PutWord(XIRCREG_EDP, (u_short)pktlen); |
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 0be0f0b164f3..7a62f781fef2 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -955,12 +955,12 @@ plip_tx_packet(struct sk_buff *skb, struct net_device *dev) | |||
955 | struct plip_local *snd = &nl->snd_data; | 955 | struct plip_local *snd = &nl->snd_data; |
956 | 956 | ||
957 | if (netif_queue_stopped(dev)) | 957 | if (netif_queue_stopped(dev)) |
958 | return 1; | 958 | return NETDEV_TX_BUSY; |
959 | 959 | ||
960 | /* We may need to grab the bus */ | 960 | /* We may need to grab the bus */ |
961 | if (!nl->port_owner) { | 961 | if (!nl->port_owner) { |
962 | if (parport_claim(nl->pardev)) | 962 | if (parport_claim(nl->pardev)) |
963 | return 1; | 963 | return NETDEV_TX_BUSY; |
964 | nl->port_owner = 1; | 964 | nl->port_owner = 1; |
965 | } | 965 | } |
966 | 966 | ||
@@ -969,7 +969,7 @@ plip_tx_packet(struct sk_buff *skb, struct net_device *dev) | |||
969 | if (skb->len > dev->mtu + dev->hard_header_len) { | 969 | if (skb->len > dev->mtu + dev->hard_header_len) { |
970 | printk(KERN_WARNING "%s: packet too big, %d.\n", dev->name, (int)skb->len); | 970 | printk(KERN_WARNING "%s: packet too big, %d.\n", dev->name, (int)skb->len); |
971 | netif_start_queue (dev); | 971 | netif_start_queue (dev); |
972 | return 1; | 972 | return NETDEV_TX_BUSY; |
973 | } | 973 | } |
974 | 974 | ||
975 | if (net_debug > 2) | 975 | if (net_debug > 2) |
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index d890829a9acc..81dbcbb910f4 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c | |||
@@ -1425,7 +1425,7 @@ static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1425 | if (!(new_skb = dev_alloc_skb(len + 8))) { | 1425 | if (!(new_skb = dev_alloc_skb(len + 8))) { |
1426 | dev_kfree_skb(skb); | 1426 | dev_kfree_skb(skb); |
1427 | netif_wake_queue(dev); | 1427 | netif_wake_queue(dev); |
1428 | return -EBUSY; | 1428 | return NETDEV_TX_OK; |
1429 | } | 1429 | } |
1430 | skb_reserve(new_skb, 8); | 1430 | skb_reserve(new_skb, 8); |
1431 | skb_put(new_skb, len); | 1431 | skb_put(new_skb, len); |
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 7a4b9fbddbaf..d8c9cf1b901d 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c | |||
@@ -2084,7 +2084,7 @@ static int sbmac_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
2084 | netif_stop_queue(dev); | 2084 | netif_stop_queue(dev); |
2085 | spin_unlock_irqrestore(&sc->sbm_lock, flags); | 2085 | spin_unlock_irqrestore(&sc->sbm_lock, flags); |
2086 | 2086 | ||
2087 | return 1; | 2087 | return NETDEV_TX_BUSY; |
2088 | } | 2088 | } |
2089 | 2089 | ||
2090 | dev->trans_start = jiffies; | 2090 | dev->trans_start = jiffies; |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 0709b7512467..341882f959f3 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -1108,7 +1108,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
1108 | if (!sh_eth_txfree(ndev)) { | 1108 | if (!sh_eth_txfree(ndev)) { |
1109 | netif_stop_queue(ndev); | 1109 | netif_stop_queue(ndev); |
1110 | spin_unlock_irqrestore(&mdp->lock, flags); | 1110 | spin_unlock_irqrestore(&mdp->lock, flags); |
1111 | return 1; | 1111 | return NETDEV_TX_BUSY; |
1112 | } | 1112 | } |
1113 | } | 1113 | } |
1114 | spin_unlock_irqrestore(&mdp->lock, flags); | 1114 | spin_unlock_irqrestore(&mdp->lock, flags); |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index 2d4617b3e208..a9a897bb42d5 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -1584,7 +1584,7 @@ sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev) | |||
1584 | /* Don't transmit data before the complete of auto-negotiation */ | 1584 | /* Don't transmit data before the complete of auto-negotiation */ |
1585 | if(!sis_priv->autong_complete){ | 1585 | if(!sis_priv->autong_complete){ |
1586 | netif_stop_queue(net_dev); | 1586 | netif_stop_queue(net_dev); |
1587 | return 1; | 1587 | return NETDEV_TX_BUSY; |
1588 | } | 1588 | } |
1589 | 1589 | ||
1590 | spin_lock_irqsave(&sis_priv->lock, flags); | 1590 | spin_lock_irqsave(&sis_priv->lock, flags); |
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c index 19d343c42a21..088fe26484e7 100644 --- a/drivers/net/skfp/skfddi.c +++ b/drivers/net/skfp/skfddi.c | |||
@@ -1082,7 +1082,7 @@ static int skfp_send_pkt(struct sk_buff *skb, struct net_device *dev) | |||
1082 | if (bp->QueueSkb == 0) { // return with tbusy set: queue full | 1082 | if (bp->QueueSkb == 0) { // return with tbusy set: queue full |
1083 | 1083 | ||
1084 | netif_stop_queue(dev); | 1084 | netif_stop_queue(dev); |
1085 | return 1; | 1085 | return NETDEV_TX_BUSY; |
1086 | } | 1086 | } |
1087 | bp->QueueSkb--; | 1087 | bp->QueueSkb--; |
1088 | skb_queue_tail(&bp->SendSkbQueue, skb); | 1088 | skb_queue_tail(&bp->SendSkbQueue, skb); |
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c index 9a7973a54116..e02471b2f2b5 100644 --- a/drivers/net/smc9194.c +++ b/drivers/net/smc9194.c | |||
@@ -503,7 +503,7 @@ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * de | |||
503 | /* THIS SHOULD NEVER HAPPEN. */ | 503 | /* THIS SHOULD NEVER HAPPEN. */ |
504 | dev->stats.tx_aborted_errors++; | 504 | dev->stats.tx_aborted_errors++; |
505 | printk(CARDNAME": Bad Craziness - sent packet while busy.\n" ); | 505 | printk(CARDNAME": Bad Craziness - sent packet while busy.\n" ); |
506 | return 1; | 506 | return NETDEV_TX_BUSY; |
507 | } | 507 | } |
508 | lp->saved_skb = skb; | 508 | lp->saved_skb = skb; |
509 | 509 | ||
diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c index 211e805c1223..e4255d829380 100644 --- a/drivers/net/sonic.c +++ b/drivers/net/sonic.c | |||
@@ -223,7 +223,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
223 | if (!laddr) { | 223 | if (!laddr) { |
224 | printk(KERN_ERR "%s: failed to map tx DMA buffer.\n", dev->name); | 224 | printk(KERN_ERR "%s: failed to map tx DMA buffer.\n", dev->name); |
225 | dev_kfree_skb(skb); | 225 | dev_kfree_skb(skb); |
226 | return 1; | 226 | return NETDEV_TX_BUSY |
227 | } | 227 | } |
228 | 228 | ||
229 | sonic_tda_put(dev, entry, SONIC_TD_STATUS, 0); /* clear status */ | 229 | sonic_tda_put(dev, entry, SONIC_TD_STATUS, 0); /* clear status */ |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index fcb943fca4f1..838cce8b8fff 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -1236,7 +1236,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1236 | */ | 1236 | */ |
1237 | if ((np->cur_tx - np->dirty_tx) + skb_num_frags(skb) * 2 > TX_RING_SIZE) { | 1237 | if ((np->cur_tx - np->dirty_tx) + skb_num_frags(skb) * 2 > TX_RING_SIZE) { |
1238 | netif_stop_queue(dev); | 1238 | netif_stop_queue(dev); |
1239 | return 1; | 1239 | return NETDEV_TX_BUSY; |
1240 | } | 1240 | } |
1241 | 1241 | ||
1242 | #if defined(ZEROCOPY) && defined(HAS_BROKEN_FIRMWARE) | 1242 | #if defined(ZEROCOPY) && defined(HAS_BROKEN_FIRMWARE) |
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c index a39c0b9ba8b6..7bb27426dbd6 100644 --- a/drivers/net/sun3_82586.c +++ b/drivers/net/sun3_82586.c | |||
@@ -1023,7 +1023,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1023 | #if(NUM_XMIT_BUFFS > 1) | 1023 | #if(NUM_XMIT_BUFFS > 1) |
1024 | if(test_and_set_bit(0,(void *) &p->lock)) { | 1024 | if(test_and_set_bit(0,(void *) &p->lock)) { |
1025 | printk("%s: Queue was locked\n",dev->name); | 1025 | printk("%s: Queue was locked\n",dev->name); |
1026 | return 1; | 1026 | return NETDEV_TX_BUSY; |
1027 | } | 1027 | } |
1028 | else | 1028 | else |
1029 | #endif | 1029 | #endif |
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c index 9bd9dadb8534..534dfe3eef6f 100644 --- a/drivers/net/sun3lance.c +++ b/drivers/net/sun3lance.c | |||
@@ -526,7 +526,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
526 | if (netif_queue_stopped(dev)) { | 526 | if (netif_queue_stopped(dev)) { |
527 | int tickssofar = jiffies - dev->trans_start; | 527 | int tickssofar = jiffies - dev->trans_start; |
528 | if (tickssofar < 20) | 528 | if (tickssofar < 20) |
529 | return( 1 ); | 529 | return NETDEV_TX_BUSY; |
530 | 530 | ||
531 | DPRINTK( 1, ( "%s: transmit timed out, status %04x, resetting.\n", | 531 | DPRINTK( 1, ( "%s: transmit timed out, status %04x, resetting.\n", |
532 | dev->name, DREG )); | 532 | dev->name, DREG )); |
@@ -577,7 +577,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
577 | if (test_and_set_bit( 0, (void*)&lp->lock ) != 0) { | 577 | if (test_and_set_bit( 0, (void*)&lp->lock ) != 0) { |
578 | printk( "%s: tx queue lock!.\n", dev->name); | 578 | printk( "%s: tx queue lock!.\n", dev->name); |
579 | /* don't clear dev->tbusy flag. */ | 579 | /* don't clear dev->tbusy flag. */ |
580 | return 1; | 580 | return NETDEV_TX_BUSY; |
581 | } | 581 | } |
582 | 582 | ||
583 | AREG = CSR0; | 583 | AREG = CSR0; |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 4e9bd380a5c2..4ef729198e10 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -2275,7 +2275,7 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2275 | spin_unlock_irq(&hp->happy_lock); | 2275 | spin_unlock_irq(&hp->happy_lock); |
2276 | printk(KERN_ERR "%s: BUG! Tx Ring full when queue awake!\n", | 2276 | printk(KERN_ERR "%s: BUG! Tx Ring full when queue awake!\n", |
2277 | dev->name); | 2277 | dev->name); |
2278 | return 1; | 2278 | return NETDEV_TX_BUSY; |
2279 | } | 2279 | } |
2280 | 2280 | ||
2281 | entry = hp->tx_new; | 2281 | entry = hp->tx_new; |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index aa6964922d5e..384cb5e28397 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -1111,7 +1111,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev ) | |||
1111 | dev->name, priv->txHead, priv->txTail ); | 1111 | dev->name, priv->txHead, priv->txTail ); |
1112 | netif_stop_queue(dev); | 1112 | netif_stop_queue(dev); |
1113 | priv->txBusyCount++; | 1113 | priv->txBusyCount++; |
1114 | return 1; | 1114 | return NETDEV_TX_BUSY; |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | tail_list->forward = 0; | 1117 | tail_list->forward = 0; |
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 534c0f38483c..13dbc59bfe42 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -1243,7 +1243,7 @@ static int xl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1243 | return 0; | 1243 | return 0; |
1244 | } else { | 1244 | } else { |
1245 | spin_unlock_irqrestore(&xl_priv->xl_lock,flags) ; | 1245 | spin_unlock_irqrestore(&xl_priv->xl_lock,flags) ; |
1246 | return 1; | 1246 | return NETDEV_TX_BUSY; |
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | } | 1249 | } |
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c index 2e70ee8f1459..b358bbbce33a 100644 --- a/drivers/net/tokenring/lanstreamer.c +++ b/drivers/net/tokenring/lanstreamer.c | |||
@@ -1187,7 +1187,7 @@ static int streamer_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1187 | } else { | 1187 | } else { |
1188 | netif_stop_queue(dev); | 1188 | netif_stop_queue(dev); |
1189 | spin_unlock_irqrestore(&streamer_priv->streamer_lock,flags); | 1189 | spin_unlock_irqrestore(&streamer_priv->streamer_lock,flags); |
1190 | return 1; | 1190 | return NETDEV_TX_BUSY; |
1191 | } | 1191 | } |
1192 | } | 1192 | } |
1193 | 1193 | ||
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index d068a9d36883..c36974925c15 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -1055,7 +1055,7 @@ static int olympic_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1055 | return 0; | 1055 | return 0; |
1056 | } else { | 1056 | } else { |
1057 | spin_unlock_irqrestore(&olympic_priv->olympic_lock,flags); | 1057 | spin_unlock_irqrestore(&olympic_priv->olympic_lock,flags); |
1058 | return 1; | 1058 | return NETDEV_TX_BUSY; |
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | } | 1061 | } |
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index a91d9c55d78e..54ad4ed03374 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c | |||
@@ -4601,7 +4601,7 @@ static int smctr_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
4601 | netif_stop_queue(dev); | 4601 | netif_stop_queue(dev); |
4602 | 4602 | ||
4603 | if(tp->QueueSkb == 0) | 4603 | if(tp->QueueSkb == 0) |
4604 | return (1); /* Return with tbusy set: queue full */ | 4604 | return NETDEV_TX_BUSY; /* Return with tbusy set: queue full */ |
4605 | 4605 | ||
4606 | tp->QueueSkb--; | 4606 | tp->QueueSkb--; |
4607 | skb_queue_tail(&tp->SendSkbQueue, skb); | 4607 | skb_queue_tail(&tp->SendSkbQueue, skb); |
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index b11bb72dc7ab..a2eab72b507a 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c | |||
@@ -633,7 +633,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device | |||
633 | if (tms380tr_debug > 0) | 633 | if (tms380tr_debug > 0) |
634 | printk(KERN_DEBUG "%s: No free TPL\n", dev->name); | 634 | printk(KERN_DEBUG "%s: No free TPL\n", dev->name); |
635 | spin_unlock_irqrestore(&tp->lock, flags); | 635 | spin_unlock_irqrestore(&tp->lock, flags); |
636 | return 1; | 636 | return NETDEV_TX_BUSY; |
637 | } | 637 | } |
638 | 638 | ||
639 | dmabuf = 0; | 639 | dmabuf = 0; |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index e7609a05032d..81f054dbb88d 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -612,7 +612,7 @@ static int de_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
612 | if (tx_free == 0) { | 612 | if (tx_free == 0) { |
613 | netif_stop_queue(dev); | 613 | netif_stop_queue(dev); |
614 | spin_unlock_irq(&de->lock); | 614 | spin_unlock_irq(&de->lock); |
615 | return 1; | 615 | return NETDEV_TX_BUSY; |
616 | } | 616 | } |
617 | tx_free--; | 617 | tx_free--; |
618 | 618 | ||
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index 32256179a205..eb72d2e9ab3d 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c | |||
@@ -1461,12 +1461,12 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) | |||
1461 | { | 1461 | { |
1462 | struct de4x5_private *lp = netdev_priv(dev); | 1462 | struct de4x5_private *lp = netdev_priv(dev); |
1463 | u_long iobase = dev->base_addr; | 1463 | u_long iobase = dev->base_addr; |
1464 | int status = 0; | 1464 | int status = NETDEV_TX_OK; |
1465 | u_long flags = 0; | 1465 | u_long flags = 0; |
1466 | 1466 | ||
1467 | netif_stop_queue(dev); | 1467 | netif_stop_queue(dev); |
1468 | if (!lp->tx_enable) { /* Cannot send for now */ | 1468 | if (!lp->tx_enable) { /* Cannot send for now */ |
1469 | return -1; | 1469 | return NETDEV_TX_LOCKED; |
1470 | } | 1470 | } |
1471 | 1471 | ||
1472 | /* | 1472 | /* |
@@ -1480,7 +1480,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) | |||
1480 | 1480 | ||
1481 | /* Test if cache is already locked - requeue skb if so */ | 1481 | /* Test if cache is already locked - requeue skb if so */ |
1482 | if (test_and_set_bit(0, (void *)&lp->cache.lock) && !lp->interrupt) | 1482 | if (test_and_set_bit(0, (void *)&lp->cache.lock) && !lp->interrupt) |
1483 | return -1; | 1483 | return NETDEV_TX_LOCKED; |
1484 | 1484 | ||
1485 | /* Transmit descriptor ring full or stale skb */ | 1485 | /* Transmit descriptor ring full or stale skb */ |
1486 | if (netif_queue_stopped(dev) || (u_long) lp->tx_skb[lp->tx_new] > 1) { | 1486 | if (netif_queue_stopped(dev) || (u_long) lp->tx_skb[lp->tx_new] > 1) { |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index f2e669974c78..8e78f003f08f 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -686,7 +686,7 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev) | |||
686 | spin_unlock_irqrestore(&db->lock, flags); | 686 | spin_unlock_irqrestore(&db->lock, flags); |
687 | printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n", | 687 | printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n", |
688 | db->tx_queue_cnt); | 688 | db->tx_queue_cnt); |
689 | return 1; | 689 | return NETDEV_TX_BUSY; |
690 | } | 690 | } |
691 | 691 | ||
692 | /* Disable NIC interrupt */ | 692 | /* Disable NIC interrupt */ |
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index 8761a5a5bd79..9277ce8febe4 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c | |||
@@ -591,7 +591,7 @@ static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
591 | if (db->tx_packet_cnt >= TX_FREE_DESC_CNT) { | 591 | if (db->tx_packet_cnt >= TX_FREE_DESC_CNT) { |
592 | spin_unlock_irqrestore(&db->lock, flags); | 592 | spin_unlock_irqrestore(&db->lock, flags); |
593 | printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n", db->tx_packet_cnt); | 593 | printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n", db->tx_packet_cnt); |
594 | return 1; | 594 | return NETDEV_TX_BUSY; |
595 | } | 595 | } |
596 | 596 | ||
597 | /* Disable NIC interrupt */ | 597 | /* Disable NIC interrupt */ |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index e3580f42c899..f8c6d7ea7264 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -816,7 +816,7 @@ static int hso_net_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
816 | } | 816 | } |
817 | dev_kfree_skb(skb); | 817 | dev_kfree_skb(skb); |
818 | /* we're done */ | 818 | /* we're done */ |
819 | return result; | 819 | return NETDEV_TX_OK; |
820 | } | 820 | } |
821 | 821 | ||
822 | static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info) | 822 | static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info) |
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c index 35dea3bea95d..f525f9fe74db 100644 --- a/drivers/net/wan/cycx_x25.c +++ b/drivers/net/wan/cycx_x25.c | |||
@@ -615,7 +615,7 @@ static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb, | |||
615 | case WAN_DISCONNECTED: | 615 | case WAN_DISCONNECTED: |
616 | if (cycx_x25_chan_connect(dev)) { | 616 | if (cycx_x25_chan_connect(dev)) { |
617 | netif_stop_queue(dev); | 617 | netif_stop_queue(dev); |
618 | return -EBUSY; | 618 | return NETDEV_TX_BUSY; |
619 | } | 619 | } |
620 | /* fall thru */ | 620 | /* fall thru */ |
621 | case WAN_CONNECTED: | 621 | case WAN_CONNECTED: |
@@ -624,7 +624,7 @@ static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb, | |||
624 | netif_stop_queue(dev); | 624 | netif_stop_queue(dev); |
625 | 625 | ||
626 | if (cycx_x25_chan_send(dev, skb)) | 626 | if (cycx_x25_chan_send(dev, skb)) |
627 | return -EBUSY; | 627 | return NETDEV_TX_BUSY; |
628 | 628 | ||
629 | break; | 629 | break; |
630 | default: | 630 | default: |
@@ -656,7 +656,7 @@ static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb, | |||
656 | if (cycx_x25_chan_send(dev, skb)) { | 656 | if (cycx_x25_chan_send(dev, skb)) { |
657 | /* prepare for future retransmissions */ | 657 | /* prepare for future retransmissions */ |
658 | skb_push(skb, 1); | 658 | skb_push(skb, 1); |
659 | return -EBUSY; | 659 | return NETDEV_TX_BUSY; |
660 | } | 660 | } |
661 | } | 661 | } |
662 | 662 | ||
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index e8d155c3e59f..2fa275a58f9d 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c | |||
@@ -205,15 +205,15 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev) | |||
205 | { | 205 | { |
206 | case DLCI_RET_OK: | 206 | case DLCI_RET_OK: |
207 | dev->stats.tx_packets++; | 207 | dev->stats.tx_packets++; |
208 | ret = 0; | 208 | ret = NETDEV_TX_OK; |
209 | break; | 209 | break; |
210 | case DLCI_RET_ERR: | 210 | case DLCI_RET_ERR: |
211 | dev->stats.tx_errors++; | 211 | dev->stats.tx_errors++; |
212 | ret = 0; | 212 | ret = NETDEV_TX_OK; |
213 | break; | 213 | break; |
214 | case DLCI_RET_DROP: | 214 | case DLCI_RET_DROP: |
215 | dev->stats.tx_dropped++; | 215 | dev->stats.tx_dropped++; |
216 | ret = 1; | 216 | ret = NETDEV_TX_BUSY; |
217 | break; | 217 | break; |
218 | } | 218 | } |
219 | /* Alan Cox recommends always returning 0, and always freeing the packet */ | 219 | /* Alan Cox recommends always returning 0, and always freeing the packet */ |
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index f4211fe0f445..3fb9dbc88a1a 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -469,7 +469,7 @@ sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
469 | } | 469 | } |
470 | } | 470 | } |
471 | 471 | ||
472 | return 1; | 472 | return NETDEV_TX_BUSY; |
473 | } | 473 | } |
474 | 474 | ||
475 | #else /* CONFIG_SBNI_MULTILINE */ | 475 | #else /* CONFIG_SBNI_MULTILINE */ |
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 8130b79a8a99..e4ad7b6b52eb 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c | |||
@@ -283,7 +283,7 @@ static int wanxl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
283 | #endif | 283 | #endif |
284 | netif_stop_queue(dev); | 284 | netif_stop_queue(dev); |
285 | spin_unlock_irq(&port->lock); | 285 | spin_unlock_irq(&port->lock); |
286 | return 1; /* request packet to be queued */ | 286 | return NETDEV_TX_BUSY; /* request packet to be queued */ |
287 | } | 287 | } |
288 | 288 | ||
289 | #ifdef DEBUG_PKT | 289 | #ifdef DEBUG_PKT |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 9eabf4d1f2e7..c70604f0329e 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -1935,7 +1935,7 @@ static int mpi_start_xmit(struct sk_buff *skb, struct net_device *dev) { | |||
1935 | netif_stop_queue (dev); | 1935 | netif_stop_queue (dev); |
1936 | if (npacks > MAXTXQ) { | 1936 | if (npacks > MAXTXQ) { |
1937 | dev->stats.tx_fifo_errors++; | 1937 | dev->stats.tx_fifo_errors++; |
1938 | return 1; | 1938 | return NETDEV_TX_BUSY; |
1939 | } | 1939 | } |
1940 | skb_queue_tail (&ai->txq, skb); | 1940 | skb_queue_tail (&ai->txq, skb); |
1941 | return 0; | 1941 | return 0; |
@@ -2139,7 +2139,7 @@ static int airo_start_xmit(struct sk_buff *skb, struct net_device *dev) { | |||
2139 | 2139 | ||
2140 | if (i == MAX_FIDS / 2) { | 2140 | if (i == MAX_FIDS / 2) { |
2141 | dev->stats.tx_fifo_errors++; | 2141 | dev->stats.tx_fifo_errors++; |
2142 | return 1; | 2142 | return NETDEV_TX_BUSY; |
2143 | } | 2143 | } |
2144 | } | 2144 | } |
2145 | /* check min length*/ | 2145 | /* check min length*/ |
@@ -2193,7 +2193,8 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) { | |||
2193 | if (test_bit(FLAG_MPI, &priv->flags)) { | 2193 | if (test_bit(FLAG_MPI, &priv->flags)) { |
2194 | /* Not implemented yet for MPI350 */ | 2194 | /* Not implemented yet for MPI350 */ |
2195 | netif_stop_queue(dev); | 2195 | netif_stop_queue(dev); |
2196 | return -ENETDOWN; | 2196 | dev_kfree_skb_any(skb); |
2197 | return NETDEV_TX_OK; | ||
2197 | } | 2198 | } |
2198 | 2199 | ||
2199 | if ( skb == NULL ) { | 2200 | if ( skb == NULL ) { |
@@ -2210,7 +2211,7 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) { | |||
2210 | 2211 | ||
2211 | if (i == MAX_FIDS) { | 2212 | if (i == MAX_FIDS) { |
2212 | dev->stats.tx_fifo_errors++; | 2213 | dev->stats.tx_fifo_errors++; |
2213 | return 1; | 2214 | return NETDEV_TX_BUSY; |
2214 | } | 2215 | } |
2215 | } | 2216 | } |
2216 | /* check min length*/ | 2217 | /* check min length*/ |
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c index a54a67c425c8..d84caf198a23 100644 --- a/drivers/net/wireless/arlan-main.c +++ b/drivers/net/wireless/arlan-main.c | |||
@@ -1199,7 +1199,7 @@ bad_end: | |||
1199 | arlan_process_interrupt(dev); | 1199 | arlan_process_interrupt(dev); |
1200 | netif_stop_queue (dev); | 1200 | netif_stop_queue (dev); |
1201 | ARLAN_DEBUG_EXIT("arlan_tx"); | 1201 | ARLAN_DEBUG_EXIT("arlan_tx"); |
1202 | return 1; | 1202 | return NETDEV_TX_BUSY; |
1203 | } | 1203 | } |
1204 | 1204 | ||
1205 | 1205 | ||
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 27eef8fb7107..291a94bd46fd 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -818,7 +818,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) | |||
818 | spin_unlock_irqrestore(&priv->irqlock, flags); | 818 | spin_unlock_irqrestore(&priv->irqlock, flags); |
819 | spin_unlock_bh(&priv->timerlock); | 819 | spin_unlock_bh(&priv->timerlock); |
820 | netif_stop_queue(dev); | 820 | netif_stop_queue(dev); |
821 | return 1; | 821 | return NETDEV_TX_BUSY; |
822 | } | 822 | } |
823 | 823 | ||
824 | frame_ctl = IEEE80211_FTYPE_DATA; | 824 | frame_ctl = IEEE80211_FTYPE_DATA; |
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index 6693423f63fe..d313b005114e 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | |||
@@ -377,7 +377,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
377 | { | 377 | { |
378 | struct hostap_interface *iface; | 378 | struct hostap_interface *iface; |
379 | local_info_t *local; | 379 | local_info_t *local; |
380 | int ret = 1; | 380 | int ret = NETDEV_TX_BUSY; |
381 | u16 fc; | 381 | u16 fc; |
382 | struct hostap_tx_data tx; | 382 | struct hostap_tx_data tx; |
383 | ap_tx_ret tx_ret; | 383 | ap_tx_ret tx_ret; |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index c3b3dfe43d1a..44c29b3f6728 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -11524,7 +11524,8 @@ static int ipw_prom_stop(struct net_device *dev) | |||
11524 | static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | 11524 | static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) |
11525 | { | 11525 | { |
11526 | IPW_DEBUG_INFO("prom dev->xmit\n"); | 11526 | IPW_DEBUG_INFO("prom dev->xmit\n"); |
11527 | return -EOPNOTSUPP; | 11527 | dev_kfree_skb(skb); |
11528 | return NETDEV_TX_OK; | ||
11528 | } | 11529 | } |
11529 | 11530 | ||
11530 | static const struct net_device_ops ipw_prom_netdev_ops = { | 11531 | static const struct net_device_ops ipw_prom_netdev_ops = { |
diff --git a/drivers/net/wireless/ipw2x00/libipw_tx.c b/drivers/net/wireless/ipw2x00/libipw_tx.c index 65a8195b3d90..da2ad5437ce5 100644 --- a/drivers/net/wireless/ipw2x00/libipw_tx.c +++ b/drivers/net/wireless/ipw2x00/libipw_tx.c | |||
@@ -539,7 +539,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
539 | spin_unlock_irqrestore(&ieee->lock, flags); | 539 | spin_unlock_irqrestore(&ieee->lock, flags); |
540 | netif_stop_queue(dev); | 540 | netif_stop_queue(dev); |
541 | dev->stats.tx_errors++; | 541 | dev->stats.tx_errors++; |
542 | return 1; | 542 | return NETDEV_TX_BUSY; |
543 | } | 543 | } |
544 | EXPORT_SYMBOL(ieee80211_xmit); | 544 | EXPORT_SYMBOL(ieee80211_xmit); |
545 | 545 | ||
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index ef3ef4551b31..8f6210993448 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -87,7 +87,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
87 | unsigned long flags; | 87 | unsigned long flags; |
88 | unsigned char wds_mac[6]; | 88 | unsigned char wds_mac[6]; |
89 | u32 curr_frag; | 89 | u32 curr_frag; |
90 | int err = 0; | ||
91 | 90 | ||
92 | #if VERBOSE > SHOW_ERROR_MESSAGES | 91 | #if VERBOSE > SHOW_ERROR_MESSAGES |
93 | DEBUG(SHOW_FUNCTION_CALLS, "islpci_eth_transmit \n"); | 92 | DEBUG(SHOW_FUNCTION_CALLS, "islpci_eth_transmit \n"); |
@@ -107,8 +106,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
107 | isl38xx_w32_flush(priv->device_base, ISL38XX_DEV_INT_UPDATE, | 106 | isl38xx_w32_flush(priv->device_base, ISL38XX_DEV_INT_UPDATE, |
108 | ISL38XX_DEV_INT_REG); | 107 | ISL38XX_DEV_INT_REG); |
109 | udelay(ISL38XX_WRITEIO_DELAY); | 108 | udelay(ISL38XX_WRITEIO_DELAY); |
110 | |||
111 | err = -EBUSY; | ||
112 | goto drop_free; | 109 | goto drop_free; |
113 | } | 110 | } |
114 | /* Check alignment and WDS frame formatting. The start of the packet should | 111 | /* Check alignment and WDS frame formatting. The start of the packet should |
@@ -152,7 +149,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
152 | if (unlikely(newskb == NULL)) { | 149 | if (unlikely(newskb == NULL)) { |
153 | printk(KERN_ERR "%s: Cannot allocate skb\n", | 150 | printk(KERN_ERR "%s: Cannot allocate skb\n", |
154 | ndev->name); | 151 | ndev->name); |
155 | err = -ENOMEM; | ||
156 | goto drop_free; | 152 | goto drop_free; |
157 | } | 153 | } |
158 | newskb_offset = (4 - (long) newskb->data) & 0x03; | 154 | newskb_offset = (4 - (long) newskb->data) & 0x03; |
@@ -197,8 +193,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
197 | if (unlikely(pci_map_address == 0)) { | 193 | if (unlikely(pci_map_address == 0)) { |
198 | printk(KERN_WARNING "%s: cannot map buffer to PCI\n", | 194 | printk(KERN_WARNING "%s: cannot map buffer to PCI\n", |
199 | ndev->name); | 195 | ndev->name); |
200 | |||
201 | err = -EIO; | ||
202 | goto drop_free; | 196 | goto drop_free; |
203 | } | 197 | } |
204 | /* Place the fragment in the control block structure. */ | 198 | /* Place the fragment in the control block structure. */ |
@@ -246,7 +240,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
246 | ndev->stats.tx_dropped++; | 240 | ndev->stats.tx_dropped++; |
247 | spin_unlock_irqrestore(&priv->slock, flags); | 241 | spin_unlock_irqrestore(&priv->slock, flags); |
248 | dev_kfree_skb(skb); | 242 | dev_kfree_skb(skb); |
249 | return err; | 243 | return NETDEV_TX_OK; |
250 | } | 244 | } |
251 | 245 | ||
252 | static inline int | 246 | static inline int |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 22e71856aa24..b10b0383dfa5 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -923,7 +923,7 @@ static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
923 | 923 | ||
924 | if (!(pcmcia_dev_present(link))) { | 924 | if (!(pcmcia_dev_present(link))) { |
925 | DEBUG(2, "ray_dev_start_xmit - device not present\n"); | 925 | DEBUG(2, "ray_dev_start_xmit - device not present\n"); |
926 | return -1; | 926 | return NETDEV_TX_LOCKED; |
927 | } | 927 | } |
928 | DEBUG(3, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev); | 928 | DEBUG(3, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev); |
929 | if (local->authentication_state == NEED_TO_AUTH) { | 929 | if (local->authentication_state == NEED_TO_AUTH) { |
@@ -931,7 +931,7 @@ static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
931 | if (!build_auth_frame(local, local->auth_id, OPEN_AUTH_REQUEST)) { | 931 | if (!build_auth_frame(local, local->auth_id, OPEN_AUTH_REQUEST)) { |
932 | local->authentication_state = AUTHENTICATED; | 932 | local->authentication_state = AUTHENTICATED; |
933 | netif_stop_queue(dev); | 933 | netif_stop_queue(dev); |
934 | return 1; | 934 | return NETDEV_TX_BUSY; |
935 | } | 935 | } |
936 | } | 936 | } |
937 | 937 | ||
@@ -944,7 +944,7 @@ static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
944 | case XMIT_NO_CCS: | 944 | case XMIT_NO_CCS: |
945 | case XMIT_NEED_AUTH: | 945 | case XMIT_NEED_AUTH: |
946 | netif_stop_queue(dev); | 946 | netif_stop_queue(dev); |
947 | return 1; | 947 | return NETDEV_TX_BUSY; |
948 | case XMIT_NO_INTR: | 948 | case XMIT_NO_INTR: |
949 | case XMIT_MSG_BAD: | 949 | case XMIT_MSG_BAD: |
950 | case XMIT_OK: | 950 | case XMIT_OK: |
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index b7b0c46adb46..38366a56b71f 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c | |||
@@ -1540,7 +1540,7 @@ static int strip_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1540 | if (!netif_running(dev)) { | 1540 | if (!netif_running(dev)) { |
1541 | printk(KERN_ERR "%s: xmit call when iface is down\n", | 1541 | printk(KERN_ERR "%s: xmit call when iface is down\n", |
1542 | dev->name); | 1542 | dev->name); |
1543 | return (1); | 1543 | return NETDEV_TX_BUSY; |
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | netif_stop_queue(dev); | 1546 | netif_stop_queue(dev); |
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c index 25d27b64f528..ab7fc5c0c8b4 100644 --- a/drivers/net/wireless/wavelan.c +++ b/drivers/net/wireless/wavelan.c | |||
@@ -2867,7 +2867,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev) | |||
2867 | spin_unlock_irqrestore(&lp->spinlock, flags); | 2867 | spin_unlock_irqrestore(&lp->spinlock, flags); |
2868 | /* Check that we can continue */ | 2868 | /* Check that we can continue */ |
2869 | if (lp->tx_n_in_use == (NTXBLOCKS - 1)) | 2869 | if (lp->tx_n_in_use == (NTXBLOCKS - 1)) |
2870 | return 1; | 2870 | return NETDEV_TX_BUSY; |
2871 | } | 2871 | } |
2872 | 2872 | ||
2873 | /* Do we need some padding? */ | 2873 | /* Do we need some padding? */ |
@@ -2880,10 +2880,10 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev) | |||
2880 | skb_copy_from_linear_data(skb, data, skb->len); | 2880 | skb_copy_from_linear_data(skb, data, skb->len); |
2881 | /* Write packet on the card */ | 2881 | /* Write packet on the card */ |
2882 | if(wv_packet_write(dev, data, ETH_ZLEN)) | 2882 | if(wv_packet_write(dev, data, ETH_ZLEN)) |
2883 | return 1; /* We failed */ | 2883 | return NETDEV_TX_BUSY; /* We failed */ |
2884 | } | 2884 | } |
2885 | else if(wv_packet_write(dev, skb->data, skb->len)) | 2885 | else if(wv_packet_write(dev, skb->data, skb->len)) |
2886 | return 1; /* We failed */ | 2886 | return NETDEV_TX_BUSY; /* We failed */ |
2887 | 2887 | ||
2888 | 2888 | ||
2889 | dev_kfree_skb(skb); | 2889 | dev_kfree_skb(skb); |
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 1f64d6033ab5..e3e96bb2c246 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
@@ -1348,6 +1348,7 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1348 | if (rc) { | 1348 | if (rc) { |
1349 | ++dev->stats.tx_dropped; | 1349 | ++dev->stats.tx_dropped; |
1350 | netif_stop_queue(dev); | 1350 | netif_stop_queue(dev); |
1351 | rc = NETDEV_TX_OK; | ||
1351 | } else { | 1352 | } else { |
1352 | ++dev->stats.tx_packets; | 1353 | ++dev->stats.tx_packets; |
1353 | dev->stats.tx_bytes += skb->len; | 1354 | dev->stats.tx_bytes += skb->len; |
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index 5fabd9c0f07a..4430b8d92e21 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c | |||
@@ -819,11 +819,11 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
819 | if (err) { | 819 | if (err) { |
820 | dev->stats.tx_errors++; | 820 | dev->stats.tx_errors++; |
821 | netif_start_queue(dev); | 821 | netif_start_queue(dev); |
822 | return err; | 822 | } else { |
823 | dev->stats.tx_packets++; | ||
824 | dev->stats.tx_bytes += skb->len; | ||
825 | dev->trans_start = jiffies; | ||
823 | } | 826 | } |
824 | dev->stats.tx_packets++; | ||
825 | dev->stats.tx_bytes += skb->len; | ||
826 | dev->trans_start = jiffies; | ||
827 | kfree_skb(skb); | 827 | kfree_skb(skb); |
828 | 828 | ||
829 | return 0; | 829 | return 0; |
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index 30a43cc79e76..7b6f46ddf3c3 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c | |||
@@ -338,12 +338,6 @@ claw_tx(struct sk_buff *skb, struct net_device *dev) | |||
338 | 338 | ||
339 | CLAW_DBF_TEXT(4, trace, "claw_tx"); | 339 | CLAW_DBF_TEXT(4, trace, "claw_tx"); |
340 | p_ch=&privptr->channel[WRITE]; | 340 | p_ch=&privptr->channel[WRITE]; |
341 | if (skb == NULL) { | ||
342 | privptr->stats.tx_dropped++; | ||
343 | privptr->stats.tx_errors++; | ||
344 | CLAW_DBF_TEXT_(2, trace, "clawtx%d", -EIO); | ||
345 | return -EIO; | ||
346 | } | ||
347 | spin_lock_irqsave(get_ccwdev_lock(p_ch->cdev), saveflags); | 341 | spin_lock_irqsave(get_ccwdev_lock(p_ch->cdev), saveflags); |
348 | rc=claw_hw_tx( skb, dev, 1 ); | 342 | rc=claw_hw_tx( skb, dev, 1 ); |
349 | spin_unlock_irqrestore(get_ccwdev_lock(p_ch->cdev), saveflags); | 343 | spin_unlock_irqrestore(get_ccwdev_lock(p_ch->cdev), saveflags); |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index be716e45f7ac..aec9e5d3cf4b 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -1315,9 +1315,9 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev) | |||
1315 | return NETDEV_TX_BUSY; | 1315 | return NETDEV_TX_BUSY; |
1316 | } | 1316 | } |
1317 | dev->trans_start = jiffies; | 1317 | dev->trans_start = jiffies; |
1318 | rc = netiucv_transmit_skb(privptr->conn, skb) != 0; | 1318 | rc = netiucv_transmit_skb(privptr->conn, skb); |
1319 | netiucv_clear_busy(dev); | 1319 | netiucv_clear_busy(dev); |
1320 | return rc; | 1320 | return rc ? NETDEV_TX_BUSY : NETDEV_TX_OK; |
1321 | } | 1321 | } |
1322 | 1322 | ||
1323 | /** | 1323 | /** |
diff --git a/drivers/staging/at76_usb/at76_usb.c b/drivers/staging/at76_usb/at76_usb.c index c8af9a868d62..3f303ae97b43 100644 --- a/drivers/staging/at76_usb/at76_usb.c +++ b/drivers/staging/at76_usb/at76_usb.c | |||
@@ -3242,12 +3242,11 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev) | |||
3242 | "%s: -EINVAL: tx urb %p hcpriv %p complete %p\n", | 3242 | "%s: -EINVAL: tx urb %p hcpriv %p complete %p\n", |
3243 | priv->netdev->name, priv->tx_urb, | 3243 | priv->netdev->name, priv->tx_urb, |
3244 | priv->tx_urb->hcpriv, priv->tx_urb->complete); | 3244 | priv->tx_urb->hcpriv, priv->tx_urb->complete); |
3245 | } else { | 3245 | } else |
3246 | stats->tx_bytes += skb->len; | 3246 | stats->tx_bytes += skb->len; |
3247 | dev_kfree_skb(skb); | ||
3248 | } | ||
3249 | 3247 | ||
3250 | return ret; | 3248 | dev_kfree_skb(skb); |
3249 | return NETDEV_TX_OK; | ||
3251 | } | 3250 | } |
3252 | 3251 | ||
3253 | static void at76_tx_timeout(struct net_device *netdev) | 3252 | static void at76_tx_timeout(struct net_device *netdev) |
diff --git a/drivers/staging/et131x/et131x_netdev.c b/drivers/staging/et131x/et131x_netdev.c index 951c73d5db20..59e99cc7786b 100644 --- a/drivers/staging/et131x/et131x_netdev.c +++ b/drivers/staging/et131x/et131x_netdev.c | |||
@@ -585,11 +585,11 @@ int et131x_tx(struct sk_buff *skb, struct net_device *netdev) | |||
585 | * available | 585 | * available |
586 | */ | 586 | */ |
587 | netif_stop_queue(netdev); | 587 | netif_stop_queue(netdev); |
588 | status = 1; | 588 | status = NETDEV_TX_BUSY; |
589 | } else { | 589 | } else { |
590 | DBG_WARNING(et131x_dbginfo, | 590 | DBG_WARNING(et131x_dbginfo, |
591 | "Misc error; drop packet\n"); | 591 | "Misc error; drop packet\n"); |
592 | status = 0; | 592 | status = NETDEV_TX_OK; |
593 | } | 593 | } |
594 | } | 594 | } |
595 | 595 | ||
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c index 33a0687252af..1294e05fcf13 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c | |||
@@ -814,7 +814,7 @@ int ieee80211_xmit(struct sk_buff *skb, | |||
814 | spin_unlock_irqrestore(&ieee->lock, flags); | 814 | spin_unlock_irqrestore(&ieee->lock, flags); |
815 | netif_stop_queue(dev); | 815 | netif_stop_queue(dev); |
816 | stats->tx_errors++; | 816 | stats->tx_errors++; |
817 | return 1; | 817 | return NETDEV_TX_BUSY; |
818 | 818 | ||
819 | } | 819 | } |
820 | 820 | ||
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 393e4df70dfd..bc0d764d851a 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c | |||
@@ -432,21 +432,21 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, | |||
432 | /* success and more buf */ | 432 | /* success and more buf */ |
433 | /* avail, re: hw_txdata */ | 433 | /* avail, re: hw_txdata */ |
434 | netif_wake_queue(wlandev->netdev); | 434 | netif_wake_queue(wlandev->netdev); |
435 | result = 0; | 435 | result = NETDEV_TX_OK; |
436 | } else if (txresult == 1) { | 436 | } else if (txresult == 1) { |
437 | /* success, no more avail */ | 437 | /* success, no more avail */ |
438 | pr_debug("txframe success, no more bufs\n"); | 438 | pr_debug("txframe success, no more bufs\n"); |
439 | /* netdev->tbusy = 1; don't set here, irqhdlr */ | 439 | /* netdev->tbusy = 1; don't set here, irqhdlr */ |
440 | /* may have already cleared it */ | 440 | /* may have already cleared it */ |
441 | result = 0; | 441 | result = NETDEV_TX_OK; |
442 | } else if (txresult == 2) { | 442 | } else if (txresult == 2) { |
443 | /* alloc failure, drop frame */ | 443 | /* alloc failure, drop frame */ |
444 | pr_debug("txframe returned alloc_fail\n"); | 444 | pr_debug("txframe returned alloc_fail\n"); |
445 | result = 1; | 445 | result = NETDEV_TX_BUSY; |
446 | } else { | 446 | } else { |
447 | /* buffer full or queue busy, drop frame. */ | 447 | /* buffer full or queue busy, drop frame. */ |
448 | pr_debug("txframe returned full or busy\n"); | 448 | pr_debug("txframe returned full or busy\n"); |
449 | result = 1; | 449 | result = NETDEV_TX_BUSY; |
450 | } | 450 | } |
451 | 451 | ||
452 | failed: | 452 | failed: |
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 4007770f7ed2..016f63b39028 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c | |||
@@ -520,7 +520,7 @@ static int eth_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
520 | */ | 520 | */ |
521 | if (list_empty(&dev->tx_reqs)) { | 521 | if (list_empty(&dev->tx_reqs)) { |
522 | spin_unlock_irqrestore(&dev->req_lock, flags); | 522 | spin_unlock_irqrestore(&dev->req_lock, flags); |
523 | return 1; | 523 | return NETDEV_TX_BUSY; |
524 | } | 524 | } |
525 | 525 | ||
526 | req = container_of(dev->tx_reqs.next, struct usb_request, list); | 526 | req = container_of(dev->tx_reqs.next, struct usb_request, list); |
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index 93150ecf3ea4..5d10ae364b5e 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h | |||
@@ -56,6 +56,18 @@ static inline int hlist_nulls_empty(const struct hlist_nulls_head *h) | |||
56 | return is_a_nulls(h->first); | 56 | return is_a_nulls(h->first); |
57 | } | 57 | } |
58 | 58 | ||
59 | static inline void hlist_nulls_add_head(struct hlist_nulls_node *n, | ||
60 | struct hlist_nulls_head *h) | ||
61 | { | ||
62 | struct hlist_nulls_node *first = h->first; | ||
63 | |||
64 | n->next = first; | ||
65 | n->pprev = &h->first; | ||
66 | h->first = n; | ||
67 | if (!is_a_nulls(first)) | ||
68 | first->pprev = &n->next; | ||
69 | } | ||
70 | |||
59 | static inline void __hlist_nulls_del(struct hlist_nulls_node *n) | 71 | static inline void __hlist_nulls_del(struct hlist_nulls_node *n) |
60 | { | 72 | { |
61 | struct hlist_nulls_node *next = n->next; | 73 | struct hlist_nulls_node *next = n->next; |
@@ -65,6 +77,12 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n) | |||
65 | next->pprev = pprev; | 77 | next->pprev = pprev; |
66 | } | 78 | } |
67 | 79 | ||
80 | static inline void hlist_nulls_del(struct hlist_nulls_node *n) | ||
81 | { | ||
82 | __hlist_nulls_del(n); | ||
83 | n->pprev = LIST_POISON2; | ||
84 | } | ||
85 | |||
68 | /** | 86 | /** |
69 | * hlist_nulls_for_each_entry - iterate over list of given type | 87 | * hlist_nulls_for_each_entry - iterate over list of given type |
70 | * @tpos: the type * to use as a loop cursor. | 88 | * @tpos: the type * to use as a loop cursor. |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index ecc79f959076..a632689b61b4 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -201,6 +201,8 @@ extern struct nf_conntrack_tuple_hash * | |||
201 | __nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple); | 201 | __nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple); |
202 | 202 | ||
203 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); | 203 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); |
204 | extern void nf_ct_delete_from_lists(struct nf_conn *ct); | ||
205 | extern void nf_ct_insert_dying_list(struct nf_conn *ct); | ||
204 | 206 | ||
205 | extern void nf_conntrack_flush_report(struct net *net, u32 pid, int report); | 207 | extern void nf_conntrack_flush_report(struct net *net, u32 pid, int report); |
206 | 208 | ||
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 1afb907e015a..4f20d58e2ab7 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -6,61 +6,54 @@ | |||
6 | #define _NF_CONNTRACK_ECACHE_H | 6 | #define _NF_CONNTRACK_ECACHE_H |
7 | #include <net/netfilter/nf_conntrack.h> | 7 | #include <net/netfilter/nf_conntrack.h> |
8 | 8 | ||
9 | #include <linux/interrupt.h> | ||
10 | #include <net/net_namespace.h> | 9 | #include <net/net_namespace.h> |
11 | #include <net/netfilter/nf_conntrack_expect.h> | 10 | #include <net/netfilter/nf_conntrack_expect.h> |
11 | #include <linux/netfilter/nf_conntrack_common.h> | ||
12 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | ||
13 | #include <net/netfilter/nf_conntrack_extend.h> | ||
12 | 14 | ||
13 | /* Connection tracking event bits */ | 15 | /* Connection tracking event types */ |
14 | enum ip_conntrack_events | 16 | enum ip_conntrack_events |
15 | { | 17 | { |
16 | /* New conntrack */ | 18 | IPCT_NEW = 0, /* new conntrack */ |
17 | IPCT_NEW_BIT = 0, | 19 | IPCT_RELATED = 1, /* related conntrack */ |
18 | IPCT_NEW = (1 << IPCT_NEW_BIT), | 20 | IPCT_DESTROY = 2, /* destroyed conntrack */ |
19 | 21 | IPCT_STATUS = 3, /* status has changed */ | |
20 | /* Expected connection */ | 22 | IPCT_PROTOINFO = 4, /* protocol information has changed */ |
21 | IPCT_RELATED_BIT = 1, | 23 | IPCT_HELPER = 5, /* new helper has been set */ |
22 | IPCT_RELATED = (1 << IPCT_RELATED_BIT), | 24 | IPCT_MARK = 6, /* new mark has been set */ |
23 | 25 | IPCT_NATSEQADJ = 7, /* NAT is doing sequence adjustment */ | |
24 | /* Destroyed conntrack */ | 26 | IPCT_SECMARK = 8, /* new security mark has been set */ |
25 | IPCT_DESTROY_BIT = 2, | 27 | }; |
26 | IPCT_DESTROY = (1 << IPCT_DESTROY_BIT), | ||
27 | |||
28 | /* Status has changed */ | ||
29 | IPCT_STATUS_BIT = 3, | ||
30 | IPCT_STATUS = (1 << IPCT_STATUS_BIT), | ||
31 | 28 | ||
32 | /* Update of protocol info */ | 29 | enum ip_conntrack_expect_events { |
33 | IPCT_PROTOINFO_BIT = 4, | 30 | IPEXP_NEW = 0, /* new expectation */ |
34 | IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT), | 31 | }; |
35 | 32 | ||
36 | /* New helper for conntrack */ | 33 | struct nf_conntrack_ecache { |
37 | IPCT_HELPER_BIT = 5, | 34 | unsigned long cache; /* bitops want long */ |
38 | IPCT_HELPER = (1 << IPCT_HELPER_BIT), | 35 | unsigned long missed; /* missed events */ |
36 | u32 pid; /* netlink pid of destroyer */ | ||
37 | }; | ||
39 | 38 | ||
40 | /* Mark is set */ | 39 | static inline struct nf_conntrack_ecache * |
41 | IPCT_MARK_BIT = 6, | 40 | nf_ct_ecache_find(const struct nf_conn *ct) |
42 | IPCT_MARK = (1 << IPCT_MARK_BIT), | 41 | { |
42 | return nf_ct_ext_find(ct, NF_CT_EXT_ECACHE); | ||
43 | } | ||
43 | 44 | ||
44 | /* NAT sequence adjustment */ | 45 | static inline struct nf_conntrack_ecache * |
45 | IPCT_NATSEQADJ_BIT = 7, | 46 | nf_ct_ecache_ext_add(struct nf_conn *ct, gfp_t gfp) |
46 | IPCT_NATSEQADJ = (1 << IPCT_NATSEQADJ_BIT), | 47 | { |
48 | struct net *net = nf_ct_net(ct); | ||
47 | 49 | ||
48 | /* Secmark is set */ | 50 | if (!net->ct.sysctl_events) |
49 | IPCT_SECMARK_BIT = 8, | 51 | return NULL; |
50 | IPCT_SECMARK = (1 << IPCT_SECMARK_BIT), | ||
51 | }; | ||
52 | 52 | ||
53 | enum ip_conntrack_expect_events { | 53 | return nf_ct_ext_add(ct, NF_CT_EXT_ECACHE, gfp); |
54 | IPEXP_NEW_BIT = 0, | ||
55 | IPEXP_NEW = (1 << IPEXP_NEW_BIT), | ||
56 | }; | 54 | }; |
57 | 55 | ||
58 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | 56 | #ifdef CONFIG_NF_CONNTRACK_EVENTS |
59 | struct nf_conntrack_ecache { | ||
60 | struct nf_conn *ct; | ||
61 | unsigned int events; | ||
62 | }; | ||
63 | |||
64 | /* This structure is passed to event handler */ | 57 | /* This structure is passed to event handler */ |
65 | struct nf_ct_event { | 58 | struct nf_ct_event { |
66 | struct nf_conn *ct; | 59 | struct nf_conn *ct; |
@@ -76,53 +69,88 @@ extern struct nf_ct_event_notifier *nf_conntrack_event_cb; | |||
76 | extern int nf_conntrack_register_notifier(struct nf_ct_event_notifier *nb); | 69 | extern int nf_conntrack_register_notifier(struct nf_ct_event_notifier *nb); |
77 | extern void nf_conntrack_unregister_notifier(struct nf_ct_event_notifier *nb); | 70 | extern void nf_conntrack_unregister_notifier(struct nf_ct_event_notifier *nb); |
78 | 71 | ||
79 | extern void nf_ct_deliver_cached_events(const struct nf_conn *ct); | 72 | extern void nf_ct_deliver_cached_events(struct nf_conn *ct); |
80 | extern void __nf_ct_event_cache_init(struct nf_conn *ct); | ||
81 | extern void nf_ct_event_cache_flush(struct net *net); | ||
82 | 73 | ||
83 | static inline void | 74 | static inline void |
84 | nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | 75 | nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) |
85 | { | 76 | { |
86 | struct net *net = nf_ct_net(ct); | 77 | struct nf_conntrack_ecache *e; |
87 | struct nf_conntrack_ecache *ecache; | 78 | |
88 | 79 | if (nf_conntrack_event_cb == NULL) | |
89 | local_bh_disable(); | 80 | return; |
90 | ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id()); | 81 | |
91 | if (ct != ecache->ct) | 82 | e = nf_ct_ecache_find(ct); |
92 | __nf_ct_event_cache_init(ct); | 83 | if (e == NULL) |
93 | ecache->events |= event; | 84 | return; |
94 | local_bh_enable(); | 85 | |
86 | set_bit(event, &e->cache); | ||
95 | } | 87 | } |
96 | 88 | ||
97 | static inline void | 89 | static inline int |
98 | nf_conntrack_event_report(enum ip_conntrack_events event, | 90 | nf_conntrack_eventmask_report(unsigned int eventmask, |
99 | struct nf_conn *ct, | 91 | struct nf_conn *ct, |
100 | u32 pid, | 92 | u32 pid, |
101 | int report) | 93 | int report) |
102 | { | 94 | { |
95 | int ret = 0; | ||
96 | struct net *net = nf_ct_net(ct); | ||
103 | struct nf_ct_event_notifier *notify; | 97 | struct nf_ct_event_notifier *notify; |
98 | struct nf_conntrack_ecache *e; | ||
104 | 99 | ||
105 | rcu_read_lock(); | 100 | rcu_read_lock(); |
106 | notify = rcu_dereference(nf_conntrack_event_cb); | 101 | notify = rcu_dereference(nf_conntrack_event_cb); |
107 | if (notify == NULL) | 102 | if (notify == NULL) |
108 | goto out_unlock; | 103 | goto out_unlock; |
109 | 104 | ||
105 | if (!net->ct.sysctl_events) | ||
106 | goto out_unlock; | ||
107 | |||
108 | e = nf_ct_ecache_find(ct); | ||
109 | if (e == NULL) | ||
110 | goto out_unlock; | ||
111 | |||
110 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) { | 112 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) { |
111 | struct nf_ct_event item = { | 113 | struct nf_ct_event item = { |
112 | .ct = ct, | 114 | .ct = ct, |
113 | .pid = pid, | 115 | .pid = e->pid ? e->pid : pid, |
114 | .report = report | 116 | .report = report |
115 | }; | 117 | }; |
116 | notify->fcn(event, &item); | 118 | /* This is a resent of a destroy event? If so, skip missed */ |
119 | unsigned long missed = e->pid ? 0 : e->missed; | ||
120 | |||
121 | ret = notify->fcn(eventmask | missed, &item); | ||
122 | if (unlikely(ret < 0 || missed)) { | ||
123 | spin_lock_bh(&ct->lock); | ||
124 | if (ret < 0) { | ||
125 | /* This is a destroy event that has been | ||
126 | * triggered by a process, we store the PID | ||
127 | * to include it in the retransmission. */ | ||
128 | if (eventmask & (1 << IPCT_DESTROY) && | ||
129 | e->pid == 0 && pid != 0) | ||
130 | e->pid = pid; | ||
131 | else | ||
132 | e->missed |= eventmask; | ||
133 | } else | ||
134 | e->missed &= ~missed; | ||
135 | spin_unlock_bh(&ct->lock); | ||
136 | } | ||
117 | } | 137 | } |
118 | out_unlock: | 138 | out_unlock: |
119 | rcu_read_unlock(); | 139 | rcu_read_unlock(); |
140 | return ret; | ||
120 | } | 141 | } |
121 | 142 | ||
122 | static inline void | 143 | static inline int |
144 | nf_conntrack_event_report(enum ip_conntrack_events event, struct nf_conn *ct, | ||
145 | u32 pid, int report) | ||
146 | { | ||
147 | return nf_conntrack_eventmask_report(1 << event, ct, pid, report); | ||
148 | } | ||
149 | |||
150 | static inline int | ||
123 | nf_conntrack_event(enum ip_conntrack_events event, struct nf_conn *ct) | 151 | nf_conntrack_event(enum ip_conntrack_events event, struct nf_conn *ct) |
124 | { | 152 | { |
125 | nf_conntrack_event_report(event, ct, 0, 0); | 153 | return nf_conntrack_eventmask_report(1 << event, ct, 0, 0); |
126 | } | 154 | } |
127 | 155 | ||
128 | struct nf_exp_event { | 156 | struct nf_exp_event { |
@@ -145,6 +173,7 @@ nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | |||
145 | u32 pid, | 173 | u32 pid, |
146 | int report) | 174 | int report) |
147 | { | 175 | { |
176 | struct net *net = nf_ct_exp_net(exp); | ||
148 | struct nf_exp_event_notifier *notify; | 177 | struct nf_exp_event_notifier *notify; |
149 | 178 | ||
150 | rcu_read_lock(); | 179 | rcu_read_lock(); |
@@ -152,13 +181,16 @@ nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | |||
152 | if (notify == NULL) | 181 | if (notify == NULL) |
153 | goto out_unlock; | 182 | goto out_unlock; |
154 | 183 | ||
184 | if (!net->ct.sysctl_events) | ||
185 | goto out_unlock; | ||
186 | |||
155 | { | 187 | { |
156 | struct nf_exp_event item = { | 188 | struct nf_exp_event item = { |
157 | .exp = exp, | 189 | .exp = exp, |
158 | .pid = pid, | 190 | .pid = pid, |
159 | .report = report | 191 | .report = report |
160 | }; | 192 | }; |
161 | notify->fcn(event, &item); | 193 | notify->fcn(1 << event, &item); |
162 | } | 194 | } |
163 | out_unlock: | 195 | out_unlock: |
164 | rcu_read_unlock(); | 196 | rcu_read_unlock(); |
@@ -178,12 +210,16 @@ extern void nf_conntrack_ecache_fini(struct net *net); | |||
178 | 210 | ||
179 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, | 211 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, |
180 | struct nf_conn *ct) {} | 212 | struct nf_conn *ct) {} |
181 | static inline void nf_conntrack_event(enum ip_conntrack_events event, | 213 | static inline int nf_conntrack_eventmask_report(unsigned int eventmask, |
182 | struct nf_conn *ct) {} | 214 | struct nf_conn *ct, |
183 | static inline void nf_conntrack_event_report(enum ip_conntrack_events event, | 215 | u32 pid, |
184 | struct nf_conn *ct, | 216 | int report) { return 0; } |
185 | u32 pid, | 217 | static inline int nf_conntrack_event(enum ip_conntrack_events event, |
186 | int report) {} | 218 | struct nf_conn *ct) { return 0; } |
219 | static inline int nf_conntrack_event_report(enum ip_conntrack_events event, | ||
220 | struct nf_conn *ct, | ||
221 | u32 pid, | ||
222 | int report) { return 0; } | ||
187 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} | 223 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} |
188 | static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event, | 224 | static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event, |
189 | struct nf_conntrack_expect *exp) {} | 225 | struct nf_conntrack_expect *exp) {} |
@@ -191,7 +227,6 @@ static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e, | |||
191 | struct nf_conntrack_expect *exp, | 227 | struct nf_conntrack_expect *exp, |
192 | u32 pid, | 228 | u32 pid, |
193 | int report) {} | 229 | int report) {} |
194 | static inline void nf_ct_event_cache_flush(struct net *net) {} | ||
195 | 230 | ||
196 | static inline int nf_conntrack_ecache_init(struct net *net) | 231 | static inline int nf_conntrack_ecache_init(struct net *net) |
197 | { | 232 | { |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index da8ee52613a5..7f8fc5d123c5 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -8,12 +8,14 @@ enum nf_ct_ext_id | |||
8 | NF_CT_EXT_HELPER, | 8 | NF_CT_EXT_HELPER, |
9 | NF_CT_EXT_NAT, | 9 | NF_CT_EXT_NAT, |
10 | NF_CT_EXT_ACCT, | 10 | NF_CT_EXT_ACCT, |
11 | NF_CT_EXT_ECACHE, | ||
11 | NF_CT_EXT_NUM, | 12 | NF_CT_EXT_NUM, |
12 | }; | 13 | }; |
13 | 14 | ||
14 | #define NF_CT_EXT_HELPER_TYPE struct nf_conn_help | 15 | #define NF_CT_EXT_HELPER_TYPE struct nf_conn_help |
15 | #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat | 16 | #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat |
16 | #define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter | 17 | #define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter |
18 | #define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache | ||
17 | 19 | ||
18 | /* Extensions: optional stuff which isn't permanently in struct. */ | 20 | /* Extensions: optional stuff which isn't permanently in struct. */ |
19 | struct nf_ct_ext { | 21 | struct nf_ct_ext { |
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index ee2a4b369a04..1b7068000927 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -50,6 +50,8 @@ extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); | |||
50 | 50 | ||
51 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, gfp_t flags); | 51 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, gfp_t flags); |
52 | 52 | ||
53 | extern void nf_ct_helper_destroy(struct nf_conn *ct); | ||
54 | |||
53 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | 55 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) |
54 | { | 56 | { |
55 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); | 57 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); |
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index 9dc58402bc09..ba1ba0c5efd1 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -14,16 +14,17 @@ struct netns_ct { | |||
14 | struct hlist_nulls_head *hash; | 14 | struct hlist_nulls_head *hash; |
15 | struct hlist_head *expect_hash; | 15 | struct hlist_head *expect_hash; |
16 | struct hlist_nulls_head unconfirmed; | 16 | struct hlist_nulls_head unconfirmed; |
17 | struct hlist_nulls_head dying; | ||
17 | struct ip_conntrack_stat *stat; | 18 | struct ip_conntrack_stat *stat; |
18 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | 19 | int sysctl_events; |
19 | struct nf_conntrack_ecache *ecache; | 20 | unsigned int sysctl_events_retry_timeout; |
20 | #endif | ||
21 | int sysctl_acct; | 21 | int sysctl_acct; |
22 | int sysctl_checksum; | 22 | int sysctl_checksum; |
23 | unsigned int sysctl_log_invalid; /* Log invalid packets */ | 23 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
24 | #ifdef CONFIG_SYSCTL | 24 | #ifdef CONFIG_SYSCTL |
25 | struct ctl_table_header *sysctl_header; | 25 | struct ctl_table_header *sysctl_header; |
26 | struct ctl_table_header *acct_sysctl_header; | 26 | struct ctl_table_header *acct_sysctl_header; |
27 | struct ctl_table_header *event_sysctl_header; | ||
27 | #endif | 28 | #endif |
28 | int hash_vmalloc; | 29 | int hash_vmalloc; |
29 | int expect_vmalloc; | 30 | int expect_vmalloc; |
diff --git a/net/atm/lec.c b/net/atm/lec.c index 199b6bb79f42..ff2e594dca9b 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -34,7 +34,6 @@ | |||
34 | 34 | ||
35 | /* Proxy LEC knows about bridging */ | 35 | /* Proxy LEC knows about bridging */ |
36 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) | 36 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) |
37 | #include <linux/if_bridge.h> | ||
38 | #include "../bridge/br_private.h" | 37 | #include "../bridge/br_private.h" |
39 | 38 | ||
40 | static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 }; | 39 | static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 }; |
@@ -271,7 +270,8 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
271 | printk("%s:No lecd attached\n", dev->name); | 270 | printk("%s:No lecd attached\n", dev->name); |
272 | dev->stats.tx_errors++; | 271 | dev->stats.tx_errors++; |
273 | netif_stop_queue(dev); | 272 | netif_stop_queue(dev); |
274 | return -EUNATCH; | 273 | kfree_skb(skb); |
274 | return NETDEV_TX_OK; | ||
275 | } | 275 | } |
276 | 276 | ||
277 | pr_debug("skbuff head:%lx data:%lx tail:%lx end:%lx\n", | 277 | pr_debug("skbuff head:%lx data:%lx tail:%lx end:%lx\n", |
@@ -518,18 +518,14 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
518 | case l_should_bridge: | 518 | case l_should_bridge: |
519 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) | 519 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) |
520 | { | 520 | { |
521 | struct net_bridge_fdb_entry *f; | ||
522 | |||
523 | pr_debug("%s: bridge zeppelin asks about %pM\n", | 521 | pr_debug("%s: bridge zeppelin asks about %pM\n", |
524 | dev->name, mesg->content.proxy.mac_addr); | 522 | dev->name, mesg->content.proxy.mac_addr); |
525 | 523 | ||
526 | if (br_fdb_get_hook == NULL || dev->br_port == NULL) | 524 | if (br_fdb_test_addr_hook == NULL) |
527 | break; | 525 | break; |
528 | 526 | ||
529 | f = br_fdb_get_hook(dev->br_port->br, | 527 | if (br_fdb_test_addr_hook(dev, |
530 | mesg->content.proxy.mac_addr); | 528 | mesg->content.proxy.mac_addr)) { |
531 | if (f != NULL && f->dst->dev != dev | ||
532 | && f->dst->state == BR_STATE_FORWARDING) { | ||
533 | /* hit from bridge table, send LE_ARP_RESPONSE */ | 529 | /* hit from bridge table, send LE_ARP_RESPONSE */ |
534 | struct sk_buff *skb2; | 530 | struct sk_buff *skb2; |
535 | struct sock *sk; | 531 | struct sock *sk; |
@@ -540,10 +536,8 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
540 | skb2 = | 536 | skb2 = |
541 | alloc_skb(sizeof(struct atmlec_msg), | 537 | alloc_skb(sizeof(struct atmlec_msg), |
542 | GFP_ATOMIC); | 538 | GFP_ATOMIC); |
543 | if (skb2 == NULL) { | 539 | if (skb2 == NULL) |
544 | br_fdb_put_hook(f); | ||
545 | break; | 540 | break; |
546 | } | ||
547 | skb2->len = sizeof(struct atmlec_msg); | 541 | skb2->len = sizeof(struct atmlec_msg); |
548 | skb_copy_to_linear_data(skb2, mesg, | 542 | skb_copy_to_linear_data(skb2, mesg, |
549 | sizeof(*mesg)); | 543 | sizeof(*mesg)); |
@@ -552,8 +546,6 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
552 | skb_queue_tail(&sk->sk_receive_queue, skb2); | 546 | skb_queue_tail(&sk->sk_receive_queue, skb2); |
553 | sk->sk_data_ready(sk, skb2->len); | 547 | sk->sk_data_ready(sk, skb2->len); |
554 | } | 548 | } |
555 | if (f != NULL) | ||
556 | br_fdb_put_hook(f); | ||
557 | } | 549 | } |
558 | #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ | 550 | #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ |
559 | break; | 551 | break; |
diff --git a/net/bridge/br.c b/net/bridge/br.c index 4d2c1f1cb524..9aac5213105a 100644 --- a/net/bridge/br.c +++ b/net/bridge/br.c | |||
@@ -65,8 +65,9 @@ static int __init br_init(void) | |||
65 | brioctl_set(br_ioctl_deviceless_stub); | 65 | brioctl_set(br_ioctl_deviceless_stub); |
66 | br_handle_frame_hook = br_handle_frame; | 66 | br_handle_frame_hook = br_handle_frame; |
67 | 67 | ||
68 | br_fdb_get_hook = br_fdb_get; | 68 | #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) |
69 | br_fdb_put_hook = br_fdb_put; | 69 | br_fdb_test_addr_hook = br_fdb_test_addr; |
70 | #endif | ||
70 | 71 | ||
71 | return 0; | 72 | return 0; |
72 | err_out4: | 73 | err_out4: |
@@ -95,8 +96,9 @@ static void __exit br_deinit(void) | |||
95 | synchronize_net(); | 96 | synchronize_net(); |
96 | 97 | ||
97 | br_netfilter_fini(); | 98 | br_netfilter_fini(); |
98 | br_fdb_get_hook = NULL; | 99 | #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) |
99 | br_fdb_put_hook = NULL; | 100 | br_fdb_test_addr_hook = NULL; |
101 | #endif | ||
100 | 102 | ||
101 | br_handle_frame_hook = NULL; | 103 | br_handle_frame_hook = NULL; |
102 | br_fdb_fini(); | 104 | br_fdb_fini(); |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index cb3e97b93aeb..57bf05c353bc 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -71,10 +71,17 @@ static inline int br_mac_hash(const unsigned char *mac) | |||
71 | return jhash_1word(key, fdb_salt) & (BR_HASH_SIZE - 1); | 71 | return jhash_1word(key, fdb_salt) & (BR_HASH_SIZE - 1); |
72 | } | 72 | } |
73 | 73 | ||
74 | static void fdb_rcu_free(struct rcu_head *head) | ||
75 | { | ||
76 | struct net_bridge_fdb_entry *ent | ||
77 | = container_of(head, struct net_bridge_fdb_entry, rcu); | ||
78 | kmem_cache_free(br_fdb_cache, ent); | ||
79 | } | ||
80 | |||
74 | static inline void fdb_delete(struct net_bridge_fdb_entry *f) | 81 | static inline void fdb_delete(struct net_bridge_fdb_entry *f) |
75 | { | 82 | { |
76 | hlist_del_rcu(&f->hlist); | 83 | hlist_del_rcu(&f->hlist); |
77 | br_fdb_put(f); | 84 | call_rcu(&f->rcu, fdb_rcu_free); |
78 | } | 85 | } |
79 | 86 | ||
80 | void br_fdb_changeaddr(struct net_bridge_port *p, const unsigned char *newaddr) | 87 | void br_fdb_changeaddr(struct net_bridge_port *p, const unsigned char *newaddr) |
@@ -226,33 +233,26 @@ struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br, | |||
226 | return NULL; | 233 | return NULL; |
227 | } | 234 | } |
228 | 235 | ||
229 | /* Interface used by ATM hook that keeps a ref count */ | 236 | #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) |
230 | struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br, | 237 | /* Interface used by ATM LANE hook to test |
231 | unsigned char *addr) | 238 | * if an addr is on some other bridge port */ |
239 | int br_fdb_test_addr(struct net_device *dev, unsigned char *addr) | ||
232 | { | 240 | { |
233 | struct net_bridge_fdb_entry *fdb; | 241 | struct net_bridge_fdb_entry *fdb; |
242 | int ret; | ||
243 | |||
244 | if (!dev->br_port) | ||
245 | return 0; | ||
234 | 246 | ||
235 | rcu_read_lock(); | 247 | rcu_read_lock(); |
236 | fdb = __br_fdb_get(br, addr); | 248 | fdb = __br_fdb_get(dev->br_port->br, addr); |
237 | if (fdb && !atomic_inc_not_zero(&fdb->use_count)) | 249 | ret = fdb && fdb->dst->dev != dev && |
238 | fdb = NULL; | 250 | fdb->dst->state == BR_STATE_FORWARDING; |
239 | rcu_read_unlock(); | 251 | rcu_read_unlock(); |
240 | return fdb; | ||
241 | } | ||
242 | |||
243 | static void fdb_rcu_free(struct rcu_head *head) | ||
244 | { | ||
245 | struct net_bridge_fdb_entry *ent | ||
246 | = container_of(head, struct net_bridge_fdb_entry, rcu); | ||
247 | kmem_cache_free(br_fdb_cache, ent); | ||
248 | } | ||
249 | 252 | ||
250 | /* Set entry up for deletion with RCU */ | 253 | return ret; |
251 | void br_fdb_put(struct net_bridge_fdb_entry *ent) | ||
252 | { | ||
253 | if (atomic_dec_and_test(&ent->use_count)) | ||
254 | call_rcu(&ent->rcu, fdb_rcu_free); | ||
255 | } | 254 | } |
255 | #endif /* CONFIG_ATM_LANE */ | ||
256 | 256 | ||
257 | /* | 257 | /* |
258 | * Fill buffer with forwarding table records in | 258 | * Fill buffer with forwarding table records in |
@@ -326,7 +326,6 @@ static struct net_bridge_fdb_entry *fdb_create(struct hlist_head *head, | |||
326 | fdb = kmem_cache_alloc(br_fdb_cache, GFP_ATOMIC); | 326 | fdb = kmem_cache_alloc(br_fdb_cache, GFP_ATOMIC); |
327 | if (fdb) { | 327 | if (fdb) { |
328 | memcpy(fdb->addr.addr, addr, ETH_ALEN); | 328 | memcpy(fdb->addr.addr, addr, ETH_ALEN); |
329 | atomic_set(&fdb->use_count, 1); | ||
330 | hlist_add_head_rcu(&fdb->hlist, head); | 329 | hlist_add_head_rcu(&fdb->hlist, head); |
331 | 330 | ||
332 | fdb->dst = source; | 331 | fdb->dst = source; |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index b6c3b71974dc..d5b5537272b4 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -51,7 +51,6 @@ struct net_bridge_fdb_entry | |||
51 | struct net_bridge_port *dst; | 51 | struct net_bridge_port *dst; |
52 | 52 | ||
53 | struct rcu_head rcu; | 53 | struct rcu_head rcu; |
54 | atomic_t use_count; | ||
55 | unsigned long ageing_timer; | 54 | unsigned long ageing_timer; |
56 | mac_addr addr; | 55 | mac_addr addr; |
57 | unsigned char is_local; | 56 | unsigned char is_local; |
@@ -154,9 +153,7 @@ extern void br_fdb_delete_by_port(struct net_bridge *br, | |||
154 | const struct net_bridge_port *p, int do_all); | 153 | const struct net_bridge_port *p, int do_all); |
155 | extern struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br, | 154 | extern struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br, |
156 | const unsigned char *addr); | 155 | const unsigned char *addr); |
157 | extern struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br, | 156 | extern int br_fdb_test_addr(struct net_device *dev, unsigned char *addr); |
158 | unsigned char *addr); | ||
159 | extern void br_fdb_put(struct net_bridge_fdb_entry *ent); | ||
160 | extern int br_fdb_fillbuf(struct net_bridge *br, void *buf, | 157 | extern int br_fdb_fillbuf(struct net_bridge *br, void *buf, |
161 | unsigned long count, unsigned long off); | 158 | unsigned long count, unsigned long off); |
162 | extern int br_fdb_insert(struct net_bridge *br, | 159 | extern int br_fdb_insert(struct net_bridge *br, |
@@ -242,10 +239,9 @@ extern void br_stp_port_timer_init(struct net_bridge_port *p); | |||
242 | extern unsigned long br_timer_value(const struct timer_list *timer); | 239 | extern unsigned long br_timer_value(const struct timer_list *timer); |
243 | 240 | ||
244 | /* br.c */ | 241 | /* br.c */ |
245 | extern struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge *br, | 242 | #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) |
246 | unsigned char *addr); | 243 | extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr); |
247 | extern void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent); | 244 | #endif |
248 | |||
249 | 245 | ||
250 | /* br_netlink.c */ | 246 | /* br_netlink.c */ |
251 | extern int br_netlink_init(void); | 247 | extern int br_netlink_init(void); |
diff --git a/net/core/dev.c b/net/core/dev.c index 11560e3258b5..ea00e36f48e1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2071,11 +2071,13 @@ static inline int deliver_skb(struct sk_buff *skb, | |||
2071 | } | 2071 | } |
2072 | 2072 | ||
2073 | #if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) | 2073 | #if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) |
2074 | /* These hooks defined here for ATM */ | 2074 | |
2075 | struct net_bridge; | 2075 | #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) |
2076 | struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge *br, | 2076 | /* This hook is defined here for ATM LANE */ |
2077 | unsigned char *addr); | 2077 | int (*br_fdb_test_addr_hook)(struct net_device *dev, |
2078 | void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent) __read_mostly; | 2078 | unsigned char *addr) __read_mostly; |
2079 | EXPORT_SYMBOL(br_fdb_test_addr_hook); | ||
2080 | #endif | ||
2079 | 2081 | ||
2080 | /* | 2082 | /* |
2081 | * If bridge module is loaded call bridging hook. | 2083 | * If bridge module is loaded call bridging hook. |
@@ -2083,6 +2085,8 @@ void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent) __read_mostly; | |||
2083 | */ | 2085 | */ |
2084 | struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p, | 2086 | struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p, |
2085 | struct sk_buff *skb) __read_mostly; | 2087 | struct sk_buff *skb) __read_mostly; |
2088 | EXPORT_SYMBOL(br_handle_frame_hook); | ||
2089 | |||
2086 | static inline struct sk_buff *handle_bridge(struct sk_buff *skb, | 2090 | static inline struct sk_buff *handle_bridge(struct sk_buff *skb, |
2087 | struct packet_type **pt_prev, int *ret, | 2091 | struct packet_type **pt_prev, int *ret, |
2088 | struct net_device *orig_dev) | 2092 | struct net_device *orig_dev) |
@@ -4209,7 +4213,7 @@ static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cm | |||
4209 | 4213 | ||
4210 | switch (cmd) { | 4214 | switch (cmd) { |
4211 | case SIOCGIFFLAGS: /* Get interface flags */ | 4215 | case SIOCGIFFLAGS: /* Get interface flags */ |
4212 | ifr->ifr_flags = dev_get_flags(dev); | 4216 | ifr->ifr_flags = (short) dev_get_flags(dev); |
4213 | return 0; | 4217 | return 0; |
4214 | 4218 | ||
4215 | case SIOCGIFMETRIC: /* Get the metric on the interface | 4219 | case SIOCGIFMETRIC: /* Get the metric on the interface |
@@ -5665,12 +5669,6 @@ EXPORT_SYMBOL(net_enable_timestamp); | |||
5665 | EXPORT_SYMBOL(net_disable_timestamp); | 5669 | EXPORT_SYMBOL(net_disable_timestamp); |
5666 | EXPORT_SYMBOL(dev_get_flags); | 5670 | EXPORT_SYMBOL(dev_get_flags); |
5667 | 5671 | ||
5668 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) | ||
5669 | EXPORT_SYMBOL(br_handle_frame_hook); | ||
5670 | EXPORT_SYMBOL(br_fdb_get_hook); | ||
5671 | EXPORT_SYMBOL(br_fdb_put_hook); | ||
5672 | #endif | ||
5673 | |||
5674 | EXPORT_SYMBOL(dev_load); | 5672 | EXPORT_SYMBOL(dev_load); |
5675 | 5673 | ||
5676 | EXPORT_PER_CPU_SYMBOL(softnet_data); | 5674 | EXPORT_PER_CPU_SYMBOL(softnet_data); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 364222bfb10d..d238a8939a09 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1615,7 +1615,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1615 | { | 1615 | { |
1616 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1616 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1617 | struct ieee80211_local *local = sdata->local; | 1617 | struct ieee80211_local *local = sdata->local; |
1618 | int ret = 1, head_need; | 1618 | int ret = NETDEV_TX_BUSY, head_need; |
1619 | u16 ethertype, hdrlen, meshhdrlen = 0; | 1619 | u16 ethertype, hdrlen, meshhdrlen = 0; |
1620 | __le16 fc; | 1620 | __le16 fc; |
1621 | struct ieee80211_hdr hdr; | 1621 | struct ieee80211_hdr hdr; |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index edf95695e0aa..5f72b94b4918 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <net/netfilter/nf_conntrack_core.h> | 39 | #include <net/netfilter/nf_conntrack_core.h> |
40 | #include <net/netfilter/nf_conntrack_extend.h> | 40 | #include <net/netfilter/nf_conntrack_extend.h> |
41 | #include <net/netfilter/nf_conntrack_acct.h> | 41 | #include <net/netfilter/nf_conntrack_acct.h> |
42 | #include <net/netfilter/nf_conntrack_ecache.h> | ||
42 | #include <net/netfilter/nf_nat.h> | 43 | #include <net/netfilter/nf_nat.h> |
43 | #include <net/netfilter/nf_nat_core.h> | 44 | #include <net/netfilter/nf_nat_core.h> |
44 | 45 | ||
@@ -182,10 +183,6 @@ destroy_conntrack(struct nf_conntrack *nfct) | |||
182 | NF_CT_ASSERT(atomic_read(&nfct->use) == 0); | 183 | NF_CT_ASSERT(atomic_read(&nfct->use) == 0); |
183 | NF_CT_ASSERT(!timer_pending(&ct->timeout)); | 184 | NF_CT_ASSERT(!timer_pending(&ct->timeout)); |
184 | 185 | ||
185 | if (!test_bit(IPS_DYING_BIT, &ct->status)) | ||
186 | nf_conntrack_event(IPCT_DESTROY, ct); | ||
187 | set_bit(IPS_DYING_BIT, &ct->status); | ||
188 | |||
189 | /* To make sure we don't get any weird locking issues here: | 186 | /* To make sure we don't get any weird locking issues here: |
190 | * destroy_conntrack() MUST NOT be called with a write lock | 187 | * destroy_conntrack() MUST NOT be called with a write lock |
191 | * to nf_conntrack_lock!!! -HW */ | 188 | * to nf_conntrack_lock!!! -HW */ |
@@ -219,27 +216,70 @@ destroy_conntrack(struct nf_conntrack *nfct) | |||
219 | nf_conntrack_free(ct); | 216 | nf_conntrack_free(ct); |
220 | } | 217 | } |
221 | 218 | ||
222 | static void death_by_timeout(unsigned long ul_conntrack) | 219 | void nf_ct_delete_from_lists(struct nf_conn *ct) |
223 | { | 220 | { |
224 | struct nf_conn *ct = (void *)ul_conntrack; | ||
225 | struct net *net = nf_ct_net(ct); | 221 | struct net *net = nf_ct_net(ct); |
226 | struct nf_conn_help *help = nfct_help(ct); | ||
227 | struct nf_conntrack_helper *helper; | ||
228 | |||
229 | if (help) { | ||
230 | rcu_read_lock(); | ||
231 | helper = rcu_dereference(help->helper); | ||
232 | if (helper && helper->destroy) | ||
233 | helper->destroy(ct); | ||
234 | rcu_read_unlock(); | ||
235 | } | ||
236 | 222 | ||
223 | nf_ct_helper_destroy(ct); | ||
237 | spin_lock_bh(&nf_conntrack_lock); | 224 | spin_lock_bh(&nf_conntrack_lock); |
238 | /* Inside lock so preempt is disabled on module removal path. | 225 | /* Inside lock so preempt is disabled on module removal path. |
239 | * Otherwise we can get spurious warnings. */ | 226 | * Otherwise we can get spurious warnings. */ |
240 | NF_CT_STAT_INC(net, delete_list); | 227 | NF_CT_STAT_INC(net, delete_list); |
241 | clean_from_lists(ct); | 228 | clean_from_lists(ct); |
242 | spin_unlock_bh(&nf_conntrack_lock); | 229 | spin_unlock_bh(&nf_conntrack_lock); |
230 | } | ||
231 | EXPORT_SYMBOL_GPL(nf_ct_delete_from_lists); | ||
232 | |||
233 | static void death_by_event(unsigned long ul_conntrack) | ||
234 | { | ||
235 | struct nf_conn *ct = (void *)ul_conntrack; | ||
236 | struct net *net = nf_ct_net(ct); | ||
237 | |||
238 | if (nf_conntrack_event(IPCT_DESTROY, ct) < 0) { | ||
239 | /* bad luck, let's retry again */ | ||
240 | ct->timeout.expires = jiffies + | ||
241 | (random32() % net->ct.sysctl_events_retry_timeout); | ||
242 | add_timer(&ct->timeout); | ||
243 | return; | ||
244 | } | ||
245 | /* we've got the event delivered, now it's dying */ | ||
246 | set_bit(IPS_DYING_BIT, &ct->status); | ||
247 | spin_lock(&nf_conntrack_lock); | ||
248 | hlist_nulls_del(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode); | ||
249 | spin_unlock(&nf_conntrack_lock); | ||
250 | nf_ct_put(ct); | ||
251 | } | ||
252 | |||
253 | void nf_ct_insert_dying_list(struct nf_conn *ct) | ||
254 | { | ||
255 | struct net *net = nf_ct_net(ct); | ||
256 | |||
257 | /* add this conntrack to the dying list */ | ||
258 | spin_lock_bh(&nf_conntrack_lock); | ||
259 | hlist_nulls_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode, | ||
260 | &net->ct.dying); | ||
261 | spin_unlock_bh(&nf_conntrack_lock); | ||
262 | /* set a new timer to retry event delivery */ | ||
263 | setup_timer(&ct->timeout, death_by_event, (unsigned long)ct); | ||
264 | ct->timeout.expires = jiffies + | ||
265 | (random32() % net->ct.sysctl_events_retry_timeout); | ||
266 | add_timer(&ct->timeout); | ||
267 | } | ||
268 | EXPORT_SYMBOL_GPL(nf_ct_insert_dying_list); | ||
269 | |||
270 | static void death_by_timeout(unsigned long ul_conntrack) | ||
271 | { | ||
272 | struct nf_conn *ct = (void *)ul_conntrack; | ||
273 | |||
274 | if (!test_bit(IPS_DYING_BIT, &ct->status) && | ||
275 | unlikely(nf_conntrack_event(IPCT_DESTROY, ct) < 0)) { | ||
276 | /* destroy event was not delivered */ | ||
277 | nf_ct_delete_from_lists(ct); | ||
278 | nf_ct_insert_dying_list(ct); | ||
279 | return; | ||
280 | } | ||
281 | set_bit(IPS_DYING_BIT, &ct->status); | ||
282 | nf_ct_delete_from_lists(ct); | ||
243 | nf_ct_put(ct); | 283 | nf_ct_put(ct); |
244 | } | 284 | } |
245 | 285 | ||
@@ -577,6 +617,7 @@ init_conntrack(struct net *net, | |||
577 | } | 617 | } |
578 | 618 | ||
579 | nf_ct_acct_ext_add(ct, GFP_ATOMIC); | 619 | nf_ct_acct_ext_add(ct, GFP_ATOMIC); |
620 | nf_ct_ecache_ext_add(ct, GFP_ATOMIC); | ||
580 | 621 | ||
581 | spin_lock_bh(&nf_conntrack_lock); | 622 | spin_lock_bh(&nf_conntrack_lock); |
582 | exp = nf_ct_find_expectation(net, tuple); | 623 | exp = nf_ct_find_expectation(net, tuple); |
@@ -807,8 +848,6 @@ void __nf_ct_refresh_acct(struct nf_conn *ct, | |||
807 | NF_CT_ASSERT(ct->timeout.data == (unsigned long)ct); | 848 | NF_CT_ASSERT(ct->timeout.data == (unsigned long)ct); |
808 | NF_CT_ASSERT(skb); | 849 | NF_CT_ASSERT(skb); |
809 | 850 | ||
810 | spin_lock_bh(&nf_conntrack_lock); | ||
811 | |||
812 | /* Only update if this is not a fixed timeout */ | 851 | /* Only update if this is not a fixed timeout */ |
813 | if (test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)) | 852 | if (test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)) |
814 | goto acct; | 853 | goto acct; |
@@ -822,11 +861,8 @@ void __nf_ct_refresh_acct(struct nf_conn *ct, | |||
822 | /* Only update the timeout if the new timeout is at least | 861 | /* Only update the timeout if the new timeout is at least |
823 | HZ jiffies from the old timeout. Need del_timer for race | 862 | HZ jiffies from the old timeout. Need del_timer for race |
824 | avoidance (may already be dying). */ | 863 | avoidance (may already be dying). */ |
825 | if (newtime - ct->timeout.expires >= HZ | 864 | if (newtime - ct->timeout.expires >= HZ) |
826 | && del_timer(&ct->timeout)) { | 865 | mod_timer_pending(&ct->timeout, newtime); |
827 | ct->timeout.expires = newtime; | ||
828 | add_timer(&ct->timeout); | ||
829 | } | ||
830 | } | 866 | } |
831 | 867 | ||
832 | acct: | 868 | acct: |
@@ -835,13 +871,13 @@ acct: | |||
835 | 871 | ||
836 | acct = nf_conn_acct_find(ct); | 872 | acct = nf_conn_acct_find(ct); |
837 | if (acct) { | 873 | if (acct) { |
874 | spin_lock_bh(&ct->lock); | ||
838 | acct[CTINFO2DIR(ctinfo)].packets++; | 875 | acct[CTINFO2DIR(ctinfo)].packets++; |
839 | acct[CTINFO2DIR(ctinfo)].bytes += | 876 | acct[CTINFO2DIR(ctinfo)].bytes += |
840 | skb->len - skb_network_offset(skb); | 877 | skb->len - skb_network_offset(skb); |
878 | spin_unlock_bh(&ct->lock); | ||
841 | } | 879 | } |
842 | } | 880 | } |
843 | |||
844 | spin_unlock_bh(&nf_conntrack_lock); | ||
845 | } | 881 | } |
846 | EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct); | 882 | EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct); |
847 | 883 | ||
@@ -853,14 +889,14 @@ bool __nf_ct_kill_acct(struct nf_conn *ct, | |||
853 | if (do_acct) { | 889 | if (do_acct) { |
854 | struct nf_conn_counter *acct; | 890 | struct nf_conn_counter *acct; |
855 | 891 | ||
856 | spin_lock_bh(&nf_conntrack_lock); | ||
857 | acct = nf_conn_acct_find(ct); | 892 | acct = nf_conn_acct_find(ct); |
858 | if (acct) { | 893 | if (acct) { |
894 | spin_lock_bh(&ct->lock); | ||
859 | acct[CTINFO2DIR(ctinfo)].packets++; | 895 | acct[CTINFO2DIR(ctinfo)].packets++; |
860 | acct[CTINFO2DIR(ctinfo)].bytes += | 896 | acct[CTINFO2DIR(ctinfo)].bytes += |
861 | skb->len - skb_network_offset(skb); | 897 | skb->len - skb_network_offset(skb); |
898 | spin_unlock_bh(&ct->lock); | ||
862 | } | 899 | } |
863 | spin_unlock_bh(&nf_conntrack_lock); | ||
864 | } | 900 | } |
865 | 901 | ||
866 | if (del_timer(&ct->timeout)) { | 902 | if (del_timer(&ct->timeout)) { |
@@ -994,11 +1030,13 @@ static int kill_report(struct nf_conn *i, void *data) | |||
994 | { | 1030 | { |
995 | struct __nf_ct_flush_report *fr = (struct __nf_ct_flush_report *)data; | 1031 | struct __nf_ct_flush_report *fr = (struct __nf_ct_flush_report *)data; |
996 | 1032 | ||
997 | /* get_next_corpse sets the dying bit for us */ | 1033 | /* If we fail to deliver the event, death_by_timeout() will retry */ |
998 | nf_conntrack_event_report(IPCT_DESTROY, | 1034 | if (nf_conntrack_event_report(IPCT_DESTROY, i, |
999 | i, | 1035 | fr->pid, fr->report) < 0) |
1000 | fr->pid, | 1036 | return 1; |
1001 | fr->report); | 1037 | |
1038 | /* Avoid the delivery of the destroy event in death_by_timeout(). */ | ||
1039 | set_bit(IPS_DYING_BIT, &i->status); | ||
1002 | return 1; | 1040 | return 1; |
1003 | } | 1041 | } |
1004 | 1042 | ||
@@ -1027,6 +1065,21 @@ void nf_conntrack_flush_report(struct net *net, u32 pid, int report) | |||
1027 | } | 1065 | } |
1028 | EXPORT_SYMBOL_GPL(nf_conntrack_flush_report); | 1066 | EXPORT_SYMBOL_GPL(nf_conntrack_flush_report); |
1029 | 1067 | ||
1068 | static void nf_ct_release_dying_list(void) | ||
1069 | { | ||
1070 | struct nf_conntrack_tuple_hash *h; | ||
1071 | struct nf_conn *ct; | ||
1072 | struct hlist_nulls_node *n; | ||
1073 | |||
1074 | spin_lock_bh(&nf_conntrack_lock); | ||
1075 | hlist_nulls_for_each_entry(h, n, &init_net.ct.dying, hnnode) { | ||
1076 | ct = nf_ct_tuplehash_to_ctrack(h); | ||
1077 | /* never fails to remove them, no listeners at this point */ | ||
1078 | nf_ct_kill(ct); | ||
1079 | } | ||
1080 | spin_unlock_bh(&nf_conntrack_lock); | ||
1081 | } | ||
1082 | |||
1030 | static void nf_conntrack_cleanup_init_net(void) | 1083 | static void nf_conntrack_cleanup_init_net(void) |
1031 | { | 1084 | { |
1032 | nf_conntrack_helper_fini(); | 1085 | nf_conntrack_helper_fini(); |
@@ -1036,10 +1089,9 @@ static void nf_conntrack_cleanup_init_net(void) | |||
1036 | 1089 | ||
1037 | static void nf_conntrack_cleanup_net(struct net *net) | 1090 | static void nf_conntrack_cleanup_net(struct net *net) |
1038 | { | 1091 | { |
1039 | nf_ct_event_cache_flush(net); | ||
1040 | nf_conntrack_ecache_fini(net); | ||
1041 | i_see_dead_people: | 1092 | i_see_dead_people: |
1042 | nf_ct_iterate_cleanup(net, kill_all, NULL); | 1093 | nf_ct_iterate_cleanup(net, kill_all, NULL); |
1094 | nf_ct_release_dying_list(); | ||
1043 | if (atomic_read(&net->ct.count) != 0) { | 1095 | if (atomic_read(&net->ct.count) != 0) { |
1044 | schedule(); | 1096 | schedule(); |
1045 | goto i_see_dead_people; | 1097 | goto i_see_dead_people; |
@@ -1050,6 +1102,7 @@ static void nf_conntrack_cleanup_net(struct net *net) | |||
1050 | 1102 | ||
1051 | nf_ct_free_hashtable(net->ct.hash, net->ct.hash_vmalloc, | 1103 | nf_ct_free_hashtable(net->ct.hash, net->ct.hash_vmalloc, |
1052 | nf_conntrack_htable_size); | 1104 | nf_conntrack_htable_size); |
1105 | nf_conntrack_ecache_fini(net); | ||
1053 | nf_conntrack_acct_fini(net); | 1106 | nf_conntrack_acct_fini(net); |
1054 | nf_conntrack_expect_fini(net); | 1107 | nf_conntrack_expect_fini(net); |
1055 | free_percpu(net->ct.stat); | 1108 | free_percpu(net->ct.stat); |
@@ -1220,14 +1273,12 @@ static int nf_conntrack_init_net(struct net *net) | |||
1220 | 1273 | ||
1221 | atomic_set(&net->ct.count, 0); | 1274 | atomic_set(&net->ct.count, 0); |
1222 | INIT_HLIST_NULLS_HEAD(&net->ct.unconfirmed, 0); | 1275 | INIT_HLIST_NULLS_HEAD(&net->ct.unconfirmed, 0); |
1276 | INIT_HLIST_NULLS_HEAD(&net->ct.dying, 0); | ||
1223 | net->ct.stat = alloc_percpu(struct ip_conntrack_stat); | 1277 | net->ct.stat = alloc_percpu(struct ip_conntrack_stat); |
1224 | if (!net->ct.stat) { | 1278 | if (!net->ct.stat) { |
1225 | ret = -ENOMEM; | 1279 | ret = -ENOMEM; |
1226 | goto err_stat; | 1280 | goto err_stat; |
1227 | } | 1281 | } |
1228 | ret = nf_conntrack_ecache_init(net); | ||
1229 | if (ret < 0) | ||
1230 | goto err_ecache; | ||
1231 | net->ct.hash = nf_ct_alloc_hashtable(&nf_conntrack_htable_size, | 1282 | net->ct.hash = nf_ct_alloc_hashtable(&nf_conntrack_htable_size, |
1232 | &net->ct.hash_vmalloc, 1); | 1283 | &net->ct.hash_vmalloc, 1); |
1233 | if (!net->ct.hash) { | 1284 | if (!net->ct.hash) { |
@@ -1241,6 +1292,9 @@ static int nf_conntrack_init_net(struct net *net) | |||
1241 | ret = nf_conntrack_acct_init(net); | 1292 | ret = nf_conntrack_acct_init(net); |
1242 | if (ret < 0) | 1293 | if (ret < 0) |
1243 | goto err_acct; | 1294 | goto err_acct; |
1295 | ret = nf_conntrack_ecache_init(net); | ||
1296 | if (ret < 0) | ||
1297 | goto err_ecache; | ||
1244 | 1298 | ||
1245 | /* Set up fake conntrack: | 1299 | /* Set up fake conntrack: |
1246 | - to never be deleted, not in any hashes */ | 1300 | - to never be deleted, not in any hashes */ |
@@ -1253,14 +1307,14 @@ static int nf_conntrack_init_net(struct net *net) | |||
1253 | 1307 | ||
1254 | return 0; | 1308 | return 0; |
1255 | 1309 | ||
1310 | err_ecache: | ||
1311 | nf_conntrack_acct_fini(net); | ||
1256 | err_acct: | 1312 | err_acct: |
1257 | nf_conntrack_expect_fini(net); | 1313 | nf_conntrack_expect_fini(net); |
1258 | err_expect: | 1314 | err_expect: |
1259 | nf_ct_free_hashtable(net->ct.hash, net->ct.hash_vmalloc, | 1315 | nf_ct_free_hashtable(net->ct.hash, net->ct.hash_vmalloc, |
1260 | nf_conntrack_htable_size); | 1316 | nf_conntrack_htable_size); |
1261 | err_hash: | 1317 | err_hash: |
1262 | nf_conntrack_ecache_fini(net); | ||
1263 | err_ecache: | ||
1264 | free_percpu(net->ct.stat); | 1318 | free_percpu(net->ct.stat); |
1265 | err_stat: | 1319 | err_stat: |
1266 | return ret; | 1320 | return ret; |
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index 5516b3e64b43..aee560b4768d 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include <net/netfilter/nf_conntrack.h> | 22 | #include <net/netfilter/nf_conntrack.h> |
23 | #include <net/netfilter/nf_conntrack_core.h> | 23 | #include <net/netfilter/nf_conntrack_core.h> |
24 | #include <net/netfilter/nf_conntrack_extend.h> | ||
24 | 25 | ||
25 | static DEFINE_MUTEX(nf_ct_ecache_mutex); | 26 | static DEFINE_MUTEX(nf_ct_ecache_mutex); |
26 | 27 | ||
@@ -32,94 +33,51 @@ EXPORT_SYMBOL_GPL(nf_expect_event_cb); | |||
32 | 33 | ||
33 | /* deliver cached events and clear cache entry - must be called with locally | 34 | /* deliver cached events and clear cache entry - must be called with locally |
34 | * disabled softirqs */ | 35 | * disabled softirqs */ |
35 | static inline void | 36 | void nf_ct_deliver_cached_events(struct nf_conn *ct) |
36 | __nf_ct_deliver_cached_events(struct nf_conntrack_ecache *ecache) | ||
37 | { | 37 | { |
38 | unsigned long events; | ||
38 | struct nf_ct_event_notifier *notify; | 39 | struct nf_ct_event_notifier *notify; |
40 | struct nf_conntrack_ecache *e; | ||
39 | 41 | ||
40 | rcu_read_lock(); | 42 | rcu_read_lock(); |
41 | notify = rcu_dereference(nf_conntrack_event_cb); | 43 | notify = rcu_dereference(nf_conntrack_event_cb); |
42 | if (notify == NULL) | 44 | if (notify == NULL) |
43 | goto out_unlock; | 45 | goto out_unlock; |
44 | 46 | ||
45 | if (nf_ct_is_confirmed(ecache->ct) && !nf_ct_is_dying(ecache->ct) | 47 | e = nf_ct_ecache_find(ct); |
46 | && ecache->events) { | 48 | if (e == NULL) |
49 | goto out_unlock; | ||
50 | |||
51 | events = xchg(&e->cache, 0); | ||
52 | |||
53 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct) && events) { | ||
47 | struct nf_ct_event item = { | 54 | struct nf_ct_event item = { |
48 | .ct = ecache->ct, | 55 | .ct = ct, |
49 | .pid = 0, | 56 | .pid = 0, |
50 | .report = 0 | 57 | .report = 0 |
51 | }; | 58 | }; |
59 | int ret; | ||
60 | /* We make a copy of the missed event cache without taking | ||
61 | * the lock, thus we may send missed events twice. However, | ||
62 | * this does not harm and it happens very rarely. */ | ||
63 | unsigned long missed = e->missed; | ||
52 | 64 | ||
53 | notify->fcn(ecache->events, &item); | 65 | ret = notify->fcn(events | missed, &item); |
66 | if (unlikely(ret < 0 || missed)) { | ||
67 | spin_lock_bh(&ct->lock); | ||
68 | if (ret < 0) | ||
69 | e->missed |= events; | ||
70 | else | ||
71 | e->missed &= ~missed; | ||
72 | spin_unlock_bh(&ct->lock); | ||
73 | } | ||
54 | } | 74 | } |
55 | 75 | ||
56 | ecache->events = 0; | ||
57 | nf_ct_put(ecache->ct); | ||
58 | ecache->ct = NULL; | ||
59 | |||
60 | out_unlock: | 76 | out_unlock: |
61 | rcu_read_unlock(); | 77 | rcu_read_unlock(); |
62 | } | 78 | } |
63 | |||
64 | /* Deliver all cached events for a particular conntrack. This is called | ||
65 | * by code prior to async packet handling for freeing the skb */ | ||
66 | void nf_ct_deliver_cached_events(const struct nf_conn *ct) | ||
67 | { | ||
68 | struct net *net = nf_ct_net(ct); | ||
69 | struct nf_conntrack_ecache *ecache; | ||
70 | |||
71 | local_bh_disable(); | ||
72 | ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id()); | ||
73 | if (ecache->ct == ct) | ||
74 | __nf_ct_deliver_cached_events(ecache); | ||
75 | local_bh_enable(); | ||
76 | } | ||
77 | EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); | 79 | EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); |
78 | 80 | ||
79 | /* Deliver cached events for old pending events, if current conntrack != old */ | ||
80 | void __nf_ct_event_cache_init(struct nf_conn *ct) | ||
81 | { | ||
82 | struct net *net = nf_ct_net(ct); | ||
83 | struct nf_conntrack_ecache *ecache; | ||
84 | |||
85 | /* take care of delivering potentially old events */ | ||
86 | ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id()); | ||
87 | BUG_ON(ecache->ct == ct); | ||
88 | if (ecache->ct) | ||
89 | __nf_ct_deliver_cached_events(ecache); | ||
90 | /* initialize for this conntrack/packet */ | ||
91 | ecache->ct = ct; | ||
92 | nf_conntrack_get(&ct->ct_general); | ||
93 | } | ||
94 | EXPORT_SYMBOL_GPL(__nf_ct_event_cache_init); | ||
95 | |||
96 | /* flush the event cache - touches other CPU's data and must not be called | ||
97 | * while packets are still passing through the code */ | ||
98 | void nf_ct_event_cache_flush(struct net *net) | ||
99 | { | ||
100 | struct nf_conntrack_ecache *ecache; | ||
101 | int cpu; | ||
102 | |||
103 | for_each_possible_cpu(cpu) { | ||
104 | ecache = per_cpu_ptr(net->ct.ecache, cpu); | ||
105 | if (ecache->ct) | ||
106 | nf_ct_put(ecache->ct); | ||
107 | } | ||
108 | } | ||
109 | |||
110 | int nf_conntrack_ecache_init(struct net *net) | ||
111 | { | ||
112 | net->ct.ecache = alloc_percpu(struct nf_conntrack_ecache); | ||
113 | if (!net->ct.ecache) | ||
114 | return -ENOMEM; | ||
115 | return 0; | ||
116 | } | ||
117 | |||
118 | void nf_conntrack_ecache_fini(struct net *net) | ||
119 | { | ||
120 | free_percpu(net->ct.ecache); | ||
121 | } | ||
122 | |||
123 | int nf_conntrack_register_notifier(struct nf_ct_event_notifier *new) | 81 | int nf_conntrack_register_notifier(struct nf_ct_event_notifier *new) |
124 | { | 82 | { |
125 | int ret = 0; | 83 | int ret = 0; |
@@ -185,3 +143,118 @@ void nf_ct_expect_unregister_notifier(struct nf_exp_event_notifier *new) | |||
185 | mutex_unlock(&nf_ct_ecache_mutex); | 143 | mutex_unlock(&nf_ct_ecache_mutex); |
186 | } | 144 | } |
187 | EXPORT_SYMBOL_GPL(nf_ct_expect_unregister_notifier); | 145 | EXPORT_SYMBOL_GPL(nf_ct_expect_unregister_notifier); |
146 | |||
147 | #define NF_CT_EVENTS_DEFAULT 1 | ||
148 | static int nf_ct_events __read_mostly = NF_CT_EVENTS_DEFAULT; | ||
149 | static int nf_ct_events_retry_timeout __read_mostly = 15*HZ; | ||
150 | |||
151 | #ifdef CONFIG_SYSCTL | ||
152 | static struct ctl_table event_sysctl_table[] = { | ||
153 | { | ||
154 | .ctl_name = CTL_UNNUMBERED, | ||
155 | .procname = "nf_conntrack_events", | ||
156 | .data = &init_net.ct.sysctl_events, | ||
157 | .maxlen = sizeof(unsigned int), | ||
158 | .mode = 0644, | ||
159 | .proc_handler = proc_dointvec, | ||
160 | }, | ||
161 | { | ||
162 | .ctl_name = CTL_UNNUMBERED, | ||
163 | .procname = "nf_conntrack_events_retry_timeout", | ||
164 | .data = &init_net.ct.sysctl_events_retry_timeout, | ||
165 | .maxlen = sizeof(unsigned int), | ||
166 | .mode = 0644, | ||
167 | .proc_handler = proc_dointvec_jiffies, | ||
168 | }, | ||
169 | {} | ||
170 | }; | ||
171 | #endif /* CONFIG_SYSCTL */ | ||
172 | |||
173 | static struct nf_ct_ext_type event_extend __read_mostly = { | ||
174 | .len = sizeof(struct nf_conntrack_ecache), | ||
175 | .align = __alignof__(struct nf_conntrack_ecache), | ||
176 | .id = NF_CT_EXT_ECACHE, | ||
177 | }; | ||
178 | |||
179 | #ifdef CONFIG_SYSCTL | ||
180 | static int nf_conntrack_event_init_sysctl(struct net *net) | ||
181 | { | ||
182 | struct ctl_table *table; | ||
183 | |||
184 | table = kmemdup(event_sysctl_table, sizeof(event_sysctl_table), | ||
185 | GFP_KERNEL); | ||
186 | if (!table) | ||
187 | goto out; | ||
188 | |||
189 | table[0].data = &net->ct.sysctl_events; | ||
190 | table[1].data = &net->ct.sysctl_events_retry_timeout; | ||
191 | |||
192 | net->ct.event_sysctl_header = | ||
193 | register_net_sysctl_table(net, | ||
194 | nf_net_netfilter_sysctl_path, table); | ||
195 | if (!net->ct.event_sysctl_header) { | ||
196 | printk(KERN_ERR "nf_ct_event: can't register to sysctl.\n"); | ||
197 | goto out_register; | ||
198 | } | ||
199 | return 0; | ||
200 | |||
201 | out_register: | ||
202 | kfree(table); | ||
203 | out: | ||
204 | return -ENOMEM; | ||
205 | } | ||
206 | |||
207 | static void nf_conntrack_event_fini_sysctl(struct net *net) | ||
208 | { | ||
209 | struct ctl_table *table; | ||
210 | |||
211 | table = net->ct.event_sysctl_header->ctl_table_arg; | ||
212 | unregister_net_sysctl_table(net->ct.event_sysctl_header); | ||
213 | kfree(table); | ||
214 | } | ||
215 | #else | ||
216 | static int nf_conntrack_event_init_sysctl(struct net *net) | ||
217 | { | ||
218 | return 0; | ||
219 | } | ||
220 | |||
221 | static void nf_conntrack_event_fini_sysctl(struct net *net) | ||
222 | { | ||
223 | } | ||
224 | #endif /* CONFIG_SYSCTL */ | ||
225 | |||
226 | int nf_conntrack_ecache_init(struct net *net) | ||
227 | { | ||
228 | int ret; | ||
229 | |||
230 | net->ct.sysctl_events = nf_ct_events; | ||
231 | net->ct.sysctl_events_retry_timeout = nf_ct_events_retry_timeout; | ||
232 | |||
233 | if (net_eq(net, &init_net)) { | ||
234 | ret = nf_ct_extend_register(&event_extend); | ||
235 | if (ret < 0) { | ||
236 | printk(KERN_ERR "nf_ct_event: Unable to register " | ||
237 | "event extension.\n"); | ||
238 | goto out_extend_register; | ||
239 | } | ||
240 | } | ||
241 | |||
242 | ret = nf_conntrack_event_init_sysctl(net); | ||
243 | if (ret < 0) | ||
244 | goto out_sysctl; | ||
245 | |||
246 | return 0; | ||
247 | |||
248 | out_sysctl: | ||
249 | if (net_eq(net, &init_net)) | ||
250 | nf_ct_extend_unregister(&event_extend); | ||
251 | out_extend_register: | ||
252 | return ret; | ||
253 | } | ||
254 | |||
255 | void nf_conntrack_ecache_fini(struct net *net) | ||
256 | { | ||
257 | nf_conntrack_event_fini_sysctl(net); | ||
258 | if (net_eq(net, &init_net)) | ||
259 | nf_ct_extend_unregister(&event_extend); | ||
260 | } | ||
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c index 0fa5a422959f..65c2a7bc3afc 100644 --- a/net/netfilter/nf_conntrack_helper.c +++ b/net/netfilter/nf_conntrack_helper.c | |||
@@ -136,6 +136,20 @@ static inline int unhelp(struct nf_conntrack_tuple_hash *i, | |||
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | 138 | ||
139 | void nf_ct_helper_destroy(struct nf_conn *ct) | ||
140 | { | ||
141 | struct nf_conn_help *help = nfct_help(ct); | ||
142 | struct nf_conntrack_helper *helper; | ||
143 | |||
144 | if (help) { | ||
145 | rcu_read_lock(); | ||
146 | helper = rcu_dereference(help->helper); | ||
147 | if (helper && helper->destroy) | ||
148 | helper->destroy(ct); | ||
149 | rcu_read_unlock(); | ||
150 | } | ||
151 | } | ||
152 | |||
139 | int nf_conntrack_helper_register(struct nf_conntrack_helper *me) | 153 | int nf_conntrack_helper_register(struct nf_conntrack_helper *me) |
140 | { | 154 | { |
141 | unsigned int h = helper_hash(&me->tuple); | 155 | unsigned int h = helper_hash(&me->tuple); |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 4e503ada5728..49479d194570 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -463,15 +463,16 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item) | |||
463 | struct sk_buff *skb; | 463 | struct sk_buff *skb; |
464 | unsigned int type; | 464 | unsigned int type; |
465 | unsigned int flags = 0, group; | 465 | unsigned int flags = 0, group; |
466 | int err; | ||
466 | 467 | ||
467 | /* ignore our fake conntrack entry */ | 468 | /* ignore our fake conntrack entry */ |
468 | if (ct == &nf_conntrack_untracked) | 469 | if (ct == &nf_conntrack_untracked) |
469 | return 0; | 470 | return 0; |
470 | 471 | ||
471 | if (events & IPCT_DESTROY) { | 472 | if (events & (1 << IPCT_DESTROY)) { |
472 | type = IPCTNL_MSG_CT_DELETE; | 473 | type = IPCTNL_MSG_CT_DELETE; |
473 | group = NFNLGRP_CONNTRACK_DESTROY; | 474 | group = NFNLGRP_CONNTRACK_DESTROY; |
474 | } else if (events & (IPCT_NEW | IPCT_RELATED)) { | 475 | } else if (events & ((1 << IPCT_NEW) | (1 << IPCT_RELATED))) { |
475 | type = IPCTNL_MSG_CT_NEW; | 476 | type = IPCTNL_MSG_CT_NEW; |
476 | flags = NLM_F_CREATE|NLM_F_EXCL; | 477 | flags = NLM_F_CREATE|NLM_F_EXCL; |
477 | group = NFNLGRP_CONNTRACK_NEW; | 478 | group = NFNLGRP_CONNTRACK_NEW; |
@@ -519,7 +520,7 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item) | |||
519 | if (ctnetlink_dump_status(skb, ct) < 0) | 520 | if (ctnetlink_dump_status(skb, ct) < 0) |
520 | goto nla_put_failure; | 521 | goto nla_put_failure; |
521 | 522 | ||
522 | if (events & IPCT_DESTROY) { | 523 | if (events & (1 << IPCT_DESTROY)) { |
523 | if (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 || | 524 | if (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 || |
524 | ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0) | 525 | ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0) |
525 | goto nla_put_failure; | 526 | goto nla_put_failure; |
@@ -527,38 +528,41 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item) | |||
527 | if (ctnetlink_dump_timeout(skb, ct) < 0) | 528 | if (ctnetlink_dump_timeout(skb, ct) < 0) |
528 | goto nla_put_failure; | 529 | goto nla_put_failure; |
529 | 530 | ||
530 | if (events & IPCT_PROTOINFO | 531 | if (events & (1 << IPCT_PROTOINFO) |
531 | && ctnetlink_dump_protoinfo(skb, ct) < 0) | 532 | && ctnetlink_dump_protoinfo(skb, ct) < 0) |
532 | goto nla_put_failure; | 533 | goto nla_put_failure; |
533 | 534 | ||
534 | if ((events & IPCT_HELPER || nfct_help(ct)) | 535 | if ((events & (1 << IPCT_HELPER) || nfct_help(ct)) |
535 | && ctnetlink_dump_helpinfo(skb, ct) < 0) | 536 | && ctnetlink_dump_helpinfo(skb, ct) < 0) |
536 | goto nla_put_failure; | 537 | goto nla_put_failure; |
537 | 538 | ||
538 | #ifdef CONFIG_NF_CONNTRACK_SECMARK | 539 | #ifdef CONFIG_NF_CONNTRACK_SECMARK |
539 | if ((events & IPCT_SECMARK || ct->secmark) | 540 | if ((events & (1 << IPCT_SECMARK) || ct->secmark) |
540 | && ctnetlink_dump_secmark(skb, ct) < 0) | 541 | && ctnetlink_dump_secmark(skb, ct) < 0) |
541 | goto nla_put_failure; | 542 | goto nla_put_failure; |
542 | #endif | 543 | #endif |
543 | 544 | ||
544 | if (events & IPCT_RELATED && | 545 | if (events & (1 << IPCT_RELATED) && |
545 | ctnetlink_dump_master(skb, ct) < 0) | 546 | ctnetlink_dump_master(skb, ct) < 0) |
546 | goto nla_put_failure; | 547 | goto nla_put_failure; |
547 | 548 | ||
548 | if (events & IPCT_NATSEQADJ && | 549 | if (events & (1 << IPCT_NATSEQADJ) && |
549 | ctnetlink_dump_nat_seq_adj(skb, ct) < 0) | 550 | ctnetlink_dump_nat_seq_adj(skb, ct) < 0) |
550 | goto nla_put_failure; | 551 | goto nla_put_failure; |
551 | } | 552 | } |
552 | 553 | ||
553 | #ifdef CONFIG_NF_CONNTRACK_MARK | 554 | #ifdef CONFIG_NF_CONNTRACK_MARK |
554 | if ((events & IPCT_MARK || ct->mark) | 555 | if ((events & (1 << IPCT_MARK) || ct->mark) |
555 | && ctnetlink_dump_mark(skb, ct) < 0) | 556 | && ctnetlink_dump_mark(skb, ct) < 0) |
556 | goto nla_put_failure; | 557 | goto nla_put_failure; |
557 | #endif | 558 | #endif |
558 | rcu_read_unlock(); | 559 | rcu_read_unlock(); |
559 | 560 | ||
560 | nlmsg_end(skb, nlh); | 561 | nlmsg_end(skb, nlh); |
561 | nfnetlink_send(skb, item->pid, group, item->report, GFP_ATOMIC); | 562 | err = nfnetlink_send(skb, item->pid, group, item->report, GFP_ATOMIC); |
563 | if (err == -ENOBUFS || err == -EAGAIN) | ||
564 | return -ENOBUFS; | ||
565 | |||
562 | return 0; | 566 | return 0; |
563 | 567 | ||
564 | nla_put_failure: | 568 | nla_put_failure: |
@@ -798,10 +802,15 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
798 | } | 802 | } |
799 | } | 803 | } |
800 | 804 | ||
801 | nf_conntrack_event_report(IPCT_DESTROY, | 805 | if (nf_conntrack_event_report(IPCT_DESTROY, ct, |
802 | ct, | 806 | NETLINK_CB(skb).pid, |
803 | NETLINK_CB(skb).pid, | 807 | nlmsg_report(nlh)) < 0) { |
804 | nlmsg_report(nlh)); | 808 | nf_ct_delete_from_lists(ct); |
809 | /* we failed to report the event, try later */ | ||
810 | nf_ct_insert_dying_list(ct); | ||
811 | nf_ct_put(ct); | ||
812 | return 0; | ||
813 | } | ||
805 | 814 | ||
806 | /* death_by_timeout would report the event again */ | 815 | /* death_by_timeout would report the event again */ |
807 | set_bit(IPS_DYING_BIT, &ct->status); | 816 | set_bit(IPS_DYING_BIT, &ct->status); |
@@ -1253,6 +1262,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1253 | } | 1262 | } |
1254 | 1263 | ||
1255 | nf_ct_acct_ext_add(ct, GFP_ATOMIC); | 1264 | nf_ct_acct_ext_add(ct, GFP_ATOMIC); |
1265 | nf_ct_ecache_ext_add(ct, GFP_ATOMIC); | ||
1256 | 1266 | ||
1257 | #if defined(CONFIG_NF_CONNTRACK_MARK) | 1267 | #if defined(CONFIG_NF_CONNTRACK_MARK) |
1258 | if (cda[CTA_MARK]) | 1268 | if (cda[CTA_MARK]) |
@@ -1340,13 +1350,13 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
1340 | else | 1350 | else |
1341 | events = IPCT_NEW; | 1351 | events = IPCT_NEW; |
1342 | 1352 | ||
1343 | nf_conntrack_event_report(IPCT_STATUS | | 1353 | nf_conntrack_eventmask_report((1 << IPCT_STATUS) | |
1344 | IPCT_HELPER | | 1354 | (1 << IPCT_HELPER) | |
1345 | IPCT_PROTOINFO | | 1355 | (1 << IPCT_PROTOINFO) | |
1346 | IPCT_NATSEQADJ | | 1356 | (1 << IPCT_NATSEQADJ) | |
1347 | IPCT_MARK | events, | 1357 | (1 << IPCT_MARK) | events, |
1348 | ct, NETLINK_CB(skb).pid, | 1358 | ct, NETLINK_CB(skb).pid, |
1349 | nlmsg_report(nlh)); | 1359 | nlmsg_report(nlh)); |
1350 | nf_ct_put(ct); | 1360 | nf_ct_put(ct); |
1351 | } else | 1361 | } else |
1352 | spin_unlock_bh(&nf_conntrack_lock); | 1362 | spin_unlock_bh(&nf_conntrack_lock); |
@@ -1365,13 +1375,13 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
1365 | if (err == 0) { | 1375 | if (err == 0) { |
1366 | nf_conntrack_get(&ct->ct_general); | 1376 | nf_conntrack_get(&ct->ct_general); |
1367 | spin_unlock_bh(&nf_conntrack_lock); | 1377 | spin_unlock_bh(&nf_conntrack_lock); |
1368 | nf_conntrack_event_report(IPCT_STATUS | | 1378 | nf_conntrack_eventmask_report((1 << IPCT_STATUS) | |
1369 | IPCT_HELPER | | 1379 | (1 << IPCT_HELPER) | |
1370 | IPCT_PROTOINFO | | 1380 | (1 << IPCT_PROTOINFO) | |
1371 | IPCT_NATSEQADJ | | 1381 | (1 << IPCT_NATSEQADJ) | |
1372 | IPCT_MARK, | 1382 | (1 << IPCT_MARK), |
1373 | ct, NETLINK_CB(skb).pid, | 1383 | ct, NETLINK_CB(skb).pid, |
1374 | nlmsg_report(nlh)); | 1384 | nlmsg_report(nlh)); |
1375 | nf_ct_put(ct); | 1385 | nf_ct_put(ct); |
1376 | } else | 1386 | } else |
1377 | spin_unlock_bh(&nf_conntrack_lock); | 1387 | spin_unlock_bh(&nf_conntrack_lock); |
@@ -1515,7 +1525,7 @@ ctnetlink_expect_event(unsigned int events, struct nf_exp_event *item) | |||
1515 | unsigned int type; | 1525 | unsigned int type; |
1516 | int flags = 0; | 1526 | int flags = 0; |
1517 | 1527 | ||
1518 | if (events & IPEXP_NEW) { | 1528 | if (events & (1 << IPEXP_NEW)) { |
1519 | type = IPCTNL_MSG_EXP_NEW; | 1529 | type = IPCTNL_MSG_EXP_NEW; |
1520 | flags = NLM_F_CREATE|NLM_F_EXCL; | 1530 | flags = NLM_F_CREATE|NLM_F_EXCL; |
1521 | } else | 1531 | } else |
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index beb37311e1a5..2fefe147750a 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
@@ -248,14 +248,14 @@ static int nf_log_proc_dostring(ctl_table *table, int write, struct file *filp, | |||
248 | rcu_assign_pointer(nf_loggers[tindex], logger); | 248 | rcu_assign_pointer(nf_loggers[tindex], logger); |
249 | mutex_unlock(&nf_log_mutex); | 249 | mutex_unlock(&nf_log_mutex); |
250 | } else { | 250 | } else { |
251 | rcu_read_lock(); | 251 | mutex_lock(&nf_log_mutex); |
252 | logger = rcu_dereference(nf_loggers[tindex]); | 252 | logger = nf_loggers[tindex]; |
253 | if (!logger) | 253 | if (!logger) |
254 | table->data = "NONE"; | 254 | table->data = "NONE"; |
255 | else | 255 | else |
256 | table->data = logger->name; | 256 | table->data = logger->name; |
257 | r = proc_dostring(table, write, filp, buffer, lenp, ppos); | 257 | r = proc_dostring(table, write, filp, buffer, lenp, ppos); |
258 | rcu_read_unlock(); | 258 | mutex_unlock(&nf_log_mutex); |
259 | } | 259 | } |
260 | 260 | ||
261 | return r; | 261 | return r; |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 46dba5f043d5..025d1a0af78b 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -364,14 +364,14 @@ int xt_check_match(struct xt_mtchk_param *par, | |||
364 | * ebt_among is exempt from centralized matchsize checking | 364 | * ebt_among is exempt from centralized matchsize checking |
365 | * because it uses a dynamic-size data set. | 365 | * because it uses a dynamic-size data set. |
366 | */ | 366 | */ |
367 | printk("%s_tables: %s match: invalid size %Zu != %u\n", | 367 | pr_err("%s_tables: %s match: invalid size %Zu != %u\n", |
368 | xt_prefix[par->family], par->match->name, | 368 | xt_prefix[par->family], par->match->name, |
369 | XT_ALIGN(par->match->matchsize), size); | 369 | XT_ALIGN(par->match->matchsize), size); |
370 | return -EINVAL; | 370 | return -EINVAL; |
371 | } | 371 | } |
372 | if (par->match->table != NULL && | 372 | if (par->match->table != NULL && |
373 | strcmp(par->match->table, par->table) != 0) { | 373 | strcmp(par->match->table, par->table) != 0) { |
374 | printk("%s_tables: %s match: only valid in %s table, not %s\n", | 374 | pr_err("%s_tables: %s match: only valid in %s table, not %s\n", |
375 | xt_prefix[par->family], par->match->name, | 375 | xt_prefix[par->family], par->match->name, |
376 | par->match->table, par->table); | 376 | par->match->table, par->table); |
377 | return -EINVAL; | 377 | return -EINVAL; |
@@ -379,7 +379,7 @@ int xt_check_match(struct xt_mtchk_param *par, | |||
379 | if (par->match->hooks && (par->hook_mask & ~par->match->hooks) != 0) { | 379 | if (par->match->hooks && (par->hook_mask & ~par->match->hooks) != 0) { |
380 | char used[64], allow[64]; | 380 | char used[64], allow[64]; |
381 | 381 | ||
382 | printk("%s_tables: %s match: used from hooks %s, but only " | 382 | pr_err("%s_tables: %s match: used from hooks %s, but only " |
383 | "valid from %s\n", | 383 | "valid from %s\n", |
384 | xt_prefix[par->family], par->match->name, | 384 | xt_prefix[par->family], par->match->name, |
385 | textify_hooks(used, sizeof(used), par->hook_mask), | 385 | textify_hooks(used, sizeof(used), par->hook_mask), |
@@ -387,7 +387,7 @@ int xt_check_match(struct xt_mtchk_param *par, | |||
387 | return -EINVAL; | 387 | return -EINVAL; |
388 | } | 388 | } |
389 | if (par->match->proto && (par->match->proto != proto || inv_proto)) { | 389 | if (par->match->proto && (par->match->proto != proto || inv_proto)) { |
390 | printk("%s_tables: %s match: only valid for protocol %u\n", | 390 | pr_err("%s_tables: %s match: only valid for protocol %u\n", |
391 | xt_prefix[par->family], par->match->name, | 391 | xt_prefix[par->family], par->match->name, |
392 | par->match->proto); | 392 | par->match->proto); |
393 | return -EINVAL; | 393 | return -EINVAL; |
@@ -514,14 +514,14 @@ int xt_check_target(struct xt_tgchk_param *par, | |||
514 | unsigned int size, u_int8_t proto, bool inv_proto) | 514 | unsigned int size, u_int8_t proto, bool inv_proto) |
515 | { | 515 | { |
516 | if (XT_ALIGN(par->target->targetsize) != size) { | 516 | if (XT_ALIGN(par->target->targetsize) != size) { |
517 | printk("%s_tables: %s target: invalid size %Zu != %u\n", | 517 | pr_err("%s_tables: %s target: invalid size %Zu != %u\n", |
518 | xt_prefix[par->family], par->target->name, | 518 | xt_prefix[par->family], par->target->name, |
519 | XT_ALIGN(par->target->targetsize), size); | 519 | XT_ALIGN(par->target->targetsize), size); |
520 | return -EINVAL; | 520 | return -EINVAL; |
521 | } | 521 | } |
522 | if (par->target->table != NULL && | 522 | if (par->target->table != NULL && |
523 | strcmp(par->target->table, par->table) != 0) { | 523 | strcmp(par->target->table, par->table) != 0) { |
524 | printk("%s_tables: %s target: only valid in %s table, not %s\n", | 524 | pr_err("%s_tables: %s target: only valid in %s table, not %s\n", |
525 | xt_prefix[par->family], par->target->name, | 525 | xt_prefix[par->family], par->target->name, |
526 | par->target->table, par->table); | 526 | par->target->table, par->table); |
527 | return -EINVAL; | 527 | return -EINVAL; |
@@ -529,7 +529,7 @@ int xt_check_target(struct xt_tgchk_param *par, | |||
529 | if (par->target->hooks && (par->hook_mask & ~par->target->hooks) != 0) { | 529 | if (par->target->hooks && (par->hook_mask & ~par->target->hooks) != 0) { |
530 | char used[64], allow[64]; | 530 | char used[64], allow[64]; |
531 | 531 | ||
532 | printk("%s_tables: %s target: used from hooks %s, but only " | 532 | pr_err("%s_tables: %s target: used from hooks %s, but only " |
533 | "usable from %s\n", | 533 | "usable from %s\n", |
534 | xt_prefix[par->family], par->target->name, | 534 | xt_prefix[par->family], par->target->name, |
535 | textify_hooks(used, sizeof(used), par->hook_mask), | 535 | textify_hooks(used, sizeof(used), par->hook_mask), |
@@ -537,7 +537,7 @@ int xt_check_target(struct xt_tgchk_param *par, | |||
537 | return -EINVAL; | 537 | return -EINVAL; |
538 | } | 538 | } |
539 | if (par->target->proto && (par->target->proto != proto || inv_proto)) { | 539 | if (par->target->proto && (par->target->proto != proto || inv_proto)) { |
540 | printk("%s_tables: %s target: only valid for protocol %u\n", | 540 | pr_err("%s_tables: %s target: only valid for protocol %u\n", |
541 | xt_prefix[par->family], par->target->name, | 541 | xt_prefix[par->family], par->target->name, |
542 | par->target->proto); | 542 | par->target->proto); |
543 | return -EINVAL; | 543 | return -EINVAL; |
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c index 7dcf2569613b..389d6e0d7740 100644 --- a/net/rose/rose_dev.c +++ b/net/rose/rose_dev.c | |||
@@ -137,7 +137,7 @@ static int rose_xmit(struct sk_buff *skb, struct net_device *dev) | |||
137 | 137 | ||
138 | if (!netif_running(dev)) { | 138 | if (!netif_running(dev)) { |
139 | printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n"); | 139 | printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n"); |
140 | return 1; | 140 | return NETDEV_TX_BUSY; |
141 | } | 141 | } |
142 | dev_kfree_skb(skb); | 142 | dev_kfree_skb(skb); |
143 | stats->tx_errors++; | 143 | stats->tx_errors++; |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index cb1cb1e76b9a..9c002b6e0533 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -338,7 +338,7 @@ restart: | |||
338 | 338 | ||
339 | if (busy) { | 339 | if (busy) { |
340 | netif_stop_queue(dev); | 340 | netif_stop_queue(dev); |
341 | return 1; | 341 | return NETDEV_TX_BUSY; |
342 | } | 342 | } |
343 | dev->stats.tx_errors++; | 343 | dev->stats.tx_errors++; |
344 | 344 | ||