From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6E7A2A09D9; Wed, 11 Nov 2020 17:05:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0237E31FC; Wed, 11 Nov 2020 17:05:54 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id B961631FC for ; Wed, 11 Nov 2020 17:05:50 +0100 (CET) IronPort-SDR: 0fvO+WNJOQBwQeI3SMIsw8wZlDF1mWCKcJsOAfkCwsbHyBhNTeZF2jvjIULZDGmUnl9pLV19Pj /aLa7HVxWldA== X-IronPort-AV: E=McAfee;i="6000,8403,9802"; a="167583866" X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="167583866" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2020 08:04:28 -0800 IronPort-SDR: WbS5NP31JsZ8RFhaU2AgvvADAOFsucoH/hxY2IZ07HYG7gYCKuvH+aEBpJskcOBU3TEFxTvVBC kb3v2AYjC2GQ== X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="473902743" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.241.123]) ([10.213.241.123]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2020 08:04:26 -0800 From: Ferruh Yigit To: Jeff Guo , Haiyue Wang References: <20201111064936.768604-1-jiawenwu@trustnetic.com> <20201111064936.768604-7-jiawenwu@trustnetic.com> <249317fb-35a7-53dd-a7cb-8124685e9ae2@intel.com> Cc: Jiawen Wu , dev@dpdk.org Message-ID: <9bf5f610-4153-cdc4-365d-805eb04064aa@intel.com> Date: Wed, 11 Nov 2020 16:04:25 +0000 MIME-Version: 1.0 In-Reply-To: <249317fb-35a7-53dd-a7cb-8124685e9ae2@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 06/37] net/txgbe: add ethertype parse rule 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 11/11/2020 4:02 PM, Ferruh Yigit wrote: > On 11/11/2020 6:49 AM, Jiawen Wu wrote: >> Add support to parse flow for ethertype filter. >> >> Signed-off-by: Jiawen Wu > > <...> > >> +static int >> +txgbe_parse_ethertype_filter(struct rte_eth_dev *dev, >> +                 const struct rte_flow_attr *attr, >> +                 const struct rte_flow_item pattern[], >> +                 const struct rte_flow_action actions[], >> +                 struct rte_eth_ethertype_filter *filter, >> +                 struct rte_flow_error *error) >> +{ >> +    int ret; >> + >> +    ret = cons_parse_ethertype_filter(attr, pattern, >> +                    actions, filter, error); >> + >> +    if (ret) >> +        return ret; >> + >> +    /* txgbe doesn't support MAC address. */ >> +    if (filter->flags & RTE_ETHTYPE_FLAGS_MAC) { >> +        memset(filter, 0, sizeof(struct rte_eth_ethertype_filter)); >> +        rte_flow_error_set(error, EINVAL, >> +            RTE_FLOW_ERROR_TYPE_ITEM, >> +            NULL, "Not supported by ethertype filter"); >> +        return -rte_errno; >> +    } >> + >> +    if (filter->queue >= dev->data->nb_rx_queues) { >> +        memset(filter, 0, sizeof(struct rte_eth_ethertype_filter)); >> +        rte_flow_error_set(error, EINVAL, >> +            RTE_FLOW_ERROR_TYPE_ITEM, >> +            NULL, "queue index much too big"); >> +        return -rte_errno; >> +    } >> + >> +    if (filter->ether_type == RTE_ETHER_TYPE_IPV4 || >> +        filter->ether_type == RTE_ETHER_TYPE_IPV6) { >> +        memset(filter, 0, sizeof(struct rte_eth_ethertype_filter)); >> +        rte_flow_error_set(error, EINVAL, >> +            RTE_FLOW_ERROR_TYPE_ITEM, >> +            NULL, "IPv4/IPv6 not supported by ethertype filter"); >> +        return -rte_errno; >> +    } >> + >> +    if (filter->flags & RTE_ETHTYPE_FLAGS_MAC) { >> +        memset(filter, 0, sizeof(struct rte_eth_ethertype_filter)); >> +        rte_flow_error_set(error, EINVAL, >> +            RTE_FLOW_ERROR_TYPE_ITEM, >> +            NULL, "mac compare is unsupported"); >> +        return -rte_errno; >> +    } > > Isn't 'RTE_ETHTYPE_FLAGS_MAC' already checked a few blocks above, that time > error message was ""Not supported by ethertype filter" > Hi Jia, Haiyue, Same exists in the ixgbe driver, this how end up in the txgbe, can you please check?