Skip to content

Commit 9c5d1bc

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) MODULE_FIRMWARE firmware string not correct for iwlwifi 8000 chips, from Sara Sharon. 2) Fix SKB size checks in batman-adv stack on receive, from Sven Eckelmann. 3) Leak fix on mac80211 interface add error paths, from Johannes Berg. 4) Cannot invoke napi_disable() with BH disabled in myri10ge driver, fix from Stanislaw Gruszka. 5) Fix sign extension problem when computing feature masks in net_gso_ok(), from Marcelo Ricardo Leitner. 6) lan78xx driver doesn't count packets and packet lengths in its statistics properly, fix from Woojung Huh. 7) Fix the buffer allocation sizes in pegasus USB driver, from Petko Manolov. 8) Fix refcount overflows in bpf, from Alexei Starovoitov. 9) Unified dst cache handling introduced a preempt warning in ip_tunnel, fix by resetting rather then setting the cached route. From Paolo Abeni. 10) Listener hash collision test fix in soreuseport, from Craig Gallak * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (47 commits) gre: do not pull header in ICMP error processing net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case tipc: only process unicast on intended node cxgb3: fix out of bounds read net/smscx5xx: use the device tree for mac address soreuseport: Fix TCP listener hash collision net: l2tp: fix reversed udp6 checksum flags ip_tunnel: fix preempt warning in ip tunnel creation/updating samples/bpf: fix trace_output example bpf: fix check_map_func_compatibility logic bpf: fix refcnt overflow drivers: net: cpsw: use of_phy_connect() in fixed-link case dt: cpsw: phy-handle, phy_id, and fixed-link are mutually exclusive drivers: net: cpsw: don't ignore phy-mode if phy-handle is used drivers: net: cpsw: fix segfault in case of bad phy-handle drivers: net: cpsw: fix parsing of phy-handle DT property in dual_emac config MAINTAINERS: net: Change maintainer for GRETH 10/100/1G Ethernet MAC device driver gre: reject GUE and FOU in collect metadata mode pegasus: fixes reported packet length pegasus: fixes URB buffer allocation size; ...
2 parents ba22906 + b7f8fe2 commit 9c5d1bc

File tree

47 files changed

+384
-194
lines changed

Some content is hidden

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

47 files changed

+384
-194
lines changed

Documentation/devicetree/bindings/net/cpsw.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ Required properties:
4545
Optional properties:
4646
- dual_emac_res_vlan : Specifies VID to be used to segregate the ports
4747
- mac-address : See ethernet.txt file in the same directory
48-
- phy_id : Specifies slave phy id
48+
- phy_id : Specifies slave phy id (deprecated, use phy-handle)
4949
- phy-handle : See ethernet.txt file in the same directory
5050

5151
Slave sub-nodes:
5252
- fixed-link : See fixed-link.txt file in the same directory
53-
Either the property phy_id, or the sub-node
54-
fixed-link can be specified
53+
54+
Note: Exactly one of phy_id, phy-handle, or fixed-link must be specified.
5555

5656
Note: "ti,hwmods" field is used to fetch the base address and irq
5757
resources from TI, omap hwmod data base during device registration.

Documentation/networking/altera_tse.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the driver for the Altera Triple-Speed Ethernet (TSE) controllers
66
using the SGDMA and MSGDMA soft DMA IP components. The driver uses the
77
platform bus to obtain component resources. The designs used to test this
88
driver were built for a Cyclone(R) V SOC FPGA board, a Cyclone(R) V FPGA board,
9-
and tested with ARM and NIOS processor hosts seperately. The anticipated use
9+
and tested with ARM and NIOS processor hosts separately. The anticipated use
1010
cases are simple communications between an embedded system and an external peer
1111
for status and simple configuration of the embedded system.
1212

@@ -65,14 +65,14 @@ Driver parameters can be also passed in command line by using:
6565
4.1) Transmit process
6666
When the driver's transmit routine is called by the kernel, it sets up a
6767
transmit descriptor by calling the underlying DMA transmit routine (SGDMA or
68-
MSGDMA), and initites a transmit operation. Once the transmit is complete, an
68+
MSGDMA), and initiates a transmit operation. Once the transmit is complete, an
6969
interrupt is driven by the transmit DMA logic. The driver handles the transmit
7070
completion in the context of the interrupt handling chain by recycling
7171
resource required to send and track the requested transmit operation.
7272

