DPDK patches and discussions
 help / color / mirror / Atom feed
From: Slava Ovsiienko <viacheslavo@mellanox.com>
To: Yongseok Koh <yskoh@mellanox.com>
Cc: Shahaf Shuler <shahafs@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 1/7] net/mlx5: e-switch VXLAN configuration and definitions
Date: Thu, 25 Oct 2018 12:50:26 +0000
Message-ID: <VI1PR05MB3278B4D5AE0C01354C535DE0D2F70@VI1PR05MB3278.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20181023100109.GA14792@mtidpdk.mti.labs.mlnx>

> -----Original Message-----
> From: Yongseok Koh
> Sent: Tuesday, October 23, 2018 13:02
> To: Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org
> Subject: Re: [PATCH v2 1/7] net/mlx5: e-switch VXLAN configuration and
> definitions
> 
> On Mon, Oct 15, 2018 at 02:13:29PM +0000, Viacheslav Ovsiienko wrote:
> > This part of patchset adds configuration changes in makefile and
> > meson.build for Mellanox MLX5 PMD. Also necessary defenitions
> > for VXLAN support are made and appropriate data structures
> > are presented.
> >
> > Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> > Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> > ---
> >  drivers/net/mlx5/Makefile        |  80 ++++++++++++++++++
> >  drivers/net/mlx5/meson.build     |  32 +++++++
> >  drivers/net/mlx5/mlx5_flow.h     |  11 +++
> >  drivers/net/mlx5/mlx5_flow_tcf.c | 175
> +++++++++++++++++++++++++++++++++++++++
> >  4 files changed, 298 insertions(+)
> >
> > diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
> > index 1e9c0b4..fec7779 100644
> > --- a/drivers/net/mlx5/Makefile
> > +++ b/drivers/net/mlx5/Makefile
> > @@ -207,6 +207,11 @@ mlx5_autoconf.h.new:
> $(RTE_SDK)/buildtools/auto-config-h.sh
> >  		enum IFLA_PHYS_PORT_NAME \
> >  		$(AUTOCONF_OUTPUT)
> >  	$Q sh -- '$<' '$@' \
> > +		HAVE_IFLA_VXLAN_COLLECT_METADATA \
> > +		linux/if_link.h \
> > +		enum IFLA_VXLAN_COLLECT_METADATA \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> >  		HAVE_TCA_CHAIN \
> >  		linux/rtnetlink.h \
> >  		enum TCA_CHAIN \
> > @@ -367,6 +372,81 @@ mlx5_autoconf.h.new:
> $(RTE_SDK)/buildtools/auto-config-h.sh
> >  		enum TCA_VLAN_PUSH_VLAN_PRIORITY \
> >  		$(AUTOCONF_OUTPUT)
> >  	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_KEY_ID \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_KEY_ID \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_IPV4_SRC \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_IPV4_DST \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST_MASK \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_IPV4_DST_MASK \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_IPV6_SRC \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_IPV6_DST \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST_MASK \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_IPV6_DST_MASK \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_UDP_SRC_PORT \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_UDP_DST_PORT \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK \
> > +		linux/pkt_cls.h \
> > +		enum TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TC_ACT_TUNNEL_KEY \
> > +		linux/tc_act/tc_tunnel_key.h \
> > +		define TCA_ACT_TUNNEL_KEY \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> > +		HAVE_TCA_TUNNEL_KEY_ENC_DST_PORT \
> > +		linux/tc_act/tc_tunnel_key.h \
> > +		enum TCA_TUNNEL_KEY_ENC_DST_PORT \
> > +		$(AUTOCONF_OUTPUT)
> > +	$Q sh -- '$<' '$@' \
> >  		HAVE_TC_ACT_PEDIT \
> >  		linux/tc_act/tc_pedit.h \
> >  		enum TCA_PEDIT_KEY_EX_HDR_TYPE_UDP \
> > diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
> > index c192d44..43aabf2 100644
> > --- a/drivers/net/mlx5/meson.build
> > +++ b/drivers/net/mlx5/meson.build
> > @@ -126,6 +126,8 @@ if build
> >  		'IFLA_PHYS_SWITCH_ID' ],
> >  		[ 'HAVE_IFLA_PHYS_PORT_NAME', 'linux/if_link.h',
> >  		'IFLA_PHYS_PORT_NAME' ],
> > +		[ 'HAVE_IFLA_VXLAN_COLLECT_METADATA', 'linux/if_link.h',
> > +		'IFLA_VXLAN_COLLECT_METADATA' ],
> >  		[ 'HAVE_TCA_CHAIN', 'linux/rtnetlink.h',
> >  		'TCA_CHAIN' ],
> >  		[ 'HAVE_TCA_FLOWER_ACT', 'linux/pkt_cls.h',
> > @@ -190,6 +192,36 @@ if build
> >  		'TC_ACT_GOTO_CHAIN' ],
> >  		[ 'HAVE_TC_ACT_VLAN', 'linux/tc_act/tc_vlan.h',
> >  		'TCA_VLAN_PUSH_VLAN_PRIORITY' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_KEY_ID', 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_KEY_ID' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_IPV4_SRC' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_IPV4_DST' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST_MASK',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_IPV4_DST_MASK' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_IPV6_SRC' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_IPV6_DST' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST_MASK',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_IPV6_DST_MASK' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_UDP_SRC_PORT' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_UDP_DST_PORT' ],
> > +		[ 'HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK',
> 'linux/pkt_cls.h',
> > +		'TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK' ],
> > +		[ 'HAVE_TC_ACT_TUNNEL_KEY',
> 'linux/tc_act/tc_tunnel_key.h',
> > +		'TCA_ACT_TUNNEL_KEY' ],
> > +		[ 'HAVE_TCA_TUNNEL_KEY_ENC_DST_PORT',
> 'linux/tc_act/tc_tunnel_key.h',
> > +		'TCA_TUNNEL_KEY_ENC_DST_PORT' ],
> >  		[ 'HAVE_TC_ACT_PEDIT', 'linux/tc_act/tc_pedit.h',
> >  		'TCA_PEDIT_KEY_EX_HDR_TYPE_UDP' ],
> >  		[ 'HAVE_RDMA_NL_NLDEV', 'rdma/rdma_netlink.h',
> > diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
> > index 840d645..b838ab0 100644
> > --- a/drivers/net/mlx5/mlx5_flow.h
> > +++ b/drivers/net/mlx5/mlx5_flow.h
> > @@ -85,6 +85,8 @@
> >  #define MLX5_FLOW_ACTION_SET_TP_SRC (1u << 15)
> >  #define MLX5_FLOW_ACTION_SET_TP_DST (1u << 16)
> >  #define MLX5_FLOW_ACTION_JUMP (1u << 17)
> > +#define MLX5_ACTION_VXLAN_ENCAP (1u << 11)
> > +#define MLX5_ACTION_VXLAN_DECAP (1u << 12)
> 
> MLX5_ACTION_* has been changed to MLX5_FLOW_ACTION_* as you can
> see above.
OK. Miscopied from previous version of patch.

> And make it alphabetical order; decap first and encap later? Or, at least make
> it consistent. The order (case clause) is different among validate, prepare and
> translate.
OK. Will reorder.

> 
> >  #define MLX5_FLOW_FATE_ACTIONS \
> >  	(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE |
> MLX5_FLOW_ACTION_RSS)
> > @@ -182,8 +184,17 @@ struct mlx5_flow_dv {
> >  struct mlx5_flow_tcf {
> >  	struct nlmsghdr *nlh;
> >  	struct tcmsg *tcm;
> > +	uint32_t nlsize; /**< Size of NL message buffer. */
> 
> It is used only for assert(), but if prepare() is trusted, why do we need to
> keep it? I don't it is needed.
> 
Q? Let's keep the nlsize under NDEBUG flag? 
It's extremely useful to have assert()
on allocated size for debugging purposes.

> > +	uint32_t applied:1; /**< Whether rule is currently applied. */
> > +	uint64_t item_flags; /**< Item flags. */
> 
> This isn't used at all.
OK, now no dependencies on it, should be removed, good.

> 
> > +	uint64_t action_flags; /**< Action flags. */
> 
> I checked following patches and it doesn't seem necessary. Please refer to
> the
> comment on the translation func. But if you think it is really needed, you
> could've used actions field of struct rte_flow and layers field of struct
> mlx5_flow in mlx5_flow.h

When translating item list into NL-message we have to know whether there is 
some tunneling action in the actions list. This is due to possible 
changing of the item meanings if tunneling action is present. For example,
usually the ipv4 item provides IPv4 addresses for matching and translated to
TCA_FLOWER_KEY_IPV4_SRC (+ xxx_DST) Netlink attribute(s), but if there is
VXLAN decap action specified, this item becames outer tunnel  source IPs
and should be translated to TCA_FLOWER_KEY_ENC_IPV4_SRC. The action
list is scanned in the preperd list, so we can save action flags  and  use these
gathered results in translation routine. As we can see from mlx5_flow_list_create() source,
it does not save item/actions flags, gathered by flow_drv_prepare(). That's why
there are item_flags/action_flags  in the struct mlx5_flow_tcf. item_flags is not
needed, should be removed. action_flags is in use.

BTW, do we need item_flags, action_flags params in flow_drv_prepare() ?
We would avoid the item_flags field if flags were transferred from
flow_drv_prepare() to flow_drv_translate() (as local variable of
mlx5_flow_list_create().

> >  	uint64_t hits;
> >  	uint64_t bytes;
> > +	union { /**< Tunnel encap/decap descriptor. */
> > +		struct mlx5_flow_tcf_tunnel_hdr *tunnel;
> > +		struct mlx5_flow_tcf_vxlan_decap *vxlan_decap;
> > +		struct mlx5_flow_tcf_vxlan_encap *vxlan_encap;
> > +	};
> 
> What is the reason for keeping pointer even though the actual structure
> follows
> after mlx5_flow_tcf? Maybe you don't want to waste memory, as the size of
> encap/decap struct differs a lot?

Sizes differ, but not a lot (especially comparing with DV rule size). 
Would you prefer to simplify and just include the union?
On other hand we could declare something like that:
	...
 	uint8_t tunnel_type;
	alignas(struct mlx5_flow_tcf_tunnel_hdr)   uint8_t buf[];

and eliminate the pointer at all. The buf beginning contains either tunnel structure
or Netlink message (if no tunnel), depending on the tunnel_type field.

With best regards,
Slava

> 
> >  };
> >
> >  /* Verbs specification header. */
> > diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c
> b/drivers/net/mlx5/mlx5_flow_tcf.c
> > index 5c46f35..8f9c78a 100644
> > --- a/drivers/net/mlx5/mlx5_flow_tcf.c
> > +++ b/drivers/net/mlx5/mlx5_flow_tcf.c
> > @@ -54,6 +54,37 @@ struct tc_vlan {
> >
> >  #endif /* HAVE_TC_ACT_VLAN */
> >
> > +#ifdef HAVE_TC_ACT_TUNNEL_KEY
> > +
> > +#include <linux/tc_act/tc_tunnel_key.h>
> > +
> > +#ifndef HAVE_TCA_TUNNEL_KEY_ENC_DST_PORT
> > +#define TCA_TUNNEL_KEY_ENC_DST_PORT 9
> > +#endif
> > +
> > +#else /* HAVE_TC_ACT_TUNNEL_KEY */
> > +
> > +#define TCA_ACT_TUNNEL_KEY 17
> > +#define TCA_TUNNEL_KEY_ACT_SET 1
> > +#define TCA_TUNNEL_KEY_ACT_RELEASE 2
> > +#define TCA_TUNNEL_KEY_PARMS 2
> > +#define TCA_TUNNEL_KEY_ENC_IPV4_SRC 3
> > +#define TCA_TUNNEL_KEY_ENC_IPV4_DST 4
> > +#define TCA_TUNNEL_KEY_ENC_IPV6_SRC 5
> > +#define TCA_TUNNEL_KEY_ENC_IPV6_DST 6
> > +#define TCA_TUNNEL_KEY_ENC_KEY_ID 7
> > +#define TCA_TUNNEL_KEY_ENC_DST_PORT 9
> > +#define TCA_TUNNEL_KEY_NO_CSUM 10
> > +
> > +struct tc_tunnel_key {
> > +	tc_gen;
> > +	int t_action;
> > +};
> > +
> > +#endif /* HAVE_TC_ACT_TUNNEL_KEY */
> > +
> > +
> > +
> >  #ifdef HAVE_TC_ACT_PEDIT
> >
> >  #include <linux/tc_act/tc_pedit.h>
> > @@ -210,6 +241,45 @@ struct tc_pedit_sel {
> >  #ifndef HAVE_TCA_FLOWER_KEY_VLAN_ETH_TYPE
> >  #define TCA_FLOWER_KEY_VLAN_ETH_TYPE 25
> >  #endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_KEY_ID
> > +#define TCA_FLOWER_KEY_ENC_KEY_ID 26
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC
> > +#define TCA_FLOWER_KEY_ENC_IPV4_SRC 27
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK
> > +#define TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK 28
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST
> > +#define TCA_FLOWER_KEY_ENC_IPV4_DST 29
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST_MASK
> > +#define TCA_FLOWER_KEY_ENC_IPV4_DST_MASK 30
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC
> > +#define TCA_FLOWER_KEY_ENC_IPV6_SRC 31
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK
> > +#define TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK 32
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST
> > +#define TCA_FLOWER_KEY_ENC_IPV6_DST 33
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST_MASK
> > +#define TCA_FLOWER_KEY_ENC_IPV6_DST_MASK 34
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT
> > +#define TCA_FLOWER_KEY_ENC_UDP_SRC_PORT 43
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK
> > +#define TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK 44
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT
> > +#define TCA_FLOWER_KEY_ENC_UDP_DST_PORT 45
> > +#endif
> > +#ifndef HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK
> > +#define TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK 46
> > +#endif
> >  #ifndef HAVE_TCA_FLOWER_KEY_TCP_FLAGS
> >  #define TCA_FLOWER_KEY_TCP_FLAGS 71
> >  #endif
> > @@ -232,6 +302,111 @@ struct tc_pedit_sel {
> >  #define TP_PORT_LEN 2 /* Transport Port (UDP/TCP) Length */
> >  #endif
> >
> > +#define MLX5_VXLAN_PORT_RANGE_MIN 30000
> > +#define MLX5_VXLAN_PORT_RANGE_MAX 60000
> > +#define MLX5_VXLAN_DEVICE_PFX "vmlx_"
> > +
> > +/** Tunnel action type, used for @p type in header structure. */
> > +enum mlx5_flow_tcf_tunact_type {
> > +	MLX5_FLOW_TCF_TUNACT_VXLAN_ENCAP,
> > +	MLX5_FLOW_TCF_TUNACT_VXLAN_DECAP,
> > +};
> > +
> > +/** Flags used for @p mask in tunnel action encap descriptors. */
> > +#define	MLX5_FLOW_TCF_ENCAP_ETH_SRC (1u << 0)
> > +#define	MLX5_FLOW_TCF_ENCAP_ETH_DST (1u << 1)
> > +#define	MLX5_FLOW_TCF_ENCAP_IPV4_SRC (1u << 2)
> > +#define	MLX5_FLOW_TCF_ENCAP_IPV4_DST (1u << 3)
> > +#define	MLX5_FLOW_TCF_ENCAP_IPV6_SRC (1u << 4)
> > +#define	MLX5_FLOW_TCF_ENCAP_IPV6_DST (1u << 5)
> > +#define	MLX5_FLOW_TCF_ENCAP_UDP_SRC (1u << 6)
> > +#define	MLX5_FLOW_TCF_ENCAP_UDP_DST (1u << 7)
> > +#define	MLX5_FLOW_TCF_ENCAP_VXLAN_VNI (1u << 8)
> > +
> > +/** Neigh rule structure */
> > +struct tcf_neigh_rule {
> > +	LIST_ENTRY(tcf_neigh_rule) next;
> > +	uint32_t refcnt;
> > +	struct ether_addr eth;
> > +	uint16_t mask;
> > +	union {
> > +		struct {
> > +			rte_be32_t dst;
> > +		} ipv4;
> > +		struct {
> > +			uint8_t dst[16];
> > +		} ipv6;
> > +	};
> > +};
> > +
> > +/** Local rule structure */
> > +struct tcf_local_rule {
> > +	LIST_ENTRY(tcf_neigh_rule) next;
> > +	uint32_t refcnt;
> > +	uint16_t mask;
> > +	union {
> > +		struct {
> > +			rte_be32_t dst;
> > +			rte_be32_t src;
> > +		} ipv4;
> > +		struct {
> > +			uint8_t dst[16];
> > +			uint8_t src[16];
> > +		} ipv6;
> > +	};
> > +};
> > +
> > +/** VXLAN virtual netdev. */
> > +struct mlx5_flow_tcf_vtep {
> > +	LIST_ENTRY(mlx5_flow_tcf_vtep) next;
> > +	LIST_HEAD(, tcf_neigh_rule) neigh;
> > +	LIST_HEAD(, tcf_local_rule) local;
> > +	uint32_t refcnt;
> > +	unsigned int ifindex; /**< Own interface index. */
> > +	unsigned int ifouter; /**< Index of device attached to. */
> > +	uint16_t port;
> > +	uint8_t created;
> > +};
> > +
> > +/** Tunnel descriptor header, common for all tunnel types. */
> > +struct mlx5_flow_tcf_tunnel_hdr {
> > +	uint32_t type; /**< Tunnel action type. */
> > +	unsigned int ifindex_tun; /**< Tunnel endpoint interface. */
> > +	unsigned int ifindex_org; /**< Original dst/src interface */
> > +	unsigned int *ifindex_ptr; /**< Interface ptr in message. */
> > +};
> > +
> > +struct mlx5_flow_tcf_vxlan_decap {
> > +	struct mlx5_flow_tcf_tunnel_hdr hdr;
> > +	uint16_t udp_port;
> > +};
> > +
> > +struct mlx5_flow_tcf_vxlan_encap {
> > +	struct mlx5_flow_tcf_tunnel_hdr hdr;
> > +	uint32_t mask;
> > +	struct {
> > +		struct ether_addr dst;
> > +		struct ether_addr src;
> > +	} eth;
> > +	union {
> > +		struct {
> > +			rte_be32_t dst;
> > +			rte_be32_t src;
> > +		} ipv4;
> > +		struct {
> > +			uint8_t dst[16];
> > +			uint8_t src[16];
> > +		} ipv6;
> > +	};
> > +struct {
> > +		rte_be16_t src;
> > +		rte_be16_t dst;
> > +	} udp;
> > +	struct {
> > +		uint8_t vni[3];
> > +	} vxlan;
> > +};
> > +
> >  /**
> >   * Structure for holding netlink context.
> >   * Note the size of the message buffer which is
> MNL_SOCKET_BUFFER_SIZE.
> >

  reply	other threads:[~2018-10-25 12:50 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02  6:30 [dpdk-dev] [PATCH 1/5] net/mlx5: add VXLAN encap/decap support for e-switch Slava Ovsiienko
2018-10-02  6:30 ` [dpdk-dev] [PATCH 2/5] net/mlx5: e-switch VXLAN netlink routines update Slava Ovsiienko
2018-10-02  6:30 ` [dpdk-dev] [PATCH 3/5] net/mlx5: e-switch VXLAN flow validation routine Slava Ovsiienko
2018-10-02  6:30 ` [dpdk-dev] [PATCH 4/5] net/mlx5: e-switch VXLAN flow translation routine Slava Ovsiienko
2018-10-02  6:30 ` [dpdk-dev] [PATCH 5/5] net/mlx5: e-switch VXLAN tunnel devices management Slava Ovsiienko
2018-10-15 14:13 ` [dpdk-dev] [PATCH v2 0/7] net/mlx5: e-switch VXLAN encap/decap hardware offload Viacheslav Ovsiienko
2018-10-15 14:13   ` [dpdk-dev] [PATCH v2 1/7] net/mlx5: e-switch VXLAN configuration and definitions Viacheslav Ovsiienko
2018-10-23 10:01     ` Yongseok Koh
2018-10-25 12:50       ` Slava Ovsiienko [this message]
2018-10-25 23:33         ` Yongseok Koh
2018-10-15 14:13   ` [dpdk-dev] [PATCH v2 2/7] net/mlx5: e-switch VXLAN flow validation routine Viacheslav Ovsiienko
2018-10-23 10:04     ` Yongseok Koh
2018-10-25 13:53       ` Slava Ovsiienko
2018-10-26  3:07         ` Yongseok Koh
2018-10-26  8:39           ` Slava Ovsiienko
2018-10-26 21:56             ` Yongseok Koh
2018-10-29  9:33               ` Slava Ovsiienko
2018-10-29 18:26                 ` Yongseok Koh
2018-10-15 14:13   ` [dpdk-dev] [PATCH v2 3/7] net/mlx5: e-switch VXLAN flow translation routine Viacheslav Ovsiienko
2018-10-23 10:06     ` Yongseok Koh
2018-10-25 14:37       ` Slava Ovsiienko
2018-10-26  4:22         ` Yongseok Koh
2018-10-26  9:06           ` Slava Ovsiienko
2018-10-26 22:10             ` Yongseok Koh
2018-10-15 14:13   ` [dpdk-dev] [PATCH v2 4/7] net/mlx5: e-switch VXLAN netlink routines update Viacheslav Ovsiienko
2018-10-23 10:07     ` Yongseok Koh
2018-10-15 14:13   ` [dpdk-dev] [PATCH v2 5/7] net/mlx5: e-switch VXLAN tunnel devices management Viacheslav Ovsiienko
2018-10-25  0:28     ` Yongseok Koh
2018-10-25 20:21       ` Slava Ovsiienko
2018-10-26  6:25         ` Yongseok Koh
2018-10-26  9:35           ` Slava Ovsiienko
2018-10-26 22:42             ` Yongseok Koh
2018-10-29 11:53               ` Slava Ovsiienko
2018-10-29 18:42                 ` Yongseok Koh
2018-10-15 14:13   ` [dpdk-dev] [PATCH v2 6/7] net/mlx5: e-switch VXLAN encapsulation rules management Viacheslav Ovsiienko
2018-10-25  0:33     ` Yongseok Koh
2018-10-15 14:13   ` [dpdk-dev] [PATCH v2 7/7] net/mlx5: e-switch VXLAN rule cleanup routines Viacheslav Ovsiienko
2018-10-25  0:36     ` Yongseok Koh
2018-10-25 20:32       ` Slava Ovsiienko
2018-10-26  6:30         ` Yongseok Koh
2018-11-01 12:19   ` [dpdk-dev] [PATCH v3 00/13] net/mlx5: e-switch VXLAN encap/decap hardware offload Slava Ovsiienko
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 01/13] net/mlx5: prepare makefile for adding e-switch VXLAN Slava Ovsiienko
2018-11-01 20:33       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 02/13] net/mlx5: prepare meson.build " Slava Ovsiienko
2018-11-01 20:33       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 03/13] net/mlx5: add necessary definitions for " Slava Ovsiienko
2018-11-01 20:35       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 04/13] net/mlx5: add necessary structures " Slava Ovsiienko
2018-11-01 20:36       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 05/13] net/mlx5: swap items/actions validations for e-switch rules Slava Ovsiienko
2018-11-01 20:37       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 06/13] net/mlx5: add e-switch VXLAN support to validation routine Slava Ovsiienko
2018-11-01 20:49       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 07/13] net/mlx5: add VXLAN support to flow prepare routine Slava Ovsiienko
2018-11-01 21:03       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 08/13] net/mlx5: add VXLAN support to flow translate routine Slava Ovsiienko
2018-11-01 21:18       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 09/13] net/mlx5: e-switch VXLAN netlink routines update Slava Ovsiienko
2018-11-01 21:21       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 10/13] net/mlx5: fix e-switch Flow counter deletion Slava Ovsiienko
2018-11-01 22:00       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 11/13] net/mlx5: add e-switch VXLAN tunnel devices management Slava Ovsiienko
2018-11-01 23:59       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 12/13] net/mlx5: add e-switch VXLAN encapsulation rules Slava Ovsiienko
2018-11-02  0:01       ` Yongseok Koh
2018-11-01 12:19     ` [dpdk-dev] [PATCH v3 13/13] net/mlx5: add e-switch VXLAN rule cleanup routines Slava Ovsiienko
2018-11-02  0:01       ` Yongseok Koh
2018-11-01 20:32     ` [dpdk-dev] [PATCH v3 00/13] net/mlx5: e-switch VXLAN encap/decap hardware offload Yongseok Koh
2018-11-02 17:53     ` [dpdk-dev] [PATCH v4 " Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 01/13] net/mlx5: prepare makefile for adding E-Switch VXLAN Slava Ovsiienko
2018-11-03  6:18         ` [dpdk-dev] [PATCH v5 00/13] net/mlx5: e-switch VXLAN encap/decap hardware offload Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 01/13] net/mlx5: prepare makefile for adding E-Switch VXLAN Slava Ovsiienko
2018-11-12 20:01             ` [dpdk-dev] [PATCH 0/4] net/mlx5: prepare to add E-switch rule flags check Slava Ovsiienko
2018-11-12 20:01               ` [dpdk-dev] [PATCH 1/4] net/mlx5: prepare Netlink communication routine to fix Slava Ovsiienko
2018-11-13 13:21                 ` Shahaf Shuler
2018-11-12 20:01               ` [dpdk-dev] [PATCH 2/4] net/mlx5: fix Netlink communication routine Slava Ovsiienko
2018-11-13 13:21                 ` Shahaf Shuler
2018-11-14 12:57                   ` Slava Ovsiienko
2018-11-12 20:01               ` [dpdk-dev] [PATCH 3/4] net/mlx5: prepare to add E-switch rule flags check Slava Ovsiienko
2018-11-12 20:01               ` [dpdk-dev] [PATCH 4/4] net/mlx5: add E-switch rule hardware offload flag check Slava Ovsiienko
2018-11-13 13:21               ` [dpdk-dev] [PATCH 0/4] net/mlx5: prepare to add E-switch rule flags check Shahaf Shuler
2018-11-14 14:56                 ` Shahaf Shuler
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 02/13] net/mlx5: prepare meson.build for adding E-Switch VXLAN Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 03/13] net/mlx5: add necessary definitions for " Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 04/13] net/mlx5: add necessary structures " Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 05/13] net/mlx5: swap items/actions validations for E-Switch rules Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 06/13] net/mlx5: add E-Switch VXLAN support to validation routine Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 07/13] net/mlx5: add VXLAN support to flow prepare routine Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 08/13] net/mlx5: add VXLAN support to flow translate routine Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 09/13] net/mlx5: update E-Switch VXLAN netlink routines Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 10/13] net/mlx5: fix E-Switch Flow counter deletion Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 11/13] net/mlx5: add E-switch VXLAN tunnel devices management Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 12/13] net/mlx5: add E-Switch VXLAN encapsulation rules Slava Ovsiienko
2018-11-03  6:18           ` [dpdk-dev] [PATCH v5 13/13] net/mlx5: add E-switch VXLAN rule cleanup routines Slava Ovsiienko
2018-11-04  6:48           ` [dpdk-dev] [PATCH v5 00/13] net/mlx5: e-switch VXLAN encap/decap hardware offload Shahaf Shuler
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 02/13] net/mlx5: prepare meson.build for adding E-Switch VXLAN Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 03/13] net/mlx5: add necessary definitions for " Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 04/13] net/mlx5: add necessary structures " Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 05/13] net/mlx5: swap items/actions validations for E-Switch rules Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 07/13] net/mlx5: add VXLAN support to flow prepare routine Slava Ovsiienko
2018-11-02 21:38         ` Yongseok Koh
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 06/13] net/mlx5: add E-Switch VXLAN support to validation routine Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 08/13] net/mlx5: add VXLAN support to flow translate routine Slava Ovsiienko
2018-11-02 21:53         ` Yongseok Koh
2018-11-02 23:29           ` Yongseok Koh
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 09/13] net/mlx5: update E-Switch VXLAN netlink routines Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 10/13] net/mlx5: fix E-Switch Flow counter deletion Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 11/13] net/mlx5: add E-switch VXLAN tunnel devices management Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 12/13] net/mlx5: add E-Switch VXLAN encapsulation rules Slava Ovsiienko
2018-11-02 17:53       ` [dpdk-dev] [PATCH v4 13/13] net/mlx5: add E-switch VXLAN rule cleanup routines Slava Ovsiienko

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=VI1PR05MB3278B4D5AE0C01354C535DE0D2F70@VI1PR05MB3278.eurprd05.prod.outlook.com \
    --to=viacheslavo@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=shahafs@mellanox.com \
    --cc=yskoh@mellanox.com \
    /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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git