Skip to content

Commit 4d8a991

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Need to access netdev->num_rx_queues behind an accessor in netvsc driver otherwise the build breaks with some configs, from Arnd Bergmann. 2) Add dummy xfrm_dev_event() so that build doesn't fail when CONFIG_XFRM_OFFLOAD is not set. From Hangbin Liu. 3) Don't OOPS when pfkey_msg2xfrm_state() signals an erros, from Dan Carpenter. 4) Fix MCDI command size for filter operations in sfc driver, from Martin Habets. 5) Fix UFO segmenting so that we don't calculate incorrect checksums, from Michal Kubecek. 6) When ipv6 datagram connects fail, reset destination address and port. From Wei Wang. 7) TCP disconnect must reset the cached receive DST, from WANG Cong. 8) Fix sign extension bug on 32-bit in dev_get_stats(), from Eric Dumazet. 9) fman driver has to depend on HAS_DMA, from Madalin Bucur. 10) Fix bpf pointer leak with xadd in verifier, from Daniel Borkmann. 11) Fix negative page counts with GFO, from Michal Kubecek. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (41 commits) sfc: fix attempt to translate invalid filter ID net: handle NAPI_GRO_FREE_STOLEN_HEAD case also in napi_frags_finish() bpf: prevent leaking pointer via xadd on unpriviledged arcnet: com20020-pci: add missing pdev setup in netdev structure arcnet: com20020-pci: fix dev_id calculation arcnet: com20020: remove needless base_addr assignment Trivial fix to spelling mistake in arc_printk message arcnet: change irq handler to lock irqsave rocker: move dereference before free mlxsw: spectrum_router: Fix NULL pointer dereference net: sched: Fix one possible panic when no destroy callback virtio-net: serialize tx routine during reset net: usb: asix88179_178a: Add support for the Belkin B2B128 fsl/fman: add dependency on HAS_DMA net: prevent sign extension in dev_get_stats() tcp: reset sk_rx_dst in tcp_disconnect() net: ipv6: reset daddr and dport in sk if connect() fails bnx2x: Don't log mc removal needlessly bnxt_en: Fix netpoll handling. bnxt_en: Add missing logic to handle TPA end error conditions. ...
2 parents 27bc344 + d58299a commit 4d8a991

Some content is hidden

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

42 files changed

+350
-84
lines changed

drivers/net/arcnet/arcnet.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
756756
struct net_device *dev = dev_id;
757757
struct arcnet_local *lp;
758758
int recbuf, status, diagstatus, didsomething, boguscount;
759+
unsigned long flags;
759760
int retval = IRQ_NONE;
760761

761762
arc_printk(D_DURING, dev, "\n");
@@ -765,7 +766,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
765766
lp = netdev_priv(dev);
766767
BUG_ON(!lp);
767768

768-
spin_lock(&lp->lock);
769+
spin_lock_irqsave(&lp->lock, flags);
769770

770771
/* RESET flag was enabled - if device is not running, we must
771772
* clear it right away (but nothing else).
@@ -774,7 +775,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
774775
if (lp->hw.status(dev) & RESETflag)
775776
lp->hw.command(dev, CFLAGScmd | RESETclear);
776777
lp->hw.intmask(dev, 0);
777-
spin_unlock(&lp->lock);
778+
spin_unlock_irqrestore(&lp->lock, flags);
778779
return retval;
779780
}
780781

@@ -998,7 +999,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
998999
udelay(1);
9991000
lp->hw.intmask(dev, lp->intmask);
10001001

1001-
spin_unlock(&lp->lock);
1002+
spin_unlock_irqrestore(&lp->lock, flags);
10021003
return retval;
10031004
}
10041005
EXPORT_SYMBOL(arcnet_interrupt);

drivers/net/arcnet/capmode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static int ack_tx(struct net_device *dev, int acked)
212212
ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */
213213
ackpkt->soft.cap.mes.ack = acked;
214214

