From: Yongseok Koh <yskoh@mellanox.com>
To: Jack Min <jackmin@mellanox.com>
Cc: "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
Adrien Mazarguil <adrien.mazarguil@6wind.com>,
John McNamara <john.mcnamara@intel.com>,
Marko Kovacevic <marko.kovacevic@intel.com>,
Thomas Monjalon <thomas@monjalon.net>,
Andrew Rybchenko <arybchenko@solarflare.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: add generic MAC address rewrite actions
Date: Wed, 3 Oct 2018 20:08:26 +0000 [thread overview]
Message-ID: <20181003200800.GD26206@mtidpdk.mti.labs.mlnx> (raw)
In-Reply-To: <20180925150340.25378-2-jackmin@mellanox.com>
On Tue, Sep 25, 2018 at 11:03:38PM +0800, Xiaoyu Min wrote:
> rte_flow actions:
> - RTE_FLOW_ACTION_TYPE_SET_MAC_SRC
> - RTE_FLOW_ACTION_TYPE_SET_MAC_DST
> added in order to offload to NIC
>
> The rte_flow_itme_eth must be present in rte_flow pattern
>
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Thanks
> doc/guides/prog_guide/rte_flow.rst | 30 ++++++++++++++++++++++++++++++
> lib/librte_ethdev/rte_flow.c | 2 ++
> lib/librte_ethdev/rte_flow.h | 29 +++++++++++++++++++++++++++++
> 3 files changed, 61 insertions(+)
>
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 3aec0834b..5ecf154b6 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -2196,6 +2196,36 @@ Assigns a new TTL value.
> | ``ttl_value`` | new TTL value |
> +---------------+--------------------+
>
> +Action: ``SET_MAC_SRC``
> +^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Set source MAC address
> +
> +.. _table_rte_flow_action_set_mac_src:
> +
> +.. table:: SET_MAC_SRC
> +
> + +--------------+---------------+
> + | Field | Value |
> + +==============+===============+
> + | ``mac_addr`` | MAC address |
> + +--------------+---------------+
> +
> +Action: ``SET_MAC_DST``
> +^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Set source MAC address
> +
> +.. _table_rte_flow_action_set_mac_dst:
> +
> +.. table:: SET_MAC_DST
> +
> + +--------------+---------------+
> + | Field | Value |
> + +==============+===============+
> + | ``mac_addr`` | MAC address |
> + +--------------+---------------+
> +
> Negative types
> ~~~~~~~~~~~~~~
>
> diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c
> index 631f80efd..1f4b67603 100644
> --- a/lib/librte_ethdev/rte_flow.c
> +++ b/lib/librte_ethdev/rte_flow.c
> @@ -123,6 +123,8 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
> sizeof(struct rte_flow_action_set_tp)),
> MK_FLOW_ACTION(DEC_TTL, 0),
> MK_FLOW_ACTION(SET_TTL, sizeof(struct rte_flow_action_set_ttl)),
> + MK_FLOW_ACTION(SET_MAC_SRC, sizeof(struct rte_flow_action_set_mac)),
> + MK_FLOW_ACTION(SET_MAC_DST, sizeof(struct rte_flow_action_set_mac)),
> };
>
> static int
> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index b41e37a31..19552902a 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -1567,6 +1567,26 @@ enum rte_flow_action_type {
> * See struct rte_flow_action_set_ttl
> */
> RTE_FLOW_ACTION_TYPE_SET_TTL,
> +
> + /**
> + * Set source MAC address from matched flow.
> + *
> + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH,
> + * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.
> + *
> + * See struct rte_flow_action_set_mac.
> + */
> + RTE_FLOW_ACTION_TYPE_SET_MAC_SRC,
> +
> + /**
> + * Set destination MAC address from matched flow.
> + *
> + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH,
> + * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.
> + *
> + * See struct rte_flow_action_set_mac.
> + */
> + RTE_FLOW_ACTION_TYPE_SET_MAC_DST,
> };
>
> /**
> @@ -1986,6 +2006,15 @@ struct rte_flow_action_set_ttl {
> uint8_t ttl_value;
> };
>
> +/**
> + * RTE_FLOW_ACTION_TYPE_SET_MAC
> + *
> + * Set MAC address from the matched flow
> + */
> +struct rte_flow_action_set_mac {
> + uint8_t mac_addr[ETHER_ADDR_LEN];
> +};
> +
> /*
> * Definition of a single action.
> *
> --
> 2.17.1
>
next prev parent reply other threads:[~2018-10-03 20:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 15:03 [dpdk-dev] [PATCH 0/3] " Xiaoyu Min
2018-09-25 15:03 ` [dpdk-dev] [PATCH 1/3] " Xiaoyu Min
2018-10-03 20:08 ` Yongseok Koh [this message]
2018-10-08 9:31 ` Andrew Rybchenko
2018-09-25 15:03 ` [dpdk-dev] [PATCH 2/3] app/testpmd: add commands of modify MAC address Xiaoyu Min
2018-10-03 20:09 ` Yongseok Koh
2018-09-25 15:03 ` [dpdk-dev] [PATCH 3/3] net/mlx5: eswitch-modify MAC address actions Xiaoyu Min
2018-10-03 20:10 ` Yongseok Koh
2018-10-05 12:54 ` [dpdk-dev] [PATCH 0/3] ethdev: add generic MAC address rewrite actions Ferruh Yigit
2018-10-08 2:32 ` Xiaoyu Min
2018-10-10 13:11 ` [dpdk-dev] [PATCH v2 " Jack Min
2018-10-10 13:11 ` [dpdk-dev] [PATCH v2 1/3] " Jack Min
2018-10-10 13:11 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: add commands of modify MAC address Jack Min
2018-10-10 13:11 ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: rewrite MAC address by E-Switch Jack Min
2018-10-11 5:51 ` Yongseok Koh
2018-10-11 13:31 ` [dpdk-dev] [PATCH v3 0/3] ethdev: add generic MAC address rewrite actions Jack Min
2018-10-11 13:31 ` [dpdk-dev] [PATCH v3 1/3] " Jack Min
2018-10-11 13:31 ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: add commands of modify MAC address Jack Min
2018-10-11 13:31 ` [dpdk-dev] [PATCH v3 3/3] net/mlx5: rewrite MAC address by E-Switch Jack Min
2018-10-16 9:11 ` [dpdk-dev] [PATCH v3 0/3] ethdev: add generic MAC address rewrite actions Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181003200800.GD26206@mtidpdk.mti.labs.mlnx \
--to=yskoh@mellanox.com \
--cc=adrien.mazarguil@6wind.com \
--cc=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jackmin@mellanox.com \
--cc=john.mcnamara@intel.com \
--cc=marko.kovacevic@intel.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).