Skip to content

Commit 1099f86

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Account for extra headroom in ath9k driver, from Felix Fietkau. 2) Fix OOPS in pppoe driver due to incorrect socket state transition, from Guillaume Nault. 3) Kill memory leak in amd-xgbe debugfx, from Geliang Tang. 4) Power management fixes for iwlwifi, from Johannes Berg. 5) Fix races in reqsk_queue_unlink(), from Eric Dumazet. 6) Fix dst_entry usage in ARP replies, from Jiri Benc. 7) Cure OOPSes with SO_GET_FILTER, from Daniel Borkmann. 8) Missing allocation failure check in amd-xgbe, from Tom Lendacky. 9) Various resource allocation/freeing cures in DSA< from Neil Armstrong. 10) A series of bug fixes in the openvswitch conntrack support, from Joe Stringer. 11) Fix two cases (BPF and act_mirred) where we have to clean the sender cpu stored in the SKB before transmitting. From WANG Cong and Alexei Starovoitov. 12) Disable VLAN filtering in promiscuous mode in mlx5 driver, from Achiad Shochat. 13) Older bnx2x chips cannot do 4-tuple UDP hashing, so prevent this configuration via ethtool. From Yuval Mintz. 14) Don't call rt6_uncached_list_flush_dev() from rt6_ifdown() when 'dev' is NULL, from Eric Biederman. 15) Prevent stalled link synchronization in tipc, from Jon Paul Maloy. 16) kcalloc() gstrings ethtool buffer before having driver fill it in, in order to prevent kernel memory leaking. From Joe Perches. 17) Fix mixxing rt6_info initialization for blackhole routes, from Martin KaFai Lau. 18) Kill VLAN regression in via-rhine, from Andrej Ota. 19) Missing pfmemalloc check in sk_add_backlog(), from Eric Dumazet. 20) Fix spurious MSG_TRUNC signalling in netlink dumps, from Ronen Arad. 21) Scrube SKBs when pushing them between namespaces in openvswitch, from Joe Stringer. 22) bcmgenet enables link interrupts too early, fix from Florian Fainelli. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (92 commits) net: bcmgenet: Fix early link interrupt enabling tunnels: Don't require remote endpoint or ID during creation. openvswitch: Scrub skb between namespaces xen-netback: correctly check failed allocation net: asix: add support for the Billionton GUSB2AM-1G-B USB adapter netlink: Trim skb to alloc size to avoid MSG_TRUNC net: add pfmemalloc check in sk_add_backlog() via-rhine: fix VLAN receive handling regression. ipv6: Initialize rt6_info properly in ip6_blackhole_route() ipv6: Move common init code for rt6_info to a new function rt6_info_init() Bluetooth: Fix initializing conn_params in scan phase Bluetooth: Fix conn_params list update in hci_connect_le_scan_cleanup Bluetooth: Fix remove_device behavior for explicit connects Bluetooth: Fix LE reconnection logic Bluetooth: Fix reference counting for LE-scan based connections Bluetooth: Fix double scan updates mlxsw: core: Fix race condition in __mlxsw_emad_transmit tipc: move fragment importance field to new header position ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings tipc: eliminate risk of stalled link synchronization ...
2 parents 7379047 + 37850e3 commit 1099f86

Some content is hidden

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

83 files changed

+668
-345
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6793,7 +6793,6 @@ F: drivers/scsi/megaraid/
67936793

67946794
MELLANOX ETHERNET DRIVER (mlx4_en)
67956795
M: Amir Vadai <amirv@mellanox.com>
6796-
M: Ido Shamay <idos@mellanox.com>
67976796
L: netdev@vger.kernel.org
67986797
S: Supported
67996798
W: http://www.mellanox.com

arch/arm/net/bpf_jit_32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ static int build_body(struct jit_ctx *ctx)
614614
case BPF_LD | BPF_B | BPF_IND:
615615
load_order = 0;
616616
load_ind:
617+
update_on_xread(ctx);
617618
OP_IMM3(ARM_ADD, r_off, r_X, k, ctx);
618619
goto load_common;
619620
case BPF_LDX | BPF_IMM:

