Skip to content

Commit 2df4ee7

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix null deref in xt_TEE netfilter module, from Eric Dumazet. 2) Several spots need to get to the original listner for SYN-ACK packets, most spots got this ok but some were not. Whilst covering the remaining cases, create a helper to do this. From Eric Dumazet. 3) Missiing check of return value from alloc_netdev() in CAIF SPI code, from Rasmus Villemoes. 4) Don't sleep while != TASK_RUNNING in macvtap, from Vlad Yasevich. 5) Use after free in mvneta driver, from Justin Maggard. 6) Fix race on dst->flags access in dst_release(), from Eric Dumazet. 7) Add missing ZLIB_INFLATE dependency for new qed driver. From Arnd Bergmann. 8) Fix multicast getsockopt deadlock, from WANG Cong. 9) Fix deadlock in btusb, from Kuba Pawlak. 10) Some ipv6_add_dev() failure paths were not cleaning up the SNMP6 counter state. From Sabrina Dubroca. 11) Fix packet_bind() race, which can cause lost notifications, from Francesco Ruggeri. 12) Fix MAC restoration in qlcnic driver during bonding mode changes, from Jarod Wilson. 13) Revert bridging forward delay change which broke libvirt and other userspace things, from Vlad Yasevich. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (65 commits) Revert "bridge: Allow forward delay to be cfgd when STP enabled" bpf_trace: Make dependent on PERF_EVENTS qed: select ZLIB_INFLATE net: fix a race in dst_release() net: mvneta: Fix memory use after free. net: Documentation: Fix default value tcp_limit_output_bytes macvtap: Resolve possible __might_sleep warning in macvtap_do_read() mvneta: add FIXED_PHY dependency net: caif: check return value of alloc_netdev net: hisilicon: NET_VENDOR_HISILICON should depend on HAS_DMA drivers: net: xgene: fix RGMII 10/100Mb mode netfilter: nft_meta: use skb_to_full_sk() helper net_sched: em_meta: use skb_to_full_sk() helper sched: cls_flow: use skb_to_full_sk() helper netfilter: xt_owner: use skb_to_full_sk() helper smack: use skb_to_full_sk() helper net: add skb_to_full_sk() helper and use it in selinux_netlbl_skbuff_setsid() bpf: doc: correct arch list for supported eBPF JIT dwc_eth_qos: Delete an unnecessary check before the function call "of_node_put" bonding: fix panic on non-ARPHRD_ETHER enslave failure ...
2 parents 3419b45 + 8a92126 commit 2df4ee7

Some content is hidden

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

68 files changed

+642
-322
lines changed

Documentation/devicetree/bindings/net/cpsw.txt

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ Optional properties:
4848
- mac-address : See ethernet.txt file in the same directory
4949
- phy-handle : See ethernet.txt file in the same directory
5050

51+
Slave sub-nodes:
52+
- fixed-link : See fixed-link.txt file in the same directory
53+
Either the properties phy_id and phy-mode,
54+
or the sub-node fixed-link can be specified
55+
5156
Note: "ti,hwmods" field is used to fetch the base address and irq
5257
resources from TI, omap hwmod data base during device registration.
5358
Future plan is to migrate hwmod data base contents into device tree

Documentation/networking/filter.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,9 @@ skb pointer). All constraints and restrictions from bpf_check_classic() apply
596596
before a conversion to the new layout is being done behind the scenes!
597597

598598
Currently, the classic BPF format is being used for JITing on most of the
599-
architectures. Only x86-64 performs JIT compilation from eBPF instruction set,
600-
however, future work will migrate other JIT compilers as well, so that they
601-
will profit from the very same benefits.
599+
architectures. x86-64, aarch64 and s390x perform JIT compilation from eBPF
600+
instruction set, however, future work will migrate other JIT compilers as well,
601+
so that they will profit from the very same benefits.
602602

603603
Some core changes of the new internal format:
604604

Documentation/networking/ip-sysctl.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ tcp_limit_output_bytes - INTEGER
709709
typical pfifo_fast qdiscs.
710710
tcp_limit_output_bytes limits the number of bytes on qdisc
711711
or device to reduce artificial RTT/cwnd and reduce bufferbloat.
712-
Default: 131072
712+
Default: 262144
713713