7373
4.2) Receive process
7474
The driver will post receive buffers to the receive DMA logic during driver
75-
intialization. Receive buffers may or may not be queued depending upon the
75+
initialization. Receive buffers may or may not be queued depending upon the
7676
underlying DMA logic (MSGDMA is able queue receive buffers, SGDMA is not able
7777
to queue receive buffers to the SGDMA receive logic). When a packet is
7878
received, the DMA logic generates an interrupt. The driver handles a receive

Documentation/networking/ipvlan.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Initial Release:
88
This is conceptually very similar to the macvlan driver with one major
99
exception of using L3 for mux-ing /demux-ing among slaves. This property makes
1010
the master device share the L2 with it's slave devices. I have developed this
11-
driver in conjuntion with network namespaces and not sure if there is use case
11+
driver in conjunction with network namespaces and not sure if there is use case
1212
outside of it.
1313

1414

@@ -42,7 +42,7 @@ out. In this mode the slaves will RX/TX multicast and broadcast (if applicable)
4242
as well.
4343

4444
4.2 L3 mode:
45-
In this mode TX processing upto L3 happens on the stack instance attached
45+
In this mode TX processing up to L3 happens on the stack instance attached
4646
to the slave device and packets are switched to the stack instance of the
4747
master device for the L2 processing and routing from that instance will be
4848
used before packets are queued on the outbound device. In this mode the slaves
@@ -56,7 +56,7 @@ situations defines your use case then you can choose to use ipvlan -
5656
(a) The Linux host that is connected to the external switch / router has
5757
policy configured that allows only one mac per port.
5858
(b) No of virtual devices created on a master exceed the mac capacity and
59-
puts the NIC in promiscous mode and degraded performance is a concern.
59+
puts the NIC in promiscuous mode and degraded performance is a concern.
6060
(c) If the slave device is to be put into the hostile / untrusted network
6161
namespace where L2 on the slave could be changed / misused.
6262

Documentation/networking/pktgen.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ The two basic thread commands are:
6767
* add_device DEVICE@NAME -- adds a single device
6868
* rem_device_all -- remove all associated devices
6969

70-
When adding a device to a thread, a corrosponding procfile is created
70+
When adding a device to a thread, a corresponding procfile is created
7171
which is used for configuring this device. Thus, device names need to
7272
be unique.
7373

7474
To support adding the same device to multiple threads, which is useful
75-
with multi queue NICs, a the device naming scheme is extended with "@":
75+
with multi queue NICs, the device naming scheme is extended with "@":
7676
device@something
7777

7878
The part after "@" can be anything, but it is custom to use the thread
@@ -221,7 +221,7 @@ Sample scripts
221221

222222
A collection of tutorial scripts and helpers for pktgen is in the
223223
samples/pktgen directory. The helper parameters.sh file support easy
224-
and consistant parameter parsing across the sample scripts.
224+
and consistent parameter parsing across the sample scripts.
225225

226226
Usage example and help:
227227
./pktgen_sample01_simple.sh -i eth4 -m 00:1B:21:3C:9D:F8 -d 192.168.8.2

Documentation/networking/vrf.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ using an rx_handler which gives the impression that packets flow through
4141
the VRF device. Similarly on egress routing rules are used to send packets
4242
to the VRF device driver before getting sent out the actual interface. This
4343
allows tcpdump on a VRF device to capture all packets into and out of the
44-
VRF as a whole.[1] Similiarly, netfilter [2] and tc rules can be applied
44+
VRF as a whole.[1] Similarly, netfilter [2] and tc rules can be applied
4545
using the VRF device to specify rules that apply to the VRF domain as a whole.
4646

4747
[1] Packets in the forwarded state do not flow through the device, so those

Documentation/networking/xfrm_sync.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Krisztian <hidden@balabit.hu> and others and additional patches
44
from Jamal <hadi@cyberus.ca>.
55

66
The end goal for syncing is to be able to insert attributes + generate
7-
events so that the an SA can be safely moved from one machine to another
7+
events so that the SA can be safely moved from one machine to another
88
for HA purposes.
99
The idea is to synchronize the SA so that the takeover machine can do
1010
the processing of the SA as accurate as possible if it has access to it.
@@ -13,7 +13,7 @@ We already have the ability to generate SA add/del/upd events.
1313
These patches add ability to sync and have accurate lifetime byte (to
1414
ensure proper decay of SAs) and replay counters to avoid replay attacks
1515
with as minimal loss at failover time.
16-
This way a backup stays as closely uptodate as an active member.
16+
This way a backup stays as closely up-to-date as an active member.
1717

