net/idpf: add supported ptypes get

Message ID 20221118035039.106084-1-beilei.xing@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/idpf: add supported ptypes get |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Xing, Beilei Nov. 18, 2022, 3:50 a.m. UTC
  From: Beilei Xing <beilei.xing@intel.com>

Failed to launch l3fwd, the log shows:
port 0 cannot parse packet type, please add --parse-ptype
This patch adds dev_supported_ptypes_get ops.

Fixes: 549343c25db8 ("net/idpf: support device initialization")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/idpf/idpf_ethdev.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
  

Comments

Jingjing Wu Nov. 18, 2022, 6:42 a.m. UTC | #1
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Friday, November 18, 2022 11:51 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Peng, Yuan <yuan.peng@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Subject: [PATCH] net/idpf: add supported ptypes get
> 
> From: Beilei Xing <beilei.xing@intel.com>
> 
> Failed to launch l3fwd, the log shows:
> port 0 cannot parse packet type, please add --parse-ptype
> This patch adds dev_supported_ptypes_get ops.
> 
> Fixes: 549343c25db8 ("net/idpf: support device initialization")
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
  
Qi Zhang Nov. 18, 2022, 9:47 a.m. UTC | #2
> -----Original Message-----
> From: Wu, Jingjing <jingjing.wu@intel.com>
> Sent: Friday, November 18, 2022 2:43 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Peng, Yuan <yuan.peng@intel.com>
> Subject: RE: [PATCH] net/idpf: add supported ptypes get
> 
> 
> 
> > -----Original Message-----
> > From: Xing, Beilei <beilei.xing@intel.com>
> > Sent: Friday, November 18, 2022 11:51 AM
> > To: Wu, Jingjing <jingjing.wu@intel.com>
> > Cc: dev@dpdk.org; Peng, Yuan <yuan.peng@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>
> > Subject: [PATCH] net/idpf: add supported ptypes get
> >
> > From: Beilei Xing <beilei.xing@intel.com>
> >
> > Failed to launch l3fwd, the log shows:
> > port 0 cannot parse packet type, please add --parse-ptype This patch
> > adds dev_supported_ptypes_get ops.
> >
> > Fixes: 549343c25db8 ("net/idpf: support device initialization")
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  
Peng, Yuan Nov. 18, 2022, 9:59 a.m. UTC | #3
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Friday, November 18, 2022 11:51 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Peng, Yuan <yuan.peng@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Subject: [PATCH] net/idpf: add supported ptypes get
> 
> From: Beilei Xing <beilei.xing@intel.com>
> 
> Failed to launch l3fwd, the log shows:
> port 0 cannot parse packet type, please add --parse-ptype This patch adds
> dev_supported_ptypes_get ops.
> 
> Fixes: 549343c25db8 ("net/idpf: support device initialization")
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Tested-by: Peng, Yuan <yuan.peng@intel.com>
  

Patch

diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 51fc97bf7b..1ea0ed69d8 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -115,6 +115,24 @@  idpf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused)
 	return 0;
 }
 
+static 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_UDP,
+		RTE_PTYPE_L4_TCP,
+		RTE_PTYPE_L4_SCTP,
+		RTE_PTYPE_L4_ICMP,
+		RTE_PTYPE_UNKNOWN
+	};
+
+	return ptypes;
+}
+
 static int
 idpf_init_vport_req_info(struct rte_eth_dev *dev)
 {
@@ -1040,6 +1058,7 @@  static const struct eth_dev_ops idpf_eth_dev_ops = {
 	.rx_queue_release		= idpf_dev_rx_queue_release,
 	.tx_queue_release		= idpf_dev_tx_queue_release,
 	.mtu_set			= idpf_dev_mtu_set,
+	.dev_supported_ptypes_get	= idpf_dev_supported_ptypes_get,
 };
 
 static uint16_t