diff options
author | David S. Miller <davem@davemloft.net> | 2009-07-16 23:21:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-16 23:21:24 -0400 |
commit | da8120355e80ddaf534adb8ed910871d97512d56 (patch) | |
tree | 9958a6c33e29b5af5faccf6650e98729151618a2 | |
parent | c86ae82605ef92594a0de809a8c588ae955fed63 (diff) | |
parent | 7fefe6a88494b00b151b5ca7bb84daaa781bbca7 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/orinoco/main.c
40 files changed, 192 insertions, 97 deletions
diff --git a/Documentation/RCU/rculist_nulls.txt b/Documentation/RCU/rculist_nulls.txt index 93cb28d05dcd..18f9651ff23d 100644 --- a/Documentation/RCU/rculist_nulls.txt +++ b/Documentation/RCU/rculist_nulls.txt | |||
@@ -83,11 +83,12 @@ not detect it missed following items in original chain. | |||
83 | obj = kmem_cache_alloc(...); | 83 | obj = kmem_cache_alloc(...); |
84 | lock_chain(); // typically a spin_lock() | 84 | lock_chain(); // typically a spin_lock() |
85 | obj->key = key; | 85 | obj->key = key; |
86 | atomic_inc(&obj->refcnt); | ||
87 | /* | 86 | /* |
88 | * we need to make sure obj->key is updated before obj->next | 87 | * we need to make sure obj->key is updated before obj->next |
88 | * or obj->refcnt | ||
89 | */ | 89 | */ |
90 | smp_wmb(); | 90 | smp_wmb(); |
91 | atomic_set(&obj->refcnt, 1); | ||
91 | hlist_add_head_rcu(&obj->obj_node, list); | 92 | hlist_add_head_rcu(&obj->obj_node, list); |
92 | unlock_chain(); // typically a spin_unlock() | 93 | unlock_chain(); // typically a spin_unlock() |
93 | 94 | ||
@@ -159,6 +160,10 @@ out: | |||
159 | obj = kmem_cache_alloc(cachep); | 160 | obj = kmem_cache_alloc(cachep); |
160 | lock_chain(); // typically a spin_lock() | 161 | lock_chain(); // typically a spin_lock() |
161 | obj->key = key; | 162 | obj->key = key; |
163 | /* | ||
164 | * changes to obj->key must be visible before refcnt one | ||
165 | */ | ||
166 | smp_wmb(); | ||
162 | atomic_set(&obj->refcnt, 1); | 167 | atomic_set(&obj->refcnt, 1); |
163 | /* | 168 | /* |
164 | * insert obj in RCU way (readers might be traversing chain) | 169 | * insert obj in RCU way (readers might be traversing chain) |
diff --git a/MAINTAINERS b/MAINTAINERS index 381190c7949c..57ea97973349 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -4089,6 +4089,7 @@ L: netfilter@vger.kernel.org | |||
4089 | L: coreteam@netfilter.org | 4089 | L: coreteam@netfilter.org |
4090 | W: http://www.netfilter.org/ | 4090 | W: http://www.netfilter.org/ |
4091 | W: http://www.iptables.org/ | 4091 | W: http://www.iptables.org/ |
4092 | T: git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git | ||
4092 | S: Supported | 4093 | S: Supported |
4093 | F: include/linux/netfilter* | 4094 | F: include/linux/netfilter* |
4094 | F: include/linux/netfilter/ | 4095 | F: include/linux/netfilter/ |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 1a223cd1933a..b39ec98345ea 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -908,6 +908,7 @@ static const struct net_device_ops rtl8139_netdev_ops = { | |||
908 | .ndo_open = rtl8139_open, | 908 | .ndo_open = rtl8139_open, |
909 | .ndo_stop = rtl8139_close, | 909 | .ndo_stop = rtl8139_close, |
910 | .ndo_get_stats = rtl8139_get_stats, | 910 | .ndo_get_stats = rtl8139_get_stats, |
911 | .ndo_change_mtu = eth_change_mtu, | ||
911 | .ndo_validate_addr = eth_validate_addr, | 912 | .ndo_validate_addr = eth_validate_addr, |
912 | .ndo_set_mac_address = rtl8139_set_mac_address, | 913 | .ndo_set_mac_address = rtl8139_set_mac_address, |
913 | .ndo_start_xmit = rtl8139_start_xmit, | 914 | .ndo_start_xmit = rtl8139_start_xmit, |
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 6f42ad728915..3fe09876e76d 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -1142,7 +1142,9 @@ static const struct net_device_ops ixp4xx_netdev_ops = { | |||
1142 | .ndo_start_xmit = eth_xmit, | 1142 | .ndo_start_xmit = eth_xmit, |
1143 | .ndo_set_multicast_list = eth_set_mcast_list, | 1143 | .ndo_set_multicast_list = eth_set_mcast_list, |
1144 | .ndo_do_ioctl = eth_ioctl, | 1144 | .ndo_do_ioctl = eth_ioctl, |
1145 | 1145 | .ndo_change_mtu = eth_change_mtu, | |
1146 | .ndo_set_mac_address = eth_mac_addr, | ||
1147 | .ndo_validate_addr = eth_validate_addr, | ||
1146 | }; | 1148 | }; |
1147 | 1149 | ||
1148 | static int __devinit eth_init_one(struct platform_device *pdev) | 1150 | static int __devinit eth_init_one(struct platform_device *pdev) |
diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h index e1658ef3fcdf..2a1120ad2e74 100644 --- a/drivers/net/atl1c/atl1c.h +++ b/drivers/net/atl1c/atl1c.h | |||
@@ -188,14 +188,14 @@ struct atl1c_tpd_ext_desc { | |||
188 | #define RRS_HDS_TYPE_DATA 2 | 188 | #define RRS_HDS_TYPE_DATA 2 |
189 | 189 | ||
190 | #define RRS_IS_NO_HDS_TYPE(flag) \ | 190 | #define RRS_IS_NO_HDS_TYPE(flag) \ |
191 | (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == 0) | 191 | ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == 0) |
192 | 192 | ||
193 | #define RRS_IS_HDS_HEAD(flag) \ | 193 | #define RRS_IS_HDS_HEAD(flag) \ |
194 | (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \ | 194 | ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \ |
195 | RRS_HDS_TYPE_HEAD) | 195 | RRS_HDS_TYPE_HEAD) |
196 | 196 | ||
197 | #define RRS_IS_HDS_DATA(flag) \ | 197 | #define RRS_IS_HDS_DATA(flag) \ |
198 | (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \ | 198 | ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \ |
199 | RRS_HDS_TYPE_DATA) | 199 | RRS_HDS_TYPE_DATA) |
200 | 200 | ||
201 | /* rrs word 3 bit 0:31 */ | 201 | /* rrs word 3 bit 0:31 */ |
@@ -245,7 +245,7 @@ struct atl1c_tpd_ext_desc { | |||
245 | #define RRS_PACKET_TYPE_802_3 1 | 245 | #define RRS_PACKET_TYPE_802_3 1 |
246 | #define RRS_PACKET_TYPE_ETH 0 | 246 | #define RRS_PACKET_TYPE_ETH 0 |
247 | #define RRS_PACKET_IS_ETH(word) \ | 247 | #define RRS_PACKET_IS_ETH(word) \ |
248 | (((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK == \ | 248 | ((((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK) == \ |
249 | RRS_PACKET_TYPE_ETH) | 249 | RRS_PACKET_TYPE_ETH) |
250 | #define RRS_RXD_IS_VALID(word) \ | 250 | #define RRS_RXD_IS_VALID(word) \ |
251 | ((((word) >> RRS_RXD_UPDATED_SHIFT) & RRS_RXD_UPDATED_MASK) == 1) | 251 | ((((word) >> RRS_RXD_UPDATED_SHIFT) & RRS_RXD_UPDATED_MASK) == 1) |
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c index cd547a205fb9..a383122679de 100644 --- a/drivers/net/atl1c/atl1c_main.c +++ b/drivers/net/atl1c/atl1c_main.c | |||
@@ -1689,7 +1689,7 @@ static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que, | |||
1689 | if (likely(RRS_RXD_IS_VALID(rrs->word3))) { | 1689 | if (likely(RRS_RXD_IS_VALID(rrs->word3))) { |
1690 | rfd_num = (rrs->word0 >> RRS_RX_RFD_CNT_SHIFT) & | 1690 | rfd_num = (rrs->word0 >> RRS_RX_RFD_CNT_SHIFT) & |
1691 | RRS_RX_RFD_CNT_MASK; | 1691 | RRS_RX_RFD_CNT_MASK; |
1692 | if (unlikely(rfd_num) != 1) | 1692 | if (unlikely(rfd_num != 1)) |
1693 | /* TODO support mul rfd*/ | 1693 | /* TODO support mul rfd*/ |
1694 | if (netif_msg_rx_err(adapter)) | 1694 | if (netif_msg_rx_err(adapter)) |
1695 | dev_warn(&pdev->dev, | 1695 | dev_warn(&pdev->dev, |
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index c734b1983ec1..204db961029e 100644 --- a/drivers/net/atlx/atl2.c +++ b/drivers/net/atlx/atl2.c | |||
@@ -2071,7 +2071,7 @@ static int atl2_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
2071 | if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)) | 2071 | if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)) |
2072 | return -EOPNOTSUPP; | 2072 | return -EOPNOTSUPP; |
2073 | 2073 | ||
2074 | if (wol->wolopts & (WAKE_MCAST|WAKE_BCAST|WAKE_MCAST)) | 2074 | if (wol->wolopts & (WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)) |
2075 | return -EOPNOTSUPP; | 2075 | return -EOPNOTSUPP; |
2076 | 2076 | ||
2077 | /* these settings will always override what we currently have */ | 2077 | /* these settings will always override what we currently have */ |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 66596d80b505..3bf0cc61e92c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1459,8 +1459,16 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1459 | * ether type (eg ARPHRD_ETHER and ARPHRD_INFINIBAND) share the same bond | 1459 | * ether type (eg ARPHRD_ETHER and ARPHRD_INFINIBAND) share the same bond |
1460 | */ | 1460 | */ |
1461 | if (bond->slave_cnt == 0) { | 1461 | if (bond->slave_cnt == 0) { |
1462 | if (slave_dev->type != ARPHRD_ETHER) | 1462 | if (bond_dev->type != slave_dev->type) { |
1463 | bond_setup_by_slave(bond_dev, slave_dev); | 1463 | dev_close(bond_dev); |
1464 | pr_debug("%s: change device type from %d to %d\n", | ||
1465 | bond_dev->name, bond_dev->type, slave_dev->type); | ||
1466 | if (slave_dev->type != ARPHRD_ETHER) | ||
1467 | bond_setup_by_slave(bond_dev, slave_dev); | ||
1468 | else | ||
1469 | ether_setup(bond_dev); | ||
1470 | dev_open(bond_dev); | ||
1471 | } | ||
1464 | } else if (bond_dev->type != slave_dev->type) { | 1472 | } else if (bond_dev->type != slave_dev->type) { |
1465 | pr_err(DRV_NAME ": %s ether type (%d) is different " | 1473 | pr_err(DRV_NAME ": %s ether type (%d) is different " |
1466 | "from other slaves (%d), can not enslave it.\n", | 1474 | "from other slaves (%d), can not enslave it.\n", |
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index e5948970a42a..ecf88abbf99e 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c | |||
@@ -1524,6 +1524,7 @@ static void net_timeout(struct net_device *dev) | |||
1524 | static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | 1524 | static int net_send_packet(struct sk_buff *skb, struct net_device *dev) |
1525 | { | 1525 | { |
1526 | struct net_local *lp = netdev_priv(dev); | 1526 | struct net_local *lp = netdev_priv(dev); |
1527 | unsigned long flags; | ||
1527 | 1528 | ||
1528 | if (net_debug > 3) { | 1529 | if (net_debug > 3) { |
1529 | printk("%s: sent %d byte packet of type %x\n", | 1530 | printk("%s: sent %d byte packet of type %x\n", |
@@ -1535,7 +1536,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1535 | ask the chip to start transmitting before the | 1536 | ask the chip to start transmitting before the |
1536 | whole packet has been completely uploaded. */ | 1537 | whole packet has been completely uploaded. */ |
1537 | 1538 | ||
1538 | spin_lock_irq(&lp->lock); | 1539 | spin_lock_irqsave(&lp->lock, flags); |
1539 | netif_stop_queue(dev); | 1540 | netif_stop_queue(dev); |
1540 | 1541 | ||
1541 | /* initiate a transmit sequence */ | 1542 | /* initiate a transmit sequence */ |
@@ -1549,13 +1550,13 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1549 | * we're waiting for TxOk, so return 1 and requeue this packet. | 1550 | * we're waiting for TxOk, so return 1 and requeue this packet. |
1550 | */ | 1551 | */ |
1551 | 1552 | ||
1552 | spin_unlock_irq(&lp->lock); | 1553 | spin_unlock_irqrestore(&lp->lock, flags); |
1553 | if (net_debug) printk("cs89x0: Tx buffer not free!\n"); | 1554 | if (net_debug) printk("cs89x0: Tx buffer not free!\n"); |
1554 | return NETDEV_TX_BUSY; | 1555 | return NETDEV_TX_BUSY; |
1555 | } | 1556 | } |
1556 | /* Write the contents of the packet */ | 1557 | /* Write the contents of the packet */ |
1557 | writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1); | 1558 | writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1); |
1558 | spin_unlock_irq(&lp->lock); | 1559 | spin_unlock_irqrestore(&lp->lock, flags); |
1559 | lp->stats.tx_bytes += skb->len; | 1560 | lp->stats.tx_bytes += skb->len; |
1560 | dev->trans_start = jiffies; | 1561 | dev->trans_start = jiffies; |
1561 | dev_kfree_skb (skb); | 1562 | dev_kfree_skb (skb); |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index a150d58ec60d..569df19f0df5 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -1897,6 +1897,9 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
1897 | 1897 | ||
1898 | if (ioread8(&nic->csr->scb.status) & rus_no_res) | 1898 | if (ioread8(&nic->csr->scb.status) & rus_no_res) |
1899 | nic->ru_running = RU_SUSPENDED; | 1899 | nic->ru_running = RU_SUSPENDED; |
1900 | pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr, | ||
1901 | sizeof(struct rfd), | ||
1902 | PCI_DMA_BIDIRECTIONAL); | ||
1900 | return -ENODATA; | 1903 | return -ENODATA; |
1901 | } | 1904 | } |
1902 | 1905 | ||
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 147c4b088fb3..e8d46cc1bec2 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -3080,7 +3080,9 @@ static const struct net_device_ops ehea_netdev_ops = { | |||
3080 | .ndo_poll_controller = ehea_netpoll, | 3080 | .ndo_poll_controller = ehea_netpoll, |
3081 | #endif | 3081 | #endif |
3082 | .ndo_get_stats = ehea_get_stats, | 3082 | .ndo_get_stats = ehea_get_stats, |
3083 | .ndo_change_mtu = eth_change_mtu, | ||
3083 | .ndo_set_mac_address = ehea_set_mac_addr, | 3084 | .ndo_set_mac_address = ehea_set_mac_addr, |
3085 | .ndo_validate_addr = eth_validate_addr, | ||
3084 | .ndo_set_multicast_list = ehea_set_multicast_list, | 3086 | .ndo_set_multicast_list = ehea_set_multicast_list, |
3085 | .ndo_change_mtu = ehea_change_mtu, | 3087 | .ndo_change_mtu = ehea_change_mtu, |
3086 | .ndo_vlan_rx_register = ehea_vlan_rx_register, | 3088 | .ndo_vlan_rx_register = ehea_vlan_rx_register, |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 08f1edb83f27..e3d99fe53ce6 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -1642,6 +1642,7 @@ static const struct net_device_ops fec_netdev_ops = { | |||
1642 | .ndo_stop = fec_enet_close, | 1642 | .ndo_stop = fec_enet_close, |
1643 | .ndo_start_xmit = fec_enet_start_xmit, | 1643 | .ndo_start_xmit = fec_enet_start_xmit, |
1644 | .ndo_set_multicast_list = set_multicast_list, | 1644 | .ndo_set_multicast_list = set_multicast_list, |
1645 | .ndo_change_mtu = eth_change_mtu, | ||
1645 | .ndo_validate_addr = eth_validate_addr, | 1646 | .ndo_validate_addr = eth_validate_addr, |
1646 | .ndo_tx_timeout = fec_timeout, | 1647 | .ndo_tx_timeout = fec_timeout, |
1647 | .ndo_set_mac_address = fec_set_mac_address, | 1648 | .ndo_set_mac_address = fec_set_mac_address, |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 21f5b0af78c9..b2db449966e2 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -156,6 +156,8 @@ static const struct net_device_ops gfar_netdev_ops = { | |||
156 | .ndo_tx_timeout = gfar_timeout, | 156 | .ndo_tx_timeout = gfar_timeout, |
157 | .ndo_do_ioctl = gfar_ioctl, | 157 | .ndo_do_ioctl = gfar_ioctl, |
158 | .ndo_vlan_rx_register = gfar_vlan_rx_register, | 158 | .ndo_vlan_rx_register = gfar_vlan_rx_register, |
159 | .ndo_set_mac_address = eth_mac_addr, | ||
160 | .ndo_validate_addr = eth_validate_addr, | ||
159 | #ifdef CONFIG_NET_POLL_CONTROLLER | 161 | #ifdef CONFIG_NET_POLL_CONTROLLER |
160 | .ndo_poll_controller = gfar_netpoll, | 162 | .ndo_poll_controller = gfar_netpoll, |
161 | #endif | 163 | #endif |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index be480292aba1..adb09d32625d 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -127,14 +127,48 @@ static void igb_restore_vlan(struct igb_adapter *); | |||
127 | static void igb_ping_all_vfs(struct igb_adapter *); | 127 | static void igb_ping_all_vfs(struct igb_adapter *); |
128 | static void igb_msg_task(struct igb_adapter *); | 128 | static void igb_msg_task(struct igb_adapter *); |
129 | static int igb_rcv_msg_from_vf(struct igb_adapter *, u32); | 129 | static int igb_rcv_msg_from_vf(struct igb_adapter *, u32); |
130 | static inline void igb_set_rah_pool(struct e1000_hw *, int , int); | ||
131 | static void igb_set_mc_list_pools(struct igb_adapter *, int, u16); | 130 | static void igb_set_mc_list_pools(struct igb_adapter *, int, u16); |
132 | static void igb_vmm_control(struct igb_adapter *); | 131 | static void igb_vmm_control(struct igb_adapter *); |
133 | static inline void igb_set_vmolr(struct e1000_hw *, int); | ||
134 | static inline int igb_set_vf_rlpml(struct igb_adapter *, int, int); | ||
135 | static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *); | 132 | static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *); |
136 | static void igb_restore_vf_multicasts(struct igb_adapter *adapter); | 133 | static void igb_restore_vf_multicasts(struct igb_adapter *adapter); |
137 | 134 | ||
135 | static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn) | ||
136 | { | ||
137 | u32 reg_data; | ||
138 | |||
139 | reg_data = rd32(E1000_VMOLR(vfn)); | ||
140 | reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */ | ||
141 | E1000_VMOLR_ROPE | /* Accept packets matched in UTA */ | ||
142 | E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */ | ||
143 | E1000_VMOLR_AUPE | /* Accept untagged packets */ | ||
144 | E1000_VMOLR_STRVLAN; /* Strip vlan tags */ | ||
145 | wr32(E1000_VMOLR(vfn), reg_data); | ||
146 | } | ||
147 | |||
148 | static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size, | ||
149 | int vfn) | ||
150 | { | ||
151 | struct e1000_hw *hw = &adapter->hw; | ||
152 | u32 vmolr; | ||
153 | |||
154 | vmolr = rd32(E1000_VMOLR(vfn)); | ||
155 | vmolr &= ~E1000_VMOLR_RLPML_MASK; | ||
156 | vmolr |= size | E1000_VMOLR_LPE; | ||
157 | wr32(E1000_VMOLR(vfn), vmolr); | ||
158 | |||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry) | ||
163 | { | ||
164 | u32 reg_data; | ||
165 | |||
166 | reg_data = rd32(E1000_RAH(entry)); | ||
167 | reg_data &= ~E1000_RAH_POOL_MASK; | ||
168 | reg_data |= E1000_RAH_POOL_1 << pool;; | ||
169 | wr32(E1000_RAH(entry), reg_data); | ||
170 | } | ||
171 | |||
138 | #ifdef CONFIG_PM | 172 | #ifdef CONFIG_PM |
139 | static int igb_suspend(struct pci_dev *, pm_message_t); | 173 | static int igb_suspend(struct pci_dev *, pm_message_t); |
140 | static int igb_resume(struct pci_dev *); | 174 | static int igb_resume(struct pci_dev *); |
@@ -5418,43 +5452,6 @@ static void igb_io_resume(struct pci_dev *pdev) | |||
5418 | igb_get_hw_control(adapter); | 5452 | igb_get_hw_control(adapter); |
5419 | } | 5453 | } |
5420 | 5454 | ||
5421 | static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn) | ||
5422 | { | ||
5423 | u32 reg_data; | ||
5424 | |||
5425 | reg_data = rd32(E1000_VMOLR(vfn)); | ||
5426 | reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */ | ||
5427 | E1000_VMOLR_ROPE | /* Accept packets matched in UTA */ | ||
5428 | E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */ | ||
5429 | E1000_VMOLR_AUPE | /* Accept untagged packets */ | ||
5430 | E1000_VMOLR_STRVLAN; /* Strip vlan tags */ | ||
5431 | wr32(E1000_VMOLR(vfn), reg_data); | ||
5432 | } | ||
5433 | |||
5434 | static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size, | ||
5435 | int vfn) | ||
5436 | { | ||
5437 | struct e1000_hw *hw = &adapter->hw; | ||
5438 | u32 vmolr; | ||
5439 | |||
5440 | vmolr = rd32(E1000_VMOLR(vfn)); | ||
5441 | vmolr &= ~E1000_VMOLR_RLPML_MASK; | ||
5442 | vmolr |= size | E1000_VMOLR_LPE; | ||
5443 | wr32(E1000_VMOLR(vfn), vmolr); | ||
5444 | |||
5445 | return 0; | ||
5446 | } | ||
5447 | |||
5448 | static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry) | ||
5449 | { | ||
5450 | u32 reg_data; | ||
5451 | |||
5452 | reg_data = rd32(E1000_RAH(entry)); | ||
5453 | reg_data &= ~E1000_RAH_POOL_MASK; | ||
5454 | reg_data |= E1000_RAH_POOL_1 << pool;; | ||
5455 | wr32(E1000_RAH(entry), reg_data); | ||
5456 | } | ||
5457 | |||
5458 | static void igb_set_mc_list_pools(struct igb_adapter *adapter, | 5455 | static void igb_set_mc_list_pools(struct igb_adapter *adapter, |
5459 | int entry_count, u16 total_rar_filters) | 5456 | int entry_count, u16 total_rar_filters) |
5460 | { | 5457 | { |
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c index 86d2300af379..9706e64e367b 100644 --- a/drivers/net/isa-skeleton.c +++ b/drivers/net/isa-skeleton.c | |||
@@ -430,7 +430,8 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
430 | * hardware interrupt handler. Queue flow control is | 430 | * hardware interrupt handler. Queue flow control is |
431 | * thus managed under this lock as well. | 431 | * thus managed under this lock as well. |
432 | */ | 432 | */ |
433 | spin_lock_irq(&np->lock); | 433 | unsigned long flags; |
434 | spin_lock_irqsave(&np->lock, flags); | ||
434 | 435 | ||
435 | add_to_tx_ring(np, skb, length); | 436 | add_to_tx_ring(np, skb, length); |
436 | dev->trans_start = jiffies; | 437 | dev->trans_start = jiffies; |
@@ -446,7 +447,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
446 | * is when the transmit statistics are updated. | 447 | * is when the transmit statistics are updated. |
447 | */ | 448 | */ |
448 | 449 | ||
449 | spin_unlock_irq(&np->lock); | 450 | spin_unlock_irqrestore(&np->lock, flags); |
450 | #else | 451 | #else |
451 | /* This is the case for older hardware which takes | 452 | /* This is the case for older hardware which takes |
452 | * a single transmit buffer at a time, and it is | 453 | * a single transmit buffer at a time, and it is |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index 7c5978ad929a..da2c8514b8d0 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
@@ -106,8 +106,6 @@ static u8 ixgbe_dcbnl_get_state(struct net_device *netdev) | |||
106 | { | 106 | { |
107 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 107 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
108 | 108 | ||
109 | DPRINTK(DRV, INFO, "Get DCB Admin Mode.\n"); | ||
110 | |||
111 | return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED); | 109 | return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED); |
112 | } | 110 | } |
113 | 111 | ||
@@ -116,8 +114,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
116 | u8 err = 0; | 114 | u8 err = 0; |
117 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 115 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
118 | 116 | ||
119 | DPRINTK(DRV, INFO, "Set DCB Admin Mode.\n"); | ||
120 | |||
121 | if (state > 0) { | 117 | if (state > 0) { |
122 | /* Turn on DCB */ | 118 | /* Turn on DCB */ |
123 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) | 119 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) |
@@ -175,6 +171,8 @@ static void ixgbe_dcbnl_get_perm_hw_addr(struct net_device *netdev, | |||
175 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 171 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
176 | int i, j; | 172 | int i, j; |
177 | 173 | ||
174 | memset(perm_addr, 0xff, MAX_ADDR_LEN); | ||
175 | |||
178 | for (i = 0; i < netdev->addr_len; i++) | 176 | for (i = 0; i < netdev->addr_len; i++) |
179 | perm_addr[i] = adapter->hw.mac.perm_addr[i]; | 177 | perm_addr[i] = adapter->hw.mac.perm_addr[i]; |
180 | 178 | ||
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index eba937c46376..b10fedd82143 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -134,8 +134,10 @@ int phy_scan_fixups(struct phy_device *phydev) | |||
134 | 134 | ||
135 | err = fixup->run(phydev); | 135 | err = fixup->run(phydev); |
136 | 136 | ||
137 | if (err < 0) | 137 | if (err < 0) { |
138 | mutex_unlock(&phy_fixup_lock); | ||
138 | return err; | 139 | return err; |
140 | } | ||
139 | } | 141 | } |
140 | } | 142 | } |
141 | mutex_unlock(&phy_fixup_lock); | 143 | mutex_unlock(&phy_fixup_lock); |
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index ef2e229ebc18..00487f569cfd 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -270,6 +270,9 @@ static const struct net_device_ops plip_netdev_ops = { | |||
270 | .ndo_stop = plip_close, | 270 | .ndo_stop = plip_close, |
271 | .ndo_start_xmit = plip_tx_packet, | 271 | .ndo_start_xmit = plip_tx_packet, |
272 | .ndo_do_ioctl = plip_ioctl, | 272 | .ndo_do_ioctl = plip_ioctl, |
273 | .ndo_change_mtu = eth_change_mtu, | ||
274 | .ndo_set_mac_address = eth_mac_addr, | ||
275 | .ndo_validate_addr = eth_validate_addr, | ||
273 | }; | 276 | }; |
274 | 277 | ||
275 | /* Entry point of PLIP driver. | 278 | /* Entry point of PLIP driver. |
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c index d1a5fb4d6acb..a3932c9f3406 100644 --- a/drivers/net/ps3_gelic_net.c +++ b/drivers/net/ps3_gelic_net.c | |||
@@ -1411,6 +1411,7 @@ static const struct net_device_ops gelic_netdevice_ops = { | |||
1411 | .ndo_set_multicast_list = gelic_net_set_multi, | 1411 | .ndo_set_multicast_list = gelic_net_set_multi, |
1412 | .ndo_change_mtu = gelic_net_change_mtu, | 1412 | .ndo_change_mtu = gelic_net_change_mtu, |
1413 | .ndo_tx_timeout = gelic_net_tx_timeout, | 1413 | .ndo_tx_timeout = gelic_net_tx_timeout, |
1414 | .ndo_set_mac_address = eth_mac_addr, | ||
1414 | .ndo_validate_addr = eth_validate_addr, | 1415 | .ndo_validate_addr = eth_validate_addr, |
1415 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1416 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1416 | .ndo_poll_controller = gelic_net_poll_controller, | 1417 | .ndo_poll_controller = gelic_net_poll_controller, |
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c index b6b3ca9bdb21..6932b08d746b 100644 --- a/drivers/net/ps3_gelic_wireless.c +++ b/drivers/net/ps3_gelic_wireless.c | |||
@@ -2707,6 +2707,7 @@ static const struct net_device_ops gelic_wl_netdevice_ops = { | |||
2707 | .ndo_set_multicast_list = gelic_net_set_multi, | 2707 | .ndo_set_multicast_list = gelic_net_set_multi, |
2708 | .ndo_change_mtu = gelic_net_change_mtu, | 2708 | .ndo_change_mtu = gelic_net_change_mtu, |
2709 | .ndo_tx_timeout = gelic_net_tx_timeout, | 2709 | .ndo_tx_timeout = gelic_net_tx_timeout, |
2710 | .ndo_set_mac_address = eth_mac_addr, | ||
2710 | .ndo_validate_addr = eth_validate_addr, | 2711 | .ndo_validate_addr = eth_validate_addr, |
2711 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2712 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2712 | .ndo_poll_controller = gelic_net_poll_controller, | 2713 | .ndo_poll_controller = gelic_net_poll_controller, |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index daf961ab68bc..ba768dfa59e0 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1151,14 +1151,7 @@ stopped: | |||
1151 | 1151 | ||
1152 | /* reset the Rx prefetch unit */ | 1152 | /* reset the Rx prefetch unit */ |
1153 | sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); | 1153 | sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); |
1154 | 1154 | mmiowb(); | |
1155 | /* Reset the RAM Buffer receive queue */ | ||
1156 | sky2_write8(hw, RB_ADDR(rxq, RB_CTRL), RB_RST_SET); | ||
1157 | |||
1158 | /* Reset Rx MAC FIFO */ | ||
1159 | sky2_write8(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), GMF_RST_SET); | ||
1160 | |||
1161 | sky2_read8(hw, B0_CTST); | ||
1162 | } | 1155 | } |
1163 | 1156 | ||
1164 | /* Clean out receive buffer area, assumes receiver hardware stopped */ | 1157 | /* Clean out receive buffer area, assumes receiver hardware stopped */ |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 2968c75ff49b..0f2c52c2e044 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -1774,6 +1774,7 @@ static const struct net_device_ops smc_netdev_ops = { | |||
1774 | .ndo_start_xmit = smc_hard_start_xmit, | 1774 | .ndo_start_xmit = smc_hard_start_xmit, |
1775 | .ndo_tx_timeout = smc_timeout, | 1775 | .ndo_tx_timeout = smc_timeout, |
1776 | .ndo_set_multicast_list = smc_set_multicast_list, | 1776 | .ndo_set_multicast_list = smc_set_multicast_list, |
1777 | .ndo_change_mtu = eth_change_mtu, | ||
1777 | .ndo_validate_addr = eth_validate_addr, | 1778 | .ndo_validate_addr = eth_validate_addr, |
1778 | .ndo_set_mac_address = eth_mac_addr, | 1779 | .ndo_set_mac_address = eth_mac_addr, |
1779 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1780 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 66067f9d91c0..94b6d2658ddc 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -1779,6 +1779,7 @@ static const struct net_device_ops smsc911x_netdev_ops = { | |||
1779 | .ndo_get_stats = smsc911x_get_stats, | 1779 | .ndo_get_stats = smsc911x_get_stats, |
1780 | .ndo_set_multicast_list = smsc911x_set_multicast_list, | 1780 | .ndo_set_multicast_list = smsc911x_set_multicast_list, |
1781 | .ndo_do_ioctl = smsc911x_do_ioctl, | 1781 | .ndo_do_ioctl = smsc911x_do_ioctl, |
1782 | .ndo_change_mtu = eth_change_mtu, | ||
1782 | .ndo_validate_addr = eth_validate_addr, | 1783 | .ndo_validate_addr = eth_validate_addr, |
1783 | .ndo_set_mac_address = smsc911x_set_mac_address, | 1784 | .ndo_set_mac_address = smsc911x_set_mac_address, |
1784 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1785 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c index a82fb2aca4cb..f1e5e4542c2a 100644 --- a/drivers/net/sunvnet.c +++ b/drivers/net/sunvnet.c | |||
@@ -1016,7 +1016,9 @@ static const struct net_device_ops vnet_ops = { | |||
1016 | .ndo_open = vnet_open, | 1016 | .ndo_open = vnet_open, |
1017 | .ndo_stop = vnet_close, | 1017 | .ndo_stop = vnet_close, |
1018 | .ndo_set_multicast_list = vnet_set_rx_mode, | 1018 | .ndo_set_multicast_list = vnet_set_rx_mode, |
1019 | .ndo_change_mtu = eth_change_mtu, | ||
1019 | .ndo_set_mac_address = vnet_set_mac_addr, | 1020 | .ndo_set_mac_address = vnet_set_mac_addr, |
1021 | .ndo_validate_addr = eth_validate_addr, | ||
1020 | .ndo_tx_timeout = vnet_tx_timeout, | 1022 | .ndo_tx_timeout = vnet_tx_timeout, |
1021 | .ndo_change_mtu = vnet_change_mtu, | 1023 | .ndo_change_mtu = vnet_change_mtu, |
1022 | .ndo_start_xmit = vnet_start_xmit, | 1024 | .ndo_start_xmit = vnet_start_xmit, |
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index cd35d50e46d4..45cebfb302cf 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c | |||
@@ -311,7 +311,7 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
311 | * bmCRC = 0 : CRC = 0xDEADBEEF | 311 | * bmCRC = 0 : CRC = 0xDEADBEEF |
312 | */ | 312 | */ |
313 | if (header & BIT(14)) | 313 | if (header & BIT(14)) |
314 | crc2 = ~crc32_le(~0, skb2->data, len); | 314 | crc2 = ~crc32_le(~0, skb2->data, skb2->len); |
315 | else | 315 | else |
316 | crc2 = 0xdeadbeef; | 316 | crc2 = 0xdeadbeef; |
317 | 317 | ||
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index 09a5bd381566..200fe3d525ca 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -999,6 +999,9 @@ static const struct net_device_ops kaweth_netdev_ops = { | |||
999 | .ndo_tx_timeout = kaweth_tx_timeout, | 999 | .ndo_tx_timeout = kaweth_tx_timeout, |
1000 | .ndo_set_multicast_list = kaweth_set_rx_mode, | 1000 | .ndo_set_multicast_list = kaweth_set_rx_mode, |
1001 | .ndo_get_stats = kaweth_netdev_stats, | 1001 | .ndo_get_stats = kaweth_netdev_stats, |
1002 | .ndo_change_mtu = eth_change_mtu, | ||
1003 | .ndo_set_mac_address = eth_mac_addr, | ||
1004 | .ndo_validate_addr = eth_validate_addr, | ||
1002 | }; | 1005 | }; |
1003 | 1006 | ||
1004 | static int kaweth_probe( | 1007 | static int kaweth_probe( |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 632d1aeda570..69d2df95ac86 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -1493,6 +1493,9 @@ static const struct net_device_ops pegasus_netdev_ops = { | |||
1493 | .ndo_set_multicast_list = pegasus_set_multicast, | 1493 | .ndo_set_multicast_list = pegasus_set_multicast, |
1494 | .ndo_get_stats = pegasus_netdev_stats, | 1494 | .ndo_get_stats = pegasus_netdev_stats, |
1495 | .ndo_tx_timeout = pegasus_tx_timeout, | 1495 | .ndo_tx_timeout = pegasus_tx_timeout, |
1496 | .ndo_change_mtu = eth_change_mtu, | ||
1497 | .ndo_set_mac_address = eth_mac_addr, | ||
1498 | .ndo_validate_addr = eth_validate_addr, | ||
1496 | }; | 1499 | }; |
1497 | 1500 | ||
1498 | static struct usb_driver pegasus_driver = { | 1501 | static struct usb_driver pegasus_driver = { |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index 715220158311..46eb618bbc90 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -621,6 +621,7 @@ static const struct net_device_ops rhine_netdev_ops = { | |||
621 | .ndo_start_xmit = rhine_start_tx, | 621 | .ndo_start_xmit = rhine_start_tx, |
622 | .ndo_get_stats = rhine_get_stats, | 622 | .ndo_get_stats = rhine_get_stats, |
623 | .ndo_set_multicast_list = rhine_set_rx_mode, | 623 | .ndo_set_multicast_list = rhine_set_rx_mode, |
624 | .ndo_change_mtu = eth_change_mtu, | ||
624 | .ndo_validate_addr = eth_validate_addr, | 625 | .ndo_validate_addr = eth_validate_addr, |
625 | .ndo_set_mac_address = eth_mac_addr, | 626 | .ndo_set_mac_address = eth_mac_addr, |
626 | .ndo_do_ioctl = netdev_ioctl, | 627 | .ndo_do_ioctl = netdev_ioctl, |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index cd1c04d42b6a..e8c550a61f33 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -2072,6 +2072,8 @@ static const struct net_device_ops orinoco_netdev_ops = { | |||
2072 | .ndo_start_xmit = orinoco_xmit, | 2072 | .ndo_start_xmit = orinoco_xmit, |
2073 | .ndo_set_multicast_list = orinoco_set_multicast_list, | 2073 | .ndo_set_multicast_list = orinoco_set_multicast_list, |
2074 | .ndo_change_mtu = orinoco_change_mtu, | 2074 | .ndo_change_mtu = orinoco_change_mtu, |
2075 | .ndo_set_mac_address = eth_mac_addr, | ||
2076 | .ndo_validate_addr = eth_validate_addr, | ||
2075 | .ndo_tx_timeout = orinoco_tx_timeout, | 2077 | .ndo_tx_timeout = orinoco_tx_timeout, |
2076 | .ndo_get_stats = orinoco_get_stats, | 2078 | .ndo_get_stats = orinoco_get_stats, |
2077 | }; | 2079 | }; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index b47b3f039d14..f2c69a2cca17 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1342,12 +1342,12 @@ static inline int skb_network_offset(const struct sk_buff *skb) | |||
1342 | * shifting the start of the packet by 2 bytes. Drivers should do this | 1342 | * shifting the start of the packet by 2 bytes. Drivers should do this |
1343 | * with: | 1343 | * with: |
1344 | * | 1344 | * |
1345 | * skb_reserve(NET_IP_ALIGN); | 1345 | * skb_reserve(skb, NET_IP_ALIGN); |
1346 | * | 1346 | * |
1347 | * The downside to this alignment of the IP header is that the DMA is now | 1347 | * The downside to this alignment of the IP header is that the DMA is now |
1348 | * unaligned. On some architectures the cost of an unaligned DMA is high | 1348 | * unaligned. On some architectures the cost of an unaligned DMA is high |
1349 | * and this cost outweighs the gains made by aligning the IP header. | 1349 | * and this cost outweighs the gains made by aligning the IP header. |
1350 | * | 1350 | * |
1351 | * Since this trade off varies between architectures, we allow NET_IP_ALIGN | 1351 | * Since this trade off varies between architectures, we allow NET_IP_ALIGN |
1352 | * to be overridden. | 1352 | * to be overridden. |
1353 | */ | 1353 | */ |
diff --git a/include/net/sock.h b/include/net/sock.h index 2c0da9239b95..950409dcec3d 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -104,15 +104,15 @@ struct net; | |||
104 | 104 | ||
105 | /** | 105 | /** |
106 | * struct sock_common - minimal network layer representation of sockets | 106 | * struct sock_common - minimal network layer representation of sockets |
107 | * @skc_node: main hash linkage for various protocol lookup tables | ||
108 | * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol | ||
109 | * @skc_refcnt: reference count | ||
110 | * @skc_hash: hash value used with various protocol lookup tables | ||
107 | * @skc_family: network address family | 111 | * @skc_family: network address family |
108 | * @skc_state: Connection state | 112 | * @skc_state: Connection state |
109 | * @skc_reuse: %SO_REUSEADDR setting | 113 | * @skc_reuse: %SO_REUSEADDR setting |
110 | * @skc_bound_dev_if: bound device index if != 0 | 114 | * @skc_bound_dev_if: bound device index if != 0 |
111 | * @skc_node: main hash linkage for various protocol lookup tables | ||
112 | * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol | ||
113 | * @skc_bind_node: bind hash linkage for various protocol lookup tables | 115 | * @skc_bind_node: bind hash linkage for various protocol lookup tables |
114 | * @skc_refcnt: reference count | ||
115 | * @skc_hash: hash value used with various protocol lookup tables | ||
116 | * @skc_prot: protocol handlers inside a network family | 116 | * @skc_prot: protocol handlers inside a network family |
117 | * @skc_net: reference to the network namespace of this socket | 117 | * @skc_net: reference to the network namespace of this socket |
118 | * | 118 | * |
@@ -120,17 +120,21 @@ struct net; | |||
120 | * for struct sock and struct inet_timewait_sock. | 120 | * for struct sock and struct inet_timewait_sock. |
121 | */ | 121 | */ |
122 | struct sock_common { | 122 | struct sock_common { |
123 | unsigned short skc_family; | 123 | /* |
124 | volatile unsigned char skc_state; | 124 | * first fields are not copied in sock_copy() |
125 | unsigned char skc_reuse; | 125 | */ |
126 | int skc_bound_dev_if; | ||
127 | union { | 126 | union { |
128 | struct hlist_node skc_node; | 127 | struct hlist_node skc_node; |
129 | struct hlist_nulls_node skc_nulls_node; | 128 | struct hlist_nulls_node skc_nulls_node; |
130 | }; | 129 | }; |
131 | struct hlist_node skc_bind_node; | ||
132 | atomic_t skc_refcnt; | 130 | atomic_t skc_refcnt; |
131 | |||
133 | unsigned int skc_hash; | 132 | unsigned int skc_hash; |
133 | unsigned short skc_family; | ||
134 | volatile unsigned char skc_state; | ||
135 | unsigned char skc_reuse; | ||
136 | int skc_bound_dev_if; | ||
137 | struct hlist_node skc_bind_node; | ||
134 | struct proto *skc_prot; | 138 | struct proto *skc_prot; |
135 | #ifdef CONFIG_NET_NS | 139 | #ifdef CONFIG_NET_NS |
136 | struct net *skc_net; | 140 | struct net *skc_net; |
@@ -208,15 +212,17 @@ struct sock { | |||
208 | * don't add nothing before this first member (__sk_common) --acme | 212 | * don't add nothing before this first member (__sk_common) --acme |
209 | */ | 213 | */ |
210 | struct sock_common __sk_common; | 214 | struct sock_common __sk_common; |
215 | #define sk_node __sk_common.skc_node | ||
216 | #define sk_nulls_node __sk_common.skc_nulls_node | ||
217 | #define sk_refcnt __sk_common.skc_refcnt | ||
218 | |||
219 | #define sk_copy_start __sk_common.skc_hash | ||
220 | #define sk_hash __sk_common.skc_hash | ||
211 | #define sk_family __sk_common.skc_family | 221 | #define sk_family __sk_common.skc_family |
212 | #define sk_state __sk_common.skc_state | 222 | #define sk_state __sk_common.skc_state |
213 | #define sk_reuse __sk_common.skc_reuse | 223 | #define sk_reuse __sk_common.skc_reuse |
214 | #define sk_bound_dev_if __sk_common.skc_bound_dev_if | 224 | #define sk_bound_dev_if __sk_common.skc_bound_dev_if |
215 | #define sk_node __sk_common.skc_node | ||
216 | #define sk_nulls_node __sk_common.skc_nulls_node | ||
217 | #define sk_bind_node __sk_common.skc_bind_node | 225 | #define sk_bind_node __sk_common.skc_bind_node |
218 | #define sk_refcnt __sk_common.skc_refcnt | ||
219 | #define sk_hash __sk_common.skc_hash | ||
220 | #define sk_prot __sk_common.skc_prot | 226 | #define sk_prot __sk_common.skc_prot |
221 | #define sk_net __sk_common.skc_net | 227 | #define sk_net __sk_common.skc_net |
222 | kmemcheck_bitfield_begin(flags); | 228 | kmemcheck_bitfield_begin(flags); |
diff --git a/net/can/bcm.c b/net/can/bcm.c index 95d7f32643ae..72720c710351 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -75,6 +75,7 @@ static __initdata const char banner[] = KERN_INFO | |||
75 | MODULE_DESCRIPTION("PF_CAN broadcast manager protocol"); | 75 | MODULE_DESCRIPTION("PF_CAN broadcast manager protocol"); |
76 | MODULE_LICENSE("Dual BSD/GPL"); | 76 | MODULE_LICENSE("Dual BSD/GPL"); |
77 | MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>"); | 77 | MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>"); |
78 | MODULE_ALIAS("can-proto-2"); | ||
78 | 79 | ||
79 | /* easy access to can_frame payload */ | 80 | /* easy access to can_frame payload */ |
80 | static inline u64 GET_U64(const struct can_frame *cp) | 81 | static inline u64 GET_U64(const struct can_frame *cp) |
@@ -1469,6 +1470,9 @@ static int bcm_release(struct socket *sock) | |||
1469 | bo->ifindex = 0; | 1470 | bo->ifindex = 0; |
1470 | } | 1471 | } |
1471 | 1472 | ||
1473 | sock_orphan(sk); | ||
1474 | sock->sk = NULL; | ||
1475 | |||
1472 | release_sock(sk); | 1476 | release_sock(sk); |
1473 | sock_put(sk); | 1477 | sock_put(sk); |
1474 | 1478 | ||
diff --git a/net/can/raw.c b/net/can/raw.c index 6aa154e806ae..f4cc44548bda 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -62,6 +62,7 @@ static __initdata const char banner[] = | |||
62 | MODULE_DESCRIPTION("PF_CAN raw protocol"); | 62 | MODULE_DESCRIPTION("PF_CAN raw protocol"); |
63 | MODULE_LICENSE("Dual BSD/GPL"); | 63 | MODULE_LICENSE("Dual BSD/GPL"); |
64 | MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>"); | 64 | MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>"); |
65 | MODULE_ALIAS("can-proto-1"); | ||
65 | 66 | ||
66 | #define MASK_ALL 0 | 67 | #define MASK_ALL 0 |
67 | 68 | ||
@@ -306,6 +307,9 @@ static int raw_release(struct socket *sock) | |||
306 | ro->bound = 0; | 307 | ro->bound = 0; |
307 | ro->count = 0; | 308 | ro->count = 0; |
308 | 309 | ||
310 | sock_orphan(sk); | ||
311 | sock->sk = NULL; | ||
312 | |||
309 | release_sock(sk); | 313 | release_sock(sk); |
310 | sock_put(sk); | 314 | sock_put(sk); |
311 | 315 | ||
diff --git a/net/core/sock.c b/net/core/sock.c index 6354863b1c68..d9eec153d531 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -919,13 +919,19 @@ static inline void sock_lock_init(struct sock *sk) | |||
919 | af_family_keys + sk->sk_family); | 919 | af_family_keys + sk->sk_family); |
920 | } | 920 | } |
921 | 921 | ||
922 | /* | ||
923 | * Copy all fields from osk to nsk but nsk->sk_refcnt must not change yet, | ||
924 | * even temporarly, because of RCU lookups. sk_node should also be left as is. | ||
925 | */ | ||
922 | static void sock_copy(struct sock *nsk, const struct sock *osk) | 926 | static void sock_copy(struct sock *nsk, const struct sock *osk) |
923 | { | 927 | { |
924 | #ifdef CONFIG_SECURITY_NETWORK | 928 | #ifdef CONFIG_SECURITY_NETWORK |
925 | void *sptr = nsk->sk_security; | 929 | void *sptr = nsk->sk_security; |
926 | #endif | 930 | #endif |
927 | 931 | BUILD_BUG_ON(offsetof(struct sock, sk_copy_start) != | |
928 | memcpy(nsk, osk, osk->sk_prot->obj_size); | 932 | sizeof(osk->sk_node) + sizeof(osk->sk_refcnt)); |
933 | memcpy(&nsk->sk_copy_start, &osk->sk_copy_start, | ||
934 | osk->sk_prot->obj_size - offsetof(struct sock, sk_copy_start)); | ||
929 | #ifdef CONFIG_SECURITY_NETWORK | 935 | #ifdef CONFIG_SECURITY_NETWORK |
930 | nsk->sk_security = sptr; | 936 | nsk->sk_security = sptr; |
931 | security_sk_clone(osk, nsk); | 937 | security_sk_clone(osk, nsk); |
@@ -939,8 +945,23 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, | |||
939 | struct kmem_cache *slab; | 945 | struct kmem_cache *slab; |
940 | 946 | ||
941 | slab = prot->slab; | 947 | slab = prot->slab; |
942 | if (slab != NULL) | 948 | if (slab != NULL) { |
943 | sk = kmem_cache_alloc(slab, priority); | 949 | sk = kmem_cache_alloc(slab, priority & ~__GFP_ZERO); |
950 | if (!sk) | ||
951 | return sk; | ||
952 | if (priority & __GFP_ZERO) { | ||
953 | /* | ||
954 | * caches using SLAB_DESTROY_BY_RCU should let | ||
955 | * sk_node.next un-modified. Special care is taken | ||
956 | * when initializing object to zero. | ||
957 | */ | ||
958 | if (offsetof(struct sock, sk_node.next) != 0) | ||
959 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
960 | memset(&sk->sk_node.pprev, 0, | ||
961 | prot->obj_size - offsetof(struct sock, | ||
962 | sk_node.pprev)); | ||
963 | } | ||
964 | } | ||
944 | else | 965 | else |
945 | sk = kmalloc(prot->obj_size, priority); | 966 | sk = kmalloc(prot->obj_size, priority); |
946 | 967 | ||
@@ -1125,6 +1146,11 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority) | |||
1125 | 1146 | ||
1126 | newsk->sk_err = 0; | 1147 | newsk->sk_err = 0; |
1127 | newsk->sk_priority = 0; | 1148 | newsk->sk_priority = 0; |
1149 | /* | ||
1150 | * Before updating sk_refcnt, we must commit prior changes to memory | ||
1151 | * (Documentation/RCU/rculist_nulls.txt for details) | ||
1152 | */ | ||
1153 | smp_wmb(); | ||
1128 | atomic_set(&newsk->sk_refcnt, 2); | 1154 | atomic_set(&newsk->sk_refcnt, 2); |
1129 | 1155 | ||
1130 | /* | 1156 | /* |
@@ -1840,6 +1866,11 @@ void sock_init_data(struct socket *sock, struct sock *sk) | |||
1840 | 1866 | ||
1841 | sk->sk_stamp = ktime_set(-1L, 0); | 1867 | sk->sk_stamp = ktime_set(-1L, 0); |
1842 | 1868 | ||
1869 | /* | ||
1870 | * Before updating sk_refcnt, we must commit prior changes to memory | ||
1871 | * (Documentation/RCU/rculist_nulls.txt for details) | ||
1872 | */ | ||
1873 | smp_wmb(); | ||
1843 | atomic_set(&sk->sk_refcnt, 1); | 1874 | atomic_set(&sk->sk_refcnt, 1); |
1844 | atomic_set(&sk->sk_wmem_alloc, 1); | 1875 | atomic_set(&sk->sk_wmem_alloc, 1); |
1845 | atomic_set(&sk->sk_drops, 0); | 1876 | atomic_set(&sk->sk_drops, 0); |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index cd85ebc119a5..b902ef55be7f 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -735,10 +735,10 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
735 | } | 735 | } |
736 | 736 | ||
737 | tos = tiph->tos; | 737 | tos = tiph->tos; |
738 | if (tos&1) { | 738 | if (tos == 1) { |
739 | tos = 0; | ||
739 | if (skb->protocol == htons(ETH_P_IP)) | 740 | if (skb->protocol == htons(ETH_P_IP)) |
740 | tos = old_iph->tos; | 741 | tos = old_iph->tos; |
741 | tos &= ~1; | ||
742 | } | 742 | } |
743 | 743 | ||
744 | { | 744 | { |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 247026282669..7d0821054729 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -1243,7 +1243,6 @@ int ip_push_pending_frames(struct sock *sk) | |||
1243 | skb->len += tmp_skb->len; | 1243 | skb->len += tmp_skb->len; |
1244 | skb->data_len += tmp_skb->len; | 1244 | skb->data_len += tmp_skb->len; |
1245 | skb->truesize += tmp_skb->truesize; | 1245 | skb->truesize += tmp_skb->truesize; |
1246 | __sock_put(tmp_skb->sk); | ||
1247 | tmp_skb->destructor = NULL; | 1246 | tmp_skb->destructor = NULL; |
1248 | tmp_skb->sk = NULL; | 1247 | tmp_skb->sk = NULL; |
1249 | } | 1248 | } |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index dd1a980b8ac9..93beee944657 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -1474,7 +1474,6 @@ int ip6_push_pending_frames(struct sock *sk) | |||
1474 | skb->len += tmp_skb->len; | 1474 | skb->len += tmp_skb->len; |
1475 | skb->data_len += tmp_skb->len; | 1475 | skb->data_len += tmp_skb->len; |
1476 | skb->truesize += tmp_skb->truesize; | 1476 | skb->truesize += tmp_skb->truesize; |
1477 | __sock_put(tmp_skb->sk); | ||
1478 | tmp_skb->destructor = NULL; | 1477 | tmp_skb->destructor = NULL; |
1479 | tmp_skb->sk = NULL; | 1478 | tmp_skb->sk = NULL; |
1480 | } | 1479 | } |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index d0b850590faf..d335a306a4db 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -1018,6 +1018,7 @@ static void ipip6_tunnel_setup(struct net_device *dev) | |||
1018 | dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); | 1018 | dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); |
1019 | dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr); | 1019 | dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr); |
1020 | dev->flags = IFF_NOARP; | 1020 | dev->flags = IFF_NOARP; |
1021 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | ||
1021 | dev->iflink = 0; | 1022 | dev->iflink = 0; |
1022 | dev->addr_len = 4; | 1023 | dev->addr_len = 4; |
1023 | dev->features |= NETIF_F_NETNS_LOCAL; | 1024 | dev->features |= NETIF_F_NETNS_LOCAL; |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 7508f11c5b39..b5869b9574b0 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -561,23 +561,38 @@ struct nf_conn *nf_conntrack_alloc(struct net *net, | |||
561 | } | 561 | } |
562 | } | 562 | } |
563 | 563 | ||
564 | ct = kmem_cache_zalloc(nf_conntrack_cachep, gfp); | 564 | /* |
565 | * Do not use kmem_cache_zalloc(), as this cache uses | ||
566 | * SLAB_DESTROY_BY_RCU. | ||
567 | */ | ||
568 | ct = kmem_cache_alloc(nf_conntrack_cachep, gfp); | ||
565 | if (ct == NULL) { | 569 | if (ct == NULL) { |
566 | pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n"); | 570 | pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n"); |
567 | atomic_dec(&net->ct.count); | 571 | atomic_dec(&net->ct.count); |
568 | return ERR_PTR(-ENOMEM); | 572 | return ERR_PTR(-ENOMEM); |
569 | } | 573 | } |
570 | 574 | /* | |
575 | * Let ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode.next | ||
576 | * and ct->tuplehash[IP_CT_DIR_REPLY].hnnode.next unchanged. | ||
577 | */ | ||
578 | memset(&ct->tuplehash[IP_CT_DIR_MAX], 0, | ||
579 | sizeof(*ct) - offsetof(struct nf_conn, tuplehash[IP_CT_DIR_MAX])); | ||
571 | spin_lock_init(&ct->lock); | 580 | spin_lock_init(&ct->lock); |
572 | atomic_set(&ct->ct_general.use, 1); | ||
573 | ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig; | 581 | ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig; |
582 | ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode.pprev = NULL; | ||
574 | ct->tuplehash[IP_CT_DIR_REPLY].tuple = *repl; | 583 | ct->tuplehash[IP_CT_DIR_REPLY].tuple = *repl; |
584 | ct->tuplehash[IP_CT_DIR_REPLY].hnnode.pprev = NULL; | ||
575 | /* Don't set timer yet: wait for confirmation */ | 585 | /* Don't set timer yet: wait for confirmation */ |
576 | setup_timer(&ct->timeout, death_by_timeout, (unsigned long)ct); | 586 | setup_timer(&ct->timeout, death_by_timeout, (unsigned long)ct); |
577 | #ifdef CONFIG_NET_NS | 587 | #ifdef CONFIG_NET_NS |
578 | ct->ct_net = net; | 588 | ct->ct_net = net; |
579 | #endif | 589 | #endif |
580 | 590 | ||
591 | /* | ||
592 | * changes to lookup keys must be done before setting refcnt to 1 | ||
593 | */ | ||
594 | smp_wmb(); | ||
595 | atomic_set(&ct->ct_general.use, 1); | ||
581 | return ct; | 596 | return ct; |
582 | } | 597 | } |
583 | EXPORT_SYMBOL_GPL(nf_conntrack_alloc); | 598 | EXPORT_SYMBOL_GPL(nf_conntrack_alloc); |
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c index 863e40977a4d..0f482e2440b4 100644 --- a/net/netfilter/xt_osf.c +++ b/net/netfilter/xt_osf.c | |||
@@ -330,7 +330,8 @@ static bool xt_osf_match_packet(const struct sk_buff *skb, | |||
330 | fcount++; | 330 | fcount++; |
331 | 331 | ||
332 | if (info->flags & XT_OSF_LOG) | 332 | if (info->flags & XT_OSF_LOG) |
333 | nf_log_packet(p->hooknum, 0, skb, p->in, p->out, NULL, | 333 | nf_log_packet(p->family, p->hooknum, skb, |
334 | p->in, p->out, NULL, | ||
334 | "%s [%s:%s] : %pi4:%d -> %pi4:%d hops=%d\n", | 335 | "%s [%s:%s] : %pi4:%d -> %pi4:%d hops=%d\n", |
335 | f->genre, f->version, f->subtype, | 336 | f->genre, f->version, f->subtype, |
336 | &ip->saddr, ntohs(tcp->source), | 337 | &ip->saddr, ntohs(tcp->source), |
@@ -345,7 +346,7 @@ static bool xt_osf_match_packet(const struct sk_buff *skb, | |||
345 | rcu_read_unlock(); | 346 | rcu_read_unlock(); |
346 | 347 | ||
347 | if (!fcount && (info->flags & XT_OSF_LOG)) | 348 | if (!fcount && (info->flags & XT_OSF_LOG)) |
348 | nf_log_packet(p->hooknum, 0, skb, p->in, p->out, NULL, | 349 | nf_log_packet(p->family, p->hooknum, skb, p->in, p->out, NULL, |
349 | "Remote OS is not known: %pi4:%u -> %pi4:%u\n", | 350 | "Remote OS is not known: %pi4:%u -> %pi4:%u\n", |
350 | &ip->saddr, ntohs(tcp->source), | 351 | &ip->saddr, ntohs(tcp->source), |
351 | &ip->daddr, ntohs(tcp->dest)); | 352 | &ip->daddr, ntohs(tcp->dest)); |