Signed-off-by: Jianfeng Tan <jianfeng.tan at intel.com>
---
 drivers/net/nfp/nfp_net.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index bc2089f..c121d7b 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1075,6 +1075,23 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct 
rte_eth_dev_info *dev_info)
 #endif
 }

+static int
+nfp_net_ptype_info_get(struct rte_eth_dev *dev, uint32_t ptype_mask,
+               uint32_t ptypes[])
+{
+       int num = 0;
+
+       if (dev->rx_pkt_burst == nfp_net_recv_pkts) {
+               /* refers to nfp_net_set_hash() */
+               if ((ptype_mask & RTE_PTYPE_INNER_L3_MASK) == 
RTE_PTYPE_INNER_L3_MASK) {
+                       ptypes[num++] = RTE_PTYPE_INNER_L3_IPV4;
+                       ptypes[num++] = RTE_PTYPE_INNER_L3_IPV6;
+                       ptypes[num++] = RTE_PTYPE_INNER_L3_IPV6_EXT;
+                       ptypes[num++] = RTE_PTYPE_INNER_L4_MASK;
+               }
+       }
+}
+
 static uint32_t
 nfp_net_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_idx)
 {
@@ -2294,6 +2311,7 @@ static struct eth_dev_ops nfp_net_eth_dev_ops = {
        .stats_get              = nfp_net_stats_get,
        .stats_reset            = nfp_net_stats_reset,
        .dev_infos_get          = nfp_net_infos_get,
+       .dev_ptype_info_get     = nfp_net_ptype_info_get,
        .mtu_set                = nfp_net_dev_mtu_set,
        .vlan_offload_set       = nfp_net_vlan_offload_set,
        .reta_update            = nfp_net_reta_update,
-- 
2.1.4

Reply via email to