215-
arc_printk(D_PROTO, dev, "Ackknowledge for cap packet %x.\n",
215+
arc_printk(D_PROTO, dev, "Acknowledge for cap packet %x.\n",
216216
*((int *)&ackpkt->soft.cap.cookie[0]));
217217

218218
ackskb->protocol = cpu_to_be16(ETH_P_ARCNET);

drivers/net/arcnet/com20020-pci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ static int com20020pci_probe(struct pci_dev *pdev,
135135
for (i = 0; i < ci->devcount; i++) {
136136
struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i];
137137
struct com20020_dev *card;
138+
int dev_id_mask = 0xf;
138139

139140
dev = alloc_arcdev(device);
140141
if (!dev) {
@@ -166,6 +167,7 @@ static int com20020pci_probe(struct pci_dev *pdev,
166167
arcnet_outb(0x00, ioaddr, COM20020_REG_W_COMMAND);
167168
arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT);
168169

170+
SET_NETDEV_DEV(dev, &pdev->dev);
169171
dev->base_addr = ioaddr;
170172
dev->dev_addr[0] = node;
171173
dev->irq = pdev->irq;
@@ -179,8 +181,8 @@ static int com20020pci_probe(struct pci_dev *pdev,
179181

180182
/* Get the dev_id from the PLX rotary coder */
181183
if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15))
182-
dev->dev_id = 0xc;
183-
dev->dev_id ^= inb(priv->misc + ci->rotary) >> 4;
184+
dev_id_mask = 0x3;
185+
dev->dev_id = (inb(priv->misc + ci->rotary) >> 4) & dev_id_mask;
184186

185187
snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);
186188

drivers/net/arcnet/com20020.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ int com20020_found(struct net_device *dev, int shared)
246246
return -ENODEV;
247247
}
248248

249-
dev->base_addr = ioaddr;
250-
251249
arc_printk(D_NORMAL, dev, "%s: station %02Xh found at %03lXh, IRQ %d.\n",
252250
lp->card_name, dev->dev_addr[0], dev->base_addr, dev->irq);
253251

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12729,7 +12729,7 @@ static int bnx2x_set_mc_list(struct bnx2x *bp)
1272912729
} else {
1273012730
/* If no mc addresses are required, flush the configuration */
1273112731
rc = bnx2x_config_mcast(bp, &rparam, BNX2X_MCAST_CMD_DEL);
12732-
if (rc)
12732+
if (rc < 0)
1273312733
BNX2X_ERR("Failed to clear multicast configuration %d\n",
1273412734
rc);
1273512735
}

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,10 +1301,11 @@ static inline struct sk_buff *bnxt_tpa_end(struct bnxt *bp,
13011301
cp_cons = NEXT_CMP(cp_cons);
13021302
}
13031303

1304-
if (unlikely(agg_bufs > MAX_SKB_FRAGS)) {
1304+
if (unlikely(agg_bufs > MAX_SKB_FRAGS || TPA_END_ERRORS(tpa_end1))) {
13051305
bnxt_abort_tpa(bp, bnapi, cp_cons, agg_bufs);
1306-
netdev_warn(bp->dev, "TPA frags %d exceeded MAX_SKB_FRAGS %d\n",
1307-
agg_bufs, (int)MAX_SKB_FRAGS);
1306+
if (agg_bufs > MAX_SKB_FRAGS)
1307+
netdev_warn(bp->dev, "TPA frags %d exceeded MAX_SKB_FRAGS %d\n",
1308+
agg_bufs, (int)MAX_SKB_FRAGS);
13081309
return NULL;
13091310
}
13101311

@@ -1562,6 +1563,45 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_napi *bnapi, u32 *raw_cons,
15621563
return rc;
15631564
}
15641565

