Skip to content

Commit 8969519

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Merge in overtime fixes, no conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 764f4eb + f92fcb5 commit 8969519

File tree

26 files changed

+444
-162
lines changed

26 files changed

+444
-162
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10770,7 +10770,6 @@ L7 BPF FRAMEWORK
1077010770
M: John Fastabend <john.fastabend@gmail.com>
1077110771
M: Daniel Borkmann <daniel@iogearbox.net>
1077210772
M: Jakub Sitnicki <jakub@cloudflare.com>
10773-
M: Lorenz Bauer <lmb@cloudflare.com>
1077410773
L: netdev@vger.kernel.org
1077510774
L: bpf@vger.kernel.org
1077610775
S: Maintained

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ static inline void bcmgenet_writel(u32 value, void __iomem *offset)
7676
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
7777
__raw_writel(value, offset);
7878
else
79-
writel_relaxed(value, offset);
79+
writel(value, offset);
8080
}
8181

8282
static inline u32 bcmgenet_readl(void __iomem *offset)
8383
{
8484
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
8585
return __raw_readl(offset);
8686
else
87-
return readl_relaxed(offset);
87+
return readl(offset);
8888
}
8989

9090
static inline void dmadesc_set_length_status(struct bcmgenet_priv *priv,

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,15 @@ static int __ibmvnic_open(struct net_device *netdev)
14301430
return rc;
14311431
}
14321432

1433+
adapter->tx_queues_active = true;
1434+
1435+
/* Since queues were stopped until now, there shouldn't be any
1436+
* one in ibmvnic_complete_tx() or ibmvnic_xmit() so maybe we
1437+
* don't need the synchronize_rcu()? Leaving it for consistency
1438+
* with setting ->tx_queues_active = false.
1439+
*/
1440+
synchronize_rcu();
1441+
14331442
netif_tx_start_all_queues(netdev);
14341443

14351444
if (prev_state == VNIC_CLOSED) {
@@ -1604,6 +1613,14 @@ static void ibmvnic_cleanup(struct net_device *netdev)
16041613
struct ibmvnic_adapter *adapter = netdev_priv(netdev);
16051614

16061615
/* ensure that transmissions are stopped if called by do_reset */
1616+
1617+
adapter->tx_queues_active = false;
1618+
1619+
/* Ensure complete_tx() and ibmvnic_xmit() see ->tx_queues_active
1620+
* update so they don't restart a queue after we stop it below.
1621+
*/
1622+
synchronize_rcu();
1623+
16071624
if (test_bit(0, &adapter->resetting))
16081625
netif_tx_disable(netdev);
16091626
else
@@ -1843,14 +1860,21 @@ static void ibmvnic_tx_scrq_clean_buffer(struct ibmvnic_adapter *adapter,
18431860
tx_buff->skb = NULL;
18441861
adapter->netdev->stats.tx_dropped++;
18451862
}
1863+
18461864
ind_bufp->index = 0;
1865+
18471866
if (atomic_sub_return(entries, &tx_scrq->used) <=
18481867
(adapter->req_tx_entries_per_subcrq / 2) &&
1849-
__netif_subqueue_stopped(adapter->netdev, queue_num) &&
1850-
!test_bit(0, &adapter->resetting)) {
1851-
netif_wake_subqueue(adapter->netdev, queue_num);
1852-
netdev_dbg(adapter->netdev, "Started queue %d\n",
1853-
queue_num);
1868+
__netif_subqueue_stopped(adapter->netdev, queue_num)) {
1869+
rcu_read_lock();
1870+
1871+
if (adapter->tx_queues_active) {
1872+
netif_wake_subqueue(adapter->netdev, queue_num);
1873+
netdev_dbg(adapter->netdev, "Started queue %d\n",
1874+
queue_num);
1875+
}
1876+
1877+
rcu_read_unlock();
18541878
}
18551879
}
18561880

@@ -1905,11 +1929,12 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
19051929
int index = 0;
19061930
u8 proto = 0;
19071931

