From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 0FBCA1B53 for ; Fri, 21 Sep 2018 15:28:39 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2018 06:28:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,285,1534834800"; d="scan'208";a="71831221" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.39]) ([10.237.221.39]) by fmsmga007.fm.intel.com with ESMTP; 21 Sep 2018 06:28:37 -0700 To: Gagandeep Singh , dev@dpdk.org Cc: pankaj.chauhan@nxp.com References: <20180906055449.21731-1-g.singh@nxp.com> <20180913094201.17098-1-g.singh@nxp.com> <20180913094201.17098-4-g.singh@nxp.com> From: Ferruh Yigit Openpgp: preference=signencrypt Message-ID: <9d6ed0aa-c08d-9be2-0798-115c0d086207@intel.com> Date: Fri, 21 Sep 2018 14:28:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180913094201.17098-4-g.singh@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 3/3] net/enetc: enable Rx and Tx 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: Fri, 21 Sep 2018 13:28:40 -0000 On 9/13/2018 10:42 AM, Gagandeep Singh wrote: > Add RX and TX queue setup, datapath functions > and enable the packet parsing > > Signed-off-by: Gagandeep Singh <...> > -LDLIBS += -lrte_eal > +LDLIBS += -lrte_eal -lrte_mempool > LDLIBS += -lrte_ethdev > LDLIBS += -lrte_bus_pci Isn't mbuf and ring are dependency? <...> > +static inline void __attribute__((hot)) > +enetc_dev_rx_parse(struct rte_mbuf *m, uint16_t parse_results) > +{ > + ENETC_PMD_DP_DEBUG("parse summary = 0x%x ", parse_results); > + > + m->packet_type = RTE_PTYPE_UNKNOWN; > + switch (parse_results) { > + case ENETC_PKT_TYPE_ETHER: > + m->packet_type = RTE_PTYPE_L2_ETHER; > + break; > + case ENETC_PKT_TYPE_IPV4: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4; > + break; > + case ENETC_PKT_TYPE_IPV6: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6; > + break; > + case ENETC_PKT_TYPE_IPV4_TCP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP; > + break; > + case ENETC_PKT_TYPE_IPV6_TCP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP; > + break; > + case ENETC_PKT_TYPE_IPV4_UDP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP; > + break; > + case ENETC_PKT_TYPE_IPV6_UDP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP; > + break; > + case ENETC_PKT_TYPE_IPV4_SCTP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_SCTP; > + break; > + case ENETC_PKT_TYPE_IPV6_SCTP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; > + break; > + case ENETC_PKT_TYPE_IPV4_ICMP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_ICMP; > + break; > + case ENETC_PKT_TYPE_IPV6_ICMP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_ICMP; > + break; > + /* More switch cases can be added */ > + default: > + m->packet_type = RTE_PTYPE_UNKNOWN; > + } > +} You are already getting packet type info from device and set mbuf, by implementing (relatively easy) rte_eth_dev_get_supported_ptypes() API you can make applications use these values better, And enable "Packet type parsing" feature in .ini file