From nobody Wed Nov 22 01:51:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SZkkg50wsz51WML; Wed, 22 Nov 2023 01:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SZkkg3s1bz3HM4; Wed, 22 Nov 2023 01:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700617915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YLEIyCVy0BO91BT5u0L+5sTmwlF7HpGjs6l4zY2hzNs=; b=gM0I9d72vEjXC+6vT9XAjvc4C4G8k8VAVhFob4qdxg0WwDYOaMr4Ai5fLpchq17QzDkjck QxM6LfsN9GqXhmu8262txkMwm88ltH96PIQy2y4PnRWKbHMWVHn0DKPYenwo5H5/ukNlzN NsltivOzIjp7wNowuobA8ADPIYyHgewK2P9h/UiN5HhFOf3sp4V1XKExWavQSRjlWaeuYE 3YJaJR4j0dqfGICBawoq9yrbuSSqn9NvKX7uh/vPr7er9YCrdYWAN3XFWMn99ZllNkmomn EsW88IlU8fzZJwnMdBEcIGTycb56TrrL/WQttSmZ8XDjxKDqp5tBRh2HtRMzjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700617915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YLEIyCVy0BO91BT5u0L+5sTmwlF7HpGjs6l4zY2hzNs=; b=DR1hKmrzoP7wARf0EHTA/8Jd8y/82UMbEd22WSuTsCjBHtD/rbkfTZD5nSxQOAulshdFqS D/QM7B2Tn8jnvTH6TvaXJRT7eOj6I2GETmi1JD8nT80B+zAxi/6778A1FHA4KAYwBeR7sh xiK1xpKKv6kGwvBgazAllb2AiGh18hbo6RYhEGDzVyeRHBhC/QzHcxI8xOL1JmeSU04sPd x00p0UdYRzjmSFgUqHdEIczM+PkI8PHV2flk96S5ABjYrbmNfhTQIWCBL2PUxD9dEeJQNX GbmH92PZ88s2TCIURmuU9Ir3xNKtSGZFhusqfMBENtqgpTJQtVQUyz+OqIZiBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700617915; a=rsa-sha256; cv=none; b=ZXfkWgsX3x2Ane4fMj9Eqr8nzAf5d4c0KaEJGSIhoigiK6FV2VSo08UFLhU5+2gSG9YECR heLnR4zUBxZEk/KZ9MwvYjLZPMcIwcyiCtdX0OY0zfFcxB0jLiSCAV6WTZCbCS93o5AS3+ K7me7k783Lid2lwLGTA1pEC2DZfHwzKKtVCzc0u8zHADmbFL6gwjVFWi51DhxEeW6u+B1a bJOWnpcgZ+BK04rb/6H21pZPk5M6QtP0PNxJ+mBjlvEdXGTIlY8qjlyQXvym+jHpzI9nHp OMOsqI+HEL6ppRsWhlCA/9NJbfYy/9DNohKfW6YwxN+jlbApvnUyd7Eam1CVaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SZkkg2p5Lz10HB; Wed, 22 Nov 2023 01:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AM1ptbv077283; Wed, 22 Nov 2023 01:51:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AM1ptiq077280; Wed, 22 Nov 2023 01:51:55 GMT (envelope-from git) Date: Wed, 22 Nov 2023 01:51:55 GMT Message-Id: <202311220151.3AM1ptiq077280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0759f76e579d - stable/14 - mlx5: Use software enum in APIs instead of PRM List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0759f76e579d61e4609b05ea0efcc2d1a63d2679 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0759f76e579d61e4609b05ea0efcc2d1a63d2679 commit 0759f76e579d61e4609b05ea0efcc2d1a63d2679 Author: Mark Bloch AuthorDate: 2023-02-19 12:25:10 +0000 Commit: Konstantin Belousov CommitDate: 2023-11-22 01:40:28 +0000 mlx5: Use software enum in APIs instead of PRM (cherry picked from commit 76ed99ed8ad259792fea752461e2cd1ed481e8e1) --- sys/dev/mlx5/fs.h | 8 ++++- sys/dev/mlx5/mlx5_core/fs_core.h | 4 +-- sys/dev/mlx5/mlx5_core/mlx5_eswitch.c | 8 ++--- sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c | 14 +++++++-- sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c | 4 +-- sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c | 32 ++++++++++---------- sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c | 50 +++++++++++++++---------------- sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 3 +- 8 files changed, 68 insertions(+), 55 deletions(-) diff --git a/sys/dev/mlx5/fs.h b/sys/dev/mlx5/fs.h index 58bdf19ccdab..da1a469d333c 100644 --- a/sys/dev/mlx5/fs.h +++ b/sys/dev/mlx5/fs.h @@ -43,6 +43,12 @@ enum { MLX5_FS_SNIFFER_FLOW_TAG = 0xFFFFFD, }; +enum mlx5_rule_fwd_action { + MLX5_FLOW_RULE_FWD_ACTION_ALLOW = 0x1, + MLX5_FLOW_RULE_FWD_ACTION_DROP = 0x2, + MLX5_FLOW_RULE_FWD_ACTION_DEST = 0x4, +}; + enum { MLX5_FS_FLOW_TAG_MASK = 0xFFFFFF, }; @@ -168,7 +174,7 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft, u8 match_criteria_enable, u32 *match_criteria, u32 *match_value, - u32 action, + u32 sw_action, struct mlx5_flow_act *flow_act, struct mlx5_flow_destination *dest); void mlx5_del_flow_rule(struct mlx5_flow_rule **); diff --git a/sys/dev/mlx5/mlx5_core/fs_core.h b/sys/dev/mlx5/mlx5_core/fs_core.h index 34dacf1af253..3eae7868833f 100644 --- a/sys/dev/mlx5/mlx5_core/fs_core.h +++ b/sys/dev/mlx5/mlx5_core/fs_core.h @@ -81,7 +81,7 @@ struct fs_fte { struct list_head dests; uint32_t index; /* index in ft */ struct mlx5_flow_act flow_act; - u8 action; /* MLX5_FLOW_CONTEXT_ACTION */ + u32 sw_action; /* enum mlx5_rule_fwd_action */ enum fs_fte_status status; }; @@ -290,7 +290,7 @@ int mlx5_cmd_fs_set_fte(struct mlx5_core_dev *dev, enum fs_ft_type type, unsigned int table_id, unsigned int index, unsigned int group_id, struct mlx5_flow_act *flow_act, - unsigned short action, int dest_size, + u32 sw_action, int dest_size, struct list_head *dests); /* mlx5_flow_desination */ int mlx5_cmd_fs_delete_fte(struct mlx5_core_dev *dev, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c b/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c index 9f9350e0260b..15f5f0ff0336 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c @@ -253,7 +253,7 @@ esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u8 mac[ETH_ALEN], u32 vport) match_header, match_c, match_v, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(flow_rule)) { printf("mlx5_core: WARN: ""FDB: Failed to add flow rule: dmac_v(%pM) dmac_c(%pM) -> vport(%d), err(%ld)\n", dmac_v, dmac_c, vport, PTR_ERR(flow_rule)); @@ -825,7 +825,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw, MLX5_MATCH_OUTER_HEADERS, match_c, match_v, - MLX5_FLOW_CONTEXT_ACTION_DROP, + MLX5_FLOW_RULE_FWD_ACTION_DROP, &flow_act, &dest); if (IS_ERR_OR_NULL(vport->ingress.drop_rule)) { err = PTR_ERR(vport->ingress.drop_rule); @@ -885,7 +885,7 @@ static int esw_vport_egress_config(struct mlx5_eswitch *esw, MLX5_MATCH_OUTER_HEADERS, match_c, match_v, - MLX5_FLOW_CONTEXT_ACTION_ALLOW, + MLX5_FLOW_RULE_FWD_ACTION_ALLOW, &flow_act, &dest); if (IS_ERR_OR_NULL(vport->egress.allowed_vlan)) { err = PTR_ERR(vport->egress.allowed_vlan); @@ -902,7 +902,7 @@ static int esw_vport_egress_config(struct mlx5_eswitch *esw, 0, match_c, match_v, - MLX5_FLOW_CONTEXT_ACTION_DROP, + MLX5_FLOW_RULE_FWD_ACTION_DROP, &flow_act, &dest); if (IS_ERR_OR_NULL(vport->egress.drop_rule)) { err = PTR_ERR(vport->egress.drop_rule); diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c index 8c2708c504ee..8032d1a632e5 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c @@ -167,7 +167,7 @@ int mlx5_cmd_fs_set_fte(struct mlx5_core_dev *dev, enum fs_ft_type type, unsigned int table_id, unsigned int index, unsigned int group_id, struct mlx5_flow_act *flow_act, - unsigned short action, int dest_size, + u32 sw_action, int dest_size, struct list_head *dests) /* mlx5_flow_desination */ { u32 out[MLX5_ST_SZ_DW(set_fte_out)] = {0}; @@ -183,10 +183,18 @@ int mlx5_cmd_fs_set_fte(struct mlx5_core_dev *dev, int atomic_mod_cap; u32 prm_action = 0; - if (action != MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) + if (sw_action != MLX5_FLOW_RULE_FWD_ACTION_DEST) dest_size = 0; - prm_action = action; + if (sw_action & MLX5_FLOW_RULE_FWD_ACTION_ALLOW) + prm_action |= MLX5_FLOW_CONTEXT_ACTION_ALLOW; + + if (sw_action & MLX5_FLOW_RULE_FWD_ACTION_DROP) + prm_action |= MLX5_FLOW_CONTEXT_ACTION_DROP; + + if (sw_action & MLX5_FLOW_RULE_FWD_ACTION_DEST) + prm_action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; + inlen = MLX5_ST_SZ_BYTES(set_fte_in) + dest_size * MLX5_ST_SZ_BYTES(dest_format_struct); diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c index 69df9ecba210..d7d63d7932a1 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c @@ -164,7 +164,7 @@ mlx5e_accel_fs_add_inpcb(struct mlx5e_priv *priv, flow = mlx5_add_flow_rule(ft->t, spec->match_criteria_enable, spec->match_criteria, spec->match_value, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); out: @@ -200,7 +200,7 @@ accel_fs_tcp_add_default_rule(struct mlx5e_priv *priv, int type) priv->fts.vlan.t : fs_tcp->tables[type + 1].t; rule = mlx5_add_flow_rule(fs_tcp->tables[type].t, 0, match_criteria, match_value, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR(rule)) return (PTR_ERR(rule)); diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c index 55d7e69d6140..60353e4b3d5b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c @@ -302,7 +302,7 @@ static void fs_remove_node_parent_locked(struct fs_base *node) kfree(node); } -static struct fs_fte *fs_alloc_fte(u8 action, +static struct fs_fte *fs_alloc_fte(u32 sw_action, struct mlx5_flow_act *flow_act, u32 *match_value, unsigned int index) @@ -320,7 +320,7 @@ static struct fs_fte *fs_alloc_fte(u8 action, fte->index = index; INIT_LIST_HEAD(&fte->dests); fte->flow_act = *flow_act; - fte->action = action; + fte->sw_action = sw_action; return fte; } @@ -341,7 +341,7 @@ static struct fs_fte *alloc_star_ft_entry(struct mlx5_flow_table *ft, if (fg->num_ftes == fg->max_ftes) return ERR_PTR(-ENOSPC); - fte = fs_alloc_fte(MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + fte = fs_alloc_fte(MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, match_value, index); if (IS_ERR(fte)) return fte; @@ -447,7 +447,7 @@ static int fs_set_star_rule(struct mlx5_core_dev *dev, src_ft->id, src_fte->index, src_ft->star_rule.fg->id, &src_fte->flow_act, - src_fte->action, + src_fte->sw_action, src_fte->dests_size, &src_fte->dests); if (err) @@ -1590,7 +1590,7 @@ static struct mlx5_flow_rule *_fs_add_dst_fte(struct fs_fte *fte, &fte->status, fte->val, ft->type, ft->id, fte->index, fg->id, &fte->flow_act, - fte->action, fte->dests_size, &fte->dests); + fte->sw_action, fte->dests_size, &fte->dests); if (err) goto free_dst; @@ -1652,7 +1652,7 @@ static unsigned int fs_get_free_fg_index(struct mlx5_flow_group *fg, static struct fs_fte *fs_create_fte(struct mlx5_flow_group *fg, u32 *match_value, - u8 action, + u32 sw_action, struct mlx5_flow_act *flow_act, struct list_head **prev) { @@ -1660,7 +1660,7 @@ static struct fs_fte *fs_create_fte(struct mlx5_flow_group *fg, int index = 0; index = fs_get_free_fg_index(fg, prev); - fte = fs_alloc_fte(action, flow_act, match_value, index); + fte = fs_alloc_fte(sw_action, flow_act, match_value, index); if (IS_ERR(fte)) return fte; @@ -1710,7 +1710,7 @@ static void fs_del_dst(struct mlx5_flow_rule *dst) err = mlx5_cmd_fs_set_fte(dev, ft->vport, &fte->status, match_value, ft->type, ft->id, fte->index, fg->id, - &fte->flow_act, fte->action, + &fte->flow_act, fte->sw_action, fte->dests_size, &fte->dests); if (err) { mlx5_core_warn(dev, "%s can't delete dst %s\n", @@ -1776,7 +1776,7 @@ static bool check_conflicting_actions(const struct mlx5_flow_act *act1, /* Add dst algorithm */ static struct mlx5_flow_rule *fs_add_dst_fg(struct mlx5_flow_group *fg, u32 *match_value, - u8 action, + u32 sw_action, struct mlx5_flow_act *flow_act, struct mlx5_flow_destination *dest) { @@ -1791,7 +1791,7 @@ static struct mlx5_flow_rule *fs_add_dst_fg(struct mlx5_flow_group *fg, /* TODO: Check of size against PRM max size */ mutex_lock(&fte->base.lock); if (fs_match_exact_val(&fg->mask, match_value, &fte->val) && - action == fte->action && + sw_action == fte->sw_action && !check_conflicting_actions(flow_act, &fte->flow_act)) { dst = _fs_add_dst_fte(fte, fg, dest); mutex_unlock(&fte->base.lock); @@ -1808,7 +1808,7 @@ static struct mlx5_flow_rule *fs_add_dst_fg(struct mlx5_flow_group *fg, goto unlock_fg; } - fte = fs_create_fte(fg, match_value, action, flow_act, &prev); + fte = fs_create_fte(fg, match_value, sw_action, flow_act, &prev); if (IS_ERR(fte)) { dst = (void *)fte; goto unlock_fg; @@ -1836,7 +1836,7 @@ static struct mlx5_flow_rule *fs_add_dst_ft(struct mlx5_flow_table *ft, u8 match_criteria_enable, u32 *match_criteria, u32 *match_value, - u8 action, + u32 sw_action, struct mlx5_flow_act *flow_act, struct mlx5_flow_destination *dest) { @@ -1853,7 +1853,7 @@ static struct mlx5_flow_rule *fs_add_dst_ft(struct mlx5_flow_table *ft, match_criteria)) { mutex_unlock(&ft->base.lock); - dst = fs_add_dst_fg(g, match_value, action, flow_act, dest); + dst = fs_add_dst_fg(g, match_value, sw_action, flow_act, dest); if (PTR_ERR(dst) && PTR_ERR(dst) != -ENOSPC) goto unlock; } @@ -1866,7 +1866,7 @@ static struct mlx5_flow_rule *fs_add_dst_ft(struct mlx5_flow_table *ft, } dst = fs_add_dst_fg(g, match_value, - action, flow_act, dest); + sw_action, flow_act, dest); if (IS_ERR(dst)) { /* Remove assumes refcount > 0 and autogroup creates a group * with a refcount = 0. @@ -1886,7 +1886,7 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft, u8 match_criteria_enable, u32 *match_criteria, u32 *match_value, - u32 action, + u32 sw_action, struct mlx5_flow_act *flow_act, struct mlx5_flow_destination *dest) { @@ -1897,7 +1897,7 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft, if (ns) down_read(&ns->dests_rw_sem); dst = fs_add_dst_ft(ft, match_criteria_enable, match_criteria, - match_value, action, flow_act, dest); + match_value, sw_action, flow_act, dest); if (ns) up_read(&ns->dests_rw_sem); diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c index cb23b80deae4..4939deb4c122 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c @@ -293,7 +293,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, rule_p = &ai->ft_rule[MLX5E_TT_ANY]; dest.tir_num = tirn[MLX5E_TT_ANY]; *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -308,7 +308,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -320,7 +320,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -335,7 +335,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -347,7 +347,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -361,7 +361,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -373,7 +373,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -387,7 +387,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -399,7 +399,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -413,7 +413,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -425,7 +425,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_SET(fte_match_param, mv, outer_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -505,7 +505,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV4]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -513,7 +513,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV6]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -524,7 +524,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV4_UDP]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -532,7 +532,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV6_UDP]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -542,7 +542,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV4_TCP]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -550,7 +550,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV6_TCP]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -560,7 +560,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV4_IPSEC_AH]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -568,7 +568,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV6_IPSEC_AH]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -578,7 +578,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) dest.tir_num = tirn[MLX5E_TT_IPV4_IPSEC_ESP]; MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IP); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -587,7 +587,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) MLX5_SET(fte_match_param, mv, inner_headers.ethertype, ETHERTYPE_IPV6); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -597,7 +597,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) rule_p = &priv->fts.main_vxlan_rule[MLX5E_TT_ANY]; dest.tir_num = tirn[MLX5E_TT_ANY]; *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; @@ -730,7 +730,7 @@ mlx5e_add_vlan_rule_sub(struct mlx5e_priv *priv, } *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); @@ -1709,7 +1709,7 @@ mlx5e_add_vxlan_rule_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv, MLX5_SET(fte_match_param, mv, outer_headers.udp_dport, el->port); *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR(*rule_p)) { err = PTR_ERR(*rule_p); @@ -1835,7 +1835,7 @@ mlx5e_add_vxlan_catchall_rule_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) rule_p = &priv->fts.vxlan_catchall_ft_rule; *rule_p = mlx5_add_flow_rule(ft, mc_enable, mc, mv, - MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, &flow_act, &dest); + MLX5_FLOW_RULE_FWD_ACTION_DEST, &flow_act, &dest); if (IS_ERR(*rule_p)) { err = PTR_ERR(*rule_p); diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index dc5396d348c5..b4c9115bc420 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -2209,8 +2209,7 @@ static struct mlx5_ib_flow_handler *create_flow_rule(struct mlx5_ib_dev *dev, } spec->match_criteria_enable = get_match_criteria_enable(spec->match_criteria); - action = dst ? MLX5_FLOW_CONTEXT_ACTION_FWD_DEST : - MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO; + action = dst ? MLX5_FLOW_RULE_FWD_ACTION_DEST : 0; handler->rule = mlx5_add_flow_rule(ft, spec->match_criteria_enable, spec->match_criteria, spec->match_value,