Skip to content

Commit 2decb26

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) mlx4 doesn't check fully for supported valid RSS hash function, fix from Amir Vadai 2) Off by one in ibmveth_change_mtu(), from David Gibson 3) Prevent altera chip from reporting false error interrupts in some circumstances, from Chee Nouk Phoon 4) Get rid of that stupid endless loop trying to allocate a FIN packet in TCP, and in the process kill deadlocks. From Eric Dumazet 5) Fix get_rps_cpus() crash due to wrong invalid-cpu value, also from Eric Dumazet 6) Fix two bugs in async rhashtable resizing, from Thomas Graf 7) Fix topology server listener socket namespace bug in TIPC, from Ying Xue 8) Add some missing HAS_DMA kconfig dependencies, from Geert Uytterhoeven 9) bgmac driver intends to force re-polling but does so by returning the wrong value from it's ->poll() handler. Fix from Rafał Miłecki 10) When the creater of an rhashtable configures a max size for it, don't bark in the logs and drop insertions when that is exceeded. Fix from Johannes Berg 11) Recover from out of order packets in ppp mppe properly, from Sylvain Rochet * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (41 commits) bnx2x: really disable TPA if 'disable_tpa' option is set net:treewide: Fix typo in drivers/net net/mlx4_en: Prevent setting invalid RSS hash function mdio-mux-gpio: use new gpiod_get_array and gpiod_put_array functions netfilter; Add some missing default cases to switch statements in nft_reject. ppp: mppe: discard late packet in stateless mode ppp: mppe: sanity error path rework net/bonding: Make DRV macros private net: rfs: fix crash in get_rps_cpus() altera tse: add support for fixed-links. pxa168: fix double deallocation of managed resources net: fix crash in build_skb() net: eth: altera: Resolve false errors from MSGDMA to TSE ehea: Fix memory hook reference counting crashes net/tg3: Release IRQs on permanent error net: mdio-gpio: support access that may sleep inet: fix possible panic in reqsk_queue_unlink() rhashtable: don't attempt to grow when at max_size bgmac: fix requests for extra polling calls from NAPI tcp: avoid looping in tcp_send_fin() ...
2 parents b787f68 + 22a8f23 commit 2decb26

Some content is hidden

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

53 files changed

+527
-317
lines changed

Documentation/networking/mpls-sysctl.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,12 @@ platform_labels - INTEGER
1818

1919
Possible values: 0 - 1048575
2020
Default: 0
21+
22+
conf/<interface>/input - BOOL
23+
Control whether packets can be input on this interface.
24+
25+
If disabled, packets will be discarded without further
26+
processing.
27+
28+
0 - disabled (default)
29+
not 0 - enabled

Documentation/networking/scaling.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ following is true:
282282

283283
- The current CPU's queue head counter >= the recorded tail counter
284284
value in rps_dev_flow[i]
285-
- The current CPU is unset (equal to RPS_NO_CPU)
285+
- The current CPU is unset (>= nr_cpu_ids)
286286
- The current CPU is offline
287287

288288
After this check, the packet is sent to the (possibly updated) current

drivers/net/bonding/bond_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
#include <net/bond_3ad.h>
8383
#include <net/bond_alb.h>
8484

85+
#include "bonding_priv.h"
86+
8587
/*---------------------------- Module parameters ----------------------------*/
8688

8789
/* monitor all links that often (in milliseconds). <=0 disables monitoring */

drivers/net/bonding/bond_procfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <net/netns/generic.h>
55
#include <net/bonding.h>
66

7+
#include "bonding_priv.h"
78

89
static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
910
__acquires(RCU)

drivers/net/bonding/bonding_priv.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
3+
*
4+
* Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
5+
* NCM: Network and Communications Management, Inc.
6+
*
7+
* BUT, I'm the one who modified it for ethernet, so:
8+
* (c) Copyright 1999, Thomas Davis, tadavis@lbl.gov
9+
*
10+
* This software may be used and distributed according to the terms
11+
* of the GNU Public License, incorporated herein by reference.
12+
*
13+
*/
14+
15+
#ifndef _BONDING_PRIV_H
16+
#define _BONDING_PRIV_H
17+
18+
#define DRV_VERSION "3.7.1"
19+
#define DRV_RELDATE "April 27, 2011"
20+
#define DRV_NAME "bonding"
21+
#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
22+
23+
#define bond_version DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n"
24+
25+
#endif

