From: Gagandeep Singh Date: Wed, 3 Oct 2018 13:36:07 +0000 (+0530) Subject: net/enetc: support packet type parsing X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3756a4c6f83bf2abf61b1b1c343fe63773d0436b;p=dpdk.git net/enetc: support packet type parsing enable supported packet parse types feature Signed-off-by: Gagandeep Singh Acked-by: Shreyansh Jain Reviewed-by: Ferruh Yigit --- diff --git a/doc/guides/nics/features/enetc.ini b/doc/guides/nics/features/enetc.ini index f780404b8d..bd9cb0bc0d 100644 --- a/doc/guides/nics/features/enetc.ini +++ b/doc/guides/nics/features/enetc.ini @@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Packet type parsing = Y Link status = Y Linux VFIO = Y ARMv8 = Y diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index dfe7ddaa15..3ee7bb4463 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -28,6 +28,7 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); static void enetc_tx_queue_release(void *txq); +static const uint32_t *enetc_supported_ptypes_get(struct rte_eth_dev *dev); /* * The set of PCI devices this driver supports @@ -50,6 +51,7 @@ static const struct eth_dev_ops enetc_ops = { .rx_queue_release = enetc_rx_queue_release, .tx_queue_setup = enetc_tx_queue_setup, .tx_queue_release = enetc_tx_queue_release, + .dev_supported_ptypes_get = enetc_supported_ptypes_get, }; /** @@ -182,6 +184,23 @@ enetc_dev_close(struct rte_eth_dev *dev) dev->data->nb_tx_queues = 0; } +static const uint32_t * +enetc_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) +{ + static const uint32_t ptypes[] = { + RTE_PTYPE_L2_ETHER, + RTE_PTYPE_L3_IPV4, + RTE_PTYPE_L3_IPV6, + RTE_PTYPE_L4_TCP, + RTE_PTYPE_L4_UDP, + RTE_PTYPE_L4_SCTP, + RTE_PTYPE_L4_ICMP, + RTE_PTYPE_UNKNOWN + }; + + return ptypes; +} + /* return 0 means link status changed, -1 means not changed */ static int enetc_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)