On 10/24/22 16:12, Junfeng Guo wrote:
Add dev ops dev_supported_ptypes_get.
Signed-off-by: Wenjun Wu <wenjun1...@intel.com>
Signed-off-by: Junfeng Guo <junfeng....@intel.com>
Again, the patch should go after datapath implementation to
make it reviewable.
[snip]
diff --git a/doc/guides/nics/features/idpf.ini
b/doc/guides/nics/features/idpf.ini
index 30e1c0831e..a03068df85 100644
--- a/doc/guides/nics/features/idpf.ini
+++ b/doc/guides/nics/features/idpf.ini
@@ -8,4 +8,5 @@
;
[Features]
Queue start/stop = Y
+Packet type parsing = Y
It is false without datapath implementation.
Linux = Y
[snip]
diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index 298eaf0a1a..c3c4acb69f 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -8,6 +8,25 @@
#include "idpf_ethdev.h"
#include "idpf_rxtx.h"
+const uint32_t *
+idpf_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
+{
+ static const uint32_t ptypes[] = {
+ RTE_PTYPE_L2_ETHER,
+ RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
+ RTE_PTYPE_L3_IPV6_EXT_UNKNOWN,
+ RTE_PTYPE_L4_FRAG,
+ RTE_PTYPE_L4_NONFRAG,
+ RTE_PTYPE_L4_UDP,
+ RTE_PTYPE_L4_TCP,
+ RTE_PTYPE_L4_SCTP,
+ RTE_PTYPE_L4_ICMP,
+ RTE_PTYPE_UNKNOWN
+ };
It looks like above array must not be static. It should be
dynamically built based on idpf_get_pkt_type().
+
+ return ptypes;
+}
+
static inline int
check_rx_thresh(uint16_t nb_desc, uint16_t thresh)
{
[snip]