Skip to content

Commit 1f6a563

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Segregate namespaces properly in conntrack dumps, from Liping Zhang. 2) tcp listener refcount fix in netfilter tproxy, from Eric Dumazet. 3) Fix timeouts in qed driver due to xmit_more, from Yuval Mintz. 4) Fix use-after-free in tcp_xmit_retransmit_queue(). 5) Userspace header fixups (use of __u32, missing includes, etc.) from Mikko Rapeli. 6) Further refinements to fragmentation wrt gso and tunnels, from Shmulik Ladkani. 7) Trigger poll correctly for zero length UDP packets, from Eric Dumazet. 8) TCP window scaling fix, also from Eric Dumazet. 9) SLAB_DESTROY_BY_RCU is not relevant any more for UDP sockets. 10) Module refcount leak in qdisc_create_dflt(), from Eric Dumazet. 11) Fix deadlock in cp_rx_poll() of 8139cp driver, from Gao Feng. 12) Memory leak in rhashtable's alloc_bucket_locks(), from Eric Dumazet. 13) Add new device ID to alx driver, from Owen Lin. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (83 commits) Add Killer E2500 device ID in alx driver. net: smc91x: fix SMC accesses Documentation: networking: dsa: Remove platform device TODO net/mlx5: Increase number of ethtool steering priorities net/mlx5: Add error prints when validate ETS failed net/mlx5e: Fix memory leak if refreshing TIRs fails net/mlx5e: Add ethtool counter for TX xmit_more net/mlx5e: Fix ethtool -g/G rx ring parameter report with striding RQ net/mlx5e: Don't wait for SQ completions on close net/mlx5e: Don't post fragmented MPWQE when RQ is disabled net/mlx5e: Don't wait for RQ completions on close net/mlx5e: Limit UMR length to the device's limitation rhashtable: fix a memory leak in alloc_bucket_locks() sfc: fix potential stack corruption from running past stat bitmask team: loadbalance: push lacpdus to exact delivery net: hns: dereference ppe_cb->ppe_common_cb if it is non-null 8139cp: Fix one possible deadloop in cp_rx_poll i40e: Change some init flow for the client Revert "phy: IRQ cannot be shared" net: dsa: bcm_sf2: Fix race condition while unmasking interrupts ...
2 parents cf4d377 + b99b43b commit 1f6a563

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+813
-453
lines changed

Documentation/networking/dsa/dsa.txt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -587,26 +587,6 @@ of DSA, would be the its port-based VLAN, used by the associated bridge device.
587587
TODO
588588
====
589589

590-
The platform device problem
591-
---------------------------
592-
DSA is currently implemented as a platform device driver which is far from ideal
593-
as was discussed in this thread:
594-
595-
http://permalink.gmane.org/gmane.linux.network/329848
596-
597-
This basically prevents the device driver model to be properly used and applied,
598-
and support non-MDIO, non-MMIO Ethernet connected switches.
599-
600-
Another problem with the platform device driver approach is that it prevents the
601-
use of a modular switch drivers build due to a circular dependency, illustrated
602-
here:
603-
604-
http://comments.gmane.org/gmane.linux.network/345803
605-
606-
Attempts of reworking this has been done here:
607-
608-
https://lwn.net/Articles/643149/
609-
610590
Making SWITCHDEV and DSA converge towards an unified codebase
611591
-------------------------------------------------------------
612592

arch/arm/mach-pxa/idp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ static struct resource smc91x_resources[] = {
8383
};
8484

8585
static struct smc91x_platdata smc91x_platdata = {
86-
.flags = SMC91X_USE_32BIT | SMC91X_USE_DMA | SMC91X_NOWAIT,
86+
.flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
87+
SMC91X_USE_DMA | SMC91X_NOWAIT,
8788
};
8889

