[dpdk-dev,v7,04/11] pmd/enic: add dev_ptype_info_get implementation
Commit Message
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/enic/enic_ethdev.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Comments
On Thu, Mar 10, 2016 at 03:31:28AM +0800, Jianfeng Tan wrote:
> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---
> drivers/net/enic/enic_ethdev.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
I get compile errors when I apply this patch:
== Build drivers/net/enic
CC enic_ethdev.o
/home/bruce/next-net/dpdk-next-net/drivers/net/enic/enic_ethdev.c:57:17: error: ‘enicpmd_recv_pkts’ used but never defined [-Werror]
static uint16_t enicpmd_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
^
compilation terminated due to -Wfatal-errors.
/Bruce
On Thu, Mar 10, 2016 at 02:50:04PM +0000, Bruce Richardson wrote:
> On Thu, Mar 10, 2016 at 03:31:28AM +0800, Jianfeng Tan wrote:
> > Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
> > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> > Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> > ---
> > drivers/net/enic/enic_ethdev.c | 17 +++++++++++++++++
> > 1 file changed, 17 insertions(+)
> >
> I get compile errors when I apply this patch:
>
> == Build drivers/net/enic
> CC enic_ethdev.o
> /home/bruce/next-net/dpdk-next-net/drivers/net/enic/enic_ethdev.c:57:17: error: ‘enicpmd_recv_pkts’ used but never defined [-Werror]
> static uint16_t enicpmd_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
> ^
> compilation terminated due to -Wfatal-errors.
>
Sorry, forgot other details to reproduce. This error I see with gcc 5.3 on Fedora 23.
/Bruce
Hi Bruce,
On 3/10/2016 10:51 PM, Bruce Richardson wrote:
> On Thu, Mar 10, 2016 at 02:50:04PM +0000, Bruce Richardson wrote:
>> On Thu, Mar 10, 2016 at 03:31:28AM +0800, Jianfeng Tan wrote:
>>> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
>>> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>>> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
>>> ---
>>> drivers/net/enic/enic_ethdev.c | 17 +++++++++++++++++
>>> 1 file changed, 17 insertions(+)
>>>
>> I get compile errors when I apply this patch:
>>
>> == Build drivers/net/enic
>> CC enic_ethdev.o
>> /home/bruce/next-net/dpdk-next-net/drivers/net/enic/enic_ethdev.c:57:17: error: ‘enicpmd_recv_pkts’ used but never defined [-Werror]
>> static uint16_t enicpmd_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
>> ^
>> compilation terminated due to -Wfatal-errors.
>>
> Sorry, forgot other details to reproduce. This error I see with gcc 5.3 on Fedora 23.
That's strange, I tested in VM + Fedora 23 + GCC 5.3.1, and I did not
see this error. (I cannot find a GCC 5.3.0 package for now). Maybe need
more investigation.
Thanks,
Jianfeng
>
> /Bruce
@@ -54,6 +54,9 @@
#define ENICPMD_FUNC_TRACE() (void)0
#endif
+static uint16_t enicpmd_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
+ uint16_t nb_pkts);
+
/*
* The set of PCI devices this driver supports
*/
@@ -431,6 +434,19 @@ static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev,
DEV_TX_OFFLOAD_TCP_CKSUM;
}
+static const uint32_t *enicpmd_dev_ptype_info_get(struct rte_eth_dev *dev)
+{
+ static const uint32_t ptypes[] = {
+ RTE_PTYPE_L3_IPV4,
+ RTE_PTYPE_L3_IPV6,
+ RTE_PTYPE_UNKNOWN
+ };
+
+ if (dev->rx_pkt_burst == enicpmd_recv_pkts)
+ return ptypes;
+ return NULL;
+}
+
static void enicpmd_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)
{
struct enic *enic = pmd_priv(eth_dev);
@@ -566,6 +582,7 @@ static const struct eth_dev_ops enicpmd_eth_dev_ops = {
.stats_reset = enicpmd_dev_stats_reset,
.queue_stats_mapping_set = NULL,
.dev_infos_get = enicpmd_dev_info_get,
+ .dev_ptype_info_get = enicpmd_dev_ptype_info_get,
.mtu_set = NULL,
.vlan_filter_set = enicpmd_vlan_filter_set,
.vlan_tpid_set = NULL,