From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 98749214A for ; Mon, 29 Feb 2016 12:34:30 +0100 (CET) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 0D9CB8F2F2; Mon, 29 Feb 2016 11:34:30 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-7-93.ams2.redhat.com [10.36.7.93]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TBYSJT031618; Mon, 29 Feb 2016 06:34:29 -0500 To: dev@dpdk.org, Jianfeng Tan References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1456472067-2721-1-git-send-email-jianfeng.tan@intel.com> <1456472067-2721-2-git-send-email-jianfeng.tan@intel.com> From: Panu Matilainen Message-ID: <56D42CC4.4000100@redhat.com> Date: Mon, 29 Feb 2016 13:34:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1456472067-2721-2-git-send-email-jianfeng.tan@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Subject: Re: [dpdk-dev] [PATCH v5 01/11] ethdev: add API to query packet type filling info 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, 29 Feb 2016 11:34:31 -0000 On 02/26/2016 09:34 AM, Jianfeng Tan wrote: > Add a new API rte_eth_dev_get_ptype_info to query whether/what packet > type can be filled by given pmd rx burst function. > > Signed-off-by: Jianfeng Tan > --- > lib/librte_ether/rte_ethdev.c | 26 ++++++++++++++++++++++++++ > lib/librte_ether/rte_ethdev.h | 26 ++++++++++++++++++++++++++ > 2 files changed, 52 insertions(+) > [...] > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 16da821..16f32a0 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1021,6 +1021,9 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); > /**< @internal Get specific informations of an Ethernet device. */ > > +typedef const uint32_t *(*eth_dev_ptype_info_get_t)(struct rte_eth_dev *dev); > +/**< @internal Get ptype info of eth_rx_burst_t. */ > + > typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev, > uint16_t queue_id); > /**< @internal Start rx and tx of a queue of an Ethernet device. */ > @@ -1347,6 +1350,7 @@ struct eth_dev_ops { > eth_queue_stats_mapping_set_t queue_stats_mapping_set; > /**< Configure per queue stat counter mapping. */ > eth_dev_infos_get_t dev_infos_get; /**< Get device info. */ > + eth_dev_ptype_info_get_t dev_ptype_info_get; /** Get ptype info */ > mtu_set_t mtu_set; /**< Set MTU. */ > vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */ > vlan_tpid_set_t vlan_tpid_set; /**< Outer VLAN TPID Setup. */ > @@ -2268,6 +2272,28 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); Technically this is an ABI break but its marked internal and I guess it falls into the "drivers only" territory similar to what was discussed in this thead: http://dpdk.org/ml/archives/dev/2016-January/032348.html so its probably ok. > void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); > > /** > + * Retrieve the packet type 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 pointer to store adequent packet types, allocated by caller. > + * @param num > + * Size of the array pointed by param ptypes. > + * @return > + * - (>0) Number of ptypes supported. If it exceeds param num, exceeding > + * packet types will not be filled in the given array. > + * - (0 or -ENOTSUP) if PMD does not fill the specified ptype. > + * - (-ENODEV) if *port_id* invalid. > + */ > +extern int rte_eth_dev_get_ptype_info(uint8_t port_id, > + uint32_t ptype_mask, > + uint32_t *ptypes, > + int num); > + > +/** > * Retrieve the MTU of an Ethernet device. > * > * @param port_id > "extern" is redundant in headers. We just saw a round of removing them (commit dd34ff1f0e03b2c5e4a97e9fbcba5c8238aac573), lets not add them back :) More importantly, to export a function you need to add an entry for it in rte_ether_version.map. - Panu -