Skip to content

Commit 6b15d66

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix negative error code usage in ATM layer, from Stefan Hajnoczi. 2) If CONFIG_SYSCTL is disabled, the default TTL is not initialized properly. From Ezequiel Garcia. 3) Missing spinlock init in mvneta driver, from Gregory CLEMENT. 4) Missing unlocks in hwmb error paths, also from Gregory CLEMENT. 5) Fix deadlock on team->lock when propagating features, from Ivan Vecera. 6) Work around buffer offset hw bug in alx chips, from Feng Tang. 7) Fix double listing of SCTP entries in sctp_diag dumps, from Xin Long. 8) Various statistics bug fixes in mlx4 from Eric Dumazet. 9) Fix some randconfig build errors wrt fou ipv6 from Arnd Bergmann. 10) All of l2tp was namespace aware, but the ipv6 support code was not doing so. From Shmulik Ladkani. 11) Handle on-stack hrtimers properly in pktgen, from Guenter Roeck. 12) Propagate MAC changes properly through VLAN devices, from Mike Manning. 13) Fix memory leak in bnx2x_init_one(), from Vitaly Kuznetsov. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (62 commits) sfc: Track RPS flow IDs per channel instead of per function usbnet: smsc95xx: fix link detection for disabled autonegotiation virtio_net: fix virtnet_open and virtnet_probe competing for try_fill_recv bnx2x: avoid leaking memory on bnx2x_init_one() failures fou: fix IPv6 Kconfig options openvswitch: update checksum in {push,pop}_mpls sctp: sctp_diag should dump sctp socket type net: fec: update dirty_tx even if no skb vlan: Propagate MAC address to VLANs atm: iphase: off by one in rx_pkt() atm: firestream: add more reserved strings vxlan: Accept user specified MTU value when create new vxlan link net: pktgen: Call destroy_hrtimer_on_stack() timer: Export destroy_hrtimer_on_stack() net: l2tp: Make l2tp_ip6 namespace aware Documentation: ip-sysctl.txt: clarify secure_redirects sfc: use flow dissector helpers for aRFS ieee802154: fix logic error in ieee802154_llsec_parse_dev_addr net: nps_enet: Disable interrupts before napi reschedule net/lapb: tuse %*ph to dump buffers ...
2 parents 58c1f99 + faf8dcc commit 6b15d66

Some content is hidden

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

67 files changed

+580
-262
lines changed

Documentation/networking/dsa/dsa.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ does not allocate any driver private context space.
369369
Switch configuration
370370
--------------------
371371

372-
- priv_size: additional size needed by the switch driver for its private context
373-
374372
- tag_protocol: this is to indicate what kind of tagging protocol is supported,
375373
should be a valid value from the dsa_tag_protocol enum
376374

@@ -416,11 +414,6 @@ PHY devices and link management
416414
to the switch port MDIO registers. If unavailable return a negative error
417415
code.
418416

419-
- poll_link: Function invoked by DSA to query the link state of the switch
420-
builtin Ethernet PHYs, per port. This function is responsible for calling
421-
netif_carrier_{on,off} when appropriate, and can be used to poll all ports in a
422-
single call. Executes from workqueue context.
423-
424417
- adjust_link: Function invoked by the PHY library when a slave network device
425418
is attached to a PHY device. This function is responsible for appropriately
426419
configuring the switch port link parameters: speed, duplex, pause based on
@@ -542,6 +535,16 @@ Bridge layer
542535
Bridge VLAN filtering
543536
---------------------
544537

538+
- port_vlan_filtering: bridge layer function invoked when the bridge gets
539+
configured for turning on or off VLAN filtering. If nothing specific needs to
540+
be done at the hardware level, this callback does not need to be implemented.
541+
When VLAN filtering is turned on, the hardware must be programmed with
542+
rejecting 802.1Q frames which have VLAN IDs outside of the programmed allowed
543+
VLAN ID map/rules. If there is no PVID programmed into the switch port,
544+
untagged frames must be rejected as well. When turned off the switch must
545+
accept any 802.1Q frames irrespective of their VLAN ID, and untagged frames are
546+
allowed.
547+
545548
- port_vlan_prepare: bridge layer function invoked when the bridge prepares the
546549
configuration of a VLAN on the given port. If the operation is not supported
547550
by the hardware, this function should return -EOPNOTSUPP to inform the bridge