714714
tcp_challenge_ack_limit - INTEGER
715715
Limits number of Challenge ACK sent per second, as recommended

drivers/bluetooth/btusb.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,8 @@ static void btusb_work(struct work_struct *work)
13721372
}
13731373

13741374
if (data->isoc_altsetting != new_alts) {
1375+
unsigned long flags;
1376+
13751377
clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
13761378
usb_kill_anchored_urbs(&data->isoc_anchor);
13771379

@@ -1384,10 +1386,10 @@ static void btusb_work(struct work_struct *work)
13841386
* Clear outstanding fragment when selecting a new
13851387
* alternate setting.
13861388
*/
1387-
spin_lock(&data->rxlock);
1389+
spin_lock_irqsave(&data->rxlock, flags);
13881390
kfree_skb(data->sco_skb);
13891391
data->sco_skb = NULL;
1390-
spin_unlock(&data->rxlock);
1392+
spin_unlock_irqrestore(&data->rxlock, flags);
13911393

13921394
if (__set_isoc_interface(hdev, new_alts) < 0)
13931395
return;

drivers/net/bonding/bond_main.c

+1
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
17491749
slave_dev->dev_addr))
17501750
eth_hw_addr_random(bond_dev);
17511751
if (bond_dev->type != ARPHRD_ETHER) {
1752+
dev_close(bond_dev);
17521753
ether_setup(bond_dev);
17531754
bond_dev->flags |= IFF_MASTER;
17541755
bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;

drivers/net/caif/caif_spi.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -730,11 +730,14 @@ int cfspi_spi_probe(struct platform_device *pdev)
730730
int res;
731731
dev = (struct cfspi_dev *)pdev->dev.platform_data;
732732

733-
ndev = alloc_netdev(sizeof(struct cfspi), "cfspi%d",
734-
NET_NAME_UNKNOWN, cfspi_setup);
735733
if (!dev)
736734
return -ENODEV;
737735

736+
ndev = alloc_netdev(sizeof(struct cfspi), "cfspi%d",
737+
NET_NAME_UNKNOWN, cfspi_setup);
738+
if (!ndev)
739+
return -ENOMEM;
740+
738741
cfspi = netdev_priv(ndev);
739742
netif_stop_queue(ndev);
740743
cfspi->ndev = ndev;

drivers/net/dsa/mv88e6171.c

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ struct dsa_switch_driver mv88e6171_switch_driver = {
103103
#endif
104104
.get_regs_len = mv88e6xxx_get_regs_len,
105105
.get_regs = mv88e6xxx_get_regs,
106+
.port_join_bridge = mv88e6xxx_port_bridge_join,
107+
.port_leave_bridge = mv88e6xxx_port_bridge_leave,
106108
.port_stp_update = mv88e6xxx_port_stp_update,
107109
.port_pvid_get = mv88e6xxx_port_pvid_get,
108110
.port_vlan_prepare = mv88e6xxx_port_vlan_prepare,

drivers/net/dsa/mv88e6352.c

+2
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ struct dsa_switch_driver mv88e6352_switch_driver = {
323323
.set_eeprom = mv88e6352_set_eeprom,
324324
.get_regs_len = mv88e6xxx_get_regs_len,
325325
.get_regs = mv88e6xxx_get_regs,
326+
.port_join_bridge = mv88e6xxx_port_bridge_join,
327+
.port_leave_bridge = mv88e6xxx_port_bridge_leave,
326328
.port_stp_update = mv88e6xxx_port_stp_update,
327329
.port_pvid_get = mv88e6xxx_port_pvid_get,
328330
.port_vlan_prepare = mv88e6xxx_port_vlan_prepare,

drivers/net/dsa/mv88e6xxx.c

+42
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,10 @@ int mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port,
14621462
const struct switchdev_obj_port_vlan *vlan,
14631463
struct switchdev_trans *trans)
14641464
{
1465+
/* We reserve a few VLANs to isolate unbridged ports */
1466+
if (vlan->vid_end >= 4000)
1467+
return -EOPNOTSUPP;
1468+
14651469
/* We don't need any dynamic resource from the kernel (yet),
14661470
* so skip the prepare phase.
14671471
*/
@@ -1870,6 +1874,36 @@ int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port,
18701874
return err;
18711875
}
18721876

1877+
int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, u32 members)
1878+
{
1879+
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
1880+
const u16 pvid = 4000 + ds->index * DSA_MAX_PORTS + port;
1881+
int err;
1882+
1883+
/* The port joined a bridge, so leave its reserved VLAN */
1884+
mutex_lock(&ps->smi_mutex);
1885+
err = _mv88e6xxx_port_vlan_del(ds, port, pvid);
1886+
if (!err)
1887+
err = _mv88e6xxx_port_pvid_set(ds, port, 0);
1888+
mutex_unlock(&ps->smi_mutex);
1889+
return err;
1890+
}
1891+
1892+
int mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port, u32 members)
1893+
{
1894+
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
1895+
const u16 pvid = 4000 + ds->index * DSA_MAX_PORTS + port;
1896+
int err;
1897+
1898+
/* The port left the bridge, so join its reserved VLAN */
1899+
mutex_lock(&ps->smi_mutex);
1900+
err = _mv88e6xxx_port_vlan_add(ds, port, pvid, true);
1901+
if (!err)
1902+
err = _mv88e6xxx_port_pvid_set(ds, port, pvid);
1903+
mutex_unlock(&ps->smi_mutex);
1904+
return err;
1905+
}
1906+
18731907
static void mv88e6xxx_bridge_work(struct work_struct *work)
18741908
{
18751909
struct mv88e6xxx_priv_state *ps;
@@ -2140,6 +2174,14 @@ int mv88e6xxx_setup_ports(struct dsa_switch *ds)
21402174
ret = mv88e6xxx_setup_port(ds, i);
21412175
if (ret < 0)
21422176
return ret;
2177+
2178+
if (dsa_is_cpu_port(ds, i) || dsa_is_dsa_port(ds, i))
2179+
continue;
2180+
2181+
/* setup the unbridged state */
2182+
ret = mv88e6xxx_port_bridge_leave(ds, i, 0);
2183+
if (ret < 0)
2184+
return ret;
21432185
}
21442186
return 0;
21452187
}

