DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wang, Xiao W" <xiao.w.wang@intel.com>
To: "Zhao1, Wei" <wei.zhao1@intel.com>,
	"Yang, Qiming" <qiming.yang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 1/3] net/ice: enable switch filter
Date: Mon, 17 Jun 2019 08:28:00 +0000	[thread overview]
Message-ID: <B7F2E978279D1D49A3034B7786DACF407AF47517@SHSMSX106.ccr.corp.intel.com> (raw)
In-Reply-To: <A2573D2ACFCADC41BB3BE09C6DE313CA07F044F7@PGSMSX103.gar.corp.intel.com>

Hi Wei,

> -----Original Message-----
> From: Zhao1, Wei
> Sent: Friday, June 14, 2019 5:47 PM
> To: Wang, Xiao W <xiao.w.wang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v2 1/3] net/ice: enable switch filter
> 
> Hi, xiao
> 
> > -----Original Message-----
> > From: Wang, Xiao W
> > Sent: Thursday, June 13, 2019 4:24 PM
> > To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org
> > Cc: Zhao1, Wei <wei.zhao1@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH v2 1/3] net/ice: enable switch filter
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang
> > > Sent: Wednesday, June 12, 2019 3:50 PM
> > > To: dev@dpdk.org
> > > Cc: Zhao1, Wei <wei.zhao1@intel.com>
> > > Subject: [dpdk-dev] [PATCH v2 1/3] net/ice: enable switch filter
> > >
> > > From: wei zhao <wei.zhao1@intel.com>
> > >
> > > The patch enables the backend of rte_flow. It transfers rte_flow_xxx
> > > to device specific data structure and configures packet process
> > > engine's binary classifier
> > > (switch) properly.
> > >
> > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > > ---
> > >  drivers/net/ice/Makefile            |   1 +
> > >  drivers/net/ice/ice_ethdev.h        |   6 +
> > >  drivers/net/ice/ice_switch_filter.c | 502
> > > ++++++++++++++++++++++++++++++++++++
> > >  drivers/net/ice/ice_switch_filter.h |  28 ++
> > >  drivers/net/ice/meson.build         |   3 +-
> > >  5 files changed, 539 insertions(+), 1 deletion(-)  create mode 100644
> > > drivers/net/ice/ice_switch_filter.c
> > >  create mode 100644 drivers/net/ice/ice_switch_filter.h
> > >
> > > diff --git a/drivers/net/ice/Makefile b/drivers/net/ice/Makefile index
> > > 0e5c55e..b10d826 100644
> > > --- a/drivers/net/ice/Makefile
> > > +++ b/drivers/net/ice/Makefile
> > > @@ -60,6 +60,7 @@ ifeq ($(CONFIG_RTE_ARCH_X86), y)
> > >  SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_rxtx_vec_sse.c  endif
> > >
> > > +SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_switch_filter.c
> > >  ifeq ($(findstring
> > >
> RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2)
> > >  	CC_AVX2_SUPPORT=1
> > >  else
> > > diff --git a/drivers/net/ice/ice_ethdev.h
> > > b/drivers/net/ice/ice_ethdev.h index 1385afa..67a358a 100644
> > > --- a/drivers/net/ice/ice_ethdev.h
> > > +++ b/drivers/net/ice/ice_ethdev.h
> > > @@ -234,6 +234,12 @@ struct ice_vsi {
> > >  	bool offset_loaded;
> > >  };
> > >
> > > +/* Struct to store flow created. */
> > > +struct rte_flow {
> > > +	TAILQ_ENTRY(rte_flow) node;
> > > +void *rule;
> > > +};
> > > +
> > >  struct ice_pf {
> > >  	struct ice_adapter *adapter; /* The adapter this PF associate to */
> > >  	struct ice_vsi *main_vsi; /* pointer to main VSI structure */ diff
> > > --git a/drivers/net/ice/ice_switch_filter.c
> > > b/drivers/net/ice/ice_switch_filter.c
> > > new file mode 100644
> > > index 0000000..e679675
> > > --- /dev/null
> > > +++ b/drivers/net/ice/ice_switch_filter.c
[...]

> > > +			RTE_FLOW_ITEM_TYPE_END; item++, i++) {
> >
> > It seems we don't need the "i" variable.
> 
> Ok, Updated in v3
> 
> >
> > > +		item_type = item->type;
> > > +
> > > +		switch (item_type) {
> > > +		case RTE_FLOW_ITEM_TYPE_ETH:
> > > +			eth_spec = item->spec;
> > > +			eth_mask = item->mask;
> > > +			if (eth_spec && eth_mask) {
> > > +				list[t].type = (tun_type == ICE_NON_TUN) ?
> > > +					ICE_MAC_OFOS : ICE_MAC_IL;
> > > +				for (j = 0; j < RTE_ETHER_ADDR_LEN; j++) {
> > > +					if (eth_mask->src.addr_bytes[j] ==
> > > +								UINT8_MAX) {
> > > +						list[t].h_u.eth_hdr.
> > > +							src_addr[j] =
> > > +						eth_spec->src.addr_bytes[j];
> > > +						list[t].m_u.eth_hdr.
> > > +							src_addr[j] =
> > > +						eth_mask->src.addr_bytes[j];
> > > +					}
> > > +					if (eth_mask->dst.addr_bytes[j] ==
> > > +								UINT8_MAX) {
> > > +						list[t].h_u.eth_hdr.
> > > +							dst_addr[j] =
> > > +						eth_spec->dst.addr_bytes[j];
> > > +						list[t].m_u.eth_hdr.
> > > +							dst_addr[j] =
> > > +						eth_mask->dst.addr_bytes[j];
> > > +					}
> > > +				}
> > > +				if (eth_mask->type == UINT16_MAX) {
> > > +					list[t].h_u.eth_hdr.ethtype_id =
> > > +					rte_be_to_cpu_16(eth_spec->type);
> > > +					list[t].m_u.eth_hdr.ethtype_id =
> > > +						UINT16_MAX;
> > > +				}
> > > +				t++;
> >
> > A lot of "t++" below, can we move it outside the switch{ } to have only one
> "t++"?
> 
> By now, we can not, because share code can not handle  if (!eth_spec
> && !eth_mask)  case,  if we t++
> For that case, that item will put into list[t], and share code will report error.

The blow "else if" branch has no effect at all, we can just remove it.

BRs,
Xiao

> >
> > > +			} else if (!eth_spec && !eth_mask) {
> > > +				list[t].type = (tun_type == ICE_NON_TUN) ?
> > > +					ICE_MAC_OFOS : ICE_MAC_IL;
> > > +			}
> > > +			break;
[...]

  reply	other threads:[~2019-06-17  8:28 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03  9:05 [dpdk-dev] [PATCH 0/2] Enable rte_flow API in ice driver Qiming Yang
2019-06-03  9:05 ` [dpdk-dev] [PATCH 1/2] net/ice: enable switch filter Qiming Yang
2019-06-03 17:07   ` Aaron Conole
2019-06-04  2:02     ` Zhao1, Wei
2019-06-03  9:05 ` [dpdk-dev] [PATCH 2/2] net/ice: add generic flow API Qiming Yang
2019-06-12  7:50 ` [dpdk-dev] [PATCH v2 0/3] Enable rte_flow API in ice driver Qiming Yang
2019-06-12  7:50   ` [dpdk-dev] [PATCH v2 1/3] net/ice: enable switch filter Qiming Yang
2019-06-13  8:23     ` Wang, Xiao W
2019-06-14  9:46       ` Zhao1, Wei
2019-06-17  8:28         ` Wang, Xiao W [this message]
2019-06-18  1:57           ` Zhao1, Wei
2019-06-17  5:27     ` Xing, Beilei
2019-06-17  8:23       ` Zhao1, Wei
2019-06-17  8:51       ` Zhao1, Wei
2019-06-18  1:50         ` Xing, Beilei
2019-06-18  9:40     ` Ye Xiaolong
2019-06-19  3:06       ` Zhao1, Wei
2019-06-12  7:50   ` [dpdk-dev] [PATCH v2 2/3] net/ice: add generic flow API Qiming Yang
2019-06-17  5:50     ` Xing, Beilei
2019-06-17  6:02     ` Xing, Beilei
2019-06-17  9:19     ` Wang, Xiao W
2019-06-12  7:50   ` [dpdk-dev] [PATCH v2 3/3] net/ice: add UDP tunnel port support Qiming Yang
2019-06-20  5:34 ` [dpdk-dev] [PATCH v3 0/3] Enable rte_flow API in ice driver Qiming Yang
2019-06-20  5:34   ` [dpdk-dev] [PATCH v3 1/3] net/ice: enable switch filter Qiming Yang
2019-06-20  9:01     ` Wang, Xiao W
2019-06-20  9:12       ` Zhao1, Wei
2019-06-20  5:34   ` [dpdk-dev] [PATCH v3 2/3] net/ice: add generic flow API Qiming Yang
2019-06-20  9:32     ` Wang, Xiao W
2019-06-21  5:47       ` Yang, Qiming
2019-06-20 10:21     ` Wang, Xiao W
2019-06-20 13:33     ` Aaron Conole
2019-06-21  2:18       ` Yang, Qiming
2019-06-20  5:34   ` [dpdk-dev] [PATCH v3 3/3] net/ice: add UDP tunnel port support Qiming Yang
2019-06-21  6:13 ` [dpdk-dev] [PATCH v4 0/3] Enable rte_flow API in ice driver Qiming Yang
2019-06-21  6:13   ` [dpdk-dev] [PATCH v4 1/3] net/ice: enable switch filter Qiming Yang
2019-06-21  6:13   ` [dpdk-dev] [PATCH v4 2/3] net/ice: add generic flow API Qiming Yang
2019-06-21  6:13   ` [dpdk-dev] [PATCH v4 3/3] net/ice: add UDP tunnel port support Qiming Yang
2019-06-21  9:21 ` [dpdk-dev] [PATCH v5 0/3] Enable rte_flow API in ice driver Qiming Yang
2019-06-21  9:21   ` [dpdk-dev] [PATCH v5 1/3] net/ice: enable switch filter Qiming Yang
2019-06-21  9:21   ` [dpdk-dev] [PATCH v5 2/3] net/ice: add generic flow API Qiming Yang
2019-06-21  9:21   ` [dpdk-dev] [PATCH v5 3/3] net/ice: add UDP tunnel port support Qiming Yang
2019-06-21 14:46   ` [dpdk-dev] [PATCH v5 0/3] Enable rte_flow API in ice driver Aaron Conole
2019-06-24  6:15 ` [dpdk-dev] [PATCH v6 " Qiming Yang
2019-06-24  6:15   ` [dpdk-dev] [PATCH v6 1/3] net/ice: enable switch filter Qiming Yang
2019-06-24  6:15   ` [dpdk-dev] [PATCH v6 2/3] net/ice: add generic flow API Qiming Yang
2019-06-24  6:15   ` [dpdk-dev] [PATCH v6 3/3] net/ice: add UDP tunnel port support Qiming Yang
2019-06-25  6:48 ` [dpdk-dev] [PATCH v7 0/3] Enable rte_flow API in ice driver Qiming Yang
2019-06-25  6:48   ` [dpdk-dev] [PATCH v7 1/3] net/ice: enable switch filter Qiming Yang
2019-06-25  6:48   ` [dpdk-dev] [PATCH v7 2/3] net/ice: add generic flow API Qiming Yang
2019-06-25  6:48   ` [dpdk-dev] [PATCH v7 3/3] net/ice: add UDP tunnel port support Qiming Yang
2019-06-26  7:07     ` Xing, Beilei
2019-06-25 14:58   ` [dpdk-dev] [PATCH v7 0/3] Enable rte_flow API in ice driver Aaron Conole
2019-06-26  1:52     ` Yang, Qiming
2019-06-26  7:42       ` Ferruh Yigit
2019-06-26  8:26         ` Yang, Qiming
2019-06-26 15:52   ` Ye Xiaolong
2019-06-26  8:03 ` [dpdk-dev] [PATCH v8 " Qiming Yang
2019-06-26  8:03   ` [dpdk-dev] [PATCH v8 1/3] net/ice: enable switch filter Qiming Yang
2019-06-26  8:03   ` [dpdk-dev] [PATCH v8 2/3] net/ice: add generic flow API Qiming Yang
2019-06-26  8:03   ` [dpdk-dev] [PATCH v8 3/3] net/ice: add UDP tunnel port support Qiming Yang
2019-06-26  8:58 ` [dpdk-dev] [PATCH v8 0/4] Enable rte_flow API in ice driver Qiming Yang
2019-06-26  8:58   ` [dpdk-dev] [PATCH v8 1/4] net/ice: enable switch filter Qiming Yang
2019-06-26  8:58   ` [dpdk-dev] [PATCH v8 2/4] net/ice: add generic flow API Qiming Yang
2019-06-26  8:58   ` [dpdk-dev] [PATCH v8 3/4] net/ice: add UDP tunnel port support Qiming Yang
2019-06-26  8:58   ` [dpdk-dev] [PATCH v8 4/4] doc: add release note for generic flow Qiming Yang
2019-06-26 21:27     ` Thomas Monjalon
2019-06-27  2:04       ` Yang, Qiming
2019-06-26 13:25   ` [dpdk-dev] [PATCH v8 0/4] Enable rte_flow API in ice driver Xing, Beilei
2019-07-01  8:32 ` [dpdk-dev] [PATCH v9 0/3] " Qiming Yang
2019-07-01  8:32   ` [dpdk-dev] [PATCH v9 1/3] net/ice: enable switch filter Qiming Yang
2019-07-01  8:32   ` [dpdk-dev] [PATCH v9 2/3] net/ice: add generic flow API Qiming Yang
2019-07-01  8:32   ` [dpdk-dev] [PATCH v9 3/3] net/ice: add UDP tunnel port support Qiming Yang
2019-07-01 11:38   ` [dpdk-dev] [PATCH v9 0/3] Enable rte_flow API in ice driver Zhang, Qi Z

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=B7F2E978279D1D49A3034B7786DACF407AF47517@SHSMSX106.ccr.corp.intel.com \
    --to=xiao.w.wang@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=wei.zhao1@intel.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
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).