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 ====================
Unified · Split
| @@ -12703,7 +12703,6 @@ L: netdev@vger.kernel.org · 12702 unmodified lines | |||
| 12703 | S: Supported | 12703 | S: Supported |
| 12704 | W: http://www.mellanox.com | 12704 | W: http://www.mellanox.com |
| 12705 | Q: https://patchwork.kernel.org/project/netdevbpf/list/ | 12705 | Q: https://patchwork.kernel.org/project/netdevbpf/list/ |
| 12706 | F: drivers/net/ethernet/mellanox/mlx5/core/accel/* | ||
| 12707 | F: drivers/net/ethernet/mellanox/mlx5/core/en_accel/* | 12706 | F: drivers/net/ethernet/mellanox/mlx5/core/en_accel/* |
| 12708 | F: drivers/net/ethernet/mellanox/mlx5/core/fpga/* | 12707 | F: drivers/net/ethernet/mellanox/mlx5/core/fpga/* |
| 12709 | F: include/linux/mlx5/mlx5_ifc_fpga.h | 12708 | F: include/linux/mlx5/mlx5_ifc_fpga.h |
| @@ -579,17 +579,6 @@ static void *pci_get_other_drvdata(struct device *this, struct device *other) · 578 unmodified lines | |||
| 579 | return pci_get_drvdata(to_pci_dev(other)); | 579 | return pci_get_drvdata(to_pci_dev(other)); |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 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 | |||
| 593 | static int next_phys_dev_lag(struct device *dev, const void *data) | 582 | static int next_phys_dev_lag(struct device *dev, const void *data) |
| 594 | { | 583 | { |
| 595 | struct mlx5_core_dev *mdev, *this = (struct mlx5_core_dev *)data; | 584 | 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 | |||
| 623 | return pci_get_drvdata(to_pci_dev(next)); | 612 | return pci_get_drvdata(to_pci_dev(next)); |
| 624 | } | 613 | } |
| 625 | 614 | ||
| 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 | |||
| 633 | /* Must be called with intf_mutex held */ | 615 | /* Must be called with intf_mutex held */ |
| 634 | struct mlx5_core_dev *mlx5_get_next_phys_dev_lag(struct mlx5_core_dev *dev) | 616 | struct mlx5_core_dev *mlx5_get_next_phys_dev_lag(struct mlx5_core_dev *dev) |
| 635 | { | 617 | { |
| @@ -675,6 +675,9 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work) · 674 unmodified lines | |||
| 675 | if (!tracer->owner) | 675 | if (!tracer->owner) |
| 676 | return; | 676 | return; |
| 677 | 677 | ||
| 678 | if (unlikely(!tracer->str_db.loaded)) | ||
| 679 | goto arm; | ||
| 680 | |||
| 678 | block_count = tracer->buff.size / TRACER_BLOCK_SIZE_BYTE; | 681 | block_count = tracer->buff.size / TRACER_BLOCK_SIZE_BYTE; |
| 679 | start_offset = tracer->buff.consumer_index * TRACER_BLOCK_SIZE_BYTE; | 682 | start_offset = tracer->buff.consumer_index * TRACER_BLOCK_SIZE_BYTE; |
| 680 | 683 | ||
| @@ -732,6 +735,7 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work) · 51 unmodified lines | |||
| 732 | &tmp_trace_block[TRACES_PER_BLOCK - 1]); | 735 | &tmp_trace_block[TRACES_PER_BLOCK - 1]); |
| 733 | } | 736 | } |
| 734 | 737 | ||
| 738 | arm: | ||
| 735 | mlx5_fw_tracer_arm(dev); | 739 | mlx5_fw_tracer_arm(dev); |
| 736 | } | 740 | } |
| 737 | 741 | ||
| @@ -1136,8 +1140,7 @@ static int fw_tracer_event(struct notifier_block *nb, unsigned long action, void · 398 unmodified lines | |||
| 1136 | queue_work(tracer->work_queue, &tracer->ownership_change_work); | 1140 | queue_work(tracer->work_queue, &tracer->ownership_change_work); |
| 1137 | break; | 1141 | break; |
| 1138 | case MLX5_TRACER_SUBTYPE_TRACES_AVAILABLE: | 1142 | case MLX5_TRACER_SUBTYPE_TRACES_AVAILABLE: |
| 1139 | if (likely(tracer->str_db.loaded)) | 1143 | queue_work(tracer->work_queue, &tracer->handle_traces_work); |
| 1140 | queue_work(tracer->work_queue, &tracer->handle_traces_work); | ||
| 1141 | break; | 1144 | break; |
| 1142 | default: | 1145 | default: |
| 1143 | mlx5_core_dbg(dev, "FWTracer: Event with unrecognized subtype: sub_type %d\n", | 1146 | mlx5_core_dbg(dev, "FWTracer: Event with unrecognized subtype: sub_type %d\n", |
| @@ -565,7 +565,8 @@ static void mlx5e_build_rx_cq_param(struct mlx5_core_dev *mdev, · 564 unmodified lines | |||
| 565 | static u8 rq_end_pad_mode(struct mlx5_core_dev *mdev, struct mlx5e_params *params) | 565 | static u8 rq_end_pad_mode(struct mlx5_core_dev *mdev, struct mlx5e_params *params) |
| 566 | { | 566 | { |
| 567 | bool lro_en = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO; | 567 | 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); | ||
| 569 | 570 | ||
| 570 | return ro && lro_en ? | 571 | return ro && lro_en ? |
| 571 | MLX5_WQ_END_PAD_MODE_NONE : MLX5_WQ_END_PAD_MODE_ALIGN; | 572 | MLX5_WQ_END_PAD_MODE_NONE : MLX5_WQ_END_PAD_MODE_ALIGN; |
| @@ -38,11 +38,12 @@ · 37 unmodified lines | |||
| 38 | 38 | ||
| 39 | void mlx5e_mkey_set_relaxed_ordering(struct mlx5_core_dev *mdev, void *mkc) | 39 | void mlx5e_mkey_set_relaxed_ordering(struct mlx5_core_dev *mdev, void *mkc) |
| 40 | { | 40 | { |
| 41 | bool ro_pci_enable = pcie_relaxed_ordering_enabled(mdev->pdev); | ||
| 41 | bool ro_write = MLX5_CAP_GEN(mdev, relaxed_ordering_write); | 42 | bool ro_write = MLX5_CAP_GEN(mdev, relaxed_ordering_write); |
| 42 | bool ro_read = MLX5_CAP_GEN(mdev, relaxed_ordering_read); | 43 | bool ro_read = MLX5_CAP_GEN(mdev, relaxed_ordering_read); |
| 43 | 44 | ||
| 44 | MLX5_SET(mkc, mkc, relaxed_ordering_read, ro_read); | 45 | MLX5_SET(mkc, mkc, relaxed_ordering_read, ro_pci_enable && ro_read); |
| 45 | MLX5_SET(mkc, mkc, relaxed_ordering_write, ro_write); | 46 | MLX5_SET(mkc, mkc, relaxed_ordering_write, ro_pci_enable && ro_write); |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | static int mlx5e_create_mkey(struct mlx5_core_dev *mdev, u32 pdn, | 49 | static int mlx5e_create_mkey(struct mlx5_core_dev *mdev, u32 pdn, |
| @@ -950,6 +950,13 @@ err_event_reg: · 949 unmodified lines | |||
| 950 | return err; | 950 | return err; |
| 951 | } | 951 | } |
| 952 | 952 | ||
| 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 | |||
| 953 | static int mlx5e_init_rep_tx(struct mlx5e_priv *priv) | 960 | static int mlx5e_init_rep_tx(struct mlx5e_priv *priv) |
| 954 | { | 961 | { |
| 955 | struct mlx5e_rep_priv *rpriv = priv->ppriv; | 962 | struct mlx5e_rep_priv *rpriv = priv->ppriv; |
| @@ -961,42 +968,36 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv) · 5 unmodified lines | |||
| 961 | return err; | 968 | return err; |
| 962 | } | 969 | } |
| 963 | 970 | ||
| 964 | err = mlx5e_tc_ht_init(&rpriv->tc_ht); | ||
| 965 | if (err) | ||
| 966 | goto err_ht_init; | ||
| 967 | |||
| 968 | if (rpriv->rep->vport == MLX5_VPORT_UPLINK) { | 971 | if (rpriv->rep->vport == MLX5_VPORT_UPLINK) { |
| 969 | err = mlx5e_init_uplink_rep_tx(rpriv); | 972 | err = mlx5e_init_uplink_rep_tx(rpriv); |
| 970 | if (err) | 973 | if (err) |
| 971 | goto err_init_tx; | 974 | goto err_init_tx; |
| 972 | } | 975 | } |
| 973 | 976 | ||
| 977 | err = mlx5e_tc_ht_init(&rpriv->tc_ht); | ||
| 978 | if (err) | ||
| 979 | goto err_ht_init; | ||
| 980 | |||
| 974 | return 0; | 981 | return 0; |
| 975 | 982 | ||
| 976 | err_init_tx: | ||
| 977 | mlx5e_tc_ht_cleanup(&rpriv->tc_ht); | ||
| 978 | err_ht_init: | 983 | err_ht_init: |
| 984 | if (rpriv->rep->vport == MLX5_VPORT_UPLINK) | ||
| 985 | mlx5e_cleanup_uplink_rep_tx(rpriv); | ||
| 986 | err_init_tx: | ||
| 979 | mlx5e_destroy_tises(priv); | 987 | mlx5e_destroy_tises(priv); |
| 980 | return err; | 988 | return err; |
| 981 | } | 989 | } |
| 982 | 990 | ||
| 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 | |||
| 990 | static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv) | 991 | static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv) |
| 991 | { | 992 | { |
| 992 | struct mlx5e_rep_priv *rpriv = priv->ppriv; | 993 | struct mlx5e_rep_priv *rpriv = priv->ppriv; |
| 993 | 994 | ||
| 994 | mlx5e_destroy_tises(priv); | 995 | mlx5e_tc_ht_cleanup(&rpriv->tc_ht); |
| 995 | 996 | ||
| 996 | if (rpriv->rep->vport == MLX5_VPORT_UPLINK) | 997 | if (rpriv->rep->vport == MLX5_VPORT_UPLINK) |
| 997 | mlx5e_cleanup_uplink_rep_tx(rpriv); | 998 | mlx5e_cleanup_uplink_rep_tx(rpriv); |
| 998 | 999 | ||
| 999 | mlx5e_tc_ht_cleanup(&rpriv->tc_ht); | 1000 | mlx5e_destroy_tises(priv); |
| 1000 | } | 1001 | } |
| 1001 | 1002 | ||
| 1002 | static void mlx5e_rep_enable(struct mlx5e_priv *priv) | 1003 | static void mlx5e_rep_enable(struct mlx5e_priv *priv) |
| @@ -2690,9 +2690,6 @@ static int mlx5_esw_offloads_devcom_event(int event, · 2689 unmodified lines | |||
| 2690 | 2690 | ||
| 2691 | switch (event) { | 2691 | switch (event) { |
| 2692 | case ESW_OFFLOADS_DEVCOM_PAIR: | 2692 | case ESW_OFFLOADS_DEVCOM_PAIR: |
| 2693 | if (mlx5_get_next_phys_dev(esw->dev) != peer_esw->dev) | ||
| 2694 | break; | ||
| 2695 | |||
| 2696 | if (mlx5_eswitch_vport_match_metadata_enabled(esw) != | 2693 | if (mlx5_eswitch_vport_match_metadata_enabled(esw) != |
| 2697 | mlx5_eswitch_vport_match_metadata_enabled(peer_esw)) | 2694 | mlx5_eswitch_vport_match_metadata_enabled(peer_esw)) |
| 2698 | break; | 2695 | break; |
| @@ -2744,6 +2741,9 @@ static void esw_offloads_devcom_init(struct mlx5_eswitch *esw) · 45 unmodified lines | |||
| 2744 | if (!MLX5_CAP_ESW(esw->dev, merged_eswitch)) | 2741 | if (!MLX5_CAP_ESW(esw->dev, merged_eswitch)) |
| 2745 | return; | 2742 | return; |
| 2746 | 2743 | ||
| 2744 | if (!mlx5_is_lag_supported(esw->dev)) | ||
| 2745 | return; | ||
| 2746 | |||
| 2747 | mlx5_devcom_register_component(devcom, | 2747 | mlx5_devcom_register_component(devcom, |
| 2748 | MLX5_DEVCOM_ESW_OFFLOADS, | 2748 | MLX5_DEVCOM_ESW_OFFLOADS, |
| 2749 | mlx5_esw_offloads_devcom_event, | 2749 | mlx5_esw_offloads_devcom_event, |
| @@ -2761,6 +2761,9 @@ static void esw_offloads_devcom_cleanup(struct mlx5_eswitch *esw) · 11 unmodified lines | |||
| 2761 | if (!MLX5_CAP_ESW(esw->dev, merged_eswitch)) | 2761 | if (!MLX5_CAP_ESW(esw->dev, merged_eswitch)) |
| 2762 | return; | 2762 | return; |
| 2763 | 2763 | ||
| 2764 | if (!mlx5_is_lag_supported(esw->dev)) | ||
| 2765 | return; | ||
| 2766 | |||
| 2764 | mlx5_devcom_send_event(devcom, MLX5_DEVCOM_ESW_OFFLOADS, | 2767 | mlx5_devcom_send_event(devcom, MLX5_DEVCOM_ESW_OFFLOADS, |
| 2765 | ESW_OFFLOADS_DEVCOM_UNPAIR, esw); | 2768 | ESW_OFFLOADS_DEVCOM_UNPAIR, esw); |
| 2766 | 2769 | ||
| @@ -1574,9 +1574,22 @@ static struct mlx5_flow_rule *find_flow_rule(struct fs_fte *fte, · 1573 unmodified lines | |||
| 1574 | return NULL; | 1574 | return NULL; |
| 1575 | } | 1575 | } |
| 1576 | 1576 | ||
| 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) | ||
| 1578 | { | 1579 | { |
| 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; | ||
| 1580 | 1593 | ||
| 1581 | /* if one rule only wants to count, it's ok */ | 1594 | /* if one rule only wants to count, it's ok */ |
| 1582 | if (action1 == MLX5_FLOW_CONTEXT_ACTION_COUNT || | 1595 | if (action1 == MLX5_FLOW_CONTEXT_ACTION_COUNT || |
| @@ -1593,6 +1606,22 @@ static bool check_conflicting_actions(u32 action1, u32 action2) · 10 unmodified lines | |||
| 1593 | MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2)) | 1606 | MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2)) |
| 1594 | return true; | 1607 | return true; |
| 1595 | 1608 | ||
| 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 | |||
| 1596 | return false; | 1625 | return false; |
| 1597 | } | 1626 | } |
| 1598 | 1627 | ||
| @@ -1600,7 +1629,7 @@ static int check_conflicting_ftes(struct fs_fte *fte, · 1 unmodified line | |||
| 1600 | const struct mlx5_flow_context *flow_context, | 1629 | const struct mlx5_flow_context *flow_context, |
| 1601 | const struct mlx5_flow_act *flow_act) | 1630 | const struct mlx5_flow_act *flow_act) |
| 1602 | { | 1631 | { |
| 1603 | if (check_conflicting_actions(flow_act->action, fte->action.action)) { | 1632 | if (check_conflicting_actions(flow_act, &fte->action)) { |
| 1604 | mlx5_core_warn(get_dev(&fte->node), | 1633 | mlx5_core_warn(get_dev(&fte->node), |
| 1605 | "Found two FTEs with conflicting actions\n"); | 1634 | "Found two FTEs with conflicting actions\n"); |
| 1606 | return -EEXIST; | 1635 | return -EEXIST; |
| @@ -74,6 +74,16 @@ struct mlx5_lag { · 73 unmodified lines | |||
| 74 | struct lag_mpesw lag_mpesw; | 74 | struct lag_mpesw lag_mpesw; |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 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 | |||
| 77 | static inline struct mlx5_lag * | 87 | static inline struct mlx5_lag * |
| 78 | mlx5_lag_dev(struct mlx5_core_dev *dev) | 88 | mlx5_lag_dev(struct mlx5_core_dev *dev) |
| 79 | { | 89 | { |
| @@ -209,7 +209,6 @@ int mlx5_attach_device(struct mlx5_core_dev *dev); · 208 unmodified lines | |||
| 209 | void mlx5_detach_device(struct mlx5_core_dev *dev); | 209 | void mlx5_detach_device(struct mlx5_core_dev *dev); |
| 210 | int mlx5_register_device(struct mlx5_core_dev *dev); | 210 | int mlx5_register_device(struct mlx5_core_dev *dev); |
| 211 | void mlx5_unregister_device(struct mlx5_core_dev *dev); | 211 | void mlx5_unregister_device(struct mlx5_core_dev *dev); |
| 212 | struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev); | ||
| 213 | struct mlx5_core_dev *mlx5_get_next_phys_dev_lag(struct mlx5_core_dev *dev); | 212 | struct mlx5_core_dev *mlx5_get_next_phys_dev_lag(struct mlx5_core_dev *dev); |
| 214 | void mlx5_dev_list_lock(void); | 213 | void mlx5_dev_list_lock(void); |
| 215 | void mlx5_dev_list_unlock(void); | 214 | void mlx5_dev_list_unlock(void); |