Skip to content

Commit 9d045ed

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: "Nothing earth shattering here, lots of small fixes (f.e. missing RCU protection, bad ref counting, missing memset(), etc.) all over the place: 1) Use get_file_rcu() in task_file iterator, from Yonghong Song. 2) There are two ways to set remote source MAC addresses in macvlan driver, but only one of which validates things properly. Fix this. From Alvin Šipraga. 3) Missing of_node_put() in gianfar probing, from Sumera Priyadarsini. 4) Preserve device wanted feature bits across multiple netlink ethtool requests, from Maxim Mikityanskiy. 5) Fix rcu_sched stall in task and task_file bpf iterators, from Yonghong Song. 6) Avoid reset after device destroy in ena driver, from Shay Agroskin. 7) Missing memset() in netlink policy export reallocation path, from Johannes Berg. 8) Fix info leak in __smc_diag_dump(), from Peilin Ye. 9) Decapsulate ECN properly for ipv6 in ipv4 tunnels, from Mark Tomlinson. 10) Fix number of data stream negotiation in SCTP, from David Laight. 11) Fix double free in connection tracker action module, from Alaa Hleihel. 12) Don't allow empty NHA_GROUP attributes, from Nikolay Aleksandrov" * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (46 commits) net: nexthop: don't allow empty NHA_GROUP bpf: Fix two typos in uapi/linux/bpf.h net: dsa: b53: check for timeout tipc: call rcu_read_lock() in tipc_aead_encrypt_done() net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flow net: sctp: Fix negotiation of the number of data streams. dt-bindings: net: renesas, ether: Improve schema validation gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY hv_netvsc: Fix the queue_mapping in netvsc_vf_xmit() hv_netvsc: Remove "unlikely" from netvsc_select_queue bpf: selftests: global_funcs: Check err_str before strstr bpf: xdp: Fix XDP mode when no mode flags specified selftests/bpf: Remove test_align leftovers tools/resolve_btfids: Fix sections with wrong alignment net/smc: Prevent kernel-infoleak in __smc_diag_dump() sfc: fix build warnings on 32-bit net: phy: mscc: Fix a couple of spelling mistakes "spcified" -> "specified" libbpf: Fix map index used in error message net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe() net: atlantic: Use readx_poll_timeout() for large timeout ...
2 parents f320ac6 + eeaac36 commit 9d045ed

File tree

44 files changed

+310
-163
lines changed

Some content is hidden

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

44 files changed

+310
-163
lines changed

Documentation/devicetree/bindings/net/renesas,ether.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,15 @@ properties:
5959
clocks:
6060
maxItems: 1
6161

62-
pinctrl-0: true
62+
power-domains:
63+
maxItems: 1
64+
65+
resets:
66+
maxItems: 1
6367

64-
pinctrl-names: true
68+
phy-mode: true
69+
70+
phy-handle: true
6571

6672
renesas,no-ether-link:
6773
type: boolean
@@ -74,6 +80,11 @@ properties:
7480
specify when the Ether LINK signal is active-low instead of normal
7581
active-high
7682

83+
patternProperties:
84+
"^ethernet-phy@[0-9a-f]$":
85+
type: object
86+
$ref: ethernet-phy.yaml#
87+
7788
required:
7889
- compatible
7990
- reg
@@ -83,7 +94,8 @@ required:
8394
- '#address-cells'
8495
- '#size-cells'
8596
- clocks
86-
- pinctrl-0
97+
98+
additionalProperties: false
8799

88100
examples:
89101
# Lager board
@@ -99,8 +111,6 @@ examples:
99111
clocks = <&mstp8_clks R8A7790_CLK_ETHER>;
100112
phy-mode = "rmii";
101113
phy-handle = <&phy1>;
102-
pinctrl-0 = <&ether_pins>;
103-
pinctrl-names = "default";
104114
renesas,ether-link-active-low;
105115
#address-cells = <1>;
106116
#size-cells = <0>;
@@ -109,7 +119,5 @@ examples:
109119
reg = <1>;
110120
interrupt-parent = <&irqc0>;
111121
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
112-
pinctrl-0 = <&phy1_pins>;
113-
pinctrl-names = "default";
114122
};
115123
};

