diff options
9 files changed, 119 insertions, 79 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c index eed7101e8bb7..acd946f2ddbe 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c | |||
@@ -399,10 +399,10 @@ add_ethtool_flow_rule(struct mlx5e_priv *priv, | |||
399 | struct mlx5_flow_table *ft, | 399 | struct mlx5_flow_table *ft, |
400 | struct ethtool_rx_flow_spec *fs) | 400 | struct ethtool_rx_flow_spec *fs) |
401 | { | 401 | { |
402 | struct mlx5_flow_act flow_act = { .flags = FLOW_ACT_NO_APPEND }; | ||
402 | struct mlx5_flow_destination *dst = NULL; | 403 | struct mlx5_flow_destination *dst = NULL; |
403 | struct mlx5_flow_act flow_act = {0}; | ||
404 | struct mlx5_flow_spec *spec; | ||
405 | struct mlx5_flow_handle *rule; | 404 | struct mlx5_flow_handle *rule; |
405 | struct mlx5_flow_spec *spec; | ||
406 | int err = 0; | 406 | int err = 0; |
407 | 407 | ||
408 | spec = kvzalloc(sizeof(*spec), GFP_KERNEL); | 408 | spec = kvzalloc(sizeof(*spec), GFP_KERNEL); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index da7555fdb4d5..3e78a727f3e6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | |||
@@ -1664,46 +1664,63 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv, | |||
1664 | return err; | 1664 | return err; |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS)) { | 1667 | if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_CONTROL)) { |
1668 | struct flow_match_ipv4_addrs match; | 1668 | struct flow_match_control match; |
1669 | u16 addr_type; | ||
1669 | 1670 | ||
1670 | flow_rule_match_enc_ipv4_addrs(rule, &match); | 1671 | flow_rule_match_enc_control(rule, &match); |
1671 | MLX5_SET(fte_match_set_lyr_2_4, headers_c, | 1672 | addr_type = match.key->addr_type; |
1672 | src_ipv4_src_ipv6.ipv4_layout.ipv4, | ||
1673 | ntohl(match.mask->src)); | ||
1674 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, | ||
1675 | src_ipv4_src_ipv6.ipv4_layout.ipv4, | ||
1676 | ntohl(match.key->src)); | ||
1677 | |||
1678 | MLX5_SET(fte_match_set_lyr_2_4, headers_c, | ||
1679 | dst_ipv4_dst_ipv6.ipv4_layout.ipv4, | ||
1680 | ntohl(match.mask->dst)); | ||
1681 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, | ||
1682 | dst_ipv4_dst_ipv6.ipv4_layout.ipv4, | ||
1683 | ntohl(match.key->dst)); | ||
1684 | |||
1685 | MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, ethertype); | ||
1686 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, ETH_P_IP); | ||
1687 | } else if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS)) { | ||
1688 | struct flow_match_ipv6_addrs match; | ||
1689 | 1673 | ||
1690 | flow_rule_match_enc_ipv6_addrs(rule, &match); | 1674 | /* For tunnel addr_type used same key id`s as for non-tunnel */ |
1691 | memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_c, | 1675 | if (addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) { |
1692 | src_ipv4_src_ipv6.ipv6_layout.ipv6), | 1676 | struct flow_match_ipv4_addrs match; |
1693 | &match.mask->src, MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6)); | ||
1694 | memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_v, | ||
1695 | src_ipv4_src_ipv6.ipv6_layout.ipv6), | ||
1696 | &match.key->src, MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6)); | ||
1697 | 1677 | ||
1698 | memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_c, | 1678 | flow_rule_match_enc_ipv4_addrs(rule, &match); |
1699 | dst_ipv4_dst_ipv6.ipv6_layout.ipv6), | 1679 | MLX5_SET(fte_match_set_lyr_2_4, headers_c, |
1700 | &match.mask->dst, MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6)); | 1680 | src_ipv4_src_ipv6.ipv4_layout.ipv4, |
1701 | memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_v, | 1681 | ntohl(match.mask->src)); |
1702 | dst_ipv4_dst_ipv6.ipv6_layout.ipv6), | 1682 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, |
1703 | &match.key->dst, MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6)); | 1683 | src_ipv4_src_ipv6.ipv4_layout.ipv4, |
1684 | ntohl(match.key->src)); | ||
1704 | 1685 | ||
1705 | MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, ethertype); | 1686 | MLX5_SET(fte_match_set_lyr_2_4, headers_c, |
1706 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, ETH_P_IPV6); | 1687 | dst_ipv4_dst_ipv6.ipv4_layout.ipv4, |
1688 | ntohl(match.mask->dst)); | ||
1689 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, | ||
1690 | dst_ipv4_dst_ipv6.ipv4_layout.ipv4, | ||
1691 | ntohl(match.key->dst)); | ||
1692 | |||
1693 | MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, | ||
1694 | ethertype); | ||
1695 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, | ||
1696 | ETH_P_IP); | ||
1697 | } else if (addr_type == FLOW_DISSECTOR_KEY_IPV6_ADDRS) { | ||
1698 | struct flow_match_ipv6_addrs match; | ||
1699 | |||
1700 | flow_rule_match_enc_ipv6_addrs(rule, &match); | ||
1701 | memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_c, | ||
1702 | src_ipv4_src_ipv6.ipv6_layout.ipv6), | ||
1703 | &match.mask->src, MLX5_FLD_SZ_BYTES(ipv6_layout, | ||
1704 | ipv6)); | ||
1705 | memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_v, | ||
1706 | src_ipv4_src_ipv6.ipv6_layout.ipv6), | ||
1707 | &match.key->src, MLX5_FLD_SZ_BYTES(ipv6_layout, | ||
1708 | ipv6)); | ||
1709 | |||
1710 | memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_c, | ||
1711 | dst_ipv4_dst_ipv6.ipv6_layout.ipv6), | ||
1712 | &match.mask->dst, MLX5_FLD_SZ_BYTES(ipv6_layout, | ||
1713 | ipv6)); | ||
1714 | memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_v, | ||
1715 | dst_ipv4_dst_ipv6.ipv6_layout.ipv6), | ||
1716 | &match.key->dst, MLX5_FLD_SZ_BYTES(ipv6_layout, | ||
1717 | ipv6)); | ||
1718 | |||
1719 | MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, | ||
1720 | ethertype); | ||
1721 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, | ||
1722 | ETH_P_IPV6); | ||
1723 | } | ||
1707 | } | 1724 | } |
1708 | 1725 | ||
1709 | if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_IP)) { | 1726 | if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_IP)) { |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 9648c2297803..e47dd7c1b909 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
@@ -1568,6 +1568,7 @@ static const struct pci_device_id mlx5_core_pci_table[] = { | |||
1568 | { PCI_VDEVICE(MELLANOX, 0x101e), MLX5_PCI_DEV_IS_VF}, /* ConnectX Family mlx5Gen Virtual Function */ | 1568 | { PCI_VDEVICE(MELLANOX, 0x101e), MLX5_PCI_DEV_IS_VF}, /* ConnectX Family mlx5Gen Virtual Function */ |
1569 | { PCI_VDEVICE(MELLANOX, 0xa2d2) }, /* BlueField integrated ConnectX-5 network controller */ | 1569 | { PCI_VDEVICE(MELLANOX, 0xa2d2) }, /* BlueField integrated ConnectX-5 network controller */ |
1570 | { PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF}, /* BlueField integrated ConnectX-5 network controller VF */ | 1570 | { PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF}, /* BlueField integrated ConnectX-5 network controller VF */ |
1571 | { PCI_VDEVICE(MELLANOX, 0xa2d6) }, /* BlueField-2 integrated ConnectX-6 Dx network controller */ | ||
1571 | { 0, } | 1572 | { 0, } |
1572 | }; | 1573 | }; |
1573 | 1574 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c index 7d81a7735de5..b74b7d0f6590 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | |||
@@ -615,7 +615,7 @@ static int dr_action_handle_cs_recalc(struct mlx5dr_domain *dmn, | |||
615 | * that recalculates the CS and forwards to the vport. | 615 | * that recalculates the CS and forwards to the vport. |
616 | */ | 616 | */ |
617 | ret = mlx5dr_domain_cache_get_recalc_cs_ft_addr(dest_action->vport.dmn, | 617 | ret = mlx5dr_domain_cache_get_recalc_cs_ft_addr(dest_action->vport.dmn, |
618 | dest_action->vport.num, | 618 | dest_action->vport.caps->num, |
619 | final_icm_addr); | 619 | final_icm_addr); |
620 | if (ret) { | 620 | if (ret) { |
621 | mlx5dr_err(dmn, "Failed to get FW cs recalc flow table\n"); | 621 | mlx5dr_err(dmn, "Failed to get FW cs recalc flow table\n"); |
@@ -744,7 +744,7 @@ int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher, | |||
744 | dest_action = action; | 744 | dest_action = action; |
745 | if (rx_rule) { | 745 | if (rx_rule) { |
746 | /* Loopback on WIRE vport is not supported */ | 746 | /* Loopback on WIRE vport is not supported */ |
747 | if (action->vport.num == WIRE_PORT) | 747 | if (action->vport.caps->num == WIRE_PORT) |
748 | goto out_invalid_arg; | 748 | goto out_invalid_arg; |
749 | 749 | ||
750 | attr.final_icm_addr = action->vport.caps->icm_address_rx; | 750 | attr.final_icm_addr = action->vport.caps->icm_address_rx; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c index 01008cd66f75..67dea7698fc9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c | |||
@@ -230,8 +230,7 @@ static int dr_matcher_set_ste_builders(struct mlx5dr_matcher *matcher, | |||
230 | (dmn->type == MLX5DR_DOMAIN_TYPE_FDB || | 230 | (dmn->type == MLX5DR_DOMAIN_TYPE_FDB || |
231 | dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX)) { | 231 | dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX)) { |
232 | ret = mlx5dr_ste_build_src_gvmi_qpn(&sb[idx++], &mask, | 232 | ret = mlx5dr_ste_build_src_gvmi_qpn(&sb[idx++], &mask, |
233 | &dmn->info.caps, | 233 | dmn, inner, rx); |
234 | inner, rx); | ||
235 | if (ret) | 234 | if (ret) |
236 | return ret; | 235 | return ret; |
237 | } | 236 | } |
@@ -458,13 +457,11 @@ static int dr_matcher_add_to_tbl(struct mlx5dr_matcher *matcher) | |||
458 | 457 | ||
459 | prev_matcher = NULL; | 458 | prev_matcher = NULL; |
460 | if (next_matcher && !first) | 459 | if (next_matcher && !first) |
461 | prev_matcher = list_entry(next_matcher->matcher_list.prev, | 460 | prev_matcher = list_prev_entry(next_matcher, matcher_list); |
462 | struct mlx5dr_matcher, | ||
463 | matcher_list); | ||
464 | else if (!first) | 461 | else if (!first) |
465 | prev_matcher = list_entry(tbl->matcher_list.prev, | 462 | prev_matcher = list_last_entry(&tbl->matcher_list, |
466 | struct mlx5dr_matcher, | 463 | struct mlx5dr_matcher, |
467 | matcher_list); | 464 | matcher_list); |
468 | 465 | ||
469 | if (dmn->type == MLX5DR_DOMAIN_TYPE_FDB || | 466 | if (dmn->type == MLX5DR_DOMAIN_TYPE_FDB || |
470 | dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX) { | 467 | dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX) { |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c index 3bc3f66b8fa8..4187f2b112b8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c | |||
@@ -18,7 +18,7 @@ static int dr_rule_append_to_miss_list(struct mlx5dr_ste *new_last_ste, | |||
18 | struct mlx5dr_ste *last_ste; | 18 | struct mlx5dr_ste *last_ste; |
19 | 19 | ||
20 | /* The new entry will be inserted after the last */ | 20 | /* The new entry will be inserted after the last */ |
21 | last_ste = list_entry(miss_list->prev, struct mlx5dr_ste, miss_list_node); | 21 | last_ste = list_last_entry(miss_list, struct mlx5dr_ste, miss_list_node); |
22 | WARN_ON(!last_ste); | 22 | WARN_ON(!last_ste); |
23 | 23 | ||
24 | ste_info_last = kzalloc(sizeof(*ste_info_last), GFP_KERNEL); | 24 | ste_info_last = kzalloc(sizeof(*ste_info_last), GFP_KERNEL); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c index 6b0af64536d8..4efe1b0be4a8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c | |||
@@ -429,12 +429,9 @@ static void dr_ste_remove_middle_ste(struct mlx5dr_ste *ste, | |||
429 | struct mlx5dr_ste *prev_ste; | 429 | struct mlx5dr_ste *prev_ste; |
430 | u64 miss_addr; | 430 | u64 miss_addr; |
431 | 431 | ||
432 | prev_ste = list_entry(mlx5dr_ste_get_miss_list(ste)->prev, struct mlx5dr_ste, | 432 | prev_ste = list_prev_entry(ste, miss_list_node); |
433 | miss_list_node); | 433 | if (WARN_ON(!prev_ste)) |
434 | if (!prev_ste) { | ||
435 | WARN_ON(true); | ||
436 | return; | 434 | return; |
437 | } | ||
438 | 435 | ||
439 | miss_addr = mlx5dr_ste_get_miss_addr(ste->hw_ste); | 436 | miss_addr = mlx5dr_ste_get_miss_addr(ste->hw_ste); |
440 | mlx5dr_ste_set_miss_addr(prev_ste->hw_ste, miss_addr); | 437 | mlx5dr_ste_set_miss_addr(prev_ste->hw_ste, miss_addr); |
@@ -461,8 +458,8 @@ void mlx5dr_ste_free(struct mlx5dr_ste *ste, | |||
461 | struct mlx5dr_ste_htbl *stats_tbl; | 458 | struct mlx5dr_ste_htbl *stats_tbl; |
462 | LIST_HEAD(send_ste_list); | 459 | LIST_HEAD(send_ste_list); |
463 | 460 | ||
464 | first_ste = list_entry(mlx5dr_ste_get_miss_list(ste)->next, | 461 | first_ste = list_first_entry(mlx5dr_ste_get_miss_list(ste), |
465 | struct mlx5dr_ste, miss_list_node); | 462 | struct mlx5dr_ste, miss_list_node); |
466 | stats_tbl = first_ste->htbl; | 463 | stats_tbl = first_ste->htbl; |
467 | 464 | ||
468 | /* Two options: | 465 | /* Two options: |
@@ -479,8 +476,7 @@ void mlx5dr_ste_free(struct mlx5dr_ste *ste, | |||
479 | if (last_ste == first_ste) | 476 | if (last_ste == first_ste) |
480 | next_ste = NULL; | 477 | next_ste = NULL; |
481 | else | 478 | else |
482 | next_ste = list_entry(ste->miss_list_node.next, | 479 | next_ste = list_next_entry(ste, miss_list_node); |
483 | struct mlx5dr_ste, miss_list_node); | ||
484 | 480 | ||
485 | if (!next_ste) { | 481 | if (!next_ste) { |
486 | /* One and only entry in the list */ | 482 | /* One and only entry in the list */ |
@@ -841,6 +837,8 @@ static void dr_ste_copy_mask_misc(char *mask, struct mlx5dr_match_misc *spec) | |||
841 | spec->source_sqn = MLX5_GET(fte_match_set_misc, mask, source_sqn); | 837 | spec->source_sqn = MLX5_GET(fte_match_set_misc, mask, source_sqn); |
842 | 838 | ||
843 | spec->source_port = MLX5_GET(fte_match_set_misc, mask, source_port); | 839 | spec->source_port = MLX5_GET(fte_match_set_misc, mask, source_port); |
840 | spec->source_eswitch_owner_vhca_id = MLX5_GET(fte_match_set_misc, mask, | ||
841 | source_eswitch_owner_vhca_id); | ||
844 | 842 | ||
845 | spec->outer_second_prio = MLX5_GET(fte_match_set_misc, mask, outer_second_prio); | 843 | spec->outer_second_prio = MLX5_GET(fte_match_set_misc, mask, outer_second_prio); |
846 | spec->outer_second_cfi = MLX5_GET(fte_match_set_misc, mask, outer_second_cfi); | 844 | spec->outer_second_cfi = MLX5_GET(fte_match_set_misc, mask, outer_second_cfi); |
@@ -2254,11 +2252,18 @@ static int dr_ste_build_src_gvmi_qpn_bit_mask(struct mlx5dr_match_param *value, | |||
2254 | { | 2252 | { |
2255 | struct mlx5dr_match_misc *misc_mask = &value->misc; | 2253 | struct mlx5dr_match_misc *misc_mask = &value->misc; |
2256 | 2254 | ||
2257 | if (misc_mask->source_port != 0xffff) | 2255 | /* Partial misc source_port is not supported */ |
2256 | if (misc_mask->source_port && misc_mask->source_port != 0xffff) | ||
2257 | return -EINVAL; | ||
2258 | |||
2259 | /* Partial misc source_eswitch_owner_vhca_id is not supported */ | ||
2260 | if (misc_mask->source_eswitch_owner_vhca_id && | ||
2261 | misc_mask->source_eswitch_owner_vhca_id != 0xffff) | ||
2258 | return -EINVAL; | 2262 | return -EINVAL; |
2259 | 2263 | ||
2260 | DR_STE_SET_MASK(src_gvmi_qp, bit_mask, source_gvmi, misc_mask, source_port); | 2264 | DR_STE_SET_MASK(src_gvmi_qp, bit_mask, source_gvmi, misc_mask, source_port); |
2261 | DR_STE_SET_MASK(src_gvmi_qp, bit_mask, source_qp, misc_mask, source_sqn); | 2265 | DR_STE_SET_MASK(src_gvmi_qp, bit_mask, source_qp, misc_mask, source_sqn); |
2266 | misc_mask->source_eswitch_owner_vhca_id = 0; | ||
2262 | 2267 | ||
2263 | return 0; | 2268 | return 0; |
2264 | } | 2269 | } |
@@ -2270,17 +2275,33 @@ static int dr_ste_build_src_gvmi_qpn_tag(struct mlx5dr_match_param *value, | |||
2270 | struct dr_hw_ste_format *hw_ste = (struct dr_hw_ste_format *)hw_ste_p; | 2275 | struct dr_hw_ste_format *hw_ste = (struct dr_hw_ste_format *)hw_ste_p; |
2271 | struct mlx5dr_match_misc *misc = &value->misc; | 2276 | struct mlx5dr_match_misc *misc = &value->misc; |
2272 | struct mlx5dr_cmd_vport_cap *vport_cap; | 2277 | struct mlx5dr_cmd_vport_cap *vport_cap; |
2278 | struct mlx5dr_domain *dmn = sb->dmn; | ||
2279 | struct mlx5dr_cmd_caps *caps; | ||
2273 | u8 *tag = hw_ste->tag; | 2280 | u8 *tag = hw_ste->tag; |
2274 | 2281 | ||
2275 | DR_STE_SET_TAG(src_gvmi_qp, tag, source_qp, misc, source_sqn); | 2282 | DR_STE_SET_TAG(src_gvmi_qp, tag, source_qp, misc, source_sqn); |
2276 | 2283 | ||
2277 | vport_cap = mlx5dr_get_vport_cap(sb->caps, misc->source_port); | 2284 | if (sb->vhca_id_valid) { |
2285 | /* Find port GVMI based on the eswitch_owner_vhca_id */ | ||
2286 | if (misc->source_eswitch_owner_vhca_id == dmn->info.caps.gvmi) | ||
2287 | caps = &dmn->info.caps; | ||
2288 | else if (dmn->peer_dmn && (misc->source_eswitch_owner_vhca_id == | ||
2289 | dmn->peer_dmn->info.caps.gvmi)) | ||
2290 | caps = &dmn->peer_dmn->info.caps; | ||
2291 | else | ||
2292 | return -EINVAL; | ||
2293 | } else { | ||
2294 | caps = &dmn->info.caps; | ||
2295 | } | ||
2296 | |||
2297 | vport_cap = mlx5dr_get_vport_cap(caps, misc->source_port); | ||
2278 | if (!vport_cap) | 2298 | if (!vport_cap) |
2279 | return -EINVAL; | 2299 | return -EINVAL; |
2280 | 2300 | ||
2281 | if (vport_cap->vport_gvmi) | 2301 | if (vport_cap->vport_gvmi) |
2282 | MLX5_SET(ste_src_gvmi_qp, tag, source_gvmi, vport_cap->vport_gvmi); | 2302 | MLX5_SET(ste_src_gvmi_qp, tag, source_gvmi, vport_cap->vport_gvmi); |
2283 | 2303 | ||
2304 | misc->source_eswitch_owner_vhca_id = 0; | ||
2284 | misc->source_port = 0; | 2305 | misc->source_port = 0; |
2285 | 2306 | ||
2286 | return 0; | 2307 | return 0; |
@@ -2288,17 +2309,20 @@ static int dr_ste_build_src_gvmi_qpn_tag(struct mlx5dr_match_param *value, | |||
2288 | 2309 | ||
2289 | int mlx5dr_ste_build_src_gvmi_qpn(struct mlx5dr_ste_build *sb, | 2310 | int mlx5dr_ste_build_src_gvmi_qpn(struct mlx5dr_ste_build *sb, |
2290 | struct mlx5dr_match_param *mask, | 2311 | struct mlx5dr_match_param *mask, |
2291 | struct mlx5dr_cmd_caps *caps, | 2312 | struct mlx5dr_domain *dmn, |
2292 | bool inner, bool rx) | 2313 | bool inner, bool rx) |
2293 | { | 2314 | { |
2294 | int ret; | 2315 | int ret; |
2295 | 2316 | ||
2317 | /* Set vhca_id_valid before we reset source_eswitch_owner_vhca_id */ | ||
2318 | sb->vhca_id_valid = mask->misc.source_eswitch_owner_vhca_id; | ||
2319 | |||
2296 | ret = dr_ste_build_src_gvmi_qpn_bit_mask(mask, sb->bit_mask); | 2320 | ret = dr_ste_build_src_gvmi_qpn_bit_mask(mask, sb->bit_mask); |
2297 | if (ret) | 2321 | if (ret) |
2298 | return ret; | 2322 | return ret; |
2299 | 2323 | ||
2300 | sb->rx = rx; | 2324 | sb->rx = rx; |
2301 | sb->caps = caps; | 2325 | sb->dmn = dmn; |
2302 | sb->inner = inner; | 2326 | sb->inner = inner; |
2303 | sb->lu_type = MLX5DR_STE_LU_TYPE_SRC_GVMI_AND_QP; | 2327 | sb->lu_type = MLX5DR_STE_LU_TYPE_SRC_GVMI_AND_QP; |
2304 | sb->byte_mask = dr_ste_conv_bit_to_byte_mask(sb->bit_mask); | 2328 | sb->byte_mask = dr_ste_conv_bit_to_byte_mask(sb->bit_mask); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h index a37ee6359be2..1cb3769d4e3c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h | |||
@@ -180,6 +180,8 @@ void mlx5dr_send_fill_and_append_ste_send_info(struct mlx5dr_ste *ste, u16 size, | |||
180 | struct mlx5dr_ste_build { | 180 | struct mlx5dr_ste_build { |
181 | u8 inner:1; | 181 | u8 inner:1; |
182 | u8 rx:1; | 182 | u8 rx:1; |
183 | u8 vhca_id_valid:1; | ||
184 | struct mlx5dr_domain *dmn; | ||
183 | struct mlx5dr_cmd_caps *caps; | 185 | struct mlx5dr_cmd_caps *caps; |
184 | u8 lu_type; | 186 | u8 lu_type; |
185 | u16 byte_mask; | 187 | u16 byte_mask; |
@@ -331,7 +333,7 @@ void mlx5dr_ste_build_register_1(struct mlx5dr_ste_build *sb, | |||
331 | bool inner, bool rx); | 333 | bool inner, bool rx); |
332 | int mlx5dr_ste_build_src_gvmi_qpn(struct mlx5dr_ste_build *sb, | 334 | int mlx5dr_ste_build_src_gvmi_qpn(struct mlx5dr_ste_build *sb, |
333 | struct mlx5dr_match_param *mask, | 335 | struct mlx5dr_match_param *mask, |
334 | struct mlx5dr_cmd_caps *caps, | 336 | struct mlx5dr_domain *dmn, |
335 | bool inner, bool rx); | 337 | bool inner, bool rx); |
336 | void mlx5dr_ste_build_empty_always_hit(struct mlx5dr_ste_build *sb, bool rx); | 338 | void mlx5dr_ste_build_empty_always_hit(struct mlx5dr_ste_build *sb, bool rx); |
337 | 339 | ||
@@ -453,7 +455,7 @@ struct mlx5dr_match_misc { | |||
453 | u32 gre_c_present:1; | 455 | u32 gre_c_present:1; |
454 | /* Source port.;0xffff determines wire port */ | 456 | /* Source port.;0xffff determines wire port */ |
455 | u32 source_port:16; | 457 | u32 source_port:16; |
456 | u32 reserved_auto2:16; | 458 | u32 source_eswitch_owner_vhca_id:16; |
457 | /* VLAN ID of first VLAN tag the inner header of the incoming packet. | 459 | /* VLAN ID of first VLAN tag the inner header of the incoming packet. |
458 | * Valid only when inner_second_cvlan_tag ==1 or inner_second_svlan_tag ==1 | 460 | * Valid only when inner_second_cvlan_tag ==1 or inner_second_svlan_tag ==1 |
459 | */ | 461 | */ |
@@ -745,7 +747,6 @@ struct mlx5dr_action { | |||
745 | struct { | 747 | struct { |
746 | struct mlx5dr_domain *dmn; | 748 | struct mlx5dr_domain *dmn; |
747 | struct mlx5dr_cmd_vport_cap *caps; | 749 | struct mlx5dr_cmd_vport_cap *caps; |
748 | u32 num; | ||
749 | } vport; | 750 | } vport; |
750 | struct { | 751 | struct { |
751 | u32 vlan_hdr; /* tpid_pcp_dei_vid */ | 752 | u32 vlan_hdr; /* tpid_pcp_dei_vid */ |
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index a487b681b516..138c50d5a353 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h | |||
@@ -282,7 +282,6 @@ enum { | |||
282 | MLX5_CMD_OP_ALLOC_MODIFY_HEADER_CONTEXT = 0x940, | 282 | MLX5_CMD_OP_ALLOC_MODIFY_HEADER_CONTEXT = 0x940, |
283 | MLX5_CMD_OP_DEALLOC_MODIFY_HEADER_CONTEXT = 0x941, | 283 | MLX5_CMD_OP_DEALLOC_MODIFY_HEADER_CONTEXT = 0x941, |
284 | MLX5_CMD_OP_QUERY_MODIFY_HEADER_CONTEXT = 0x942, | 284 | MLX5_CMD_OP_QUERY_MODIFY_HEADER_CONTEXT = 0x942, |
285 | MLX5_CMD_OP_SYNC_STEERING = 0xb00, | ||
286 | MLX5_CMD_OP_FPGA_CREATE_QP = 0x960, | 285 | MLX5_CMD_OP_FPGA_CREATE_QP = 0x960, |
287 | MLX5_CMD_OP_FPGA_MODIFY_QP = 0x961, | 286 | MLX5_CMD_OP_FPGA_MODIFY_QP = 0x961, |
288 | MLX5_CMD_OP_FPGA_QUERY_QP = 0x962, | 287 | MLX5_CMD_OP_FPGA_QUERY_QP = 0x962, |
@@ -296,6 +295,7 @@ enum { | |||
296 | MLX5_CMD_OP_DESTROY_UCTX = 0xa06, | 295 | MLX5_CMD_OP_DESTROY_UCTX = 0xa06, |
297 | MLX5_CMD_OP_CREATE_UMEM = 0xa08, | 296 | MLX5_CMD_OP_CREATE_UMEM = 0xa08, |
298 | MLX5_CMD_OP_DESTROY_UMEM = 0xa0a, | 297 | MLX5_CMD_OP_DESTROY_UMEM = 0xa0a, |
298 | MLX5_CMD_OP_SYNC_STEERING = 0xb00, | ||
299 | MLX5_CMD_OP_MAX | 299 | MLX5_CMD_OP_MAX |
300 | }; | 300 | }; |
301 | 301 | ||
@@ -487,7 +487,7 @@ union mlx5_ifc_gre_key_bits { | |||
487 | 487 | ||
488 | struct mlx5_ifc_fte_match_set_misc_bits { | 488 | struct mlx5_ifc_fte_match_set_misc_bits { |
489 | u8 gre_c_present[0x1]; | 489 | u8 gre_c_present[0x1]; |
490 | u8 reserved_auto1[0x1]; | 490 | u8 reserved_at_1[0x1]; |
491 | u8 gre_k_present[0x1]; | 491 | u8 gre_k_present[0x1]; |
492 | u8 gre_s_present[0x1]; | 492 | u8 gre_s_present[0x1]; |
493 | u8 source_vhca_port[0x4]; | 493 | u8 source_vhca_port[0x4]; |
@@ -5054,50 +5054,50 @@ struct mlx5_ifc_query_hca_cap_in_bits { | |||
5054 | 5054 | ||
5055 | struct mlx5_ifc_other_hca_cap_bits { | 5055 | struct mlx5_ifc_other_hca_cap_bits { |
5056 | u8 roce[0x1]; | 5056 | u8 roce[0x1]; |
5057 | u8 reserved_0[0x27f]; | 5057 | u8 reserved_at_1[0x27f]; |
5058 | }; | 5058 | }; |
5059 | 5059 | ||
5060 | struct mlx5_ifc_query_other_hca_cap_out_bits { | 5060 | struct mlx5_ifc_query_other_hca_cap_out_bits { |
5061 | u8 status[0x8]; | 5061 | u8 status[0x8]; |
5062 | u8 reserved_0[0x18]; | 5062 | u8 reserved_at_8[0x18]; |
5063 | 5063 | ||
5064 | u8 syndrome[0x20]; | 5064 | u8 syndrome[0x20]; |
5065 | 5065 | ||
5066 | u8 reserved_1[0x40]; | 5066 | u8 reserved_at_40[0x40]; |
5067 | 5067 | ||
5068 | struct mlx5_ifc_other_hca_cap_bits other_capability; | 5068 | struct mlx5_ifc_other_hca_cap_bits other_capability; |
5069 | }; | 5069 | }; |
5070 | 5070 | ||
5071 | struct mlx5_ifc_query_other_hca_cap_in_bits { | 5071 | struct mlx5_ifc_query_other_hca_cap_in_bits { |
5072 | u8 opcode[0x10]; | 5072 | u8 opcode[0x10]; |
5073 | u8 reserved_0[0x10]; | 5073 | u8 reserved_at_10[0x10]; |
5074 | 5074 | ||
5075 | u8 reserved_1[0x10]; | 5075 | u8 reserved_at_20[0x10]; |
5076 | u8 op_mod[0x10]; | 5076 | u8 op_mod[0x10]; |
5077 | 5077 | ||
5078 | u8 reserved_2[0x10]; | 5078 | u8 reserved_at_40[0x10]; |
5079 | u8 function_id[0x10]; | 5079 | u8 function_id[0x10]; |
5080 | 5080 | ||
5081 | u8 reserved_3[0x20]; | 5081 | u8 reserved_at_60[0x20]; |
5082 | }; | 5082 | }; |
5083 | 5083 | ||
5084 | struct mlx5_ifc_modify_other_hca_cap_out_bits { | 5084 | struct mlx5_ifc_modify_other_hca_cap_out_bits { |
5085 | u8 status[0x8]; | 5085 | u8 status[0x8]; |
5086 | u8 reserved_0[0x18]; | 5086 | u8 reserved_at_8[0x18]; |
5087 | 5087 | ||
5088 | u8 syndrome[0x20]; | 5088 | u8 syndrome[0x20]; |
5089 | 5089 | ||
5090 | u8 reserved_1[0x40]; | 5090 | u8 reserved_at_40[0x40]; |
5091 | }; | 5091 | }; |
5092 | 5092 | ||
5093 | struct mlx5_ifc_modify_other_hca_cap_in_bits { | 5093 | struct mlx5_ifc_modify_other_hca_cap_in_bits { |
5094 | u8 opcode[0x10]; | 5094 | u8 opcode[0x10]; |
5095 | u8 reserved_0[0x10]; | 5095 | u8 reserved_at_10[0x10]; |
5096 | 5096 | ||
5097 | u8 reserved_1[0x10]; | 5097 | u8 reserved_at_20[0x10]; |
5098 | u8 op_mod[0x10]; | 5098 | u8 op_mod[0x10]; |
5099 | 5099 | ||
5100 | u8 reserved_2[0x10]; | 5100 | u8 reserved_at_40[0x10]; |
5101 | u8 function_id[0x10]; | 5101 | u8 function_id[0x10]; |
5102 | u8 field_select[0x20]; | 5102 | u8 field_select[0x20]; |
5103 | 5103 | ||