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 08B465A6B for ; Mon, 11 Jan 2016 08:39:10 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 10 Jan 2016 23:39:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,551,1444719600"; d="scan'208";a="724478292" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.119]) ([10.239.67.119]) by orsmga003.jf.intel.com with ESMTP; 10 Jan 2016 23:39:09 -0800 To: "Ananyev, Konstantin" , =?UTF-8?Q?N=c3=a9lio_Laranjeiro?= , "dev@dpdk.org" References: <20160104113814.GT3806@6wind.com> <2601191342CEEE43887BDE71AB97725836AE1002@irsmsx105.ger.corp.intel.com> <20160105161423.GE4712@autoinstall.dev.6wind.com> <2601191342CEEE43887BDE71AB97725836AE18E3@irsmsx105.ger.corp.intel.com> <20160106100053.GJ12095@6wind.com> <2601191342CEEE43887BDE71AB97725836AE1B46@irsmsx105.ger.corp.intel.com> <20160106154438.GP12095@6wind.com> <2601191342CEEE43887BDE71AB97725836AE2DBC@irsmsx105.ger.corp.intel.com> <20160106172248.GT12095@6wind.com> <2601191342CEEE43887BDE71AB97725836AE2F5B@irsmsx105.ger.corp.intel.com> <20160107133227.GU12095@6wind.com> From: "Tan, Jianfeng" Message-ID: <56935C1C.4040900@intel.com> Date: Mon, 11 Jan 2016 15:39:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160107133227.GU12095@6wind.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 01/12] ethdev: add API to query what/if packet type is set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 07:39:11 -0000 Hi, According to the proposal, I'm going to fix the definition of this API as below: /** * Retrieve the contextual information of an Ethernet device. * * @param port_id * The port identifier of the Ethernet device. * @param ptype_mask * A hint of what kind of packet type which the caller is interested in * @param ptypes * An array of packet types to be filled with * @param num * Size of ptypes[] * @return * - (>=0) if successful. Indicate number of valid values in ptypes array. * - (-ENOTSUP) if hardware-assisted VLAN stripping not configured. * - (-ENODEV) if *port_id* invalid. */ extern int rte_eth_dev_get_ptype_info(uint8_t port_id, uint32_t ptype_mask, uint32_t ptypes[], uint32_t num); Unresolved issues: 1) When num is exceeded, we just stop there and return num, or return -ENOMEM? The first way has a bug when: what app is exactly asking for is not filled in ptypes[] because of exceeding num, but app believes this API returns with success. 2) if RTE_PTYPE_*_MAX_NUM macros necessary? Without them, we could calculate num through 2^(number of bit 1 in RTE_PTPE_*_MASK). Thanks, Jianfeng