Commit e9bbd601 authored by Jakub Kicinski's avatar Jakub Kicinski

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

Saeed Mahameed says:

====================
mlx5 fixes 2023-08-16

This series provides bug fixes to mlx5 driver.

* tag 'mlx5-fixes-2023-08-16' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
  net/mlx5: Fix mlx5_cmd_update_root_ft() error flow
  net/mlx5e: XDP, Fix fifo overrun on XDP_REDIRECT
====================

Link: https://lore.kernel.org/r/20230816204108.53819-1-saeed@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 43d00e10 0fd23db0
...@@ -84,6 +84,8 @@ enum mlx5e_xdp_xmit_mode { ...@@ -84,6 +84,8 @@ enum mlx5e_xdp_xmit_mode {
* MLX5E_XDP_XMIT_MODE_XSK: * MLX5E_XDP_XMIT_MODE_XSK:
* none. * none.
*/ */
#define MLX5E_XDP_FIFO_ENTRIES2DS_MAX_RATIO 4
union mlx5e_xdp_info { union mlx5e_xdp_info {
enum mlx5e_xdp_xmit_mode mode; enum mlx5e_xdp_xmit_mode mode;
union { union {
......
...@@ -1298,11 +1298,13 @@ static int mlx5e_alloc_xdpsq_fifo(struct mlx5e_xdpsq *sq, int numa) ...@@ -1298,11 +1298,13 @@ static int mlx5e_alloc_xdpsq_fifo(struct mlx5e_xdpsq *sq, int numa)
{ {
struct mlx5e_xdp_info_fifo *xdpi_fifo = &sq->db.xdpi_fifo; struct mlx5e_xdp_info_fifo *xdpi_fifo = &sq->db.xdpi_fifo;
int wq_sz = mlx5_wq_cyc_get_size(&sq->wq); int wq_sz = mlx5_wq_cyc_get_size(&sq->wq);
int entries = wq_sz * MLX5_SEND_WQEBB_NUM_DS * 2; /* upper bound for maximum num of int entries;
* entries of all xmit_modes.
*/
size_t size; size_t size;
/* upper bound for maximum num of entries of all xmit_modes. */
entries = roundup_pow_of_two(wq_sz * MLX5_SEND_WQEBB_NUM_DS *
MLX5E_XDP_FIFO_ENTRIES2DS_MAX_RATIO);
size = array_size(sizeof(*xdpi_fifo->xi), entries); size = array_size(sizeof(*xdpi_fifo->xi), entries);
xdpi_fifo->xi = kvzalloc_node(size, GFP_KERNEL, numa); xdpi_fifo->xi = kvzalloc_node(size, GFP_KERNEL, numa);
if (!xdpi_fifo->xi) if (!xdpi_fifo->xi)
......
...@@ -245,12 +245,20 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns, ...@@ -245,12 +245,20 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns,
mlx5_lag_is_shared_fdb(dev) && mlx5_lag_is_shared_fdb(dev) &&
mlx5_lag_is_master(dev)) { mlx5_lag_is_master(dev)) {
struct mlx5_core_dev *peer_dev; struct mlx5_core_dev *peer_dev;
int i; int i, j;
mlx5_lag_for_each_peer_mdev(dev, peer_dev, i) { mlx5_lag_for_each_peer_mdev(dev, peer_dev, i) {
err = mlx5_cmd_set_slave_root_fdb(dev, peer_dev, !disconnect, err = mlx5_cmd_set_slave_root_fdb(dev, peer_dev, !disconnect,
(!disconnect) ? ft->id : 0); (!disconnect) ? ft->id : 0);
if (err && !disconnect) { if (err && !disconnect) {
mlx5_lag_for_each_peer_mdev(dev, peer_dev, j) {
if (j < i)
mlx5_cmd_set_slave_root_fdb(dev, peer_dev, 1,
ns->root_ft->id);
else
break;
}
MLX5_SET(set_flow_table_root_in, in, op_mod, 0); MLX5_SET(set_flow_table_root_in, in, op_mod, 0);
MLX5_SET(set_flow_table_root_in, in, table_id, MLX5_SET(set_flow_table_root_in, in, table_id,
ns->root_ft->id); ns->root_ft->id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment