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 36C31A0613 for ; Mon, 23 Sep 2019 16:26:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 52A0D1BEE3; Mon, 23 Sep 2019 16:26:31 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BC4972B91 for ; Mon, 23 Sep 2019 16:26:29 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Sep 2019 07:26:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,540,1559545200"; d="scan'208";a="213344929" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga004.fm.intel.com with ESMTP; 23 Sep 2019 07:26:27 -0700 Date: Mon, 23 Sep 2019 22:24:24 +0800 From: Ye Xiaolong To: Leyi Rong Cc: haiyue.wang@intel.com, wenzhuo.lu@intel.com, qi.z.zhang@intel.com, dev@dpdk.org Message-ID: <20190923142424.GB15446@intel.com> References: <20190829023421.112551-1-leyi.rong@intel.com> <20190919062553.79257-1-leyi.rong@intel.com> <20190919062553.79257-4-leyi.rong@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190919062553.79257-4-leyi.rong@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v4 3/6] net/ice: add protocol extraction support for per Rx queue 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 09/19, Leyi Rong wrote: >From: Haiyue Wang > [snip] >+static inline uint8_t >+ice_rxdid_to_proto_xtr_type(uint8_t rxdid) >+{ >+ static uint8_t xtr_map[] = { >+ [ICE_RXDID_COMMS_AUX_VLAN] = PROTO_XTR_VLAN, >+ [ICE_RXDID_COMMS_AUX_IPV4] = PROTO_XTR_IPV4, >+ [ICE_RXDID_COMMS_AUX_IPV6] = PROTO_XTR_IPV6, >+ [ICE_RXDID_COMMS_AUX_IPV6_FLOW] = PROTO_XTR_IPV6_FLOW, >+ [ICE_RXDID_COMMS_AUX_TCP] = PROTO_XTR_TCP, >+ }; >+ >+ return rxdid < RTE_DIM(xtr_map) ? xtr_map[rxdid] : PROTO_XTR_NONE; >+} >+ >+static inline uint8_t >+ice_proto_xtr_type_to_rxdid(uint8_t xtr_tpye) s/xtr_tpye/xtr_type/ >+{ >+ static uint8_t rxdid_map[] = { >+ [PROTO_XTR_VLAN] = ICE_RXDID_COMMS_AUX_VLAN, >+ [PROTO_XTR_IPV4] = ICE_RXDID_COMMS_AUX_IPV4, >+ [PROTO_XTR_IPV6] = ICE_RXDID_COMMS_AUX_IPV6, >+ [PROTO_XTR_IPV6_FLOW] = ICE_RXDID_COMMS_AUX_IPV6_FLOW, >+ [PROTO_XTR_TCP] = ICE_RXDID_COMMS_AUX_TCP, >+ }; >+ uint8_t rxdid; >+ >+ rxdid = xtr_tpye < RTE_DIM(rxdid_map) ? rxdid_map[xtr_tpye] : 0; >+ >+ return rxdid != 0 ? rxdid : ICE_RXDID_COMMS_GENERIC; Maybe just return xtr_type < RTE_DIM(rxdid_map) ? rxdid_map[xtr_type] : ICE_RXDID_COMMS_GENERIC; as previous ice_rxdid_to_proto_xtr_type. Thanks, Xiaolong