[dpdk-dev] [PATCH v5 3/4] net/enetc: support packet parse type

Gagandeep Singh g.singh at nxp.com
Wed Oct 3 15:36:07 CEST 2018


enable supported packet parse types feature

Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
---
 doc/guides/nics/features/enetc.ini |  1 +
 drivers/net/enetc/enetc_ethdev.c   | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/doc/guides/nics/features/enetc.ini b/doc/guides/nics/features/enetc.ini
index f780404b8..bd9cb0bc0 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 dfe7ddaa1..3ee7bb446 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)
-- 
2.17.1



More information about the dev mailing list