History

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

Saeed Mahameed says: ==================== mlx5 fixes 2022-06-08 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2022-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: fs, fail conflicting actions net/mlx5: Rearm the FW tracer after each tracer event net/mlx5: E-Switch, pair only capable devices net/mlx5e: CT: Fix cleanup of CT before cleanup of TC ct rules Revert "net/mlx5e: Allow relaxed ordering over VFs" MAINTAINERS: adjust MELLANOX ETHERNET INNOVA DRIVERS to TLS support removal ====================

Jakub Kicinski committed 4 years ago

Commit bf56a092 parents a3bd210 8fa5e7b10 files · +74 −46Browse files

Unified · Split

10 files
  1. MAINTAINERS +0 −1
  2. drivers/net/ethernet/mellanox/mlx5/core/dev.c +0 −18
  3. drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +5 −2
  4. drivers/net/ethernet/mellanox/mlx5/core/en/params.c +2 −1
  5. drivers/net/ethernet/mellanox/mlx5/core/en_common.c +3 −2
  6. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +16 −15
  7. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +6 −3
  8. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +32 −3
  9. drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h +10 −0
  10. drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +0 −1
MAINTAINERS+0−1
@@ -12703,7 +12703,6 @@ L: netdev@vger.kernel.org · 12702 unmodified lines
1270312703 S: Supported
1270412704 W: http://www.mellanox.com
1270512705 Q: https://patchwork.kernel.org/project/netdevbpf/list/
12706−F: drivers/net/ethernet/mellanox/mlx5/core/accel/*
1270712706 F: drivers/net/ethernet/mellanox/mlx5/core/en_accel/*
1270812707 F: drivers/net/ethernet/mellanox/mlx5/core/fpga/*
1270912708 F: include/linux/mlx5/mlx5_ifc_fpga.h
drivers/net/ethernet/mellanox/mlx5/core/dev.c+0−18
@@ -579,17 +579,6 @@ static void *pci_get_other_drvdata(struct device *this, struct device *other) · 578 unmodified lines
579579 return pci_get_drvdata(to_pci_dev(other));
580580 }
581581
582−static int next_phys_dev(struct device *dev, const void *data)
583−{
584− struct mlx5_core_dev *mdev, *this = (struct mlx5_core_dev *)data;
585−
586− mdev = pci_get_other_drvdata(this->device, dev);
587− if (!mdev)
588− return 0;
589−
590− return _next_phys_dev(mdev, data);
591−}
592−
593582 static int next_phys_dev_lag(struct device *dev, const void *data)
594583 {
595584 struct mlx5_core_dev *mdev, *this = (struct mlx5_core_dev *)data;
@@ -623,13 +612,6 @@ static struct mlx5_core_dev *mlx5_get_next_dev(struct mlx5_core_dev *dev, · 27 unmodified lines
623612 return pci_get_drvdata(to_pci_dev(next));
624613 }
625614
626−/* Must be called with intf_mutex held */
627−struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev)
628−{
629− lockdep_assert_held(&mlx5_intf_mutex);
630− return mlx5_get_next_dev(dev, &next_phys_dev);
631−}
632−
633615 /* Must be called with intf_mutex held */
634616 struct mlx5_core_dev *mlx5_get_next_phys_dev_lag(struct mlx5_core_dev *dev)
635617 {
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c+5−2
@@ -675,6 +675,9 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work) · 674 unmodified lines
675675 if (!tracer->owner)
676676 return;
677677
678+ if (unlikely(!tracer->str_db.loaded))
679+ goto arm;
680+
678681 block_count = tracer->buff.size / TRACER_BLOCK_SIZE_BYTE;
679682 start_offset = tracer->buff.consumer_index * TRACER_BLOCK_SIZE_BYTE;
680683
@@ -732,6 +735,7 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work) · 51 unmodified lines
732735 &tmp_trace_block[TRACES_PER_BLOCK - 1]);
733736 }
734737
738+arm:
735739 mlx5_fw_tracer_arm(dev);
736740 }
737741
@@ -1136,8 +1140,7 @@ static int fw_tracer_event(struct notifier_block *nb, unsigned long action, void · 398 unmodified lines
11361140 queue_work(tracer->work_queue, &tracer->ownership_change_work);
11371141 break;
11381142 case MLX5_TRACER_SUBTYPE_TRACES_AVAILABLE:
1139− if (likely(tracer->str_db.loaded))
1140− queue_work(tracer->work_queue, &tracer->handle_traces_work);
1143+ queue_work(tracer->work_queue, &tracer->handle_traces_work);
11411144 break;
11421145 default:
11431146 mlx5_core_dbg(dev, "FWTracer: Event with unrecognized subtype: sub_type %d\n",
drivers/net/ethernet/mellanox/mlx5/core/en/params.c+2−1
@@ -565,7 +565,8 @@ static void mlx5e_build_rx_cq_param(struct mlx5_core_dev *mdev, · 564 unmodified lines
565565 static u8 rq_end_pad_mode(struct mlx5_core_dev *mdev, struct mlx5e_params *params)
566566 {
567567 bool lro_en = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO;
568− bool ro = MLX5_CAP_GEN(mdev, relaxed_ordering_write);
568+ bool ro = pcie_relaxed_ordering_enabled(mdev->pdev) &&
569+ MLX5_CAP_GEN(mdev, relaxed_ordering_write);
569570
570571 return ro && lro_en ?
571572 MLX5_WQ_END_PAD_MODE_NONE : MLX5_WQ_END_PAD_MODE_ALIGN;
drivers/net/ethernet/mellanox/mlx5/core/en_common.c+3−2
@@ -38,11 +38,12 @@ · 37 unmodified lines
3838
3939 void mlx5e_mkey_set_relaxed_ordering(struct mlx5_core_dev *mdev, void *mkc)
4040 {
41+ bool ro_pci_enable = pcie_relaxed_ordering_enabled(mdev->pdev);
4142 bool ro_write = MLX5_CAP_GEN(mdev, relaxed_ordering_write);
4243 bool ro_read = MLX5_CAP_GEN(mdev, relaxed_ordering_read);
4344
44− MLX5_SET(mkc, mkc, relaxed_ordering_read, ro_read);
45− MLX5_SET(mkc, mkc, relaxed_ordering_write, ro_write);
45+ MLX5_SET(mkc, mkc, relaxed_ordering_read, ro_pci_enable && ro_read);
46+ MLX5_SET(mkc, mkc, relaxed_ordering_write, ro_pci_enable && ro_write);
4647 }
4748
4849 static int mlx5e_create_mkey(struct mlx5_core_dev *mdev, u32 pdn,
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+16−15
@@ -950,6 +950,13 @@ err_event_reg: · 949 unmodified lines
950950 return err;
951951 }
952952
953+static void mlx5e_cleanup_uplink_rep_tx(struct mlx5e_rep_priv *rpriv)
954+{
955+ mlx5e_rep_tc_netdevice_event_unregister(rpriv);
956+ mlx5e_rep_bond_cleanup(rpriv);
957+ mlx5e_rep_tc_cleanup(rpriv);
958+}
959+
953960 static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
954961 {
955962 struct mlx5e_rep_priv *rpriv = priv->ppriv;
@@ -961,42 +968,36 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv) · 5 unmodified lines
961968 return err;
962969 }
963970
964− err = mlx5e_tc_ht_init(&rpriv->tc_ht);
965− if (err)
966− goto err_ht_init;
967−
968971 if (rpriv->rep->vport == MLX5_VPORT_UPLINK) {
969972 err = mlx5e_init_uplink_rep_tx(rpriv);
970973 if (err)
971974 goto err_init_tx;
972975 }
973976
977+ err = mlx5e_tc_ht_init(&rpriv->tc_ht);
978+ if (err)
979+ goto err_ht_init;
980+
974981 return 0;
975982
976−err_init_tx:
977− mlx5e_tc_ht_cleanup(&rpriv->tc_ht);
978983 err_ht_init:
984+ if (rpriv->rep->vport == MLX5_VPORT_UPLINK)
985+ mlx5e_cleanup_uplink_rep_tx(rpriv);
986+err_init_tx:
979987 mlx5e_destroy_tises(priv);
980988 return err;
981989 }
982990
983−static void mlx5e_cleanup_uplink_rep_tx(struct mlx5e_rep_priv *rpriv)
984−{
985− mlx5e_rep_tc_netdevice_event_unregister(rpriv);
986− mlx5e_rep_bond_cleanup(rpriv);
987− mlx5e_rep_tc_cleanup(rpriv);
988−}
989−
990991 static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv)
991992 {
992993 struct mlx5e_rep_priv *rpriv = priv->ppriv;
993994
994− mlx5e_destroy_tises(priv);
995+ mlx5e_tc_ht_cleanup(&rpriv->tc_ht);
995996
996997 if (rpriv->rep->vport == MLX5_VPORT_UPLINK)
997998 mlx5e_cleanup_uplink_rep_tx(rpriv);
998999
999− mlx5e_tc_ht_cleanup(&rpriv->tc_ht);
1000+ mlx5e_destroy_tises(priv);
10001001 }
10011002
10021003 static void mlx5e_rep_enable(struct mlx5e_priv *priv)
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+6−3
@@ -2690,9 +2690,6 @@ static int mlx5_esw_offloads_devcom_event(int event, · 2689 unmodified lines
26902690
26912691 switch (event) {
26922692 case ESW_OFFLOADS_DEVCOM_PAIR:
2693− if (mlx5_get_next_phys_dev(esw->dev) != peer_esw->dev)
2694− break;
2695−
26962693 if (mlx5_eswitch_vport_match_metadata_enabled(esw) !=
26972694 mlx5_eswitch_vport_match_metadata_enabled(peer_esw))
26982695 break;
@@ -2744,6 +2741,9 @@ static void esw_offloads_devcom_init(struct mlx5_eswitch *esw) · 45 unmodified lines
27442741 if (!MLX5_CAP_ESW(esw->dev, merged_eswitch))
27452742 return;
27462743
2744+ if (!mlx5_is_lag_supported(esw->dev))
2745+ return;
2746+
27472747 mlx5_devcom_register_component(devcom,
27482748 MLX5_DEVCOM_ESW_OFFLOADS,
27492749 mlx5_esw_offloads_devcom_event,
@@ -2761,6 +2761,9 @@ static void esw_offloads_devcom_cleanup(struct mlx5_eswitch *esw) · 11 unmodified lines
27612761 if (!MLX5_CAP_ESW(esw->dev, merged_eswitch))
27622762 return;
27632763
2764+ if (!mlx5_is_lag_supported(esw->dev))
2765+ return;
2766+
27642767 mlx5_devcom_send_event(devcom, MLX5_DEVCOM_ESW_OFFLOADS,
27652768 ESW_OFFLOADS_DEVCOM_UNPAIR, esw);
27662769
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+32−3
@@ -1574,9 +1574,22 @@ static struct mlx5_flow_rule *find_flow_rule(struct fs_fte *fte, · 1573 unmodified lines
15741574 return NULL;
15751575 }
15761576
1577−static bool check_conflicting_actions(u32 action1, u32 action2)
1577+static bool check_conflicting_actions_vlan(const struct mlx5_fs_vlan *vlan0,
1578+ const struct mlx5_fs_vlan *vlan1)
15781579 {
1579− u32 xored_actions = action1 ^ action2;
1580+ return vlan0->ethtype != vlan1->ethtype ||
1581+ vlan0->vid != vlan1->vid ||
1582+ vlan0->prio != vlan1->prio;
1583+}
1584+
1585+static bool check_conflicting_actions(const struct mlx5_flow_act *act1,
1586+ const struct mlx5_flow_act *act2)
1587+{
1588+ u32 action1 = act1->action;
1589+ u32 action2 = act2->action;
1590+ u32 xored_actions;
1591+
1592+ xored_actions = action1 ^ action2;
15801593
15811594 /* if one rule only wants to count, it's ok */
15821595 if (action1 == MLX5_FLOW_CONTEXT_ACTION_COUNT ||
@@ -1593,6 +1606,22 @@ static bool check_conflicting_actions(u32 action1, u32 action2) · 10 unmodified lines
15931606 MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2))
15941607 return true;
15951608
1609+ if (action1 & MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT &&
1610+ act1->pkt_reformat != act2->pkt_reformat)
1611+ return true;
1612+
1613+ if (action1 & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
1614+ act1->modify_hdr != act2->modify_hdr)
1615+ return true;
1616+
1617+ if (action1 & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH &&
1618+ check_conflicting_actions_vlan(&act1->vlan[0], &act2->vlan[0]))
1619+ return true;
1620+
1621+ if (action1 & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2 &&
1622+ check_conflicting_actions_vlan(&act1->vlan[1], &act2->vlan[1]))
1623+ return true;
1624+
15961625 return false;
15971626 }
15981627
@@ -1600,7 +1629,7 @@ static int check_conflicting_ftes(struct fs_fte *fte, · 1 unmodified line
16001629 const struct mlx5_flow_context *flow_context,
16011630 const struct mlx5_flow_act *flow_act)
16021631 {
1603− if (check_conflicting_actions(flow_act->action, fte->action.action)) {
1632+ if (check_conflicting_actions(flow_act, &fte->action)) {
16041633 mlx5_core_warn(get_dev(&fte->node),
16051634 "Found two FTEs with conflicting actions\n");
16061635 return -EEXIST;
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h+10−0
@@ -74,6 +74,16 @@ struct mlx5_lag { · 73 unmodified lines
7474 struct lag_mpesw lag_mpesw;
7575 };
7676
77+static inline bool mlx5_is_lag_supported(struct mlx5_core_dev *dev)
78+{
79+ if (!MLX5_CAP_GEN(dev, vport_group_manager) ||
80+ !MLX5_CAP_GEN(dev, lag_master) ||
81+ MLX5_CAP_GEN(dev, num_lag_ports) < 2 ||
82+ MLX5_CAP_GEN(dev, num_lag_ports) > MLX5_MAX_PORTS)
83+ return false;
84+ return true;
85+}
86+
7787 static inline struct mlx5_lag *
7888 mlx5_lag_dev(struct mlx5_core_dev *dev)
7989 {
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h+0−1
@@ -209,7 +209,6 @@ int mlx5_attach_device(struct mlx5_core_dev *dev); · 208 unmodified lines
209209 void mlx5_detach_device(struct mlx5_core_dev *dev);
210210 int mlx5_register_device(struct mlx5_core_dev *dev);
211211 void mlx5_unregister_device(struct mlx5_core_dev *dev);
212−struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev);
213212 struct mlx5_core_dev *mlx5_get_next_phys_dev_lag(struct mlx5_core_dev *dev);
214213 void mlx5_dev_list_lock(void);
215214 void mlx5_dev_list_unlock(void);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t