Skip to content

Commit c58c18b

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Merge in late fixes to prepare for the 6.17 net-next PR. Conflicts: net/core/neighbour.c 1bbb76a ("neighbour: Fix null-ptr-deref in neigh_flush_dev().") 13a936b ("neighbour: Protect tbl->phash_buckets[] with a dedicated mutex.") 03dc03f ("neighbor: Add NTF_EXT_VALIDATED flag for externally validated entries") Adjacent changes: drivers/net/usb/usbnet.c 0d9cfc9 ("net: usbnet: Avoid potential RCU stall on LINK_CHANGE event") 2c04d27 ("net: usb: Convert tasklet API to new bottom half workqueue mechanism") net/ipv6/route.c 31d7d67 ("ipv6: annotate data-races around rt->fib6_nsiblings") 1caf272 ("ipv6: adopt dst_dev() helper") 3b3ccf9 ("net: Remove unnecessary NULL check for lwtunnel_fill_encap()") Signed-off-by: Jakub Kicinski <[email protected]>
2 parents c471b90 + afd8c2c commit c58c18b

File tree

18 files changed

+247
-121
lines changed

18 files changed

+247
-121
lines changed

drivers/net/can/usb/peak_usb/pcan_usb_fd.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct __packed pcan_ufd_fw_info {
4949
__le32 ser_no; /* S/N */
5050
__le32 flags; /* special functions */
5151

52-
/* extended data when type == PCAN_USBFD_TYPE_EXT */
52+
/* extended data when type >= PCAN_USBFD_TYPE_EXT */
5353
u8 cmd_out_ep; /* ep for cmd */
5454
u8 cmd_in_ep; /* ep for replies */
5555
u8 data_out_ep[2]; /* ep for CANx TX */
@@ -982,10 +982,11 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev)
982982
dev->can.ctrlmode |= CAN_CTRLMODE_FD_NON_ISO;
983983
}
984984

985-
/* if vendor rsp is of type 2, then it contains EP numbers to
986-
* use for cmds pipes. If not, then default EP should be used.
985+
/* if vendor rsp type is greater than or equal to 2, then it
986+
* contains EP numbers to use for cmds pipes. If not, then
987+
* default EP should be used.
987988
*/
988-
if (fw_info->type != cpu_to_le16(PCAN_USBFD_TYPE_EXT)) {
989+
if (le16_to_cpu(fw_info->type) < PCAN_USBFD_TYPE_EXT) {
989990
fw_info->cmd_out_ep = PCAN_USBPRO_EP_CMDOUT;
990991
fw_info->cmd_in_ep = PCAN_USBPRO_EP_CMDIN;
991992
}
@@ -1018,11 +1019,11 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev)
10181019
dev->can_channel_id =
10191020
le32_to_cpu(pdev->usb_if->fw_info.dev_id[dev->ctrl_idx]);
10201021