Documentation/networking/ip-sysctl.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,15 +1036,17 @@ proxy_arp_pvlan - BOOLEAN
10361036

10371037
shared_media - BOOLEAN
10381038
Send(router) or accept(host) RFC1620 shared media redirects.
1039-
Overrides ip_secure_redirects.
1039+
Overrides secure_redirects.
10401040
shared_media for the interface will be enabled if at least one of
10411041
conf/{all,interface}/shared_media is set to TRUE,
10421042
it will be disabled otherwise
10431043
default TRUE
10441044

10451045
secure_redirects - BOOLEAN
1046-
Accept ICMP redirect messages only for gateways,
1047-
listed in default gateway list.
1046+
Accept ICMP redirect messages only to gateways listed in the
1047+
interface's current gateway list. Even if disabled, RFC1122 redirect
1048+
rules still apply.
1049+
Overridden by shared_media.
10481050
secure_redirects for the interface will be enabled if at least one of
10491051
conf/{all,interface}/secure_redirects is set to TRUE,
10501052
it will be disabled otherwise

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7989,6 +7989,7 @@ Q: http://patchwork.ozlabs.org/project/netdev/list/
79897989
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
79907990
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
79917991
S: Odd Fixes
7992+
F: Documentation/devicetree/bindings/net/
79927993
F: drivers/net/
79937994
F: include/linux/if_*
79947995
F: include/linux/netdevice.h