drivers/net/can/sja1000/peak_pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ static const struct pci_device_id peak_pci_tbl[] = {
8787
{PEAK_PCI_VENDOR_ID, PEAK_PC_104P_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
8888
{PEAK_PCI_VENDOR_ID, PEAK_PCI_104E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
8989
{PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
90+
{PEAK_PCI_VENDOR_ID, PEAK_PCIE_OEM_ID, PCI_ANY_ID, PCI_ANY_ID,},
9091
#ifdef CONFIG_CAN_PEAK_PCIEC
9192
{PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
9293
{PEAK_PCI_VENDOR_ID, PEAK_PCIEC34_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},

drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,13 @@ void xgbe_debugfs_init(struct xgbe_prv_data *pdata)
327327
pdata->debugfs_xpcs_reg = 0;
328328

329329
buf = kasprintf(GFP_KERNEL, "amd-xgbe-%s", pdata->netdev->name);
330+
if (!buf)
331+
return;
332+
330333
pdata->xgbe_debugfs = debugfs_create_dir(buf, NULL);
331334
if (!pdata->xgbe_debugfs) {
332335
netdev_err(pdata->netdev, "debugfs_create_dir failed\n");
336+
kfree(buf);
333337
return;
334338
}
335339

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3351,6 +3351,13 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)
33513351
udp_rss_requested = 0;
33523352
else
33533353
return -EINVAL;
3354+
3355+
if (CHIP_IS_E1x(bp) && udp_rss_requested) {
3356+
DP(BNX2X_MSG_ETHTOOL,
3357+
"57710, 57711 boards don't support RSS according to UDP 4-tuple\n");
3358+
return -EINVAL;
3359+
}
3360+
33543361
if ((info->flow_type == UDP_V4_FLOW) &&
33553362
(bp->rss_conf_obj.udp_rss_v4 != udp_rss_requested)) {
33563363
bp->rss_conf_obj.udp_rss_v4 = udp_rss_requested;

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,24 @@ static void bcmgenet_intr_disable(struct bcmgenet_priv *priv)
16831683
bcmgenet_intrl2_1_writel(priv, 0, INTRL2_CPU_MASK_CLEAR);
16841684
}
16851685

1686+
static void bcmgenet_link_intr_enable(struct bcmgenet_priv *priv)
1687+
{
1688+
u32 int0_enable = 0;
1689+
1690+
/* Monitor cable plug/unplugged event for internal PHY, external PHY
1691+
* and MoCA PHY
1692+
*/
1693+
if (priv->internal_phy) {
1694+
int0_enable |= UMAC_IRQ_LINK_EVENT;
1695+
} else if (priv->ext_phy) {
1696+
int0_enable |= UMAC_IRQ_LINK_EVENT;
1697+
} else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
1698+
if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET)
1699+
int0_enable |= UMAC_IRQ_LINK_EVENT;
1700+
}
1701+
bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR);
1702+
}
1703+
16861704
static int init_umac(struct bcmgenet_priv *priv)
16871705
{
16881706
struct device *kdev = &priv->pdev->dev;
@@ -1723,15 +1741,8 @@ static int init_umac(struct bcmgenet_priv *priv)
17231741
/* Enable Tx default queue 16 interrupts */
17241742
int0_enable |= UMAC_IRQ_TXDMA_DONE;
17251743

1726-
/* Monitor cable plug/unplugged event for internal PHY */
1727-
if (priv->internal_phy) {
1728-
int0_enable |= UMAC_IRQ_LINK_EVENT;
1729-
} else if (priv->ext_phy) {
1730-
int0_enable |= UMAC_IRQ_LINK_EVENT;
1731-
} else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
1732-
if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET)
1733-
int0_enable |= UMAC_IRQ_LINK_EVENT;
1734-
1744+
/* Configure backpressure vectors for MoCA */
1745+
if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
17351746
reg = bcmgenet_bp_mc_get(priv);
17361747
reg |= BIT(priv->hw_params->bp_in_en_shift);
17371748

@@ -2645,6 +2656,9 @@ static void bcmgenet_netif_start(struct net_device *dev)
26452656

26462657
netif_tx_start_all_queues(dev);
26472658

2659+
/* Monitor link interrupts now */
2660+
bcmgenet_link_intr_enable(priv);
2661+
26482662
phy_start(priv->phydev);
26492663
}
26502664