1021-
/* if vendor rsp is of type 2, then it contains EP numbers to
1022-
* use for data pipes. If not, then statically defined EP are used
1023-
* (see peak_usb_create_dev()).
1022+
/* if vendor rsp type is greater than or equal to 2, then it contains EP
1023+
* numbers to use for data pipes. If not, then statically defined EP are
1024+
* used (see peak_usb_create_dev()).
10241025
*/
1025-
if (fw_info->type == cpu_to_le16(PCAN_USBFD_TYPE_EXT)) {
1026+
if (le16_to_cpu(fw_info->type) >= PCAN_USBFD_TYPE_EXT) {
10261027
dev->ep_msg_in = fw_info->data_in_ep;
10271028
dev->ep_msg_out = fw_info->data_out_ep[dev->ctrl_idx];
10281029
}

drivers/net/dsa/microchip/ksz8.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ static void ksz8863_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
384384
addr -= dev->info->reg_mib_cnt;
385385
ctrl_addr = addr ? KSZ8863_MIB_PACKET_DROPPED_TX_0 :
386386
KSZ8863_MIB_PACKET_DROPPED_RX_0;
387+
if (ksz_is_8895_family(dev) &&
388+
ctrl_addr == KSZ8863_MIB_PACKET_DROPPED_RX_0)
389+
ctrl_addr = KSZ8895_MIB_PACKET_DROPPED_RX_0;
387390
ctrl_addr += port;
388391
ctrl_addr |= IND_ACC_TABLE(TABLE_MIB | TABLE_READ);
389392

drivers/net/dsa/microchip/ksz8_reg.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,9 @@
833833
#define KSZ8795_MIB_TOTAL_TX_1 0x105
834834

835835
#define KSZ8863_MIB_PACKET_DROPPED_TX_0 0x100
836-
#define KSZ8863_MIB_PACKET_DROPPED_RX_0 0x105
836+
#define KSZ8863_MIB_PACKET_DROPPED_RX_0 0x103
837+
838+
#define KSZ8895_MIB_PACKET_DROPPED_RX_0 0x105
837839

838840
#define MIB_PACKET_DROPPED 0x0000FFFF
839841

drivers/net/ethernet/intel/igb/igb_xsk.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ bool igb_xmit_zc(struct igb_ring *tx_ring, struct xsk_buff_pool *xsk_pool)
482482
if (!nb_pkts)
483483
return true;
484484

485-
while (nb_pkts-- > 0) {
485+
for (; i < nb_pkts; i++) {
486486
dma = xsk_buff_raw_get_dma(xsk_pool, descs[i].addr);
487487
xsk_buff_raw_dma_sync_for_device(xsk_pool, dma, descs[i].len);
488488

@@ -512,7 +512,6 @@ bool igb_xmit_zc(struct igb_ring *tx_ring, struct xsk_buff_pool *xsk_pool)
512512

513513
total_bytes += descs[i].len;
514514

515-
i++;
516515
tx_ring->next_to_use++;
517516
tx_buffer_info->next_to_watch = tx_desc;
518517
if (tx_ring->next_to_use == tx_ring->count)

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ struct mlx5e_rq {
726726
struct xsk_buff_pool *xsk_pool;
727727

728728
struct work_struct recover_work;
729+
struct work_struct rx_timeout_work;
729730

730731
/* control */
731732
struct mlx5_wq_ctrl wq_ctrl;

drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ static int port_set_buffer(struct mlx5e_priv *priv,
331331
if (err)
332332
goto out;
333333

334+
/* RO bits should be set to 0 on write */
335+
MLX5_SET(pbmc_reg, in, port_buffer_size, 0);
336+
334337
err = mlx5e_port_set_pbmc(mdev, in);
335338
out:
336339
kfree(in);

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,23 @@ static int mlx5e_rx_reporter_err_rq_cqe_recover(void *ctx)
170170
static int mlx5e_rx_reporter_timeout_recover(void *ctx)
171171
{
172172
struct mlx5_eq_comp *eq;
173+
struct mlx5e_priv *priv;
173174
struct mlx5e_rq *rq;
174175
int err;
175176

176177
rq = ctx;
178+
priv = rq->priv;
179+
180+
mutex_lock(&priv->state_lock);
181+
177182
eq = rq->cq.mcq.eq;
178183

179184
err = mlx5e_health_channel_eq_recover(rq->netdev, eq, rq->cq.ch_stats);
180185
if (err && rq->icosq)
181186
clear_bit(MLX5E_SQ_STATE_ENABLED, &rq->icosq->state);
182187

188+
mutex_unlock(&priv->state_lock);
189+
183190
return err;
184191
}
185192

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ void mlx5e_ipsec_offload_handle_rx_skb(struct net_device *netdev,
327327
if (unlikely(!sa_entry)) {
328328
rcu_read_unlock();
329329
atomic64_inc(&ipsec->sw_stats.ipsec_rx_drop_sadb_miss);
330+
/* Clear secpath to prevent invalid dereference
331+
* in downstream XFRM policy checks.
332+
*/
333+
secpath_reset(skb);
330334
return;
331335
}
332336
xfrm_state_hold(sa_entry->x);

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,27 @@ static void mlx5e_rq_err_cqe_work(struct work_struct *recover_work)
676676
mlx5e_reporter_rq_cqe_err(rq);
677677
}
678678

679+
static void mlx5e_rq_timeout_work(struct work_struct *timeout_work)
680+
{
681+
struct mlx5e_rq *rq = container_of(timeout_work,
682+
struct mlx5e_rq,
683+
rx_timeout_work);
684+
685+
/* Acquire netdev instance lock to synchronize with channel close and
686+
* reopen flows. Either successfully obtain the lock, or detect that
687+
* channels are closing for another reason, making this work no longer
688+
* necessary.
689+
*/
690+
while (!netdev_trylock(rq->netdev)) {
691+
if (!test_bit(MLX5E_STATE_CHANNELS_ACTIVE, &rq->priv->state))
692+
return;
693+
msleep(20);
694+
}
695+
696+
mlx5e_reporter_rx_timeout(rq);
697+
netdev_unlock(rq->netdev);
698+
}
699+
679700
static int mlx5e_alloc_mpwqe_rq_drop_page(struct mlx5e_rq *rq)
680701
{
681702
rq->wqe_overflow.page = alloc_page(GFP_KERNEL);
@@ -876,6 +897,7 @@ static int mlx5e_alloc_rq(struct mlx5e_params *params,
876897

877898
rqp->wq.db_numa_node = node;
878899
INIT_WORK(&rq->recover_work, mlx5e_rq_err_cqe_work);
900+
INIT_WORK(&rq->rx_timeout_work, mlx5e_rq_timeout_work);
879901

880902
if (params->xdp_prog)
881903
bpf_prog_inc(params->xdp_prog);
@@ -1261,7 +1283,8 @@ int mlx5e_wait_for_min_rx_wqes(struct mlx5e_rq *rq, int wait_time)
12611283
netdev_warn(rq->netdev, "Failed to get min RX wqes on Channel[%d] RQN[0x%x] wq cur_sz(%d) min_rx_wqes(%d)\n",
12621284
rq->ix, rq->rqn, mlx5e_rqwq_get_cur_sz(rq), min_wqes);
12631285

1264-
mlx5e_reporter_rx_timeout(rq);
1286+
queue_work(rq->priv->wq, &rq->rx_timeout_work);
1287+
12651288
return -ETIMEDOUT;
12661289
}
12671290

@@ -1432,6 +1455,7 @@ void mlx5e_close_rq(struct mlx5e_rq *rq)
14321455
if (rq->dim)
14331456
cancel_work_sync(&rq->dim->work);
14341457
cancel_work_sync(&rq->recover_work);
1458+
cancel_work_sync(&rq->rx_timeout_work);
14351459
mlx5e_destroy_rq(rq);
14361460
mlx5e_free_rx_descs(rq);
14371461
mlx5e_free_rq(rq);

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2596,7 +2596,7 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
25962596

25972597
budget = min(budget, stmmac_tx_avail(priv, queue));
25982598

2599-
while (budget-- > 0) {
2599+
for (; budget > 0; budget--) {
26002600
struct stmmac_metadata_request meta_req;
26012601
struct xsk_tx_metadata *meta = NULL;
26022602
dma_addr_t dma_addr;

0 commit comments

Comments
 (0)