diff options
31 files changed, 217 insertions, 134 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 37054306dc9f..8fd05d4e3b0a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -2098,7 +2098,7 @@ S: Supported | |||
2098 | F: drivers/scsi/bfa/ | 2098 | F: drivers/scsi/bfa/ |
2099 | 2099 | ||
2100 | BROCADE BNA 10 GIGABIT ETHERNET DRIVER | 2100 | BROCADE BNA 10 GIGABIT ETHERNET DRIVER |
2101 | M: Rasesh Mody <rmody@brocade.com> | 2101 | M: Rasesh Mody <rasesh.mody@qlogic.com> |
2102 | L: netdev@vger.kernel.org | 2102 | L: netdev@vger.kernel.org |
2103 | S: Supported | 2103 | S: Supported |
2104 | F: drivers/net/ethernet/brocade/bna/ | 2104 | F: drivers/net/ethernet/brocade/bna/ |
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 2fee73b878c2..823d01c5684c 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c | |||
@@ -3236,8 +3236,9 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) | |||
3236 | 3236 | ||
3237 | skb->protocol = eth_type_trans(skb, bp->dev); | 3237 | skb->protocol = eth_type_trans(skb, bp->dev); |
3238 | 3238 | ||
3239 | if ((len > (bp->dev->mtu + ETH_HLEN)) && | 3239 | if (len > (bp->dev->mtu + ETH_HLEN) && |
3240 | (ntohs(skb->protocol) != 0x8100)) { | 3240 | skb->protocol != htons(0x8100) && |
3241 | skb->protocol != htons(ETH_P_8021AD)) { | ||
3241 | 3242 | ||
3242 | dev_kfree_skb(skb); | 3243 | dev_kfree_skb(skb); |
3243 | goto next_rx; | 3244 | goto next_rx; |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index e7d3a620d96a..ba499489969a 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -6918,7 +6918,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) | |||
6918 | skb->protocol = eth_type_trans(skb, tp->dev); | 6918 | skb->protocol = eth_type_trans(skb, tp->dev); |
6919 | 6919 | ||
6920 | if (len > (tp->dev->mtu + ETH_HLEN) && | 6920 | if (len > (tp->dev->mtu + ETH_HLEN) && |
6921 | skb->protocol != htons(ETH_P_8021Q)) { | 6921 | skb->protocol != htons(ETH_P_8021Q) && |
6922 | skb->protocol != htons(ETH_P_8021AD)) { | ||
6922 | dev_kfree_skb_any(skb); | 6923 | dev_kfree_skb_any(skb); |
6923 | goto drop_it_no_recycle; | 6924 | goto drop_it_no_recycle; |
6924 | } | 6925 | } |
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index ca5d7798b265..e1e02fba4fcc 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/of_device.h> | 30 | #include <linux/of_device.h> |
31 | #include <linux/of_mdio.h> | 31 | #include <linux/of_mdio.h> |
32 | #include <linux/of_net.h> | 32 | #include <linux/of_net.h> |
33 | #include <linux/pinctrl/consumer.h> | ||
34 | 33 | ||
35 | #include "macb.h" | 34 | #include "macb.h" |
36 | 35 | ||
@@ -2071,7 +2070,6 @@ static int __init macb_probe(struct platform_device *pdev) | |||
2071 | struct phy_device *phydev; | 2070 | struct phy_device *phydev; |
2072 | u32 config; | 2071 | u32 config; |
2073 | int err = -ENXIO; | 2072 | int err = -ENXIO; |
2074 | struct pinctrl *pinctrl; | ||
2075 | const char *mac; | 2073 | const char *mac; |
2076 | 2074 | ||
2077 | regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2075 | regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -2080,15 +2078,6 @@ static int __init macb_probe(struct platform_device *pdev) | |||
2080 | goto err_out; | 2078 | goto err_out; |
2081 | } | 2079 | } |
2082 | 2080 | ||
2083 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
2084 | if (IS_ERR(pinctrl)) { | ||
2085 | err = PTR_ERR(pinctrl); | ||
2086 | if (err == -EPROBE_DEFER) | ||
2087 | goto err_out; | ||
2088 | |||
2089 | dev_warn(&pdev->dev, "No pinctrl provided\n"); | ||
2090 | } | ||
2091 | |||
2092 | err = -ENOMEM; | 2081 | err = -ENOMEM; |
2093 | dev = alloc_etherdev(sizeof(*bp)); | 2082 | dev = alloc_etherdev(sizeof(*bp)); |
2094 | if (!dev) | 2083 | if (!dev) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 7e2d5d57c598..871e3a5bda38 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -78,13 +78,13 @@ MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero"); | |||
78 | #endif /* CONFIG_PCI_MSI */ | 78 | #endif /* CONFIG_PCI_MSI */ |
79 | 79 | ||
80 | static uint8_t num_vfs[3] = {0, 0, 0}; | 80 | static uint8_t num_vfs[3] = {0, 0, 0}; |
81 | static int num_vfs_argc = 3; | 81 | static int num_vfs_argc; |
82 | module_param_array(num_vfs, byte , &num_vfs_argc, 0444); | 82 | module_param_array(num_vfs, byte , &num_vfs_argc, 0444); |
83 | MODULE_PARM_DESC(num_vfs, "enable #num_vfs functions if num_vfs > 0\n" | 83 | MODULE_PARM_DESC(num_vfs, "enable #num_vfs functions if num_vfs > 0\n" |
84 | "num_vfs=port1,port2,port1+2"); | 84 | "num_vfs=port1,port2,port1+2"); |
85 | 85 | ||
86 | static uint8_t probe_vf[3] = {0, 0, 0}; | 86 | static uint8_t probe_vf[3] = {0, 0, 0}; |
87 | static int probe_vfs_argc = 3; | 87 | static int probe_vfs_argc; |
88 | module_param_array(probe_vf, byte, &probe_vfs_argc, 0444); | 88 | module_param_array(probe_vf, byte, &probe_vfs_argc, 0444); |
89 | MODULE_PARM_DESC(probe_vf, "number of vfs to probe by pf driver (num_vfs > 0)\n" | 89 | MODULE_PARM_DESC(probe_vf, "number of vfs to probe by pf driver (num_vfs > 0)\n" |
90 | "probe_vf=port1,port2,port1+2"); | 90 | "probe_vf=port1,port2,port1+2"); |
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c index 32058614151a..5c4068353f66 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | |||
@@ -135,6 +135,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter) | |||
135 | int i, j; | 135 | int i, j; |
136 | struct nx_host_tx_ring *tx_ring = adapter->tx_ring; | 136 | struct nx_host_tx_ring *tx_ring = adapter->tx_ring; |
137 | 137 | ||
138 | spin_lock(&adapter->tx_clean_lock); | ||
138 | cmd_buf = tx_ring->cmd_buf_arr; | 139 | cmd_buf = tx_ring->cmd_buf_arr; |
139 | for (i = 0; i < tx_ring->num_desc; i++) { | 140 | for (i = 0; i < tx_ring->num_desc; i++) { |
140 | buffrag = cmd_buf->frag_array; | 141 | buffrag = cmd_buf->frag_array; |
@@ -158,6 +159,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter) | |||
158 | } | 159 | } |
159 | cmd_buf++; | 160 | cmd_buf++; |
160 | } | 161 | } |
162 | spin_unlock(&adapter->tx_clean_lock); | ||
161 | } | 163 | } |
162 | 164 | ||
163 | void netxen_free_sw_resources(struct netxen_adapter *adapter) | 165 | void netxen_free_sw_resources(struct netxen_adapter *adapter) |
@@ -1792,9 +1794,9 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter) | |||
1792 | break; | 1794 | break; |
1793 | } | 1795 | } |
1794 | 1796 | ||
1795 | if (count && netif_running(netdev)) { | 1797 | tx_ring->sw_consumer = sw_consumer; |
1796 | tx_ring->sw_consumer = sw_consumer; | ||
1797 | 1798 | ||
1799 | if (count && netif_running(netdev)) { | ||
1798 | smp_mb(); | 1800 | smp_mb(); |
1799 | 1801 | ||
1800 | if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) | 1802 | if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) |
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c index 1159031f885b..5ec5a2b0e989 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | |||
@@ -1186,7 +1186,6 @@ __netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev) | |||
1186 | return; | 1186 | return; |
1187 | 1187 | ||
1188 | smp_mb(); | 1188 | smp_mb(); |
1189 | spin_lock(&adapter->tx_clean_lock); | ||
1190 | netif_carrier_off(netdev); | 1189 | netif_carrier_off(netdev); |
1191 | netif_tx_disable(netdev); | 1190 | netif_tx_disable(netdev); |
1192 | 1191 | ||
@@ -1204,7 +1203,6 @@ __netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev) | |||
1204 | netxen_napi_disable(adapter); | 1203 | netxen_napi_disable(adapter); |
1205 | 1204 | ||
1206 | netxen_release_tx_buffers(adapter); | 1205 | netxen_release_tx_buffers(adapter); |
1207 | spin_unlock(&adapter->tx_clean_lock); | ||
1208 | } | 1206 | } |
1209 | 1207 | ||
1210 | /* Usage: During suspend and firmware recovery module */ | 1208 | /* Usage: During suspend and firmware recovery module */ |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index 86783e1afcf7..3172cdf591fe 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | |||
@@ -1177,9 +1177,8 @@ static void qlcnic_83xx_setup_idc_parameters(struct qlcnic_adapter *adapter) | |||
1177 | { | 1177 | { |
1178 | u32 idc_params, val; | 1178 | u32 idc_params, val; |
1179 | 1179 | ||
1180 | if (qlcnic_83xx_lockless_flash_read32(adapter, | 1180 | if (qlcnic_83xx_flash_read32(adapter, QLC_83XX_IDC_FLASH_PARAM_ADDR, |
1181 | QLC_83XX_IDC_FLASH_PARAM_ADDR, | 1181 | (u8 *)&idc_params, 1)) { |
1182 | (u8 *)&idc_params, 1)) { | ||
1183 | dev_info(&adapter->pdev->dev, | 1182 | dev_info(&adapter->pdev->dev, |
1184 | "%s:failed to get IDC params from flash\n", __func__); | 1183 | "%s:failed to get IDC params from flash\n", __func__); |
1185 | adapter->dev_init_timeo = QLC_83XX_IDC_INIT_TIMEOUT_SECS; | 1184 | adapter->dev_init_timeo = QLC_83XX_IDC_INIT_TIMEOUT_SECS; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 141f116eb868..494e8105adee 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -1333,21 +1333,21 @@ static void qlcnic_get_ethtool_stats(struct net_device *dev, | |||
1333 | struct qlcnic_host_tx_ring *tx_ring; | 1333 | struct qlcnic_host_tx_ring *tx_ring; |
1334 | struct qlcnic_esw_statistics port_stats; | 1334 | struct qlcnic_esw_statistics port_stats; |
1335 | struct qlcnic_mac_statistics mac_stats; | 1335 | struct qlcnic_mac_statistics mac_stats; |
1336 | int index, ret, length, size, tx_size, ring; | 1336 | int index, ret, length, size, ring; |
1337 | char *p; | 1337 | char *p; |
1338 | 1338 | ||
1339 | tx_size = adapter->drv_tx_rings * QLCNIC_TX_STATS_LEN; | 1339 | memset(data, 0, stats->n_stats * sizeof(u64)); |
1340 | 1340 | ||
1341 | memset(data, 0, tx_size * sizeof(u64)); | ||
1342 | for (ring = 0, index = 0; ring < adapter->drv_tx_rings; ring++) { | 1341 | for (ring = 0, index = 0; ring < adapter->drv_tx_rings; ring++) { |
1343 | if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) { | 1342 | if (adapter->is_up == QLCNIC_ADAPTER_UP_MAGIC) { |
1344 | tx_ring = &adapter->tx_ring[ring]; | 1343 | tx_ring = &adapter->tx_ring[ring]; |
1345 | data = qlcnic_fill_tx_queue_stats(data, tx_ring); | 1344 | data = qlcnic_fill_tx_queue_stats(data, tx_ring); |
1346 | qlcnic_update_stats(adapter); | 1345 | qlcnic_update_stats(adapter); |
1346 | } else { | ||
1347 | data += QLCNIC_TX_STATS_LEN; | ||
1347 | } | 1348 | } |
1348 | } | 1349 | } |
1349 | 1350 | ||
1350 | memset(data, 0, stats->n_stats * sizeof(u64)); | ||
1351 | length = QLCNIC_STATS_LEN; | 1351 | length = QLCNIC_STATS_LEN; |
1352 | for (index = 0; index < length; index++) { | 1352 | for (index = 0; index < length; index++) { |
1353 | p = (char *)adapter + qlcnic_gstrings_stats[index].stat_offset; | 1353 | p = (char *)adapter + qlcnic_gstrings_stats[index].stat_offset; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 6e6ee226de04..b0c1521e08a3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -2786,8 +2786,15 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
2786 | if (IS_ERR(priv->stmmac_clk)) { | 2786 | if (IS_ERR(priv->stmmac_clk)) { |
2787 | dev_warn(priv->device, "%s: warning: cannot get CSR clock\n", | 2787 | dev_warn(priv->device, "%s: warning: cannot get CSR clock\n", |
2788 | __func__); | 2788 | __func__); |
2789 | ret = PTR_ERR(priv->stmmac_clk); | 2789 | /* If failed to obtain stmmac_clk and specific clk_csr value |
2790 | goto error_clk_get; | 2790 | * is NOT passed from the platform, probe fail. |
2791 | */ | ||
2792 | if (!priv->plat->clk_csr) { | ||
2793 | ret = PTR_ERR(priv->stmmac_clk); | ||
2794 | goto error_clk_get; | ||
2795 | } else { | ||
2796 | priv->stmmac_clk = NULL; | ||
2797 | } | ||
2791 | } | 2798 | } |
2792 | clk_prepare_enable(priv->stmmac_clk); | 2799 | clk_prepare_enable(priv->stmmac_clk); |
2793 | 2800 | ||
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index a9c5eaadc426..0fcb5e7eb073 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -387,6 +387,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
387 | int hdr_offset; | 387 | int hdr_offset; |
388 | u32 net_trans_info; | 388 | u32 net_trans_info; |
389 | u32 hash; | 389 | u32 hash; |
390 | u32 skb_length = skb->len; | ||
390 | 391 | ||
391 | 392 | ||
392 | /* We will atmost need two pages to describe the rndis | 393 | /* We will atmost need two pages to describe the rndis |
@@ -562,7 +563,7 @@ do_send: | |||
562 | 563 | ||
563 | drop: | 564 | drop: |
564 | if (ret == 0) { | 565 | if (ret == 0) { |
565 | net->stats.tx_bytes += skb->len; | 566 | net->stats.tx_bytes += skb_length; |
566 | net->stats.tx_packets++; | 567 | net->stats.tx_packets++; |
567 | } else { | 568 | } else { |
568 | kfree(packet); | 569 | kfree(packet); |
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 3381c4f91a8c..0c6adaaf898c 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -112,17 +112,15 @@ out: | |||
112 | return err; | 112 | return err; |
113 | } | 113 | } |
114 | 114 | ||
115 | /* Requires RTNL */ | ||
115 | static int macvtap_set_queue(struct net_device *dev, struct file *file, | 116 | static int macvtap_set_queue(struct net_device *dev, struct file *file, |
116 | struct macvtap_queue *q) | 117 | struct macvtap_queue *q) |
117 | { | 118 | { |
118 | struct macvlan_dev *vlan = netdev_priv(dev); | 119 | struct macvlan_dev *vlan = netdev_priv(dev); |
119 | int err = -EBUSY; | ||
120 | 120 | ||
121 | rtnl_lock(); | ||
122 | if (vlan->numqueues == MAX_MACVTAP_QUEUES) | 121 | if (vlan->numqueues == MAX_MACVTAP_QUEUES) |
123 | goto out; | 122 | return -EBUSY; |
124 | 123 | ||
125 | err = 0; | ||
126 | rcu_assign_pointer(q->vlan, vlan); | 124 | rcu_assign_pointer(q->vlan, vlan); |
127 | rcu_assign_pointer(vlan->taps[vlan->numvtaps], q); | 125 | rcu_assign_pointer(vlan->taps[vlan->numvtaps], q); |
128 | sock_hold(&q->sk); | 126 | sock_hold(&q->sk); |
@@ -136,9 +134,7 @@ static int macvtap_set_queue(struct net_device *dev, struct file *file, | |||
136 | vlan->numvtaps++; | 134 | vlan->numvtaps++; |
137 | vlan->numqueues++; | 135 | vlan->numqueues++; |
138 | 136 | ||
139 | out: | 137 | return 0; |
140 | rtnl_unlock(); | ||
141 | return err; | ||
142 | } | 138 | } |
143 | 139 | ||
144 | static int macvtap_disable_queue(struct macvtap_queue *q) | 140 | static int macvtap_disable_queue(struct macvtap_queue *q) |
@@ -454,11 +450,12 @@ static void macvtap_sock_destruct(struct sock *sk) | |||
454 | static int macvtap_open(struct inode *inode, struct file *file) | 450 | static int macvtap_open(struct inode *inode, struct file *file) |
455 | { | 451 | { |
456 | struct net *net = current->nsproxy->net_ns; | 452 | struct net *net = current->nsproxy->net_ns; |
457 | struct net_device *dev = dev_get_by_macvtap_minor(iminor(inode)); | 453 | struct net_device *dev; |
458 | struct macvtap_queue *q; | 454 | struct macvtap_queue *q; |
459 | int err; | 455 | int err = -ENODEV; |
460 | 456 | ||
461 | err = -ENODEV; | 457 | rtnl_lock(); |
458 | dev = dev_get_by_macvtap_minor(iminor(inode)); | ||
462 | if (!dev) | 459 | if (!dev) |
463 | goto out; | 460 | goto out; |
464 | 461 | ||
@@ -498,6 +495,7 @@ out: | |||
498 | if (dev) | 495 | if (dev) |
499 | dev_put(dev); | 496 | dev_put(dev); |
500 | 497 | ||
498 | rtnl_unlock(); | ||
501 | return err; | 499 | return err; |
502 | } | 500 | } |
503 | 501 | ||
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 74760e8143e3..604ef210a4de 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <net/ip6_checksum.h> | 24 | #include <net/ip6_checksum.h> |
25 | 25 | ||
26 | /* Version Information */ | 26 | /* Version Information */ |
27 | #define DRIVER_VERSION "v1.06.0 (2014/03/03)" | 27 | #define DRIVER_VERSION "v1.06.1 (2014/10/01)" |
28 | #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" | 28 | #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" |
29 | #define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" | 29 | #define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" |
30 | #define MODULENAME "r8152" | 30 | #define MODULENAME "r8152" |
@@ -1949,10 +1949,34 @@ static void rxdy_gated_en(struct r8152 *tp, bool enable) | |||
1949 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data); | 1949 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data); |
1950 | } | 1950 | } |
1951 | 1951 | ||
1952 | static int rtl_start_rx(struct r8152 *tp) | ||
1953 | { | ||
1954 | int i, ret = 0; | ||
1955 | |||
1956 | INIT_LIST_HEAD(&tp->rx_done); | ||
1957 | for (i = 0; i < RTL8152_MAX_RX; i++) { | ||
1958 | INIT_LIST_HEAD(&tp->rx_info[i].list); | ||
1959 | ret = r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL); | ||
1960 | if (ret) | ||
1961 | break; | ||
1962 | } | ||
1963 | |||
1964 | return ret; | ||
1965 | } | ||
1966 | |||
1967 | static int rtl_stop_rx(struct r8152 *tp) | ||
1968 | { | ||
1969 | int i; | ||
1970 | |||
1971 | for (i = 0; i < RTL8152_MAX_RX; i++) | ||
1972 | usb_kill_urb(tp->rx_info[i].urb); | ||
1973 | |||
1974 | return 0; | ||
1975 | } | ||
1976 | |||
1952 | static int rtl_enable(struct r8152 *tp) | 1977 | static int rtl_enable(struct r8152 *tp) |
1953 | { | 1978 | { |
1954 | u32 ocp_data; | 1979 | u32 ocp_data; |
1955 | int i, ret; | ||
1956 | 1980 | ||
1957 | r8152b_reset_packet_filter(tp); | 1981 | r8152b_reset_packet_filter(tp); |
1958 | 1982 | ||
@@ -1962,14 +1986,7 @@ static int rtl_enable(struct r8152 *tp) | |||
1962 | 1986 | ||
1963 | rxdy_gated_en(tp, false); | 1987 | rxdy_gated_en(tp, false); |
1964 | 1988 | ||
1965 | INIT_LIST_HEAD(&tp->rx_done); | 1989 | return rtl_start_rx(tp); |
1966 | ret = 0; | ||
1967 | for (i = 0; i < RTL8152_MAX_RX; i++) { | ||
1968 | INIT_LIST_HEAD(&tp->rx_info[i].list); | ||
1969 | ret |= r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL); | ||
1970 | } | ||
1971 | |||
1972 | return ret; | ||
1973 | } | 1990 | } |
1974 | 1991 | ||
1975 | static int rtl8152_enable(struct r8152 *tp) | 1992 | static int rtl8152_enable(struct r8152 *tp) |
@@ -2053,8 +2070,7 @@ static void rtl_disable(struct r8152 *tp) | |||
2053 | mdelay(1); | 2070 | mdelay(1); |
2054 | } | 2071 | } |
2055 | 2072 | ||
2056 | for (i = 0; i < RTL8152_MAX_RX; i++) | 2073 | rtl_stop_rx(tp); |
2057 | usb_kill_urb(tp->rx_info[i].urb); | ||
2058 | 2074 | ||
2059 | rtl8152_nic_reset(tp); | 2075 | rtl8152_nic_reset(tp); |
2060 | } | 2076 | } |
@@ -2185,28 +2201,6 @@ static void rtl_phy_reset(struct r8152 *tp) | |||
2185 | } | 2201 | } |
2186 | } | 2202 | } |
2187 | 2203 | ||
2188 | static void rtl_clear_bp(struct r8152 *tp) | ||
2189 | { | ||
2190 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_0, 0); | ||
2191 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_2, 0); | ||
2192 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_4, 0); | ||
2193 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_6, 0); | ||
2194 | ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_0, 0); | ||
2195 | ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_2, 0); | ||
2196 | ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_4, 0); | ||
2197 | ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_6, 0); | ||
2198 | mdelay(3); | ||
2199 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_BA, 0); | ||
2200 | ocp_write_word(tp, MCU_TYPE_USB, USB_BP_BA, 0); | ||
2201 | } | ||
2202 | |||
2203 | static void r8153_clear_bp(struct r8152 *tp) | ||
2204 | { | ||
2205 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_BP_EN, 0); | ||
2206 | ocp_write_byte(tp, MCU_TYPE_USB, USB_BP_EN, 0); | ||
2207 | rtl_clear_bp(tp); | ||
2208 | } | ||
2209 | |||
2210 | static void r8153_teredo_off(struct r8152 *tp) | 2204 | static void r8153_teredo_off(struct r8152 *tp) |
2211 | { | 2205 | { |
2212 | u32 ocp_data; | 2206 | u32 ocp_data; |
@@ -2249,8 +2243,6 @@ static void r8152b_hw_phy_cfg(struct r8152 *tp) | |||
2249 | r8152_mdio_write(tp, MII_BMCR, data); | 2243 | r8152_mdio_write(tp, MII_BMCR, data); |
2250 | } | 2244 | } |
2251 | 2245 | ||
2252 | rtl_clear_bp(tp); | ||
2253 | |||
2254 | set_bit(PHY_RESET, &tp->flags); | 2246 | set_bit(PHY_RESET, &tp->flags); |
2255 | } | 2247 | } |
2256 | 2248 | ||
@@ -2401,8 +2393,6 @@ static void r8153_hw_phy_cfg(struct r8152 *tp) | |||
2401 | r8152_mdio_write(tp, MII_BMCR, data); | 2393 | r8152_mdio_write(tp, MII_BMCR, data); |
2402 | } | 2394 | } |
2403 | 2395 | ||
2404 | r8153_clear_bp(tp); | ||
2405 | |||
2406 | if (tp->version == RTL_VER_03) { | 2396 | if (tp->version == RTL_VER_03) { |
2407 | data = ocp_reg_read(tp, OCP_EEE_CFG); | 2397 | data = ocp_reg_read(tp, OCP_EEE_CFG); |
2408 | data &= ~CTAP_SHORT_EN; | 2398 | data &= ~CTAP_SHORT_EN; |
@@ -3083,13 +3073,14 @@ static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message) | |||
3083 | clear_bit(WORK_ENABLE, &tp->flags); | 3073 | clear_bit(WORK_ENABLE, &tp->flags); |
3084 | usb_kill_urb(tp->intr_urb); | 3074 | usb_kill_urb(tp->intr_urb); |
3085 | cancel_delayed_work_sync(&tp->schedule); | 3075 | cancel_delayed_work_sync(&tp->schedule); |
3076 | tasklet_disable(&tp->tl); | ||
3086 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | 3077 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { |
3078 | rtl_stop_rx(tp); | ||
3087 | rtl_runtime_suspend_enable(tp, true); | 3079 | rtl_runtime_suspend_enable(tp, true); |
3088 | } else { | 3080 | } else { |
3089 | tasklet_disable(&tp->tl); | ||
3090 | tp->rtl_ops.down(tp); | 3081 | tp->rtl_ops.down(tp); |
3091 | tasklet_enable(&tp->tl); | ||
3092 | } | 3082 | } |
3083 | tasklet_enable(&tp->tl); | ||
3093 | } | 3084 | } |
3094 | 3085 | ||
3095 | return 0; | 3086 | return 0; |
@@ -3108,17 +3099,18 @@ static int rtl8152_resume(struct usb_interface *intf) | |||
3108 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | 3099 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { |
3109 | rtl_runtime_suspend_enable(tp, false); | 3100 | rtl_runtime_suspend_enable(tp, false); |
3110 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); | 3101 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); |
3102 | set_bit(WORK_ENABLE, &tp->flags); | ||
3111 | if (tp->speed & LINK_STATUS) | 3103 | if (tp->speed & LINK_STATUS) |
3112 | tp->rtl_ops.disable(tp); | 3104 | rtl_start_rx(tp); |
3113 | } else { | 3105 | } else { |
3114 | tp->rtl_ops.up(tp); | 3106 | tp->rtl_ops.up(tp); |
3115 | rtl8152_set_speed(tp, AUTONEG_ENABLE, | 3107 | rtl8152_set_speed(tp, AUTONEG_ENABLE, |
3116 | tp->mii.supports_gmii ? SPEED_1000 : SPEED_100, | 3108 | tp->mii.supports_gmii ? SPEED_1000 : SPEED_100, |
3117 | DUPLEX_FULL); | 3109 | DUPLEX_FULL); |
3110 | tp->speed = 0; | ||
3111 | netif_carrier_off(tp->netdev); | ||
3112 | set_bit(WORK_ENABLE, &tp->flags); | ||
3118 | } | 3113 | } |
3119 | tp->speed = 0; | ||
3120 | netif_carrier_off(tp->netdev); | ||
3121 | set_bit(WORK_ENABLE, &tp->flags); | ||
3122 | usb_submit_urb(tp->intr_urb, GFP_KERNEL); | 3114 | usb_submit_urb(tp->intr_urb, GFP_KERNEL); |
3123 | } | 3115 | } |
3124 | 3116 | ||
@@ -3405,7 +3397,7 @@ static void rtl8153_unload(struct r8152 *tp) | |||
3405 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | 3397 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) |
3406 | return; | 3398 | return; |
3407 | 3399 | ||
3408 | r8153_power_cut_en(tp, true); | 3400 | r8153_power_cut_en(tp, false); |
3409 | } | 3401 | } |
3410 | 3402 | ||
3411 | static int rtl_ops_init(struct r8152 *tp, const struct usb_device_id *id) | 3403 | static int rtl_ops_init(struct r8152 *tp, const struct usb_device_id *id) |
@@ -3558,7 +3550,11 @@ static void rtl8152_disconnect(struct usb_interface *intf) | |||
3558 | 3550 | ||
3559 | usb_set_intfdata(intf, NULL); | 3551 | usb_set_intfdata(intf, NULL); |
3560 | if (tp) { | 3552 | if (tp) { |
3561 | set_bit(RTL8152_UNPLUG, &tp->flags); | 3553 | struct usb_device *udev = tp->udev; |
3554 | |||
3555 | if (udev->state == USB_STATE_NOTATTACHED) | ||
3556 | set_bit(RTL8152_UNPLUG, &tp->flags); | ||
3557 | |||
3562 | tasklet_kill(&tp->tl); | 3558 | tasklet_kill(&tp->tl); |
3563 | unregister_netdev(tp->netdev); | 3559 | unregister_netdev(tp->netdev); |
3564 | tp->rtl_ops.unload(tp); | 3560 | tp->rtl_ops.unload(tp); |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 9bcb220bd4ad..cf485f9aa563 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -114,16 +114,13 @@ struct rt6_info { | |||
114 | u32 rt6i_flags; | 114 | u32 rt6i_flags; |
115 | struct rt6key rt6i_src; | 115 | struct rt6key rt6i_src; |
116 | struct rt6key rt6i_prefsrc; | 116 | struct rt6key rt6i_prefsrc; |
117 | u32 rt6i_metric; | ||
118 | 117 | ||
119 | struct inet6_dev *rt6i_idev; | 118 | struct inet6_dev *rt6i_idev; |
120 | unsigned long _rt6i_peer; | 119 | unsigned long _rt6i_peer; |
121 | 120 | ||
122 | u32 rt6i_genid; | 121 | u32 rt6i_metric; |
123 | |||
124 | /* more non-fragment space at head required */ | 122 | /* more non-fragment space at head required */ |
125 | unsigned short rt6i_nfheader_len; | 123 | unsigned short rt6i_nfheader_len; |
126 | |||
127 | u8 rt6i_protocol; | 124 | u8 rt6i_protocol; |
128 | }; | 125 | }; |
129 | 126 | ||
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 361d26077196..e0d64667a4b3 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -352,26 +352,12 @@ static inline void rt_genid_bump_ipv4(struct net *net) | |||
352 | atomic_inc(&net->ipv4.rt_genid); | 352 | atomic_inc(&net->ipv4.rt_genid); |
353 | } | 353 | } |
354 | 354 | ||
355 | #if IS_ENABLED(CONFIG_IPV6) | 355 | extern void (*__fib6_flush_trees)(struct net *net); |
356 | static inline int rt_genid_ipv6(struct net *net) | ||
357 | { | ||
358 | return atomic_read(&net->ipv6.rt_genid); | ||
359 | } | ||
360 | |||
361 | static inline void rt_genid_bump_ipv6(struct net *net) | ||
362 | { | ||
363 | atomic_inc(&net->ipv6.rt_genid); | ||
364 | } | ||
365 | #else | ||
366 | static inline int rt_genid_ipv6(struct net *net) | ||
367 | { | ||
368 | return 0; | ||
369 | } | ||
370 | |||
371 | static inline void rt_genid_bump_ipv6(struct net *net) | 356 | static inline void rt_genid_bump_ipv6(struct net *net) |
372 | { | 357 | { |
358 | if (__fib6_flush_trees) | ||
359 | __fib6_flush_trees(net); | ||
373 | } | 360 | } |
374 | #endif | ||
375 | 361 | ||
376 | #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) | 362 | #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) |
377 | static inline struct netns_ieee802154_lowpan * | 363 | static inline struct netns_ieee802154_lowpan * |
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 7b36e4d40ed7..16d02639d334 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
@@ -588,13 +588,13 @@ EXPORT_SYMBOL_GPL(rhashtable_init); | |||
588 | * rhashtable_destroy - destroy hash table | 588 | * rhashtable_destroy - destroy hash table |
589 | * @ht: the hash table to destroy | 589 | * @ht: the hash table to destroy |
590 | * | 590 | * |
591 | * Frees the bucket array. | 591 | * Frees the bucket array. This function is not rcu safe, therefore the caller |
592 | * has to make sure that no resizing may happen by unpublishing the hashtable | ||
593 | * and waiting for the quiescent cycle before releasing the bucket array. | ||
592 | */ | 594 | */ |
593 | void rhashtable_destroy(const struct rhashtable *ht) | 595 | void rhashtable_destroy(const struct rhashtable *ht) |
594 | { | 596 | { |
595 | const struct bucket_table *tbl = rht_dereference(ht->tbl, ht); | 597 | bucket_table_free(ht->tbl); |
596 | |||
597 | bucket_table_free(tbl); | ||
598 | } | 598 | } |
599 | EXPORT_SYMBOL_GPL(rhashtable_destroy); | 599 | EXPORT_SYMBOL_GPL(rhashtable_destroy); |
600 | 600 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index da1378a3e2c7..8d289697cc7a 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -3152,6 +3152,9 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
3152 | NAPI_GRO_CB(skb)->free = NAPI_GRO_FREE_STOLEN_HEAD; | 3152 | NAPI_GRO_CB(skb)->free = NAPI_GRO_FREE_STOLEN_HEAD; |
3153 | goto done; | 3153 | goto done; |
3154 | } | 3154 | } |
3155 | /* switch back to head shinfo */ | ||
3156 | pinfo = skb_shinfo(p); | ||
3157 | |||
3155 | if (pinfo->frag_list) | 3158 | if (pinfo->frag_list) |
3156 | goto merge; | 3159 | goto merge; |
3157 | if (skb_gro_len(p) != pinfo->gso_size) | 3160 | if (skb_gro_len(p) != pinfo->gso_size) |
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index bd41dd1948b6..bda4bb8ae260 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -764,9 +764,14 @@ int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd) | |||
764 | 764 | ||
765 | t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type); | 765 | t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type); |
766 | 766 | ||
767 | if (!t && (cmd == SIOCADDTUNNEL)) { | 767 | if (cmd == SIOCADDTUNNEL) { |
768 | t = ip_tunnel_create(net, itn, p); | 768 | if (!t) { |
769 | err = PTR_ERR_OR_ZERO(t); | 769 | t = ip_tunnel_create(net, itn, p); |
770 | err = PTR_ERR_OR_ZERO(t); | ||
771 | break; | ||
772 | } | ||
773 | |||
774 | err = -EEXIST; | ||
770 | break; | 775 | break; |
771 | } | 776 | } |
772 | if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) { | 777 | if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) { |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 173e7ea54c70..cbadb942c332 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -746,7 +746,7 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow | |||
746 | } | 746 | } |
747 | 747 | ||
748 | n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw); | 748 | n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw); |
749 | if (n) { | 749 | if (!IS_ERR(n)) { |
750 | if (!(n->nud_state & NUD_VALID)) { | 750 | if (!(n->nud_state & NUD_VALID)) { |
751 | neigh_event_send(n, NULL); | 751 | neigh_event_send(n, NULL); |
752 | } else { | 752 | } else { |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 3342ee64f2e3..3e118dfddd02 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -4780,10 +4780,11 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | |||
4780 | 4780 | ||
4781 | if (ip6_del_rt(ifp->rt)) | 4781 | if (ip6_del_rt(ifp->rt)) |
4782 | dst_free(&ifp->rt->dst); | 4782 | dst_free(&ifp->rt->dst); |
4783 | |||
4784 | rt_genid_bump_ipv6(net); | ||
4783 | break; | 4785 | break; |
4784 | } | 4786 | } |
4785 | atomic_inc(&net->ipv6.dev_addr_genid); | 4787 | atomic_inc(&net->ipv6.dev_addr_genid); |
4786 | rt_genid_bump_ipv6(net); | ||
4787 | } | 4788 | } |
4788 | 4789 | ||
4789 | static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | 4790 | static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) |
diff --git a/net/ipv6/addrconf_core.c b/net/ipv6/addrconf_core.c index e6960457f625..98cc4cd570e2 100644 --- a/net/ipv6/addrconf_core.c +++ b/net/ipv6/addrconf_core.c | |||
@@ -8,6 +8,13 @@ | |||
8 | #include <net/addrconf.h> | 8 | #include <net/addrconf.h> |
9 | #include <net/ip.h> | 9 | #include <net/ip.h> |
10 | 10 | ||
11 | /* if ipv6 module registers this function is used by xfrm to force all | ||
12 | * sockets to relookup their nodes - this is fairly expensive, be | ||
13 | * careful | ||
14 | */ | ||
15 | void (*__fib6_flush_trees)(struct net *); | ||
16 | EXPORT_SYMBOL(__fib6_flush_trees); | ||
17 | |||
11 | #define IPV6_ADDR_SCOPE_TYPE(scope) ((scope) << 16) | 18 | #define IPV6_ADDR_SCOPE_TYPE(scope) ((scope) << 16) |
12 | 19 | ||
13 | static inline unsigned int ipv6_addr_scope2type(unsigned int scope) | 20 | static inline unsigned int ipv6_addr_scope2type(unsigned int scope) |
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 76b7f5ee8f4c..97b9fa8de377 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -1605,6 +1605,24 @@ static void fib6_prune_clones(struct net *net, struct fib6_node *fn) | |||
1605 | fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL); | 1605 | fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL); |
1606 | } | 1606 | } |
1607 | 1607 | ||
1608 | static int fib6_update_sernum(struct rt6_info *rt, void *arg) | ||
1609 | { | ||
1610 | __u32 sernum = *(__u32 *)arg; | ||
1611 | |||
1612 | if (rt->rt6i_node && | ||
1613 | rt->rt6i_node->fn_sernum != sernum) | ||
1614 | rt->rt6i_node->fn_sernum = sernum; | ||
1615 | |||
1616 | return 0; | ||
1617 | } | ||
1618 | |||
1619 | static void fib6_flush_trees(struct net *net) | ||
1620 | { | ||
1621 | __u32 new_sernum = fib6_new_sernum(); | ||
1622 | |||
1623 | fib6_clean_all(net, fib6_update_sernum, &new_sernum); | ||
1624 | } | ||
1625 | |||
1608 | /* | 1626 | /* |
1609 | * Garbage collection | 1627 | * Garbage collection |
1610 | */ | 1628 | */ |
@@ -1788,6 +1806,8 @@ int __init fib6_init(void) | |||
1788 | NULL); | 1806 | NULL); |
1789 | if (ret) | 1807 | if (ret) |
1790 | goto out_unregister_subsys; | 1808 | goto out_unregister_subsys; |
1809 | |||
1810 | __fib6_flush_trees = fib6_flush_trees; | ||
1791 | out: | 1811 | out: |
1792 | return ret; | 1812 | return ret; |
1793 | 1813 | ||
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 5f19dfbc4c6a..f304471477dc 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -314,6 +314,8 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net, | |||
314 | struct ip6gre_net *ign = net_generic(net, ip6gre_net_id); | 314 | struct ip6gre_net *ign = net_generic(net, ip6gre_net_id); |
315 | 315 | ||
316 | t = ip6gre_tunnel_find(net, parms, ARPHRD_IP6GRE); | 316 | t = ip6gre_tunnel_find(net, parms, ARPHRD_IP6GRE); |
317 | if (t && create) | ||
318 | return NULL; | ||
317 | if (t || !create) | 319 | if (t || !create) |
318 | return t; | 320 | return t; |
319 | 321 | ||
@@ -1724,4 +1726,5 @@ MODULE_LICENSE("GPL"); | |||
1724 | MODULE_AUTHOR("D. Kozlov (xeb@mail.ru)"); | 1726 | MODULE_AUTHOR("D. Kozlov (xeb@mail.ru)"); |
1725 | MODULE_DESCRIPTION("GRE over IPv6 tunneling device"); | 1727 | MODULE_DESCRIPTION("GRE over IPv6 tunneling device"); |
1726 | MODULE_ALIAS_RTNL_LINK("ip6gre"); | 1728 | MODULE_ALIAS_RTNL_LINK("ip6gre"); |
1729 | MODULE_ALIAS_RTNL_LINK("ip6gretap"); | ||
1727 | MODULE_ALIAS_NETDEV("ip6gre0"); | 1730 | MODULE_ALIAS_NETDEV("ip6gre0"); |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index f9de5a695072..69a84b464009 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -364,8 +364,12 @@ static struct ip6_tnl *ip6_tnl_locate(struct net *net, | |||
364 | (t = rtnl_dereference(*tp)) != NULL; | 364 | (t = rtnl_dereference(*tp)) != NULL; |
365 | tp = &t->next) { | 365 | tp = &t->next) { |
366 | if (ipv6_addr_equal(local, &t->parms.laddr) && | 366 | if (ipv6_addr_equal(local, &t->parms.laddr) && |
367 | ipv6_addr_equal(remote, &t->parms.raddr)) | 367 | ipv6_addr_equal(remote, &t->parms.raddr)) { |
368 | if (create) | ||
369 | return NULL; | ||
370 | |||
368 | return t; | 371 | return t; |
372 | } | ||
369 | } | 373 | } |
370 | if (!create) | 374 | if (!create) |
371 | return NULL; | 375 | return NULL; |
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index 7f52fd9fa7b0..5833a2244467 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c | |||
@@ -253,8 +253,12 @@ static struct ip6_tnl *vti6_locate(struct net *net, struct __ip6_tnl_parm *p, | |||
253 | (t = rtnl_dereference(*tp)) != NULL; | 253 | (t = rtnl_dereference(*tp)) != NULL; |
254 | tp = &t->next) { | 254 | tp = &t->next) { |
255 | if (ipv6_addr_equal(local, &t->parms.laddr) && | 255 | if (ipv6_addr_equal(local, &t->parms.laddr) && |
256 | ipv6_addr_equal(remote, &t->parms.raddr)) | 256 | ipv6_addr_equal(remote, &t->parms.raddr)) { |
257 | if (create) | ||
258 | return NULL; | ||
259 | |||
257 | return t; | 260 | return t; |
261 | } | ||
258 | } | 262 | } |
259 | if (!create) | 263 | if (!create) |
260 | return NULL; | 264 | return NULL; |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index f23fbd28a501..bafde82324c5 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -314,7 +314,6 @@ static inline struct rt6_info *ip6_dst_alloc(struct net *net, | |||
314 | 314 | ||
315 | memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); | 315 | memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); |
316 | rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers); | 316 | rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers); |
317 | rt->rt6i_genid = rt_genid_ipv6(net); | ||
318 | INIT_LIST_HEAD(&rt->rt6i_siblings); | 317 | INIT_LIST_HEAD(&rt->rt6i_siblings); |
319 | } | 318 | } |
320 | return rt; | 319 | return rt; |
@@ -1098,9 +1097,6 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie) | |||
1098 | * DST_OBSOLETE_FORCE_CHK which forces validation calls down | 1097 | * DST_OBSOLETE_FORCE_CHK which forces validation calls down |
1099 | * into this function always. | 1098 | * into this function always. |
1100 | */ | 1099 | */ |
1101 | if (rt->rt6i_genid != rt_genid_ipv6(dev_net(rt->dst.dev))) | ||
1102 | return NULL; | ||
1103 | |||
1104 | if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie)) | 1100 | if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie)) |
1105 | return NULL; | 1101 | return NULL; |
1106 | 1102 | ||
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig index b5c1d3aadb41..6d77cce481d5 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig | |||
@@ -847,6 +847,7 @@ config NETFILTER_XT_TARGET_TPROXY | |||
847 | tristate '"TPROXY" target transparent proxying support' | 847 | tristate '"TPROXY" target transparent proxying support' |
848 | depends on NETFILTER_XTABLES | 848 | depends on NETFILTER_XTABLES |
849 | depends on NETFILTER_ADVANCED | 849 | depends on NETFILTER_ADVANCED |
850 | depends on (IPV6 || IPV6=n) | ||
850 | depends on IP_NF_MANGLE | 851 | depends on IP_NF_MANGLE |
851 | select NF_DEFRAG_IPV4 | 852 | select NF_DEFRAG_IPV4 |
852 | select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES | 853 | select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index c138b8fbe280..f37f0716a9fc 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -222,6 +222,51 @@ replay: | |||
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | struct nfnl_err { | ||
226 | struct list_head head; | ||
227 | struct nlmsghdr *nlh; | ||
228 | int err; | ||
229 | }; | ||
230 | |||
231 | static int nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err) | ||
232 | { | ||
233 | struct nfnl_err *nfnl_err; | ||
234 | |||
235 | nfnl_err = kmalloc(sizeof(struct nfnl_err), GFP_KERNEL); | ||
236 | if (nfnl_err == NULL) | ||
237 | return -ENOMEM; | ||
238 | |||
239 | nfnl_err->nlh = nlh; | ||
240 | nfnl_err->err = err; | ||
241 | list_add_tail(&nfnl_err->head, list); | ||
242 | |||
243 | return 0; | ||
244 | } | ||
245 | |||
246 | static void nfnl_err_del(struct nfnl_err *nfnl_err) | ||
247 | { | ||
248 | list_del(&nfnl_err->head); | ||
249 | kfree(nfnl_err); | ||
250 | } | ||
251 | |||
252 | static void nfnl_err_reset(struct list_head *err_list) | ||
253 | { | ||
254 | struct nfnl_err *nfnl_err, *next; | ||
255 | |||
256 | list_for_each_entry_safe(nfnl_err, next, err_list, head) | ||
257 | nfnl_err_del(nfnl_err); | ||
258 | } | ||
259 | |||
260 | static void nfnl_err_deliver(struct list_head *err_list, struct sk_buff *skb) | ||
261 | { | ||
262 | struct nfnl_err *nfnl_err, *next; | ||
263 | |||
264 | list_for_each_entry_safe(nfnl_err, next, err_list, head) { | ||
265 | netlink_ack(skb, nfnl_err->nlh, nfnl_err->err); | ||
266 | nfnl_err_del(nfnl_err); | ||
267 | } | ||
268 | } | ||
269 | |||
225 | static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh, | 270 | static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh, |
226 | u_int16_t subsys_id) | 271 | u_int16_t subsys_id) |
227 | { | 272 | { |
@@ -230,6 +275,7 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
230 | const struct nfnetlink_subsystem *ss; | 275 | const struct nfnetlink_subsystem *ss; |
231 | const struct nfnl_callback *nc; | 276 | const struct nfnl_callback *nc; |
232 | bool success = true, done = false; | 277 | bool success = true, done = false; |
278 | static LIST_HEAD(err_list); | ||
233 | int err; | 279 | int err; |
234 | 280 | ||
235 | if (subsys_id >= NFNL_SUBSYS_COUNT) | 281 | if (subsys_id >= NFNL_SUBSYS_COUNT) |
@@ -287,6 +333,7 @@ replay: | |||
287 | type = nlh->nlmsg_type; | 333 | type = nlh->nlmsg_type; |
288 | if (type == NFNL_MSG_BATCH_BEGIN) { | 334 | if (type == NFNL_MSG_BATCH_BEGIN) { |
289 | /* Malformed: Batch begin twice */ | 335 | /* Malformed: Batch begin twice */ |
336 | nfnl_err_reset(&err_list); | ||
290 | success = false; | 337 | success = false; |
291 | goto done; | 338 | goto done; |
292 | } else if (type == NFNL_MSG_BATCH_END) { | 339 | } else if (type == NFNL_MSG_BATCH_END) { |
@@ -333,6 +380,7 @@ replay: | |||
333 | * original skb. | 380 | * original skb. |
334 | */ | 381 | */ |
335 | if (err == -EAGAIN) { | 382 | if (err == -EAGAIN) { |
383 | nfnl_err_reset(&err_list); | ||
336 | ss->abort(skb); | 384 | ss->abort(skb); |
337 | nfnl_unlock(subsys_id); | 385 | nfnl_unlock(subsys_id); |
338 | kfree_skb(nskb); | 386 | kfree_skb(nskb); |
@@ -341,11 +389,24 @@ replay: | |||
341 | } | 389 | } |
342 | ack: | 390 | ack: |
343 | if (nlh->nlmsg_flags & NLM_F_ACK || err) { | 391 | if (nlh->nlmsg_flags & NLM_F_ACK || err) { |
392 | /* Errors are delivered once the full batch has been | ||
393 | * processed, this avoids that the same error is | ||
394 | * reported several times when replaying the batch. | ||
395 | */ | ||
396 | if (nfnl_err_add(&err_list, nlh, err) < 0) { | ||
397 | /* We failed to enqueue an error, reset the | ||
398 | * list of errors and send OOM to userspace | ||
399 | * pointing to the batch header. | ||
400 | */ | ||
401 | nfnl_err_reset(&err_list); | ||
402 | netlink_ack(skb, nlmsg_hdr(oskb), -ENOMEM); | ||
403 | success = false; | ||
404 | goto done; | ||
405 | } | ||
344 | /* We don't stop processing the batch on errors, thus, | 406 | /* We don't stop processing the batch on errors, thus, |
345 | * userspace gets all the errors that the batch | 407 | * userspace gets all the errors that the batch |
346 | * triggers. | 408 | * triggers. |
347 | */ | 409 | */ |
348 | netlink_ack(skb, nlh, err); | ||
349 | if (err) | 410 | if (err) |
350 | success = false; | 411 | success = false; |
351 | } | 412 | } |
@@ -361,6 +422,7 @@ done: | |||
361 | else | 422 | else |
362 | ss->abort(skb); | 423 | ss->abort(skb); |
363 | 424 | ||
425 | nfnl_err_deliver(&err_list, oskb); | ||
364 | nfnl_unlock(subsys_id); | 426 | nfnl_unlock(subsys_id); |
365 | kfree_skb(nskb); | 427 | kfree_skb(nskb); |
366 | } | 428 | } |
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c index 28fb8f38e6ba..8892b7b6184a 100644 --- a/net/netfilter/nft_hash.c +++ b/net/netfilter/nft_hash.c | |||
@@ -180,15 +180,17 @@ static int nft_hash_init(const struct nft_set *set, | |||
180 | static void nft_hash_destroy(const struct nft_set *set) | 180 | static void nft_hash_destroy(const struct nft_set *set) |
181 | { | 181 | { |
182 | const struct rhashtable *priv = nft_set_priv(set); | 182 | const struct rhashtable *priv = nft_set_priv(set); |
183 | const struct bucket_table *tbl; | 183 | const struct bucket_table *tbl = priv->tbl; |
184 | struct nft_hash_elem *he, *next; | 184 | struct nft_hash_elem *he, *next; |
185 | unsigned int i; | 185 | unsigned int i; |
186 | 186 | ||
187 | tbl = rht_dereference(priv->tbl, priv); | 187 | for (i = 0; i < tbl->size; i++) { |
188 | for (i = 0; i < tbl->size; i++) | 188 | for (he = rht_entry(tbl->buckets[i], struct nft_hash_elem, node); |
189 | rht_for_each_entry_safe(he, next, tbl->buckets[i], priv, node) | 189 | he != NULL; he = next) { |
190 | next = rht_entry(he->node.next, struct nft_hash_elem, node); | ||
190 | nft_hash_elem_destroy(set, he); | 191 | nft_hash_elem_destroy(set, he); |
191 | 192 | } | |
193 | } | ||
192 | rhashtable_destroy(priv); | 194 | rhashtable_destroy(priv); |
193 | } | 195 | } |
194 | 196 | ||
diff --git a/net/netfilter/nft_rbtree.c b/net/netfilter/nft_rbtree.c index e1836ff88199..46214f245665 100644 --- a/net/netfilter/nft_rbtree.c +++ b/net/netfilter/nft_rbtree.c | |||
@@ -234,13 +234,11 @@ static void nft_rbtree_destroy(const struct nft_set *set) | |||
234 | struct nft_rbtree_elem *rbe; | 234 | struct nft_rbtree_elem *rbe; |
235 | struct rb_node *node; | 235 | struct rb_node *node; |
236 | 236 | ||
237 | spin_lock_bh(&nft_rbtree_lock); | ||
238 | while ((node = priv->root.rb_node) != NULL) { | 237 | while ((node = priv->root.rb_node) != NULL) { |
239 | rb_erase(node, &priv->root); | 238 | rb_erase(node, &priv->root); |
240 | rbe = rb_entry(node, struct nft_rbtree_elem, node); | 239 | rbe = rb_entry(node, struct nft_rbtree_elem, node); |
241 | nft_rbtree_elem_destroy(set, rbe); | 240 | nft_rbtree_elem_destroy(set, rbe); |
242 | } | 241 | } |
243 | spin_unlock_bh(&nft_rbtree_lock); | ||
244 | } | 242 | } |
245 | 243 | ||
246 | static bool nft_rbtree_estimate(const struct nft_set_desc *desc, u32 features, | 244 | static bool nft_rbtree_estimate(const struct nft_set_desc *desc, u32 features, |
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 3a633debb6df..ad57f4444b9c 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c | |||
@@ -526,9 +526,11 @@ pop_stack: | |||
526 | match_idx = stack[--stackp]; | 526 | match_idx = stack[--stackp]; |
527 | cur_match = tcf_em_get_match(tree, match_idx); | 527 | cur_match = tcf_em_get_match(tree, match_idx); |
528 | 528 | ||
529 | if (tcf_em_early_end(cur_match, res)) | 529 | if (tcf_em_early_end(cur_match, res)) { |
530 | if (tcf_em_is_inverted(cur_match)) | ||
531 | res = !res; | ||
530 | goto pop_stack; | 532 | goto pop_stack; |
531 | else { | 533 | } else { |
532 | match_idx++; | 534 | match_idx++; |
533 | goto proceed; | 535 | goto proceed; |
534 | } | 536 | } |