1566+
/* In netpoll mode, if we are using a combined completion ring, we need to
1567+
* discard the rx packets and recycle the buffers.
1568+
*/
1569+
static int bnxt_force_rx_discard(struct bnxt *bp, struct bnxt_napi *bnapi,
1570+
u32 *raw_cons, u8 *event)
1571+
{
1572+
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
1573+
u32 tmp_raw_cons = *raw_cons;
1574+
struct rx_cmp_ext *rxcmp1;
1575+
struct rx_cmp *rxcmp;
1576+
u16 cp_cons;
1577+
u8 cmp_type;
1578+
1579+
cp_cons = RING_CMP(tmp_raw_cons);
1580+
rxcmp = (struct rx_cmp *)
1581+
&cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
1582+
1583+
tmp_raw_cons = NEXT_RAW_CMP(tmp_raw_cons);
1584+
cp_cons = RING_CMP(tmp_raw_cons);
1585+
rxcmp1 = (struct rx_cmp_ext *)
1586+
&cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
1587+
1588+
if (!RX_CMP_VALID(rxcmp1, tmp_raw_cons))
1589+
return -EBUSY;
1590+
1591+
cmp_type = RX_CMP_TYPE(rxcmp);
1592+
if (cmp_type == CMP_TYPE_RX_L2_CMP) {
1593+
rxcmp1->rx_cmp_cfa_code_errors_v2 |=
1594+
cpu_to_le32(RX_CMPL_ERRORS_CRC_ERROR);
1595+
} else if (cmp_type == CMP_TYPE_RX_L2_TPA_END_CMP) {
1596+
struct rx_tpa_end_cmp_ext *tpa_end1;
1597+
1598+
tpa_end1 = (struct rx_tpa_end_cmp_ext *)rxcmp1;
1599+
tpa_end1->rx_tpa_end_cmp_errors_v2 |=
1600+
cpu_to_le32(RX_TPA_END_CMP_ERRORS);
1601+
}
1602+
return bnxt_rx_pkt(bp, bnapi, raw_cons, event);
1603+
}
1604+
15651605
#define BNXT_GET_EVENT_PORT(data) \
15661606
((data) & \
15671607
ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK)
@@ -1744,7 +1784,11 @@ static int bnxt_poll_work(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
17441784
if (unlikely(tx_pkts > bp->tx_wake_thresh))
17451785
rx_pkts = budget;
17461786
} else if ((TX_CMP_TYPE(txcmp) & 0x30) == 0x10) {
1747-
rc = bnxt_rx_pkt(bp, bnapi, &raw_cons, &event);
1787+
if (likely(budget))
1788+
rc = bnxt_rx_pkt(bp, bnapi, &raw_cons, &event);
1789+
else
1790+
rc = bnxt_force_rx_discard(bp, bnapi, &raw_cons,
1791+
&event);
17481792
if (likely(rc >= 0))
17491793
rx_pkts += rc;
17501794
else if (rc == -EBUSY) /* partial completion */
@@ -6663,12 +6707,11 @@ static void bnxt_poll_controller(struct net_device *dev)
66636707
struct bnxt *bp = netdev_priv(dev);
66646708
int i;
66656709

6666-
for (i = 0; i < bp->cp_nr_rings; i++) {
6667-
struct bnxt_irq *irq = &bp->irq_tbl[i];
6710+
/* Only process tx rings/combined rings in netpoll mode. */
6711+
for (i = 0; i < bp->tx_nr_rings; i++) {
6712+
struct bnxt_tx_ring_info *txr = &bp->tx_ring[i];
66686713

6669-
disable_irq(irq->vector);
6670-
irq->handler(irq->vector, bp->bnapi[i]);
6671-
enable_irq(irq->vector);
6714+
napi_schedule(&txr->bnapi->napi);
66726715
}
66736716
}
66746717
#endif

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,16 @@ struct rx_tpa_end_cmp_ext {
374374

375375
__le32 rx_tpa_end_cmp_errors_v2;
376376
#define RX_TPA_END_CMP_V2 (0x1 << 0)
377-
#define RX_TPA_END_CMP_ERRORS (0x7fff << 1)
377+
#define RX_TPA_END_CMP_ERRORS (0x3 << 1)
378378
#define RX_TPA_END_CMPL_ERRORS_SHIFT 1
379379

380380
u32 rx_tpa_end_cmp_start_opaque;
381381
};
382382

383+
#define TPA_END_ERRORS(rx_tpa_end_ext) \
384+
((rx_tpa_end_ext)->rx_tpa_end_cmp_errors_v2 & \
385+
cpu_to_le32(RX_TPA_END_CMP_ERRORS))
386+
383387
#define DB_IDX_MASK 0xffffff
384388
#define DB_IDX_VALID (0x1 << 26)
385389
#define DB_IRQ_DIS (0x1 << 27)

drivers/net/ethernet/freescale/fman/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ config FSL_FMAN
22
tristate "FMan support"
33
depends on FSL_SOC || ARCH_LAYERSCAPE || COMPILE_TEST
44
select GENERIC_ALLOCATOR
5+
depends on HAS_DMA
56
select PHYLIB
67
default n
78
help

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,6 +3334,9 @@ static int mlxsw_sp_inetaddr_vlan_event(struct net_device *vlan_dev,
33343334
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(vlan_dev);
33353335
u16 vid = vlan_dev_vlan_id(vlan_dev);
33363336

3337+
if (netif_is_bridge_port(vlan_dev))
3338+
return 0;
3339+
33373340
if (mlxsw_sp_port_dev_check(real_dev))
33383341
return mlxsw_sp_inetaddr_vport_event(vlan_dev, real_dev, event,
33393342
vid);

drivers/net/ethernet/rocker/rocker_ofdpa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,8 +1505,8 @@ static int ofdpa_port_ipv4_nh(struct ofdpa_port *ofdpa_port,
15051505
*index = entry->index;
15061506
resolved = false;
15071507
} else if (removing) {
1508-
ofdpa_neigh_del(trans, found);
15091508
*index = found->index;
1509+
ofdpa_neigh_del(trans, found);
15101510
} else if (updating) {
15111511
ofdpa_neigh_update(found, trans, NULL, false);
15121512
resolved = !is_zero_ether_addr(found->eth_dst);

drivers/net/ethernet/sfc/ef10.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4172,7 +4172,7 @@ static s32 efx_ef10_filter_insert(struct efx_nic *efx,
41724172
* recipients
41734173
*/
41744174
if (is_mc_recip) {
4175-
MCDI_DECLARE_BUF(inbuf, MC_CMD_FILTER_OP_IN_LEN);
4175+
MCDI_DECLARE_BUF(inbuf, MC_CMD_FILTER_OP_EXT_IN_LEN);
41764176
unsigned int depth, i;
41774177

41784178
memset(inbuf, 0, sizeof(inbuf));
@@ -4320,7 +4320,7 @@ static int efx_ef10_filter_remove_internal(struct efx_nic *efx,
43204320
efx_ef10_filter_set_entry(table, filter_idx, NULL, 0);
43214321
} else {
43224322
efx_mcdi_display_error(efx, MC_CMD_FILTER_OP,
4323-
MC_CMD_FILTER_OP_IN_LEN,
4323+
MC_CMD_FILTER_OP_EXT_IN_LEN,
43244324
NULL, 0, rc);
43254325
}
43264326
}
@@ -4453,7 +4453,7 @@ static s32 efx_ef10_filter_rfs_insert(struct efx_nic *efx,
44534453
struct efx_filter_spec *spec)
44544454
{
44554455
struct efx_ef10_filter_table *table = efx->filter_state;
4456-
MCDI_DECLARE_BUF(inbuf, MC_CMD_FILTER_OP_IN_LEN);
4456+
MCDI_DECLARE_BUF(inbuf, MC_CMD_FILTER_OP_EXT_IN_LEN);
44574457
struct efx_filter_spec *saved_spec;
44584458
unsigned int hash, i, depth = 1;
44594459
bool replacing = false;
@@ -4940,7 +4940,7 @@ static void efx_ef10_filter_table_restore(struct efx_nic *efx)
49404940
static void efx_ef10_filter_table_remove(struct efx_nic *efx)
49414941
{
49424942
struct efx_ef10_filter_table *table = efx->filter_state;
4943-
MCDI_DECLARE_BUF(inbuf, MC_CMD_FILTER_OP_IN_LEN);
4943+
MCDI_DECLARE_BUF(inbuf, MC_CMD_FILTER_OP_EXT_IN_LEN);
49444944
struct efx_filter_spec *spec;
49454945
unsigned int filter_idx;
49464946
int rc;
@@ -5105,6 +5105,7 @@ static int efx_ef10_filter_insert_addr_list(struct efx_nic *efx,
51055105

51065106
/* Insert/renew filters */
51075107
for (i = 0; i < addr_count; i++) {
5108+
EFX_WARN_ON_PARANOID(ids[i] != EFX_EF10_FILTER_ID_INVALID);
51085109
efx_filter_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, 0);
51095110
efx_filter_set_eth_local(&spec, vlan->vid, addr_list[i].addr);
51105111
rc = efx_ef10_filter_insert(efx, &spec, true);
@@ -5122,11 +5123,11 @@ static int efx_ef10_filter_insert_addr_list(struct efx_nic *efx,
51225123
}
51235124
return rc;
51245125
} else {
5125-
/* mark as not inserted, and carry on */
5126-
rc = EFX_EF10_FILTER_ID_INVALID;
5126+
/* keep invalid ID, and carry on */
51275127
}
5128+
} else {
5129+
ids[i] = efx_ef10_filter_get_unsafe_id(rc);
51285130
}
5129-
ids[i] = efx_ef10_filter_get_unsafe_id(rc);
51305131
}
51315132

51325133
if (multicast && rollback) {

drivers/net/ethernet/ti/cpsw-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int ti_cm_get_macid(struct device *dev, int slave, u8 *mac_addr)
9090
if (of_device_is_compatible(dev->of_node, "ti,dm816-emac"))
9191
return cpsw_am33xx_cm_get_macid(dev, 0x30, slave, mac_addr);
9292

93-
if (of_machine_is_compatible("ti,am4372"))
93+
if (of_machine_is_compatible("ti,am43"))
9494
return cpsw_am33xx_cm_get_macid(dev, 0x630, slave, mac_addr);
9595

9696
if (of_machine_is_compatible("ti,dra7"))

drivers/net/hyperv/netvsc_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ static int netvsc_set_channels(struct net_device *net,
776776
channels->rx_count || channels->tx_count || channels->other_count)
777777
return -EINVAL;
778778

779-
if (count > net->num_tx_queues || count > net->num_rx_queues)
779+
if (count > net->num_tx_queues || count > VRSS_CHANNEL_MAX)
780780
return -EINVAL;
781781

782782
if (!nvdev || nvdev->destroy)
@@ -1203,7 +1203,7 @@ static int netvsc_set_rxfh(struct net_device *dev, const u32 *indir,
12031203
rndis_dev = ndev->extension;
12041204
if (indir) {
12051205
for (i = 0; i < ITAB_NUM; i++)
1206-
if (indir[i] >= dev->num_rx_queues)
1206+
if (indir[i] >= VRSS_CHANNEL_MAX)
12071207
return -EINVAL;
12081208

12091209
for (i = 0; i < ITAB_NUM; i++)

0 commit comments

Comments
 (0)