From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BE5C5A09FF; Mon, 4 Jan 2021 16:21:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 553F1160733; Mon, 4 Jan 2021 16:21:58 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 0EFE216072F for ; Mon, 4 Jan 2021 16:21:55 +0100 (CET) IronPort-SDR: zAerWAlK88YYriMFrGuffFdk6pn7c59Nrd4XmSx8DMMadca2YNZ7vYLvtVhAiOfgmIPZb3PGS+ RziW32dD51nQ== X-IronPort-AV: E=McAfee;i="6000,8403,9854"; a="174389056" X-IronPort-AV: E=Sophos;i="5.78,474,1599548400"; d="scan'208";a="174389056" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2021 07:21:54 -0800 IronPort-SDR: xZGmUsjVKQ8wla6oOFrtPv5xkjQG5R6p14HIsSaNik+9khtGKqPa7IEMdA4orpMtfNtacgXmgq x2/bH1w+WwPA== X-IronPort-AV: E=Sophos;i="5.78,474,1599548400"; d="scan'208";a="378456780" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.251.93.148]) ([10.251.93.148]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2021 07:21:52 -0800 To: Yuying Zhang , dev@dpdk.org, qi.z.zhang@intel.com, jingjing.wu@intel.com References: <20201201083207.70668-1-yuying.zhang@intel.com> From: Ferruh Yigit Message-ID: <8879813b-a78b-0b0e-91cc-68bbde010a5c@intel.com> Date: Mon, 4 Jan 2021 15:21:49 +0000 MIME-Version: 1.0 In-Reply-To: <20201201083207.70668-1-yuying.zhang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v1] net/iavf: support FDIR TCP/UDP pattern without input set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 12/1/2020 8:32 AM, Yuying Zhang wrote: > This patch adds an input set refinement function to support outer > and inner TCP/UDP patterns without input set for flow director filter. > Can you please describe more what is supported now, it can be even better to give same samples which patter is supported now, which was not supported before? > Signed-off-by: Yuying Zhang > --- > drivers/net/iavf/iavf_fdir.c | 67 ++++++++++++++++++++++++++++++------ > 1 file changed, 56 insertions(+), 11 deletions(-) > > diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c > index 7054bde0b..2c57313e4 100644 > --- a/drivers/net/iavf/iavf_fdir.c > +++ b/drivers/net/iavf/iavf_fdir.c > @@ -448,9 +448,56 @@ iavf_fdir_parse_action(struct iavf_adapter *ad, > return 0; > } > > +static int > +iavf_fdir_refine_input_set(const uint64_t input_set, > + const uint64_t input_set_mask, > + struct iavf_fdir_conf *filter) > +{ > + struct virtchnl_proto_hdr *hdr, *hdr_last; > + struct rte_flow_item_ipv4 ipv4_spec; > + struct rte_flow_item_ipv6 ipv6_spec; > + int last_layer; > + uint8_t proto_id; > + > + if (input_set & ~input_set_mask) > + return -rte_errno; What is the value of the 'rte_errno' at this stage, why returning it instead of setting it? > + else if (input_set) > + return 0; > + > + last_layer = filter->add_fltr.rule_cfg.proto_hdrs.count - 1; > + hdr_last = &filter->add_fltr.rule_cfg.proto_hdrs.proto_hdr[last_layer]; > + if (hdr_last->type == VIRTCHNL_PROTO_HDR_TCP) > + proto_id = 6; > + else if (hdr_last->type == VIRTCHNL_PROTO_HDR_UDP) > + proto_id = 17; > + else > + return -rte_errno; > + > + hdr = &filter->add_fltr.rule_cfg.proto_hdrs.proto_hdr[last_layer - 1]; Do we know here that 'last_layer' > 0 ? > + switch (hdr->type) { > + case VIRTCHNL_PROTO_HDR_IPV4: > + VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, PROT); > + memset(&ipv4_spec, 0, sizeof(ipv4_spec)); > + ipv4_spec.hdr.next_proto_id = proto_id; > + rte_memcpy(hdr->buffer, &ipv4_spec.hdr, > + sizeof(ipv4_spec.hdr)); > + return 0; > + case VIRTCHNL_PROTO_HDR_IPV6: > + VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, PROT); > + memset(&ipv6_spec, 0, sizeof(ipv6_spec)); > + ipv6_spec.hdr.proto = proto_id; > + rte_memcpy(hdr->buffer, &ipv6_spec.hdr, > + sizeof(ipv6_spec.hdr)); > + return 0; > + default: > + return -rte_errno; > + } > +} > + <...>