8990
static struct platform_device smc91x_device = {

arch/arm/mach-pxa/xcep.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ static struct resource smc91x_resources[] = {
120120
};
121121

122122
static struct smc91x_platdata xcep_smc91x_info = {
123-
.flags = SMC91X_USE_32BIT | SMC91X_NOWAIT | SMC91X_USE_DMA,
123+
.flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
124+
SMC91X_NOWAIT | SMC91X_USE_DMA,
124125
};
125126

126127
static struct platform_device smc91x_device = {

arch/arm/mach-realview/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ static struct smsc911x_platform_config smsc911x_config = {
9393
};
9494

9595
static struct smc91x_platdata smc91x_platdata = {
96-
.flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
96+
.flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
97+
SMC91X_NOWAIT,
9798
};
9899

99100
static struct platform_device realview_eth_device = {

arch/arm/mach-sa1100/pleb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static struct resource smc91x_resources[] = {
4545
};
4646

4747
static struct smc91x_platdata smc91x_platdata = {
48-
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
48+
.flags = SMC91X_USE_16BIT | SMC91X_USE_8BIT | SMC91X_NOWAIT,
4949
};
5050

5151
static struct platform_device smc91x_device = {

arch/blackfin/mach-bf561/boards/cm_bf561.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ static struct platform_device hitachi_fb_device = {
146146
#include <linux/smc91x.h>
147147

148148
static struct smc91x_platdata smc91x_info = {
149-
.flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
149+
.flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
150+
SMC91X_NOWAIT,
150151
.leda = RPC_LED_100_10,
151152
.ledb = RPC_LED_TX_RX,
152153
};

arch/blackfin/mach-bf561/boards/ezkit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ static struct platform_device net2272_bfin_device = {
134134
#include <linux/smc91x.h>
135135

136136
static struct smc91x_platdata smc91x_info = {
137-
.flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
137+
.flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
138+
SMC91X_NOWAIT,
138139
.leda = RPC_LED_100_10,
139140
.ledb = RPC_LED_TX_RX,
140141
};

drivers/net/dsa/bcm_sf2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ static inline void name##_writeq(struct bcm_sf2_priv *priv, u64 val, \
205205
static inline void intrl2_##which##_mask_clear(struct bcm_sf2_priv *priv, \
206206
u32 mask) \
207207
{ \
208-
intrl2_##which##_writel(priv, mask, INTRL2_CPU_MASK_CLEAR); \
209208
priv->irq##which##_mask &= ~(mask); \
209+
intrl2_##which##_writel(priv, mask, INTRL2_CPU_MASK_CLEAR); \
210210
} \
211211
static inline void intrl2_##which##_mask_set(struct bcm_sf2_priv *priv, \
212212
u32 mask) \

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,15 +2656,19 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
26562656
return ret;
26572657
}
26582658

2659+
/* Rate Control: disable ingress rate limiting. */
26592660
if (mv88e6xxx_6352_family(chip) || mv88e6xxx_6351_family(chip) ||
26602661
mv88e6xxx_6165_family(chip) || mv88e6xxx_6097_family(chip) ||
2661-
mv88e6xxx_6185_family(chip) || mv88e6xxx_6095_family(chip) ||
26622662
mv88e6xxx_6320_family(chip)) {
2663-
/* Rate Control: disable ingress rate limiting. */
26642663
ret = _mv88e6xxx_reg_write(chip, REG_PORT(port),
26652664
PORT_RATE_CONTROL, 0x0001);
26662665
if (ret)
26672666
return ret;
2667+
} else if (mv88e6xxx_6185_family(chip) || mv88e6xxx_6095_family(chip)) {
2668+
ret = _mv88e6xxx_reg_write(chip, REG_PORT(port),
2669+
PORT_RATE_CONTROL, 0x0000);
2670+
if (ret)
2671+
return ret;
26682672
}
26692673

26702674
/* Port Control 1: disable trunking, disable sending

drivers/net/ethernet/atheros/alx/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,8 @@ static const struct pci_device_id alx_pci_tbl[] = {
15451545
.driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
15461546
{ PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_E2400),
15471547
.driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
1548+
{ PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_E2500),
1549+
.driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
15481550
{ PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_AR8162),
15491551
.driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
15501552
{ PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_AR8171) },

drivers/net/ethernet/atheros/alx/reg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#define ALX_DEV_ID_AR8161 0x1091
3939
#define ALX_DEV_ID_E2200 0xe091
4040
#define ALX_DEV_ID_E2400 0xe0a1
41+
#define ALX_DEV_ID_E2500 0xe0b1
4142
#define ALX_DEV_ID_AR8162 0x1090
4243
#define ALX_DEV_ID_AR8171 0x10A1
4344
#define ALX_DEV_ID_AR8172 0x10A0

drivers/net/ethernet/broadcom/bgmac-bcma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static int bgmac_probe(struct bcma_device *core)
159159

160160
if (!bgmac_is_bcm4707_family(core)) {
161161
mii_bus = bcma_mdio_mii_register(core, bgmac->phyaddr);
162-
if (!IS_ERR(mii_bus)) {
162+
if (IS_ERR(mii_bus)) {
163163
err = PTR_ERR(mii_bus);
164164
goto err;
165165
}

drivers/net/ethernet/cavium/thunder/nic_reg.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@
170170
#define NIC_QSET_SQ_0_7_DOOR (0x010838)
171171
#define NIC_QSET_SQ_0_7_STATUS (0x010840)
172172
#define NIC_QSET_SQ_0_7_DEBUG (0x010848)
173-
#define NIC_QSET_SQ_0_7_CNM_CHG (0x010860)
174173
#define NIC_QSET_SQ_0_7_STAT_0_1 (0x010900)
175174

176175
#define NIC_QSET_RBDR_0_1_CFG (0x010C00)

drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ static void nicvf_get_regs(struct net_device *dev,
382382
p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_DOOR, q);
383383
p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_STATUS, q);
384384
p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_DEBUG, q);
385-
p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_CNM_CHG, q);
385+
/* Padding, was NIC_QSET_SQ_0_7_CNM_CHG, which
386+
* produces bus errors when read
387+
*/
388+
p[i++] = 0;
386389
p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_STAT_0_1, q);
387390
reg_offset = NIC_QSET_SQ_0_7_STAT_0_1 | (1 << 3);
388391
p[i++] = nicvf_queue_reg_read(nic, reg_offset, q);

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4335,6 +4335,11 @@ static void cfg_queues(struct adapter *adap)
43354335
#endif
43364336
int ciq_size;
43374337

4338+
/* Reduce memory usage in kdump environment, disable all offload.
4339+
*/
4340+
if (is_kdump_kernel())
4341+
adap->params.offload = 0;
4342+
43384343
for_each_port(adap, i)
43394344
n10g += is_x_10g_port(&adap2pinfo(adap, i)->link_cfg);
43404345
#ifdef CONFIG_CHELSIO_T4_DCB
@@ -4365,11 +4370,6 @@ static void cfg_queues(struct adapter *adap)
43654370
if (q10g > netif_get_num_default_rss_queues())
43664371
q10g = netif_get_num_default_rss_queues();
43674372

4368-
/* Reduce memory usage in kdump environment, disable all offload.
4369-
*/
4370-
if (is_kdump_kernel())
4371-
adap->params.offload = 0;
4372-
43734373
for_each_port(adap, i) {
43744374
struct port_info *pi = adap2pinfo(adap, i);
43754375

drivers/net/ethernet/freescale/gianfar.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2922,17 +2922,25 @@ static bool gfar_add_rx_frag(struct gfar_rx_buff *rxb, u32 lstatus,
29222922
{
29232923
unsigned int size = lstatus & BD_LENGTH_MASK;
29242924
struct page *page = rxb->page;
2925+
bool last = !!(lstatus & BD_LFLAG(RXBD_LAST));
29252926

29262927
/* Remove the FCS from the packet length */
2927-
if (likely(lstatus & BD_LFLAG(RXBD_LAST)))
2928+
if (last)
29282929
size -= ETH_FCS_LEN;
29292930

2930-
if (likely(first))
2931+
if (likely(first)) {
29312932
skb_put(skb, size);
2932-
else
2933-
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
2934-
rxb->page_offset + RXBUF_ALIGNMENT,
2935-
size, GFAR_RXB_TRUESIZE);
2933+
} else {
2934+
/* the last fragments' length contains the full frame length */
2935+
if (last)
2936+
size -= skb->len;
2937+
2938+
/* in case the last fragment consisted only of the FCS */
2939+
if (size > 0)
2940+
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
2941+
rxb->page_offset + RXBUF_ALIGNMENT,
2942+
size, GFAR_RXB_TRUESIZE);
2943+
}
29362944

29372945
/* try reuse page */
29382946
if (unlikely(page_count(page) != 1))

drivers/net/ethernet/freescale/gianfar.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ extern const char gfar_driver_version[];
100100
#define DEFAULT_RX_LFC_THR 16
101101
#define DEFAULT_LFC_PTVVAL 4
102102

103-
#define GFAR_RXB_SIZE 1536
103+
/* prevent fragmenation by HW in DSA environments */
104+
#define GFAR_RXB_SIZE roundup(1536 + 8, 64)
104105
#define GFAR_SKBFRAG_SIZE (RXBUF_ALIGNMENT + GFAR_RXB_SIZE \
105106
+ SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
106107
#define GFAR_RXB_TRUESIZE 2048

drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,10 @@ static void hns_ppe_init_hw(struct hns_ppe_cb *ppe_cb)
328328
static void hns_ppe_uninit_hw(struct hns_ppe_cb *ppe_cb)
329329
{
330330
u32 port;
331-
struct dsaf_device *dsaf_dev = ppe_cb->ppe_common_cb->dsaf_dev;
332331

333332
if (ppe_cb->ppe_common_cb) {
333+
struct dsaf_device *dsaf_dev = ppe_cb->ppe_common_cb->dsaf_dev;
334+
334335
port = ppe_cb->index;
335336
dsaf_dev->misc_op->ppe_srst(dsaf_dev, port, 0);
336337
}

drivers/net/ethernet/intel/i40e/i40e_client.c

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi)
199199
void i40e_notify_client_of_netdev_open(struct i40e_vsi *vsi)
200200
{
201201
struct i40e_client_instance *cdev;
202+
int ret = 0;
202203

203204
if (!vsi)
204205
return;
@@ -211,7 +212,14 @@ void i40e_notify_client_of_netdev_open(struct i40e_vsi *vsi)
211212
"Cannot locate client instance open routine\n");
212213
continue;
213214
}
214-
cdev->client->ops->open(&cdev->lan_info, cdev->client);
215+
if (!(test_bit(__I40E_CLIENT_INSTANCE_OPENED,
216+
&cdev->state))) {
217+
ret = cdev->client->ops->open(&cdev->lan_info,
218+
cdev->client);
219+
if (!ret)
220+
set_bit(__I40E_CLIENT_INSTANCE_OPENED,
221+
&cdev->state);
222+
}
215223
}
216224
}
217225
mutex_unlock(&i40e_client_instance_mutex);
@@ -407,12 +415,14 @@ struct i40e_vsi *i40e_vsi_lookup(struct i40e_pf *pf,
407415
* i40e_client_add_instance - add a client instance struct to the instance list
408416
* @pf: pointer to the board struct
409417
* @client: pointer to a client struct in the client list.
418+
* @existing: if there was already an existing instance
410419
*
411-
* Returns cdev ptr on success, NULL on failure
420+
* Returns cdev ptr on success or if already exists, NULL on failure
412421
**/
413422
static
414423
struct i40e_client_instance *i40e_client_add_instance(struct i40e_pf *pf,
415-
struct i40e_client *client)
424+
struct i40e_client *client,
425+
bool *existing)
416426
{
417427
struct i40e_client_instance *cdev;
418428
struct netdev_hw_addr *mac = NULL;
@@ -421,7 +431,7 @@ struct i40e_client_instance *i40e_client_add_instance(struct i40e_pf *pf,
421431
mutex_lock(&i40e_client_instance_mutex);
422432
list_for_each_entry(cdev, &i40e_client_instances, list) {
423433
if ((cdev->lan_info.pf == pf) && (cdev->client == client)) {
424-
cdev = NULL;
434+
*existing = true;
425435
goto out;
426436
}
427437
}
@@ -505,6 +515,7 @@ void i40e_client_subtask(struct i40e_pf *pf)
505515
{
506516
struct i40e_client_instance *cdev;
507517
struct i40e_client *client;
518+
bool existing = false;
508519
int ret = 0;
509520

510521
if (!(pf->flags & I40E_FLAG_SERVICE_CLIENT_REQUESTED))
@@ -528,18 +539,25 @@ void i40e_client_subtask(struct i40e_pf *pf)
528539
/* check if L2 VSI is up, if not we are not ready */
529540
if (test_bit(__I40E_DOWN, &pf->vsi[pf->lan_vsi]->state))
530541
continue;
542+
} else {
543+
dev_warn(&pf->pdev->dev, "This client %s is being instanciated at probe\n",
544+
client->name);
531545
}
532546

533547
/* Add the client instance to the instance list */
534-
cdev = i40e_client_add_instance(pf, client);
548+
cdev = i40e_client_add_instance(pf, client, &existing);
535549
if (!cdev)
536550
continue;
537551

538-
/* Also up the ref_cnt of no. of instances of this client */
539-
atomic_inc(&client->ref_cnt);
540-
dev_info(&pf->pdev->dev, "Added instance of Client %s to PF%d bus=0x%02x func=0x%02x\n",
541-
client->name, pf->hw.pf_id,
542-
pf->hw.bus.device, pf->hw.bus.func);
552+
if (!existing) {
553+
/* Also up the ref_cnt for no. of instances of this
554+
* client.
555+
*/
556+
atomic_inc(&client->ref_cnt);
557+
dev_info(&pf->pdev->dev, "Added instance of Client %s to PF%d bus=0x%02x func=0x%02x\n",
558+
client->name, pf->hw.pf_id,
559+
pf->hw.bus.device, pf->hw.bus.func);
560+
}
543561

544562
/* Send an Open request to the client */
545563
atomic_inc(&cdev->ref_cnt);
@@ -588,7 +606,8 @@ int i40e_lan_add_device(struct i40e_pf *pf)
588606
pf->hw.pf_id, pf->hw.bus.device, pf->hw.bus.func);
589607

590608
/* Since in some cases register may have happened before a device gets
591-
* added, we can schedule a subtask to go initiate the clients.
609+
* added, we can schedule a subtask to go initiate the clients if
610+
* they can be launched at probe time.
592611
*/
593612
pf->flags |= I40E_FLAG_SERVICE_CLIENT_REQUESTED;
594613
i40e_service_event_schedule(pf);

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5431,7 +5431,6 @@ int i40e_open(struct net_device *netdev)
54315431
wr32(&pf->hw, I40E_GLLAN_TSOMSK_L, be32_to_cpu(TCP_FLAG_CWR) >> 16);
54325432

54335433
udp_tunnel_get_rx_info(netdev);
5434-
i40e_notify_client_of_netdev_open(vsi);
54355434

54365435
return 0;
54375436
}

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2958,8 +2958,10 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
29582958
}
29592959

29602960
/* was that the last pool using this rar? */
2961-
if (mpsar_lo == 0 && mpsar_hi == 0 && rar != 0)
2961+
if (mpsar_lo == 0 && mpsar_hi == 0 &&
2962+
rar != 0 && rar != hw->mac.san_mac_rar_index)
29622963
hw->mac.ops.clear_rar(hw, rar);
2964+
29632965
return 0;
29642966
}
29652967

0 commit comments

Comments
 (0)