> -----Original Message-----
> From: Liu, KevinX <kevinx....@intel.com>
> Sent: Thursday, April 28, 2022 2:13 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.y...@intel.com>; Zhang, Qi Z
> <qi.z.zh...@intel.com>; Yang, SteveX <stevex.y...@intel.com>; Wang, Jie1X
> <jie1x.w...@intel.com>; Liu, KevinX <kevinx....@intel.com>
> Subject: [PATCH v6 05/12] net/ice: add ops dev-supported-ptypes-get to dcf
>
> From: Jie Wang <jie1x.w...@intel.com>
>
> add API "dev_supported_ptypes_get" to dcf, that dcf pmd can get ptypes
> through the new API.
>
> Signed-off-by: Jie Wang <jie1x.w...@intel.com>
> Signed-off-by: Kevin Liu <kevinx....@intel.com>
> ---
> doc/guides/rel_notes/release_22_07.rst | 1 +
> drivers/net/ice/ice_dcf_ethdev.c | 80 ++++++++++++++++----------
> 2 files changed, 50 insertions(+), 31 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_22_07.rst
> b/doc/guides/rel_notes/release_22_07.rst
> index dc37de85f3..a39196c605 100644
> --- a/doc/guides/rel_notes/release_22_07.rst
> +++ b/doc/guides/rel_notes/release_22_07.rst
> @@ -66,6 +66,7 @@ New Features
> * Added enable RSS HASH ops for DCF hardware.
> * Added cleanup Tx buffers.
> * Added add ops MTU-SET to dcf.
> + * Added add ops dev-supported-ptypes-get to dcf.
Misc feature is not necessary for release notes update, please remove this.
>
> Removed Items
> -------------
> diff --git a/drivers/net/ice/ice_dcf_ethdev.c
> b/drivers/net/ice/ice_dcf_ethdev.c
> index 06d752fd61..6a577a6582 100644
> --- a/drivers/net/ice/ice_dcf_ethdev.c
> +++ b/drivers/net/ice/ice_dcf_ethdev.c
> @@ -1218,38 +1218,56 @@ ice_dcf_dev_reset(struct rte_eth_dev *dev)
> return ret;
> }
>
> +static const uint32_t *
> +ice_dcf_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_L4_FRAG,
> + RTE_PTYPE_L4_ICMP,
> + RTE_PTYPE_L4_NONFRAG,
> + RTE_PTYPE_L4_SCTP,
> + RTE_PTYPE_L4_TCP,
> + RTE_PTYPE_L4_UDP,
> + RTE_PTYPE_UNKNOWN
> + };
> + return ptypes;
> +}
> +
> static const struct eth_dev_ops ice_dcf_eth_dev_ops = {
> - .dev_start = ice_dcf_dev_start,
> - .dev_stop = ice_dcf_dev_stop,
> - .dev_close = ice_dcf_dev_close,
> - .dev_reset = ice_dcf_dev_reset,
> - .dev_configure = ice_dcf_dev_configure,
> - .dev_infos_get = ice_dcf_dev_info_get,
> - .rx_queue_setup = ice_rx_queue_setup,
> - .tx_queue_setup = ice_tx_queue_setup,
> - .rx_queue_release = ice_dev_rx_queue_release,
> - .tx_queue_release = ice_dev_tx_queue_release,
> - .rx_queue_start = ice_dcf_rx_queue_start,
> - .tx_queue_start = ice_dcf_tx_queue_start,
> - .rx_queue_stop = ice_dcf_rx_queue_stop,
> - .tx_queue_stop = ice_dcf_tx_queue_stop,
> - .link_update = ice_dcf_link_update,
> - .stats_get = ice_dcf_stats_get,
> - .stats_reset = ice_dcf_stats_reset,
> - .promiscuous_enable = ice_dcf_dev_promiscuous_enable,
> - .promiscuous_disable = ice_dcf_dev_promiscuous_disable,
> - .allmulticast_enable = ice_dcf_dev_allmulticast_enable,
> - .allmulticast_disable = ice_dcf_dev_allmulticast_disable,
> - .flow_ops_get = ice_dcf_dev_flow_ops_get,
> - .udp_tunnel_port_add = ice_dcf_dev_udp_tunnel_port_add,
> - .udp_tunnel_port_del = ice_dcf_dev_udp_tunnel_port_del,
> - .tm_ops_get = ice_dcf_tm_ops_get,
> - .reta_update = ice_dcf_dev_rss_reta_update,
> - .reta_query = ice_dcf_dev_rss_reta_query,
> - .rss_hash_update = ice_dcf_dev_rss_hash_update,
> - .rss_hash_conf_get = ice_dcf_dev_rss_hash_conf_get,
> - .tx_done_cleanup = ice_tx_done_cleanup,
> - .mtu_set = ice_dcf_dev_mtu_set,
> + .dev_start = ice_dcf_dev_start,
> + .dev_stop = ice_dcf_dev_stop,
> + .dev_close = ice_dcf_dev_close,
> + .dev_reset = ice_dcf_dev_reset,
> + .dev_configure = ice_dcf_dev_configure,
> + .dev_infos_get = ice_dcf_dev_info_get,
> + .dev_supported_ptypes_get = ice_dcf_dev_supported_ptypes_get,
> + .rx_queue_setup = ice_rx_queue_setup,
> + .tx_queue_setup = ice_tx_queue_setup,
> + .rx_queue_release = ice_dev_rx_queue_release,
> + .tx_queue_release = ice_dev_tx_queue_release,
> + .rx_queue_start = ice_dcf_rx_queue_start,
> + .tx_queue_start = ice_dcf_tx_queue_start,
> + .rx_queue_stop = ice_dcf_rx_queue_stop,
> + .tx_queue_stop = ice_dcf_tx_queue_stop,
> + .link_update = ice_dcf_link_update,
> + .stats_get = ice_dcf_stats_get,
> + .stats_reset = ice_dcf_stats_reset,
> + .promiscuous_enable = ice_dcf_dev_promiscuous_enable,
> + .promiscuous_disable = ice_dcf_dev_promiscuous_disable,
> + .allmulticast_enable = ice_dcf_dev_allmulticast_enable,
> + .allmulticast_disable = ice_dcf_dev_allmulticast_disable,
> + .flow_ops_get = ice_dcf_dev_flow_ops_get,
> + .udp_tunnel_port_add = ice_dcf_dev_udp_tunnel_port_add,
> + .udp_tunnel_port_del = ice_dcf_dev_udp_tunnel_port_del,
> + .tm_ops_get = ice_dcf_tm_ops_get,
> + .reta_update = ice_dcf_dev_rss_reta_update,
> + .reta_query = ice_dcf_dev_rss_reta_query,
> + .rss_hash_update = ice_dcf_dev_rss_hash_update,
> + .rss_hash_conf_get = ice_dcf_dev_rss_hash_conf_get,
> + .tx_done_cleanup = ice_tx_done_cleanup,
> + .mtu_set = ice_dcf_dev_mtu_set,
> };
>
> static int
> --
> 2.33.1