drivers/net/can/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ config PCH_CAN
112112

113113
config CAN_GRCAN
114114
tristate "Aeroflex Gaisler GRCAN and GRHCAN CAN devices"
115-
depends on OF
115+
depends on OF && HAS_DMA
116116
---help---
117117
Say Y here if you want to use Aeroflex Gaisler GRCAN or GRHCAN.
118118
Note that the driver supports little endian, even though little

drivers/net/can/usb/kvaser_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ static void kvaser_usb_rx_can_err(const struct kvaser_usb_net_priv *priv,
11021102

11031103
if (msg->u.rx_can_header.flag & (MSG_FLAG_ERROR_FRAME |
11041104
MSG_FLAG_NERR)) {
1105-
netdev_err(priv->netdev, "Unknow error (flags: 0x%02x)\n",
1105+
netdev_err(priv->netdev, "Unknown error (flags: 0x%02x)\n",
11061106
msg->u.rx_can_header.flag);
11071107

11081108
stats->rx_errors++;

drivers/net/ethernet/8390/etherh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static int etherh_addr(char *addr, struct expansion_card *ec)
523523
char *s;
524524

525525
if (!ecard_readchunk(&cd, ec, 0xf5, 0)) {
526-
printk(KERN_ERR "%s: unable to read podule description string\n",
526+
printk(KERN_ERR "%s: unable to read module description string\n",
527527
dev_name(&ec->dev));
528528
goto no_addr;
529529
}

drivers/net/ethernet/altera/altera_msgdmahw.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,12 @@ struct msgdma_extended_desc {
5858
/* Tx buffer control flags
5959
*/
6060
#define MSGDMA_DESC_CTL_TX_FIRST (MSGDMA_DESC_CTL_GEN_SOP | \
61-
MSGDMA_DESC_CTL_TR_ERR_IRQ | \
6261
MSGDMA_DESC_CTL_GO)
6362

64-
#define MSGDMA_DESC_CTL_TX_MIDDLE (MSGDMA_DESC_CTL_TR_ERR_IRQ | \
65-
MSGDMA_DESC_CTL_GO)
63+
#define MSGDMA_DESC_CTL_TX_MIDDLE (MSGDMA_DESC_CTL_GO)
6664

6765
#define MSGDMA_DESC_CTL_TX_LAST (MSGDMA_DESC_CTL_GEN_EOP | \
6866
MSGDMA_DESC_CTL_TR_COMP_IRQ | \
69-
MSGDMA_DESC_CTL_TR_ERR_IRQ | \
7067
MSGDMA_DESC_CTL_GO)
7168

7269
#define MSGDMA_DESC_CTL_TX_SINGLE (MSGDMA_DESC_CTL_GEN_SOP | \

drivers/net/ethernet/altera/altera_tse_main.c

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ static int init_phy(struct net_device *dev)
777777
struct altera_tse_private *priv = netdev_priv(dev);
778778
struct phy_device *phydev;
779779
struct device_node *phynode;
780+
bool fixed_link = false;
781+
int rc = 0;
780782

781783
/* Avoid init phy in case of no phy present */
782784
if (!priv->phy_iface)
@@ -789,13 +791,32 @@ static int init_phy(struct net_device *dev)
789791
phynode = of_parse_phandle(priv->device->of_node, "phy-handle", 0);
790792

791793
if (!phynode) {
792-
netdev_dbg(dev, "no phy-handle found\n");
793-
if (!priv->mdio) {
794-
netdev_err(dev,
795-
"No phy-handle nor local mdio specified\n");
796-
return -ENODEV;
794+
/* check if a fixed-link is defined in device-tree */
795+
if (of_phy_is_fixed_link(priv->device->of_node)) {
796+
rc = of_phy_register_fixed_link(priv->device->of_node);
797+
if (rc < 0) {
798+
netdev_err(dev, "cannot register fixed PHY\n");
799+
return rc;
800+
}
801+
802+
/* In the case of a fixed PHY, the DT node associated
803+
* to the PHY is the Ethernet MAC DT node.
804+
*/
805+
phynode = of_node_get(priv->device->of_node);
806+
fixed_link = true;
807+
808+
netdev_dbg(dev, "fixed-link detected\n");
809+
phydev = of_phy_connect(dev, phynode,
810+
&altera_tse_adjust_link,
811+
0, priv->phy_iface);
812+
} else {
813+
netdev_dbg(dev, "no phy-handle found\n");
814+
if (!priv->mdio) {
815+
netdev_err(dev, "No phy-handle nor local mdio specified\n");
816+
return -ENODEV;
817+
}
818+
phydev = connect_local_phy(dev);
797819
}
798-
phydev = connect_local_phy(dev);
799820
} else {
800821
netdev_dbg(dev, "phy-handle found\n");
801822
phydev = of_phy_connect(dev, phynode,
@@ -819,10 +840,10 @@ static int init_phy(struct net_device *dev)
819840
/* Broken HW is sometimes missing the pull-up resistor on the
820841
* MDIO line, which results in reads to non-existent devices returning
821842
* 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
822-
* device as well.
843+
* device as well. If a fixed-link is used the phy_id is always 0.
823844
* Note: phydev->phy_id is the result of reading the UID PHY registers.
824845
*/
825-
if (phydev->phy_id == 0) {
846+
if ((phydev->phy_id == 0) && !fixed_link) {
826847
netdev_err(dev, "Bad PHY UID 0x%08x\n", phydev->phy_id);
827848
phy_disconnect(phydev);
828849
return -ENODEV;

drivers/net/ethernet/amd/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ config SUNLANCE
179179

180180
config AMD_XGBE
181181
tristate "AMD 10GbE Ethernet driver"
182-
depends on (OF_NET || ACPI) && HAS_IOMEM
182+
depends on (OF_NET || ACPI) && HAS_IOMEM && HAS_DMA
183183
select PHYLIB
184184
select AMD_XGBE_PHY
185185
select BITREVERSE

drivers/net/ethernet/arc/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ config ARC_EMAC_CORE
2525
config ARC_EMAC
2626
tristate "ARC EMAC support"
2727
select ARC_EMAC_CORE
28-
depends on OF_IRQ
29-
depends on OF_NET
28+
depends on OF_IRQ && OF_NET && HAS_DMA
3029
---help---
3130
On some legacy ARC (Synopsys) FPGA boards such as ARCAngel4/ML50x
3231
non-standard on-chip ethernet device ARC EMAC 10/100 is used.
@@ -35,7 +34,7 @@ config ARC_EMAC
3534
config EMAC_ROCKCHIP
3635
tristate "Rockchip EMAC support"
3736
select ARC_EMAC_CORE
38-
depends on OF_IRQ && OF_NET && REGULATOR
37+
depends on OF_IRQ && OF_NET && REGULATOR && HAS_DMA
3938
---help---
4039
Support for Rockchip RK3066/RK3188 EMAC ethernet controllers.
4140
This selects Rockchip SoC glue layer support for the

drivers/net/ethernet/broadcom/bgmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ static int bgmac_poll(struct napi_struct *napi, int weight)
12601260

12611261
/* Poll again if more events arrived in the meantime */
12621262
if (bgmac_read(bgmac, BGMAC_INT_STATUS) & (BGMAC_IS_TX0 | BGMAC_IS_RX))
1263-
return handled;
1263+
return weight;
12641264

12651265
if (handled < weight) {
12661266
napi_complete(napi);

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

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,8 +2485,10 @@ static void bnx2x_bz_fp(struct bnx2x *bp, int index)
24852485
else if (bp->flags & GRO_ENABLE_FLAG)
24862486
fp->mode = TPA_MODE_GRO;
24872487

2488-
/* We don't want TPA on an FCoE L2 ring */
2489-
if (IS_FCOE_FP(fp))
2488+
/* We don't want TPA if it's disabled in bp
2489+
* or if this is an FCoE L2 ring.
2490+
*/
2491+
if (bp->disable_tpa || IS_FCOE_FP(fp))
24902492
fp->disable_tpa = 1;
24912493
}
24922494

@@ -4809,6 +4811,23 @@ netdev_features_t bnx2x_fix_features(struct net_device *dev,
48094811
{
48104812
struct bnx2x *bp = netdev_priv(dev);
48114813

4814+
if (pci_num_vf(bp->pdev)) {
4815+
netdev_features_t changed = dev->features ^ features;
4816+
4817+
/* Revert the requested changes in features if they
4818+
* would require internal reload of PF in bnx2x_set_features().
4819+
*/
4820+
if (!(features & NETIF_F_RXCSUM) && !bp->disable_tpa) {
4821+
features &= ~NETIF_F_RXCSUM;
4822+
features |= dev->features & NETIF_F_RXCSUM;
4823+
}
4824+
4825+
if (changed & NETIF_F_LOOPBACK) {
4826+
features &= ~NETIF_F_LOOPBACK;
4827+
features |= dev->features & NETIF_F_LOOPBACK;
4828+
}
4829+
}
4830+
48124831
/* TPA requires Rx CSUM offloading */
48134832
if (!(features & NETIF_F_RXCSUM)) {
48144833
features &= ~NETIF_F_LRO;
@@ -4839,15 +4858,18 @@ int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
48394858
else
48404859
flags &= ~GRO_ENABLE_FLAG;
48414860

4842-
if (features & NETIF_F_LOOPBACK) {
4843-
if (bp->link_params.loopback_mode != LOOPBACK_BMAC) {
4844-
bp->link_params.loopback_mode = LOOPBACK_BMAC;
4845-
bnx2x_reload = true;
4846-
}
4847-
} else {
4848-
if (bp->link_params.loopback_mode != LOOPBACK_NONE) {
4849-
bp->link_params.loopback_mode = LOOPBACK_NONE;
4850-
bnx2x_reload = true;
4861+
/* VFs or non SRIOV PFs should be able to change loopback feature */
4862+
if (!pci_num_vf(bp->pdev)) {
4863+
if (features & NETIF_F_LOOPBACK) {
4864+
if (bp->link_params.loopback_mode != LOOPBACK_BMAC) {
4865+
bp->link_params.loopback_mode = LOOPBACK_BMAC;
4866+
bnx2x_reload = true;
4867+
}
4868+
} else {
4869+
if (bp->link_params.loopback_mode != LOOPBACK_NONE) {
4870+
bp->link_params.loopback_mode = LOOPBACK_NONE;
4871+
bnx2x_reload = true;
4872+
}
48514873
}
48524874
}
48534875

@@ -4931,6 +4953,11 @@ int bnx2x_resume(struct pci_dev *pdev)
49314953
}
49324954
bp = netdev_priv(dev);
49334955

4956+
if (pci_num_vf(bp->pdev)) {
4957+
DP(BNX2X_MSG_IOV, "VFs are enabled, can not change MTU\n");
4958+
return -EPERM;
4959+
}
4960+
49344961
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
49354962
BNX2X_ERR("Handling parity error recovery. Try again later\n");
49364963
return -EAGAIN;

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,12 @@ static int bnx2x_set_ringparam(struct net_device *dev,
18431843
"set ring params command parameters: rx_pending = %d, tx_pending = %d\n",
18441844
ering->rx_pending, ering->tx_pending);
18451845

1846+
if (pci_num_vf(bp->pdev)) {
1847+
DP(BNX2X_MSG_IOV,
1848+
"VFs are enabled, can not change ring parameters\n");
1849+
return -EPERM;
1850+
}
1851+
18461852
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
18471853
DP(BNX2X_MSG_ETHTOOL,
18481854
"Handling parity error recovery. Try again later\n");
@@ -2899,6 +2905,12 @@ static void bnx2x_self_test(struct net_device *dev,
28992905
u8 is_serdes, link_up;
29002906
int rc, cnt = 0;
29012907

2908+
if (pci_num_vf(bp->pdev)) {
2909+
DP(BNX2X_MSG_IOV,
2910+
"VFs are enabled, can not perform self test\n");
2911+
return;
2912+
}
2913+
29022914
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
29032915
netdev_err(bp->dev,
29042916
"Handling parity error recovery. Try again later\n");
@@ -3468,6 +3480,11 @@ static int bnx2x_set_channels(struct net_device *dev,
34683480
channels->rx_count, channels->tx_count, channels->other_count,
34693481
channels->combined_count);
34703482

3483+
if (pci_num_vf(bp->pdev)) {
3484+
DP(BNX2X_MSG_IOV, "VFs are enabled, can not set channels\n");
3485+
return -EPERM;
3486+
}
3487+
34713488
/* We don't support separate rx / tx channels.
34723489
* We don't allow setting 'other' channels.
34733490
*/

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18129,7 +18129,9 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,
1812918129

1813018130
rtnl_lock();
1813118131

18132-
tp->pcierr_recovery = true;
18132+
/* We needn't recover from permanent error */
18133+
if (state == pci_channel_io_frozen)
18134+
tp->pcierr_recovery = true;
1813318135

1813418136
/* We probably don't have netdev yet */
1813518137
if (!netdev || !netif_running(netdev))

drivers/net/ethernet/cadence/macb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,9 +1473,9 @@ static void macb_init_rings(struct macb *bp)
14731473
for (i = 0; i < TX_RING_SIZE; i++) {
14741474
bp->queues[0].tx_ring[i].addr = 0;
14751475
bp->queues[0].tx_ring[i].ctrl = MACB_BIT(TX_USED);
1476-
bp->queues[0].tx_head = 0;
1477-
bp->queues[0].tx_tail = 0;
14781476
}
1477+
bp->queues[0].tx_head = 0;
1478+
bp->queues[0].tx_tail = 0;
14791479
bp->queues[0].tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
14801480

14811481
bp->rx_tail = 0;

drivers/net/ethernet/ibm/ehea/ehea_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3347,7 +3347,7 @@ static int ehea_register_memory_hooks(void)
33473347
{
33483348
int ret = 0;
33493349

3350-
if (atomic_inc_and_test(&ehea_memory_hooks_registered))
3350+
if (atomic_inc_return(&ehea_memory_hooks_registered) > 1)
33513351
return 0;
33523352

33533353
ret = ehea_create_busmap();
@@ -3381,12 +3381,14 @@ static int ehea_register_memory_hooks(void)
33813381
out2:
33823382
unregister_reboot_notifier(&ehea_reboot_nb);
33833383
out:
3384+
atomic_dec(&ehea_memory_hooks_registered);
33843385
return ret;
33853386
}
33863387

33873388
static void ehea_unregister_memory_hooks(void)
33883389
{
3389-
if (atomic_read(&ehea_memory_hooks_registered))
3390+
/* Only remove the hooks if we've registered them */
3391+
if (atomic_read(&ehea_memory_hooks_registered) == 0)
33903392
return;
33913393

33923394
unregister_reboot_notifier(&ehea_reboot_nb);

drivers/net/ethernet/ibm/ibmveth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ static int ibmveth_change_mtu(struct net_device *dev, int new_mtu)
12381238
return -EINVAL;
12391239

12401240
for (i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++)
1241-
if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size)
1241+
if (new_mtu_oh <= adapter->rx_buff_pool[i].buff_size)
12421242
break;
12431243

12441244
if (i == IBMVETH_NUM_BUFF_POOLS)
@@ -1257,7 +1257,7 @@ static int ibmveth_change_mtu(struct net_device *dev, int new_mtu)
12571257
for (i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++) {
12581258
adapter->rx_buff_pool[i].active = 1;
12591259

1260-
if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size) {
1260+
if (new_mtu_oh <= adapter->rx_buff_pool[i].buff_size) {
12611261
dev->mtu = new_mtu;
12621262
vio_cmo_set_dev_desired(viodev,
12631263
ibmveth_get_desired_dma

0 commit comments

Comments
 (0)