Skip to content

Commit 531e93d

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: "I was battling a cold after some recent trips, so quite a bit piled up meanwhile, sorry about that. Highlights: 1) Fix fd leak in various bpf selftests, from Brian Vazquez. 2) Fix crash in xsk when device doesn't support some methods, from Magnus Karlsson. 3) Fix various leaks and use-after-free in rxrpc, from David Howells. 4) Fix several SKB leaks due to confusion of who owns an SKB and who should release it in the llc code. From Eric Biggers. 5) Kill a bunc of KCSAN warnings in TCP, from Eric Dumazet. 6) Jumbo packets don't work after resume on r8169, as the BIOS resets the chip into non-jumbo mode during suspend. From Heiner Kallweit. 7) Corrupt L2 header during MPLS push, from Davide Caratti. 8) Prevent possible infinite loop in tc_ctl_action, from Eric Dumazet. 9) Get register bits right in bcmgenet driver, based upon chip version. From Florian Fainelli. 10) Fix mutex problems in microchip DSA driver, from Marek Vasut. 11) Cure race between route lookup and invalidation in ipv4, from Wei Wang. 12) Fix performance regression due to false sharing in 'net' structure, from Eric Dumazet" * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (145 commits) net: reorder 'struct net' fields to avoid false sharing net: dsa: fix switch tree list net: ethernet: dwmac-sun8i: show message only when switching to promisc net: aquantia: add an error handling in aq_nic_set_multicast_list net: netem: correct the parent's backlog when corrupted packet was dropped net: netem: fix error path for corrupted GSO frames macb: propagate errors when getting optional clocks xen/netback: fix error path of xenvif_connect_data() net: hns3: fix mis-counting IRQ vector numbers issue net: usb: lan78xx: Connect PHY before registering MAC vsock/virtio: discard packets if credit is not respected vsock/virtio: send a credit update when buffer size is changed mlxsw: spectrum_trap: Push Ethernet header before reporting trap net: ensure correct skb->tstamp in various fragmenters net: bcmgenet: reset 40nm EPHY on energy detect net: bcmgenet: soft reset 40nm EPHYs before MAC init net: phy: bcm7xxx: define soft_reset for 40nm EPHY net: bcmgenet: don't set phydev->link from MAC net: Update address for MediaTek ethernet driver in MAINTAINERS ipv4: fix race condition between route lookup and invalidation ...
2 parents 998d755 + 2a06b89 commit 531e93d

File tree

179 files changed

+1486
-892
lines changed

Some content is hidden

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

179 files changed

+1486
-892
lines changed

Documentation/networking/device_drivers/pensando/ionic.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ Support
3636
=======
3737
For general Linux networking support, please use the netdev mailing
3838
list, which is monitored by Pensando personnel::
39+
3940
4041

4142
For more specific support needs, please use the Pensando driver support
4243
email::
43-
44+
45+

Documentation/networking/net_dim.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ under some conditions.
9292
Part III: Registering a Network Device to DIM
9393
==============================================
9494

95-
Net DIM API exposes the main function net_dim(struct net_dim *dim,
96-
struct net_dim_sample end_sample). This function is the entry point to the Net
95+
Net DIM API exposes the main function net_dim(struct dim *dim,
96+
struct dim_sample end_sample). This function is the entry point to the Net
9797
DIM algorithm and has to be called every time the driver would like to check if
9898
it should change interrupt moderation parameters. The driver should provide two
99-
data structures: struct net_dim and struct net_dim_sample. Struct net_dim
99+
data structures: struct dim and struct dim_sample. Struct dim
100100
describes the state of DIM for a specific object (RX queue, TX queue,
101101
other queues, etc.). This includes the current selected profile, previous data
102102
samples, the callback function provided by the driver and more.
103-
Struct net_dim_sample describes a data sample, which will be compared to the
104-
data sample stored in struct net_dim in order to decide on the algorithm's next
103+
Struct dim_sample describes a data sample, which will be compared to the
104+
data sample stored in struct dim in order to decide on the algorithm's next
105105
step. The sample should include bytes, packets and interrupts, measured by
106106
the driver.
107107