drivers/net/ethernet/emulex/benet/be.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ struct be_adapter {
592592
int be_get_temp_freq;
593593
struct be_hwmon hwmon_info;
594594
u8 pf_number;
595+
u8 pci_func_num;
595596
struct rss_info rss_info;
596597
/* Filters for packets that need to be sent to BMC */
597598
u32 bmc_filt_mask;

drivers/net/ethernet/emulex/benet/be_cmds.c

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,10 @@ static int be_cmd_notify_wait(struct be_adapter *adapter,
851851
return status;
852852

853853
dest_wrb = be_cmd_copy(adapter, wrb);
854-
if (!dest_wrb)
855-
return -EBUSY;
854+
if (!dest_wrb) {
855+
status = -EBUSY;
856+
goto unlock;
857+
}
856858

857859
if (use_mcc(adapter))
858860
status = be_mcc_notify_wait(adapter);
@@ -862,6 +864,7 @@ static int be_cmd_notify_wait(struct be_adapter *adapter,
862864
if (!status)
863865
memcpy(wrb, dest_wrb, sizeof(*wrb));
864866

867+
unlock:
865868
be_cmd_unlock(adapter);
866869
return status;
867870
}
@@ -1984,6 +1987,8 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
19841987
be_if_cap_flags(adapter));
19851988
}
19861989
flags &= be_if_cap_flags(adapter);
1990+
if (!flags)
1991+
return -ENOTSUPP;
19871992

19881993
return __be_cmd_rx_filter(adapter, flags, value);
19891994
}
@@ -2887,6 +2892,7 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter)
28872892
if (!status) {
28882893
attribs = attribs_cmd.va + sizeof(struct be_cmd_resp_hdr);
28892894
adapter->hba_port_num = attribs->hba_attribs.phy_port;
2895+
adapter->pci_func_num = attribs->pci_func_num;
28902896
serial_num = attribs->hba_attribs.controller_serial_number;
28912897
for (i = 0; i < CNTL_SERIAL_NUM_WORDS; i++)
28922898
adapter->serial_num[i] = le32_to_cpu(serial_num[i]) &
@@ -3709,7 +3715,6 @@ int be_cmd_get_func_config(struct be_adapter *adapter, struct be_resources *res)
37093715
status = -EINVAL;
37103716
goto err;
37113717
}
3712-
37133718
adapter->pf_number = desc->pf_num;
37143719
be_copy_nic_desc(res, desc);
37153720
}
@@ -3721,7 +3726,10 @@ int be_cmd_get_func_config(struct be_adapter *adapter, struct be_resources *res)
37213726
return status;
37223727
}
37233728

3724-
/* Will use MBOX only if MCCQ has not been created */
3729+
/* Will use MBOX only if MCCQ has not been created
3730+
* non-zero domain => a PF is querying this on behalf of a VF
3731+
* zero domain => a PF or a VF is querying this for itself
3732+
*/
37253733
int be_cmd_get_profile_config(struct be_adapter *adapter,
37263734
struct be_resources *res, u8 query, u8 domain)
37273735
{
@@ -3748,10 +3756,15 @@ int be_cmd_get_profile_config(struct be_adapter *adapter,
37483756
OPCODE_COMMON_GET_PROFILE_CONFIG,
37493757
cmd.size, &wrb, &cmd);
37503758

3751-
req->hdr.domain = domain;
37523759
if (!lancer_chip(adapter))
37533760
req->hdr.version = 1;
37543761
req->type = ACTIVE_PROFILE_TYPE;
3762+
/* When a function is querying profile information relating to
3763+
* itself hdr.pf_number must be set to it's pci_func_num + 1
3764+
*/
3765+
req->hdr.domain = domain;
3766+
if (domain == 0)
3767+
req->hdr.pf_num = adapter->pci_func_num + 1;
37553768

37563769
/* When QUERY_MODIFIABLE_FIELDS_TYPE bit is set, cmd returns the
37573770
* descriptors with all bits set to "1" for the fields which can be
@@ -3921,12 +3934,16 @@ static void be_fill_vf_res_template(struct be_adapter *adapter,
39213934
vf_if_cap_flags &= ~(BE_IF_FLAGS_RSS |
39223935
BE_IF_FLAGS_DEFQ_RSS);
39233936
}
3924-
3925-
nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags);
39263937
} else {
39273938
num_vf_qs = 1;
39283939
}
39293940

3941+
if (res_mod.vf_if_cap_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) {
3942+
nic_vft->flags |= BIT(IF_CAPS_FLAGS_VALID_SHIFT);
3943+
vf_if_cap_flags &= ~BE_IF_FLAGS_VLAN_PROMISCUOUS;
3944+
}
3945+
3946+
nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags);
39303947
nic_vft->rq_count = cpu_to_le16(num_vf_qs);
39313948
nic_vft->txq_count = cpu_to_le16(num_vf_qs);
39323949
nic_vft->rssq_count = cpu_to_le16(num_vf_qs);

drivers/net/ethernet/emulex/benet/be_cmds.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ struct be_cmd_req_hdr {
289289
u32 timeout; /* dword 1 */
290290
u32 request_length; /* dword 2 */
291291
u8 version; /* dword 3 */
292-
u8 rsvd[3]; /* dword 3 */
292+
u8 rsvd1; /* dword 3 */
293+
u8 pf_num; /* dword 3 */
294+
u8 rsvd2; /* dword 3 */
293295
};
294296