drivers/net/bonding/bond_main.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,6 +2948,9 @@ static int bond_ab_arp_inspect(struct bonding *bond)
29482948
if (bond_time_in_interval(bond, last_rx, 1)) {
29492949
bond_propose_link_state(slave, BOND_LINK_UP);
29502950
commit++;
2951+
} else if (slave->link == BOND_LINK_BACK) {
2952+
bond_propose_link_state(slave, BOND_LINK_FAIL);
2953+
commit++;
29512954
}
29522955
continue;
29532956
}
@@ -3056,6 +3059,19 @@ static void bond_ab_arp_commit(struct bonding *bond)
30563059

30573060
continue;
30583061

3062+
case BOND_LINK_FAIL:
3063+
bond_set_slave_link_state(slave, BOND_LINK_FAIL,
3064+
BOND_SLAVE_NOTIFY_NOW);
3065+
bond_set_slave_inactive_flags(slave,
3066+
BOND_SLAVE_NOTIFY_NOW);
3067+
3068+
/* A slave has just been enslaved and has become
3069+
* the current active slave.
3070+
*/
3071+
if (rtnl_dereference(bond->curr_active_slave))
3072+
RCU_INIT_POINTER(bond->current_arp_slave, NULL);
3073+
continue;
3074+
30593075
default:
30603076
slave_err(bond->dev, slave->dev,
30613077
"impossible: link_new_state %d on slave\n",
@@ -3106,8 +3122,6 @@ static bool bond_ab_arp_probe(struct bonding *bond)
31063122
return should_notify_rtnl;
31073123
}
31083124

3109-
bond_set_slave_inactive_flags(curr_arp_slave, BOND_SLAVE_NOTIFY_LATER);
3110-
31113125
bond_for_each_slave_rcu(bond, slave, iter) {
31123126
if (!found && !before && bond_slave_is_up(slave))
31133127
before = slave;

drivers/net/dsa/b53/b53_common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,8 @@ static int b53_arl_op(struct b53_device *dev, int op, int port,
15541554
return ret;
15551555

15561556
switch (ret) {
1557+
case -ETIMEDOUT:
1558+
return ret;
15571559
case -ENOSPC:
15581560
dev_dbg(dev->dev, "{%pM,%.4d} no space left in ARL\n",
15591561
addr, vid);

drivers/net/dsa/ocelot/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ config NET_DSA_MSCC_FELIX
99
select NET_DSA_TAG_OCELOT
1010
select FSL_ENETC_MDIO
1111
help
12-
This driver supports network switches from the the Vitesse /
12+
This driver supports network switches from the Vitesse /
1313
Microsemi / Microchip Ocelot family of switching cores that are
1414
connected to their host CPU via Ethernet.
1515
The following switches are supported:

drivers/net/ethernet/amazon/ena/ena_netdev.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,13 +2180,10 @@ static void ena_del_napi_in_range(struct ena_adapter *adapter,
21802180
int i;
21812181

21822182
for (i = first_index; i < first_index + count; i++) {
2183-
/* Check if napi was initialized before */
2184-
if (!ENA_IS_XDP_INDEX(adapter, i) ||
2185-
adapter->ena_napi[i].xdp_ring)
2186-
netif_napi_del(&adapter->ena_napi[i].napi);
2187-
else
2188-
WARN_ON(ENA_IS_XDP_INDEX(adapter, i) &&
2189-
adapter->ena_napi[i].xdp_ring);
2183+
netif_napi_del(&adapter->ena_napi[i].napi);
2184+
2185+
WARN_ON(!ENA_IS_XDP_INDEX(adapter, i) &&
2186+
adapter->ena_napi[i].xdp_ring);
21902187
}
21912188
}
21922189

@@ -3601,16 +3598,14 @@ static void ena_fw_reset_device(struct work_struct *work)
36013598
{
36023599
struct ena_adapter *adapter =
36033600
container_of(work, struct ena_adapter, reset_task);
3604-
struct pci_dev *pdev = adapter->pdev;
36053601

3606-
if (unlikely(!test_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags))) {
3607-
dev_err(&pdev->dev,
3608-
"device reset schedule while reset bit is off\n");
3609-
return;
3610-
}
36113602
rtnl_lock();
3612-
ena_destroy_device(adapter, false);
3613-
ena_restore_device(adapter);
3603+
3604+
if (likely(test_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags))) {
3605+
ena_destroy_device(adapter, false);
3606+
ena_restore_device(adapter);
3607+
}
3608+
36143609
rtnl_unlock();
36153610
}
36163611

@@ -3692,7 +3687,7 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter,
36923687
}
36933688

