Saeed Mahameed says: ==================== mlx5 fixes 2022-05-31 This series provides bug fixes to mlx5 driver. Please pull and let me know if there is any problem. * tag 'mlx5-fixes-2022-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: Fix mlx5_get_next_dev() peer device matching net/mlx5e: Update netdev features after changing XDP state net/mlx5: correct ECE offset in query qp output net/mlx5e: Disable softirq in mlx5e_activate_rq to avoid race condition net/mlx5: CT: Fix header-rewrite re-use for tupels net/mlx5e: TC NIC mode, fix tc chains miss table net/mlx5: Don't use already freed action pointer ====================
Unified · Split
| @@ -571,18 +571,32 @@ static int _next_phys_dev(struct mlx5_core_dev *mdev, · 570 unmodified lines | |||
| 571 | return 1; | 571 | return 1; |
| 572 | } | 572 | } |
| 573 | 573 | ||
| 574 | static void *pci_get_other_drvdata(struct device *this, struct device *other) | ||
| 575 | { | ||
| 576 | if (this->driver != other->driver) | ||
| 577 | return NULL; | ||
| 578 | |||
| 579 | return pci_get_drvdata(to_pci_dev(other)); | ||
| 580 | } | ||
| 581 | |||
| 574 | static int next_phys_dev(struct device *dev, const void *data) | 582 | static int next_phys_dev(struct device *dev, const void *data) |
| 575 | { | 583 | { |
| 576 | struct mlx5_adev *madev = container_of(dev, struct mlx5_adev, adev.dev); | 584 | struct mlx5_core_dev *mdev, *this = (struct mlx5_core_dev *)data; |
| 577 | struct mlx5_core_dev *mdev = madev->mdev; | 585 | |
| 586 | mdev = pci_get_other_drvdata(this->device, dev); | ||
| 587 | if (!mdev) | ||
| 588 | return 0; | ||
| 578 | 589 | ||
| 579 | return _next_phys_dev(mdev, data); | 590 | return _next_phys_dev(mdev, data); |
| 580 | } | 591 | } |
| 581 | 592 | ||
| 582 | static int next_phys_dev_lag(struct device *dev, const void *data) | 593 | static int next_phys_dev_lag(struct device *dev, const void *data) |
| 583 | { | 594 | { |
| 584 | struct mlx5_adev *madev = container_of(dev, struct mlx5_adev, adev.dev); | 595 | struct mlx5_core_dev *mdev, *this = (struct mlx5_core_dev *)data; |
| 585 | struct mlx5_core_dev *mdev = madev->mdev; | 596 | |
| 597 | mdev = pci_get_other_drvdata(this->device, dev); | ||
| 598 | if (!mdev) | ||
| 599 | return 0; | ||
| 586 | 600 | ||
| 587 | if (!MLX5_CAP_GEN(mdev, vport_group_manager) || | 601 | if (!MLX5_CAP_GEN(mdev, vport_group_manager) || |
| 588 | !MLX5_CAP_GEN(mdev, lag_master) || | 602 | !MLX5_CAP_GEN(mdev, lag_master) || |
| @@ -596,19 +610,17 @@ static int next_phys_dev_lag(struct device *dev, const void *data) · 7 unmodified lines | |||
| 596 | static struct mlx5_core_dev *mlx5_get_next_dev(struct mlx5_core_dev *dev, | 610 | static struct mlx5_core_dev *mlx5_get_next_dev(struct mlx5_core_dev *dev, |
| 597 | int (*match)(struct device *dev, const void *data)) | 611 | int (*match)(struct device *dev, const void *data)) |
| 598 | { | 612 | { |
| 599 | struct auxiliary_device *adev; | 613 | struct device *next; |
| 600 | struct mlx5_adev *madev; | ||
| 601 | 614 | ||
| 602 | if (!mlx5_core_is_pf(dev)) | 615 | if (!mlx5_core_is_pf(dev)) |
| 603 | return NULL; | 616 | return NULL; |
| 604 | 617 | ||
| 605 | adev = auxiliary_find_device(NULL, dev, match); | 618 | next = bus_find_device(&pci_bus_type, NULL, dev, match); |
| 606 | if (!adev) | 619 | if (!next) |
| 607 | return NULL; | 620 | return NULL; |
| 608 | 621 | ||
| 609 | madev = container_of(adev, struct mlx5_adev, adev); | 622 | put_device(next); |
| 610 | put_device(&adev->dev); | 623 | return pci_get_drvdata(to_pci_dev(next)); |
| 611 | return madev->mdev; | ||
| 612 | } | 624 | } |
| 613 | 625 | ||
| 614 | /* Must be called with intf_mutex held */ | 626 | /* Must be called with intf_mutex held */ |
| @@ -764,6 +764,7 @@ struct mlx5e_rq { · 763 unmodified lines | |||
| 764 | u8 wq_type; | 764 | u8 wq_type; |
| 765 | u32 rqn; | 765 | u32 rqn; |
| 766 | struct mlx5_core_dev *mdev; | 766 | struct mlx5_core_dev *mdev; |
| 767 | struct mlx5e_channel *channel; | ||
| 767 | u32 umr_mkey; | 768 | u32 umr_mkey; |
| 768 | struct mlx5e_dma_info wqe_overflow; | 769 | struct mlx5e_dma_info wqe_overflow; |
| 769 | 770 | ||
| @@ -1076,6 +1077,9 @@ void mlx5e_close_cq(struct mlx5e_cq *cq); · 306 unmodified lines | |||
| 1076 | int mlx5e_open_locked(struct net_device *netdev); | 1077 | int mlx5e_open_locked(struct net_device *netdev); |
| 1077 | int mlx5e_close_locked(struct net_device *netdev); | 1078 | int mlx5e_close_locked(struct net_device *netdev); |
| 1078 | 1079 | ||
| 1080 | void mlx5e_trigger_napi_icosq(struct mlx5e_channel *c); | ||
| 1081 | void mlx5e_trigger_napi_sched(struct napi_struct *napi); | ||
| 1082 | |||
| 1079 | int mlx5e_open_channels(struct mlx5e_priv *priv, | 1083 | int mlx5e_open_channels(struct mlx5e_priv *priv, |
| 1080 | struct mlx5e_channels *chs); | 1084 | struct mlx5e_channels *chs); |
| 1081 | void mlx5e_close_channels(struct mlx5e_channels *chs); | 1085 | void mlx5e_close_channels(struct mlx5e_channels *chs); |
| @@ -12,6 +12,7 @@ struct mlx5e_post_act; · 11 unmodified lines | |||
| 12 | enum { | 12 | enum { |
| 13 | MLX5E_TC_FT_LEVEL = 0, | 13 | MLX5E_TC_FT_LEVEL = 0, |
| 14 | MLX5E_TC_TTC_FT_LEVEL, | 14 | MLX5E_TC_TTC_FT_LEVEL, |
| 15 | MLX5E_TC_MISS_LEVEL, | ||
| 15 | }; | 16 | }; |
| 16 | 17 | ||
| 17 | struct mlx5e_tc_table { | 18 | struct mlx5e_tc_table { |
| @@ -20,6 +21,7 @@ struct mlx5e_tc_table { · 2 unmodified lines | |||
| 20 | */ | 21 | */ |
| 21 | struct mutex t_lock; | 22 | struct mutex t_lock; |
| 22 | struct mlx5_flow_table *t; | 23 | struct mlx5_flow_table *t; |
| 24 | struct mlx5_flow_table *miss_t; | ||
| 23 | struct mlx5_fs_chains *chains; | 25 | struct mlx5_fs_chains *chains; |
| 24 | struct mlx5e_post_act *post_act; | 26 | struct mlx5e_post_act *post_act; |
| 25 | 27 | ||
| @@ -736,6 +736,7 @@ void mlx5e_ptp_activate_channel(struct mlx5e_ptp *c) · 735 unmodified lines | |||
| 736 | if (test_bit(MLX5E_PTP_STATE_RX, c->state)) { | 736 | if (test_bit(MLX5E_PTP_STATE_RX, c->state)) { |
| 737 | mlx5e_ptp_rx_set_fs(c->priv); | 737 | mlx5e_ptp_rx_set_fs(c->priv); |
| 738 | mlx5e_activate_rq(&c->rq); | 738 | mlx5e_activate_rq(&c->rq); |
| 739 | mlx5e_trigger_napi_sched(&c->napi); | ||
| 739 | } | 740 | } |
| 740 | } | 741 | } |
| 741 | 742 | ||
| @@ -123,6 +123,8 @@ static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx) · 122 unmodified lines | |||
| 123 | xskrq->stats->recover++; | 123 | xskrq->stats->recover++; |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | mlx5e_trigger_napi_icosq(icosq->channel); | ||
| 127 | |||
| 126 | mutex_unlock(&icosq->channel->icosq_recovery_lock); | 128 | mutex_unlock(&icosq->channel->icosq_recovery_lock); |
| 127 | 129 | ||
| 128 | return 0; | 130 | return 0; |
| @@ -166,6 +168,10 @@ static int mlx5e_rx_reporter_err_rq_cqe_recover(void *ctx) · 37 unmodified lines | |||
| 166 | clear_bit(MLX5E_RQ_STATE_RECOVERING, &rq->state); | 168 | clear_bit(MLX5E_RQ_STATE_RECOVERING, &rq->state); |
| 167 | mlx5e_activate_rq(rq); | 169 | mlx5e_activate_rq(rq); |
| 168 | rq->stats->recover++; | 170 | rq->stats->recover++; |
| 171 | if (rq->channel) | ||
| 172 | mlx5e_trigger_napi_icosq(rq->channel); | ||
| 173 | else | ||
| 174 | mlx5e_trigger_napi_sched(rq->cq.napi); | ||
| 169 | return 0; | 175 | return 0; |
| 170 | out: | 176 | out: |
| 171 | clear_bit(MLX5E_RQ_STATE_RECOVERING, &rq->state); | 177 | clear_bit(MLX5E_RQ_STATE_RECOVERING, &rq->state); |
| @@ -715,7 +715,7 @@ mlx5_tc_ct_entry_create_mod_hdr(struct mlx5_tc_ct_priv *ct_priv, · 714 unmodified lines | |||
| 715 | struct mlx5_flow_attr *attr, | 715 | struct mlx5_flow_attr *attr, |
| 716 | struct flow_rule *flow_rule, | 716 | struct flow_rule *flow_rule, |
| 717 | struct mlx5e_mod_hdr_handle **mh, | 717 | struct mlx5e_mod_hdr_handle **mh, |
| 718 | u8 zone_restore_id, bool nat) | 718 | u8 zone_restore_id, bool nat_table, bool has_nat) |
| 719 | { | 719 | { |
| 720 | DECLARE_MOD_HDR_ACTS_ACTIONS(actions_arr, MLX5_CT_MIN_MOD_ACTS); | 720 | DECLARE_MOD_HDR_ACTS_ACTIONS(actions_arr, MLX5_CT_MIN_MOD_ACTS); |
| 721 | DECLARE_MOD_HDR_ACTS(mod_acts, actions_arr); | 721 | DECLARE_MOD_HDR_ACTS(mod_acts, actions_arr); |
| @@ -731,11 +731,12 @@ mlx5_tc_ct_entry_create_mod_hdr(struct mlx5_tc_ct_priv *ct_priv, · 9 unmodified lines | |||
| 731 | &attr->ct_attr.ct_labels_id); | 731 | &attr->ct_attr.ct_labels_id); |
| 732 | if (err) | 732 | if (err) |
| 733 | return -EOPNOTSUPP; | 733 | return -EOPNOTSUPP; |
| 734 | if (nat) { | 734 | if (nat_table) { |
| 735 | err = mlx5_tc_ct_entry_create_nat(ct_priv, flow_rule, | 735 | if (has_nat) { |
| 736 | &mod_acts); | 736 | err = mlx5_tc_ct_entry_create_nat(ct_priv, flow_rule, &mod_acts); |
| 737 | if (err) | 737 | if (err) |
| 738 | goto err_mapping; | 738 | goto err_mapping; |
| 739 | } | ||
| 739 | 740 | ||
| 740 | ct_state |= MLX5_CT_STATE_NAT_BIT; | 741 | ct_state |= MLX5_CT_STATE_NAT_BIT; |
| 741 | } | 742 | } |
| @@ -750,7 +751,7 @@ mlx5_tc_ct_entry_create_mod_hdr(struct mlx5_tc_ct_priv *ct_priv, · 8 unmodified lines | |||
| 750 | if (err) | 751 | if (err) |
| 751 | goto err_mapping; | 752 | goto err_mapping; |
| 752 | 753 | ||
| 753 | if (nat) { | 754 | if (nat_table && has_nat) { |
| 754 | attr->modify_hdr = mlx5_modify_header_alloc(ct_priv->dev, ct_priv->ns_type, | 755 | attr->modify_hdr = mlx5_modify_header_alloc(ct_priv->dev, ct_priv->ns_type, |
| 755 | mod_acts.num_actions, | 756 | mod_acts.num_actions, |
| 756 | mod_acts.actions); | 757 | mod_acts.actions); |
| @@ -818,7 +819,9 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, · 61 unmodified lines | |||
| 818 | 819 | ||
| 819 | err = mlx5_tc_ct_entry_create_mod_hdr(ct_priv, attr, flow_rule, | 820 | err = mlx5_tc_ct_entry_create_mod_hdr(ct_priv, attr, flow_rule, |
| 820 | &zone_rule->mh, | 821 | &zone_rule->mh, |
| 821 | zone_restore_id, nat); | 822 | zone_restore_id, |
| 823 | nat, | ||
| 824 | mlx5_tc_ct_entry_has_nat(entry)); | ||
| 822 | if (err) { | 825 | if (err) { |
| 823 | ct_dbg("Failed to create ct entry mod hdr"); | 826 | ct_dbg("Failed to create ct entry mod hdr"); |
| 824 | goto err_mod_hdr; | 827 | goto err_mod_hdr; |
| @@ -179,6 +179,7 @@ static void mlx5e_activate_trap(struct mlx5e_trap *trap) · 178 unmodified lines | |||
| 179 | { | 179 | { |
| 180 | napi_enable(&trap->napi); | 180 | napi_enable(&trap->napi); |
| 181 | mlx5e_activate_rq(&trap->rq); | 181 | mlx5e_activate_rq(&trap->rq); |
| 182 | mlx5e_trigger_napi_sched(&trap->napi); | ||
| 182 | } | 183 | } |
| 183 | 184 | ||
| 184 | void mlx5e_deactivate_trap(struct mlx5e_priv *priv) | 185 | void mlx5e_deactivate_trap(struct mlx5e_priv *priv) |
| @@ -117,6 +117,7 @@ static int mlx5e_xsk_enable_locked(struct mlx5e_priv *priv, · 116 unmodified lines | |||
| 117 | goto err_remove_pool; | 117 | goto err_remove_pool; |
| 118 | 118 | ||
| 119 | mlx5e_activate_xsk(c); | 119 | mlx5e_activate_xsk(c); |
| 120 | mlx5e_trigger_napi_icosq(c); | ||
| 120 | 121 | ||
| 121 | /* Don't wait for WQEs, because the newer xdpsock sample doesn't provide | 122 | /* Don't wait for WQEs, because the newer xdpsock sample doesn't provide |
| 122 | * any Fill Ring entries at the setup stage. | 123 | * any Fill Ring entries at the setup stage. |
| @@ -64,6 +64,7 @@ static int mlx5e_init_xsk_rq(struct mlx5e_channel *c, · 63 unmodified lines | |||
| 64 | rq->clock = &mdev->clock; | 64 | rq->clock = &mdev->clock; |
| 65 | rq->icosq = &c->icosq; | 65 | rq->icosq = &c->icosq; |
| 66 | rq->ix = c->ix; | 66 | rq->ix = c->ix; |
| 67 | rq->channel = c; | ||
| 67 | rq->mdev = mdev; | 68 | rq->mdev = mdev; |
| 68 | rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu); | 69 | rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu); |
| 69 | rq->xdpsq = &c->rq_xdpsq; | 70 | rq->xdpsq = &c->rq_xdpsq; |
| @@ -179,10 +180,6 @@ void mlx5e_activate_xsk(struct mlx5e_channel *c) · 109 unmodified lines | |||
| 179 | mlx5e_reporter_icosq_resume_recovery(c); | 180 | mlx5e_reporter_icosq_resume_recovery(c); |
| 180 | 181 | ||
| 181 | /* TX queue is created active. */ | 182 | /* TX queue is created active. */ |
| 182 | |||
| 183 | spin_lock_bh(&c->async_icosq_lock); | ||
| 184 | mlx5e_trigger_irq(&c->async_icosq); | ||
| 185 | spin_unlock_bh(&c->async_icosq_lock); | ||
| 186 | } | 183 | } |
| 187 | 184 | ||
| 188 | void mlx5e_deactivate_xsk(struct mlx5e_channel *c) | 185 | void mlx5e_deactivate_xsk(struct mlx5e_channel *c) |
| @@ -475,6 +475,7 @@ static int mlx5e_init_rxq_rq(struct mlx5e_channel *c, struct mlx5e_params *param · 474 unmodified lines | |||
| 475 | rq->clock = &mdev->clock; | 475 | rq->clock = &mdev->clock; |
| 476 | rq->icosq = &c->icosq; | 476 | rq->icosq = &c->icosq; |
| 477 | rq->ix = c->ix; | 477 | rq->ix = c->ix; |
| 478 | rq->channel = c; | ||
| 478 | rq->mdev = mdev; | 479 | rq->mdev = mdev; |
| 479 | rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu); | 480 | rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu); |
| 480 | rq->xdpsq = &c->rq_xdpsq; | 481 | rq->xdpsq = &c->rq_xdpsq; |
| @@ -1066,13 +1067,6 @@ err_free_rq: · 585 unmodified lines | |||
| 1066 | void mlx5e_activate_rq(struct mlx5e_rq *rq) | 1067 | void mlx5e_activate_rq(struct mlx5e_rq *rq) |
| 1067 | { | 1068 | { |
| 1068 | set_bit(MLX5E_RQ_STATE_ENABLED, &rq->state); | 1069 | set_bit(MLX5E_RQ_STATE_ENABLED, &rq->state); |
| 1069 | if (rq->icosq) { | ||
| 1070 | mlx5e_trigger_irq(rq->icosq); | ||
| 1071 | } else { | ||
| 1072 | local_bh_disable(); | ||
| 1073 | napi_schedule(rq->cq.napi); | ||
| 1074 | local_bh_enable(); | ||
| 1075 | } | ||
| 1076 | } | 1070 | } |
| 1077 | 1071 | ||
| 1078 | void mlx5e_deactivate_rq(struct mlx5e_rq *rq) | 1072 | void mlx5e_deactivate_rq(struct mlx5e_rq *rq) |
| @@ -2227,6 +2221,20 @@ static int mlx5e_channel_stats_alloc(struct mlx5e_priv *priv, int ix, int cpu) · 1148 unmodified lines | |||
| 2227 | return 0; | 2221 | return 0; |
| 2228 | } | 2222 | } |
| 2229 | 2223 | ||
| 2224 | void mlx5e_trigger_napi_icosq(struct mlx5e_channel *c) | ||
| 2225 | { | ||
| 2226 | spin_lock_bh(&c->async_icosq_lock); | ||
| 2227 | mlx5e_trigger_irq(&c->async_icosq); | ||
| 2228 | spin_unlock_bh(&c->async_icosq_lock); | ||
| 2229 | } | ||
| 2230 | |||
| 2231 | void mlx5e_trigger_napi_sched(struct napi_struct *napi) | ||
| 2232 | { | ||
| 2233 | local_bh_disable(); | ||
| 2234 | napi_schedule(napi); | ||
| 2235 | local_bh_enable(); | ||
| 2236 | } | ||
| 2237 | |||
| 2230 | static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix, | 2238 | static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix, |
| 2231 | struct mlx5e_params *params, | 2239 | struct mlx5e_params *params, |
| 2232 | struct mlx5e_channel_param *cparam, | 2240 | struct mlx5e_channel_param *cparam, |
| @@ -2308,6 +2316,8 @@ static void mlx5e_activate_channel(struct mlx5e_channel *c) · 75 unmodified lines | |||
| 2308 | 2316 | ||
| 2309 | if (test_bit(MLX5E_CHANNEL_STATE_XSK, c->state)) | 2317 | if (test_bit(MLX5E_CHANNEL_STATE_XSK, c->state)) |
| 2310 | mlx5e_activate_xsk(c); | 2318 | mlx5e_activate_xsk(c); |
| 2319 | |||
| 2320 | mlx5e_trigger_napi_icosq(c); | ||
| 2311 | } | 2321 | } |
| 2312 | 2322 | ||
| 2313 | static void mlx5e_deactivate_channel(struct mlx5e_channel *c) | 2323 | static void mlx5e_deactivate_channel(struct mlx5e_channel *c) |
| @@ -4559,6 +4569,11 @@ static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog) · 2245 unmodified lines | |||
| 4559 | 4569 | ||
| 4560 | unlock: | 4570 | unlock: |
| 4561 | mutex_unlock(&priv->state_lock); | 4571 | mutex_unlock(&priv->state_lock); |
| 4572 | |||
| 4573 | /* Need to fix some features. */ | ||
| 4574 | if (!err) | ||
| 4575 | netdev_update_features(netdev); | ||
| 4576 | |||
| 4562 | return err; | 4577 | return err; |
| 4563 | } | 4578 | } |
| 4564 | 4579 | ||
| @@ -4714,6 +4714,33 @@ static int mlx5e_tc_nic_get_ft_size(struct mlx5_core_dev *dev) · 4713 unmodified lines | |||
| 4714 | return tc_tbl_size; | 4714 | return tc_tbl_size; |
| 4715 | } | 4715 | } |
| 4716 | 4716 | ||
| 4717 | static int mlx5e_tc_nic_create_miss_table(struct mlx5e_priv *priv) | ||
| 4718 | { | ||
| 4719 | struct mlx5_flow_table **ft = &priv->fs.tc.miss_t; | ||
| 4720 | struct mlx5_flow_table_attr ft_attr = {}; | ||
| 4721 | struct mlx5_flow_namespace *ns; | ||
| 4722 | int err = 0; | ||
| 4723 | |||
| 4724 | ft_attr.max_fte = 1; | ||
| 4725 | ft_attr.autogroup.max_num_groups = 1; | ||
| 4726 | ft_attr.level = MLX5E_TC_MISS_LEVEL; | ||
| 4727 | ft_attr.prio = 0; | ||
| 4728 | ns = mlx5_get_flow_namespace(priv->mdev, MLX5_FLOW_NAMESPACE_KERNEL); | ||
| 4729 | |||
| 4730 | *ft = mlx5_create_auto_grouped_flow_table(ns, &ft_attr); | ||
| 4731 | if (IS_ERR(*ft)) { | ||
| 4732 | err = PTR_ERR(*ft); | ||
| 4733 | netdev_err(priv->netdev, "failed to create tc nic miss table err=%d\n", err); | ||
| 4734 | } | ||
| 4735 | |||
| 4736 | return err; | ||
| 4737 | } | ||
| 4738 | |||
| 4739 | static void mlx5e_tc_nic_destroy_miss_table(struct mlx5e_priv *priv) | ||
| 4740 | { | ||
| 4741 | mlx5_destroy_flow_table(priv->fs.tc.miss_t); | ||
| 4742 | } | ||
| 4743 | |||
| 4717 | int mlx5e_tc_nic_init(struct mlx5e_priv *priv) | 4744 | int mlx5e_tc_nic_init(struct mlx5e_priv *priv) |
| 4718 | { | 4745 | { |
| 4719 | struct mlx5e_tc_table *tc = &priv->fs.tc; | 4746 | struct mlx5e_tc_table *tc = &priv->fs.tc; |
| @@ -4746,19 +4773,23 @@ int mlx5e_tc_nic_init(struct mlx5e_priv *priv) · 26 unmodified lines | |||
| 4746 | } | 4773 | } |
| 4747 | tc->mapping = chains_mapping; | 4774 | tc->mapping = chains_mapping; |
| 4748 | 4775 | ||
| 4776 | err = mlx5e_tc_nic_create_miss_table(priv); | ||
| 4777 | if (err) | ||
| 4778 | goto err_chains; | ||
| 4779 | |||
| 4749 | if (MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, ignore_flow_level)) | 4780 | if (MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, ignore_flow_level)) |
| 4750 | attr.flags = MLX5_CHAINS_AND_PRIOS_SUPPORTED | | 4781 | attr.flags = MLX5_CHAINS_AND_PRIOS_SUPPORTED | |
| 4751 | MLX5_CHAINS_IGNORE_FLOW_LEVEL_SUPPORTED; | 4782 | MLX5_CHAINS_IGNORE_FLOW_LEVEL_SUPPORTED; |
| 4752 | attr.ns = MLX5_FLOW_NAMESPACE_KERNEL; | 4783 | attr.ns = MLX5_FLOW_NAMESPACE_KERNEL; |
| 4753 | attr.max_ft_sz = mlx5e_tc_nic_get_ft_size(dev); | 4784 | attr.max_ft_sz = mlx5e_tc_nic_get_ft_size(dev); |
| 4754 | attr.max_grp_num = MLX5E_TC_TABLE_NUM_GROUPS; | 4785 | attr.max_grp_num = MLX5E_TC_TABLE_NUM_GROUPS; |
| 4755 | attr.default_ft = mlx5e_vlan_get_flowtable(priv->fs.vlan); | 4786 | attr.default_ft = priv->fs.tc.miss_t; |
| 4756 | attr.mapping = chains_mapping; | 4787 | attr.mapping = chains_mapping; |
| 4757 | 4788 | ||
| 4758 | tc->chains = mlx5_chains_create(dev, &attr); | 4789 | tc->chains = mlx5_chains_create(dev, &attr); |
| 4759 | if (IS_ERR(tc->chains)) { | 4790 | if (IS_ERR(tc->chains)) { |
| 4760 | err = PTR_ERR(tc->chains); | 4791 | err = PTR_ERR(tc->chains); |
| 4761 | goto err_chains; | 4792 | goto err_miss; |
| 4762 | } | 4793 | } |
| 4763 | 4794 | ||
| 4764 | tc->post_act = mlx5e_tc_post_act_init(priv, tc->chains, MLX5_FLOW_NAMESPACE_KERNEL); | 4795 | tc->post_act = mlx5e_tc_post_act_init(priv, tc->chains, MLX5_FLOW_NAMESPACE_KERNEL); |
| @@ -4781,6 +4812,8 @@ err_reg: · 16 unmodified lines | |||
| 4781 | mlx5_tc_ct_clean(tc->ct); | 4812 | mlx5_tc_ct_clean(tc->ct); |
| 4782 | mlx5e_tc_post_act_destroy(tc->post_act); | 4813 | mlx5e_tc_post_act_destroy(tc->post_act); |
| 4783 | mlx5_chains_destroy(tc->chains); | 4814 | mlx5_chains_destroy(tc->chains); |
| 4815 | err_miss: | ||
| 4816 | mlx5e_tc_nic_destroy_miss_table(priv); | ||
| 4784 | err_chains: | 4817 | err_chains: |
| 4785 | mapping_destroy(chains_mapping); | 4818 | mapping_destroy(chains_mapping); |
| 4786 | err_mapping: | 4819 | err_mapping: |
| @@ -4821,6 +4854,7 @@ void mlx5e_tc_nic_cleanup(struct mlx5e_priv *priv) · 34 unmodified lines | |||
| 4821 | mlx5e_tc_post_act_destroy(tc->post_act); | 4854 | mlx5e_tc_post_act_destroy(tc->post_act); |
| 4822 | mapping_destroy(tc->mapping); | 4855 | mapping_destroy(tc->mapping); |
| 4823 | mlx5_chains_destroy(tc->chains); | 4856 | mlx5_chains_destroy(tc->chains); |
| 4857 | mlx5e_tc_nic_destroy_miss_table(priv); | ||
| 4824 | } | 4858 | } |
| 4825 | 4859 | ||
| 4826 | int mlx5e_tc_ht_init(struct rhashtable *tc_ht) | 4860 | int mlx5e_tc_ht_init(struct rhashtable *tc_ht) |
| @@ -114,7 +114,7 @@ · 113 unmodified lines | |||
| 114 | #define KERNEL_MIN_LEVEL (KERNEL_NIC_PRIO_NUM_LEVELS + 1) | 114 | #define KERNEL_MIN_LEVEL (KERNEL_NIC_PRIO_NUM_LEVELS + 1) |
| 115 | 115 | ||
| 116 | #define KERNEL_NIC_TC_NUM_PRIOS 1 | 116 | #define KERNEL_NIC_TC_NUM_PRIOS 1 |
| 117 | #define KERNEL_NIC_TC_NUM_LEVELS 2 | 117 | #define KERNEL_NIC_TC_NUM_LEVELS 3 |
| 118 | 118 | ||
| 119 | #define ANCHOR_NUM_LEVELS 1 | 119 | #define ANCHOR_NUM_LEVELS 1 |
| 120 | #define ANCHOR_NUM_PRIOS 1 | 120 | #define ANCHOR_NUM_PRIOS 1 |
| @@ -44,11 +44,10 @@ static int set_miss_action(struct mlx5_flow_root_namespace *ns, · 43 unmodified lines | |||
| 44 | err = mlx5dr_table_set_miss_action(ft->fs_dr_table.dr_table, action); | 44 | err = mlx5dr_table_set_miss_action(ft->fs_dr_table.dr_table, action); |
| 45 | if (err && action) { | 45 | if (err && action) { |
| 46 | err = mlx5dr_action_destroy(action); | 46 | err = mlx5dr_action_destroy(action); |
| 47 | if (err) { | 47 | if (err) |
| 48 | action = NULL; | 48 | mlx5_core_err(ns->dev, |
| 49 | mlx5_core_err(ns->dev, "Failed to destroy action (%d)\n", | 49 | "Failed to destroy action (%d)\n", err); |
| 50 | err); | 50 | action = NULL; |
| 51 | } | ||
| 52 | } | 51 | } |
| 53 | ft->fs_dr_table.miss_action = action; | 52 | ft->fs_dr_table.miss_action = action; |
| 54 | if (old_miss_action) { | 53 | if (old_miss_action) { |
| @@ -5176,12 +5176,11 @@ struct mlx5_ifc_query_qp_out_bits { · 5175 unmodified lines | |||
| 5176 | 5176 | ||
| 5177 | u8 syndrome[0x20]; | 5177 | u8 syndrome[0x20]; |
| 5178 | 5178 | ||
| 5179 | u8 reserved_at_40[0x20]; | 5179 | u8 reserved_at_40[0x40]; |
| 5180 | u8 ece[0x20]; | ||
| 5181 | 5180 | ||
| 5182 | u8 opt_param_mask[0x20]; | 5181 | u8 opt_param_mask[0x20]; |
| 5183 | 5182 | ||
| 5184 | u8 reserved_at_a0[0x20]; | 5183 | u8 ece[0x20]; |
| 5185 | 5184 | ||
| 5186 | struct mlx5_ifc_qpc_bits qpc; | 5185 | struct mlx5_ifc_qpc_bits qpc; |
| 5187 | 5186 | ||