1908-
tx_scrq = adapter->tx_scrq[queue_num];
1909-
txq = netdev_get_tx_queue(netdev, queue_num);
1910-
ind_bufp = &tx_scrq->ind_buf;
1911-
1912-
if (test_bit(0, &adapter->resetting)) {
1932+
/* If a reset is in progress, drop the packet since
1933+
* the scrqs may get torn down. Otherwise use the
1934+
* rcu to ensure reset waits for us to complete.
1935+
*/
1936+
rcu_read_lock();
1937+
if (!adapter->tx_queues_active) {
19131938
dev_kfree_skb_any(skb);
19141939

19151940
tx_send_failed++;
@@ -1918,13 +1943,18 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
19181943
goto out;
19191944
}
19201945

1946+
tx_scrq = adapter->tx_scrq[queue_num];
1947+
txq = netdev_get_tx_queue(netdev, queue_num);
1948+
ind_bufp = &tx_scrq->ind_buf;
1949+
19211950
if (ibmvnic_xmit_workarounds(skb, netdev)) {
19221951
tx_dropped++;
19231952
tx_send_failed++;
19241953
ret = NETDEV_TX_OK;
19251954
ibmvnic_tx_scrq_flush(adapter, tx_scrq);
19261955
goto out;
19271956
}
1957+
19281958
if (skb_is_gso(skb))
19291959
tx_pool = &adapter->tso_pool[queue_num];
19301960
else
@@ -2079,6 +2109,7 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
20792109
netif_carrier_off(netdev);
20802110
}
20812111
out:
2112+
rcu_read_unlock();
20822113
netdev->stats.tx_dropped += tx_dropped;
20832114
netdev->stats.tx_bytes += tx_bytes;
20842115
netdev->stats.tx_packets += tx_packets;
@@ -3749,9 +3780,15 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
37493780
(adapter->req_tx_entries_per_subcrq / 2) &&
37503781
__netif_subqueue_stopped(adapter->netdev,
37513782
scrq->pool_index)) {
3752-
netif_wake_subqueue(adapter->netdev, scrq->pool_index);
3753-
netdev_dbg(adapter->netdev, "Started queue %d\n",
3754-
scrq->pool_index);
3783+
rcu_read_lock();
3784+
if (adapter->tx_queues_active) {
3785+
netif_wake_subqueue(adapter->netdev,
3786+
scrq->pool_index);
3787+
netdev_dbg(adapter->netdev,
3788+
"Started queue %d\n",
3789+
scrq->pool_index);
3790+
}
3791+
rcu_read_unlock();
37553792
}
37563793
}
37573794

