From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 381B63772 for ; Thu, 22 Dec 2016 10:48:06 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 22 Dec 2016 01:48:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,387,1477983600"; d="scan'208";a="205673495" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by fmsmga004.fm.intel.com with ESMTP; 22 Dec 2016 01:48:04 -0800 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.252]) by PGSMSX104.gar.corp.intel.com ([169.254.3.85]) with mapi id 14.03.0248.002; Thu, 22 Dec 2016 17:48:03 +0800 From: "Zhao1, Wei" To: "Yigit, Ferruh" , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH 01/18] net/ixgbe: store SYN filter Thread-Index: AQHSTIlmEad9/8ZRgEee5RaOdfYQ2qEQpJwAgAMu0rA= Date: Thu, 22 Dec 2016 09:48:03 +0000 Message-ID: References: <1480675394-59179-1-git-send-email-wei.zhao1@intel.com> <1480675394-59179-2-git-send-email-wei.zhao1@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 01/18] net/ixgbe: store SYN filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2016 09:48:07 -0000 Hi, Yigit > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, December 21, 2016 12:56 AM > To: Zhao1, Wei ; dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: Re: [dpdk-dev] [PATCH 01/18] net/ixgbe: store SYN filter >=20 > On 12/2/2016 10:42 AM, Wei Zhao wrote: > > From: wei zhao1 > > > > Add support for storing SYN filter in SW. >=20 > Do you think does it makes more clear to refer as TCP SYN filter? Or SYN = filter > is clear enough? >=20 Ok, I will change to " TCP SYN filter " to make it more clear > > > > Signed-off-by: Wenzhuo Lu > > Signed-off-by: wei zhao1 >=20 > Can you please update sign-off to your actual name? > Ok, I will change to " Signed-off-by: Wei Zhao " > > --- > > drivers/net/ixgbe/ixgbe_ethdev.c | 12 ++++++++++-- > > drivers/net/ixgbe/ixgbe_ethdev.h | 2 ++ > > 2 files changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > > b/drivers/net/ixgbe/ixgbe_ethdev.c > > index edc9b22..7f10cca 100644 > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > > @@ -1287,6 +1287,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev) > > memset(filter_info->fivetuple_mask, 0, > > sizeof(uint32_t) * IXGBE_5TUPLE_ARRAY_SIZE); > > > > + /* initialize SYN filter */ > > + filter_info->syn_info =3D 0; >=20 > can it be an option to memset all filter_info? (and of course move list i= nit > after memset) >=20 Maybe, change to the following code? memset(filter_info, 0, sizeof(struct ixgbe_filter_info));=20 TAILQ_INIT(&filter_info->fivetuple_list); But that wiil mix /* initialize ether type filter */ and /* initialize 5tup= le filter list */ two process together, Because struct ixgbe_filter_info store two type info of ether and 5tuple. So, not to change ? struct ixgbe_filter_info { uint8_t ethertype_mask; /* Bit mask for every used ethertype filter */ /* store used ethertype filters*/ struct ixgbe_ethertype_filter ethertype_filters[IXGBE_MAX_ETQF_FILTERS]; /* Bit mask for every used 5tuple filter */ uint32_t fivetuple_mask[IXGBE_5TUPLE_ARRAY_SIZE]; struct ixgbe_5tuple_filter_list fivetuple_list; /* store the SYN filter info */ uint32_t syn_info; }; > > return 0; > > } > > > > @@ -5509,15 +5511,19 @@ ixgbe_syn_filter_set(struct rte_eth_dev *dev, > > bool add) > > { > > struct ixgbe_hw *hw =3D > > IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > + struct ixgbe_filter_info *filter_info =3D > > + IXGBE_DEV_PRIVATE_TO_FILTER_INFO(dev->data- > >dev_private); > > + uint32_t syn_info; > > uint32_t synqf; > > > > if (filter->queue >=3D IXGBE_MAX_RX_QUEUE_NUM) > > return -EINVAL; > > > > + syn_info =3D filter_info->syn_info; > > synqf =3D IXGBE_READ_REG(hw, IXGBE_SYNQF); > > > > if (add) { > > - if (synqf & IXGBE_SYN_FILTER_ENABLE) > > + if (syn_info & IXGBE_SYN_FILTER_ENABLE) >=20 > If these checks will be done on syn_info, shouldn't syn_info be assigned = to > synqf before this. Specially for first usage, synqf may be different than= hw > register. >=20 > Or perhaps can keep continue to use synqf. Since synqf assigned to > filter_info->syn_info after updated. >=20 Let me have a deeper think of this to reply you. > > return -EINVAL; > > synqf =3D (uint32_t)(((filter->queue << > IXGBE_SYN_FILTER_QUEUE_SHIFT) & > > IXGBE_SYN_FILTER_QUEUE) | > IXGBE_SYN_FILTER_ENABLE); @@ -5527,10 > > +5533,12 @@ ixgbe_syn_filter_set(struct rte_eth_dev *dev, > > else > > synqf &=3D ~IXGBE_SYN_FILTER_SYNQFP; > > } else { > > - if (!(synqf & IXGBE_SYN_FILTER_ENABLE)) > > + if (!(syn_info & IXGBE_SYN_FILTER_ENABLE)) > > return -ENOENT; > > synqf &=3D ~(IXGBE_SYN_FILTER_QUEUE | > IXGBE_SYN_FILTER_ENABLE); > > } > > + > > + filter_info->syn_info =3D synqf; > > IXGBE_WRITE_REG(hw, IXGBE_SYNQF, synqf); > > IXGBE_WRITE_FLUSH(hw); > > return 0; > <...> >=20