36943689
u64_stats_update_begin(&tx_ring->syncp);
3695-
tx_ring->tx_stats.missed_tx = missed_tx;
3690+
tx_ring->tx_stats.missed_tx += missed_tx;
36963691
u64_stats_update_end(&tx_ring->syncp);
36973692

36983693
return rc;
@@ -4389,8 +4384,11 @@ static void __ena_shutoff(struct pci_dev *pdev, bool shutdown)
43894384
netdev->rx_cpu_rmap = NULL;
43904385
}
43914386
#endif /* CONFIG_RFS_ACCEL */
4392-
del_timer_sync(&adapter->timer_service);
43934387

4388+
/* Make sure timer and reset routine won't be called after
4389+
* freeing device resources.
4390+
*/
4391+
del_timer_sync(&adapter->timer_service);
43944392
cancel_work_sync(&adapter->reset_task);
43954393

43964394
rtnl_lock(); /* lock released inside the below if-else block */
@@ -4558,6 +4556,9 @@ static void ena_keep_alive_wd(void *adapter_data,
45584556
tx_drops = ((u64)desc->tx_drops_high << 32) | desc->tx_drops_low;
45594557

45604558
u64_stats_update_begin(&adapter->syncp);
4559+
/* These stats are accumulated by the device, so the counters indicate
4560+
* all drops since last reset.
4561+
*/
45614562
adapter->dev_stats.rx_drops = rx_drops;
45624563
adapter->dev_stats.tx_drops = tx_drops;
45634564
u64_stats_update_end(&adapter->syncp);

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,8 +1631,8 @@ static int hw_atl_b0_get_mac_temp(struct aq_hw_s *self, u32 *temp)
16311631
hw_atl_ts_reset_set(self, 0);
16321632
}
16331633

1634-
err = readx_poll_timeout_atomic(hw_atl_b0_ts_ready_and_latch_high_get,
1635-
self, val, val == 1, 10000U, 500000U);
1634+
err = readx_poll_timeout(hw_atl_b0_ts_ready_and_latch_high_get, self,
1635+
val, val == 1, 10000U, 500000U);
16361636
if (err)
16371637
return err;
16381638

drivers/net/ethernet/chelsio/cxgb4/sge.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,19 +2553,22 @@ int cxgb4_selftest_lb_pkt(struct net_device *netdev)
25532553

25542554
pkt_len = ETH_HLEN + sizeof(CXGB4_SELFTEST_LB_STR);
25552555

2556-
flits = DIV_ROUND_UP(pkt_len + sizeof(struct cpl_tx_pkt) +
2557-
sizeof(*wr), sizeof(__be64));
2556+
flits = DIV_ROUND_UP(pkt_len + sizeof(*cpl) + sizeof(*wr),
2557+
sizeof(__be64));
25582558
ndesc = flits_to_desc(flits);
25592559

25602560
lb = &pi->ethtool_lb;
25612561
lb->loopback = 1;
25622562

25632563
q = &adap->sge.ethtxq[pi->first_qset];
2564+
__netif_tx_lock(q->txq, smp_processor_id());
25642565

25652566
reclaim_completed_tx(adap, &q->q, -1, true);
25662567
credits = txq_avail(&q->q) - ndesc;
2567-
if (unlikely(credits < 0))
2568+
if (unlikely(credits < 0)) {
2569+
__netif_tx_unlock(q->txq);
25682570
return -ENOMEM;
2571+
}
25692572

