This improves performance, since clients may be able to skip SW
packet classification.

Signed-off-by: Andrew Boyer <andrew.bo...@amd.com>
---
 doc/guides/rel_notes/release_22_11.rst |  1 +
 drivers/net/ionic/ionic_ethdev.c       |  1 +
 drivers/net/ionic/ionic_rxtx.c         | 19 +++++++++++++++++++
 drivers/net/ionic/ionic_rxtx.h         |  2 ++
 4 files changed, 23 insertions(+)

diff --git a/doc/guides/rel_notes/release_22_11.rst 
b/doc/guides/rel_notes/release_22_11.rst
index 0c962f9637..5c3bd15e55 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -85,6 +85,7 @@ New Features
   * Updated to reflect that Pensando has been acquired by AMD.
   * Enhanced data path to provide substantial performance improvements.
   * Added support for mbuf fast free.
+  * Added support for advertising packet types.
 
 Removed Items
 -------------
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 38241d41ec..39bbe60d79 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -70,6 +70,7 @@ static const struct rte_eth_desc_lim tx_desc_lim_v1 = {
 
 static const struct eth_dev_ops ionic_eth_dev_ops = {
        .dev_infos_get          = ionic_dev_info_get,
+       .dev_supported_ptypes_get = ionic_dev_supported_ptypes_get,
        .dev_configure          = ionic_dev_configure,
        .mtu_set                = ionic_dev_mtu_set,
        .dev_start              = ionic_dev_start,
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index 134589b016..24fd8fcf04 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -850,6 +850,25 @@ static const uint32_t 
ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK]
                RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP,
 };
 
+const uint32_t *
+ionic_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
+{
+       /* See ionic_ptype_table[] */
+       static const uint32_t ptypes[] = {
+               RTE_PTYPE_L2_ETHER,
+               RTE_PTYPE_L2_ETHER_TIMESYNC,
+               RTE_PTYPE_L2_ETHER_LLDP,
+               RTE_PTYPE_L2_ETHER_ARP,
+               RTE_PTYPE_L3_IPV4,
+               RTE_PTYPE_L3_IPV6,
+               RTE_PTYPE_L4_TCP,
+               RTE_PTYPE_L4_UDP,
+               RTE_PTYPE_UNKNOWN
+       };
+
+       return ptypes;
+}
+
 /*
  * Cleans one descriptor. Connects the filled mbufs into a chain.
  * Does not advance the tail index.
diff --git a/drivers/net/ionic/ionic_rxtx.h b/drivers/net/ionic/ionic_rxtx.h
index 79ec1112de..de51f21012 100644
--- a/drivers/net/ionic/ionic_rxtx.h
+++ b/drivers/net/ionic/ionic_rxtx.h
@@ -40,4 +40,6 @@ void ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t 
queue_id,
 void ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
        struct rte_eth_txq_info *qinfo);
 
+const uint32_t *ionic_dev_supported_ptypes_get(struct rte_eth_dev *dev);
+
 #endif /* _IONIC_RXTX_H_ */
-- 
2.17.1

Reply via email to