From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5EB07106B for ; Mon, 15 Jun 2015 09:19:50 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 15 Jun 2015 00:19:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,617,1427785200"; d="scan'208";a="508377840" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by FMSMGA003.fm.intel.com with ESMTP; 15 Jun 2015 00:19:50 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 15 Jun 2015 15:19:47 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.129]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.246]) with mapi id 14.03.0224.002; Mon, 15 Jun 2015 15:19:46 +0800 From: "Wu, Jingjing" To: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] ixgbe: fix x550 flow director issue Thread-Index: AQHQpzCUKDkYm7ToUkiYDW66MdtGpp2tKMMg Date: Mon, 15 Jun 2015 07:19:46 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8C533E8@SHSMSX104.ccr.corp.intel.com> References: <1434347966-29668-1-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1434347966-29668-1-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix x550 flow director issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 07:19:51 -0000 Acked-by: Jingjing Wu > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > Sent: Monday, June 15, 2015 1:59 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] ixgbe: fix x550 flow director issue >=20 > On x550, flow director doesn't support other IP packets directly. > If we want to monitor IP other packets, the L4 protocol and ports must be > masked. It means, on x550, if we want to add a flow director filter for o= ther > IP packets, a flow director mask must have been configed to mask L4 > protocol and ports. >=20 > Return err when the user try to config a flow director filter for other I= P > packets without flow director mask configed before. And print err log for= it. >=20 > Signed-off-by: Wenzhuo Lu > --- > drivers/net/ixgbe/ixgbe_fdir.c | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdi= r.c > index db48817..40824ba 100644 > --- a/drivers/net/ixgbe/ixgbe_fdir.c > +++ b/drivers/net/ixgbe/ixgbe_fdir.c > @@ -334,9 +334,10 @@ fdir_set_input_mask_82599(struct rte_eth_dev > *dev, > fdirtcpm =3D reverse_fdir_bitmasks(input_mask->dst_port_mask, > input_mask->src_port_mask); >=20 > - /* write both the same so that UDP and TCP use the same mask */ > + /* write all the same so that UDP, TCP and SCTP use the same mask > */ > IXGBE_WRITE_REG(hw, IXGBE_FDIRTCPM, ~fdirtcpm); > IXGBE_WRITE_REG(hw, IXGBE_FDIRUDPM, ~fdirtcpm); > + IXGBE_WRITE_REG(hw, IXGBE_FDIRSCTPM, ~fdirtcpm); > info->mask.src_port_mask =3D input_mask->src_port_mask; > info->mask.dst_port_mask =3D input_mask->dst_port_mask; >=20 > @@ -899,10 +900,31 @@ ixgbe_add_del_fdir_filter(struct rte_eth_dev *dev, > uint8_t queue; > bool is_perfect =3D FALSE; > int err; > + struct ixgbe_hw_fdir_info *info =3D > + IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data- > >dev_private); >=20 > if (dev->data->dev_conf.fdir_conf.mode =3D=3D RTE_FDIR_MODE_NONE) > return -ENOTSUP; >=20 > + /* > + * Sanity check for x550. > + * When adding a new filter with flow type set to IPv4-other, > + * the flow director mask should be configed before, > + * and the L4 protocol and ports are masked. > + */ > + if ((!del) && > + (hw->mac.type =3D=3D ixgbe_mac_X550 || > + hw->mac.type =3D=3D ixgbe_mac_X550EM_x) && > + (fdir_filter->input.flow_type =3D=3D > + RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) && > + (info->mask.src_port_mask !=3D 0 || > + info->mask.dst_port_mask !=3D 0)) { > + PMD_DRV_LOG(ERR, "By this device," > + " IPv4-other is not supported without" > + " L4 protocol and ports masked!"); > + return -ENOTSUP; > + } > + > if (dev->data->dev_conf.fdir_conf.mode =3D=3D > RTE_FDIR_MODE_PERFECT) > is_perfect =3D TRUE; >=20 > -- > 1.9.3