drivers/net/dsa/mv88e6xxx.h

+2
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ int mv88e6xxx_phy_write_indirect(struct dsa_switch *ds, int addr, int regnum,
468468
int mv88e6xxx_get_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e);
469469
int mv88e6xxx_set_eee(struct dsa_switch *ds, int port,
470470
struct phy_device *phydev, struct ethtool_eee *e);
471+
int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, u32 members);
472+
int mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port, u32 members);
471473
int mv88e6xxx_port_stp_update(struct dsa_switch *ds, int port, u8 state);
472474
int mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port,
473475
const struct switchdev_obj_port_vlan *vlan,

drivers/net/ethernet/apm/xgene/xgene_enet_hw.c

+47-2
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,45 @@ static void xgene_gmac_reset(struct xgene_enet_pdata *pdata)
459459
xgene_enet_wr_mcx_mac(pdata, MAC_CONFIG_1_ADDR, 0);
460460
}
461461

462+
static void xgene_enet_configure_clock(struct xgene_enet_pdata *pdata)
463+
{
464+
struct device *dev = &pdata->pdev->dev;
465+
466+
if (dev->of_node) {
467+
struct clk *parent = clk_get_parent(pdata->clk);
468+
469+
switch (pdata->phy_speed) {
470+
case SPEED_10:
471+
clk_set_rate(parent, 2500000);
472+
break;
473+
case SPEED_100:
474+
clk_set_rate(parent, 25000000);
475+
break;
476+
default:
477+
clk_set_rate(parent, 125000000);
478+
break;
479+
}
480+
}
481+
#ifdef CONFIG_ACPI
482+
else {
483+
switch (pdata->phy_speed) {
484+
case SPEED_10:
485+
acpi_evaluate_object(ACPI_HANDLE(dev),
486+
"S10", NULL, NULL);
487+
break;
488+
case SPEED_100:
489+
acpi_evaluate_object(ACPI_HANDLE(dev),
490+
"S100", NULL, NULL);
491+
break;
492+
default:
493+
acpi_evaluate_object(ACPI_HANDLE(dev),
494+
"S1G", NULL, NULL);
495+
break;
496+
}
497+
}
498+
#endif
499+
}
500+
462501
static void xgene_gmac_init(struct xgene_enet_pdata *pdata)
463502
{
464503
struct device *dev = &pdata->pdev->dev;
@@ -477,33 +516,38 @@ static void xgene_gmac_init(struct xgene_enet_pdata *pdata)
477516
switch (pdata->phy_speed) {
478517
case SPEED_10:
479518
ENET_INTERFACE_MODE2_SET(&mc2, 1);
519+
intf_ctl &= ~(ENET_LHD_MODE | ENET_GHD_MODE);
480520
CFG_MACMODE_SET(&icm0, 0);
481521
CFG_WAITASYNCRD_SET(&icm2, 500);
482522
rgmii &= ~CFG_SPEED_1250;
483523
break;
484524
case SPEED_100:
485525
ENET_INTERFACE_MODE2_SET(&mc2, 1);
526+
intf_ctl &= ~ENET_GHD_MODE;
486527
intf_ctl |= ENET_LHD_MODE;
487528
CFG_MACMODE_SET(&icm0, 1);
488529
CFG_WAITASYNCRD_SET(&icm2, 80);
489530
rgmii &= ~CFG_SPEED_1250;
490531
break;
491532
default:
492533
ENET_INTERFACE_MODE2_SET(&mc2, 2);
534+
intf_ctl &= ~ENET_LHD_MODE;
493535
intf_ctl |= ENET_GHD_MODE;
494-
536+
CFG_MACMODE_SET(&icm0, 2);
537+
CFG_WAITASYNCRD_SET(&icm2, 0);
495538
if (dev->of_node) {
496539
CFG_TXCLK_MUXSEL0_SET(&rgmii, pdata->tx_delay);
497540
CFG_RXCLK_MUXSEL0_SET(&rgmii, pdata->rx_delay);
498541
}
542+
rgmii |= CFG_SPEED_1250;
499543

500544
xgene_enet_rd_csr(pdata, DEBUG_REG_ADDR, &value);
501545
value |= CFG_BYPASS_UNISEC_TX | CFG_BYPASS_UNISEC_RX;
502546
xgene_enet_wr_csr(pdata, DEBUG_REG_ADDR, value);
503547
break;
504548
}
505549

506-
mc2 |= FULL_DUPLEX2;
550+
mc2 |= FULL_DUPLEX2 | PAD_CRC;
507551
xgene_enet_wr_mcx_mac(pdata, MAC_CONFIG_2_ADDR, mc2);
508552
xgene_enet_wr_mcx_mac(pdata, INTERFACE_CONTROL_ADDR, intf_ctl);
509553

@@ -522,6 +566,7 @@ static void xgene_gmac_init(struct xgene_enet_pdata *pdata)
522566
/* Rtype should be copied from FP */
523567
xgene_enet_wr_csr(pdata, RSIF_RAM_DBG_REG0_ADDR, 0);
524568
xgene_enet_wr_csr(pdata, RGMII_REG_0_ADDR, rgmii);
569+
xgene_enet_configure_clock(pdata);
525570

526571
/* Rx-Tx traffic resume */
527572
xgene_enet_wr_csr(pdata, CFG_LINK_AGGR_RESUME_0_ADDR, TX_PORT0);

drivers/net/ethernet/apm/xgene/xgene_enet_hw.h

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ enum xgene_enet_rm {
181181
#define ENET_LHD_MODE BIT(25)
182182
#define ENET_GHD_MODE BIT(26)
183183
#define FULL_DUPLEX2 BIT(0)
184+
#define PAD_CRC BIT(2)
184185
#define SCAN_AUTO_INCR BIT(5)
185186
#define TBYT_ADDR 0x38
186187
#define TPKT_ADDR 0x39

drivers/net/ethernet/apm/xgene/xgene_enet_main.c

-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,6 @@ static int xgene_enet_open(struct net_device *ndev)
698698
else
699699
schedule_delayed_work(&pdata->link_work, PHY_POLL_LINK_OFF);
700700

701-
netif_carrier_off(ndev);
702701
netif_start_queue(ndev);
703702

704703
return ret;

drivers/net/ethernet/broadcom/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ config SYSTEMPORT
173173
config BNXT
174174
tristate "Broadcom NetXtreme-C/E support"
175175
depends on PCI
176+
depends on VXLAN || VXLAN=n
176177
select FW_LOADER
177178
select LIBCRC32C
178179
---help---

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

+21-7
Original file line numberDiff line numberDiff line change
@@ -1292,8 +1292,6 @@ static inline int bnxt_has_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr)
12921292
return TX_CMP_VALID(txcmp, raw_cons);
12931293
}
12941294

