Skip to content

Commit 5ae4bbf

Browse files
committed
Merge tag 'mlx5-fixes-2018-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2018-05-10 the following series includes some fixes for mlx5 core driver. Please pull and let me know if there's any problem. For -stable v4.5 ("net/mlx5: E-Switch, Include VF RDMA stats in vport statistics") For -stable v4.10 ("net/mlx5e: Err if asked to offload TC match on frag being first") ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 1b97013 + f85900c commit 5ae4bbf

File tree

5 files changed

+52
-1
lines changed

5 files changed

+52
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
12611261
f->mask);
12621262
addr_type = key->addr_type;
12631263

1264+
/* the HW doesn't support frag first/later */
1265+
if (mask->flags & FLOW_DIS_FIRST_FRAG)
1266+
return -EOPNOTSUPP;
1267+
12641268
if (mask->flags & FLOW_DIS_IS_FRAGMENT) {
12651269
MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1);
12661270
MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag,

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#include <linux/module.h>
3535
#include <linux/mlx5/driver.h>
3636
#include <linux/mlx5/cmd.h>
37+
#ifdef CONFIG_RFS_ACCEL
38+
#include <linux/cpu_rmap.h>
39+
#endif
3740
#include "mlx5_core.h"
3841
#include "fpga/core.h"
3942
#include "eswitch.h"
@@ -923,3 +926,28 @@ int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq,
923926
MLX5_SET(query_eq_in, in, eq_number, eq->eqn);
924927
return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen);
925928
}
929+
930+
/* This function should only be called after mlx5_cmd_force_teardown_hca */
931+
void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev)
932+
{
933+
struct mlx5_eq_table *table = &dev->priv.eq_table;
934+
struct mlx5_eq *eq;
935+
936+
#ifdef CONFIG_RFS_ACCEL
937+
if (dev->rmap) {
938+
free_irq_cpu_rmap(dev->rmap);
939+
dev->rmap = NULL;
940+
}
941+
#endif
942+
list_for_each_entry(eq, &table->comp_eqs_list, list)
943+
free_irq(eq->irqn, eq);
944+
945+
free_irq(table->pages_eq.irqn, &table->pages_eq);
946+
free_irq(table->async_eq.irqn, &table->async_eq);
947+
free_irq(table->cmd_eq.irqn, &table->cmd_eq);
948+
#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
949+
if (MLX5_CAP_GEN(dev, pg))
950+
free_irq(table->pfault_eq.irqn, &table->pfault_eq);
951+
#endif
952+
pci_free_irq_vectors(dev->pdev);
953+
}

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2175,26 +2175,35 @@ int mlx5_eswitch_get_vport_stats(struct mlx5_eswitch *esw,
21752175
memset(vf_stats, 0, sizeof(*vf_stats));
21762176
vf_stats->rx_packets =
21772177
MLX5_GET_CTR(out, received_eth_unicast.packets) +
2178+
MLX5_GET_CTR(out, received_ib_unicast.packets) +
21782179
MLX5_GET_CTR(out, received_eth_multicast.packets) +
2180+
MLX5_GET_CTR(out, received_ib_multicast.packets) +
21792181
MLX5_GET_CTR(out, received_eth_broadcast.packets);
21802182

21812183
vf_stats->rx_bytes =
21822184
MLX5_GET_CTR(out, received_eth_unicast.octets) +
2185+
MLX5_GET_CTR(out, received_ib_unicast.octets) +
21832186
MLX5_GET_CTR(out, received_eth_multicast.octets) +
2187+
MLX5_GET_CTR(out, received_ib_multicast.octets) +
21842188
MLX5_GET_CTR(out, received_eth_broadcast.octets);
21852189

21862190
vf_stats->tx_packets =
21872191
MLX5_GET_CTR(out, transmitted_eth_unicast.packets) +
2192+
MLX5_GET_CTR(out, transmitted_ib_unicast.packets) +
21882193
MLX5_GET_CTR(out, transmitted_eth_multicast.packets) +
2194+
MLX5_GET_CTR(out, transmitted_ib_multicast.packets) +
21892195
MLX5_GET_CTR(out, transmitted_eth_broadcast.packets);
21902196

21912197
vf_stats->tx_bytes =
21922198
MLX5_GET_CTR(out, transmitted_eth_unicast.octets) +
2199+
MLX5_GET_CTR(out, transmitted_ib_unicast.octets) +
21932200
MLX5_GET_CTR(out, transmitted_eth_multicast.octets) +
2201+
MLX5_GET_CTR(out, transmitted_ib_multicast.octets) +
21942202
MLX5_GET_CTR(out, transmitted_eth_broadcast.octets);
21952203

21962204
vf_stats->multicast =
2197-
MLX5_GET_CTR(out, received_eth_multicast.packets);
2205+
MLX5_GET_CTR(out, received_eth_multicast.packets) +
2206+
MLX5_GET_CTR(out, received_ib_multicast.packets);
21982207

21992208
vf_stats->broadcast =
22002209
MLX5_GET_CTR(out, received_eth_broadcast.packets);

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,6 +1587,14 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev *dev)
15871587

15881588
mlx5_enter_error_state(dev, true);
15891589

1590+
/* Some platforms requiring freeing the IRQ's in the shutdown
1591+
* flow. If they aren't freed they can't be allocated after
1592+
* kexec. There is no need to cleanup the mlx5_core software
1593+
* contexts.
1594+
*/
1595+
mlx5_irq_clear_affinity_hints(dev);
1596+
mlx5_core_eq_free_irqs(dev);
1597+
15901598
return 0;
15911599
}
15921600

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq,
128128
u32 *out, int outlen);
129129
int mlx5_start_eqs(struct mlx5_core_dev *dev);
130130
void mlx5_stop_eqs(struct mlx5_core_dev *dev);
131+
/* This function should only be called after mlx5_cmd_force_teardown_hca */
132+
void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev);
131133
struct mlx5_eq *mlx5_eqn2eq(struct mlx5_core_dev *dev, int eqn);
132134
u32 mlx5_eq_poll_irq_disabled(struct mlx5_eq *eq);
133135
void mlx5_cq_tasklet_cb(unsigned long data);

0 commit comments

Comments
 (0)