25702573
wr = (void *)&q->q.desc[q->q.pidx];
25712574
memset(wr, 0, sizeof(struct tx_desc));
@@ -2598,6 +2601,7 @@ int cxgb4_selftest_lb_pkt(struct net_device *netdev)
25982601
init_completion(&lb->completion);
25992602
txq_advance(&q->q, ndesc);
26002603
cxgb4_ring_tx_db(adap, &q->q, ndesc);
2604+
__netif_tx_unlock(q->txq);
26012605

26022606
/* wait for the pkt to return */
26032607
ret = wait_for_completion_timeout(&lb->completion, 10 * HZ);

drivers/net/ethernet/cortina/gemini.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
23892389

23902390
dev_info(dev, "probe %s ID %d\n", dev_name(dev), id);
23912391

2392-
netdev = alloc_etherdev_mq(sizeof(*port), TX_QUEUE_NUM);
2392+
netdev = devm_alloc_etherdev_mqs(dev, sizeof(*port), TX_QUEUE_NUM, TX_QUEUE_NUM);
23932393
if (!netdev) {
23942394
dev_err(dev, "Can't allocate ethernet device #%d\n", id);
23952395
return -ENOMEM;
@@ -2521,7 +2521,6 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
25212521
}
25222522

25232523
port->netdev = NULL;
2524-
free_netdev(netdev);
25252524
return ret;
25262525
}
25272526

@@ -2530,7 +2529,6 @@ static int gemini_ethernet_port_remove(struct platform_device *pdev)
25302529
struct gemini_ethernet_port *port = platform_get_drvdata(pdev);
25312530

25322531
gemini_port_remove(port);
2533-
free_netdev(port->netdev);
25342532
return 0;
25352533
}
25362534

drivers/net/ethernet/freescale/gianfar.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,10 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
750750
continue;
751751

