From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 650ED3253; Wed, 19 Jul 2017 05:48:03 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jul 2017 20:48:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,379,1496127600"; d="scan'208";a="1197067138" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by fmsmga002.fm.intel.com with ESMTP; 18 Jul 2017 20:48:01 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.148]) by PGSMSX108.gar.corp.intel.com ([10.221.44.103]) with mapi id 14.03.0319.002; Wed, 19 Jul 2017 11:47:59 +0800 From: "Zhao1, Wei" To: "Zhang, Qi Z" , "Lu, Wenzhuo" CC: "dev@dpdk.org" , "Zhang, Qi Z" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/ixgbe: fix sctp port support limitation Thread-Index: AQHTACkF64UnkCsqFEuawEeTyv6Qd6Jagqyw Date: Wed, 19 Jul 2017 03:47:59 +0000 Message-ID: References: <20170719083917.63441-1-qi.z.zhang@intel.com> In-Reply-To: <20170719083917.63441-1-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action 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] net/ixgbe: fix sctp port support limitation 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: Wed, 19 Jul 2017 03:48:06 -0000 Hi, zhangqi 82599 also support SCTP packet type, you can reference to this patch: http://dpdk.org/dev/patchwork/patch/27012/=20 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qi Zhang > Sent: Wednesday, July 19, 2017 4:39 PM > To: Lu, Wenzhuo > Cc: dev@dpdk.org; Zhang, Qi Z ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/ixgbe: fix sctp port support limitation >=20 > Only x550 family support sctp port in fdir filter, so add this limiation = when > parse consistent API. >=20 > Fixes: 11777435c727 ("net/ixgbe: parse flow director filter") > Cc: stable@dpdk.org >=20 > Signed-off-by: Qi Zhang > --- > drivers/net/ixgbe/ixgbe_flow.c | 107 ++++++++++++++++++++++++--------- > -------- > 1 file changed, 64 insertions(+), 43 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flo= w.c > index f70bdb0..4b5697a 100644 > --- a/drivers/net/ixgbe/ixgbe_flow.c > +++ b/drivers/net/ixgbe/ixgbe_flow.c > @@ -1375,7 +1375,8 @@ static inline uint8_t signature_match(const struct > rte_flow_item pattern[]) > * Item->last should be NULL. > */ > static int > -ixgbe_parse_fdir_filter_normal(const struct rte_flow_attr *attr, > +ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev, > + const struct rte_flow_attr *attr, > const struct rte_flow_item pattern[], > const struct rte_flow_action actions[], > struct ixgbe_fdir_rule *rule, @@ -1398,9 +1399,10 > @@ ixgbe_parse_fdir_filter_normal(const struct rte_flow_attr *attr, > const struct rte_flow_item_vlan *vlan_mask; > const struct rte_flow_item_raw *raw_mask; > const struct rte_flow_item_raw *raw_spec; > - > uint8_t j; >=20 > + struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > + > if (!pattern) { > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ITEM_NUM, > @@ -1897,49 +1899,68 @@ ixgbe_parse_fdir_filter_normal(const struct > rte_flow_attr *attr, > item, "Not supported last point for range"); > return -rte_errno; > } > - /** > - * Only care about src & dst ports, > - * others should be masked. > - */ > - if (!item->mask) { > - memset(rule, 0, sizeof(struct ixgbe_fdir_rule)); > - rte_flow_error_set(error, EINVAL, > - RTE_FLOW_ERROR_TYPE_ITEM, > - item, "Not supported by fdir filter"); > - return -rte_errno; > - } > - rule->b_mask =3D TRUE; > - sctp_mask =3D > - (const struct rte_flow_item_sctp *)item->mask; > - if (sctp_mask->hdr.tag || > - sctp_mask->hdr.cksum) { > - memset(rule, 0, sizeof(struct ixgbe_fdir_rule)); > - rte_flow_error_set(error, EINVAL, > - RTE_FLOW_ERROR_TYPE_ITEM, > - item, "Not supported by fdir filter"); > - return -rte_errno; > - } > - rule->mask.src_port_mask =3D sctp_mask->hdr.src_port; > - rule->mask.dst_port_mask =3D sctp_mask->hdr.dst_port; >=20 > - if (item->spec) { > - rule->b_spec =3D TRUE; > - sctp_spec =3D > + /* only x550 family support sctp port */ > + if (hw->mac.type =3D=3D ixgbe_mac_X550 || > + hw->mac.type =3D=3D ixgbe_mac_X550EM_x || > + hw->mac.type =3D=3D ixgbe_mac_X550EM_a) { > + /** > + * Only care about src & dst ports, > + * others should be masked. > + */ > + if (!item->mask) { > + memset(rule, 0, sizeof(struct > ixgbe_fdir_rule)); > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, "Not supported by fdir filter"); > + return -rte_errno; > + } > + rule->b_mask =3D TRUE; > + sctp_mask =3D > + (const struct rte_flow_item_sctp *)item- > >mask; > + if (sctp_mask->hdr.tag || > + sctp_mask->hdr.cksum) { > + memset(rule, 0, sizeof(struct > ixgbe_fdir_rule)); > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, "Not supported by fdir filter"); > + return -rte_errno; > + } > + rule->mask.src_port_mask =3D sctp_mask- > >hdr.src_port; > + rule->mask.dst_port_mask =3D sctp_mask- > >hdr.dst_port; > + > + if (item->spec) { > + rule->b_spec =3D TRUE; > + sctp_spec =3D > (const struct rte_flow_item_sctp *)item- > >spec; > - rule->ixgbe_fdir.formatted.src_port =3D > - sctp_spec->hdr.src_port; > - rule->ixgbe_fdir.formatted.dst_port =3D > - sctp_spec->hdr.dst_port; > - } > + rule->ixgbe_fdir.formatted.src_port =3D > + sctp_spec->hdr.src_port; > + rule->ixgbe_fdir.formatted.dst_port =3D > + sctp_spec->hdr.dst_port; > + } >=20 > - item =3D next_no_fuzzy_pattern(pattern, item); > - if (item->type !=3D RTE_FLOW_ITEM_TYPE_RAW && > - item->type !=3D RTE_FLOW_ITEM_TYPE_END) { > - memset(rule, 0, sizeof(struct ixgbe_fdir_rule)); > - rte_flow_error_set(error, EINVAL, > - RTE_FLOW_ERROR_TYPE_ITEM, > - item, "Not supported by fdir filter"); > - return -rte_errno; > + item =3D next_no_fuzzy_pattern(pattern, item); > + if (item->type !=3D RTE_FLOW_ITEM_TYPE_RAW && > + item->type !=3D RTE_FLOW_ITEM_TYPE_END) { > + memset(rule, 0, sizeof(struct > ixgbe_fdir_rule)); > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, "Not supported by fdir filter"); > + return -rte_errno; > + } > + } else { > + /* sctp port is not supported */ > + sctp_mask =3D > + (const struct rte_flow_item_sctp *)item- > >mask; > + if (sctp_mask && > + (sctp_mask->hdr.src_port || > + sctp_mask->hdr.dst_port)) { > + memset(rule, 0, sizeof(struct > ixgbe_fdir_rule)); > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, "Not supported by fdir filter"); > + return -rte_errno; > + } > } > } >=20 > @@ -2528,7 +2549,7 @@ ixgbe_parse_fdir_filter(struct rte_eth_dev *dev, > hw->mac.type !=3D ixgbe_mac_X550EM_a) > return -ENOTSUP; >=20 > - ret =3D ixgbe_parse_fdir_filter_normal(attr, pattern, > + ret =3D ixgbe_parse_fdir_filter_normal(dev, attr, pattern, > actions, rule, error); >=20 > if (!ret) > -- > 2.9.4