295297
#define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
@@ -1652,7 +1654,11 @@ struct mgmt_hba_attribs {
16521654

16531655
struct mgmt_controller_attrib {
16541656
struct mgmt_hba_attribs hba_attribs;
1655-
u32 rsvd0[10];
1657+
u32 rsvd0[2];
1658+
u16 rsvd1;
1659+
u8 pci_func_num;
1660+
u8 rsvd2;
1661+
u32 rsvd3[7];
16561662
} __packed;
16571663

16581664
struct be_cmd_req_cntl_attribs {

drivers/net/ethernet/emulex/benet/be_main.c

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,11 +1123,12 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
11231123
struct sk_buff *skb,
11241124
struct be_wrb_params *wrb_params)
11251125
{
1126-
/* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or
1127-
* less may cause a transmit stall on that port. So the work-around is
1128-
* to pad short packets (<= 32 bytes) to a 36-byte length.
1126+
/* Lancer, SH and BE3 in SRIOV mode have a bug wherein
1127+
* packets that are 32b or less may cause a transmit stall
1128+
* on that port. The workaround is to pad such packets
1129+
* (len <= 32 bytes) to a minimum length of 36b.
11291130
*/
1130-
if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {
1131+
if (skb->len <= 32) {
11311132
if (skb_put_padto(skb, 36))
11321133
return NULL;
11331134
}
@@ -4205,10 +4206,6 @@ static int be_get_config(struct be_adapter *adapter)
42054206
int status, level;
42064207
u16 profile_id;
42074208

4208-
status = be_cmd_get_cntl_attributes(adapter);
4209-
if (status)
4210-
return status;
4211-
42124209
status = be_cmd_query_fw_cfg(adapter);
42134210
if (status)
42144211
return status;
@@ -4407,6 +4404,11 @@ static int be_setup(struct be_adapter *adapter)
44074404
if (!lancer_chip(adapter))
44084405
be_cmd_req_native_mode(adapter);
44094406

4407+
/* Need to invoke this cmd first to get the PCI Function Number */
4408+
status = be_cmd_get_cntl_attributes(adapter);
4409+
if (status)
4410+
return status;
4411+
44104412
if (!BE2_chip(adapter) && be_physfn(adapter))
44114413
be_alloc_sriov_res(adapter);
44124414

@@ -4999,7 +5001,15 @@ static bool be_check_ufi_compatibility(struct be_adapter *adapter,
49995001
return false;
50005002
}
50015003

5002-
return (fhdr->asic_type_rev >= adapter->asic_rev);
5004+
/* In BE3 FW images the "asic_type_rev" field doesn't track the
5005+
* asic_rev of the chips it is compatible with.
5006+
* When asic_type_rev is 0 the image is compatible only with
5007+
* pre-BE3-R chips (asic_rev < 0x10)
5008+
*/
5009+
if (BEx_chip(adapter) && fhdr->asic_type_rev == 0)
5010+
return adapter->asic_rev < 0x10;
5011+
else
5012+
return (fhdr->asic_type_rev >= adapter->asic_rev);
50035013
}
50045014

50055015
static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)

drivers/net/ethernet/freescale/fsl_pq_mdio.c

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,28 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus)
198198