@@ -110,9 +110,9 @@ main net_dim() function. The recommended method is to call net_dim() on each
110110
interrupt. Since Net DIM has a built-in moderation and it might decide to skip
111111
iterations under certain conditions, there is no need to moderate the net_dim()
112112
calls as well. As mentioned above, the driver needs to provide an object of type
113-
struct net_dim to the net_dim() function call. It is advised for each entity
114-
using Net DIM to hold a struct net_dim as part of its data structure and use it
115-
as the main Net DIM API object. The struct net_dim_sample should hold the latest
113+
struct dim to the net_dim() function call. It is advised for each entity
114+
using Net DIM to hold a struct dim as part of its data structure and use it
115+
as the main Net DIM API object. The struct dim_sample should hold the latest
116116
bytes, packets and interrupts count. No need to perform any calculations, just
117117
include the raw data.
118118

@@ -132,33 +132,33 @@ usage is not complete but it should make the outline of the usage clear.
132132

133133
my_driver.c:
134134

135-
#include <linux/net_dim.h>
135+
#include <linux/dim.h>
136136

137137
/* Callback for net DIM to schedule on a decision to change moderation */
138138
void my_driver_do_dim_work(struct work_struct *work)
139139
{
140-
/* Get struct net_dim from struct work_struct */
141-
struct net_dim *dim = container_of(work, struct net_dim,
142-
work);
140+
/* Get struct dim from struct work_struct */
141+
struct dim *dim = container_of(work, struct dim,
142+
work);
143143
/* Do interrupt moderation related stuff */
144144
...
145145

146146
/* Signal net DIM work is done and it should move to next iteration */
147-
dim->state = NET_DIM_START_MEASURE;
147+
dim->state = DIM_START_MEASURE;
148148
}
149149

150150
/* My driver's interrupt handler */
151151
int my_driver_handle_interrupt(struct my_driver_entity *my_entity, ...)
152152
{
153153
...
154154
/* A struct to hold current measured data */
155-
struct net_dim_sample dim_sample;
155+
struct dim_sample dim_sample;
156156
...
157157
/* Initiate data sample struct with current data */
158-
net_dim_sample(my_entity->events,
159-
my_entity->packets,
160-
my_entity->bytes,
161-
&dim_sample);
158+
dim_update_sample(my_entity->events,
159+
my_entity->packets,
160+
my_entity->bytes,
161+
&dim_sample);
162162
/* Call net DIM */
163163
net_dim(&my_entity->dim, dim_sample);
164164
...

MAINTAINERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9122,7 +9122,7 @@ F: drivers/auxdisplay/ks0108.c
91229122
F: include/linux/ks0108.h
91239123

91249124
L3MDEV
9125-
M: David Ahern <[email protected]>
9125+
M: David Ahern <[email protected]>
91269126
91279127
S: Maintained
91289128
F: net/l3mdev
@@ -10255,7 +10255,7 @@ MEDIATEK ETHERNET DRIVER
1025510255
M: Felix Fietkau <[email protected]>
1025610256
M: John Crispin <[email protected]>
1025710257
M: Sean Wang <[email protected]>
10258-
M: Nelson Chang <nelson.chang@mediatek.com>
10258+
M: Mark Lee <Mark-MC.Lee@mediatek.com>
1025910259
1026010260
S: Maintained
1026110261
F: drivers/net/ethernet/mediatek/
@@ -17433,7 +17433,7 @@ F: include/linux/regulator/
1743317433
K: regulator_get_optional
1743417434

1743517435
VRF
17436-
M: David Ahern <[email protected]>
17436+
M: David Ahern <[email protected]>
1743717437
M: Shrijeet Mukherjee <[email protected]>
1743817438
1743917439
S: Maintained

arch/arm/boot/dts/mt7629-rfb.dts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,21 @@
6666
pinctrl-1 = <&ephy_leds_pins>;
6767
status = "okay";
6868

69+
gmac0: mac@0 {
70+
compatible = "mediatek,eth-mac";
71+
reg = <0>;
72+
phy-mode = "2500base-x";
73+
fixed-link {
74+
speed = <2500>;
75+
full-duplex;
76+
pause;
77+
};
78+
};
79+
6980
gmac1: mac@1 {
7081
compatible = "mediatek,eth-mac";
7182
reg = <1>;
83+
phy-mode = "gmii";
7284
phy-handle = <&phy0>;
7385
};
7486

@@ -78,7 +90,6 @@
7890

7991
phy0: ethernet-phy@0 {
8092
reg = <0>;
81-
phy-mode = "gmii";
8293
};
8394
};
8495
};