drivers/net/ethernet/ibm/ibmvnic.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,14 @@ struct ibmvnic_adapter {
10061006
struct work_struct ibmvnic_reset;
10071007
struct delayed_work ibmvnic_delayed_reset;
10081008
unsigned long resetting;
1009-
bool napi_enabled, from_passive_init;
1010-
bool login_pending;
10111009
/* last device reset time */
10121010
unsigned long last_reset_time;
10131011

1012+
bool napi_enabled;
1013+
bool from_passive_init;
1014+
bool login_pending;
1015+
/* protected by rcu */
1016+
bool tx_queues_active;
10141017
bool failover_pending;
10151018
bool force_reset_recovery;
10161019

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ enum ice_pf_state {
290290
ICE_LINK_DEFAULT_OVERRIDE_PENDING,
291291
ICE_PHY_INIT_COMPLETE,
292292
ICE_FD_VF_FLUSH_CTX, /* set at FD Rx IRQ or timeout */
293+
ICE_AUX_ERR_PENDING,
293294
ICE_STATE_NBITS /* must be last */
294295
};
295296

@@ -557,6 +558,7 @@ struct ice_pf {
557558
wait_queue_head_t reset_wait_queue;
558559

559560
u32 hw_csum_rx_error;
561+
u32 oicr_err_reg;
560562
u16 oicr_idx; /* Other interrupt cause MSIX vector index */
561563
u16 num_avail_sw_msix; /* remaining MSIX SW vectors left unclaimed */
562564
u16 max_pf_txqs; /* Total Tx queues PF wide */

drivers/net/ethernet/intel/ice/ice_idc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_event *event)
3434
{
3535
struct iidc_auxiliary_drv *iadrv;
3636

37+
if (WARN_ON_ONCE(!in_task()))
38+
return;
39+
3740
if (!pf->adev)
3841
return;
3942

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,19 @@ static void ice_service_task(struct work_struct *work)
22782278
return;
22792279
}
22802280

2281+
if (test_and_clear_bit(ICE_AUX_ERR_PENDING, pf->state)) {
2282+
struct iidc_event *event;
2283+
2284+
event = kzalloc(sizeof(*event), GFP_KERNEL);
2285+
if (event) {
2286+
set_bit(IIDC_EVENT_CRIT_ERR, event->type);
2287+
/* report the entire OICR value to AUX driver */
2288+
swap(event->reg, pf->oicr_err_reg);
2289+
ice_send_event_to_aux(pf, event);
2290+
kfree(event);
2291+
}
2292+
}
2293+
22812294
if (test_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags)) {
22822295
/* Plug aux device per request */
22832296
ice_plug_aux_dev(pf);
@@ -3064,17 +3077,9 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
30643077

30653078
#define ICE_AUX_CRIT_ERR (PFINT_OICR_PE_CRITERR_M | PFINT_OICR_HMC_ERR_M | PFINT_OICR_PE_PUSH_M)
30663079
if (oicr & ICE_AUX_CRIT_ERR) {
3067-
struct iidc_event *event;
3068-
3080+
pf->oicr_err_reg |= oicr;
3081+
set_bit(ICE_AUX_ERR_PENDING, pf->state);
30693082
ena_mask &= ~ICE_AUX_CRIT_ERR;
3070-
event = kzalloc(sizeof(*event), GFP_ATOMIC);
3071-
if (event) {
3072-
set_bit(IIDC_EVENT_CRIT_ERR, event->type);
3073-
/* report the entire OICR value to AUX driver */
3074-
event->reg = oicr;
3075-
ice_send_event_to_aux(pf, event);
3076-
kfree(event);
3077-
}
30783083
}
30793084

30803085
/* Report any remaining unexpected interrupts */

drivers/net/wwan/qcom_bam_dmux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ static int __maybe_unused bam_dmux_runtime_resume(struct device *dev)
755755
return 0;
756756

757757
dmux->tx = dma_request_chan(dev, "tx");
758-
if (IS_ERR(dmux->rx)) {
758+
if (IS_ERR(dmux->tx)) {
759759
dev_err(dev, "Failed to request TX DMA channel: %pe\n", dmux->tx);
760760
dmux->tx = NULL;
761761
bam_dmux_runtime_suspend(dev);

include/net/netfilter/nf_flow_table.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <linux/netfilter/nf_conntrack_tuple_common.h>
1111
#include <net/flow_offload.h>
1212
#include <net/dst.h>
13+
#include <linux/if_pppox.h>
14+
#include <linux/ppp_defs.h>
1315

1416
struct nf_flowtable;
1517
struct nf_flow_rule;
@@ -317,4 +319,20 @@ int nf_flow_rule_route_ipv6(struct net *net, const struct flow_offload *flow,
317319
int nf_flow_table_offload_init(void);
318320
void nf_flow_table_offload_exit(void);
319321

322+
static inline __be16 nf_flow_pppoe_proto(const struct sk_buff *skb)
323+
{
324+
__be16 proto;
325+
326+
proto = *((__be16 *)(skb_mac_header(skb) + ETH_HLEN +
327+
sizeof(struct pppoe_hdr)));
328+
switch (proto) {
329+
case htons(PPP_IP):
330+
return htons(ETH_P_IP);
331+
case htons(PPP_IPV6):
332+
return htons(ETH_P_IPV6);
333+
}
334+
335+
return 0;
336+
}
337+
320338
#endif /* _NF_FLOW_TABLE_H */

net/ax25/af_ax25.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,20 @@ static void ax25_kill_by_device(struct net_device *dev)
8989
sk = s->sk;
9090
if (!sk) {
9191
spin_unlock_bh(&ax25_list_lock);
92-
s->ax25_dev = NULL;
9392
ax25_disconnect(s, ENETUNREACH);
93+
s->ax25_dev = NULL;
9494
spin_lock_bh(&ax25_list_lock);
9595
goto again;
9696
}
9797
sock_hold(sk);
9898
spin_unlock_bh(&ax25_list_lock);
9999
lock_sock(sk);
100-
s->ax25_dev = NULL;
101-
dev_put_track(ax25_dev->dev, &ax25_dev->dev_tracker);
102-
ax25_dev_put(ax25_dev);
103100
ax25_disconnect(s, ENETUNREACH);
101+
s->ax25_dev = NULL;
102+
if (sk->sk_socket) {
103+
dev_put_track(ax25_dev->dev, &ax25_dev->dev_tracker);
104+
ax25_dev_put(ax25_dev);
105+
}
104106
release_sock(sk);
105107
spin_lock_bh(&ax25_list_lock);
106108
sock_put(sk);
@@ -979,14 +981,20 @@ static int ax25_release(struct socket *sock)
979981
{
980982
struct sock *sk = sock->sk;
981983
ax25_cb *ax25;
984+
ax25_dev *ax25_dev;
982985

983986
if (sk == NULL)
984987
return 0;
985988

986989
sock_hold(sk);
987-
sock_orphan(sk);
988990
lock_sock(sk);
991+
sock_orphan(sk);
989992
ax25 = sk_to_ax25(sk);
993+
ax25_dev = ax25->ax25_dev;
994+
if (ax25_dev) {
995+
dev_put_track(ax25_dev->dev, &ax25_dev->dev_tracker);
996+
ax25_dev_put(ax25_dev);
997+
}
990998

991999
if (sk->sk_type == SOCK_SEQPACKET) {
9921000
switch (ax25->state) {

0 commit comments

Comments
 (0)