752752
err = gfar_parse_group(child, priv, model);
753-
if (err)
753+
if (err) {
754+
of_node_put(child);
754755
goto err_grp_init;
756+
}
755757
}
756758
} else { /* SQ_SG_MODE */
757759
err = gfar_parse_group(np, priv, model);

drivers/net/ethernet/sfc/ef100.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static int ef100_pci_parse_continue_entry(struct efx_nic *efx, int entry_locatio
142142

143143
/* Temporarily map new BAR. */
144144
rc = efx_init_io(efx, bar,
145-
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
145+
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
146146
pci_resource_len(efx->pci_dev, bar));
147147
if (rc) {
148148
netif_err(efx, probe, efx->net_dev,
@@ -160,7 +160,7 @@ static int ef100_pci_parse_continue_entry(struct efx_nic *efx, int entry_locatio
160160

161161
/* Put old BAR back. */
162162
rc = efx_init_io(efx, previous_bar,
163-
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
163+
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
164164
pci_resource_len(efx->pci_dev, previous_bar));
165165
if (rc) {
166166
netif_err(efx, probe, efx->net_dev,
@@ -334,7 +334,7 @@ static int ef100_pci_parse_xilinx_cap(struct efx_nic *efx, int vndr_cap,
334334

335335
/* Temporarily map BAR. */
336336
rc = efx_init_io(efx, bar,
337-
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
337+
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
338338
pci_resource_len(efx->pci_dev, bar));
339339
if (rc) {
340340
netif_err(efx, probe, efx->net_dev,
@@ -495,7 +495,7 @@ static int ef100_pci_probe(struct pci_dev *pci_dev,
495495

496496
/* Set up basic I/O (BAR mappings etc) */
497497
rc = efx_init_io(efx, fcw.bar,
498-
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
498+
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
499499
pci_resource_len(efx->pci_dev, fcw.bar));
500500
if (rc)
501501
goto fail;

drivers/net/ethernet/sfc/ef100_nic.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,18 +431,18 @@ static int ef100_reset(struct efx_nic *efx, enum reset_type reset_type)
431431
/* A RESET_TYPE_ALL will cause filters to be removed, so we remove filters
432432
* and reprobe after reset to avoid removing filters twice
433433
*/
434-
down_read(&efx->filter_sem);
434+
down_write(&efx->filter_sem);
435435
ef100_filter_table_down(efx);
436-
up_read(&efx->filter_sem);
436+
up_write(&efx->filter_sem);
437437
rc = efx_mcdi_reset(efx, reset_type);
438438
if (rc)
439439
return rc;
440440

441441
netif_device_attach(efx->net_dev);
442442

443-
down_read(&efx->filter_sem);
443+
down_write(&efx->filter_sem);
444444
rc = ef100_filter_table_up(efx);
445-
up_read(&efx->filter_sem);
445+
up_write(&efx->filter_sem);
446446
if (rc)
447447
return rc;
448448

@@ -739,6 +739,7 @@ const struct efx_nic_type ef100_pf_nic_type = {
739739
.rx_remove = efx_mcdi_rx_remove,
740740
.rx_write = ef100_rx_write,
741741
.rx_packet = __ef100_rx_packet,
742+
.rx_buf_hash_valid = ef100_rx_buf_hash_valid,
742743
.fini_dmaq = efx_fini_dmaq,
743744
.max_rx_ip_filters = EFX_MCDI_FILTER_TBL_ROWS,
744745
.filter_table_probe = ef100_filter_table_up,
@@ -820,6 +821,7 @@ const struct efx_nic_type ef100_vf_nic_type = {
820821
.rx_remove = efx_mcdi_rx_remove,
821822
.rx_write = ef100_rx_write,
822823
.rx_packet = __ef100_rx_packet,
824+
.rx_buf_hash_valid = ef100_rx_buf_hash_valid,
823825
.fini_dmaq = efx_fini_dmaq,
824826
.max_rx_ip_filters = EFX_MCDI_FILTER_TBL_ROWS,
825827
.filter_table_probe = ef100_filter_table_up,

drivers/net/ethernet/sfc/net_driver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ struct efx_async_filter_insertion {
846846
* @timer_quantum_ns: Interrupt timer quantum, in nanoseconds
847847
* @timer_max_ns: Interrupt timer maximum value, in nanoseconds
848848
* @irq_rx_adaptive: Adaptive IRQ moderation enabled for RX event queues
849+
* @irqs_hooked: Channel interrupts are hooked
849850
* @irq_rx_mod_step_us: Step size for IRQ moderation for RX event queues
850851
* @irq_rx_moderation_us: IRQ moderation time for RX event queues
851852
* @msg_enable: Log message enable flags
@@ -1004,6 +1005,7 @@ struct efx_nic {
10041005
unsigned int timer_quantum_ns;
10051006
unsigned int timer_max_ns;
10061007
bool irq_rx_adaptive;
1008+
bool irqs_hooked;
10071009
unsigned int irq_mod_step_us;
10081010
unsigned int irq_rx_moderation_us;
10091011
u32 msg_enable;

drivers/net/ethernet/sfc/nic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ int efx_nic_init_interrupt(struct efx_nic *efx)
129129
#endif
130130
}
131131

132+
efx->irqs_hooked = true;
132133
return 0;
133134

134135
fail2:
@@ -154,6 +155,8 @@ void efx_nic_fini_interrupt(struct efx_nic *efx)
154155
efx->net_dev->rx_cpu_rmap = NULL;
155156
#endif
156157

158+
if (!efx->irqs_hooked)
159+
return;
157160
if (EFX_INT_MODE_USE_MSI(efx)) {
158161
/* Disable MSI/MSI-X interrupts */
159162
efx_for_each_channel(channel, efx)
@@ -163,6 +166,7 @@ void efx_nic_fini_interrupt(struct efx_nic *efx)
163166
/* Disable legacy interrupt */
164167
free_irq(efx->legacy_irq, efx);
165168
}
169+
efx->irqs_hooked = false;
166170
}
167171

168172
/* Register dump */

drivers/net/ethernet/sfc/rx_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ void efx_remove_filters(struct efx_nic *efx)
849849
efx_for_each_channel(channel, efx) {
850850
cancel_delayed_work_sync(&channel->filter_work);
851851
kfree(channel->rps_flow_id);
852+
channel->rps_flow_id = NULL;
852853
}
853854
#endif
854855
down_write(&efx->filter_sem);

0 commit comments

Comments
 (0)