1818
Because the above items change for every packet the SA receives,
1919
it is possible for a lot of the events to be generated.
@@ -163,7 +163,7 @@ If you have an SA that is getting hit by traffic in bursts such that
163163
there is a period where the timer threshold expires with no packets
164164
seen, then an odd behavior is seen as follows:
165165
The first packet arrival after a timer expiry will trigger a timeout
166-
aevent; i.e we dont wait for a timeout period or a packet threshold
166+
event; i.e we don't wait for a timeout period or a packet threshold
167167
to be reached. This is done for simplicity and efficiency reasons.
168168

169169
-JHS

MAINTAINERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4903,7 +4903,7 @@ F: net/ipv4/gre_offload.c
49034903
F: include/net/gre.h
49044904

49054905
GRETH 10/100/1G Ethernet MAC device driver
4906-
M: Kristoffer Glembo <kristoffer@gaisler.com>
4906+
M: Andreas Larsson <andreas@gaisler.com>
49074907
L: netdev@vger.kernel.org
49084908
S: Maintained
49094909
F: drivers/net/ethernet/aeroflex/
@@ -10014,7 +10014,8 @@ F: drivers/infiniband/hw/ocrdma/
1001410014

1001510015
SFC NETWORK DRIVER
1001610016
M: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
10017-
M: Shradha Shah <sshah@solarflare.com>
10017+
M: Edward Cree <ecree@solarflare.com>
10018+
M: Bert Kenward <bkenward@solarflare.com>
1001810019
L: netdev@vger.kernel.org
1001910020
S: Supported
1002010021
F: drivers/net/ethernet/sfc/

