Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mlx5-fixes-2023-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahemeed says:

====================
mlx5 fixes 2023-02-24

V1->V2:
- Toss away arguably non-fixes patches

This series provides bug fixes for mlx5 driver.
Please pull and let me know if there is any problem.
====================

+40 -8
+4
drivers/net/ethernet/mellanox/mlx5/core/ecpf.c
··· 98 98 err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_HOST_PF]); 99 99 if (err) 100 100 mlx5_core_warn(dev, "Timeout reclaiming external host PF pages err(%d)\n", err); 101 + 102 + err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_VF]); 103 + if (err) 104 + mlx5_core_warn(dev, "Timeout reclaiming external host VFs pages err(%d)\n", err); 101 105 }
+22 -3
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
··· 86 86 return (ptpsq->ts_cqe_ctr_mask && (skb_cc != skb_id)); 87 87 } 88 88 89 - static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_cc, u16 skb_id) 89 + static bool mlx5e_ptp_ts_cqe_ooo(struct mlx5e_ptpsq *ptpsq, u16 skb_id) 90 + { 91 + u16 skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc); 92 + u16 skb_pc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_pc); 93 + 94 + if (PTP_WQE_CTR2IDX(skb_id - skb_cc) >= PTP_WQE_CTR2IDX(skb_pc - skb_cc)) 95 + return true; 96 + 97 + return false; 98 + } 99 + 100 + static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_cc, 101 + u16 skb_id, int budget) 90 102 { 91 103 struct skb_shared_hwtstamps hwts = {}; 92 104 struct sk_buff *skb; ··· 110 98 hwts.hwtstamp = mlx5e_skb_cb_get_hwts(skb)->cqe_hwtstamp; 111 99 skb_tstamp_tx(skb, &hwts); 112 100 ptpsq->cq_stats->resync_cqe++; 101 + napi_consume_skb(skb, budget); 113 102 skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc); 114 103 } 115 104 } ··· 131 118 goto out; 132 119 } 133 120 134 - if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_cc, skb_id)) 135 - mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_cc, skb_id); 121 + if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_cc, skb_id)) { 122 + if (mlx5e_ptp_ts_cqe_ooo(ptpsq, skb_id)) { 123 + /* already handled by a previous resync */ 124 + ptpsq->cq_stats->ooo_cqe_drop++; 125 + return; 126 + } 127 + mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_cc, skb_id, budget); 128 + } 136 129 137 130 skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo); 138 131 hwtstamp = mlx5e_cqe_ts_to_ns(sq->ptp_cyc2time, sq->clock, get_cqe_ts(cqe));
+1 -2
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c
··· 710 710 else 711 711 napi_gro_receive(rq->cq.napi, skb); 712 712 713 - if (tc_priv.fwd_dev) 714 - dev_put(tc_priv.fwd_dev); 713 + dev_put(tc_priv.fwd_dev); 715 714 716 715 return; 717 716
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c
··· 37 37 int err; 38 38 39 39 handle = kvzalloc(sizeof(*handle), GFP_KERNEL); 40 - if (IS_ERR(handle)) 40 + if (!handle) 41 41 return ERR_PTR(-ENOMEM); 42 42 43 43 err = rhashtable_init(&handle->ht, &act_counters_ht_params);
+3 -1
drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
··· 86 86 static inline bool 87 87 mlx5e_skb_fifo_has_room(struct mlx5e_skb_fifo *fifo) 88 88 { 89 - return (*fifo->pc - *fifo->cc) < fifo->mask; 89 + return (u16)(*fifo->pc - *fifo->cc) < fifo->mask; 90 90 } 91 91 92 92 static inline bool ··· 302 302 static inline 303 303 struct sk_buff *mlx5e_skb_fifo_pop(struct mlx5e_skb_fifo *fifo) 304 304 { 305 + WARN_ON_ONCE(*fifo->pc == *fifo->cc); 306 + 305 307 return *mlx5e_skb_fifo_get(fifo, (*fifo->cc)++); 306 308 } 307 309
+1
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
··· 2138 2138 { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, abort_abs_diff_ns) }, 2139 2139 { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, resync_cqe) }, 2140 2140 { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, resync_event) }, 2141 + { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, ooo_cqe_drop) }, 2141 2142 }; 2142 2143 2143 2144 static const struct counter_desc ptp_rq_stats_desc[] = {
+1
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
··· 461 461 u64 abort_abs_diff_ns; 462 462 u64 resync_cqe; 463 463 u64 resync_event; 464 + u64 ooo_cqe_drop; 464 465 }; 465 466 466 467 struct mlx5e_rep_stats {
+2 -1
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
··· 869 869 dest.vport.flags |= MLX5_FLOW_DEST_VPORT_VHCA_ID; 870 870 flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; 871 871 872 - if (rep->vport == MLX5_VPORT_UPLINK) 872 + if (MLX5_CAP_ESW_FLOWTABLE(on_esw->dev, flow_source) && 873 + rep->vport == MLX5_VPORT_UPLINK) 873 874 spec->flow_context.flow_source = MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT; 874 875 875 876 flow_rule = mlx5_add_flow_rules(mlx5_eswitch_get_slow_fdb(on_esw),
+1
drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c
··· 105 105 geneve->opt_type = opt->type; 106 106 geneve->obj_id = res; 107 107 geneve->refcount++; 108 + res = 0; 108 109 } 109 110 110 111 unlock:
+4
drivers/net/ethernet/mellanox/mlx5/core/sriov.c
··· 147 147 148 148 mlx5_eswitch_disable_sriov(dev->priv.eswitch, clear_vf); 149 149 150 + /* For ECPFs, skip waiting for host VF pages until ECPF is destroyed */ 151 + if (mlx5_core_is_ecpf(dev)) 152 + return; 153 + 150 154 if (mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_VF])) 151 155 mlx5_core_warn(dev, "timeout reclaiming VFs pages\n"); 152 156 }