1295-
#define CAG_LEGACY_INT_STATUS 0x2014
1296-
12971295
static irqreturn_t bnxt_inta(int irq, void *dev_instance)
12981296
{
12991297
struct bnxt_napi *bnapi = dev_instance;
@@ -1305,7 +1303,7 @@ static irqreturn_t bnxt_inta(int irq, void *dev_instance)
13051303
prefetch(&cpr->cp_desc_ring[CP_RING(cons)][CP_IDX(cons)]);
13061304

13071305
if (!bnxt_has_work(bp, cpr)) {
1308-
int_status = readl(bp->bar0 + CAG_LEGACY_INT_STATUS);
1306+
int_status = readl(bp->bar0 + BNXT_CAG_REG_LEGACY_INT_STATUS);
13091307
/* return if erroneous interrupt */
13101308
if (!(int_status & (0x10000 << cpr->cp_ring_struct.fw_ring_id)))
13111309
return IRQ_NONE;
@@ -4527,10 +4525,25 @@ static int bnxt_update_phy_setting(struct bnxt *bp)
45274525
return rc;
45284526
}
45294527

4528+
/* Common routine to pre-map certain register block to different GRC window.
4529+
* A PF has 16 4K windows and a VF has 4 4K windows. However, only 15 windows
4530+
* in PF and 3 windows in VF that can be customized to map in different
4531+
* register blocks.
4532+
*/
4533+
static void bnxt_preset_reg_win(struct bnxt *bp)
4534+
{
4535+
if (BNXT_PF(bp)) {
4536+
/* CAG registers map to GRC window #4 */
4537+
writel(BNXT_CAG_REG_BASE,
4538+
bp->bar0 + BNXT_GRCPF_REG_WINDOW_BASE_OUT + 12);
4539+
}
4540+
}
4541+
45304542
static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
45314543
{
45324544
int rc = 0;
45334545

4546+
bnxt_preset_reg_win(bp);
45344547
netif_carrier_off(bp->dev);
45354548
if (irq_re_init) {
45364549
rc = bnxt_setup_int_mode(bp);
@@ -5294,7 +5307,7 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
52945307
struct bnxt_ntuple_filter *fltr, *new_fltr;
52955308
struct flow_keys *fkeys;
52965309
struct ethhdr *eth = (struct ethhdr *)skb_mac_header(skb);
5297-
int rc = 0, idx;
5310+
int rc = 0, idx, bit_id;
52985311
struct hlist_head *head;
52995312

53005313
if (skb->encapsulation)
@@ -5332,14 +5345,15 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
53325345
rcu_read_unlock();
53335346

53345347
spin_lock_bh(&bp->ntp_fltr_lock);
5335-
new_fltr->sw_id = bitmap_find_free_region(bp->ntp_fltr_bmap,
5336-
BNXT_NTP_FLTR_MAX_FLTR, 0);
5337-
if (new_fltr->sw_id < 0) {
5348+
bit_id = bitmap_find_free_region(bp->ntp_fltr_bmap,
5349+
BNXT_NTP_FLTR_MAX_FLTR, 0);
5350+
if (bit_id < 0) {
53385351
spin_unlock_bh(&bp->ntp_fltr_lock);
53395352
rc = -ENOMEM;
53405353
goto err_free;
53415354
}
53425355

5356+
new_fltr->sw_id = (u16)bit_id;
53435357
new_fltr->flow_id = flow_id;
53445358
new_fltr->rxq = rxq_index;
53455359
hlist_add_head_rcu(&new_fltr->hash, head);

0 commit comments

Comments
 (0)