199199
#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
200200
/*
201+
* Return the TBIPA address, starting from the address
202+
* of the mapped GFAR MDIO registers (struct gfar)
201203
* This is mildly evil, but so is our hardware for doing this.
202204
* Also, we have to cast back to struct gfar because of
203205
* definition weirdness done in gianfar.h.
204206
*/
205-
static uint32_t __iomem *get_gfar_tbipa(void __iomem *p)
207+
static uint32_t __iomem *get_gfar_tbipa_from_mdio(void __iomem *p)
206208
{
207209
struct gfar __iomem *enet_regs = p;
208210

209211
return &enet_regs->tbipa;
210212
}
211213

214+
/*
215+
* Return the TBIPA address, starting from the address
216+
* of the mapped GFAR MII registers (gfar_mii_regs[] within struct gfar)
217+
*/
218+
static uint32_t __iomem *get_gfar_tbipa_from_mii(void __iomem *p)
219+
{
220+
return get_gfar_tbipa_from_mdio(container_of(p, struct gfar, gfar_mii_regs));
221+
}
222+
212223
/*
213224
* Return the TBIPAR address for an eTSEC2 node
214225
*/
@@ -220,11 +231,12 @@ static uint32_t __iomem *get_etsec_tbipa(void __iomem *p)
220231

221232
#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
222233
/*
223-
* Return the TBIPAR address for a QE MDIO node
234+
* Return the TBIPAR address for a QE MDIO node, starting from the address
235+
* of the mapped MII registers (struct fsl_pq_mii)
224236
*/
225237
static uint32_t __iomem *get_ucc_tbipa(void __iomem *p)
226238
{
227-
struct fsl_pq_mdio __iomem *mdio = p;
239+
struct fsl_pq_mdio __iomem *mdio = container_of(p, struct fsl_pq_mdio, mii);
228240

229241
return &mdio->utbipar;
230242
}
@@ -300,22 +312,22 @@ static const struct of_device_id fsl_pq_mdio_match[] = {
300312
.compatible = "fsl,gianfar-tbi",
301313
.data = &(struct fsl_pq_mdio_data) {
302314
.mii_offset = 0,
303-
.get_tbipa = get_gfar_tbipa,
315+
.get_tbipa = get_gfar_tbipa_from_mii,
304316
},
305317
},
306318
{
307319
.compatible = "fsl,gianfar-mdio",
308320
.data = &(struct fsl_pq_mdio_data) {
309321
.mii_offset = 0,
310-
.get_tbipa = get_gfar_tbipa,
322+
.get_tbipa = get_gfar_tbipa_from_mii,
311323
},
312324
},
313325
{
314326
.type = "mdio",
315327
.compatible = "gianfar",
316328
.data = &(struct fsl_pq_mdio_data) {
317329
.mii_offset = offsetof(struct fsl_pq_mdio, mii),
318-
.get_tbipa = get_gfar_tbipa,
330+
.get_tbipa = get_gfar_tbipa_from_mdio,
319331
},
320332
},
321333
{
@@ -445,6 +457,16 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
445457

446458
tbipa = data->get_tbipa(priv->map);
447459

460+
/*
461+
* Add consistency check to make sure TBI is contained
462+
* within the mapped range (not because we would get a
463+
* segfault, rather to catch bugs in computing TBI
464+
* address). Print error message but continue anyway.
465+
*/
466+
if ((void *)tbipa > priv->map + resource_size(&res) - 4)
467+
dev_err(&pdev->dev, "invalid register map (should be at least 0x%04x to contain TBI address)\n",
468+
((void *)tbipa - priv->map) + 4);
469+
448470
iowrite32be(be32_to_cpup(prop), tbipa);
449471
}
450472
}

0 commit comments

Comments
 (0)