drivers/atm/firestream.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,17 @@ static char *res_strings[] = {
181181
"reserved 27",
182182
"reserved 28",
183183
"reserved 29",
184-
"reserved 30",
184+
"reserved 30", /* FIXME: The strings between 30-40 might be wrong. */
185185
"reassembly abort: no buffers",
186186
"receive buffer overflow",
187187
"change in GFC",
188188
"receive buffer full",
189189
"low priority discard - no receive descriptor",
190190
"low priority discard - missing end of packet",
191+
"reserved 37",
192+
"reserved 38",
193+
"reserved 39",
194+
"reseverd 40",
191195
"reserved 41",
192196
"reserved 42",
193197
"reserved 43",

drivers/atm/iphase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ static int rx_pkt(struct atm_dev *dev)
11281128
/* make the ptr point to the corresponding buffer desc entry */
11291129
buf_desc_ptr += desc;
11301130
if (!desc || (desc > iadev->num_rx_desc) ||
1131-
((buf_desc_ptr->vc_index & 0xffff) > iadev->num_vc)) {
1131+
((buf_desc_ptr->vc_index & 0xffff) >= iadev->num_vc)) {
11321132
free_desc(dev, desc);
11331133
IF_ERR(printk("IA: bad descriptor desc = %d \n", desc);)
11341134
return -1;

drivers/net/ethernet/arc/emac_mdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
141141
priv->bus = bus;
142142
bus->priv = priv;
143143
bus->parent = priv->dev;
144-
bus->name = "Synopsys MII Bus",
144+
bus->name = "Synopsys MII Bus";
145145
bus->read = &arc_mdio_read;
146146
bus->write = &arc_mdio_write;
147147
bus->reset = &arc_mdio_reset;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ struct alx_priv {
9696
unsigned int rx_ringsz;
9797
unsigned int rxbuf_size;
9898

99+
struct page *rx_page;
100+
unsigned int rx_page_offset;
101+
unsigned int rx_frag_size;
102+
99103
struct napi_struct napi;
100104
struct alx_tx_queue txq;
101105
struct alx_rx_queue rxq;

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

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,35 @@ static void alx_free_txbuf(struct alx_priv *alx, int entry)
7070
}
7171
}
7272

73+
static struct sk_buff *alx_alloc_skb(struct alx_priv *alx, gfp_t gfp)
74+
{
75+
struct sk_buff *skb;
76+
struct page *page;
77+
78+
if (alx->rx_frag_size > PAGE_SIZE)
79+
return __netdev_alloc_skb(alx->dev, alx->rxbuf_size, gfp);
80+
81+
page = alx->rx_page;
82+
if (!page) {
83+
alx->rx_page = page = alloc_page(gfp);
84+
if (unlikely(!page))
85+
return NULL;
86+
alx->rx_page_offset = 0;
87+
}
88+
89+
skb = build_skb(page_address(page) + alx->rx_page_offset,
90+
alx->rx_frag_size);
91+
if (likely(skb)) {
92+
alx->rx_page_offset += alx->rx_frag_size;
93+
if (alx->rx_page_offset >= PAGE_SIZE)
94+
alx->rx_page = NULL;
95+
else
96+
get_page(page);
97+
}
98+
return skb;
99+
}
100+
101+
73102
static int alx_refill_rx_ring(struct alx_priv *alx, gfp_t gfp)
74103
{
75104
struct alx_rx_queue *rxq = &alx->rxq;
@@ -86,7 +115,7 @@ static int alx_refill_rx_ring(struct alx_priv *alx, gfp_t gfp)
86115
while (!cur_buf->skb && next != rxq->read_idx) {
87116
struct alx_rfd *rfd = &rxq->rfd[cur];
88117

89-
skb = __netdev_alloc_skb(alx->dev, alx->rxbuf_size, gfp);
118+
skb = alx_alloc_skb(alx, gfp);
90119
if (!skb)
91120
break;
92121
dma = dma_map_single(&alx->hw.pdev->dev,
@@ -124,6 +153,7 @@ static int alx_refill_rx_ring(struct alx_priv *alx, gfp_t gfp)
124153
alx_write_mem16(&alx->hw, ALX_RFD_PIDX, cur);
125154
}
126155

156+
127157
return count;
128158
}
129159

@@ -592,6 +622,11 @@ static void alx_free_rings(struct alx_priv *alx)
592622
kfree(alx->txq.bufs);
593623
kfree(alx->rxq.bufs);
594624

625+
if (alx->rx_page) {
626+
put_page(alx->rx_page);
627+
alx->rx_page = NULL;
628+
}
629+
595630
dma_free_coherent(&alx->hw.pdev->dev,
596631
alx->descmem.size,
597632
alx->descmem.virt,
@@ -646,6 +681,7 @@ static int alx_request_irq(struct alx_priv *alx)
646681
alx->dev->name, alx);
647682
if (!err)
648683
goto out;
684+
649685
/* fall back to legacy interrupt */
650686
pci_disable_msi(alx->hw.pdev);
651687
}
@@ -689,6 +725,7 @@ static int alx_init_sw(struct alx_priv *alx)
689725
struct pci_dev *pdev = alx->hw.pdev;
690726
struct alx_hw *hw = &alx->hw;
691727
int err;
728+
unsigned int head_size;
692729

693730
err = alx_identify_hw(alx);
694731
if (err) {
@@ -704,7 +741,12 @@ static int alx_init_sw(struct alx_priv *alx)
704741

705742
hw->smb_timer = 400;
706743
hw->mtu = alx->dev->mtu;
744+
707745
alx->rxbuf_size = ALX_MAX_FRAME_LEN(hw->mtu);
746+
head_size = SKB_DATA_ALIGN(alx->rxbuf_size + NET_SKB_PAD) +
747+
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
748+
alx->rx_frag_size = roundup_pow_of_two(head_size);
749+
708750
alx->tx_ringsz = 256;
709751
alx->rx_ringsz = 512;
710752
hw->imt = 200;
@@ -806,6 +848,7 @@ static int alx_change_mtu(struct net_device *netdev, int mtu)
806848
{
807849
struct alx_priv *alx = netdev_priv(netdev);
808850
int max_frame = ALX_MAX_FRAME_LEN(mtu);
851+
unsigned int head_size;
809852

810853
if ((max_frame < ALX_MIN_FRAME_SIZE) ||
811854
(max_frame > ALX_MAX_FRAME_SIZE))
@@ -817,6 +860,9 @@ static int alx_change_mtu(struct net_device *netdev, int mtu)
817860
netdev->mtu = mtu;
818861
alx->hw.mtu = mtu;
819862
alx->rxbuf_size = max(max_frame, ALX_DEF_RXBUF_SIZE);
863+
head_size = SKB_DATA_ALIGN(alx->rxbuf_size + NET_SKB_PAD) +
864+
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
865+
alx->rx_frag_size = roundup_pow_of_two(head_size);
820866
netdev_update_features(netdev);
821867
if (netif_running(netdev))
822868
alx_reinit(alx);

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13941,14 +13941,14 @@ static int bnx2x_init_one(struct pci_dev *pdev,
1394113941
bp->doorbells = bnx2x_vf_doorbells(bp);
1394213942
rc = bnx2x_vf_pci_alloc(bp);
1394313943
if (rc)
13944-
goto init_one_exit;
13944+
goto init_one_freemem;
1394513945
} else {
1394613946
doorbell_size = BNX2X_L2_MAX_CID(bp) * (1 << BNX2X_DB_SHIFT);
1394713947
if (doorbell_size > pci_resource_len(pdev, 2)) {
1394813948
dev_err(&bp->pdev->dev,
1394913949
"Cannot map doorbells, bar size too small, aborting\n");
1395013950
rc = -ENOMEM;
13951-
goto init_one_exit;
13951+
goto init_one_freemem;
1395213952
}
1395313953
bp->doorbells = ioremap_nocache(pci_resource_start(pdev, 2),
1395413954
doorbell_size);
@@ -13957,19 +13957,19 @@ static int bnx2x_init_one(struct pci_dev *pdev,
1395713957
dev_err(&bp->pdev->dev,
1395813958
"Cannot map doorbell space, aborting\n");
1395913959
rc = -ENOMEM;
13960-
goto init_one_exit;
13960+
goto init_one_freemem;
1396113961
}
1396213962

1396313963
if (IS_VF(bp)) {
1396413964
rc = bnx2x_vfpf_acquire(bp, tx_count, rx_count);
1396513965
if (rc)
13966-
goto init_one_exit;
13966+
goto init_one_freemem;
1396713967
}
1396813968

1396913969
/* Enable SRIOV if capability found in configuration space */
1397013970
rc = bnx2x_iov_init_one(bp, int_mode, BNX2X_MAX_NUM_OF_VFS);
1397113971
if (rc)
13972-
goto init_one_exit;
13972+
goto init_one_freemem;
1397313973

1397413974
/* calc qm_cid_count */
1397513975
bp->qm_cid_count = bnx2x_set_qm_cid_count(bp);
@@ -13988,15 +13988,15 @@ static int bnx2x_init_one(struct pci_dev *pdev,
1398813988
rc = bnx2x_set_int_mode(bp);
1398913989
if (rc) {
1399013990
dev_err(&pdev->dev, "Cannot set interrupts\n");
13991-
goto init_one_exit;
13991+
goto init_one_freemem;
1399213992
}
1399313993
BNX2X_DEV_INFO("set interrupts successfully\n");
1399413994

1399513995
/* register the net device */
1399613996
rc = register_netdev(dev);
1399713997
if (rc) {
1399813998
dev_err(&pdev->dev, "Cannot register net device\n");
13999-
goto init_one_exit;
13999+
goto init_one_freemem;
1400014000
}
1400114001
BNX2X_DEV_INFO("device name after netdev register %s\n", dev->name);
1400214002

@@ -14029,6 +14029,9 @@ static int bnx2x_init_one(struct pci_dev *pdev,
1402914029

1403014030
return 0;
1403114031

14032+
init_one_freemem:
14033+
bnx2x_free_mem_bp(bp);
14034+
1403214035
init_one_exit:
1403314036
bnx2x_disable_pcie_error_reporting(bp);
1403414037

drivers/net/ethernet/ezchip/nps_enet.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,10 @@ static int nps_enet_poll(struct napi_struct *napi, int budget)
205205
* re-adding ourselves to the poll list.
206206
*/
207207

208-
if (priv->tx_skb && !tx_ctrl_ct)
208+
if (priv->tx_skb && !tx_ctrl_ct) {
209+
nps_enet_reg_set(priv, NPS_ENET_REG_BUF_INT_ENABLE, 0);
209210
napi_reschedule(napi);
211+
}
210212
}
211213

212214
return work_done;

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,10 +1197,8 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id)
11971197
fec16_to_cpu(bdp->cbd_datlen),
11981198
DMA_TO_DEVICE);
11991199
bdp->cbd_bufaddr = cpu_to_fec32(0);
1200-
if (!skb) {
1201-
bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
1202-
continue;
1203-
}
1200+
if (!skb)
1201+
goto skb_done;
12041202

12051203
/* Check for errors. */
12061204
if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC |
@@ -1239,7 +1237,7 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id)
12391237

12401238
/* Free the sk buffer associated with this last transmit */
12411239
dev_kfree_skb_any(skb);
1242-
1240+
skb_done:
12431241
/* Make sure the update to bdp and tx_skbuff are performed
12441242
* before dirty_tx
12451243
*/

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ static u32 hns_nic_get_link(struct net_device *net_dev)
4646
u32 link_stat = priv->link;
4747
struct hnae_handle *h;
4848

49-
assert(priv && priv->ae_handle);
5049
h = priv->ae_handle;
5150

5251
if (priv->phy) {
@@ -646,8 +645,6 @@ static void hns_nic_get_drvinfo(struct net_device *net_dev,
646645
{
647646
struct hns_nic_priv *priv = netdev_priv(net_dev);
648647

649-
assert(priv);
650-
651648
strncpy(drvinfo->version, HNAE_DRIVER_VERSION,
652649
sizeof(drvinfo->version));
653650
drvinfo->version[sizeof(drvinfo->version) - 1] = '\0';
@@ -720,8 +717,6 @@ static int hns_set_pauseparam(struct net_device *net_dev,
720717
struct hnae_handle *h;
721718
struct hnae_ae_ops *ops;
722719

723-
assert(priv || priv->ae_handle);
724-
725720
h = priv->ae_handle;
726721
ops = h->dev->ops;
727722

@@ -780,8 +775,6 @@ static int hns_set_coalesce(struct net_device *net_dev,
780775
struct hnae_ae_ops *ops;
781776
int ret;
782777

783-
assert(priv || priv->ae_handle);
784-
785778
ops = priv->ae_handle->dev->ops;
786779

787780
if (ec->tx_coalesce_usecs != ec->rx_coalesce_usecs)
@@ -1111,8 +1104,6 @@ void hns_get_regs(struct net_device *net_dev, struct ethtool_regs *cmd,
11111104
struct hns_nic_priv *priv = netdev_priv(net_dev);
11121105
struct hnae_ae_ops *ops;
11131106

1114-
assert(priv || priv->ae_handle);
1115-
11161107
ops = priv->ae_handle->dev->ops;
11171108

11181109
cmd->version = HNS_CHIP_VERSION;
@@ -1135,8 +1126,6 @@ static int hns_get_regs_len(struct net_device *net_dev)
11351126
struct hns_nic_priv *priv = netdev_priv(net_dev);
11361127
struct hnae_ae_ops *ops;
11371128

1138-
assert(priv || priv->ae_handle);
1139-
11401129
ops = priv->ae_handle->dev->ops;
11411130
if (!ops->get_regs_len) {
11421131
netdev_err(net_dev, "ops->get_regs_len is null!\n");

drivers/net/ethernet/marvell/mvneta_bm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ struct mvneta_bm_pool *mvneta_bm_pool_use(struct mvneta_bm *priv, u8 pool_id,
189189
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
190190
hwbm_pool->construct = mvneta_bm_construct;
191191
hwbm_pool->priv = new_pool;
192+
spin_lock_init(&hwbm_pool->lock);
192193

193194
/* Create new pool */
194195
err = mvneta_bm_pool_create(priv, new_pool);

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static void mlx4_en_get_ethtool_stats(struct net_device *dev,
362362

363363
for (i = 0; i < NUM_MAIN_STATS; i++, bitmap_iterator_inc(&it))
364364
if (bitmap_iterator_test(&it))
365-
data[index++] = ((unsigned long *)&priv->stats)[i];
365+
data[index++] = ((unsigned long *)&dev->stats)[i];
366366

367367
for (i = 0; i < NUM_PORT_STATS; i++, bitmap_iterator_inc(&it))
368368
if (bitmap_iterator_test(&it))

0 commit comments

Comments
 (0)