arch/arm/boot/dts/mt7629.dtsi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,14 +468,12 @@
468468
compatible = "mediatek,mt7629-sgmiisys", "syscon";
469469
reg = <0x1b128000 0x3000>;
470470
#clock-cells = <1>;
471-
mediatek,physpeed = "2500";
472471
};
473472

474473
sgmiisys1: syscon@1b130000 {
475474
compatible = "mediatek,mt7629-sgmiisys", "syscon";
476475
reg = <0x1b130000 0x3000>;
477476
#clock-cells = <1>;
478-
mediatek,physpeed = "2500";
479477
};
480478
};
481479
};

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4039,7 +4039,7 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave)
40394039
* this to-be-skipped slave to send a packet out.
40404040
*/
40414041
old_arr = rtnl_dereference(bond->slave_arr);
4042-
for (idx = 0; idx < old_arr->count; idx++) {
4042+
for (idx = 0; old_arr != NULL && idx < old_arr->count; idx++) {
40434043
if (skipslave == old_arr->arr[idx]) {
40444044
old_arr->arr[idx] =
40454045
old_arr->arr[old_arr->count-1];

drivers/net/dsa/b53/b53_common.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,6 @@ int b53_mirror_add(struct dsa_switch *ds, int port,
18451845
loc = B53_EG_MIR_CTL;
18461846

18471847
b53_read16(dev, B53_MGMT_PAGE, loc, &reg);
1848-
reg &= ~MIRROR_MASK;
18491848
reg |= BIT(port);
18501849
b53_write16(dev, B53_MGMT_PAGE, loc, reg);
18511850

drivers/net/dsa/microchip/ksz8795.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,10 +1224,6 @@ static int ksz8795_switch_init(struct ksz_device *dev)
12241224
{
12251225
int i;
12261226

1227-
mutex_init(&dev->stats_mutex);
1228-
mutex_init(&dev->alu_mutex);
1229-
mutex_init(&dev->vlan_mutex);
1230-
12311227
dev->ds->ops = &ksz8795_switch_ops;
12321228

12331229
for (i = 0; i < ARRAY_SIZE(ksz8795_switch_chips); i++) {

drivers/net/dsa/microchip/ksz8795_spi.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ KSZ_REGMAP_TABLE(ksz8795, 16, SPI_ADDR_SHIFT,
2525

2626
static int ksz8795_spi_probe(struct spi_device *spi)
2727
{
28+
struct regmap_config rc;
2829
struct ksz_device *dev;
2930
int i, ret;
3031

@@ -33,9 +34,9 @@ static int ksz8795_spi_probe(struct spi_device *spi)
3334
return -ENOMEM;
3435

3536
for (i = 0; i < ARRAY_SIZE(ksz8795_regmap_config); i++) {
36-
dev->regmap[i] = devm_regmap_init_spi(spi,
37-
&ksz8795_regmap_config
38-
[i]);
37+
rc = ksz8795_regmap_config[i];
38+
rc.lock_arg = &dev->regmap_mutex;
39+
dev->regmap[i] = devm_regmap_init_spi(spi, &rc);
3940
if (IS_ERR(dev->regmap[i])) {
4041
ret = PTR_ERR(dev->regmap[i]);
4142
dev_err(&spi->dev,

drivers/net/dsa/microchip/ksz9477_i2c.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ KSZ_REGMAP_TABLE(ksz9477, not_used, 16, 0, 0);
1717
static int ksz9477_i2c_probe(struct i2c_client *i2c,
1818
const struct i2c_device_id *i2c_id)
1919
{
20+
struct regmap_config rc;
2021
struct ksz_device *dev;
2122
int i, ret;
2223

@@ -25,8 +26,9 @@ static int ksz9477_i2c_probe(struct i2c_client *i2c,
2526
return -ENOMEM;
2627

2728
for (i = 0; i < ARRAY_SIZE(ksz9477_regmap_config); i++) {
28-
dev->regmap[i] = devm_regmap_init_i2c(i2c,
29-
&ksz9477_regmap_config[i]);
29+
rc = ksz9477_regmap_config[i];
30+
rc.lock_arg = &dev->regmap_mutex;
31+
dev->regmap[i] = devm_regmap_init_i2c(i2c, &rc);
3032
if (IS_ERR(dev->regmap[i])) {
3133
ret = PTR_ERR(dev->regmap[i]);
3234
dev_err(&i2c->dev,

drivers/net/dsa/microchip/ksz9477_reg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* SPDX-License-Identifier: GPL-2.0
2-
*
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
33
* Microchip KSZ9477 register definitions
44
*
55
* Copyright (C) 2017-2018 Microchip Technology Inc.

drivers/net/dsa/microchip/ksz9477_spi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ KSZ_REGMAP_TABLE(ksz9477, 32, SPI_ADDR_SHIFT,
2424

2525
static int ksz9477_spi_probe(struct spi_device *spi)
2626
{
27+
struct regmap_config rc;
2728
struct ksz_device *dev;
2829
int i, ret;
2930

@@ -32,8 +33,9 @@ static int ksz9477_spi_probe(struct spi_device *spi)
3233
return -ENOMEM;
3334

3435
for (i = 0; i < ARRAY_SIZE(ksz9477_regmap_config); i++) {
35-
dev->regmap[i] = devm_regmap_init_spi(spi,
36-
&ksz9477_regmap_config[i]);
36+
rc = ksz9477_regmap_config[i];
37+
rc.lock_arg = &dev->regmap_mutex;
38+
dev->regmap[i] = devm_regmap_init_spi(spi, &rc);
3739
if (IS_ERR(dev->regmap[i])) {
3840
ret = PTR_ERR(dev->regmap[i]);
3941
dev_err(&spi->dev,

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ int ksz_switch_register(struct ksz_device *dev,
436436
}
437437

438438
mutex_init(&dev->dev_mutex);
439-
mutex_init(&dev->stats_mutex);
439+
mutex_init(&dev->regmap_mutex);
440440
mutex_init(&dev->alu_mutex);
441441
mutex_init(&dev->vlan_mutex);
442442

drivers/net/dsa/microchip/ksz_common.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* SPDX-License-Identifier: GPL-2.0
2-
* Microchip switch driver common header
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Microchip switch driver common header
33
*
44
* Copyright (C) 2017-2019 Microchip Technology Inc.
55
*/
@@ -47,7 +47,7 @@ struct ksz_device {
4747
const char *name;
4848

4949
struct mutex dev_mutex; /* device access */
50-
struct mutex stats_mutex; /* status access */
50+
struct mutex regmap_mutex; /* regmap access */
5151
struct mutex alu_mutex; /* ALU access */
5252
struct mutex vlan_mutex; /* vlan access */
5353
const struct ksz_dev_ops *dev_ops;
@@ -290,6 +290,18 @@ static inline void ksz_pwrite32(struct ksz_device *dev, int port, int offset,
290290
ksz_write32(dev, dev->dev_ops->get_port_addr(port, offset), data);
291291
}
292292

293+
static inline void ksz_regmap_lock(void *__mtx)
294+
{
295+
struct mutex *mtx = __mtx;
296+
mutex_lock(mtx);
297+
}
298+
299+
static inline void ksz_regmap_unlock(void *__mtx)
300+
{
301+
struct mutex *mtx = __mtx;
302+
mutex_unlock(mtx);
303+
}
304+
293305
/* Regmap tables generation */
294306
#define KSZ_SPI_OP_RD 3
295307
#define KSZ_SPI_OP_WR 2
@@ -314,6 +326,8 @@ static inline void ksz_pwrite32(struct ksz_device *dev, int port, int offset,
314326
.write_flag_mask = \
315327
KSZ_SPI_OP_FLAG_MASK(KSZ_SPI_OP_WR, swp, \
316328
regbits, regpad), \
329+
.lock = ksz_regmap_lock, \
330+
.unlock = ksz_regmap_unlock, \
317331
.reg_format_endian = REGMAP_ENDIAN_BIG, \
318332
.val_format_endian = REGMAP_ENDIAN_BIG \
319333
}

drivers/net/dsa/sja1105/sja1105.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* SPDX-License-Identifier: GPL-2.0
2-
* Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
33
* Copyright (c) 2018-2019, Vladimir Oltean <[email protected]>
44
*/
55
#ifndef _SJA1105_H

drivers/net/dsa/sja1105/sja1105_dynamic_config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* SPDX-License-Identifier: GPL-2.0
2-
* Copyright (c) 2019, Vladimir Oltean <[email protected]>
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (c) 2019, Vladimir Oltean <[email protected]>
33
*/
44
#ifndef _SJA1105_DYNAMIC_CONFIG_H
55
#define _SJA1105_DYNAMIC_CONFIG_H

drivers/net/dsa/sja1105/sja1105_ptp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* SPDX-License-Identifier: GPL-2.0
2-
* Copyright (c) 2019, Vladimir Oltean <[email protected]>
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (c) 2019, Vladimir Oltean <[email protected]>
33
*/
44
#ifndef _SJA1105_PTP_H
55
#define _SJA1105_PTP_H

drivers/net/dsa/sja1105/sja1105_static_config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* SPDX-License-Identifier: BSD-3-Clause
2-
* Copyright (c) 2016-2018, NXP Semiconductors
1+
/* SPDX-License-Identifier: BSD-3-Clause */
2+
/* Copyright (c) 2016-2018, NXP Semiconductors
33
* Copyright (c) 2018-2019, Vladimir Oltean <[email protected]>
44
*/
55
#ifndef _SJA1105_STATIC_CONFIG_H

drivers/net/dsa/sja1105/sja1105_tas.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* SPDX-License-Identifier: GPL-2.0
2-
* Copyright (c) 2019, Vladimir Oltean <[email protected]>
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (c) 2019, Vladimir Oltean <[email protected]>
33
*/
44
#ifndef _SJA1105_TAS_H
55
#define _SJA1105_TAS_H

drivers/net/ethernet/aquantia/atlantic/aq_main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ static void aq_ndev_set_multicast_settings(struct net_device *ndev)
194194
{
195195
struct aq_nic_s *aq_nic = netdev_priv(ndev);
196196

197-
aq_nic_set_packet_filter(aq_nic, ndev->flags);
198-
199-
aq_nic_set_multicast_list(aq_nic, ndev);
197+
(void)aq_nic_set_multicast_list(aq_nic, ndev);
200198
}
201199

202200
static int aq_ndo_vlan_rx_add_vid(struct net_device *ndev, __be16 proto,

0 commit comments

Comments
 (0)