drivers/net/dsa/mv88e6xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,7 @@ int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
21812181
struct net_device *bridge)
21822182
{
21832183
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
2184-
int i, err;
2184+
int i, err = 0;
21852185

21862186
mutex_lock(&ps->smi_mutex);
21872187

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

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,30 @@ static inline int bnxt_alloc_rx_page(struct bnxt *bp,
581581
struct page *page;
582582
dma_addr_t mapping;
583583
u16 sw_prod = rxr->rx_sw_agg_prod;
584+
unsigned int offset = 0;
584585

585-
page = alloc_page(gfp);
586-
if (!page)
587-
return -ENOMEM;
586+
if (PAGE_SIZE > BNXT_RX_PAGE_SIZE) {
587+
page = rxr->rx_page;
588+
if (!page) {
589+
page = alloc_page(gfp);
590+
if (!page)
591+
return -ENOMEM;
592+
rxr->rx_page = page;
593+
rxr->rx_page_offset = 0;
594+
}
595+
offset = rxr->rx_page_offset;
596+
rxr->rx_page_offset += BNXT_RX_PAGE_SIZE;
597+
if (rxr->rx_page_offset == PAGE_SIZE)
598+
rxr->rx_page = NULL;
599+
else
600+
get_page(page);
601+
} else {
602+
page = alloc_page(gfp);
603+
if (!page)
604+
return -ENOMEM;
605+
}
588606

589-
mapping = dma_map_page(&pdev->dev, page, 0, PAGE_SIZE,
607+
mapping = dma_map_page(&pdev->dev, page, offset, BNXT_RX_PAGE_SIZE,
590608
PCI_DMA_FROMDEVICE);
591609
if (dma_mapping_error(&pdev->dev, mapping)) {
592610
__free_page(page);
@@ -601,6 +619,7 @@ static inline int bnxt_alloc_rx_page(struct bnxt *bp,
601619
rxr->rx_sw_agg_prod = NEXT_RX_AGG(sw_prod);
602620

603621
rx_agg_buf->page = page;
622+
rx_agg_buf->offset = offset;
604623
rx_agg_buf->mapping = mapping;
605624
rxbd->rx_bd_haddr = cpu_to_le64(mapping);
606625
rxbd->rx_bd_opaque = sw_prod;
@@ -642,6 +661,7 @@ static void bnxt_reuse_rx_agg_bufs(struct bnxt_napi *bnapi, u16 cp_cons,
642661
page = cons_rx_buf->page;
643662
cons_rx_buf->page = NULL;
644663
prod_rx_buf->page = page;
664+
prod_rx_buf->offset = cons_rx_buf->offset;
645665

646666
prod_rx_buf->mapping = cons_rx_buf->mapping;
647667

@@ -709,7 +729,8 @@ static struct sk_buff *bnxt_rx_pages(struct bnxt *bp, struct bnxt_napi *bnapi,
709729
RX_AGG_CMP_LEN) >> RX_AGG_CMP_LEN_SHIFT;
710730

711731
cons_rx_buf = &rxr->rx_agg_ring[cons];
712-
skb_fill_page_desc(skb, i, cons_rx_buf->page, 0, frag_len);
732+
skb_fill_page_desc(skb, i, cons_rx_buf->page,
733+
cons_rx_buf->offset, frag_len);
713734
__clear_bit(cons, rxr->rx_agg_bmap);
714735

715736
/* It is possible for bnxt_alloc_rx_page() to allocate
@@ -740,7 +761,7 @@ static struct sk_buff *bnxt_rx_pages(struct bnxt *bp, struct bnxt_napi *bnapi,
740761
return NULL;
741762
}
742763

743-
dma_unmap_page(&pdev->dev, mapping, PAGE_SIZE,
764+
dma_unmap_page(&pdev->dev, mapping, BNXT_RX_PAGE_SIZE,
744765
PCI_DMA_FROMDEVICE);
745766

746767
skb->data_len += frag_len;
@@ -1584,13 +1605,17 @@ static void bnxt_free_rx_skbs(struct bnxt *bp)
15841605

15851606
dma_unmap_page(&pdev->dev,
15861607
dma_unmap_addr(rx_agg_buf, mapping),
1587-
PAGE_SIZE, PCI_DMA_FROMDEVICE);
1608+
BNXT_RX_PAGE_SIZE, PCI_DMA_FROMDEVICE);
15881609

15891610
rx_agg_buf->page = NULL;
15901611
__clear_bit(j, rxr->rx_agg_bmap);
15911612

15921613
__free_page(page);
15931614
}
1615+
if (rxr->rx_page) {
1616+
__free_page(rxr->rx_page);
1617+
rxr->rx_page = NULL;
1618+
}
15941619
}
15951620
}
15961621

@@ -1973,7 +1998,7 @@ static int bnxt_init_one_rx_ring(struct bnxt *bp, int ring_nr)
19731998
if (!(bp->flags & BNXT_FLAG_AGG_RINGS))
19741999
return 0;
19752000

1976-
type = ((u32)PAGE_SIZE << RX_BD_LEN_SHIFT) |
2001+
type = ((u32)BNXT_RX_PAGE_SIZE << RX_BD_LEN_SHIFT) |
19772002
RX_BD_TYPE_RX_AGG_BD | RX_BD_FLAGS_SOP;
19782003

19792004
bnxt_init_rxbd_pages(ring, type);
@@ -2164,7 +2189,7 @@ void bnxt_set_ring_params(struct bnxt *bp)
21642189
bp->rx_agg_nr_pages = 0;
21652190

21662191
if (bp->flags & BNXT_FLAG_TPA)
2167-
agg_factor = 4;
2192+
agg_factor = min_t(u32, 4, 65536 / BNXT_RX_PAGE_SIZE);
21682193

21692194
bp->flags &= ~BNXT_FLAG_JUMBO;
21702195
if (rx_space > PAGE_SIZE) {
@@ -3020,12 +3045,12 @@ static int bnxt_hwrm_vnic_set_tpa(struct bnxt *bp, u16 vnic_id, u32 tpa_flags)
30203045
/* Number of segs are log2 units, and first packet is not
30213046
* included as part of this units.
30223047
*/
3023-
if (mss <= PAGE_SIZE) {
3024-
n = PAGE_SIZE / mss;
3048+
if (mss <= BNXT_RX_PAGE_SIZE) {
3049+
n = BNXT_RX_PAGE_SIZE / mss;
30253050
nsegs = (MAX_SKB_FRAGS - 1) * n;
30263051
} else {
3027-
n = mss / PAGE_SIZE;
3028-
if (mss & (PAGE_SIZE - 1))
3052+
n = mss / BNXT_RX_PAGE_SIZE;
3053+
if (mss & (BNXT_RX_PAGE_SIZE - 1))
30293054
n++;
30303055
nsegs = (MAX_SKB_FRAGS - n) / n;
30313056
}
@@ -4309,7 +4334,7 @@ static int bnxt_setup_int_mode(struct bnxt *bp)
43094334
if (bp->flags & BNXT_FLAG_MSIX_CAP)
43104335
rc = bnxt_setup_msix(bp);
43114336

4312-
if (!(bp->flags & BNXT_FLAG_USING_MSIX)) {
4337+
if (!(bp->flags & BNXT_FLAG_USING_MSIX) && BNXT_PF(bp)) {
43134338
/* fallback to INTA */
43144339
rc = bnxt_setup_inta(bp);
43154340
}

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,15 @@ struct rx_tpa_end_cmp_ext {
407407

408408
#define BNXT_PAGE_SIZE (1 << BNXT_PAGE_SHIFT)
409409

410+
/* The RXBD length is 16-bit so we can only support page sizes < 64K */
411+
#if (PAGE_SHIFT > 15)
412+
#define BNXT_RX_PAGE_SHIFT 15
413+
#else
414+
#define BNXT_RX_PAGE_SHIFT PAGE_SHIFT
415+
#endif
416+
417+
#define BNXT_RX_PAGE_SIZE (1 << BNXT_RX_PAGE_SHIFT)
418+
410419
#define BNXT_MIN_PKT_SIZE 45
411420

412421
#define BNXT_NUM_TESTS(bp) 0
@@ -506,6 +515,7 @@ struct bnxt_sw_rx_bd {
506515

507516
struct bnxt_sw_rx_agg_bd {
508517
struct page *page;
518+
unsigned int offset;
509519
dma_addr_t mapping;
510520
};
511521

@@ -586,6 +596,9 @@ struct bnxt_rx_ring_info {
586596
unsigned long *rx_agg_bmap;
587597
u16 rx_agg_bmap_size;
588598

599+
struct page *rx_page;
600+
unsigned int rx_page_offset;
601+
589602
dma_addr_t rx_desc_mapping[MAX_RX_PAGES];
590603
dma_addr_t rx_agg_desc_mapping[MAX_RX_AGG_PAGES];
591604

drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ static void setup_rss(struct adapter *adap)
576576
unsigned int nq0 = adap2pinfo(adap, 0)->nqsets;
577577
unsigned int nq1 = adap->port[1] ? adap2pinfo(adap, 1)->nqsets : 1;
578578
u8 cpus[SGE_QSETS + 1];
579-
u16 rspq_map[RSS_TABLE_SIZE];
579+
u16 rspq_map[RSS_TABLE_SIZE + 1];
580580

581581
for (i = 0; i < SGE_QSETS; ++i)
582582
cpus[i] = i;
@@ -586,6 +586,7 @@ static void setup_rss(struct adapter *adap)
586586
rspq_map[i] = i % nq0;
587587
rspq_map[i + RSS_TABLE_SIZE / 2] = (i % nq1) + nq0;
588588
}
589+
rspq_map[RSS_TABLE_SIZE] = 0xffff; /* terminator */
589590

590591
t3_config_rss(adap, F_RQFEEDBACKENABLE | F_TNLLKPEN | F_TNLMAPEN |
591592
F_TNLPRTEN | F_TNL2TUPEN | F_TNL4TUPEN |

drivers/net/ethernet/myricom/myri10ge/myri10ge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,9 +2668,9 @@ static int myri10ge_close(struct net_device *dev)
26682668

26692669
del_timer_sync(&mgp->watchdog_timer);
26702670
mgp->running = MYRI10GE_ETH_STOPPING;
2671-
local_bh_disable(); /* myri10ge_ss_lock_napi needs bh disabled */
26722671
for (i = 0; i < mgp->num_slices; i++) {
26732672
napi_disable(&mgp->ss[i].napi);
2673+
local_bh_disable(); /* myri10ge_ss_lock_napi needs this */
26742674
/* Lock the slice to prevent the busy_poll handler from
26752675
* accessing it. Later when we bring the NIC up, myri10ge_open
26762676
* resets the slice including this lock.
@@ -2679,8 +2679,8 @@ static int myri10ge_close(struct net_device *dev)
26792679
pr_info("Slice %d locked\n", i);
26802680
mdelay(1);
26812681
}
2682+
local_bh_enable();
26822683
}
2683-
local_bh_enable();
26842684
netif_carrier_off(dev);
26852685

26862686
netif_tx_stop_all_queues(dev);

0 commit comments

Comments
 (0)