support full function of DCF
cover support full function of DCF
These functions have been customized and implemented on DPDK-20.11, Now it's time to migrate the function to DPDK-22.07.
Alvin Zhang (18):
net/ice: support dcf promisc configuration net/ice: support dcf VLAN filter and offload configuration net/ice: support DCF new VLAN capabilities common/iavf: support flushing rules and reporting DCF id net/ice/base: fix ethertype filter input set net/iavf: support checking if device is an MDCF instance net/ice/base: support custom DDP buildin recipe net/ice: support buildin recipe configuration net/ice/base: support IPv6 GRE UDP pattern net/ice: support IPv6 NVGRE tunnel
net/ice: support new pattern of IPv4 net/ice/base: support new patterns of TCP and UDP net/ice: support new patterns of TCP and UDP net/ice/base: support IPv4 GRE tunnel
net/ice: support IPv4 GRE raw pattern type net/ice/base: support custom ddp package version net/ice: treat unknown package as OS default package net/ice: fix DCF ACL flow engine
Dapeng Yu (1):
net/ice: enable CVL DCF device reset API
Jie Wang (2):
net/ice: add ops MTU-SET to dcf
net/ice: add ops dev-supported-ptypes-get to dcf
Junfeng Guo (4):
net/ice/base: add VXLAN support for switch filter net/ice: add VXLAN support for switch filter net/ice/base: update Profile ID table for VXLAN net/ice/base: update Protocol ID table to match DVM DDP
Kevin Liu (5):
net/ice: support dcf MAC configuration net/ice: support MDCF(multi-DCF) instance net/ice: disable ACL function for MDCF instance net/ice: add enable/disable queues for DCF large VF net/ice: fix DCF reset
Qi Zhang (1):
testpmd: force flow flush
Robin Zhang (1):
net/ice: cleanup Tx buffers
Steve Yang (7):
net/ice: enable RSS RETA ops for DCF hardware net/ice: enable RSS HASH ops for DCF hardware net/ice: handle virtchnl event message without interrupt net/ice: add DCF request queues function
net/ice: negotiate large VF and request more queues net/ice: enable multiple queues configurations for large VF net/ice: enable IRQ mapping configuration for large VF
app/test-pmd/config.c | 6 +- drivers/common/iavf/virtchnl.h | 13 + drivers/net/iavf/iavf_ethdev.c | 2 +- drivers/net/ice/base/ice_common.c | 29 +- drivers/net/ice/base/ice_fdir.c | 3 + drivers/net/ice/base/ice_flex_pipe.c | 41 +- drivers/net/ice/base/ice_flex_pipe.h | 3 +- drivers/net/ice/base/ice_protocol_type.h | 22 + drivers/net/ice/base/ice_switch.c | 626 ++++++++++++- drivers/net/ice/base/ice_switch.h | 12 + drivers/net/ice/base/ice_type.h | 2 + drivers/net/ice/ice_acl_filter.c | 31 +- drivers/net/ice/ice_dcf.c | 398 ++++++++- drivers/net/ice/ice_dcf.h | 34 +- drivers/net/ice/ice_dcf_ethdev.c | 1038 ++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 14 + drivers/net/ice/ice_dcf_parent.c | 11 + drivers/net/ice/ice_ethdev.c | 13 +- drivers/net/ice/ice_generic_flow.c | 91 +- drivers/net/ice/ice_generic_flow.h | 13 + drivers/net/ice/ice_switch_filter.c | 168 +++- 21 files changed, 2385 insertions(+), 185 deletions(-)
Signature · 1 line
2.33.1
PATCH 1/39 net/ice: enable RSS RETA ops for DCF hardware
From: Steve Yang <[email protected]>
RSS RETA should be updated and queried by application, Add related ops ('.reta_update', '.reta_query') for DCF.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -790,7 +790,7 @@ ice_dcf_configure_rss_key(struct ice_dcf_hw *hw)return err; } -static int +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw) {struct virtchnl_rss_lut *rss_lut;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +77 -0
89 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH 2/39 net/ice: enable RSS HASH ops for DCF hardware
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
RSS HASH should be updated and queried by application, Add related ops ('.rss_hash_update', '.rss_hash_conf_get') for DCF.
Because DCF doesn't support configure RSS HASH, only HASH key can be updated within ops '.rss_hash_update'.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 51 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -758,7 +758,7 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw) hw->ets_config =NULL ; } -static int +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw) {struct virtchnl_rss_key *rss_key;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +51 -0
63 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH 3/39 net/ice: cleanup Tx buffers
In reply to Kevin LiuFrom: Robin Zhang <[email protected]>
Add support for ops rte_eth_tx_done_cleanup in dcf
--- drivers/net/ice/ice_dcf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/ice_dcf_ethdev.c +1 -0
@@ -1235,6 +1235,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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, }; static int
Signature · 1 line
2.33.1
PATCH 4/39 net/ice: add ops MTU-SET to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "mtu_set" to dcf, and it can configure the port mtu through cmdline.
--- drivers/net/ice/ice_dcf_ethdev.c | 14 ++++++++++++++ drivers/net/ice/ice_dcf_ethdev.h | 6 ++++++ 2 files changed, 20 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +14 -0
@@ -1081,6 +1081,19 @@ ice_dcf_link_update(struct rte_eth_dev *dev,return rte_eth_linkstatus_set (dev, &new_link); } +static int +ice_dcf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) +{ +/* mtu setting is forbidden if port is start */ +if (dev->data->dev_started !=0 ) { +PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , + dev->data->port_id); +return -EBUSY ; + } + +return 0 ; +} +bool ice_dcf_adminq_need_retry (struct ice_adapter *ad) {
@@ -1236,6 +1249,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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
drivers/net/ice/ice_dcf_ethdev.h +6 -0
@@ -15,6 +15,12 @@#define ICE_DCF_MAX_RINGS 1 +#define ICE_DCF_FRAME_SIZE_MAX 9728 +#define ICE_DCF_VLAN_TAG_SIZE 4 +#define ICE_DCF_ETH_OVERHEAD \ + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2) +#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +struct ice_dcf_queue {uint64_t dummy; };
Signature · 1 line
2.33.1
PATCH 5/39 net/ice: add ops dev-supported-ptypes-get to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "dev_supported_ptypes_get" to dcf, that dcf pmd can get ptypes through the new API.
--- drivers/net/ice/ice_dcf_ethdev.c | 80 +++++++++++++++++++------------- 1 file changed, 49 insertions(+), 31 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +49 -31
@@ -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
Signature · 1 line
2.33.1
PATCH 6/39 net/ice: support dcf promisc configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Support configuration of unicast and multicast promisc on dcf.
--- drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 3 ++ 2 files changed, 76 insertions(+), 4 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +73 -4
@@ -727,27 +727,95 @@ ice_dcf_dev_info_get(struct rte_eth_dev *dev, }static int -ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +dcf_config_promisc (struct ice_dcf_adapter *adapter, +bool enable_unicast, +bool enable_multicast) { +struct ice_dcf_hw *hw = &adapter->real_hw; +struct virtchnl_promisc_info promisc; +struct dcf_virtchnl_cmd args; +int err; + + promisc.flags =0 ; + promisc.vsi_id = hw->vsi_res->vsi_id; + +if (enable_unicast) + promisc.flags |=FLAG_VF_UNICAST_PROMISC ; + +if (enable_multicast) + promisc.flags |=FLAG_VF_MULTICAST_PROMISC ; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE ; + args.req_msg = (uint8_t *)&promisc; + args.req_msglen =sizeof (promisc); + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"fail to execute command VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE" ); +return err; + } + + adapter->promisc_unicast_enabled = enable_unicast; + adapter->promisc_multicast_enabled = enable_multicast;return 0 ; } +static int +ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, true, + adapter->promisc_multicast_enabled); +} +static int ice_dcf_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, false, + adapter->promisc_multicast_enabled); }static int ice_dcf_dev_allmulticast_enable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + true); }static int ice_dcf_dev_allmulticast_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + false); } static int
@@ -1299,6 +1367,7 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev)return -1 ; } +dcf_config_promisc (adapter, false, false);return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +3 -0
@@ -33,6 +33,9 @@ struct ice_dcf_adapter {struct ice_adapter parent;/* Must be first */ struct ice_dcf_hw real_hw; +bool promisc_unicast_enabled; +bool promisc_multicast_enabled; +int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH 7/39 net/ice: support dcf MAC configuration
In reply to Kevin LiuBelow PMD ops are supported in this patch:
.mac_addr_add = dcf_dev_add_mac_addr
.mac_addr_remove = dcf_dev_del_mac_addr
.set_mc_addr_list = dcf_set_mc_addr_list
.mac_addr_set = dcf_dev_set_default_mac_addr--- drivers/net/ice/ice_dcf.c | 9 +- drivers/net/ice/ice_dcf.h | 4 +- drivers/net/ice/ice_dcf_ethdev.c | 218 ++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 5 +- 4 files changed, 226 insertions(+), 10 deletions(-)
drivers/net/ice/ice_dcf.c +5 -4
@@ -1089,10 +1089,11 @@ ice_dcf_query_stats(struct ice_dcf_hw *hw, }int -ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add) +ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr, +bool add,uint8_t type) {struct virtchnl_ether_addr_list *list; -struct rte_ether_addr *addr;struct dcf_virtchnl_cmd args;int len, err =0 ;
@@ -1105,7 +1106,6 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add) } len =sizeof (struct virtchnl_ether_addr_list ); - addr = hw->eth_dev->data->mac_addrs; len +=sizeof (struct virtchnl_ether_addr ); list =rte_zmalloc (NULL , len,0 );
@@ -1116,9 +1116,10 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add)rte_memcpy (list->list[0 ].addr, addr->addr_bytes,sizeof (addr->addr_bytes)); +PMD_DRV_LOG (DEBUG ,"add/rm mac:" RTE_ETHER_ADDR_PRT_FMT ,RTE_ETHER_ADDR_BYTES (addr)); - + list->list[0 ].type = type; list->vsi_id = hw->vsi_res->vsi_id; list->num_elements =1 ;
drivers/net/ice/ice_dcf.h +3 -1
@@ -131,7 +131,9 @@ int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); -int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add); +int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr,bool add, +uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);
drivers/net/ice/ice_dcf_ethdev.c +215 -3
259 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +3 -2
@@ -14,7 +14,7 @@#include "ice_dcf.h" #define ICE_DCF_MAX_RINGS 1 - +#define DCF_NUM_MACADDR_MAX 64#define ICE_DCF_FRAME_SIZE_MAX 9728#define ICE_DCF_VLAN_TAG_SIZE 4#define ICE_DCF_ETH_OVERHEAD \
@@ -35,7 +35,8 @@ struct ice_dcf_adapter {bool promisc_unicast_enabled;bool promisc_multicast_enabled; - +uint32_t mc_addrs_num; +struct rte_ether_addr mc_addrs[DCF_NUM_MACADDR_MAX ];int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH 8/39 net/ice: support dcf VLAN filter and offload configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Below PMD ops are supported in this patch:
.vlan_filter_set = dcf_dev_vlan_filter_set
.vlan_offload_set = dcf_dev_vlan_offload_set
--- drivers/net/ice/ice_dcf_ethdev.c | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +101 -0
@@ -1026,6 +1026,105 @@ dcf_dev_set_default_mac_addr(struct rte_eth_dev *dev,return 0 ; } +static int +dcf_add_del_vlan (struct ice_dcf_hw *hw,uint16_t vlanid,bool add) +{ +struct virtchnl_vlan_filter_list *vlan_list; +uint8_t cmd_buffer[sizeof (struct virtchnl_vlan_filter_list ) + +sizeof (uint16_t )]; +struct dcf_virtchnl_cmd args; +int err; + + vlan_list = (struct virtchnl_vlan_filter_list *)cmd_buffer; + vlan_list->vsi_id = hw->vsi_res->vsi_id; + vlan_list->num_elements =1 ; + vlan_list->vlan_id[0 ] = vlanid; + +memset (&args,0 ,sizeof (args)); + args.v_op = add ?VIRTCHNL_OP_ADD_VLAN :VIRTCHNL_OP_DEL_VLAN ; + args.req_msg = cmd_buffer; + args.req_msglen =sizeof (cmd_buffer); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command %s" , + add ?"OP_ADD_VLAN" :"OP_DEL_VLAN" ); + +return err; +} + +static int +dcf_enable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_ENABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_ENABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_disable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_DISABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_dev_vlan_filter_set (struct rte_eth_dev *dev,uint16_t vlan_id,int on) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + + err =dcf_add_del_vlan (hw, vlan_id, on); +if (err) +return -EIO ; +return 0 ; +} + +static int +dcf_dev_vlan_offload_set (struct rte_eth_dev *dev,int mask) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +struct rte_eth_conf *dev_conf = &dev->data->dev_conf; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + +/* Vlan stripping setting */ +if (mask &RTE_ETH_VLAN_STRIP_MASK ) { +/* Enable or disable VLAN stripping */ +if (dev_conf->rxmode.offloads &RTE_ETH_RX_OFFLOAD_VLAN_STRIP ) + err =dcf_enable_vlan_strip (hw); +else + err =dcf_disable_vlan_strip (hw); + +if (err) +return -EIO ; + } +return 0 ; +} +static int ice_dcf_dev_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops)
@@ -1538,6 +1637,8 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .mac_addr_remove = dcf_dev_del_mac_addr, .set_mc_addr_list = dcf_set_mc_addr_list, .mac_addr_set = dcf_dev_set_default_mac_addr, + .vlan_filter_set = dcf_dev_vlan_filter_set, + .vlan_offload_set = dcf_dev_vlan_offload_set, .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,
Signature · 1 line
2.33.1
PATCH 9/39 net/ice: support DCF new VLAN capabilities
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
The new VLAN virtchnl opcodes introduce new capabilities like VLAN filtering, stripping and insertion.
The DCF needs to query the VLAN capabilities based on current device configuration firstly.
DCF is able to configure inner VLAN filter when port VLAN is enabled base on negotiation; and DCF is able to configure outer VLAN (0x8100) if port VLAN is disabled to be compatible with legacy mode.
When port VLAN is updated by DCF, the DCF needs to reset to query the new VLAN capabilities.
--- drivers/net/ice/ice_dcf.c | 27 +++++ drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 171 ++++++++++++++++++++++++++++--- 3 files changed, 182 insertions(+), 17 deletions(-)
drivers/net/ice/ice_dcf.c +27 -0
@@ -587,6 +587,29 @@ ice_dcf_get_supported_rxdid(struct ice_dcf_hw *hw)return 0 ; } +static int +dcf_get_vlan_offload_caps_v2 (struct ice_dcf_hw *hw) +{ +struct virtchnl_vlan_caps vlan_v2_caps; +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS ; + args.rsp_msgbuf = (uint8_t *)&vlan_v2_caps; + args.rsp_buflen =sizeof (vlan_v2_caps); + + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) { +PMD_DRV_LOG (ERR , +"Failed to execute command of VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS" ); +return ret; + } + +rte_memcpy (&hw->vlan_v2_caps, &vlan_v2_caps,sizeof (vlan_v2_caps)); +return 0 ; +} +int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw) {
@@ -701,6 +724,10 @@ ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)rte_intr_enable (pci_dev->intr_handle);ice_dcf_enable_irq0 (hw); +if ((hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN_V2 ) && +dcf_get_vlan_offload_caps_v2 (hw)) + goto err_rss; +return 0 ; err_rss:
drivers/net/ice/ice_dcf.h +1 -0
@@ -107,6 +107,7 @@ struct ice_dcf_hw {uint16_t nb_msix;uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset; +struct virtchnl_vlan_caps vlan_v2_caps;/* Link status */ bool link_up;
drivers/net/ice/ice_dcf_ethdev.c +154 -17
196 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH 10/39 net/ice: enable CVL DCF device reset API
In reply to Kevin LiuFrom: Dapeng Yu <[email protected]>
Enable CVL DCF device reset API.
--- drivers/net/ice/ice_dcf.c | 24 ++++++++++++++++++++++++ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 25 insertions(+)
drivers/net/ice/ice_dcf.c +24 -0
@@ -1163,3 +1163,27 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,rte_free (list);return err; } + +int +ice_dcf_cap_reset (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw) +{ +int ret; + +struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); +struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + +ice_dcf_disable_irq0 (hw); +rte_intr_disable (intr_handle); +rte_intr_callback_unregister (intr_handle, ice_dcf_dev_interrupt_handler, + hw); + ret =ice_dcf_mode_disable (hw); +if (ret) + goto err; + ret =ice_dcf_get_vf_resource (hw); +err: +rte_intr_callback_register (intr_handle, ice_dcf_dev_interrupt_handler, + hw); +rte_intr_enable (intr_handle); +ice_dcf_enable_irq0 (hw); +return ret; +}
drivers/net/ice/ice_dcf.h +1 -0
@@ -137,6 +137,7 @@ int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete); +int ice_dcf_cap_reset (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);void ice_dcf_tm_conf_uninit (struct rte_eth_dev *dev);int ice_dcf_replay_vf_bw (struct ice_dcf_hw *hw,uint16_t vf_id);
Signature · 1 line
2.33.1
PATCH 11/39 net/ice/base: add VXLAN support for switch filter
In reply to Kevin LiuFrom: Junfeng Guo <[email protected]>
1. Add profile rule for VXLAN on Switch Filter, including pattern_eth_ipv4_udp_vxlan_any pattern_eth_ipv6_udp_vxlan_any pattern_eth_ipv4_udp_vxlan_eth_ipv4 pattern_eth_ipv4_udp_vxlan_eth_ipv6 pattern_eth_ipv6_udp_vxlan_eth_ipv4 pattern_eth_ipv6_udp_vxlan_eth_ipv6
2. Add common rule for VXLAN on Switch Filter, including
+-----------------+-----------------------------------------------------+ | Pattern | Input Set | +-----------------+-----------------------------------------------------+ | ipv4_vxlan_ipv4 | vni, inner dmac, inner dst/src ip, outer dst/src ip | | ipv4_vxlan_ipv6 | vni, inner dmac, inner dst/src ip | | ipv6_vxlan_ipv4 | vni, inner dmac, inner dst/src ip | | ipv6_vxlan_ipv6 | vni, inner dmac, inner dst/src ip | +-----------------+-----------------------------------------------------+
--- drivers/net/ice/base/ice_protocol_type.h | 6 + drivers/net/ice/base/ice_switch.c | 213 ++++++++++++++++++++++- drivers/net/ice/base/ice_switch.h | 12 ++ 3 files changed, 230 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_protocol_type.h +6 -0
@@ -112,6 +112,12 @@ enum ice_sw_tunnel_type {ICE_SW_TUN_IPV6_NAT_T ,ICE_SW_TUN_IPV4_L2TPV3 ,ICE_SW_TUN_IPV6_L2TPV3 , +ICE_SW_TUN_PROFID_IPV4_VXLAN , +ICE_SW_TUN_PROFID_IPV4_VXLAN_IPV4 , +ICE_SW_TUN_PROFID_IPV4_VXLAN_IPV6 , +ICE_SW_TUN_PROFID_IPV6_VXLAN , +ICE_SW_TUN_PROFID_IPV6_VXLAN_IPV4 , +ICE_SW_TUN_PROFID_IPV6_VXLAN_IPV6 ,ICE_SW_TUN_PROFID_IPV6_ESP ,ICE_SW_TUN_PROFID_IPV6_AH , ICE_SW_TUN_PROFID_MAC_IPV6_L2TPV3,
drivers/net/ice/base/ice_switch.c +212 -1
270 lines not on this page · raw message
drivers/net/ice/base/ice_switch.h +12 -0
@@ -20,6 +20,18 @@#define ICE_PROFID_IPV4_UDP 5#define ICE_PROFID_IPV6_TCP 7#define ICE_PROFID_IPV6_UDP 8 +#define ICE_PROFID_IPV4_TUN_M_IPV4_TCP 10 +#define ICE_PROFID_IPV4_TUN_M_IPV4_UDP 11 +#define ICE_PROFID_IPV4_TUN_M_IPV4_OTHER 12 +#define ICE_PROFID_IPV6_TUN_M_IPV4_TCP 16 +#define ICE_PROFID_IPV6_TUN_M_IPV4_UDP 17 +#define ICE_PROFID_IPV6_TUN_M_IPV4_OTHER 18 +#define ICE_PROFID_IPV4_TUN_M_IPV6_TCP 22 +#define ICE_PROFID_IPV4_TUN_M_IPV6_UDP 23 +#define ICE_PROFID_IPV4_TUN_M_IPV6_OTHER 24 +#define ICE_PROFID_IPV6_TUN_M_IPV6_TCP 25 +#define ICE_PROFID_IPV6_TUN_M_IPV6_UDP 26 +#define ICE_PROFID_IPV6_TUN_M_IPV6_OTHER 27#define ICE_PROFID_PPPOE_PAY 34#define ICE_PROFID_PPPOE_IPV4_TCP 35#define ICE_PROFID_PPPOE_IPV4_UDP 36
Signature · 1 line
2.33.1
PATCH 12/39 net/ice: add VXLAN support for switch filter
In reply to Kevin LiuFrom: Junfeng Guo <[email protected]>
1. Add profile rule for VXLAN on Switch Filter, including pattern_eth_ipv4_udp_vxlan_any pattern_eth_ipv6_udp_vxlan_any pattern_eth_ipv4_udp_vxlan_eth_ipv4 pattern_eth_ipv4_udp_vxlan_eth_ipv6 pattern_eth_ipv6_udp_vxlan_eth_ipv4 pattern_eth_ipv6_udp_vxlan_eth_ipv6
2. Add common rule for VXLAN on Switch Filter, including
+-----------------+-----------------------------------------------------+ | Pattern | Input Set | +-----------------+-----------------------------------------------------+ | ipv4_vxlan_ipv4 | vni, inner dmac, inner dst/src ip, outer dst/src ip | | ipv4_vxlan_ipv6 | vni, inner dmac, inner dst/src ip | | ipv6_vxlan_ipv4 | vni, inner dmac, inner dst/src ip | | ipv6_vxlan_ipv6 | vni, inner dmac, inner dst/src ip | +-----------------+-----------------------------------------------------+
--- drivers/net/ice/ice_generic_flow.c | 20 ++++++++++ drivers/net/ice/ice_generic_flow.h | 4 ++ drivers/net/ice/ice_switch_filter.c | 59 +++++++++++++++++++++++++++-- 3 files changed, 80 insertions(+), 3 deletions(-)
drivers/net/ice/ice_generic_flow.c +20 -0
@@ -375,6 +375,26 @@ enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_icmp[] = { RTE_FLOW_ITEM_TYPE_END, }; +/* IPv4 VXLAN ANY */ +enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_any[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_UDP , +RTE_FLOW_ITEM_TYPE_VXLAN , +RTE_FLOW_ITEM_TYPE_ANY , +RTE_FLOW_ITEM_TYPE_END , +}; + +/* IPv6 VXLAN ANY */ +enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_any[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV6 , +RTE_FLOW_ITEM_TYPE_UDP , +RTE_FLOW_ITEM_TYPE_VXLAN , +RTE_FLOW_ITEM_TYPE_ANY , +RTE_FLOW_ITEM_TYPE_END , +}; +/* IPv4 VXLAN MAC IPv4 */ enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4[] = {RTE_FLOW_ITEM_TYPE_ETH ,
drivers/net/ice/ice_generic_flow.h +4 -0
@@ -175,6 +175,10 @@ extern enum rte_flow_item_type pattern_eth_ipv6_icmp6[];extern enum rte_flow_item_type pattern_eth_vlan_ipv6_icmp6[];extern enum rte_flow_item_type pattern_eth_qinq_ipv6_icmp6[]; +/* IPv4/IPv6 VXLAN ANY */ +extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_any[]; +extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_any[]; +/* IPv4 VXLAN IPv4 */ extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4[];extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_udp[];
drivers/net/ice/ice_switch_filter.c +56 -3
125 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH 13/39 common/iavf: support flushing rules and reporting DCF id
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add virtual channel opcode for DCF flushing rules. Add virtual channel event for PF reporting DCF id.
--- drivers/common/iavf/virtchnl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/common/iavf/virtchnl.h +13 -0
@@ -164,6 +164,12 @@ enum virtchnl_ops {VIRTCHNL_OP_ENABLE_QUEUES_V2 =107 ,VIRTCHNL_OP_DISABLE_QUEUES_V2 =108 ,VIRTCHNL_OP_MAP_QUEUE_VECTOR =111 , + +/** +* To reduce the risk for future combability issue, +* set VIRTCHNL_OP_DCF_RULE_FLUSH carefully by using a special value. +*/ +VIRTCHNL_OP_DCF_RULE_FLUSH =6000 , VIRTCHNL_OP_MAX, };
@@ -1424,6 +1430,12 @@ enum virtchnl_event_codes {VIRTCHNL_EVENT_RESET_IMPENDING ,VIRTCHNL_EVENT_PF_DRIVER_CLOSE ,VIRTCHNL_EVENT_DCF_VSI_MAP_UPDATE , + +/** +* To reduce the risk for future combability issue, +* set VIRTCHNL_EVENT_DCF_VSI_INFO carefully by using a special value. +*/ + VIRTCHNL_EVENT_DCF_VSI_INFO = 1000, };#define PF_EVENT_SEVERITY_INFO 0
@@ -2200,6 +2212,7 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,*/ valid_len = msglen;break ; +case VIRTCHNL_OP_DCF_RULE_FLUSH :case VIRTCHNL_OP_DCF_DISABLE :case VIRTCHNL_OP_DCF_GET_VSI_MAP :case VIRTCHNL_OP_DCF_GET_PKG_INFO :
Signature · 1 line
2.33.1
PATCH 14/39 net/ice/base: fix ethertype filter input set
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add destination and source MAC as the input sets to ethertype filter.
For example:
flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 type is 0x802 / end actions queue index 2 / end
This flow will result in all the matched ingress packets be forwarded to queue 2.
--- drivers/net/ice/base/ice_fdir.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ice/base/ice_fdir.c +3 -0
@@ -3935,6 +3935,9 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->ip.v6.dst_port);break ;case ICE_FLTR_PTYPE_NON_IP_L2 : +ice_pkt_insert_mac_addr (loc, input->ext_data.dst_mac); +ice_pkt_insert_mac_addr (loc +ETH_ALEN , + input->ext_data.src_mac);ice_pkt_insert_u16 (loc,ICE_MAC_ETHTYPE_OFFSET , input->ext_data.ether_type);break ;
Signature · 1 line
2.33.1
PATCH 15/39 net/iavf: support checking if device is an MDCF instance
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
For an MDCF instance (with 'mdcf' in the parameter list), it should not be bound to iavf PMD.
--- drivers/net/iavf/iavf_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/iavf_ethdev.c +1 -1
@@ -2678,7 +2678,7 @@ static int iavf_dcf_cap_check_handler(__rte_unused const char *key, const char *value, __rte_unused void *opaque) { - if (strcmp(value, "dcf")) + if (strcmp(value, "dcf") && strcmp(value, "mdcf")) return -1; return 0;
Signature · 1 line
2.33.1
PATCH 16/39 net/ice: support MDCF(multi-DCF) instance
In reply to Kevin LiuAdd MDCF flushing flow rule ops.
Support parsing commandline device capability 'mdcf'. Support PF reporting current DCF id and disabling the DCF capability of an MDCF instance.
--- drivers/net/ice/ice_dcf.c | 23 ++++++- drivers/net/ice/ice_dcf.h | 3 + drivers/net/ice/ice_dcf_ethdev.c | 99 ++++++++++++++++------------- drivers/net/ice/ice_dcf_parent.c | 8 +++ drivers/net/ice/ice_generic_flow.c | 10 +++ drivers/net/ice/ice_switch_filter.c | 5 +- 6 files changed, 100 insertions(+), 48 deletions(-)
drivers/net/ice/ice_dcf.c +20 -3
@@ -681,7 +681,8 @@ ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)if (ice_dcf_get_vf_vsi_map (hw) <0 ) {PMD_INIT_LOG (ERR ,"Failed to get VF VSI map" ); -ice_dcf_mode_disable (hw); +if (!hw->multi_inst) +ice_dcf_mode_disable (hw); goto err_alloc; }
@@ -759,8 +760,8 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)rte_intr_disable (intr_handle);rte_intr_callback_unregister (intr_handle, ice_dcf_dev_interrupt_handler, hw); - -ice_dcf_mode_disable (hw); +if (!hw->multi_inst) +ice_dcf_mode_disable (hw);iavf_shutdown_adminq (&hw->avf);rte_free (hw->arq_buf);
@@ -1187,3 +1188,19 @@ ice_dcf_cap_reset(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)ice_dcf_enable_irq0 (hw);return ret; } + +int +ice_dcf_flush_rules (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int err =0 ; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_DCF_RULE_FLUSH ; + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (WARNING ,"fail to execute command OF_DCF_RULE_FLUSH, DCF role must be preempted." ); + +return 0 ; +}
drivers/net/ice/ice_dcf.h +3 -0
@@ -98,6 +98,8 @@ struct ice_dcf_hw {uint16_t vsi_id;struct rte_eth_dev *eth_dev; +bool multi_inst; +bool dcf_replaced;uint8_t *rss_lut;uint8_t *rss_key;uint64_t supported_rxdid;
@@ -142,5 +144,6 @@ void ice_dcf_tm_conf_init(struct rte_eth_dev *dev);void ice_dcf_tm_conf_uninit (struct rte_eth_dev *dev);int ice_dcf_replay_vf_bw (struct ice_dcf_hw *hw,uint16_t vf_id);int ice_dcf_clear_bw (struct ice_dcf_hw *hw); +int ice_dcf_flush_rules (struct ice_dcf_hw *hw);#endif /* _ICE_DCF_H_ */
drivers/net/ice/ice_dcf_ethdev.c +56 -43
132 lines not on this page · raw message
drivers/net/ice/ice_dcf_parent.c +8 -0
@@ -125,6 +125,9 @@ ice_dcf_vsi_update_service_handler(void *param)pthread_detach (pthread_self ()); +if (hw->multi_inst) +return NULL ; +rte_delay_us (ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL );rte_spinlock_lock (&vsi_update_lock);
@@ -269,6 +272,10 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,start_vsi_reset_thread (dcf_hw, true, pf_msg->event_data.vf_vsi_map.vf_id);break ; +case VIRTCHNL_EVENT_DCF_VSI_INFO : +if (dcf_hw->vsi_id != pf_msg->event_data.vf_vsi_map.vsi_id) + dcf_hw->dcf_replaced = true; +break ;default :PMD_DRV_LOG (ERR ,"Unknown event received %u" , pf_msg->event);break ;
@@ -436,6 +443,7 @@ ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev) parent_hw->aq_send_cmd_fn = ice_dcf_send_aq_cmd; parent_hw->aq_send_cmd_param = &adapter->real_hw; parent_hw->dcf_enabled = true; + hw->dcf_replaced = false; err =ice_dcf_init_parent_hw (parent_hw);if (err) {
drivers/net/ice/ice_generic_flow.c +10 -0
@@ -17,6 +17,7 @@#include "ice_ethdev.h" #include "ice_generic_flow.h" +#include "ice_dcf.h" /** * Non-pipeline mode, fdir and switch both used as distributor,
@@ -2533,10 +2534,16 @@ ice_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) {struct ice_pf *pf =ICE_DEV_PRIVATE_TO_PF (dev->data->dev_private); +struct ice_adapter *ad = +ICE_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); +struct ice_dcf_hw *hw = ad->hw.aq_send_cmd_param;struct rte_flow *p_flow;void *temp;int ret =0 ; +if (ad->hw.dcf_enabled && hw->dcf_replaced) +return ret; + RTE_TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) { ret =ice_flow_destroy (dev, p_flow, error);if (ret) {
@@ -2547,6 +2554,9 @@ ice_flow_flush(struct rte_eth_dev *dev, } } +if (ad->hw.dcf_enabled && hw->multi_inst) +return ice_dcf_flush_rules (ad->hw.aq_send_cmd_param); +return ret; }
drivers/net/ice/ice_switch_filter.c +3 -2
@@ -497,6 +497,7 @@ ice_switch_destroy(struct ice_adapter *ad,struct rte_flow *flow, struct rte_flow_error *error) { + struct ice_dcf_hw *dcf_hw = ad->hw.aq_send_cmd_param;struct ice_hw *hw = &ad->hw;int ret;struct ice_switch_filter_conf *filter_conf_ptr;
@@ -524,7 +525,7 @@ ice_switch_destroy(struct ice_adapter *ad, } ret =ice_rem_adv_rule_by_id (hw, &filter_conf_ptr->sw_query_data); -if (ret) { +if (ret && !(hw->dcf_enabled && dcf_hw->multi_inst)) {if (ice_dcf_adminq_need_retry (ad)) ret = -EAGAIN ;else
@@ -537,7 +538,7 @@ ice_switch_destroy(struct ice_adapter *ad, }ice_switch_filter_rule_free (flow); -return ret; +return 0 ; } static bool
Signature · 1 line
2.33.1
PATCH 17/39 net/ice/base: support custom DDP buildin recipe
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add control flag and data pointer for custom DDP package buildin recipe. Init the data pointer of buildin recipe.
Support dumping buildin recipe lookup info.
--- drivers/net/ice/base/ice_common.c | 25 +++++++++++++++ drivers/net/ice/base/ice_switch.c | 52 ++++++++++++++++++++++++++++++- drivers/net/ice/base/ice_type.h | 2 ++ 3 files changed, 78 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_common.c +25 -0
@@ -732,6 +732,28 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd)return ice_aq_send_cmd (hw, &desc,NULL ,0 , cd); } +static int ice_buildin_recipe_init (struct ice_hw *hw) +{ +struct ice_switch_info *sw = hw->switch_info; +struct ice_sw_recipe *recipe; + + sw->buildin_recipes =ice_malloc (hw, +sizeof (sw->buildin_recipes[0 ]) *ICE_MAX_NUM_RECIPES ); + +if (!sw->buildin_recipes) +return ICE_ERR_NO_MEMORY ; + + recipe = &sw->buildin_recipes[10 ]; + recipe->is_root =1 ; + + recipe->lkup_exts.n_val_words =1 ; + recipe->lkup_exts.field_mask[0 ] =0x00ff ; + recipe->lkup_exts.fv_words[0 ].off =8 ; + recipe->lkup_exts.fv_words[0 ].prot_id =32 ; + +return ICE_SUCCESS ; +} +/** * ice_init_fltr_mgmt_struct - initializes filter management list and locks * @hw: pointer to the HW struct
@@ -752,6 +774,8 @@ enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)INIT_LIST_HEAD (&sw->vsi_list_map_head); sw->prof_res_bm_init =0 ; +ice_buildin_recipe_init (hw); + status =ice_init_def_sw_recp (hw, &hw->switch_info->recp_list);if (status) {ice_free (hw, hw->switch_info);
@@ -822,6 +846,7 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw)ice_free (hw, recps[i].root_buf); }ice_rm_sw_replay_rule_info (hw, sw); +ice_free (hw, sw->buildin_recipes);ice_free (hw, sw->recp_list);ice_free (hw, sw); }
drivers/net/ice/base/ice_switch.c +51 -1
73 lines not on this page · raw message
drivers/net/ice/base/ice_type.h +2 -0
@@ -1107,6 +1107,7 @@ struct ice_switch_info {u16 max_used_prof_index;ice_declare_bitmap (prof_res_bm[ICE_MAX_NUM_PROFILES ],ICE_MAX_FV_WORDS ); +struct ice_sw_recipe *buildin_recipes; };/* Port hardware description */
@@ -1263,6 +1264,7 @@ struct ice_hw {ice_declare_bitmap (hw_ptype,ICE_FLOW_PTYPE_MAX );u8 dvm_ena;__le16 io_expander_handle; +u8 use_buildin_recipe; };/* Statistics collected by each port, VSI, VEB, and S-channel */
Signature · 1 line
2.33.1
PATCH 18/39 net/ice: support buildin recipe configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Support parsing 'br'(buildin recipe) parameter in device parameter list.
--- drivers/net/ice/ice_dcf_ethdev.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf_ethdev.c +25 -1
@@ -1807,6 +1807,23 @@ ice_dcf_cap_check_handler(__rte_unused const char *key,return -1 ; } +static int +parse_bool (const char *key,const char *value,void *args) +{ +bool *i = (bool *)args; +int num =atoi (value); + +if (num !=0 && num !=1 ) { +PMD_DRV_LOG (WARNING , +"invalid value:\"%s\" for key:\"%s\", must be 0 or 1" , + value, key); +return -1 ; + } + + *i = (bool )num; +return 0 ; +} +static int ice_dcf_cap_selected (struct ice_dcf_adapter *adapter,struct rte_devargs *devargs)
@@ -1814,7 +1831,9 @@ ice_dcf_cap_selected(struct ice_dcf_adapter *adapter,struct ice_adapter *ad = &adapter->parent;struct rte_kvargs *kvlist;const char *key_cap ="cap" ; +const char *key_br ="br" ;int ret =0 ; +bool br =0 ;if (devargs ==NULL )return 0 ;
@@ -1832,6 +1851,11 @@ ice_dcf_cap_selected(struct ice_dcf_adapter *adapter, &adapter->real_hw.multi_inst) < 0) goto exit; +/* dcf capability selected when there's a key-value pair: cap=dcf */ +if (rte_kvargs_process (kvlist, key_br, parse_bool, &br) <0 ) + goto exit; + + ad->hw.use_buildin_recipe = br; ret =1 ; exit:
@@ -2008,4 +2032,4 @@ static struct rte_pci_driver rte_ice_dcf_pmd = {RTE_PMD_REGISTER_PCI (net_ice_dcf, rte_ice_dcf_pmd);RTE_PMD_REGISTER_PCI_TABLE (net_ice_dcf, pci_id_ice_dcf_map);RTE_PMD_REGISTER_KMOD_DEP (net_ice_dcf,"* igb_uio | vfio-pci" ); -RTE_PMD_REGISTER_PARAM_STRING (net_ice_dcf,"cap=dcf|mdcf" ); +RTE_PMD_REGISTER_PARAM_STRING (net_ice_dcf,"cap=dcf|mdcf br=<1|0>" );
Signature · 1 line
2.33.1
PATCH 19/39 net/ice/base: support IPv6 GRE UDP pattern
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add supports(trainer packet and it's offsets, definitions, pattern matching) for IPv6 GRE UDP pattern.
--- drivers/net/ice/base/ice_protocol_type.h | 1 + drivers/net/ice/base/ice_switch.c | 43 +++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_protocol_type.h +1 -0
@@ -44,6 +44,7 @@ enum ice_protocol_type {ICE_GENEVE ,ICE_VXLAN_GPE ,ICE_NVGRE , +ICE_GRE ,ICE_GTP ,ICE_PPPOE , ICE_PFCP,
drivers/net/ice/base/ice_switch.c +42 -1
68 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH 20/39 net/ice: support IPv6 NVGRE tunnel
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add protocol definition and pattern matching for IPv6 NVGRE tunnel.
--- drivers/net/ice/ice_switch_filter.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/ice_switch_filter.c +5 -0
@@ -31,6 +31,7 @@#define ICE_PPP_IPV4_PROTO 0x0021#define ICE_PPP_IPV6_PROTO 0x0057#define ICE_IPV4_PROTO_NVGRE 0x002F +#define ICE_IPV6_PROTO_NVGRE 0x002F#define ICE_SW_PRI_BASE 6#define ICE_SW_INSET_ETHER ( \
@@ -804,6 +805,10 @@ ice_switch_parse_pattern(const struct rte_flow_item pattern[],break ; } } +if ((ipv6_spec->hdr.proto & + ipv6_mask->hdr.proto) == +ICE_IPV6_PROTO_NVGRE ) + *tun_type =ICE_SW_TUN_AND_NON_TUN ;if (ipv6_mask->hdr.proto) *input |=ICE_INSET_IPV6_NEXT_HDR ;if (ipv6_mask->hdr.hop_limits)
Signature · 1 line
2.33.1
PATCH 21/39 net/ice: support new pattern of IPv4
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definition and pattern entry for IPv4 pattern: MAC/VLAN/IPv4
--- drivers/net/ice/ice_switch_filter.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ice/ice_switch_filter.c +3 -0
@@ -38,6 +38,8 @@ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE)#define ICE_SW_INSET_MAC_VLAN ( \ ICE_SW_INSET_ETHER | ICE_INSET_VLAN_INNER) +#define ICE_SW_INSET_MAC_VLAN_IPV4 ( \ + ICE_SW_INSET_MAC_VLAN | ICE_SW_INSET_MAC_IPV4)#define ICE_SW_INSET_MAC_QINQ ( \ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_VLAN_INNER | \ ICE_INSET_VLAN_OUTER)
@@ -231,6 +233,7 @@ ice_pattern_match_item ice_switch_pattern_dist_list[] = { {pattern_eth_ipv4, ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_udp, ICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_tcp, ICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE, ICE_INSET_NONE}, + {pattern_eth_vlan_ipv4, ICE_SW_INSET_MAC_VLAN_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6, ICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_udp, ICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_tcp, ICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE, ICE_INSET_NONE},
Signature · 1 line
2.33.1
PATCH 22/39 net/ice/base: support new patterns of TCP and UDP
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Find training packets for below TCP and UDP patterns:
MAC/VLAN/IPv4/TCP
MAC/VLAN/IPv4/UDP
--- drivers/net/ice/base/ice_switch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/ice/base/ice_switch.c +12 -0
@@ -8616,6 +8616,12 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }if (tun_type ==ICE_SW_IPV4_TCP ) { +if (vlan && tcp) { + *pkt = dummy_vlan_tcp_packet; + *pkt_len =sizeof (dummy_vlan_tcp_packet); + *offsets = dummy_vlan_tcp_packet_offsets; +return ; + } *pkt = dummy_tcp_packet; *pkt_len =sizeof (dummy_tcp_packet); *offsets = dummy_tcp_packet_offsets;
@@ -8623,6 +8629,12 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }if (tun_type ==ICE_SW_IPV4_UDP ) { +if (vlan && udp) { + *pkt = dummy_vlan_udp_packet; + *pkt_len =sizeof (dummy_vlan_udp_packet); + *offsets = dummy_vlan_udp_packet_offsets; +return ; + } *pkt = dummy_udp_packet; *pkt_len =sizeof (dummy_udp_packet); *offsets = dummy_udp_packet_offsets;
Signature · 1 line
2.33.1
PATCH 23/39 net/ice: support new patterns of TCP and UDP
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definitions and pattern entries for below TCP and UDP patterns:
MAC/VLAN/IPv4/TCP
MAC/VLAN/IPv4/UDP
--- drivers/net/ice/ice_switch_filter.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ice/ice_switch_filter.c +6 -0
@@ -62,6 +62,10 @@ ICE_INSET_DMAC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_SRC | \ ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_TOS | \ ICE_INSET_UDP_DST_PORT | ICE_INSET_UDP_SRC_PORT) +#define ICE_SW_INSET_MAC_VLAN_IPV4_TCP ( \ + ICE_SW_INSET_MAC_VLAN | ICE_SW_INSET_MAC_IPV4_TCP) +#define ICE_SW_INSET_MAC_VLAN_IPV4_UDP ( \ + ICE_SW_INSET_MAC_VLAN | ICE_SW_INSET_MAC_IPV4_UDP)#define ICE_SW_INSET_MAC_IPV6 ( \ ICE_INSET_DMAC | ICE_INSET_IPV6_DST | ICE_INSET_IPV6_SRC | \ ICE_INSET_IPV6_TC | ICE_INSET_IPV6_HOP_LIMIT | \
@@ -234,6 +238,8 @@ ice_pattern_match_item ice_switch_pattern_dist_list[] = { {pattern_eth_ipv4_udp, ICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_tcp, ICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_vlan_ipv4, ICE_SW_INSET_MAC_VLAN_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, + {pattern_eth_vlan_ipv4_tcp, ICE_SW_INSET_MAC_VLAN_IPV4_TCP, ICE_INSET_NONE, ICE_INSET_NONE}, + {pattern_eth_vlan_ipv4_udp, ICE_SW_INSET_MAC_VLAN_IPV4_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6, ICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_udp, ICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_tcp, ICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE, ICE_INSET_NONE},
Signature · 1 line
2.33.1
PATCH 24/39 net/ice/base: support IPv4 GRE tunnel
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definitions, trainer packets and routine path for IPv4 GRE tunnel. Ref:
https://www.ietf.org/rfc/rfc1701.html
--- drivers/net/ice/base/ice_flex_pipe.c | 37 ++- drivers/net/ice/base/ice_flex_pipe.h | 3 +- drivers/net/ice/base/ice_protocol_type.h | 15 ++ drivers/net/ice/base/ice_switch.c | 304 ++++++++++++++++++++++- 4 files changed, 332 insertions(+), 27 deletions(-)
drivers/net/ice/base/ice_flex_pipe.c +18 -19
@@ -1851,6 +1851,7 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs,* @ids_cnt: lookup/protocol count * @bm: bitmap of field vectors to consider * @fv_list: Head of a list +* @lkup_exts: lookup elements * * Finds all the field vector entries from switch block that contain * a given protocol ID and returns a list of structures of type
@@ -1861,7 +1862,8 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs,*/ enum ice_status ice_get_sw_fv_list (struct ice_hw *hw,u8 *prot_ids,u16 ids_cnt, -ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list) +ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list, +struct ice_prot_lkup_ext *lkup_exts) {struct ice_sw_fv_list_entry *fvl;struct ice_sw_fv_list_entry *tmp;
@@ -1892,29 +1894,26 @@ ice_get_sw_fv_list(struct ice_hw *hw, u8 *prot_ids, u16 ids_cnt,if (!ice_is_bit_set (bm, (u16 )offset))continue ; -for (i =0 ; i < ids_cnt; i++) { +int found =1 ; +for (i =0 ; i < lkup_exts->n_val_words; i++) {int j; -/* This code assumes that if a switch field vector line -* has a matching protocol, then this line will contain -* the entries necessary to represent every field in -* that protocol header. -*/ for (j =0 ; j < hw->blk[ICE_BLK_SW ].es.fvw; j++) -if (fv->ew[j].prot_id == prot_ids[i]) +if (fv->ew[j].prot_id == + lkup_exts->fv_words[i].prot_id && + fv->ew[j].off == lkup_exts->fv_words[i].off)break ;if (j >= hw->blk[ICE_BLK_SW ].es.fvw) -break ; -if (i +1 == ids_cnt) { - fvl = (struct ice_sw_fv_list_entry *) -ice_malloc (hw,sizeof (*fvl)); -if (!fvl) - goto err; - fvl->fv_ptr = fv; - fvl->profile_id = offset; -LIST_ADD (&fvl->list_entry, fv_list); -break ; - } + found =0 ; + } +if (found) { + fvl = (struct ice_sw_fv_list_entry *) +ice_malloc (hw,sizeof (*fvl)); +if (!fvl) + goto err; + fvl->fv_ptr = fv; + fvl->profile_id = offset; +LIST_ADD (&fvl->list_entry, fv_list); } }while (fv);if (LIST_EMPTY (fv_list))
drivers/net/ice/base/ice_flex_pipe.h +2 -1
@@ -37,7 +37,8 @@ void ice_init_prof_result_bm(struct ice_hw *hw);enum ice_status ice_get_sw_fv_list (struct ice_hw *hw,u8 *prot_ids,u16 ids_cnt, -ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list); +ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list, +struct ice_prot_lkup_ext *lkup_exts);enum ice_status ice_pkg_buf_unreserve_section (struct ice_buf_build *bld,u16 count);u16 ice_pkg_buf_get_free_space (struct ice_buf_build *bld);
drivers/net/ice/base/ice_protocol_type.h +15 -0
@@ -67,6 +67,7 @@ enum ice_sw_tunnel_type {ICE_SW_TUN_VXLAN ,/* VXLAN matches only non-VLAN pkts */ ICE_SW_TUN_VXLAN_VLAN ,/* VXLAN matches both VLAN and non-VLAN pkts */ ICE_SW_TUN_NVGRE , +ICE_SW_TUN_GRE , ICE_SW_TUN_UDP, /* This means all "UDP" tunnel types: VXLAN-GPE, VXLAN* and GENEVE */
@@ -231,6 +232,10 @@ enum ice_prot_id {#define ICE_TUN_FLAG_VLAN_MASK 0x01#define ICE_TUN_FLAG_FV_IND 2 +#define ICE_GRE_FLAG_MDID 22 +#define ICE_GRE_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_GRE_FLAG_MDID) +#define ICE_GRE_FLAG_MASK 0x01C0 +#define ICE_PROTOCOL_MAX_ENTRIES 16/* Mapping of software defined protocol ID to hardware defined protocol ID */
@@ -371,6 +376,15 @@ struct ice_nvgre {__be32 tni_flow; }; +struct ice_gre { +__be16 flags; +__be16 protocol; +__be16 chksum; +__be16 offset; +__be32 key; +__be32 seqnum; +}; +union ice_prot_hdr {struct ice_ether_hdr eth_hdr;struct ice_ethtype_hdr ethertype;
@@ -381,6 +395,7 @@ union ice_prot_hdr {struct ice_sctp_hdr sctp_hdr;struct ice_udp_tnl_hdr tnl_hdr;struct ice_nvgre nvgre_hdr; +struct ice_gre gre_hdr;struct ice_udp_gtp_hdr gtp_hdr;struct ice_pppoe_hdr pppoe_hdr;struct ice_pfcp_hdr pfcp_hdr;
drivers/net/ice/base/ice_switch.c +297 -7
435 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH 25/39 net/ice: support IPv4 GRE raw pattern type
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definitions, matching entries, parsers for below patterns:
ETH/IPV4/GRE/RAW/IPV4
ETH/IPV4/GRE/RAW/IPV4/UDP
ETH/IPV4/GRE/RAW/IPV4/TCP
--- drivers/net/ice/ice_generic_flow.c | 27 +++++++++ drivers/net/ice/ice_generic_flow.h | 9 +++ drivers/net/ice/ice_switch_filter.c | 90 +++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+)
drivers/net/ice/ice_generic_flow.c +27 -0
@@ -1085,6 +1085,33 @@ enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[] = {RTE_FLOW_ITEM_TYPE_ICMP6 , RTE_FLOW_ITEM_TYPE_END, }; +/* IPv4 GRE RAW IPv4 */ +enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_GRE , +RTE_FLOW_ITEM_TYPE_RAW , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_END , +}; +enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4_udp[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_GRE , +RTE_FLOW_ITEM_TYPE_RAW , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_UDP , +RTE_FLOW_ITEM_TYPE_END , +}; +enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4_tcp[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_GRE , +RTE_FLOW_ITEM_TYPE_RAW , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_TCP , +RTE_FLOW_ITEM_TYPE_END , +};/*IPv4 GTPU (EH) */ enum rte_flow_item_type pattern_eth_ipv4_gtpu[] = {
drivers/net/ice/ice_generic_flow.h +9 -0
@@ -27,6 +27,7 @@#define ICE_PROT_L2TPV3OIP BIT_ULL(16)#define ICE_PROT_PFCP BIT_ULL(17)#define ICE_PROT_NAT_T_ESP BIT_ULL(18) +#define ICE_PROT_GRE BIT_ULL(19)/* field */
@@ -54,6 +55,7 @@#define ICE_PFCP_SEID BIT_ULL(42)#define ICE_PFCP_S_FIELD BIT_ULL(41)#define ICE_IP_PK_ID BIT_ULL(40) +#define ICE_RAW_PATTERN BIT_ULL(39)/* input set */
@@ -104,6 +106,8 @@ (ICE_PROT_GTPU | ICE_GTPU_TEID)#define ICE_INSET_GTPU_QFI \ (ICE_PROT_GTPU | ICE_GTPU_QFI) +#define ICE_INSET_RAW \ + (ICE_PROT_GRE | ICE_RAW_PATTERN)#define ICE_INSET_PPPOE_SESSION \ (ICE_PROT_PPPOE_S | ICE_PPPOE_SESSION)#define ICE_INSET_PPPOE_PROTO \
@@ -291,6 +295,11 @@ extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_udp[];extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_sctp[];extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[]; +/* IPv4 GRE RAW IPv4 */ +extern enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4[]; +extern enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4_udp[]; +extern enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4_tcp[]; +/* IPv4 GTPU (EH) */ extern enum rte_flow_item_type pattern_eth_ipv4_gtpu[];extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[];
drivers/net/ice/ice_switch_filter.c +90 -0
120 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH 26/39 net/ice/base: support custom ddp package version
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add checking if the current ddp package is a custom package.
--- drivers/net/ice/base/ice_flex_pipe.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ice/base/ice_flex_pipe.c +4 -0
@@ -1467,6 +1467,10 @@ static void ice_init_pkg_regs(struct ice_hw *hw)*/ static enum ice_status ice_chk_pkg_version (struct ice_pkg_ver *pkg_ver) { +/* 0xFF indicate a custom pkg */ +if (pkg_ver->major ==0xFF ) +return ICE_SUCCESS ; +if (pkg_ver->major !=ICE_PKG_SUPP_VER_MAJ || pkg_ver->minor !=ICE_PKG_SUPP_VER_MNR )return ICE_ERR_NOT_SUPPORTED ;
Signature · 1 line
2.33.1
PATCH 27/39 net/ice: disable ACL function for MDCF instance
In reply to Kevin LiuMDCF instance does not support ACL, so disable it.
--- drivers/net/ice/ice_acl_filter.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/ice/ice_acl_filter.c +9 -2
@@ -25,6 +25,7 @@#include "ice_ethdev.h" #include "ice_generic_flow.h" #include "base/ice_flow.h" +#include "ice_dcf_ethdev.h" #define MAX_ACL_SLOTS_ID 2048
@@ -994,8 +995,11 @@ ice_acl_init(struct ice_adapter *ad)struct ice_pf *pf = &ad->pf;struct ice_hw *hw =ICE_PF_TO_HW (pf);struct ice_flow_parser *parser = &ice_acl_parser; +struct rte_eth_dev *eth_dev = &rte_eth_devices[ad->pf.dev_data->port_id]; +struct ice_dcf_adapter *dcf_adapter = eth_dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &dcf_adapter->real_hw; -if (!ad->hw.dcf_enabled) +if (!ad->hw.dcf_enabled || dcf_hw->multi_inst)return 0 ; ret =ice_acl_prof_alloc (hw);
@@ -1041,8 +1045,11 @@ ice_acl_uninit(struct ice_adapter *ad)struct ice_pf *pf = &ad->pf;struct ice_hw *hw =ICE_PF_TO_HW (pf);struct ice_flow_parser *parser = &ice_acl_parser; +struct rte_eth_dev *eth_dev = &rte_eth_devices[ad->pf.dev_data->port_id]; +struct ice_dcf_adapter *dcf_adapter = eth_dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &dcf_adapter->real_hw; -if (ad->hw.dcf_enabled) { +if (ad->hw.dcf_enabled && !dcf_hw->multi_inst) {ice_unregister_parser (parser, ad);ice_deinit_acl (pf);ice_acl_prof_free (hw);
Signature · 1 line
2.33.1
PATCH 28/39 net/ice: treat unknown package as OS default package
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
In order to use custom package, unknown package should be treated as OS default package.
--- drivers/net/ice/ice_ethdev.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/ice/ice_ethdev.c +8 -5
@@ -1710,13 +1710,16 @@ ice_load_pkg_type(struct ice_hw *hw)/* store the activated package type (OS default or Comms) */ if (!strncmp ((char *)hw->active_pkg_name,ICE_OS_DEFAULT_PKG_NAME , -ICE_PKG_NAME_SIZE )) +ICE_PKG_NAME_SIZE )) { package_type =ICE_PKG_TYPE_OS_DEFAULT ; -else if (!strncmp ((char *)hw->active_pkg_name,ICE_COMMS_PKG_NAME , -ICE_PKG_NAME_SIZE )) + }else if (!strncmp ((char *)hw->active_pkg_name,ICE_COMMS_PKG_NAME , +ICE_PKG_NAME_SIZE )) { package_type =ICE_PKG_TYPE_COMMS ; -else - package_type =ICE_PKG_TYPE_UNKNOWN ; + }else { +PMD_INIT_LOG (WARNING , +"The package type is not identified, treaded as OS default type" ); + package_type =ICE_PKG_TYPE_OS_DEFAULT ; + } PMD_INIT_LOG(NOTICE, "Active package is: %d.%d.%d.%d, %s (%s VLAN mode)", hw->active_pkg_ver.major, hw->active_pkg_ver.minor,
Signature · 1 line
2.33.1
PATCH 29/39 net/ice/base: update Profile ID table for VXLAN
In reply to Kevin LiuFrom: Junfeng Guo <[email protected]>
Update Profile ID table for VXLAN to align with Tencent customed DDP.
--- drivers/net/ice/base/ice_switch.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/ice/base/ice_switch.h +9 -9
@@ -23,15 +23,15 @@#define ICE_PROFID_IPV4_TUN_M_IPV4_TCP 10#define ICE_PROFID_IPV4_TUN_M_IPV4_UDP 11#define ICE_PROFID_IPV4_TUN_M_IPV4_OTHER 12 -#define ICE_PROFID_IPV6_TUN_M_IPV4_TCP 16 -#define ICE_PROFID_IPV6_TUN_M_IPV4_UDP 17 -#define ICE_PROFID_IPV6_TUN_M_IPV4_OTHER 18 -#define ICE_PROFID_IPV4_TUN_M_IPV6_TCP 22 -#define ICE_PROFID_IPV4_TUN_M_IPV6_UDP 23 -#define ICE_PROFID_IPV4_TUN_M_IPV6_OTHER 24 -#define ICE_PROFID_IPV6_TUN_M_IPV6_TCP 25 -#define ICE_PROFID_IPV6_TUN_M_IPV6_UDP 26 -#define ICE_PROFID_IPV6_TUN_M_IPV6_OTHER 27 +#define ICE_PROFID_IPV6_TUN_M_IPV4_TCP 34 +#define ICE_PROFID_IPV6_TUN_M_IPV4_UDP 35 +#define ICE_PROFID_IPV6_TUN_M_IPV4_OTHER 36 +#define ICE_PROFID_IPV4_TUN_M_IPV6_TCP 40 +#define ICE_PROFID_IPV4_TUN_M_IPV6_UDP 41 +#define ICE_PROFID_IPV4_TUN_M_IPV6_OTHER 42 +#define ICE_PROFID_IPV6_TUN_M_IPV6_TCP 43 +#define ICE_PROFID_IPV6_TUN_M_IPV6_UDP 44 +#define ICE_PROFID_IPV6_TUN_M_IPV6_OTHER 45#define ICE_PROFID_PPPOE_PAY 34#define ICE_PROFID_PPPOE_IPV4_TCP 35#define ICE_PROFID_PPPOE_IPV4_UDP 36
Signature · 1 line
2.33.1
PATCH 30/39 net/ice/base: update Protocol ID table to match DVM DDP
In reply to Kevin LiuFrom: Junfeng Guo <[email protected]>
The ice kernel driver and DDP is working in Double VLAN Mode (DVM), but the DVM is not supported on this PMD. Thus update the SW to HW Protocol ID table for VLAN to support common switch filtering with single VLAN layer.
--- drivers/net/ice/base/ice_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_switch.c +1 -1
@@ -7098,7 +7098,7 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { { ICE_MAC_OFOS, ICE_MAC_OFOS_HW }, { ICE_MAC_IL, ICE_MAC_IL_HW }, { ICE_ETYPE_OL, ICE_ETYPE_OL_HW }, - { ICE_VLAN_OFOS, ICE_VLAN_OL_HW }, + { ICE_VLAN_OFOS, ICE_VLAN_OF_HW }, { ICE_IPV4_OFOS, ICE_IPV4_OFOS_HW }, { ICE_IPV4_IL, ICE_IPV4_IL_HW }, { ICE_IPV6_OFOS, ICE_IPV6_OFOS_HW },
Signature · 1 line
2.33.1
PATCH 31/39 net/ice: handle virtchnl event message without interrupt
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Currently, VF can only handle virtchnl event message by calling interrupt. It is not available in two cases:
1. If the event message comes during VF initialization before interrupt is enabled, this message will not be handled correctly.
2. Some virtchnl commands need to receive the event message and handle it with interrupt disabled.
To solve this issue, we add the virtchnl event message handling in the process of reading vitchnl messages in adminq from PF.
--- drivers/net/ice/ice_dcf.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +23 -2
@@ -63,11 +63,32 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, goto again; v_op =rte_le_to_cpu_32 (event.desc.cookie_high); -if (v_op != op) - goto again; + +if (v_op ==VIRTCHNL_OP_EVENT ) { +struct virtchnl_pf_event *vpe = + (struct virtchnl_pf_event *)event.msg_buf; +switch (vpe->event) { +case VIRTCHNL_EVENT_RESET_IMPENDING : + hw->resetting = true; +if (rsp_msglen) + *rsp_msglen =0 ; +return IAVF_SUCCESS ; +default : + goto again; + } + }else { +/* async reply msg on command issued by vf previously */ +if (v_op != op) { +PMD_DRV_LOG (WARNING , +"command mismatch, expect %u, get %u" , + op, v_op); + goto again; + } + }if (rsp_msglen !=NULL ) *rsp_msglen = event.msg_len; +return rte_le_to_cpu_32 (event.desc.cookie_low); again:
Signature · 1 line
2.33.1
PATCH 32/39 net/ice: add DCF request queues function
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Add a new virtchnl function to request additional queues from PF. Current default queue pairs number is 16. In order to support up to 256 queue pairs DCF port, enable this request queues function.
--- drivers/net/ice/ice_dcf.c | 98 +++++++++++++++++++++++++++++++++------ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 86 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +85 -13
@@ -257,7 +257,7 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)VIRTCHNL_VF_CAP_ADV_LINK_SPEED |VIRTCHNL_VF_CAP_DCF |VIRTCHNL_VF_OFFLOAD_VLAN_V2 |VF_BASE_MODE_OFFLOADS |VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | -VIRTCHNL_VF_OFFLOAD_QOS ; +VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES ; err =ice_dcf_send_cmd_req_no_irq (hw,VIRTCHNL_OP_GET_VF_RESOURCES , (uint8_t *)&caps,sizeof (caps));
@@ -468,18 +468,38 @@ ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw, goto ret; } -do { -if (!cmd->pending) -break ; - -rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); - }while (i++ <ICE_DCF_ARQ_MAX_RETRIES ); - -if (cmd->v_ret !=IAVF_SUCCESS ) { - err =-1 ; -PMD_DRV_LOG (ERR , -"No response (%d times) or return failure (%d) for cmd %d" , - i, cmd->v_ret, cmd->v_op); +switch (cmd->v_op) { +case VIRTCHNL_OP_REQUEST_QUEUES : + err =ice_dcf_recv_cmd_rsp_no_irq (hw, +VIRTCHNL_OP_REQUEST_QUEUES , + cmd->rsp_msgbuf, + cmd->rsp_buflen, +NULL ); +if (err !=IAVF_SUCCESS || !hw->resetting) { + err =-1 ; +PMD_DRV_LOG (ERR , +"Failed to get response of " +"VIRTCHNL_OP_REQUEST_QUEUES %d" , + err); + } +break ; +default : +/* For other virtchnl ops in running time, +* wait for the cmd done flag. +*/ +do { +if (!cmd->pending) +break ; +rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); + }while (i++ <ICE_DCF_ARQ_MAX_RETRIES ); + +if (cmd->v_ret !=IAVF_SUCCESS ) { + err =-1 ; +PMD_DRV_LOG (ERR , +"No response (%d times) or " +"return failure (%d) for cmd %d" , + i, cmd->v_ret, cmd->v_op); + } } ret:
@@ -1012,6 +1032,58 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num) +{ +struct virtchnl_vf_res_request vfres; +struct dcf_virtchnl_cmd args; +uint16_t num_queue_pairs; +int err; + +if (!(hw->vf_res->vf_cap_flags & +VIRTCHNL_VF_OFFLOAD_REQ_QUEUES )) { +PMD_DRV_LOG (ERR ,"request queues not supported" ); +return -1 ; + } + +if (num ==0 ) { +PMD_DRV_LOG (ERR ,"queue number cannot be zero" ); +return -1 ; + } + vfres.num_queue_pairs = num; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_REQUEST_QUEUES ; + + args.req_msg = (u8 *)&vfres; + args.req_msglen =sizeof (vfres); + + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + +/* +* disable interrupt to avoid the admin queue message to be read +* before iavf_read_msg_from_pf. +*/ +rte_intr_disable (hw->eth_dev->intr_handle); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +rte_intr_enable (hw->eth_dev->intr_handle); +if (err) { +PMD_DRV_LOG (ERR ,"fail to execute command OP_REQUEST_QUEUES" ); +return err; + } + +/* request additional queues failed, return available number */ + num_queue_pairs = ((struct virtchnl_vf_res_request *) + args.rsp_msgbuf)->num_queue_pairs; +PMD_DRV_LOG (ERR , +"request queues failed, only %u queues available" , + num_queue_pairs); + +return -1 ; +} +int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
drivers/net/ice/ice_dcf.h +1 -0
@@ -129,6 +129,7 @@ int ice_dcf_configure_rss_key(struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw); +int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);
Signature · 1 line
2.33.1
PATCH 33/39 net/ice: negotiate large VF and request more queues
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Negotiate large VF capability with PF during VF initialization. If large VF is supported and the number of queues larger than 16 is required, VF requests additional queues from PF. Mark the state that large VF is supported.
If the allocated queues number is larger than 16, the max RSS queue region cannot be 16 anymore. Add the function to query max RSS queue region from PF, use it in the RSS initialization and future filters configuration.
--- drivers/net/ice/ice_dcf.c | 34 +++++++++++++++- drivers/net/ice/ice_dcf.h | 4 ++ drivers/net/ice/ice_dcf_ethdev.c | 69 +++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 2 + 4 files changed, 106 insertions(+), 3 deletions(-)
drivers/net/ice/ice_dcf.c +33 -1
@@ -257,7 +257,8 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)VIRTCHNL_VF_CAP_ADV_LINK_SPEED |VIRTCHNL_VF_CAP_DCF |VIRTCHNL_VF_OFFLOAD_VLAN_V2 |VF_BASE_MODE_OFFLOADS |VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | -VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES ; +VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES | +VIRTCHNL_VF_LARGE_NUM_QPAIRS ; err =ice_dcf_send_cmd_req_no_irq (hw,VIRTCHNL_OP_GET_VF_RESOURCES , (uint8_t *)&caps,sizeof (caps));
@@ -1084,6 +1085,37 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)return -1 ; } +int +ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +uint16_t qregion_width; +int err; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_GET_MAX_RSS_QREGION ; + args.req_msg =NULL ; + args.req_msglen =0 ; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"Failed to execute command of " +"VIRTCHNL_OP_GET_MAX_RSS_QREGION" ); +return err; + } + + qregion_width = ((struct virtchnl_max_rss_qregion *) + args.rsp_msgbuf)->qregion_width; + hw->max_rss_qregion = (uint16_t )(1 << qregion_width); + +return 0 ; +} + +int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
drivers/net/ice/ice_dcf.h +4 -0
@@ -107,6 +107,7 @@ struct ice_dcf_hw {uint16_t msix_base;uint16_t nb_msix; +uint16_t max_rss_qregion;/* max RSS queue region supported by PF */ uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset;struct virtchnl_vlan_caps vlan_v2_caps;
@@ -116,6 +117,8 @@ struct ice_dcf_hw {uint32_t link_speed;bool resetting; +/* Indicate large VF support enabled or not */ +bool lv_enabled; }; int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,
@@ -130,6 +133,7 @@ int ice_dcf_configure_rss_lut(struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num); +int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +67 -2
99 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +2 -0
@@ -20,6 +20,8 @@#define ICE_DCF_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 +#define ICE_DCF_MAX_NUM_QUEUES_LV 256struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH 34/39 net/ice: enable multiple queues configurations for large VF
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Since the adminq buffer size has a 4K limitation, the current virtchnl command VIRTCHNL_OP_CONFIG_VSI_QUEUES cannot send the message only once to configure up to 256 queues. In this patch, we send the messages multiple times to make sure that the buffer size is less than 4K each time.
--- drivers/net/ice/ice_dcf.c | 11 ++++++----- drivers/net/ice/ice_dcf.h | 3 ++- drivers/net/ice/ice_dcf_ethdev.c | 20 ++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 27 insertions(+), 8 deletions(-)
drivers/net/ice/ice_dcf.c +6 -5
@@ -950,7 +950,8 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw)#define IAVF_RXDID_COMMS_OVS_1 22int -ice_dcf_configure_queues (struct ice_dcf_hw *hw) +ice_dcf_configure_queues (struct ice_dcf_hw *hw, +uint16_t num_queue_pairs,uint16_t index) {struct ice_rx_queue **rxq = (struct ice_rx_queue **)hw->eth_dev->data->rx_queues;
@@ -963,16 +964,16 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)int err; size =sizeof (*vc_config) + -sizeof (vc_config->qpair[0 ]) * hw->num_queue_pairs; +sizeof (vc_config->qpair[0 ]) * num_queue_pairs; vc_config =rte_zmalloc ("cfg_queue" , size,0 );if (!vc_config)return -ENOMEM ; vc_config->vsi_id = hw->vsi_res->vsi_id; - vc_config->num_queue_pairs = hw->num_queue_pairs; + vc_config->num_queue_pairs = num_queue_pairs; -for (i =0 , vc_qp = vc_config->qpair; - i < hw->num_queue_pairs; +for (i = index, vc_qp = vc_config->qpair; + i < index + num_queue_pairs; i++, vc_qp++) { vc_qp->txq.vsi_id = hw->vsi_res->vsi_id; vc_qp->txq.queue_id = i;
drivers/net/ice/ice_dcf.h +2 -1
@@ -131,7 +131,8 @@ void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw);int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw); -int ice_dcf_configure_queues (struct ice_dcf_hw *hw); +int ice_dcf_configure_queues (struct ice_dcf_hw *hw, +uint16_t num_queue_pairs,uint16_t index);int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +18 -2
@@ -514,6 +514,8 @@ ice_dcf_dev_start(struct rte_eth_dev *dev)struct rte_intr_handle *intr_handle = dev->intr_handle;struct ice_adapter *ad = &dcf_ad->parent;struct ice_dcf_hw *hw = &dcf_ad->real_hw; +uint16_t num_queue_pairs; +uint16_t index =0 ;int ret;if (hw->resetting) {
@@ -532,6 +534,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) hw->num_queue_pairs =RTE_MAX (dev->data->nb_rx_queues, dev->data->nb_tx_queues); + num_queue_pairs = hw->num_queue_pairs; ret =ice_dcf_init_rx_queues (dev);if (ret) {
@@ -547,7 +550,20 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) } } - ret =ice_dcf_configure_queues (hw); +/* If needed, send configure queues msg multiple times to make the +* adminq buffer length smaller than the 4K limitation. +*/ +while (num_queue_pairs >ICE_DCF_CFG_Q_NUM_PER_BUF ) { +if (ice_dcf_configure_queues (hw, +ICE_DCF_CFG_Q_NUM_PER_BUF , index) !=0 ) { +PMD_DRV_LOG (ERR ,"configure queues failed" ); + goto err_queue; + } + num_queue_pairs -=ICE_DCF_CFG_Q_NUM_PER_BUF ; + index +=ICE_DCF_CFG_Q_NUM_PER_BUF ; + } + + ret =ice_dcf_configure_queues (hw, num_queue_pairs, index);if (ret) {PMD_DRV_LOG (ERR ,"Fail to config queues" );return ret;
@@ -587,7 +603,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) dev->data->dev_link.link_status =RTE_ETH_LINK_UP ; - +err_queue:return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +1 -0
@@ -22,6 +22,7 @@#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD)#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16#define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH 35/39 net/ice: enable IRQ mapping configuration for large VF
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
The current IRQ mapping configuration only supports max 16 queues and 16 MSIX vectors. Change the queue vector mapping structure to indicate up to 256 queues. A new opcode is used to handle the case with large number of queues. To avoid adminq buffer size limitation, we support to send the virtchnl message multiple times if needed.
--- drivers/net/ice/ice_dcf.c | 50 +++++++++++++++++++++++++++---- drivers/net/ice/ice_dcf.h | 10 ++++++- drivers/net/ice/ice_dcf_ethdev.c | 51 +++++++++++++++++++++++++++----- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 99 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +45 -5
@@ -1116,7 +1116,6 @@ ice_dcf_get_max_rss_queue_region(struct ice_dcf_hw *hw)return 0 ; } -int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
@@ -1133,13 +1132,14 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)return -ENOMEM ; map_info->num_vectors = hw->nb_msix; -for (i =0 ; i < hw->nb_msix; i++) { - vecmap = &map_info->vecmap[i]; +for (i =0 ; i < hw->eth_dev->data->nb_rx_queues; i++) { + vecmap = + &map_info->vecmap[hw->qv_map[i].vector_id - hw->msix_base]; vecmap->vsi_id = hw->vsi_res->vsi_id; vecmap->rxitr_idx =0 ; - vecmap->vector_id = hw->msix_base + i; + vecmap->vector_id = hw->qv_map[i].vector_id; vecmap->txq_map =0 ; - vecmap->rxq_map = hw->rxq_map[hw->msix_base + i]; + vecmap->rxq_map |=1 << hw->qv_map[i].queue_id; }memset (&args,0 ,sizeof (args));
@@ -1155,6 +1155,46 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw, +uint16_t num,uint16_t index) +{ +struct virtchnl_queue_vector_maps *map_info; +struct virtchnl_queue_vector *qv_maps; +struct dcf_virtchnl_cmd args; +int len, i, err; +int count =0 ; + + len =sizeof (struct virtchnl_queue_vector_maps ) + +sizeof (struct virtchnl_queue_vector ) * (num -1 ); + + map_info =rte_zmalloc ("map_info" , len,0 ); +if (!map_info) +return -ENOMEM ; + + map_info->vport_id = hw->vsi_res->vsi_id; + map_info->num_qv_maps = num; +for (i = index; i < index + map_info->num_qv_maps; i++) { + qv_maps = &map_info->qv_maps[count++]; + qv_maps->itr_idx =VIRTCHNL_ITR_IDX_0 ; + qv_maps->queue_type =VIRTCHNL_QUEUE_TYPE_RX ; + qv_maps->queue_id = hw->qv_map[i].queue_id; + qv_maps->vector_id = hw->qv_map[i].vector_id; + } + + args.v_op =VIRTCHNL_OP_MAP_QUEUE_VECTOR ; + args.req_msg = (u8 *)map_info; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.req_msglen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command OP_MAP_QUEUE_VECTOR" ); + +rte_free (map_info); +return err; +} +int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on) {
drivers/net/ice/ice_dcf.h +9 -1
@@ -74,6 +74,11 @@ struct ice_dcf_tm_conf {bool committed; }; +struct ice_dcf_qv_map { +uint16_t queue_id; +uint16_t vector_id; +}; +struct ice_dcf_hw {struct iavf_hw avf;
@@ -108,7 +113,8 @@ struct ice_dcf_hw {uint16_t msix_base;uint16_t nb_msix;uint16_t max_rss_qregion;/* max RSS queue region supported by PF */ -uint16_t rxq_map[16 ]; + +struct ice_dcf_qv_map *qv_map;/* queue vector mapping */ struct virtchnl_eth_stats eth_stats_offset;struct virtchnl_vlan_caps vlan_v2_caps;
@@ -136,6 +142,8 @@ int ice_dcf_configure_queues(struct ice_dcf_hw *hw,int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw); +int ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw, +uint16_t num,uint16_t index);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw); int ice_dcf_query_stats(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_ethdev.c +44 -7
94 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +1 -0
@@ -23,6 +23,7 @@#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16#define ICE_DCF_MAX_NUM_QUEUES_LV 256#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 +#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH 36/39 net/ice: add enable/disable queues for DCF large VF
In reply to Kevin LiuThe current virtchnl structure for enable/disable queues only supports max 32 queue pairs. Use a new opcode and structure to indicate up to 256 queue pairs, in order to enable/disable queues in large VF case.
--- drivers/net/ice/ice_dcf.c | 99 +++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf.h | 5 ++ drivers/net/ice/ice_dcf_ethdev.c | 26 +++++++-- drivers/net/ice/ice_dcf_ethdev.h | 8 +-- 4 files changed, 125 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +96 -3
@@ -90,7 +90,6 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, *rsp_msglen = event.msg_len;return rte_le_to_cpu_32 (event.desc.cookie_low); - again:rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); }while (i++ <ICE_DCF_ARQ_MAX_RETRIES );
@@ -897,7 +896,7 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw) {struct rte_eth_dev *dev = hw->eth_dev;struct rte_eth_rss_conf *rss_conf; -uint8_t i, j, nb_q; +uint16_t i, j, nb_q;int ret; rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
@@ -1076,6 +1075,12 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)return err; } +/* request queues succeeded, vf is resetting */ +if (hw->resetting) { +PMD_DRV_LOG (INFO ,"vf is resetting" ); +return 0 ; + } +/* request additional queues failed, return available number */ num_queue_pairs = ((struct virtchnl_vf_res_request *) args.rsp_msgbuf)->num_queue_pairs;
@@ -1186,7 +1191,8 @@ ice_dcf_config_irq_map_lv(struct ice_dcf_hw *hw, args.req_msg = (u8 *)map_info; args.req_msglen = len; args.rsp_msgbuf = hw->arq_buf; - args.req_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; err =ice_dcf_execute_virtchnl_cmd (hw, &args);if (err)PMD_DRV_LOG (ERR ,"fail to execute command OP_MAP_QUEUE_VECTOR" );
@@ -1226,6 +1232,50 @@ ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on)return err; } +int +ice_dcf_switch_queue_lv (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on) +{ +struct virtchnl_del_ena_dis_queues *queue_select; +struct virtchnl_queue_chunk *queue_chunk; +struct dcf_virtchnl_cmd args; +int err, len; + + len =sizeof (struct virtchnl_del_ena_dis_queues ); + queue_select =rte_zmalloc ("queue_select" , len,0 ); +if (!queue_select) +return -ENOMEM ; + + queue_chunk = queue_select->chunks.chunks; + queue_select->chunks.num_chunks =1 ; + queue_select->vport_id = hw->vsi_res->vsi_id; + +if (rx) { + queue_chunk->type =VIRTCHNL_QUEUE_TYPE_RX ; + queue_chunk->start_queue_id = qid; + queue_chunk->num_queues =1 ; + }else { + queue_chunk->type =VIRTCHNL_QUEUE_TYPE_TX ; + queue_chunk->start_queue_id = qid; + queue_chunk->num_queues =1 ; + } + +if (on) + args.v_op =VIRTCHNL_OP_ENABLE_QUEUES_V2 ; +else + args.v_op =VIRTCHNL_OP_DISABLE_QUEUES_V2 ; + args.req_msg = (u8 *)queue_select; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"Failed to execute command of %s" , + on ?"OP_ENABLE_QUEUES_V2" :"OP_DISABLE_QUEUES_V2" ); +rte_free (queue_select); +return err; +} +int ice_dcf_disable_queues (struct ice_dcf_hw *hw) {
@@ -1255,6 +1305,49 @@ ice_dcf_disable_queues(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_disable_queues_lv (struct ice_dcf_hw *hw) +{ +struct virtchnl_del_ena_dis_queues *queue_select; +struct virtchnl_queue_chunk *queue_chunk; +struct dcf_virtchnl_cmd args; +int err, len; + + len =sizeof (struct virtchnl_del_ena_dis_queues ) + +sizeof (struct virtchnl_queue_chunk ) * + (ICE_DCF_RXTX_QUEUE_CHUNKS_NUM -1 ); + queue_select =rte_zmalloc ("queue_select" , len,0 ); +if (!queue_select) +return -ENOMEM ; + + queue_chunk = queue_select->chunks.chunks; + queue_select->chunks.num_chunks =ICE_DCF_RXTX_QUEUE_CHUNKS_NUM ; + queue_select->vport_id = hw->vsi_res->vsi_id; + + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].type =VIRTCHNL_QUEUE_TYPE_TX ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].start_queue_id =0 ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].num_queues = + hw->eth_dev->data->nb_tx_queues; + + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].type =VIRTCHNL_QUEUE_TYPE_RX ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].start_queue_id =0 ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].num_queues = + hw->eth_dev->data->nb_rx_queues; + + args.v_op =VIRTCHNL_OP_DISABLE_QUEUES_V2 ; + args.req_msg = (u8 *)queue_select; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_QUEUES_V2" ); +rte_free (queue_select); +return err; +} +int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats)
drivers/net/ice/ice_dcf.h +5 -0
@@ -15,6 +15,8 @@#include "base/ice_type.h" #include "ice_logs.h" +#define ICE_DCF_RXTX_QUEUE_CHUNKS_NUM 2 +struct dcf_virtchnl_cmd {TAILQ_ENTRY (dcf_virtchnl_cmd) next;
@@ -145,7 +147,10 @@ int ice_dcf_config_irq_map(struct ice_dcf_hw *hw);int ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw,uint16_t num,uint16_t index);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on); +int ice_dcf_switch_queue_lv (struct ice_dcf_hw *hw, +uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw); +int ice_dcf_disable_queues_lv (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_ethdev.c +20 -6
@@ -318,6 +318,7 @@ static int ice_dcf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) {struct ice_dcf_adapter *ad = dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &ad->real_hw;struct iavf_hw *hw = &ad->real_hw.avf;struct ice_rx_queue *rxq;int err =0 ;
@@ -340,7 +341,11 @@ ice_dcf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)IAVF_WRITE_FLUSH (hw);/* Ready to switch the queue on */ - err =ice_dcf_switch_queue (&ad->real_hw, rx_queue_id, true, true); +if (!dcf_hw->lv_enabled) + err =ice_dcf_switch_queue (dcf_hw, rx_queue_id, true, true); +else + err =ice_dcf_switch_queue_lv (dcf_hw, rx_queue_id, true, true); +if (err) {PMD_DRV_LOG (ERR ,"Failed to switch RX queue %u on" , rx_queue_id);
@@ -449,6 +454,7 @@ static int ice_dcf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) {struct ice_dcf_adapter *ad = dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &ad->real_hw;struct iavf_hw *hw = &ad->real_hw.avf;struct ice_tx_queue *txq;int err =0 ;
@@ -464,7 +470,10 @@ ice_dcf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)IAVF_WRITE_FLUSH (hw);/* Ready to switch the queue on */ - err =ice_dcf_switch_queue (&ad->real_hw, tx_queue_id, false, true); +if (!dcf_hw->lv_enabled) + err =ice_dcf_switch_queue (dcf_hw, tx_queue_id, false, true); +else + err =ice_dcf_switch_queue_lv (dcf_hw, tx_queue_id, false, true);if (err) { PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on",
@@ -651,12 +660,17 @@ ice_dcf_stop_queues(struct rte_eth_dev *dev)struct ice_dcf_hw *hw = &ad->real_hw;struct ice_rx_queue *rxq;struct ice_tx_queue *txq; -int ret, i; +int i;/* Stop All queues */ - ret =ice_dcf_disable_queues (hw); -if (ret) -PMD_DRV_LOG (WARNING ,"Fail to stop queues" ); +if (!hw->lv_enabled) { +if (ice_dcf_disable_queues (hw)) +PMD_DRV_LOG (WARNING ,"Fail to stop queues" ); + }else { +if (ice_dcf_disable_queues_lv (hw)) +PMD_DRV_LOG (WARNING , +"Fail to stop queues for large VF" ); + }for (i =0 ; i < dev->data->nb_tx_queues; i++) { txq = dev->data->tx_queues[i];
drivers/net/ice/ice_dcf_ethdev.h +4 -4
@@ -20,10 +20,10 @@#define ICE_DCF_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) -#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 -#define ICE_DCF_MAX_NUM_QUEUES_LV 256 -#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 -#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128 +#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 +#define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 +#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH 37/39 net/ice: fix DCF ACL flow engine
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
ACL is not a necessary feature for DCF, it may not be supported by the ice kernel driver, so in this patch the program does not return the ACL initiation fails to high level functions, as substitute it prints some error logs, cleans the related resources and unregisters the ACL engine.
--- drivers/net/ice/ice_acl_filter.c | 20 ++++++++++++++---- drivers/net/ice/ice_generic_flow.c | 34 +++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 12 deletions(-)
drivers/net/ice/ice_acl_filter.c +16 -4
@@ -57,6 +57,8 @@ ice_pattern_match_item ice_acl_pattern[] = { {pattern_eth_ipv4_sctp, ICE_ACL_INSET_ETH_IPV4_SCTP, ICE_INSET_NONE, ICE_INSET_NONE}, }; +static void ice_acl_prof_free (struct ice_hw *hw); +static int ice_acl_prof_alloc (struct ice_hw *hw) {
@@ -1011,17 +1013,27 @@ ice_acl_init(struct ice_adapter *ad) ret =ice_acl_setup (pf);if (ret) -return ret; + goto deinit_acl; ret =ice_acl_bitmap_init (pf);if (ret) -return ret; + goto deinit_acl; ret =ice_acl_prof_init (pf);if (ret) -return ret; + goto deinit_acl; -return ice_register_parser (parser, ad); + ret =ice_register_parser (parser, ad); +if (ret) + goto deinit_acl; + +return 0 ; + +deinit_acl: +ice_deinit_acl (pf); +ice_acl_prof_free (hw); +PMD_DRV_LOG (ERR ,"ACL init failed, may not supported!" ); +return ret; } static void
drivers/net/ice/ice_generic_flow.c +26 -8
@@ -1865,6 +1865,12 @@ ice_register_flow_engine(struct ice_flow_engine *engine)TAILQ_INSERT_TAIL (&engine_list, engine, node); } +static void +ice_unregister_flow_engine (struct ice_flow_engine *engine) +{ +TAILQ_REMOVE (&engine_list, engine, node); +} +int ice_flow_init (struct ice_adapter *ad) {
@@ -1888,9 +1894,18 @@ ice_flow_init(struct ice_adapter *ad) ret = engine->init (ad);if (ret) { -PMD_INIT_LOG (ERR ,"Failed to initialize engine %d" , - engine->type); -return ret; +/** +* ACL may not supported in kernel driver, +* so just unregister the engine. +*/ +if (engine->type ==ICE_FLOW_ENGINE_ACL ) { +ice_unregister_flow_engine (engine); + }else { +PMD_INIT_LOG (ERR , +"Failed to initialize engine %d" , + engine->type); +return ret; + } } }return 0 ;
@@ -1977,7 +1992,7 @@ ice_register_parser(struct ice_flow_parser *parser, list =ice_get_parser_list (parser, ad);if (list ==NULL ) -return -EINVAL ; + goto err;if (ad->devargs.pipe_mode_support) {TAILQ_INSERT_TAIL (list, parser_node, node);
@@ -1989,7 +2004,7 @@ ice_register_parser(struct ice_flow_parser *parser, ICE_FLOW_ENGINE_ACL) {TAILQ_INSERT_AFTER (list, existing_node, parser_node, node); - goto DONE; +return 0 ; } }TAILQ_INSERT_HEAD (list, parser_node, node);
@@ -2000,7 +2015,7 @@ ice_register_parser(struct ice_flow_parser *parser, ICE_FLOW_ENGINE_SWITCH) {TAILQ_INSERT_AFTER (list, existing_node, parser_node, node); - goto DONE; +return 0 ; } }TAILQ_INSERT_HEAD (list, parser_node, node);
@@ -2009,11 +2024,14 @@ ice_register_parser(struct ice_flow_parser *parser, }else if (parser->engine->type ==ICE_FLOW_ENGINE_ACL ) {TAILQ_INSERT_HEAD (list, parser_node, node); }else { -return -EINVAL ; + goto err; } } -DONE:return 0 ; +err: +rte_free (parser_node); +PMD_DRV_LOG (ERR ,"%s failed." , __func__); +return -EINVAL ; }void
Signature · 1 line
2.33.1
PATCH 38/39 testpmd: force flow flush
In reply to Kevin LiuFrom: Qi Zhang <[email protected]>
For mdcf, rte_flow_flush is still need to be invoked even there are no flows be created in current instance.
--- app/test-pmd/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
app/test-pmd/config.c +3 -3
@@ -2923,15 +2923,15 @@ port_flow_flush(portid_t port_id) port = &ports[port_id]; -if (port->flow_list ==NULL ) -return ret; -/* Poisoning to make sure PMDs update it in case of error. */ memset (&error,0x44 ,sizeof (error));if (rte_flow_flush (port_id, &error)) {port_flow_complain (&error); } +if (port->flow_list ==NULL ) +return ret; +while (port->flow_list) {struct port_flow *pf = port->flow_list->next;
Signature · 1 line
2.33.1
PATCH 39/39 net/ice: fix DCF reset
In reply to Kevin LiuAfter the PF triggers the VF reset, before the VF PMD can perform any operations on the hardware, it must reinitialize the all resources.
This patch adds a flag to indicate whether the VF has been reset by PF, and update the DCF resetting operations according to this flag.
--- drivers/net/ice/base/ice_common.c | 4 +++- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf_ethdev.c | 17 ++++++++++++++++- drivers/net/ice/ice_dcf_parent.c | 3 +++ 4 files changed, 23 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_common.c +3 -1
@@ -779,6 +779,7 @@ enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) status =ice_init_def_sw_recp (hw, &hw->switch_info->recp_list);if (status) {ice_free (hw, hw->switch_info); + hw->switch_info =NULL ;return status; }return ICE_SUCCESS ;
@@ -848,7 +849,6 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw)ice_rm_sw_replay_rule_info (hw, sw);ice_free (hw, sw->buildin_recipes);ice_free (hw, sw->recp_list); -ice_free (hw, sw); }/**
@@ -858,6 +858,8 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw)void ice_cleanup_fltr_mgmt_struct (struct ice_hw *hw) {ice_cleanup_fltr_mgmt_single (hw, hw->switch_info); +ice_free (hw, hw->switch_info); + hw->switch_info =NULL ; }/**
drivers/net/ice/ice_dcf.c +1 -1
@@ -1430,7 +1430,7 @@ ice_dcf_cap_reset(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)int ret;struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;ice_dcf_disable_irq0 (hw);rte_intr_disable (intr_handle);
drivers/net/ice/ice_dcf_ethdev.c +16 -1
@@ -1005,6 +1005,15 @@ dcf_add_del_mc_addr_list(struct ice_dcf_hw *hw,uint32_t i;int len, err =0 ; +if (hw->resetting) { +if (!add) +return 0 ; + +PMD_DRV_LOG (ERR , +"fail to add multicast MACs for VF resetting" ); +return -EIO ; + } + len =sizeof (struct virtchnl_ether_addr_list ); len +=sizeof (struct virtchnl_ether_addr ) * mc_addrs_num;
@@ -1643,7 +1652,13 @@ ice_dcf_dev_close(struct rte_eth_dev *dev)if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ; - (void )ice_dcf_dev_stop (dev); +if (adapter->parent.pf.adapter_stopped) + (void )ice_dcf_dev_stop (dev); + +if (adapter->real_hw.resetting) { +ice_dcf_uninit_hw (dev, &adapter->real_hw); +ice_dcf_init_hw (dev, &adapter->real_hw); + }ice_free_queues (dev);
drivers/net/ice/ice_dcf_parent.c +3 -0
@@ -243,6 +243,9 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,case VIRTCHNL_EVENT_RESET_IMPENDING :PMD_DRV_LOG (DEBUG ,"VIRTCHNL_EVENT_RESET_IMPENDING event" ); dcf_hw->resetting = true; +rte_eth_dev_callback_process (dcf_hw->eth_dev, +RTE_ETH_EVENT_INTR_RESET , +NULL );break ;case VIRTCHNL_EVENT_LINK_CHANGE :PMD_DRV_LOG (DEBUG ,"VIRTCHNL_EVENT_LINK_CHANGE event" );
Signature · 1 line
2.33.1
v2 cover support full function of DCF
In reply to Kevin LiuThese functions have been customized and implemented on DPDK-20.11, Now it's time to migrate the function to DPDK-22.07.
v2:
* remove patch:
1.net/iavf: support checking if device is an MDCF instance 2.net/ice: support MDCF(multi-DCF) instance 3.net/ice/base: support custom DDP buildin recipe 4.net/ice: support buildin recipe configuration 5.net/ice/base: support custom ddp package version 6.net/ice: disable ACL function for MDCF instance
Alvin Zhang (14):
net/ice: support dcf promisc configuration net/ice: support dcf VLAN filter and offload configuration net/ice: support DCF new VLAN capabilities common/iavf: support flushing rules and reporting DCF id net/ice/base: fix ethertype filter input set net/ice/base: support IPv6 GRE UDP pattern net/ice: support IPv6 NVGRE tunnel
net/ice: support new pattern of IPv4 net/ice/base: support new patterns of TCP and UDP net/ice: support new patterns of TCP and UDP net/ice/base: support IPv4 GRE tunnel
net/ice: support IPv4 GRE raw pattern type net/ice: treat unknown package as OS default package net/ice: fix DCF ACL flow engine
Dapeng Yu (1):
net/ice: enable CVL DCF device reset API
Jie Wang (2):
net/ice: add ops MTU-SET to dcf
net/ice: add ops dev-supported-ptypes-get to dcf
Junfeng Guo (4):
net/ice/base: add VXLAN support for switch filter net/ice: add VXLAN support for switch filter net/ice/base: update Profile ID table for VXLAN net/ice/base: update Protocol ID table to match DVM DDP
Kevin Liu (3):
net/ice: support dcf MAC configuration net/ice: add enable/disable queues for DCF large VF net/ice: fix DCF reset
Qi Zhang (1):
testpmd: force flow flush
Robin Zhang (1):
net/ice: cleanup Tx buffers
Steve Yang (7):
net/ice: enable RSS RETA ops for DCF hardware net/ice: enable RSS HASH ops for DCF hardware net/ice: handle virtchnl event message without interrupt net/ice: add DCF request queues function
net/ice: negotiate large VF and request more queues net/ice: enable multiple queues configurations for large VF net/ice: enable IRQ mapping configuration for large VF
app/test-pmd/config.c | 6 +- drivers/common/iavf/virtchnl.h | 13 + drivers/net/ice/base/ice_common.c | 4 +- drivers/net/ice/base/ice_fdir.c | 3 + drivers/net/ice/base/ice_flex_pipe.c | 37 +- drivers/net/ice/base/ice_flex_pipe.h | 3 +- drivers/net/ice/base/ice_protocol_type.h | 22 + drivers/net/ice/base/ice_switch.c | 574 +++++++++++++- drivers/net/ice/base/ice_switch.h | 12 + drivers/net/ice/ice_acl_filter.c | 20 +- drivers/net/ice/ice_dcf.c | 375 ++++++++- drivers/net/ice/ice_dcf.h | 31 +- drivers/net/ice/ice_dcf_ethdev.c | 925 +++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 14 + drivers/net/ice/ice_dcf_parent.c | 3 + drivers/net/ice/ice_ethdev.c | 13 +- drivers/net/ice/ice_generic_flow.c | 81 +- drivers/net/ice/ice_generic_flow.h | 13 + drivers/net/ice/ice_switch_filter.c | 163 +++- 19 files changed, 2174 insertions(+), 138 deletions(-)
Signature · 1 line
2.33.1
PATCH v2 1/33 net/ice: enable RSS RETA ops for DCF hardware
From: Steve Yang <[email protected]>
RSS RETA should be updated and queried by application, Add related ops ('.reta_update', '.reta_query') for DCF.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -790,7 +790,7 @@ ice_dcf_configure_rss_key(struct ice_dcf_hw *hw)return err; } -static int +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw) {struct virtchnl_rss_lut *rss_lut;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +77 -0
89 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v2 2/33 net/ice: enable RSS HASH ops for DCF hardware
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
RSS HASH should be updated and queried by application, Add related ops ('.rss_hash_update', '.rss_hash_conf_get') for DCF.
Because DCF doesn't support configure RSS HASH, only HASH key can be updated within ops '.rss_hash_update'.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 51 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -758,7 +758,7 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw) hw->ets_config =NULL ; } -static int +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw) {struct virtchnl_rss_key *rss_key;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +51 -0
63 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v2 3/33 net/ice: cleanup Tx buffers
In reply to Kevin LiuFrom: Robin Zhang <[email protected]>
Add support for ops rte_eth_tx_done_cleanup in dcf
--- drivers/net/ice/ice_dcf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/ice_dcf_ethdev.c +1 -0
@@ -1235,6 +1235,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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, }; static int
Signature · 1 line
2.33.1
PATCH v2 4/33 net/ice: add ops MTU-SET to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "mtu_set" to dcf, and it can configure the port mtu through cmdline.
--- drivers/net/ice/ice_dcf_ethdev.c | 14 ++++++++++++++ drivers/net/ice/ice_dcf_ethdev.h | 6 ++++++ 2 files changed, 20 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +14 -0
@@ -1081,6 +1081,19 @@ ice_dcf_link_update(struct rte_eth_dev *dev,return rte_eth_linkstatus_set (dev, &new_link); } +static int +ice_dcf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) +{ +/* mtu setting is forbidden if port is start */ +if (dev->data->dev_started !=0 ) { +PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , + dev->data->port_id); +return -EBUSY ; + } + +return 0 ; +} +bool ice_dcf_adminq_need_retry (struct ice_adapter *ad) {
@@ -1236,6 +1249,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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
drivers/net/ice/ice_dcf_ethdev.h +6 -0
@@ -15,6 +15,12 @@#define ICE_DCF_MAX_RINGS 1 +#define ICE_DCF_FRAME_SIZE_MAX 9728 +#define ICE_DCF_VLAN_TAG_SIZE 4 +#define ICE_DCF_ETH_OVERHEAD \ + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2) +#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +struct ice_dcf_queue {uint64_t dummy; };
Signature · 1 line
2.33.1
PATCH v2 5/33 net/ice: add ops dev-supported-ptypes-get to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "dev_supported_ptypes_get" to dcf, that dcf pmd can get ptypes through the new API.
--- drivers/net/ice/ice_dcf_ethdev.c | 80 +++++++++++++++++++------------- 1 file changed, 49 insertions(+), 31 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +49 -31
@@ -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
Signature · 1 line
2.33.1
PATCH v2 6/33 net/ice: support dcf promisc configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Support configuration of unicast and multicast promisc on dcf.
--- drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 3 ++ 2 files changed, 76 insertions(+), 4 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +73 -4
@@ -727,27 +727,95 @@ ice_dcf_dev_info_get(struct rte_eth_dev *dev, }static int -ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +dcf_config_promisc (struct ice_dcf_adapter *adapter, +bool enable_unicast, +bool enable_multicast) { +struct ice_dcf_hw *hw = &adapter->real_hw; +struct virtchnl_promisc_info promisc; +struct dcf_virtchnl_cmd args; +int err; + + promisc.flags =0 ; + promisc.vsi_id = hw->vsi_res->vsi_id; + +if (enable_unicast) + promisc.flags |=FLAG_VF_UNICAST_PROMISC ; + +if (enable_multicast) + promisc.flags |=FLAG_VF_MULTICAST_PROMISC ; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE ; + args.req_msg = (uint8_t *)&promisc; + args.req_msglen =sizeof (promisc); + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"fail to execute command VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE" ); +return err; + } + + adapter->promisc_unicast_enabled = enable_unicast; + adapter->promisc_multicast_enabled = enable_multicast;return 0 ; } +static int +ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, true, + adapter->promisc_multicast_enabled); +} +static int ice_dcf_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, false, + adapter->promisc_multicast_enabled); }static int ice_dcf_dev_allmulticast_enable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + true); }static int ice_dcf_dev_allmulticast_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + false); } static int
@@ -1299,6 +1367,7 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev)return -1 ; } +dcf_config_promisc (adapter, false, false);return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +3 -0
@@ -33,6 +33,9 @@ struct ice_dcf_adapter {struct ice_adapter parent;/* Must be first */ struct ice_dcf_hw real_hw; +bool promisc_unicast_enabled; +bool promisc_multicast_enabled; +int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH v2 7/33 net/ice: support dcf MAC configuration
In reply to Kevin LiuBelow PMD ops are supported in this patch:
.mac_addr_add = dcf_dev_add_mac_addr
.mac_addr_remove = dcf_dev_del_mac_addr
.set_mc_addr_list = dcf_set_mc_addr_list
.mac_addr_set = dcf_dev_set_default_mac_addr--- drivers/net/ice/ice_dcf.c | 9 +- drivers/net/ice/ice_dcf.h | 4 +- drivers/net/ice/ice_dcf_ethdev.c | 218 ++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 5 +- 4 files changed, 226 insertions(+), 10 deletions(-)
drivers/net/ice/ice_dcf.c +5 -4
@@ -1089,10 +1089,11 @@ ice_dcf_query_stats(struct ice_dcf_hw *hw, }int -ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add) +ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr, +bool add,uint8_t type) {struct virtchnl_ether_addr_list *list; -struct rte_ether_addr *addr;struct dcf_virtchnl_cmd args;int len, err =0 ;
@@ -1105,7 +1106,6 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add) } len =sizeof (struct virtchnl_ether_addr_list ); - addr = hw->eth_dev->data->mac_addrs; len +=sizeof (struct virtchnl_ether_addr ); list =rte_zmalloc (NULL , len,0 );
@@ -1116,9 +1116,10 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add)rte_memcpy (list->list[0 ].addr, addr->addr_bytes,sizeof (addr->addr_bytes)); +PMD_DRV_LOG (DEBUG ,"add/rm mac:" RTE_ETHER_ADDR_PRT_FMT ,RTE_ETHER_ADDR_BYTES (addr)); - + list->list[0 ].type = type; list->vsi_id = hw->vsi_res->vsi_id; list->num_elements =1 ;
drivers/net/ice/ice_dcf.h +3 -1
@@ -131,7 +131,9 @@ int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); -int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add); +int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr,bool add, +uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);
drivers/net/ice/ice_dcf_ethdev.c +215 -3
259 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +3 -2
@@ -14,7 +14,7 @@#include "ice_dcf.h" #define ICE_DCF_MAX_RINGS 1 - +#define DCF_NUM_MACADDR_MAX 64#define ICE_DCF_FRAME_SIZE_MAX 9728#define ICE_DCF_VLAN_TAG_SIZE 4#define ICE_DCF_ETH_OVERHEAD \
@@ -35,7 +35,8 @@ struct ice_dcf_adapter {bool promisc_unicast_enabled;bool promisc_multicast_enabled; - +uint32_t mc_addrs_num; +struct rte_ether_addr mc_addrs[DCF_NUM_MACADDR_MAX ];int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH v2 8/33 net/ice: support dcf VLAN filter and offload configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Below PMD ops are supported in this patch:
.vlan_filter_set = dcf_dev_vlan_filter_set
.vlan_offload_set = dcf_dev_vlan_offload_set
--- drivers/net/ice/ice_dcf_ethdev.c | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +101 -0
@@ -1026,6 +1026,105 @@ dcf_dev_set_default_mac_addr(struct rte_eth_dev *dev,return 0 ; } +static int +dcf_add_del_vlan (struct ice_dcf_hw *hw,uint16_t vlanid,bool add) +{ +struct virtchnl_vlan_filter_list *vlan_list; +uint8_t cmd_buffer[sizeof (struct virtchnl_vlan_filter_list ) + +sizeof (uint16_t )]; +struct dcf_virtchnl_cmd args; +int err; + + vlan_list = (struct virtchnl_vlan_filter_list *)cmd_buffer; + vlan_list->vsi_id = hw->vsi_res->vsi_id; + vlan_list->num_elements =1 ; + vlan_list->vlan_id[0 ] = vlanid; + +memset (&args,0 ,sizeof (args)); + args.v_op = add ?VIRTCHNL_OP_ADD_VLAN :VIRTCHNL_OP_DEL_VLAN ; + args.req_msg = cmd_buffer; + args.req_msglen =sizeof (cmd_buffer); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command %s" , + add ?"OP_ADD_VLAN" :"OP_DEL_VLAN" ); + +return err; +} + +static int +dcf_enable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_ENABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_ENABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_disable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_DISABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_dev_vlan_filter_set (struct rte_eth_dev *dev,uint16_t vlan_id,int on) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + + err =dcf_add_del_vlan (hw, vlan_id, on); +if (err) +return -EIO ; +return 0 ; +} + +static int +dcf_dev_vlan_offload_set (struct rte_eth_dev *dev,int mask) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +struct rte_eth_conf *dev_conf = &dev->data->dev_conf; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + +/* Vlan stripping setting */ +if (mask &RTE_ETH_VLAN_STRIP_MASK ) { +/* Enable or disable VLAN stripping */ +if (dev_conf->rxmode.offloads &RTE_ETH_RX_OFFLOAD_VLAN_STRIP ) + err =dcf_enable_vlan_strip (hw); +else + err =dcf_disable_vlan_strip (hw); + +if (err) +return -EIO ; + } +return 0 ; +} +static int ice_dcf_dev_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops)
@@ -1538,6 +1637,8 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .mac_addr_remove = dcf_dev_del_mac_addr, .set_mc_addr_list = dcf_set_mc_addr_list, .mac_addr_set = dcf_dev_set_default_mac_addr, + .vlan_filter_set = dcf_dev_vlan_filter_set, + .vlan_offload_set = dcf_dev_vlan_offload_set, .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,
Signature · 1 line
2.33.1
PATCH v2 9/33 net/ice: support DCF new VLAN capabilities
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
The new VLAN virtchnl opcodes introduce new capabilities like VLAN filtering, stripping and insertion.
The DCF needs to query the VLAN capabilities based on current device configuration firstly.
DCF is able to configure inner VLAN filter when port VLAN is enabled base on negotiation; and DCF is able to configure outer VLAN (0x8100) if port VLAN is disabled to be compatible with legacy mode.
When port VLAN is updated by DCF, the DCF needs to reset to query the new VLAN capabilities.
--- drivers/net/ice/ice_dcf.c | 27 +++++ drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 171 ++++++++++++++++++++++++++++--- 3 files changed, 182 insertions(+), 17 deletions(-)
drivers/net/ice/ice_dcf.c +27 -0
@@ -587,6 +587,29 @@ ice_dcf_get_supported_rxdid(struct ice_dcf_hw *hw)return 0 ; } +static int +dcf_get_vlan_offload_caps_v2 (struct ice_dcf_hw *hw) +{ +struct virtchnl_vlan_caps vlan_v2_caps; +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS ; + args.rsp_msgbuf = (uint8_t *)&vlan_v2_caps; + args.rsp_buflen =sizeof (vlan_v2_caps); + + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) { +PMD_DRV_LOG (ERR , +"Failed to execute command of VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS" ); +return ret; + } + +rte_memcpy (&hw->vlan_v2_caps, &vlan_v2_caps,sizeof (vlan_v2_caps)); +return 0 ; +} +int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw) {
@@ -701,6 +724,10 @@ ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)rte_intr_enable (pci_dev->intr_handle);ice_dcf_enable_irq0 (hw); +if ((hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN_V2 ) && +dcf_get_vlan_offload_caps_v2 (hw)) + goto err_rss; +return 0 ; err_rss:
drivers/net/ice/ice_dcf.h +1 -0
@@ -107,6 +107,7 @@ struct ice_dcf_hw {uint16_t nb_msix;uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset; +struct virtchnl_vlan_caps vlan_v2_caps;/* Link status */ bool link_up;
drivers/net/ice/ice_dcf_ethdev.c +154 -17
196 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v2 10/33 net/ice: enable CVL DCF device reset API
In reply to Kevin LiuFrom: Dapeng Yu <[email protected]>
Enable CVL DCF device reset API.
--- drivers/net/ice/ice_dcf.c | 24 ++++++++++++++++++++++++ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 25 insertions(+)
drivers/net/ice/ice_dcf.c +24 -0
@@ -1163,3 +1163,27 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,rte_free (list);return err; } + +int +ice_dcf_cap_reset (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw) +{ +int ret; + +struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); +struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + +ice_dcf_disable_irq0 (hw); +rte_intr_disable (intr_handle); +rte_intr_callback_unregister (intr_handle, ice_dcf_dev_interrupt_handler, + hw); + ret =ice_dcf_mode_disable (hw); +if (ret) + goto err; + ret =ice_dcf_get_vf_resource (hw); +err: +rte_intr_callback_register (intr_handle, ice_dcf_dev_interrupt_handler, + hw); +rte_intr_enable (intr_handle); +ice_dcf_enable_irq0 (hw); +return ret; +}
drivers/net/ice/ice_dcf.h +1 -0
@@ -137,6 +137,7 @@ int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete); +int ice_dcf_cap_reset (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);void ice_dcf_tm_conf_uninit (struct rte_eth_dev *dev);int ice_dcf_replay_vf_bw (struct ice_dcf_hw *hw,uint16_t vf_id);
Signature · 1 line
2.33.1
PATCH v2 11/33 net/ice/base: add VXLAN support for switch filter
In reply to Kevin LiuFrom: Junfeng Guo <[email protected]>
1. Add profile rule for VXLAN on Switch Filter, including pattern_eth_ipv4_udp_vxlan_any pattern_eth_ipv6_udp_vxlan_any pattern_eth_ipv4_udp_vxlan_eth_ipv4 pattern_eth_ipv4_udp_vxlan_eth_ipv6 pattern_eth_ipv6_udp_vxlan_eth_ipv4 pattern_eth_ipv6_udp_vxlan_eth_ipv6
2. Add common rule for VXLAN on Switch Filter, including
+-----------------+-----------------------------------------------------+ | Pattern | Input Set | +-----------------+-----------------------------------------------------+ | ipv4_vxlan_ipv4 | vni, inner dmac, inner dst/src ip, outer dst/src ip | | ipv4_vxlan_ipv6 | vni, inner dmac, inner dst/src ip | | ipv6_vxlan_ipv4 | vni, inner dmac, inner dst/src ip | | ipv6_vxlan_ipv6 | vni, inner dmac, inner dst/src ip | +-----------------+-----------------------------------------------------+
--- drivers/net/ice/base/ice_protocol_type.h | 6 + drivers/net/ice/base/ice_switch.c | 213 ++++++++++++++++++++++- drivers/net/ice/base/ice_switch.h | 12 ++ 3 files changed, 230 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_protocol_type.h +6 -0
@@ -112,6 +112,12 @@ enum ice_sw_tunnel_type {ICE_SW_TUN_IPV6_NAT_T ,ICE_SW_TUN_IPV4_L2TPV3 ,ICE_SW_TUN_IPV6_L2TPV3 , +ICE_SW_TUN_PROFID_IPV4_VXLAN , +ICE_SW_TUN_PROFID_IPV4_VXLAN_IPV4 , +ICE_SW_TUN_PROFID_IPV4_VXLAN_IPV6 , +ICE_SW_TUN_PROFID_IPV6_VXLAN , +ICE_SW_TUN_PROFID_IPV6_VXLAN_IPV4 , +ICE_SW_TUN_PROFID_IPV6_VXLAN_IPV6 ,ICE_SW_TUN_PROFID_IPV6_ESP ,ICE_SW_TUN_PROFID_IPV6_AH , ICE_SW_TUN_PROFID_MAC_IPV6_L2TPV3,
drivers/net/ice/base/ice_switch.c +212 -1
270 lines not on this page · raw message
drivers/net/ice/base/ice_switch.h +12 -0
@@ -20,6 +20,18 @@#define ICE_PROFID_IPV4_UDP 5#define ICE_PROFID_IPV6_TCP 7#define ICE_PROFID_IPV6_UDP 8 +#define ICE_PROFID_IPV4_TUN_M_IPV4_TCP 10 +#define ICE_PROFID_IPV4_TUN_M_IPV4_UDP 11 +#define ICE_PROFID_IPV4_TUN_M_IPV4_OTHER 12 +#define ICE_PROFID_IPV6_TUN_M_IPV4_TCP 16 +#define ICE_PROFID_IPV6_TUN_M_IPV4_UDP 17 +#define ICE_PROFID_IPV6_TUN_M_IPV4_OTHER 18 +#define ICE_PROFID_IPV4_TUN_M_IPV6_TCP 22 +#define ICE_PROFID_IPV4_TUN_M_IPV6_UDP 23 +#define ICE_PROFID_IPV4_TUN_M_IPV6_OTHER 24 +#define ICE_PROFID_IPV6_TUN_M_IPV6_TCP 25 +#define ICE_PROFID_IPV6_TUN_M_IPV6_UDP 26 +#define ICE_PROFID_IPV6_TUN_M_IPV6_OTHER 27#define ICE_PROFID_PPPOE_PAY 34#define ICE_PROFID_PPPOE_IPV4_TCP 35#define ICE_PROFID_PPPOE_IPV4_UDP 36
Signature · 1 line
2.33.1
PATCH v2 12/33 net/ice: add VXLAN support for switch filter
In reply to Kevin LiuFrom: Junfeng Guo <[email protected]>
1. Add profile rule for VXLAN on Switch Filter, including pattern_eth_ipv4_udp_vxlan_any pattern_eth_ipv6_udp_vxlan_any pattern_eth_ipv4_udp_vxlan_eth_ipv4 pattern_eth_ipv4_udp_vxlan_eth_ipv6 pattern_eth_ipv6_udp_vxlan_eth_ipv4 pattern_eth_ipv6_udp_vxlan_eth_ipv6
2. Add common rule for VXLAN on Switch Filter, including
+-----------------+-----------------------------------------------------+ | Pattern | Input Set | +-----------------+-----------------------------------------------------+ | ipv4_vxlan_ipv4 | vni, inner dmac, inner dst/src ip, outer dst/src ip | | ipv4_vxlan_ipv6 | vni, inner dmac, inner dst/src ip | | ipv6_vxlan_ipv4 | vni, inner dmac, inner dst/src ip | | ipv6_vxlan_ipv6 | vni, inner dmac, inner dst/src ip | +-----------------+-----------------------------------------------------+
--- drivers/net/ice/ice_generic_flow.c | 20 ++++++++++ drivers/net/ice/ice_generic_flow.h | 4 ++ drivers/net/ice/ice_switch_filter.c | 59 +++++++++++++++++++++++++++-- 3 files changed, 80 insertions(+), 3 deletions(-)
drivers/net/ice/ice_generic_flow.c +20 -0
@@ -375,6 +375,26 @@ enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_icmp[] = { RTE_FLOW_ITEM_TYPE_END, }; +/* IPv4 VXLAN ANY */ +enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_any[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_UDP , +RTE_FLOW_ITEM_TYPE_VXLAN , +RTE_FLOW_ITEM_TYPE_ANY , +RTE_FLOW_ITEM_TYPE_END , +}; + +/* IPv6 VXLAN ANY */ +enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_any[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV6 , +RTE_FLOW_ITEM_TYPE_UDP , +RTE_FLOW_ITEM_TYPE_VXLAN , +RTE_FLOW_ITEM_TYPE_ANY , +RTE_FLOW_ITEM_TYPE_END , +}; +/* IPv4 VXLAN MAC IPv4 */ enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4[] = {RTE_FLOW_ITEM_TYPE_ETH ,
drivers/net/ice/ice_generic_flow.h +4 -0
@@ -175,6 +175,10 @@ extern enum rte_flow_item_type pattern_eth_ipv6_icmp6[];extern enum rte_flow_item_type pattern_eth_vlan_ipv6_icmp6[];extern enum rte_flow_item_type pattern_eth_qinq_ipv6_icmp6[]; +/* IPv4/IPv6 VXLAN ANY */ +extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_any[]; +extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_any[]; +/* IPv4 VXLAN IPv4 */ extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4[];extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_udp[];
drivers/net/ice/ice_switch_filter.c +56 -3
125 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v2 13/33 common/iavf: support flushing rules and reporting DCF id
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add virtual channel opcode for DCF flushing rules. Add virtual channel event for PF reporting DCF id.
--- drivers/common/iavf/virtchnl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/common/iavf/virtchnl.h +13 -0
@@ -164,6 +164,12 @@ enum virtchnl_ops {VIRTCHNL_OP_ENABLE_QUEUES_V2 =107 ,VIRTCHNL_OP_DISABLE_QUEUES_V2 =108 ,VIRTCHNL_OP_MAP_QUEUE_VECTOR =111 , + +/** +* To reduce the risk for future combability issue, +* set VIRTCHNL_OP_DCF_RULE_FLUSH carefully by using a special value. +*/ +VIRTCHNL_OP_DCF_RULE_FLUSH =6000 , VIRTCHNL_OP_MAX, };
@@ -1424,6 +1430,12 @@ enum virtchnl_event_codes {VIRTCHNL_EVENT_RESET_IMPENDING ,VIRTCHNL_EVENT_PF_DRIVER_CLOSE ,VIRTCHNL_EVENT_DCF_VSI_MAP_UPDATE , + +/** +* To reduce the risk for future combability issue, +* set VIRTCHNL_EVENT_DCF_VSI_INFO carefully by using a special value. +*/ + VIRTCHNL_EVENT_DCF_VSI_INFO = 1000, };#define PF_EVENT_SEVERITY_INFO 0
@@ -2200,6 +2212,7 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,*/ valid_len = msglen;break ; +case VIRTCHNL_OP_DCF_RULE_FLUSH :case VIRTCHNL_OP_DCF_DISABLE :case VIRTCHNL_OP_DCF_GET_VSI_MAP :case VIRTCHNL_OP_DCF_GET_PKG_INFO :
Signature · 1 line
2.33.1
PATCH v2 14/33 net/ice/base: fix ethertype filter input set
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add destination and source MAC as the input sets to ethertype filter.
For example:
flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 type is 0x802 / end actions queue index 2 / end
This flow will result in all the matched ingress packets be forwarded to queue 2.
--- drivers/net/ice/base/ice_fdir.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ice/base/ice_fdir.c +3 -0
@@ -3935,6 +3935,9 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->ip.v6.dst_port);break ;case ICE_FLTR_PTYPE_NON_IP_L2 : +ice_pkt_insert_mac_addr (loc, input->ext_data.dst_mac); +ice_pkt_insert_mac_addr (loc +ETH_ALEN , + input->ext_data.src_mac);ice_pkt_insert_u16 (loc,ICE_MAC_ETHTYPE_OFFSET , input->ext_data.ether_type);break ;
Signature · 1 line
2.33.1
PATCH v2 15/33 net/ice/base: support IPv6 GRE UDP pattern
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add supports(trainer packet and it's offsets, definitions, pattern matching) for IPv6 GRE UDP pattern.
--- drivers/net/ice/base/ice_protocol_type.h | 1 + drivers/net/ice/base/ice_switch.c | 43 +++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_protocol_type.h +1 -0
@@ -44,6 +44,7 @@ enum ice_protocol_type {ICE_GENEVE ,ICE_VXLAN_GPE ,ICE_NVGRE , +ICE_GRE ,ICE_GTP ,ICE_PPPOE , ICE_PFCP,
drivers/net/ice/base/ice_switch.c +42 -1
68 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v2 16/33 net/ice: support IPv6 NVGRE tunnel
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add protocol definition and pattern matching for IPv6 NVGRE tunnel.
--- drivers/net/ice/ice_switch_filter.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/ice_switch_filter.c +5 -0
@@ -31,6 +31,7 @@#define ICE_PPP_IPV4_PROTO 0x0021#define ICE_PPP_IPV6_PROTO 0x0057#define ICE_IPV4_PROTO_NVGRE 0x002F +#define ICE_IPV6_PROTO_NVGRE 0x002F#define ICE_SW_PRI_BASE 6#define ICE_SW_INSET_ETHER ( \
@@ -803,6 +804,10 @@ ice_switch_parse_pattern(const struct rte_flow_item pattern[],break ; } } +if ((ipv6_spec->hdr.proto & + ipv6_mask->hdr.proto) == +ICE_IPV6_PROTO_NVGRE ) + *tun_type =ICE_SW_TUN_AND_NON_TUN ;if (ipv6_mask->hdr.proto) *input |=ICE_INSET_IPV6_NEXT_HDR ;if (ipv6_mask->hdr.hop_limits)
Signature · 1 line
2.33.1
PATCH v2 17/33 net/ice: support new pattern of IPv4
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definition and pattern entry for IPv4 pattern: MAC/VLAN/IPv4
--- drivers/net/ice/ice_switch_filter.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ice/ice_switch_filter.c +3 -0
@@ -38,6 +38,8 @@ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE)#define ICE_SW_INSET_MAC_VLAN ( \ ICE_SW_INSET_ETHER | ICE_INSET_VLAN_INNER) +#define ICE_SW_INSET_MAC_VLAN_IPV4 ( \ + ICE_SW_INSET_MAC_VLAN | ICE_SW_INSET_MAC_IPV4)#define ICE_SW_INSET_MAC_QINQ ( \ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_VLAN_INNER | \ ICE_INSET_VLAN_OUTER)
@@ -231,6 +233,7 @@ ice_pattern_match_item ice_switch_pattern_dist_list[] = { {pattern_eth_ipv4, ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_udp, ICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_tcp, ICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE, ICE_INSET_NONE}, + {pattern_eth_vlan_ipv4, ICE_SW_INSET_MAC_VLAN_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6, ICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_udp, ICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_tcp, ICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE, ICE_INSET_NONE},
Signature · 1 line
2.33.1
PATCH v2 18/33 net/ice/base: support new patterns of TCP and UDP
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Find training packets for below TCP and UDP patterns:
MAC/VLAN/IPv4/TCP
MAC/VLAN/IPv4/UDP
--- drivers/net/ice/base/ice_switch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/ice/base/ice_switch.c +12 -0
@@ -8568,6 +8568,12 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }if (tun_type ==ICE_SW_IPV4_TCP ) { +if (vlan && tcp) { + *pkt = dummy_vlan_tcp_packet; + *pkt_len =sizeof (dummy_vlan_tcp_packet); + *offsets = dummy_vlan_tcp_packet_offsets; +return ; + } *pkt = dummy_tcp_packet; *pkt_len =sizeof (dummy_tcp_packet); *offsets = dummy_tcp_packet_offsets;
@@ -8575,6 +8581,12 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }if (tun_type ==ICE_SW_IPV4_UDP ) { +if (vlan && udp) { + *pkt = dummy_vlan_udp_packet; + *pkt_len =sizeof (dummy_vlan_udp_packet); + *offsets = dummy_vlan_udp_packet_offsets; +return ; + } *pkt = dummy_udp_packet; *pkt_len =sizeof (dummy_udp_packet); *offsets = dummy_udp_packet_offsets;
Signature · 1 line
2.33.1
PATCH v2 19/33 net/ice: support new patterns of TCP and UDP
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definitions and pattern entries for below TCP and UDP patterns:
MAC/VLAN/IPv4/TCP
MAC/VLAN/IPv4/UDP
--- drivers/net/ice/ice_switch_filter.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ice/ice_switch_filter.c +6 -0
@@ -62,6 +62,10 @@ ICE_INSET_DMAC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_SRC | \ ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_TOS | \ ICE_INSET_UDP_DST_PORT | ICE_INSET_UDP_SRC_PORT) +#define ICE_SW_INSET_MAC_VLAN_IPV4_TCP ( \ + ICE_SW_INSET_MAC_VLAN | ICE_SW_INSET_MAC_IPV4_TCP) +#define ICE_SW_INSET_MAC_VLAN_IPV4_UDP ( \ + ICE_SW_INSET_MAC_VLAN | ICE_SW_INSET_MAC_IPV4_UDP)#define ICE_SW_INSET_MAC_IPV6 ( \ ICE_INSET_DMAC | ICE_INSET_IPV6_DST | ICE_INSET_IPV6_SRC | \ ICE_INSET_IPV6_TC | ICE_INSET_IPV6_HOP_LIMIT | \
@@ -234,6 +238,8 @@ ice_pattern_match_item ice_switch_pattern_dist_list[] = { {pattern_eth_ipv4_udp, ICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_tcp, ICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_vlan_ipv4, ICE_SW_INSET_MAC_VLAN_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, + {pattern_eth_vlan_ipv4_tcp, ICE_SW_INSET_MAC_VLAN_IPV4_TCP, ICE_INSET_NONE, ICE_INSET_NONE}, + {pattern_eth_vlan_ipv4_udp, ICE_SW_INSET_MAC_VLAN_IPV4_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6, ICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_udp, ICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_tcp, ICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE, ICE_INSET_NONE},
Signature · 1 line
2.33.1
PATCH v2 20/33 net/ice/base: support IPv4 GRE tunnel
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definitions, trainer packets and routine path for IPv4 GRE tunnel. Ref:
https://www.ietf.org/rfc/rfc1701.html
--- drivers/net/ice/base/ice_flex_pipe.c | 37 ++- drivers/net/ice/base/ice_flex_pipe.h | 3 +- drivers/net/ice/base/ice_protocol_type.h | 15 ++ drivers/net/ice/base/ice_switch.c | 304 ++++++++++++++++++++++- 4 files changed, 332 insertions(+), 27 deletions(-)
drivers/net/ice/base/ice_flex_pipe.c +18 -19
@@ -1851,6 +1851,7 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs,* @ids_cnt: lookup/protocol count * @bm: bitmap of field vectors to consider * @fv_list: Head of a list +* @lkup_exts: lookup elements * * Finds all the field vector entries from switch block that contain * a given protocol ID and returns a list of structures of type
@@ -1861,7 +1862,8 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs,*/ enum ice_status ice_get_sw_fv_list (struct ice_hw *hw,u8 *prot_ids,u16 ids_cnt, -ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list) +ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list, +struct ice_prot_lkup_ext *lkup_exts) {struct ice_sw_fv_list_entry *fvl;struct ice_sw_fv_list_entry *tmp;
@@ -1892,29 +1894,26 @@ ice_get_sw_fv_list(struct ice_hw *hw, u8 *prot_ids, u16 ids_cnt,if (!ice_is_bit_set (bm, (u16 )offset))continue ; -for (i =0 ; i < ids_cnt; i++) { +int found =1 ; +for (i =0 ; i < lkup_exts->n_val_words; i++) {int j; -/* This code assumes that if a switch field vector line -* has a matching protocol, then this line will contain -* the entries necessary to represent every field in -* that protocol header. -*/ for (j =0 ; j < hw->blk[ICE_BLK_SW ].es.fvw; j++) -if (fv->ew[j].prot_id == prot_ids[i]) +if (fv->ew[j].prot_id == + lkup_exts->fv_words[i].prot_id && + fv->ew[j].off == lkup_exts->fv_words[i].off)break ;if (j >= hw->blk[ICE_BLK_SW ].es.fvw) -break ; -if (i +1 == ids_cnt) { - fvl = (struct ice_sw_fv_list_entry *) -ice_malloc (hw,sizeof (*fvl)); -if (!fvl) - goto err; - fvl->fv_ptr = fv; - fvl->profile_id = offset; -LIST_ADD (&fvl->list_entry, fv_list); -break ; - } + found =0 ; + } +if (found) { + fvl = (struct ice_sw_fv_list_entry *) +ice_malloc (hw,sizeof (*fvl)); +if (!fvl) + goto err; + fvl->fv_ptr = fv; + fvl->profile_id = offset; +LIST_ADD (&fvl->list_entry, fv_list); } }while (fv);if (LIST_EMPTY (fv_list))
drivers/net/ice/base/ice_flex_pipe.h +2 -1
@@ -37,7 +37,8 @@ void ice_init_prof_result_bm(struct ice_hw *hw);enum ice_status ice_get_sw_fv_list (struct ice_hw *hw,u8 *prot_ids,u16 ids_cnt, -ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list); +ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list, +struct ice_prot_lkup_ext *lkup_exts);enum ice_status ice_pkg_buf_unreserve_section (struct ice_buf_build *bld,u16 count);u16 ice_pkg_buf_get_free_space (struct ice_buf_build *bld);
drivers/net/ice/base/ice_protocol_type.h +15 -0
@@ -67,6 +67,7 @@ enum ice_sw_tunnel_type {ICE_SW_TUN_VXLAN ,/* VXLAN matches only non-VLAN pkts */ ICE_SW_TUN_VXLAN_VLAN ,/* VXLAN matches both VLAN and non-VLAN pkts */ ICE_SW_TUN_NVGRE , +ICE_SW_TUN_GRE , ICE_SW_TUN_UDP, /* This means all "UDP" tunnel types: VXLAN-GPE, VXLAN* and GENEVE */
@@ -231,6 +232,10 @@ enum ice_prot_id {#define ICE_TUN_FLAG_VLAN_MASK 0x01#define ICE_TUN_FLAG_FV_IND 2 +#define ICE_GRE_FLAG_MDID 22 +#define ICE_GRE_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_GRE_FLAG_MDID) +#define ICE_GRE_FLAG_MASK 0x01C0 +#define ICE_PROTOCOL_MAX_ENTRIES 16/* Mapping of software defined protocol ID to hardware defined protocol ID */
@@ -371,6 +376,15 @@ struct ice_nvgre {__be32 tni_flow; }; +struct ice_gre { +__be16 flags; +__be16 protocol; +__be16 chksum; +__be16 offset; +__be32 key; +__be32 seqnum; +}; +union ice_prot_hdr {struct ice_ether_hdr eth_hdr;struct ice_ethtype_hdr ethertype;
@@ -381,6 +395,7 @@ union ice_prot_hdr {struct ice_sctp_hdr sctp_hdr;struct ice_udp_tnl_hdr tnl_hdr;struct ice_nvgre nvgre_hdr; +struct ice_gre gre_hdr;struct ice_udp_gtp_hdr gtp_hdr;struct ice_pppoe_hdr pppoe_hdr;struct ice_pfcp_hdr pfcp_hdr;
drivers/net/ice/base/ice_switch.c +297 -7
435 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v2 21/33 net/ice: support IPv4 GRE raw pattern type
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definitions, matching entries, parsers for below patterns:
ETH/IPV4/GRE/RAW/IPV4
ETH/IPV4/GRE/RAW/IPV4/UDP
ETH/IPV4/GRE/RAW/IPV4/TCP
--- drivers/net/ice/ice_generic_flow.c | 27 +++++++++ drivers/net/ice/ice_generic_flow.h | 9 +++ drivers/net/ice/ice_switch_filter.c | 90 +++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+)
drivers/net/ice/ice_generic_flow.c +27 -0
@@ -1084,6 +1084,33 @@ enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[] = {RTE_FLOW_ITEM_TYPE_ICMP6 , RTE_FLOW_ITEM_TYPE_END, }; +/* IPv4 GRE RAW IPv4 */ +enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_GRE , +RTE_FLOW_ITEM_TYPE_RAW , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_END , +}; +enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4_udp[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_GRE , +RTE_FLOW_ITEM_TYPE_RAW , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_UDP , +RTE_FLOW_ITEM_TYPE_END , +}; +enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4_tcp[] = { +RTE_FLOW_ITEM_TYPE_ETH , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_GRE , +RTE_FLOW_ITEM_TYPE_RAW , +RTE_FLOW_ITEM_TYPE_IPV4 , +RTE_FLOW_ITEM_TYPE_TCP , +RTE_FLOW_ITEM_TYPE_END , +};/*IPv4 GTPU (EH) */ enum rte_flow_item_type pattern_eth_ipv4_gtpu[] = {
drivers/net/ice/ice_generic_flow.h +9 -0
@@ -27,6 +27,7 @@#define ICE_PROT_L2TPV3OIP BIT_ULL(16)#define ICE_PROT_PFCP BIT_ULL(17)#define ICE_PROT_NAT_T_ESP BIT_ULL(18) +#define ICE_PROT_GRE BIT_ULL(19)/* field */
@@ -54,6 +55,7 @@#define ICE_PFCP_SEID BIT_ULL(42)#define ICE_PFCP_S_FIELD BIT_ULL(41)#define ICE_IP_PK_ID BIT_ULL(40) +#define ICE_RAW_PATTERN BIT_ULL(39)/* input set */
@@ -104,6 +106,8 @@ (ICE_PROT_GTPU | ICE_GTPU_TEID)#define ICE_INSET_GTPU_QFI \ (ICE_PROT_GTPU | ICE_GTPU_QFI) +#define ICE_INSET_RAW \ + (ICE_PROT_GRE | ICE_RAW_PATTERN)#define ICE_INSET_PPPOE_SESSION \ (ICE_PROT_PPPOE_S | ICE_PPPOE_SESSION)#define ICE_INSET_PPPOE_PROTO \
@@ -291,6 +295,11 @@ extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_udp[];extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_sctp[];extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[]; +/* IPv4 GRE RAW IPv4 */ +extern enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4[]; +extern enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4_udp[]; +extern enum rte_flow_item_type pattern_eth_ipv4_gre_raw_ipv4_tcp[]; +/* IPv4 GTPU (EH) */ extern enum rte_flow_item_type pattern_eth_ipv4_gtpu[];extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[];
drivers/net/ice/ice_switch_filter.c +90 -0
120 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v2 22/33 net/ice: treat unknown package as OS default package
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
In order to use custom package, unknown package should be treated as OS default package.
--- drivers/net/ice/ice_ethdev.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/ice/ice_ethdev.c +8 -5
@@ -1710,13 +1710,16 @@ ice_load_pkg_type(struct ice_hw *hw)/* store the activated package type (OS default or Comms) */ if (!strncmp ((char *)hw->active_pkg_name,ICE_OS_DEFAULT_PKG_NAME , -ICE_PKG_NAME_SIZE )) +ICE_PKG_NAME_SIZE )) { package_type =ICE_PKG_TYPE_OS_DEFAULT ; -else if (!strncmp ((char *)hw->active_pkg_name,ICE_COMMS_PKG_NAME , -ICE_PKG_NAME_SIZE )) + }else if (!strncmp ((char *)hw->active_pkg_name,ICE_COMMS_PKG_NAME , +ICE_PKG_NAME_SIZE )) { package_type =ICE_PKG_TYPE_COMMS ; -else - package_type =ICE_PKG_TYPE_UNKNOWN ; + }else { +PMD_INIT_LOG (WARNING , +"The package type is not identified, treaded as OS default type" ); + package_type =ICE_PKG_TYPE_OS_DEFAULT ; + } PMD_INIT_LOG(NOTICE, "Active package is: %d.%d.%d.%d, %s (%s VLAN mode)", hw->active_pkg_ver.major, hw->active_pkg_ver.minor,
Signature · 1 line
2.33.1
PATCH v2 23/33 net/ice/base: update Profile ID table for VXLAN
In reply to Kevin LiuFrom: Junfeng Guo <[email protected]>
Update Profile ID table for VXLAN to align with Tencent customed DDP.
--- drivers/net/ice/base/ice_switch.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/ice/base/ice_switch.h +9 -9
@@ -23,15 +23,15 @@#define ICE_PROFID_IPV4_TUN_M_IPV4_TCP 10#define ICE_PROFID_IPV4_TUN_M_IPV4_UDP 11#define ICE_PROFID_IPV4_TUN_M_IPV4_OTHER 12 -#define ICE_PROFID_IPV6_TUN_M_IPV4_TCP 16 -#define ICE_PROFID_IPV6_TUN_M_IPV4_UDP 17 -#define ICE_PROFID_IPV6_TUN_M_IPV4_OTHER 18 -#define ICE_PROFID_IPV4_TUN_M_IPV6_TCP 22 -#define ICE_PROFID_IPV4_TUN_M_IPV6_UDP 23 -#define ICE_PROFID_IPV4_TUN_M_IPV6_OTHER 24 -#define ICE_PROFID_IPV6_TUN_M_IPV6_TCP 25 -#define ICE_PROFID_IPV6_TUN_M_IPV6_UDP 26 -#define ICE_PROFID_IPV6_TUN_M_IPV6_OTHER 27 +#define ICE_PROFID_IPV6_TUN_M_IPV4_TCP 34 +#define ICE_PROFID_IPV6_TUN_M_IPV4_UDP 35 +#define ICE_PROFID_IPV6_TUN_M_IPV4_OTHER 36 +#define ICE_PROFID_IPV4_TUN_M_IPV6_TCP 40 +#define ICE_PROFID_IPV4_TUN_M_IPV6_UDP 41 +#define ICE_PROFID_IPV4_TUN_M_IPV6_OTHER 42 +#define ICE_PROFID_IPV6_TUN_M_IPV6_TCP 43 +#define ICE_PROFID_IPV6_TUN_M_IPV6_UDP 44 +#define ICE_PROFID_IPV6_TUN_M_IPV6_OTHER 45#define ICE_PROFID_PPPOE_PAY 34#define ICE_PROFID_PPPOE_IPV4_TCP 35#define ICE_PROFID_PPPOE_IPV4_UDP 36
Signature · 1 line
2.33.1
PATCH v2 24/33 net/ice/base: update Protocol ID table to match DVM DDP
In reply to Kevin LiuFrom: Junfeng Guo <[email protected]>
The ice kernel driver and DDP is working in Double VLAN Mode (DVM), but the DVM is not supported on this PMD. Thus update the SW to HW Protocol ID table for VLAN to support common switch filtering with single VLAN layer.
--- drivers/net/ice/base/ice_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_switch.c +1 -1
@@ -7098,7 +7098,7 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { { ICE_MAC_OFOS, ICE_MAC_OFOS_HW }, { ICE_MAC_IL, ICE_MAC_IL_HW }, { ICE_ETYPE_OL, ICE_ETYPE_OL_HW }, - { ICE_VLAN_OFOS, ICE_VLAN_OL_HW }, + { ICE_VLAN_OFOS, ICE_VLAN_OF_HW }, { ICE_IPV4_OFOS, ICE_IPV4_OFOS_HW }, { ICE_IPV4_IL, ICE_IPV4_IL_HW }, { ICE_IPV6_OFOS, ICE_IPV6_OFOS_HW },
Signature · 1 line
2.33.1
PATCH v2 25/33 net/ice: handle virtchnl event message without interrupt
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Currently, VF can only handle virtchnl event message by calling interrupt. It is not available in two cases:
1. If the event message comes during VF initialization before interrupt is enabled, this message will not be handled correctly.
2. Some virtchnl commands need to receive the event message and handle it with interrupt disabled.
To solve this issue, we add the virtchnl event message handling in the process of reading vitchnl messages in adminq from PF.
--- drivers/net/ice/ice_dcf.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +23 -2
@@ -63,11 +63,32 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, goto again; v_op =rte_le_to_cpu_32 (event.desc.cookie_high); -if (v_op != op) - goto again; + +if (v_op ==VIRTCHNL_OP_EVENT ) { +struct virtchnl_pf_event *vpe = + (struct virtchnl_pf_event *)event.msg_buf; +switch (vpe->event) { +case VIRTCHNL_EVENT_RESET_IMPENDING : + hw->resetting = true; +if (rsp_msglen) + *rsp_msglen =0 ; +return IAVF_SUCCESS ; +default : + goto again; + } + }else { +/* async reply msg on command issued by vf previously */ +if (v_op != op) { +PMD_DRV_LOG (WARNING , +"command mismatch, expect %u, get %u" , + op, v_op); + goto again; + } + }if (rsp_msglen !=NULL ) *rsp_msglen = event.msg_len; +return rte_le_to_cpu_32 (event.desc.cookie_low); again:
Signature · 1 line
2.33.1
PATCH v2 26/33 net/ice: add DCF request queues function
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Add a new virtchnl function to request additional queues from PF. Current default queue pairs number is 16. In order to support up to 256 queue pairs DCF port, enable this request queues function.
--- drivers/net/ice/ice_dcf.c | 98 +++++++++++++++++++++++++++++++++------ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 86 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +85 -13
@@ -257,7 +257,7 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)VIRTCHNL_VF_CAP_ADV_LINK_SPEED |VIRTCHNL_VF_CAP_DCF |VIRTCHNL_VF_OFFLOAD_VLAN_V2 |VF_BASE_MODE_OFFLOADS |VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | -VIRTCHNL_VF_OFFLOAD_QOS ; +VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES ; err =ice_dcf_send_cmd_req_no_irq (hw,VIRTCHNL_OP_GET_VF_RESOURCES , (uint8_t *)&caps,sizeof (caps));
@@ -468,18 +468,38 @@ ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw, goto ret; } -do { -if (!cmd->pending) -break ; - -rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); - }while (i++ <ICE_DCF_ARQ_MAX_RETRIES ); - -if (cmd->v_ret !=IAVF_SUCCESS ) { - err =-1 ; -PMD_DRV_LOG (ERR , -"No response (%d times) or return failure (%d) for cmd %d" , - i, cmd->v_ret, cmd->v_op); +switch (cmd->v_op) { +case VIRTCHNL_OP_REQUEST_QUEUES : + err =ice_dcf_recv_cmd_rsp_no_irq (hw, +VIRTCHNL_OP_REQUEST_QUEUES , + cmd->rsp_msgbuf, + cmd->rsp_buflen, +NULL ); +if (err !=IAVF_SUCCESS || !hw->resetting) { + err =-1 ; +PMD_DRV_LOG (ERR , +"Failed to get response of " +"VIRTCHNL_OP_REQUEST_QUEUES %d" , + err); + } +break ; +default : +/* For other virtchnl ops in running time, +* wait for the cmd done flag. +*/ +do { +if (!cmd->pending) +break ; +rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); + }while (i++ <ICE_DCF_ARQ_MAX_RETRIES ); + +if (cmd->v_ret !=IAVF_SUCCESS ) { + err =-1 ; +PMD_DRV_LOG (ERR , +"No response (%d times) or " +"return failure (%d) for cmd %d" , + i, cmd->v_ret, cmd->v_op); + } } ret:
@@ -1011,6 +1031,58 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num) +{ +struct virtchnl_vf_res_request vfres; +struct dcf_virtchnl_cmd args; +uint16_t num_queue_pairs; +int err; + +if (!(hw->vf_res->vf_cap_flags & +VIRTCHNL_VF_OFFLOAD_REQ_QUEUES )) { +PMD_DRV_LOG (ERR ,"request queues not supported" ); +return -1 ; + } + +if (num ==0 ) { +PMD_DRV_LOG (ERR ,"queue number cannot be zero" ); +return -1 ; + } + vfres.num_queue_pairs = num; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_REQUEST_QUEUES ; + + args.req_msg = (u8 *)&vfres; + args.req_msglen =sizeof (vfres); + + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + +/* +* disable interrupt to avoid the admin queue message to be read +* before iavf_read_msg_from_pf. +*/ +rte_intr_disable (hw->eth_dev->intr_handle); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +rte_intr_enable (hw->eth_dev->intr_handle); +if (err) { +PMD_DRV_LOG (ERR ,"fail to execute command OP_REQUEST_QUEUES" ); +return err; + } + +/* request additional queues failed, return available number */ + num_queue_pairs = ((struct virtchnl_vf_res_request *) + args.rsp_msgbuf)->num_queue_pairs; +PMD_DRV_LOG (ERR , +"request queues failed, only %u queues available" , + num_queue_pairs); + +return -1 ; +} +int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
drivers/net/ice/ice_dcf.h +1 -0
@@ -127,6 +127,7 @@ int ice_dcf_configure_rss_key(struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw); +int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);
Signature · 1 line
2.33.1
PATCH v2 27/33 net/ice: negotiate large VF and request more queues
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Negotiate large VF capability with PF during VF initialization. If large VF is supported and the number of queues larger than 16 is required, VF requests additional queues from PF. Mark the state that large VF is supported.
If the allocated queues number is larger than 16, the max RSS queue region cannot be 16 anymore. Add the function to query max RSS queue region from PF, use it in the RSS initialization and future filters configuration.
--- drivers/net/ice/ice_dcf.c | 34 +++++++++++++++- drivers/net/ice/ice_dcf.h | 4 ++ drivers/net/ice/ice_dcf_ethdev.c | 69 +++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 2 + 4 files changed, 106 insertions(+), 3 deletions(-)
drivers/net/ice/ice_dcf.c +33 -1
@@ -257,7 +257,8 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)VIRTCHNL_VF_CAP_ADV_LINK_SPEED |VIRTCHNL_VF_CAP_DCF |VIRTCHNL_VF_OFFLOAD_VLAN_V2 |VF_BASE_MODE_OFFLOADS |VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | -VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES ; +VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES | +VIRTCHNL_VF_LARGE_NUM_QPAIRS ; err =ice_dcf_send_cmd_req_no_irq (hw,VIRTCHNL_OP_GET_VF_RESOURCES , (uint8_t *)&caps,sizeof (caps));
@@ -1083,6 +1084,37 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)return -1 ; } +int +ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +uint16_t qregion_width; +int err; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_GET_MAX_RSS_QREGION ; + args.req_msg =NULL ; + args.req_msglen =0 ; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"Failed to execute command of " +"VIRTCHNL_OP_GET_MAX_RSS_QREGION" ); +return err; + } + + qregion_width = ((struct virtchnl_max_rss_qregion *) + args.rsp_msgbuf)->qregion_width; + hw->max_rss_qregion = (uint16_t )(1 << qregion_width); + +return 0 ; +} + +int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
drivers/net/ice/ice_dcf.h +4 -0
@@ -105,6 +105,7 @@ struct ice_dcf_hw {uint16_t msix_base;uint16_t nb_msix; +uint16_t max_rss_qregion;/* max RSS queue region supported by PF */ uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset;struct virtchnl_vlan_caps vlan_v2_caps;
@@ -114,6 +115,8 @@ struct ice_dcf_hw {uint32_t link_speed;bool resetting; +/* Indicate large VF support enabled or not */ +bool lv_enabled; }; int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,
@@ -128,6 +131,7 @@ int ice_dcf_configure_rss_lut(struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num); +int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +67 -2
99 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +2 -0
@@ -20,6 +20,8 @@#define ICE_DCF_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 +#define ICE_DCF_MAX_NUM_QUEUES_LV 256struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v2 28/33 net/ice: enable multiple queues configurations for large VF
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Since the adminq buffer size has a 4K limitation, the current virtchnl command VIRTCHNL_OP_CONFIG_VSI_QUEUES cannot send the message only once to configure up to 256 queues. In this patch, we send the messages multiple times to make sure that the buffer size is less than 4K each time.
--- drivers/net/ice/ice_dcf.c | 11 ++++++----- drivers/net/ice/ice_dcf.h | 3 ++- drivers/net/ice/ice_dcf_ethdev.c | 20 ++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 27 insertions(+), 8 deletions(-)
drivers/net/ice/ice_dcf.c +6 -5
@@ -949,7 +949,8 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw)#define IAVF_RXDID_COMMS_OVS_1 22int -ice_dcf_configure_queues (struct ice_dcf_hw *hw) +ice_dcf_configure_queues (struct ice_dcf_hw *hw, +uint16_t num_queue_pairs,uint16_t index) {struct ice_rx_queue **rxq = (struct ice_rx_queue **)hw->eth_dev->data->rx_queues;
@@ -962,16 +963,16 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)int err; size =sizeof (*vc_config) + -sizeof (vc_config->qpair[0 ]) * hw->num_queue_pairs; +sizeof (vc_config->qpair[0 ]) * num_queue_pairs; vc_config =rte_zmalloc ("cfg_queue" , size,0 );if (!vc_config)return -ENOMEM ; vc_config->vsi_id = hw->vsi_res->vsi_id; - vc_config->num_queue_pairs = hw->num_queue_pairs; + vc_config->num_queue_pairs = num_queue_pairs; -for (i =0 , vc_qp = vc_config->qpair; - i < hw->num_queue_pairs; +for (i = index, vc_qp = vc_config->qpair; + i < index + num_queue_pairs; i++, vc_qp++) { vc_qp->txq.vsi_id = hw->vsi_res->vsi_id; vc_qp->txq.queue_id = i;
drivers/net/ice/ice_dcf.h +2 -1
@@ -129,7 +129,8 @@ void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw);int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw); -int ice_dcf_configure_queues (struct ice_dcf_hw *hw); +int ice_dcf_configure_queues (struct ice_dcf_hw *hw, +uint16_t num_queue_pairs,uint16_t index);int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +18 -2
@@ -513,6 +513,8 @@ ice_dcf_dev_start(struct rte_eth_dev *dev)struct rte_intr_handle *intr_handle = dev->intr_handle;struct ice_adapter *ad = &dcf_ad->parent;struct ice_dcf_hw *hw = &dcf_ad->real_hw; +uint16_t num_queue_pairs; +uint16_t index =0 ;int ret;if (hw->resetting) {
@@ -531,6 +533,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) hw->num_queue_pairs =RTE_MAX (dev->data->nb_rx_queues, dev->data->nb_tx_queues); + num_queue_pairs = hw->num_queue_pairs; ret =ice_dcf_init_rx_queues (dev);if (ret) {
@@ -546,7 +549,20 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) } } - ret =ice_dcf_configure_queues (hw); +/* If needed, send configure queues msg multiple times to make the +* adminq buffer length smaller than the 4K limitation. +*/ +while (num_queue_pairs >ICE_DCF_CFG_Q_NUM_PER_BUF ) { +if (ice_dcf_configure_queues (hw, +ICE_DCF_CFG_Q_NUM_PER_BUF , index) !=0 ) { +PMD_DRV_LOG (ERR ,"configure queues failed" ); + goto err_queue; + } + num_queue_pairs -=ICE_DCF_CFG_Q_NUM_PER_BUF ; + index +=ICE_DCF_CFG_Q_NUM_PER_BUF ; + } + + ret =ice_dcf_configure_queues (hw, num_queue_pairs, index);if (ret) {PMD_DRV_LOG (ERR ,"Fail to config queues" );return ret;
@@ -586,7 +602,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) dev->data->dev_link.link_status =RTE_ETH_LINK_UP ; - +err_queue:return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +1 -0
@@ -22,6 +22,7 @@#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD)#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16#define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v2 29/33 net/ice: enable IRQ mapping configuration for large VF
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
The current IRQ mapping configuration only supports max 16 queues and 16 MSIX vectors. Change the queue vector mapping structure to indicate up to 256 queues. A new opcode is used to handle the case with large number of queues. To avoid adminq buffer size limitation, we support to send the virtchnl message multiple times if needed.
--- drivers/net/ice/ice_dcf.c | 50 +++++++++++++++++++++++++++---- drivers/net/ice/ice_dcf.h | 10 ++++++- drivers/net/ice/ice_dcf_ethdev.c | 51 +++++++++++++++++++++++++++----- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 99 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +45 -5
@@ -1115,7 +1115,6 @@ ice_dcf_get_max_rss_queue_region(struct ice_dcf_hw *hw)return 0 ; } -int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
@@ -1132,13 +1131,14 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)return -ENOMEM ; map_info->num_vectors = hw->nb_msix; -for (i =0 ; i < hw->nb_msix; i++) { - vecmap = &map_info->vecmap[i]; +for (i =0 ; i < hw->eth_dev->data->nb_rx_queues; i++) { + vecmap = + &map_info->vecmap[hw->qv_map[i].vector_id - hw->msix_base]; vecmap->vsi_id = hw->vsi_res->vsi_id; vecmap->rxitr_idx =0 ; - vecmap->vector_id = hw->msix_base + i; + vecmap->vector_id = hw->qv_map[i].vector_id; vecmap->txq_map =0 ; - vecmap->rxq_map = hw->rxq_map[hw->msix_base + i]; + vecmap->rxq_map |=1 << hw->qv_map[i].queue_id; }memset (&args,0 ,sizeof (args));
@@ -1154,6 +1154,46 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw, +uint16_t num,uint16_t index) +{ +struct virtchnl_queue_vector_maps *map_info; +struct virtchnl_queue_vector *qv_maps; +struct dcf_virtchnl_cmd args; +int len, i, err; +int count =0 ; + + len =sizeof (struct virtchnl_queue_vector_maps ) + +sizeof (struct virtchnl_queue_vector ) * (num -1 ); + + map_info =rte_zmalloc ("map_info" , len,0 ); +if (!map_info) +return -ENOMEM ; + + map_info->vport_id = hw->vsi_res->vsi_id; + map_info->num_qv_maps = num; +for (i = index; i < index + map_info->num_qv_maps; i++) { + qv_maps = &map_info->qv_maps[count++]; + qv_maps->itr_idx =VIRTCHNL_ITR_IDX_0 ; + qv_maps->queue_type =VIRTCHNL_QUEUE_TYPE_RX ; + qv_maps->queue_id = hw->qv_map[i].queue_id; + qv_maps->vector_id = hw->qv_map[i].vector_id; + } + + args.v_op =VIRTCHNL_OP_MAP_QUEUE_VECTOR ; + args.req_msg = (u8 *)map_info; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.req_msglen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command OP_MAP_QUEUE_VECTOR" ); + +rte_free (map_info); +return err; +} +int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on) {
drivers/net/ice/ice_dcf.h +9 -1
@@ -74,6 +74,11 @@ struct ice_dcf_tm_conf {bool committed; }; +struct ice_dcf_qv_map { +uint16_t queue_id; +uint16_t vector_id; +}; +struct ice_dcf_hw {struct iavf_hw avf;
@@ -106,7 +111,8 @@ struct ice_dcf_hw {uint16_t msix_base;uint16_t nb_msix;uint16_t max_rss_qregion;/* max RSS queue region supported by PF */ -uint16_t rxq_map[16 ]; + +struct ice_dcf_qv_map *qv_map;/* queue vector mapping */ struct virtchnl_eth_stats eth_stats_offset;struct virtchnl_vlan_caps vlan_v2_caps;
@@ -134,6 +140,8 @@ int ice_dcf_configure_queues(struct ice_dcf_hw *hw,int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw); +int ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw, +uint16_t num,uint16_t index);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw); int ice_dcf_query_stats(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_ethdev.c +44 -7
94 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +1 -0
@@ -23,6 +23,7 @@#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16#define ICE_DCF_MAX_NUM_QUEUES_LV 256#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 +#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v2 30/33 net/ice: add enable/disable queues for DCF large VF
In reply to Kevin LiuThe current virtchnl structure for enable/disable queues only supports max 32 queue pairs. Use a new opcode and structure to indicate up to 256 queue pairs, in order to enable/disable queues in large VF case.
--- drivers/net/ice/ice_dcf.c | 99 +++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf.h | 5 ++ drivers/net/ice/ice_dcf_ethdev.c | 26 +++++++-- drivers/net/ice/ice_dcf_ethdev.h | 8 +-- 4 files changed, 125 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +96 -3
@@ -90,7 +90,6 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, *rsp_msglen = event.msg_len;return rte_le_to_cpu_32 (event.desc.cookie_low); - again:rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); }while (i++ <ICE_DCF_ARQ_MAX_RETRIES );
@@ -896,7 +895,7 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw) {struct rte_eth_dev *dev = hw->eth_dev;struct rte_eth_rss_conf *rss_conf; -uint8_t i, j, nb_q; +uint16_t i, j, nb_q;int ret; rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
@@ -1075,6 +1074,12 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)return err; } +/* request queues succeeded, vf is resetting */ +if (hw->resetting) { +PMD_DRV_LOG (INFO ,"vf is resetting" ); +return 0 ; + } +/* request additional queues failed, return available number */ num_queue_pairs = ((struct virtchnl_vf_res_request *) args.rsp_msgbuf)->num_queue_pairs;
@@ -1185,7 +1190,8 @@ ice_dcf_config_irq_map_lv(struct ice_dcf_hw *hw, args.req_msg = (u8 *)map_info; args.req_msglen = len; args.rsp_msgbuf = hw->arq_buf; - args.req_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; err =ice_dcf_execute_virtchnl_cmd (hw, &args);if (err)PMD_DRV_LOG (ERR ,"fail to execute command OP_MAP_QUEUE_VECTOR" );
@@ -1225,6 +1231,50 @@ ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on)return err; } +int +ice_dcf_switch_queue_lv (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on) +{ +struct virtchnl_del_ena_dis_queues *queue_select; +struct virtchnl_queue_chunk *queue_chunk; +struct dcf_virtchnl_cmd args; +int err, len; + + len =sizeof (struct virtchnl_del_ena_dis_queues ); + queue_select =rte_zmalloc ("queue_select" , len,0 ); +if (!queue_select) +return -ENOMEM ; + + queue_chunk = queue_select->chunks.chunks; + queue_select->chunks.num_chunks =1 ; + queue_select->vport_id = hw->vsi_res->vsi_id; + +if (rx) { + queue_chunk->type =VIRTCHNL_QUEUE_TYPE_RX ; + queue_chunk->start_queue_id = qid; + queue_chunk->num_queues =1 ; + }else { + queue_chunk->type =VIRTCHNL_QUEUE_TYPE_TX ; + queue_chunk->start_queue_id = qid; + queue_chunk->num_queues =1 ; + } + +if (on) + args.v_op =VIRTCHNL_OP_ENABLE_QUEUES_V2 ; +else + args.v_op =VIRTCHNL_OP_DISABLE_QUEUES_V2 ; + args.req_msg = (u8 *)queue_select; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"Failed to execute command of %s" , + on ?"OP_ENABLE_QUEUES_V2" :"OP_DISABLE_QUEUES_V2" ); +rte_free (queue_select); +return err; +} +int ice_dcf_disable_queues (struct ice_dcf_hw *hw) {
@@ -1254,6 +1304,49 @@ ice_dcf_disable_queues(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_disable_queues_lv (struct ice_dcf_hw *hw) +{ +struct virtchnl_del_ena_dis_queues *queue_select; +struct virtchnl_queue_chunk *queue_chunk; +struct dcf_virtchnl_cmd args; +int err, len; + + len =sizeof (struct virtchnl_del_ena_dis_queues ) + +sizeof (struct virtchnl_queue_chunk ) * + (ICE_DCF_RXTX_QUEUE_CHUNKS_NUM -1 ); + queue_select =rte_zmalloc ("queue_select" , len,0 ); +if (!queue_select) +return -ENOMEM ; + + queue_chunk = queue_select->chunks.chunks; + queue_select->chunks.num_chunks =ICE_DCF_RXTX_QUEUE_CHUNKS_NUM ; + queue_select->vport_id = hw->vsi_res->vsi_id; + + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].type =VIRTCHNL_QUEUE_TYPE_TX ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].start_queue_id =0 ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].num_queues = + hw->eth_dev->data->nb_tx_queues; + + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].type =VIRTCHNL_QUEUE_TYPE_RX ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].start_queue_id =0 ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].num_queues = + hw->eth_dev->data->nb_rx_queues; + + args.v_op =VIRTCHNL_OP_DISABLE_QUEUES_V2 ; + args.req_msg = (u8 *)queue_select; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_QUEUES_V2" ); +rte_free (queue_select); +return err; +} +int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats)
drivers/net/ice/ice_dcf.h +5 -0
@@ -15,6 +15,8 @@#include "base/ice_type.h" #include "ice_logs.h" +#define ICE_DCF_RXTX_QUEUE_CHUNKS_NUM 2 +struct dcf_virtchnl_cmd {TAILQ_ENTRY (dcf_virtchnl_cmd) next;
@@ -143,7 +145,10 @@ int ice_dcf_config_irq_map(struct ice_dcf_hw *hw);int ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw,uint16_t num,uint16_t index);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on); +int ice_dcf_switch_queue_lv (struct ice_dcf_hw *hw, +uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw); +int ice_dcf_disable_queues_lv (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_ethdev.c +20 -6
@@ -317,6 +317,7 @@ static int ice_dcf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) {struct ice_dcf_adapter *ad = dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &ad->real_hw;struct iavf_hw *hw = &ad->real_hw.avf;struct ice_rx_queue *rxq;int err =0 ;
@@ -339,7 +340,11 @@ ice_dcf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)IAVF_WRITE_FLUSH (hw);/* Ready to switch the queue on */ - err =ice_dcf_switch_queue (&ad->real_hw, rx_queue_id, true, true); +if (!dcf_hw->lv_enabled) + err =ice_dcf_switch_queue (dcf_hw, rx_queue_id, true, true); +else + err =ice_dcf_switch_queue_lv (dcf_hw, rx_queue_id, true, true); +if (err) {PMD_DRV_LOG (ERR ,"Failed to switch RX queue %u on" , rx_queue_id);
@@ -448,6 +453,7 @@ static int ice_dcf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) {struct ice_dcf_adapter *ad = dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &ad->real_hw;struct iavf_hw *hw = &ad->real_hw.avf;struct ice_tx_queue *txq;int err =0 ;
@@ -463,7 +469,10 @@ ice_dcf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)IAVF_WRITE_FLUSH (hw);/* Ready to switch the queue on */ - err =ice_dcf_switch_queue (&ad->real_hw, tx_queue_id, false, true); +if (!dcf_hw->lv_enabled) + err =ice_dcf_switch_queue (dcf_hw, tx_queue_id, false, true); +else + err =ice_dcf_switch_queue_lv (dcf_hw, tx_queue_id, false, true);if (err) { PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on",
@@ -650,12 +659,17 @@ ice_dcf_stop_queues(struct rte_eth_dev *dev)struct ice_dcf_hw *hw = &ad->real_hw;struct ice_rx_queue *rxq;struct ice_tx_queue *txq; -int ret, i; +int i;/* Stop All queues */ - ret =ice_dcf_disable_queues (hw); -if (ret) -PMD_DRV_LOG (WARNING ,"Fail to stop queues" ); +if (!hw->lv_enabled) { +if (ice_dcf_disable_queues (hw)) +PMD_DRV_LOG (WARNING ,"Fail to stop queues" ); + }else { +if (ice_dcf_disable_queues_lv (hw)) +PMD_DRV_LOG (WARNING , +"Fail to stop queues for large VF" ); + }for (i =0 ; i < dev->data->nb_tx_queues; i++) { txq = dev->data->tx_queues[i];
drivers/net/ice/ice_dcf_ethdev.h +4 -4
@@ -20,10 +20,10 @@#define ICE_DCF_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) -#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 -#define ICE_DCF_MAX_NUM_QUEUES_LV 256 -#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 -#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128 +#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 +#define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 +#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v2 31/33 net/ice: fix DCF ACL flow engine
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
ACL is not a necessary feature for DCF, it may not be supported by the ice kernel driver, so in this patch the program does not return the ACL initiation fails to high level functions, as substitute it prints some error logs, cleans the related resources and unregisters the ACL engine.
--- drivers/net/ice/ice_acl_filter.c | 20 ++++++++++++++---- drivers/net/ice/ice_generic_flow.c | 34 +++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 12 deletions(-)
drivers/net/ice/ice_acl_filter.c +16 -4
@@ -56,6 +56,8 @@ ice_pattern_match_item ice_acl_pattern[] = { {pattern_eth_ipv4_sctp, ICE_ACL_INSET_ETH_IPV4_SCTP, ICE_INSET_NONE, ICE_INSET_NONE}, }; +static void ice_acl_prof_free (struct ice_hw *hw); +static int ice_acl_prof_alloc (struct ice_hw *hw) {
@@ -1007,17 +1009,27 @@ ice_acl_init(struct ice_adapter *ad) ret =ice_acl_setup (pf);if (ret) -return ret; + goto deinit_acl; ret =ice_acl_bitmap_init (pf);if (ret) -return ret; + goto deinit_acl; ret =ice_acl_prof_init (pf);if (ret) -return ret; + goto deinit_acl; -return ice_register_parser (parser, ad); + ret =ice_register_parser (parser, ad); +if (ret) + goto deinit_acl; + +return 0 ; + +deinit_acl: +ice_deinit_acl (pf); +ice_acl_prof_free (hw); +PMD_DRV_LOG (ERR ,"ACL init failed, may not supported!" ); +return ret; } static void
drivers/net/ice/ice_generic_flow.c +26 -8
@@ -1864,6 +1864,12 @@ ice_register_flow_engine(struct ice_flow_engine *engine)TAILQ_INSERT_TAIL (&engine_list, engine, node); } +static void +ice_unregister_flow_engine (struct ice_flow_engine *engine) +{ +TAILQ_REMOVE (&engine_list, engine, node); +} +int ice_flow_init (struct ice_adapter *ad) {
@@ -1887,9 +1893,18 @@ ice_flow_init(struct ice_adapter *ad) ret = engine->init (ad);if (ret) { -PMD_INIT_LOG (ERR ,"Failed to initialize engine %d" , - engine->type); -return ret; +/** +* ACL may not supported in kernel driver, +* so just unregister the engine. +*/ +if (engine->type ==ICE_FLOW_ENGINE_ACL ) { +ice_unregister_flow_engine (engine); + }else { +PMD_INIT_LOG (ERR , +"Failed to initialize engine %d" , + engine->type); +return ret; + } } }return 0 ;
@@ -1976,7 +1991,7 @@ ice_register_parser(struct ice_flow_parser *parser, list =ice_get_parser_list (parser, ad);if (list ==NULL ) -return -EINVAL ; + goto err;if (ad->devargs.pipe_mode_support) {TAILQ_INSERT_TAIL (list, parser_node, node);
@@ -1988,7 +2003,7 @@ ice_register_parser(struct ice_flow_parser *parser, ICE_FLOW_ENGINE_ACL) {TAILQ_INSERT_AFTER (list, existing_node, parser_node, node); - goto DONE; +return 0 ; } }TAILQ_INSERT_HEAD (list, parser_node, node);
@@ -1999,7 +2014,7 @@ ice_register_parser(struct ice_flow_parser *parser, ICE_FLOW_ENGINE_SWITCH) {TAILQ_INSERT_AFTER (list, existing_node, parser_node, node); - goto DONE; +return 0 ; } }TAILQ_INSERT_HEAD (list, parser_node, node);
@@ -2008,11 +2023,14 @@ ice_register_parser(struct ice_flow_parser *parser, }else if (parser->engine->type ==ICE_FLOW_ENGINE_ACL ) {TAILQ_INSERT_HEAD (list, parser_node, node); }else { -return -EINVAL ; + goto err; } } -DONE:return 0 ; +err: +rte_free (parser_node); +PMD_DRV_LOG (ERR ,"%s failed." , __func__); +return -EINVAL ; }void
Signature · 1 line
2.33.1
PATCH v2 32/33 testpmd: force flow flush
In reply to Kevin LiuFrom: Qi Zhang <[email protected]>
For mdcf, rte_flow_flush is still need to be invoked even there are no flows be created in current instance.
--- app/test-pmd/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
app/test-pmd/config.c +3 -3
@@ -2923,15 +2923,15 @@ port_flow_flush(portid_t port_id) port = &ports[port_id]; -if (port->flow_list ==NULL ) -return ret; -/* Poisoning to make sure PMDs update it in case of error. */ memset (&error,0x44 ,sizeof (error));if (rte_flow_flush (port_id, &error)) {port_flow_complain (&error); } +if (port->flow_list ==NULL ) +return ret; +while (port->flow_list) {struct port_flow *pf = port->flow_list->next;
Signature · 1 line
2.33.1
PATCH v2 33/33 net/ice: fix DCF reset
In reply to Kevin LiuAfter the PF triggers the VF reset, before the VF PMD can perform any operations on the hardware, it must reinitialize the all resources.
This patch adds a flag to indicate whether the VF has been reset by PF, and update the DCF resetting operations according to this flag.
--- drivers/net/ice/base/ice_common.c | 4 +++- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf_ethdev.c | 17 ++++++++++++++++- drivers/net/ice/ice_dcf_parent.c | 3 +++ 4 files changed, 23 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_common.c +3 -1
@@ -755,6 +755,7 @@ enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) status =ice_init_def_sw_recp (hw, &hw->switch_info->recp_list);if (status) {ice_free (hw, hw->switch_info); + hw->switch_info =NULL ;return status; }return ICE_SUCCESS ;
@@ -823,7 +824,6 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw) }ice_rm_sw_replay_rule_info (hw, sw);ice_free (hw, sw->recp_list); -ice_free (hw, sw); }/**
@@ -833,6 +833,8 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw)void ice_cleanup_fltr_mgmt_struct (struct ice_hw *hw) {ice_cleanup_fltr_mgmt_single (hw, hw->switch_info); +ice_free (hw, hw->switch_info); + hw->switch_info =NULL ; }/**
drivers/net/ice/ice_dcf.c +1 -1
@@ -1429,7 +1429,7 @@ ice_dcf_cap_reset(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)int ret;struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;ice_dcf_disable_irq0 (hw);rte_intr_disable (intr_handle);
drivers/net/ice/ice_dcf_ethdev.c +16 -1
@@ -1004,6 +1004,15 @@ dcf_add_del_mc_addr_list(struct ice_dcf_hw *hw,uint32_t i;int len, err =0 ; +if (hw->resetting) { +if (!add) +return 0 ; + +PMD_DRV_LOG (ERR , +"fail to add multicast MACs for VF resetting" ); +return -EIO ; + } + len =sizeof (struct virtchnl_ether_addr_list ); len +=sizeof (struct virtchnl_ether_addr ) * mc_addrs_num;
@@ -1642,7 +1651,13 @@ ice_dcf_dev_close(struct rte_eth_dev *dev)if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ; - (void )ice_dcf_dev_stop (dev); +if (adapter->parent.pf.adapter_stopped) + (void )ice_dcf_dev_stop (dev); + +if (adapter->real_hw.resetting) { +ice_dcf_uninit_hw (dev, &adapter->real_hw); +ice_dcf_init_hw (dev, &adapter->real_hw); + }ice_free_queues (dev);
drivers/net/ice/ice_dcf_parent.c +3 -0
@@ -240,6 +240,9 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,case VIRTCHNL_EVENT_RESET_IMPENDING :PMD_DRV_LOG (DEBUG ,"VIRTCHNL_EVENT_RESET_IMPENDING event" ); dcf_hw->resetting = true; +rte_eth_dev_callback_process (dcf_hw->eth_dev, +RTE_ETH_EVENT_INTR_RESET , +NULL );break ;case VIRTCHNL_EVENT_LINK_CHANGE :PMD_DRV_LOG (DEBUG ,"VIRTCHNL_EVENT_LINK_CHANGE event" );
Signature · 1 line
2.33.1
v3 cover support full function of DCF
In reply to Kevin Liuv3:
* remove patch:
1.net/ice/base: add VXLAN support for switch filter 2.net/ice: add VXLAN support for switch filter 3.common/iavf: support flushing rules and reporting DCF id 4.net/ice/base: fix ethertype filter input set 5.net/ice/base: support IPv6 GRE UDP pattern 6.net/ice/base: support new patterns of TCP and UDP 7.net/ice: support new patterns of TCP and UDP 8.net/ice/base: support IPv4 GRE tunnel 9.net/ice: support IPv4 GRE raw pattern type 10.net/ice/base: update Profile ID table for VXLAN 11.net/ice/base: update Protocol ID table to match DVM DDP
v2:
* remove patch:
1.net/iavf: support checking if device is an MDCF instance 2.net/ice: support MDCF(multi-DCF) instance 3.net/ice/base: support custom DDP buildin recipe 4.net/ice: support buildin recipe configuration 5.net/ice/base: support custom ddp package version 6.net/ice: disable ACL function for MDCF instance
Alvin Zhang (7):
net/ice: support dcf promisc configuration net/ice: support dcf VLAN filter and offload configuration net/ice: support DCF new VLAN capabilities net/ice: support IPv6 NVGRE tunnel
net/ice: support new pattern of IPv4
net/ice: treat unknown package as OS default package net/ice: fix DCF ACL flow engine
Dapeng Yu (1):
net/ice: enable CVL DCF device reset API
Jie Wang (2):
net/ice: add ops MTU-SET to dcf
net/ice: add ops dev-supported-ptypes-get to dcf
Kevin Liu (3):
net/ice: support dcf MAC configuration net/ice: add enable/disable queues for DCF large VF net/ice: fix DCF reset
Qi Zhang (1):
testpmd: force flow flush
Robin Zhang (1):
net/ice: cleanup Tx buffers
Steve Yang (7):
net/ice: enable RSS RETA ops for DCF hardware net/ice: enable RSS HASH ops for DCF hardware net/ice: handle virtchnl event message without interrupt net/ice: add DCF request queues function
net/ice: negotiate large VF and request more queues net/ice: enable multiple queues configurations for large VF net/ice: enable IRQ mapping configuration for large VF
app/test-pmd/config.c | 6 +- drivers/net/ice/base/ice_common.c | 4 +- drivers/net/ice/ice_acl_filter.c | 20 +- drivers/net/ice/ice_dcf.c | 375 ++++++++++- drivers/net/ice/ice_dcf.h | 31 +- drivers/net/ice/ice_dcf_ethdev.c | 925 ++++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 14 + drivers/net/ice/ice_dcf_parent.c | 3 + drivers/net/ice/ice_ethdev.c | 13 +- drivers/net/ice/ice_generic_flow.c | 34 +- drivers/net/ice/ice_switch_filter.c | 8 + 11 files changed, 1328 insertions(+), 105 deletions(-)
Signature · 1 line
2.33.1
PATCH v3 1/22 net/ice: enable RSS RETA ops for DCF hardware
From: Steve Yang <[email protected]>
RSS RETA should be updated and queried by application, Add related ops ('.reta_update', '.reta_query') for DCF.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -790,7 +790,7 @@ ice_dcf_configure_rss_key(struct ice_dcf_hw *hw)return err; } -static int +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw) {struct virtchnl_rss_lut *rss_lut;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +77 -0
89 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v3 2/22 net/ice: enable RSS HASH ops for DCF hardware
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
RSS HASH should be updated and queried by application, Add related ops ('.rss_hash_update', '.rss_hash_conf_get') for DCF.
Because DCF doesn't support configure RSS HASH, only HASH key can be updated within ops '.rss_hash_update'.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 51 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -758,7 +758,7 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw) hw->ets_config =NULL ; } -static int +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw) {struct virtchnl_rss_key *rss_key;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +51 -0
63 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v3 3/22 net/ice: cleanup Tx buffers
In reply to Kevin LiuFrom: Robin Zhang <[email protected]>
Add support for ops rte_eth_tx_done_cleanup in dcf
--- drivers/net/ice/ice_dcf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/ice_dcf_ethdev.c +1 -0
@@ -1235,6 +1235,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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, }; static int
Signature · 1 line
2.33.1
PATCH v3 4/22 net/ice: add ops MTU-SET to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "mtu_set" to dcf, and it can configure the port mtu through cmdline.
--- drivers/net/ice/ice_dcf_ethdev.c | 14 ++++++++++++++ drivers/net/ice/ice_dcf_ethdev.h | 6 ++++++ 2 files changed, 20 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +14 -0
@@ -1081,6 +1081,19 @@ ice_dcf_link_update(struct rte_eth_dev *dev,return rte_eth_linkstatus_set (dev, &new_link); } +static int +ice_dcf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) +{ +/* mtu setting is forbidden if port is start */ +if (dev->data->dev_started !=0 ) { +PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , + dev->data->port_id); +return -EBUSY ; + } + +return 0 ; +} +bool ice_dcf_adminq_need_retry (struct ice_adapter *ad) {
@@ -1236,6 +1249,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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
drivers/net/ice/ice_dcf_ethdev.h +6 -0
@@ -15,6 +15,12 @@#define ICE_DCF_MAX_RINGS 1 +#define ICE_DCF_FRAME_SIZE_MAX 9728 +#define ICE_DCF_VLAN_TAG_SIZE 4 +#define ICE_DCF_ETH_OVERHEAD \ + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2) +#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +struct ice_dcf_queue {uint64_t dummy; };
Signature · 1 line
2.33.1
PATCH v3 5/22 net/ice: add ops dev-supported-ptypes-get to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "dev_supported_ptypes_get" to dcf, that dcf pmd can get ptypes through the new API.
--- drivers/net/ice/ice_dcf_ethdev.c | 80 +++++++++++++++++++------------- 1 file changed, 49 insertions(+), 31 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +49 -31
@@ -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
Signature · 1 line
2.33.1
PATCH v3 6/22 net/ice: support dcf promisc configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Support configuration of unicast and multicast promisc on dcf.
--- drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 3 ++ 2 files changed, 76 insertions(+), 4 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +73 -4
@@ -727,27 +727,95 @@ ice_dcf_dev_info_get(struct rte_eth_dev *dev, }static int -ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +dcf_config_promisc (struct ice_dcf_adapter *adapter, +bool enable_unicast, +bool enable_multicast) { +struct ice_dcf_hw *hw = &adapter->real_hw; +struct virtchnl_promisc_info promisc; +struct dcf_virtchnl_cmd args; +int err; + + promisc.flags =0 ; + promisc.vsi_id = hw->vsi_res->vsi_id; + +if (enable_unicast) + promisc.flags |=FLAG_VF_UNICAST_PROMISC ; + +if (enable_multicast) + promisc.flags |=FLAG_VF_MULTICAST_PROMISC ; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE ; + args.req_msg = (uint8_t *)&promisc; + args.req_msglen =sizeof (promisc); + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"fail to execute command VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE" ); +return err; + } + + adapter->promisc_unicast_enabled = enable_unicast; + adapter->promisc_multicast_enabled = enable_multicast;return 0 ; } +static int +ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, true, + adapter->promisc_multicast_enabled); +} +static int ice_dcf_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, false, + adapter->promisc_multicast_enabled); }static int ice_dcf_dev_allmulticast_enable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + true); }static int ice_dcf_dev_allmulticast_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + false); } static int
@@ -1299,6 +1367,7 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev)return -1 ; } +dcf_config_promisc (adapter, false, false);return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +3 -0
@@ -33,6 +33,9 @@ struct ice_dcf_adapter {struct ice_adapter parent;/* Must be first */ struct ice_dcf_hw real_hw; +bool promisc_unicast_enabled; +bool promisc_multicast_enabled; +int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH v3 7/22 net/ice: support dcf MAC configuration
In reply to Kevin LiuBelow PMD ops are supported in this patch:
.mac_addr_add = dcf_dev_add_mac_addr
.mac_addr_remove = dcf_dev_del_mac_addr
.set_mc_addr_list = dcf_set_mc_addr_list
.mac_addr_set = dcf_dev_set_default_mac_addr--- drivers/net/ice/ice_dcf.c | 9 +- drivers/net/ice/ice_dcf.h | 4 +- drivers/net/ice/ice_dcf_ethdev.c | 218 ++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 5 +- 4 files changed, 226 insertions(+), 10 deletions(-)
drivers/net/ice/ice_dcf.c +5 -4
@@ -1089,10 +1089,11 @@ ice_dcf_query_stats(struct ice_dcf_hw *hw, }int -ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add) +ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr, +bool add,uint8_t type) {struct virtchnl_ether_addr_list *list; -struct rte_ether_addr *addr;struct dcf_virtchnl_cmd args;int len, err =0 ;
@@ -1105,7 +1106,6 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add) } len =sizeof (struct virtchnl_ether_addr_list ); - addr = hw->eth_dev->data->mac_addrs; len +=sizeof (struct virtchnl_ether_addr ); list =rte_zmalloc (NULL , len,0 );
@@ -1116,9 +1116,10 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add)rte_memcpy (list->list[0 ].addr, addr->addr_bytes,sizeof (addr->addr_bytes)); +PMD_DRV_LOG (DEBUG ,"add/rm mac:" RTE_ETHER_ADDR_PRT_FMT ,RTE_ETHER_ADDR_BYTES (addr)); - + list->list[0 ].type = type; list->vsi_id = hw->vsi_res->vsi_id; list->num_elements =1 ;
drivers/net/ice/ice_dcf.h +3 -1
@@ -131,7 +131,9 @@ int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); -int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add); +int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr,bool add, +uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);
drivers/net/ice/ice_dcf_ethdev.c +215 -3
259 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +3 -2
@@ -14,7 +14,7 @@#include "ice_dcf.h" #define ICE_DCF_MAX_RINGS 1 - +#define DCF_NUM_MACADDR_MAX 64#define ICE_DCF_FRAME_SIZE_MAX 9728#define ICE_DCF_VLAN_TAG_SIZE 4#define ICE_DCF_ETH_OVERHEAD \
@@ -35,7 +35,8 @@ struct ice_dcf_adapter {bool promisc_unicast_enabled;bool promisc_multicast_enabled; - +uint32_t mc_addrs_num; +struct rte_ether_addr mc_addrs[DCF_NUM_MACADDR_MAX ];int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH v3 8/22 net/ice: support dcf VLAN filter and offload configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Below PMD ops are supported in this patch:
.vlan_filter_set = dcf_dev_vlan_filter_set
.vlan_offload_set = dcf_dev_vlan_offload_set
--- drivers/net/ice/ice_dcf_ethdev.c | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +101 -0
@@ -1026,6 +1026,105 @@ dcf_dev_set_default_mac_addr(struct rte_eth_dev *dev,return 0 ; } +static int +dcf_add_del_vlan (struct ice_dcf_hw *hw,uint16_t vlanid,bool add) +{ +struct virtchnl_vlan_filter_list *vlan_list; +uint8_t cmd_buffer[sizeof (struct virtchnl_vlan_filter_list ) + +sizeof (uint16_t )]; +struct dcf_virtchnl_cmd args; +int err; + + vlan_list = (struct virtchnl_vlan_filter_list *)cmd_buffer; + vlan_list->vsi_id = hw->vsi_res->vsi_id; + vlan_list->num_elements =1 ; + vlan_list->vlan_id[0 ] = vlanid; + +memset (&args,0 ,sizeof (args)); + args.v_op = add ?VIRTCHNL_OP_ADD_VLAN :VIRTCHNL_OP_DEL_VLAN ; + args.req_msg = cmd_buffer; + args.req_msglen =sizeof (cmd_buffer); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command %s" , + add ?"OP_ADD_VLAN" :"OP_DEL_VLAN" ); + +return err; +} + +static int +dcf_enable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_ENABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_ENABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_disable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_DISABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_dev_vlan_filter_set (struct rte_eth_dev *dev,uint16_t vlan_id,int on) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + + err =dcf_add_del_vlan (hw, vlan_id, on); +if (err) +return -EIO ; +return 0 ; +} + +static int +dcf_dev_vlan_offload_set (struct rte_eth_dev *dev,int mask) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +struct rte_eth_conf *dev_conf = &dev->data->dev_conf; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + +/* Vlan stripping setting */ +if (mask &RTE_ETH_VLAN_STRIP_MASK ) { +/* Enable or disable VLAN stripping */ +if (dev_conf->rxmode.offloads &RTE_ETH_RX_OFFLOAD_VLAN_STRIP ) + err =dcf_enable_vlan_strip (hw); +else + err =dcf_disable_vlan_strip (hw); + +if (err) +return -EIO ; + } +return 0 ; +} +static int ice_dcf_dev_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops)
@@ -1538,6 +1637,8 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .mac_addr_remove = dcf_dev_del_mac_addr, .set_mc_addr_list = dcf_set_mc_addr_list, .mac_addr_set = dcf_dev_set_default_mac_addr, + .vlan_filter_set = dcf_dev_vlan_filter_set, + .vlan_offload_set = dcf_dev_vlan_offload_set, .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,
Signature · 1 line
2.33.1
PATCH v3 9/22 net/ice: support DCF new VLAN capabilities
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
The new VLAN virtchnl opcodes introduce new capabilities like VLAN filtering, stripping and insertion.
The DCF needs to query the VLAN capabilities based on current device configuration firstly.
DCF is able to configure inner VLAN filter when port VLAN is enabled base on negotiation; and DCF is able to configure outer VLAN (0x8100) if port VLAN is disabled to be compatible with legacy mode.
When port VLAN is updated by DCF, the DCF needs to reset to query the new VLAN capabilities.
--- drivers/net/ice/ice_dcf.c | 27 +++++ drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 171 ++++++++++++++++++++++++++++--- 3 files changed, 182 insertions(+), 17 deletions(-)
drivers/net/ice/ice_dcf.c +27 -0
@@ -587,6 +587,29 @@ ice_dcf_get_supported_rxdid(struct ice_dcf_hw *hw)return 0 ; } +static int +dcf_get_vlan_offload_caps_v2 (struct ice_dcf_hw *hw) +{ +struct virtchnl_vlan_caps vlan_v2_caps; +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS ; + args.rsp_msgbuf = (uint8_t *)&vlan_v2_caps; + args.rsp_buflen =sizeof (vlan_v2_caps); + + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) { +PMD_DRV_LOG (ERR , +"Failed to execute command of VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS" ); +return ret; + } + +rte_memcpy (&hw->vlan_v2_caps, &vlan_v2_caps,sizeof (vlan_v2_caps)); +return 0 ; +} +int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw) {
@@ -701,6 +724,10 @@ ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)rte_intr_enable (pci_dev->intr_handle);ice_dcf_enable_irq0 (hw); +if ((hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN_V2 ) && +dcf_get_vlan_offload_caps_v2 (hw)) + goto err_rss; +return 0 ; err_rss:
drivers/net/ice/ice_dcf.h +1 -0
@@ -107,6 +107,7 @@ struct ice_dcf_hw {uint16_t nb_msix;uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset; +struct virtchnl_vlan_caps vlan_v2_caps;/* Link status */ bool link_up;
drivers/net/ice/ice_dcf_ethdev.c +154 -17
196 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v3 10/22 net/ice: enable CVL DCF device reset API
In reply to Kevin LiuFrom: Dapeng Yu <[email protected]>
Enable CVL DCF device reset API.
--- drivers/net/ice/ice_dcf.c | 24 ++++++++++++++++++++++++ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 25 insertions(+)
drivers/net/ice/ice_dcf.c +24 -0
@@ -1163,3 +1163,27 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,rte_free (list);return err; } + +int +ice_dcf_cap_reset (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw) +{ +int ret; + +struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); +struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + +ice_dcf_disable_irq0 (hw); +rte_intr_disable (intr_handle); +rte_intr_callback_unregister (intr_handle, ice_dcf_dev_interrupt_handler, + hw); + ret =ice_dcf_mode_disable (hw); +if (ret) + goto err; + ret =ice_dcf_get_vf_resource (hw); +err: +rte_intr_callback_register (intr_handle, ice_dcf_dev_interrupt_handler, + hw); +rte_intr_enable (intr_handle); +ice_dcf_enable_irq0 (hw); +return ret; +}
drivers/net/ice/ice_dcf.h +1 -0
@@ -137,6 +137,7 @@ int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete); +int ice_dcf_cap_reset (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);void ice_dcf_tm_conf_uninit (struct rte_eth_dev *dev);int ice_dcf_replay_vf_bw (struct ice_dcf_hw *hw,uint16_t vf_id);
Signature · 1 line
2.33.1
PATCH v3 11/22 net/ice: support IPv6 NVGRE tunnel
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add protocol definition and pattern matching for IPv6 NVGRE tunnel.
--- drivers/net/ice/ice_switch_filter.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/ice_switch_filter.c +5 -0
@@ -31,6 +31,7 @@#define ICE_PPP_IPV4_PROTO 0x0021#define ICE_PPP_IPV6_PROTO 0x0057#define ICE_IPV4_PROTO_NVGRE 0x002F +#define ICE_IPV6_PROTO_NVGRE 0x002F#define ICE_SW_PRI_BASE 6#define ICE_SW_INSET_ETHER ( \
@@ -763,6 +764,10 @@ ice_switch_parse_pattern(const struct rte_flow_item pattern[],break ; } } +if ((ipv6_spec->hdr.proto & + ipv6_mask->hdr.proto) == +ICE_IPV6_PROTO_NVGRE ) + *tun_type =ICE_SW_TUN_AND_NON_TUN ;if (ipv6_mask->hdr.proto) *input |=ICE_INSET_IPV6_NEXT_HDR ;if (ipv6_mask->hdr.hop_limits)
Signature · 1 line
2.33.1
PATCH v3 12/22 net/ice: support new pattern of IPv4
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definition and pattern entry for IPv4 pattern: MAC/VLAN/IPv4
--- drivers/net/ice/ice_switch_filter.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ice/ice_switch_filter.c +3 -0
@@ -38,6 +38,8 @@ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE)#define ICE_SW_INSET_MAC_VLAN ( \ ICE_SW_INSET_ETHER | ICE_INSET_VLAN_INNER) +#define ICE_SW_INSET_MAC_VLAN_IPV4 ( \ + ICE_SW_INSET_MAC_VLAN | ICE_SW_INSET_MAC_IPV4)#define ICE_SW_INSET_MAC_QINQ ( \ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_VLAN_INNER | \ ICE_INSET_VLAN_OUTER)
@@ -215,6 +217,7 @@ ice_pattern_match_item ice_switch_pattern_dist_list[] = { {pattern_eth_ipv4, ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_udp, ICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_tcp, ICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE, ICE_INSET_NONE}, + {pattern_eth_vlan_ipv4, ICE_SW_INSET_MAC_VLAN_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6, ICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_udp, ICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_tcp, ICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE, ICE_INSET_NONE},
Signature · 1 line
2.33.1
PATCH v3 13/22 net/ice: treat unknown package as OS default package
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
In order to use custom package, unknown package should be treated as OS default package.
--- drivers/net/ice/ice_ethdev.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/ice/ice_ethdev.c +8 -5
@@ -1710,13 +1710,16 @@ ice_load_pkg_type(struct ice_hw *hw)/* store the activated package type (OS default or Comms) */ if (!strncmp ((char *)hw->active_pkg_name,ICE_OS_DEFAULT_PKG_NAME , -ICE_PKG_NAME_SIZE )) +ICE_PKG_NAME_SIZE )) { package_type =ICE_PKG_TYPE_OS_DEFAULT ; -else if (!strncmp ((char *)hw->active_pkg_name,ICE_COMMS_PKG_NAME , -ICE_PKG_NAME_SIZE )) + }else if (!strncmp ((char *)hw->active_pkg_name,ICE_COMMS_PKG_NAME , +ICE_PKG_NAME_SIZE )) { package_type =ICE_PKG_TYPE_COMMS ; -else - package_type =ICE_PKG_TYPE_UNKNOWN ; + }else { +PMD_INIT_LOG (WARNING , +"The package type is not identified, treaded as OS default type" ); + package_type =ICE_PKG_TYPE_OS_DEFAULT ; + } PMD_INIT_LOG(NOTICE, "Active package is: %d.%d.%d.%d, %s (%s VLAN mode)", hw->active_pkg_ver.major, hw->active_pkg_ver.minor,
Signature · 1 line
2.33.1
PATCH v3 14/22 net/ice: handle virtchnl event message without interrupt
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Currently, VF can only handle virtchnl event message by calling interrupt. It is not available in two cases:
1. If the event message comes during VF initialization before interrupt is enabled, this message will not be handled correctly.
2. Some virtchnl commands need to receive the event message and handle it with interrupt disabled.
To solve this issue, we add the virtchnl event message handling in the process of reading vitchnl messages in adminq from PF.
--- drivers/net/ice/ice_dcf.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +23 -2
@@ -63,11 +63,32 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, goto again; v_op =rte_le_to_cpu_32 (event.desc.cookie_high); -if (v_op != op) - goto again; + +if (v_op ==VIRTCHNL_OP_EVENT ) { +struct virtchnl_pf_event *vpe = + (struct virtchnl_pf_event *)event.msg_buf; +switch (vpe->event) { +case VIRTCHNL_EVENT_RESET_IMPENDING : + hw->resetting = true; +if (rsp_msglen) + *rsp_msglen =0 ; +return IAVF_SUCCESS ; +default : + goto again; + } + }else { +/* async reply msg on command issued by vf previously */ +if (v_op != op) { +PMD_DRV_LOG (WARNING , +"command mismatch, expect %u, get %u" , + op, v_op); + goto again; + } + }if (rsp_msglen !=NULL ) *rsp_msglen = event.msg_len; +return rte_le_to_cpu_32 (event.desc.cookie_low); again:
Signature · 1 line
2.33.1
PATCH v3 15/22 net/ice: add DCF request queues function
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Add a new virtchnl function to request additional queues from PF. Current default queue pairs number is 16. In order to support up to 256 queue pairs DCF port, enable this request queues function.
--- drivers/net/ice/ice_dcf.c | 98 +++++++++++++++++++++++++++++++++------ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 86 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +85 -13
@@ -257,7 +257,7 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)VIRTCHNL_VF_CAP_ADV_LINK_SPEED |VIRTCHNL_VF_CAP_DCF |VIRTCHNL_VF_OFFLOAD_VLAN_V2 |VF_BASE_MODE_OFFLOADS |VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | -VIRTCHNL_VF_OFFLOAD_QOS ; +VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES ; err =ice_dcf_send_cmd_req_no_irq (hw,VIRTCHNL_OP_GET_VF_RESOURCES , (uint8_t *)&caps,sizeof (caps));
@@ -468,18 +468,38 @@ ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw, goto ret; } -do { -if (!cmd->pending) -break ; - -rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); - }while (i++ <ICE_DCF_ARQ_MAX_RETRIES ); - -if (cmd->v_ret !=IAVF_SUCCESS ) { - err =-1 ; -PMD_DRV_LOG (ERR , -"No response (%d times) or return failure (%d) for cmd %d" , - i, cmd->v_ret, cmd->v_op); +switch (cmd->v_op) { +case VIRTCHNL_OP_REQUEST_QUEUES : + err =ice_dcf_recv_cmd_rsp_no_irq (hw, +VIRTCHNL_OP_REQUEST_QUEUES , + cmd->rsp_msgbuf, + cmd->rsp_buflen, +NULL ); +if (err !=IAVF_SUCCESS || !hw->resetting) { + err =-1 ; +PMD_DRV_LOG (ERR , +"Failed to get response of " +"VIRTCHNL_OP_REQUEST_QUEUES %d" , + err); + } +break ; +default : +/* For other virtchnl ops in running time, +* wait for the cmd done flag. +*/ +do { +if (!cmd->pending) +break ; +rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); + }while (i++ <ICE_DCF_ARQ_MAX_RETRIES ); + +if (cmd->v_ret !=IAVF_SUCCESS ) { + err =-1 ; +PMD_DRV_LOG (ERR , +"No response (%d times) or " +"return failure (%d) for cmd %d" , + i, cmd->v_ret, cmd->v_op); + } } ret:
@@ -1011,6 +1031,58 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num) +{ +struct virtchnl_vf_res_request vfres; +struct dcf_virtchnl_cmd args; +uint16_t num_queue_pairs; +int err; + +if (!(hw->vf_res->vf_cap_flags & +VIRTCHNL_VF_OFFLOAD_REQ_QUEUES )) { +PMD_DRV_LOG (ERR ,"request queues not supported" ); +return -1 ; + } + +if (num ==0 ) { +PMD_DRV_LOG (ERR ,"queue number cannot be zero" ); +return -1 ; + } + vfres.num_queue_pairs = num; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_REQUEST_QUEUES ; + + args.req_msg = (u8 *)&vfres; + args.req_msglen =sizeof (vfres); + + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + +/* +* disable interrupt to avoid the admin queue message to be read +* before iavf_read_msg_from_pf. +*/ +rte_intr_disable (hw->eth_dev->intr_handle); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +rte_intr_enable (hw->eth_dev->intr_handle); +if (err) { +PMD_DRV_LOG (ERR ,"fail to execute command OP_REQUEST_QUEUES" ); +return err; + } + +/* request additional queues failed, return available number */ + num_queue_pairs = ((struct virtchnl_vf_res_request *) + args.rsp_msgbuf)->num_queue_pairs; +PMD_DRV_LOG (ERR , +"request queues failed, only %u queues available" , + num_queue_pairs); + +return -1 ; +} +int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
drivers/net/ice/ice_dcf.h +1 -0
@@ -127,6 +127,7 @@ int ice_dcf_configure_rss_key(struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw); +int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);
Signature · 1 line
2.33.1
PATCH v3 16/22 net/ice: negotiate large VF and request more queues
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Negotiate large VF capability with PF during VF initialization. If large VF is supported and the number of queues larger than 16 is required, VF requests additional queues from PF. Mark the state that large VF is supported.
If the allocated queues number is larger than 16, the max RSS queue region cannot be 16 anymore. Add the function to query max RSS queue region from PF, use it in the RSS initialization and future filters configuration.
--- drivers/net/ice/ice_dcf.c | 34 +++++++++++++++- drivers/net/ice/ice_dcf.h | 4 ++ drivers/net/ice/ice_dcf_ethdev.c | 69 +++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 2 + 4 files changed, 106 insertions(+), 3 deletions(-)
drivers/net/ice/ice_dcf.c +33 -1
@@ -257,7 +257,8 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)VIRTCHNL_VF_CAP_ADV_LINK_SPEED |VIRTCHNL_VF_CAP_DCF |VIRTCHNL_VF_OFFLOAD_VLAN_V2 |VF_BASE_MODE_OFFLOADS |VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | -VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES ; +VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES | +VIRTCHNL_VF_LARGE_NUM_QPAIRS ; err =ice_dcf_send_cmd_req_no_irq (hw,VIRTCHNL_OP_GET_VF_RESOURCES , (uint8_t *)&caps,sizeof (caps));
@@ -1083,6 +1084,37 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)return -1 ; } +int +ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +uint16_t qregion_width; +int err; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_GET_MAX_RSS_QREGION ; + args.req_msg =NULL ; + args.req_msglen =0 ; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"Failed to execute command of " +"VIRTCHNL_OP_GET_MAX_RSS_QREGION" ); +return err; + } + + qregion_width = ((struct virtchnl_max_rss_qregion *) + args.rsp_msgbuf)->qregion_width; + hw->max_rss_qregion = (uint16_t )(1 << qregion_width); + +return 0 ; +} + +int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
drivers/net/ice/ice_dcf.h +4 -0
@@ -105,6 +105,7 @@ struct ice_dcf_hw {uint16_t msix_base;uint16_t nb_msix; +uint16_t max_rss_qregion;/* max RSS queue region supported by PF */ uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset;struct virtchnl_vlan_caps vlan_v2_caps;
@@ -114,6 +115,8 @@ struct ice_dcf_hw {uint32_t link_speed;bool resetting; +/* Indicate large VF support enabled or not */ +bool lv_enabled; }; int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,
@@ -128,6 +131,7 @@ int ice_dcf_configure_rss_lut(struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num); +int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +67 -2
99 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +2 -0
@@ -20,6 +20,8 @@#define ICE_DCF_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 +#define ICE_DCF_MAX_NUM_QUEUES_LV 256struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v3 17/22 net/ice: enable multiple queues configurations for large VF
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Since the adminq buffer size has a 4K limitation, the current virtchnl command VIRTCHNL_OP_CONFIG_VSI_QUEUES cannot send the message only once to configure up to 256 queues. In this patch, we send the messages multiple times to make sure that the buffer size is less than 4K each time.
--- drivers/net/ice/ice_dcf.c | 11 ++++++----- drivers/net/ice/ice_dcf.h | 3 ++- drivers/net/ice/ice_dcf_ethdev.c | 20 ++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 27 insertions(+), 8 deletions(-)
drivers/net/ice/ice_dcf.c +6 -5
@@ -949,7 +949,8 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw)#define IAVF_RXDID_COMMS_OVS_1 22int -ice_dcf_configure_queues (struct ice_dcf_hw *hw) +ice_dcf_configure_queues (struct ice_dcf_hw *hw, +uint16_t num_queue_pairs,uint16_t index) {struct ice_rx_queue **rxq = (struct ice_rx_queue **)hw->eth_dev->data->rx_queues;
@@ -962,16 +963,16 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)int err; size =sizeof (*vc_config) + -sizeof (vc_config->qpair[0 ]) * hw->num_queue_pairs; +sizeof (vc_config->qpair[0 ]) * num_queue_pairs; vc_config =rte_zmalloc ("cfg_queue" , size,0 );if (!vc_config)return -ENOMEM ; vc_config->vsi_id = hw->vsi_res->vsi_id; - vc_config->num_queue_pairs = hw->num_queue_pairs; + vc_config->num_queue_pairs = num_queue_pairs; -for (i =0 , vc_qp = vc_config->qpair; - i < hw->num_queue_pairs; +for (i = index, vc_qp = vc_config->qpair; + i < index + num_queue_pairs; i++, vc_qp++) { vc_qp->txq.vsi_id = hw->vsi_res->vsi_id; vc_qp->txq.queue_id = i;
drivers/net/ice/ice_dcf.h +2 -1
@@ -129,7 +129,8 @@ void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw);int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw); -int ice_dcf_configure_queues (struct ice_dcf_hw *hw); +int ice_dcf_configure_queues (struct ice_dcf_hw *hw, +uint16_t num_queue_pairs,uint16_t index);int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +18 -2
@@ -513,6 +513,8 @@ ice_dcf_dev_start(struct rte_eth_dev *dev)struct rte_intr_handle *intr_handle = dev->intr_handle;struct ice_adapter *ad = &dcf_ad->parent;struct ice_dcf_hw *hw = &dcf_ad->real_hw; +uint16_t num_queue_pairs; +uint16_t index =0 ;int ret;if (hw->resetting) {
@@ -531,6 +533,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) hw->num_queue_pairs =RTE_MAX (dev->data->nb_rx_queues, dev->data->nb_tx_queues); + num_queue_pairs = hw->num_queue_pairs; ret =ice_dcf_init_rx_queues (dev);if (ret) {
@@ -546,7 +549,20 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) } } - ret =ice_dcf_configure_queues (hw); +/* If needed, send configure queues msg multiple times to make the +* adminq buffer length smaller than the 4K limitation. +*/ +while (num_queue_pairs >ICE_DCF_CFG_Q_NUM_PER_BUF ) { +if (ice_dcf_configure_queues (hw, +ICE_DCF_CFG_Q_NUM_PER_BUF , index) !=0 ) { +PMD_DRV_LOG (ERR ,"configure queues failed" ); + goto err_queue; + } + num_queue_pairs -=ICE_DCF_CFG_Q_NUM_PER_BUF ; + index +=ICE_DCF_CFG_Q_NUM_PER_BUF ; + } + + ret =ice_dcf_configure_queues (hw, num_queue_pairs, index);if (ret) {PMD_DRV_LOG (ERR ,"Fail to config queues" );return ret;
@@ -586,7 +602,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) dev->data->dev_link.link_status =RTE_ETH_LINK_UP ; - +err_queue:return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +1 -0
@@ -22,6 +22,7 @@#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD)#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16#define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v3 18/22 net/ice: enable IRQ mapping configuration for large VF
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
The current IRQ mapping configuration only supports max 16 queues and 16 MSIX vectors. Change the queue vector mapping structure to indicate up to 256 queues. A new opcode is used to handle the case with large number of queues. To avoid adminq buffer size limitation, we support to send the virtchnl message multiple times if needed.
--- drivers/net/ice/ice_dcf.c | 50 +++++++++++++++++++++++++++---- drivers/net/ice/ice_dcf.h | 10 ++++++- drivers/net/ice/ice_dcf_ethdev.c | 51 +++++++++++++++++++++++++++----- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 99 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +45 -5
@@ -1115,7 +1115,6 @@ ice_dcf_get_max_rss_queue_region(struct ice_dcf_hw *hw)return 0 ; } -int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
@@ -1132,13 +1131,14 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)return -ENOMEM ; map_info->num_vectors = hw->nb_msix; -for (i =0 ; i < hw->nb_msix; i++) { - vecmap = &map_info->vecmap[i]; +for (i =0 ; i < hw->eth_dev->data->nb_rx_queues; i++) { + vecmap = + &map_info->vecmap[hw->qv_map[i].vector_id - hw->msix_base]; vecmap->vsi_id = hw->vsi_res->vsi_id; vecmap->rxitr_idx =0 ; - vecmap->vector_id = hw->msix_base + i; + vecmap->vector_id = hw->qv_map[i].vector_id; vecmap->txq_map =0 ; - vecmap->rxq_map = hw->rxq_map[hw->msix_base + i]; + vecmap->rxq_map |=1 << hw->qv_map[i].queue_id; }memset (&args,0 ,sizeof (args));
@@ -1154,6 +1154,46 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw, +uint16_t num,uint16_t index) +{ +struct virtchnl_queue_vector_maps *map_info; +struct virtchnl_queue_vector *qv_maps; +struct dcf_virtchnl_cmd args; +int len, i, err; +int count =0 ; + + len =sizeof (struct virtchnl_queue_vector_maps ) + +sizeof (struct virtchnl_queue_vector ) * (num -1 ); + + map_info =rte_zmalloc ("map_info" , len,0 ); +if (!map_info) +return -ENOMEM ; + + map_info->vport_id = hw->vsi_res->vsi_id; + map_info->num_qv_maps = num; +for (i = index; i < index + map_info->num_qv_maps; i++) { + qv_maps = &map_info->qv_maps[count++]; + qv_maps->itr_idx =VIRTCHNL_ITR_IDX_0 ; + qv_maps->queue_type =VIRTCHNL_QUEUE_TYPE_RX ; + qv_maps->queue_id = hw->qv_map[i].queue_id; + qv_maps->vector_id = hw->qv_map[i].vector_id; + } + + args.v_op =VIRTCHNL_OP_MAP_QUEUE_VECTOR ; + args.req_msg = (u8 *)map_info; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.req_msglen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command OP_MAP_QUEUE_VECTOR" ); + +rte_free (map_info); +return err; +} +int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on) {
drivers/net/ice/ice_dcf.h +9 -1
@@ -74,6 +74,11 @@ struct ice_dcf_tm_conf {bool committed; }; +struct ice_dcf_qv_map { +uint16_t queue_id; +uint16_t vector_id; +}; +struct ice_dcf_hw {struct iavf_hw avf;
@@ -106,7 +111,8 @@ struct ice_dcf_hw {uint16_t msix_base;uint16_t nb_msix;uint16_t max_rss_qregion;/* max RSS queue region supported by PF */ -uint16_t rxq_map[16 ]; + +struct ice_dcf_qv_map *qv_map;/* queue vector mapping */ struct virtchnl_eth_stats eth_stats_offset;struct virtchnl_vlan_caps vlan_v2_caps;
@@ -134,6 +140,8 @@ int ice_dcf_configure_queues(struct ice_dcf_hw *hw,int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw); +int ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw, +uint16_t num,uint16_t index);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw); int ice_dcf_query_stats(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_ethdev.c +44 -7
94 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +1 -0
@@ -23,6 +23,7 @@#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16#define ICE_DCF_MAX_NUM_QUEUES_LV 256#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 +#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v3 19/22 net/ice: add enable/disable queues for DCF large VF
In reply to Kevin LiuThe current virtchnl structure for enable/disable queues only supports max 32 queue pairs. Use a new opcode and structure to indicate up to 256 queue pairs, in order to enable/disable queues in large VF case.
--- drivers/net/ice/ice_dcf.c | 99 +++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf.h | 5 ++ drivers/net/ice/ice_dcf_ethdev.c | 26 +++++++-- drivers/net/ice/ice_dcf_ethdev.h | 8 +-- 4 files changed, 125 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +96 -3
@@ -90,7 +90,6 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, *rsp_msglen = event.msg_len;return rte_le_to_cpu_32 (event.desc.cookie_low); - again:rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); }while (i++ <ICE_DCF_ARQ_MAX_RETRIES );
@@ -896,7 +895,7 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw) {struct rte_eth_dev *dev = hw->eth_dev;struct rte_eth_rss_conf *rss_conf; -uint8_t i, j, nb_q; +uint16_t i, j, nb_q;int ret; rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
@@ -1075,6 +1074,12 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)return err; } +/* request queues succeeded, vf is resetting */ +if (hw->resetting) { +PMD_DRV_LOG (INFO ,"vf is resetting" ); +return 0 ; + } +/* request additional queues failed, return available number */ num_queue_pairs = ((struct virtchnl_vf_res_request *) args.rsp_msgbuf)->num_queue_pairs;
@@ -1185,7 +1190,8 @@ ice_dcf_config_irq_map_lv(struct ice_dcf_hw *hw, args.req_msg = (u8 *)map_info; args.req_msglen = len; args.rsp_msgbuf = hw->arq_buf; - args.req_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; err =ice_dcf_execute_virtchnl_cmd (hw, &args);if (err)PMD_DRV_LOG (ERR ,"fail to execute command OP_MAP_QUEUE_VECTOR" );
@@ -1225,6 +1231,50 @@ ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on)return err; } +int +ice_dcf_switch_queue_lv (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on) +{ +struct virtchnl_del_ena_dis_queues *queue_select; +struct virtchnl_queue_chunk *queue_chunk; +struct dcf_virtchnl_cmd args; +int err, len; + + len =sizeof (struct virtchnl_del_ena_dis_queues ); + queue_select =rte_zmalloc ("queue_select" , len,0 ); +if (!queue_select) +return -ENOMEM ; + + queue_chunk = queue_select->chunks.chunks; + queue_select->chunks.num_chunks =1 ; + queue_select->vport_id = hw->vsi_res->vsi_id; + +if (rx) { + queue_chunk->type =VIRTCHNL_QUEUE_TYPE_RX ; + queue_chunk->start_queue_id = qid; + queue_chunk->num_queues =1 ; + }else { + queue_chunk->type =VIRTCHNL_QUEUE_TYPE_TX ; + queue_chunk->start_queue_id = qid; + queue_chunk->num_queues =1 ; + } + +if (on) + args.v_op =VIRTCHNL_OP_ENABLE_QUEUES_V2 ; +else + args.v_op =VIRTCHNL_OP_DISABLE_QUEUES_V2 ; + args.req_msg = (u8 *)queue_select; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"Failed to execute command of %s" , + on ?"OP_ENABLE_QUEUES_V2" :"OP_DISABLE_QUEUES_V2" ); +rte_free (queue_select); +return err; +} +int ice_dcf_disable_queues (struct ice_dcf_hw *hw) {
@@ -1254,6 +1304,49 @@ ice_dcf_disable_queues(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_disable_queues_lv (struct ice_dcf_hw *hw) +{ +struct virtchnl_del_ena_dis_queues *queue_select; +struct virtchnl_queue_chunk *queue_chunk; +struct dcf_virtchnl_cmd args; +int err, len; + + len =sizeof (struct virtchnl_del_ena_dis_queues ) + +sizeof (struct virtchnl_queue_chunk ) * + (ICE_DCF_RXTX_QUEUE_CHUNKS_NUM -1 ); + queue_select =rte_zmalloc ("queue_select" , len,0 ); +if (!queue_select) +return -ENOMEM ; + + queue_chunk = queue_select->chunks.chunks; + queue_select->chunks.num_chunks =ICE_DCF_RXTX_QUEUE_CHUNKS_NUM ; + queue_select->vport_id = hw->vsi_res->vsi_id; + + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].type =VIRTCHNL_QUEUE_TYPE_TX ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].start_queue_id =0 ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].num_queues = + hw->eth_dev->data->nb_tx_queues; + + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].type =VIRTCHNL_QUEUE_TYPE_RX ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].start_queue_id =0 ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].num_queues = + hw->eth_dev->data->nb_rx_queues; + + args.v_op =VIRTCHNL_OP_DISABLE_QUEUES_V2 ; + args.req_msg = (u8 *)queue_select; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_QUEUES_V2" ); +rte_free (queue_select); +return err; +} +int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats)
drivers/net/ice/ice_dcf.h +5 -0
@@ -15,6 +15,8 @@#include "base/ice_type.h" #include "ice_logs.h" +#define ICE_DCF_RXTX_QUEUE_CHUNKS_NUM 2 +struct dcf_virtchnl_cmd {TAILQ_ENTRY (dcf_virtchnl_cmd) next;
@@ -143,7 +145,10 @@ int ice_dcf_config_irq_map(struct ice_dcf_hw *hw);int ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw,uint16_t num,uint16_t index);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on); +int ice_dcf_switch_queue_lv (struct ice_dcf_hw *hw, +uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw); +int ice_dcf_disable_queues_lv (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_ethdev.c +20 -6
@@ -317,6 +317,7 @@ static int ice_dcf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) {struct ice_dcf_adapter *ad = dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &ad->real_hw;struct iavf_hw *hw = &ad->real_hw.avf;struct ice_rx_queue *rxq;int err =0 ;
@@ -339,7 +340,11 @@ ice_dcf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)IAVF_WRITE_FLUSH (hw);/* Ready to switch the queue on */ - err =ice_dcf_switch_queue (&ad->real_hw, rx_queue_id, true, true); +if (!dcf_hw->lv_enabled) + err =ice_dcf_switch_queue (dcf_hw, rx_queue_id, true, true); +else + err =ice_dcf_switch_queue_lv (dcf_hw, rx_queue_id, true, true); +if (err) {PMD_DRV_LOG (ERR ,"Failed to switch RX queue %u on" , rx_queue_id);
@@ -448,6 +453,7 @@ static int ice_dcf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) {struct ice_dcf_adapter *ad = dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &ad->real_hw;struct iavf_hw *hw = &ad->real_hw.avf;struct ice_tx_queue *txq;int err =0 ;
@@ -463,7 +469,10 @@ ice_dcf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)IAVF_WRITE_FLUSH (hw);/* Ready to switch the queue on */ - err =ice_dcf_switch_queue (&ad->real_hw, tx_queue_id, false, true); +if (!dcf_hw->lv_enabled) + err =ice_dcf_switch_queue (dcf_hw, tx_queue_id, false, true); +else + err =ice_dcf_switch_queue_lv (dcf_hw, tx_queue_id, false, true);if (err) { PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on",
@@ -650,12 +659,17 @@ ice_dcf_stop_queues(struct rte_eth_dev *dev)struct ice_dcf_hw *hw = &ad->real_hw;struct ice_rx_queue *rxq;struct ice_tx_queue *txq; -int ret, i; +int i;/* Stop All queues */ - ret =ice_dcf_disable_queues (hw); -if (ret) -PMD_DRV_LOG (WARNING ,"Fail to stop queues" ); +if (!hw->lv_enabled) { +if (ice_dcf_disable_queues (hw)) +PMD_DRV_LOG (WARNING ,"Fail to stop queues" ); + }else { +if (ice_dcf_disable_queues_lv (hw)) +PMD_DRV_LOG (WARNING , +"Fail to stop queues for large VF" ); + }for (i =0 ; i < dev->data->nb_tx_queues; i++) { txq = dev->data->tx_queues[i];
drivers/net/ice/ice_dcf_ethdev.h +4 -4
@@ -20,10 +20,10 @@#define ICE_DCF_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) -#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 -#define ICE_DCF_MAX_NUM_QUEUES_LV 256 -#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 -#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128 +#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 +#define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 +#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v3 20/22 net/ice: fix DCF ACL flow engine
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
ACL is not a necessary feature for DCF, it may not be supported by the ice kernel driver, so in this patch the program does not return the ACL initiation fails to high level functions, as substitute it prints some error logs, cleans the related resources and unregisters the ACL engine.
--- drivers/net/ice/ice_acl_filter.c | 20 ++++++++++++++---- drivers/net/ice/ice_generic_flow.c | 34 +++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 12 deletions(-)
drivers/net/ice/ice_acl_filter.c +16 -4
@@ -56,6 +56,8 @@ ice_pattern_match_item ice_acl_pattern[] = { {pattern_eth_ipv4_sctp, ICE_ACL_INSET_ETH_IPV4_SCTP, ICE_INSET_NONE, ICE_INSET_NONE}, }; +static void ice_acl_prof_free (struct ice_hw *hw); +static int ice_acl_prof_alloc (struct ice_hw *hw) {
@@ -1007,17 +1009,27 @@ ice_acl_init(struct ice_adapter *ad) ret =ice_acl_setup (pf);if (ret) -return ret; + goto deinit_acl; ret =ice_acl_bitmap_init (pf);if (ret) -return ret; + goto deinit_acl; ret =ice_acl_prof_init (pf);if (ret) -return ret; + goto deinit_acl; -return ice_register_parser (parser, ad); + ret =ice_register_parser (parser, ad); +if (ret) + goto deinit_acl; + +return 0 ; + +deinit_acl: +ice_deinit_acl (pf); +ice_acl_prof_free (hw); +PMD_DRV_LOG (ERR ,"ACL init failed, may not supported!" ); +return ret; } static void
drivers/net/ice/ice_generic_flow.c +26 -8
@@ -1817,6 +1817,12 @@ ice_register_flow_engine(struct ice_flow_engine *engine)TAILQ_INSERT_TAIL (&engine_list, engine, node); } +static void +ice_unregister_flow_engine (struct ice_flow_engine *engine) +{ +TAILQ_REMOVE (&engine_list, engine, node); +} +int ice_flow_init (struct ice_adapter *ad) {
@@ -1840,9 +1846,18 @@ ice_flow_init(struct ice_adapter *ad) ret = engine->init (ad);if (ret) { -PMD_INIT_LOG (ERR ,"Failed to initialize engine %d" , - engine->type); -return ret; +/** +* ACL may not supported in kernel driver, +* so just unregister the engine. +*/ +if (engine->type ==ICE_FLOW_ENGINE_ACL ) { +ice_unregister_flow_engine (engine); + }else { +PMD_INIT_LOG (ERR , +"Failed to initialize engine %d" , + engine->type); +return ret; + } } }return 0 ;
@@ -1929,7 +1944,7 @@ ice_register_parser(struct ice_flow_parser *parser, list =ice_get_parser_list (parser, ad);if (list ==NULL ) -return -EINVAL ; + goto err;if (ad->devargs.pipe_mode_support) {TAILQ_INSERT_TAIL (list, parser_node, node);
@@ -1941,7 +1956,7 @@ ice_register_parser(struct ice_flow_parser *parser, ICE_FLOW_ENGINE_ACL) {TAILQ_INSERT_AFTER (list, existing_node, parser_node, node); - goto DONE; +return 0 ; } }TAILQ_INSERT_HEAD (list, parser_node, node);
@@ -1952,7 +1967,7 @@ ice_register_parser(struct ice_flow_parser *parser, ICE_FLOW_ENGINE_SWITCH) {TAILQ_INSERT_AFTER (list, existing_node, parser_node, node); - goto DONE; +return 0 ; } }TAILQ_INSERT_HEAD (list, parser_node, node);
@@ -1961,11 +1976,14 @@ ice_register_parser(struct ice_flow_parser *parser, }else if (parser->engine->type ==ICE_FLOW_ENGINE_ACL ) {TAILQ_INSERT_HEAD (list, parser_node, node); }else { -return -EINVAL ; + goto err; } } -DONE:return 0 ; +err: +rte_free (parser_node); +PMD_DRV_LOG (ERR ,"%s failed." , __func__); +return -EINVAL ; }void
Signature · 1 line
2.33.1
PATCH v3 21/22 testpmd: force flow flush
In reply to Kevin LiuFrom: Qi Zhang <[email protected]>
For mdcf, rte_flow_flush is still need to be invoked even there are no flows be created in current instance.
--- app/test-pmd/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
app/test-pmd/config.c +3 -3
@@ -2923,15 +2923,15 @@ port_flow_flush(portid_t port_id) port = &ports[port_id]; -if (port->flow_list ==NULL ) -return ret; -/* Poisoning to make sure PMDs update it in case of error. */ memset (&error,0x44 ,sizeof (error));if (rte_flow_flush (port_id, &error)) {port_flow_complain (&error); } +if (port->flow_list ==NULL ) +return ret; +while (port->flow_list) {struct port_flow *pf = port->flow_list->next;
Signature · 1 line
2.33.1
PATCH v3 22/22 net/ice: fix DCF reset
In reply to Kevin LiuAfter the PF triggers the VF reset, before the VF PMD can perform any operations on the hardware, it must reinitialize the all resources.
This patch adds a flag to indicate whether the VF has been reset by PF, and update the DCF resetting operations according to this flag.
--- drivers/net/ice/base/ice_common.c | 4 +++- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf_ethdev.c | 17 ++++++++++++++++- drivers/net/ice/ice_dcf_parent.c | 3 +++ 4 files changed, 23 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_common.c +3 -1
@@ -755,6 +755,7 @@ enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) status =ice_init_def_sw_recp (hw, &hw->switch_info->recp_list);if (status) {ice_free (hw, hw->switch_info); + hw->switch_info =NULL ;return status; }return ICE_SUCCESS ;
@@ -823,7 +824,6 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw) }ice_rm_sw_replay_rule_info (hw, sw);ice_free (hw, sw->recp_list); -ice_free (hw, sw); }/**
@@ -833,6 +833,8 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw)void ice_cleanup_fltr_mgmt_struct (struct ice_hw *hw) {ice_cleanup_fltr_mgmt_single (hw, hw->switch_info); +ice_free (hw, hw->switch_info); + hw->switch_info =NULL ; }/**
drivers/net/ice/ice_dcf.c +1 -1
@@ -1429,7 +1429,7 @@ ice_dcf_cap_reset(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)int ret;struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;ice_dcf_disable_irq0 (hw);rte_intr_disable (intr_handle);
drivers/net/ice/ice_dcf_ethdev.c +16 -1
@@ -1004,6 +1004,15 @@ dcf_add_del_mc_addr_list(struct ice_dcf_hw *hw,uint32_t i;int len, err =0 ; +if (hw->resetting) { +if (!add) +return 0 ; + +PMD_DRV_LOG (ERR , +"fail to add multicast MACs for VF resetting" ); +return -EIO ; + } + len =sizeof (struct virtchnl_ether_addr_list ); len +=sizeof (struct virtchnl_ether_addr ) * mc_addrs_num;
@@ -1642,7 +1651,13 @@ ice_dcf_dev_close(struct rte_eth_dev *dev)if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ; - (void )ice_dcf_dev_stop (dev); +if (adapter->parent.pf.adapter_stopped) + (void )ice_dcf_dev_stop (dev); + +if (adapter->real_hw.resetting) { +ice_dcf_uninit_hw (dev, &adapter->real_hw); +ice_dcf_init_hw (dev, &adapter->real_hw); + }ice_free_queues (dev);
drivers/net/ice/ice_dcf_parent.c +3 -0
@@ -240,6 +240,9 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,case VIRTCHNL_EVENT_RESET_IMPENDING :PMD_DRV_LOG (DEBUG ,"VIRTCHNL_EVENT_RESET_IMPENDING event" ); dcf_hw->resetting = true; +rte_eth_dev_callback_process (dcf_hw->eth_dev, +RTE_ETH_EVENT_INTR_RESET , +NULL );break ;case VIRTCHNL_EVENT_LINK_CHANGE :PMD_DRV_LOG (DEBUG ,"VIRTCHNL_EVENT_LINK_CHANGE event" );
Signature · 1 line
2.33.1
v4 cover complete common VF features for DCF
In reply to Kevin LiuThe DCF PMD support the below dev ops,dev_supported_ptypes_getdev_link_updatexstats_getxstats_get_namesxstats_resetpromiscuous_enablepromiscuous_disableallmulticast_enableallmulticast_disablemac_addr_addmac_addr_removeset_mc_addr_listvlan_filter_setvlan_offload_setmac_addr_setreta_updatereta_queryrss_hash_updaterss_hash_conf_getrxq_info_gettxq_info_getmtu_settx_done_cleanupget_monitor_addr
v4:
* remove patch:
1.testpmd: force flow flush
2.net/ice: fix DCF ACL flow engine 3.net/ice: fix DCF reset
* add patch:
1.net/ice: add extended stats 2.net/ice: support queue information getting 3.net/ice: implement power management 4.doc: update for ice DCF datapath configuration
v3:
* remove patch:
1.net/ice/base: add VXLAN support for switch filter 2.net/ice: add VXLAN support for switch filter 3.common/iavf: support flushing rules and reporting DCF id 4.net/ice/base: fix ethertype filter input set 5.net/ice/base: support IPv6 GRE UDP pattern 6.net/ice/base: support new patterns of TCP and UDP 7.net/ice: support new patterns of TCP and UDP 8.net/ice/base: support IPv4 GRE tunnel 9.net/ice: support IPv4 GRE raw pattern type 10.net/ice/base: update Profile ID table for VXLAN 11.net/ice/base: update Protocol ID table to match DVM DDP
v2:
* remove patch:
1.net/iavf: support checking if device is an MDCF instance 2.net/ice: support MDCF(multi-DCF) instance 3.net/ice/base: support custom DDP buildin recipe 4.net/ice: support buildin recipe configuration 5.net/ice/base: support custom ddp package version 6.net/ice: disable ACL function for MDCF instance
Alvin Zhang (6):
net/ice: support dcf promisc configuration net/ice: support dcf VLAN filter and offload configuration net/ice: support DCF new VLAN capabilities net/ice: support IPv6 NVGRE tunnel
net/ice: support new pattern of IPv4
net/ice: treat unknown package as OS default package
Dapeng Yu (1):
net/ice: enable CVL DCF device reset API
Jie Wang (2):
net/ice: add ops MTU-SET to dcf
net/ice: add ops dev-supported-ptypes-get to dcf
Kevin Liu (6):
net/ice: support dcf MAC configuration net/ice: add enable/disable queues for DCF large VF net/ice: add extended stats
net/ice: support queue information getting net/ice: implement power management
doc: update for ice DCF datapath configuration
Robin Zhang (1):
net/ice: cleanup Tx buffers
Steve Yang (7):
net/ice: enable RSS RETA ops for DCF hardware net/ice: enable RSS HASH ops for DCF hardware net/ice: handle virtchnl event message without interrupt net/ice: add DCF request queues function
net/ice: negotiate large VF and request more queues net/ice: enable multiple queues configurations for large VF net/ice: enable IRQ mapping configuration for large VF
doc/guides/nics/features/ice_dcf.ini | 15 + drivers/net/ice/ice_dcf.c | 375 +++++++++- drivers/net/ice/ice_dcf.h | 52 +- drivers/net/ice/ice_dcf_ethdev.c | 986 +++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 14 + drivers/net/ice/ice_ethdev.c | 13 +- drivers/net/ice/ice_switch_filter.c | 8 + 7 files changed, 1375 insertions(+), 88 deletions(-)
Signature · 1 line
2.33.1
PATCH v4 1/23 net/ice: enable RSS RETA ops for DCF hardware
From: Steve Yang <[email protected]>
RSS RETA should be updated and queried by application, Add related ops ('.reta_update', '.reta_query') for DCF.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -790,7 +790,7 @@ ice_dcf_configure_rss_key(struct ice_dcf_hw *hw)return err; } -static int +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw) {struct virtchnl_rss_lut *rss_lut;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +77 -0
89 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v4 2/23 net/ice: enable RSS HASH ops for DCF hardware
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
RSS HASH should be updated and queried by application, Add related ops ('.rss_hash_update', '.rss_hash_conf_get') for DCF.
Because DCF doesn't support configure RSS HASH, only HASH key can be updated within ops '.rss_hash_update'.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 51 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -758,7 +758,7 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw) hw->ets_config =NULL ; } -static int +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw) {struct virtchnl_rss_key *rss_key;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +51 -0
63 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v4 3/23 net/ice: cleanup Tx buffers
In reply to Kevin LiuFrom: Robin Zhang <[email protected]>
Add support for ops rte_eth_tx_done_cleanup in dcf
--- drivers/net/ice/ice_dcf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/ice_dcf_ethdev.c +1 -0
@@ -1235,6 +1235,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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, }; static int
Signature · 1 line
2.33.1
PATCH v4 4/23 net/ice: add ops MTU-SET to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "mtu_set" to dcf, and it can configure the port mtu through cmdline.
--- drivers/net/ice/ice_dcf_ethdev.c | 14 ++++++++++++++ drivers/net/ice/ice_dcf_ethdev.h | 6 ++++++ 2 files changed, 20 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +14 -0
@@ -1081,6 +1081,19 @@ ice_dcf_link_update(struct rte_eth_dev *dev,return rte_eth_linkstatus_set (dev, &new_link); } +static int +ice_dcf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) +{ +/* mtu setting is forbidden if port is start */ +if (dev->data->dev_started !=0 ) { +PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , + dev->data->port_id); +return -EBUSY ; + } + +return 0 ; +} +bool ice_dcf_adminq_need_retry (struct ice_adapter *ad) {
@@ -1236,6 +1249,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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
drivers/net/ice/ice_dcf_ethdev.h +6 -0
@@ -15,6 +15,12 @@#define ICE_DCF_MAX_RINGS 1 +#define ICE_DCF_FRAME_SIZE_MAX 9728 +#define ICE_DCF_VLAN_TAG_SIZE 4 +#define ICE_DCF_ETH_OVERHEAD \ + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2) +#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +struct ice_dcf_queue {uint64_t dummy; };
Signature · 1 line
2.33.1
PATCH v4 5/23 net/ice: add ops dev-supported-ptypes-get to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "dev_supported_ptypes_get" to dcf, that dcf pmd can get ptypes through the new API.
--- drivers/net/ice/ice_dcf_ethdev.c | 80 +++++++++++++++++++------------- 1 file changed, 49 insertions(+), 31 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +49 -31
@@ -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
Signature · 1 line
2.33.1
PATCH v4 6/23 net/ice: support dcf promisc configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Support configuration of unicast and multicast promisc on dcf.
--- drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 3 ++ 2 files changed, 76 insertions(+), 4 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +73 -4
@@ -727,27 +727,95 @@ ice_dcf_dev_info_get(struct rte_eth_dev *dev, }static int -ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +dcf_config_promisc (struct ice_dcf_adapter *adapter, +bool enable_unicast, +bool enable_multicast) { +struct ice_dcf_hw *hw = &adapter->real_hw; +struct virtchnl_promisc_info promisc; +struct dcf_virtchnl_cmd args; +int err; + + promisc.flags =0 ; + promisc.vsi_id = hw->vsi_res->vsi_id; + +if (enable_unicast) + promisc.flags |=FLAG_VF_UNICAST_PROMISC ; + +if (enable_multicast) + promisc.flags |=FLAG_VF_MULTICAST_PROMISC ; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE ; + args.req_msg = (uint8_t *)&promisc; + args.req_msglen =sizeof (promisc); + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"fail to execute command VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE" ); +return err; + } + + adapter->promisc_unicast_enabled = enable_unicast; + adapter->promisc_multicast_enabled = enable_multicast;return 0 ; } +static int +ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, true, + adapter->promisc_multicast_enabled); +} +static int ice_dcf_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, false, + adapter->promisc_multicast_enabled); }static int ice_dcf_dev_allmulticast_enable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + true); }static int ice_dcf_dev_allmulticast_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + false); } static int
@@ -1299,6 +1367,7 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev)return -1 ; } +dcf_config_promisc (adapter, false, false);return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +3 -0
@@ -33,6 +33,9 @@ struct ice_dcf_adapter {struct ice_adapter parent;/* Must be first */ struct ice_dcf_hw real_hw; +bool promisc_unicast_enabled; +bool promisc_multicast_enabled; +int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH v4 7/23 net/ice: support dcf MAC configuration
In reply to Kevin LiuBelow PMD ops are supported in this patch:
.mac_addr_add = dcf_dev_add_mac_addr
.mac_addr_remove = dcf_dev_del_mac_addr
.set_mc_addr_list = dcf_set_mc_addr_list
.mac_addr_set = dcf_dev_set_default_mac_addr--- drivers/net/ice/ice_dcf.c | 9 +- drivers/net/ice/ice_dcf.h | 4 +- drivers/net/ice/ice_dcf_ethdev.c | 218 ++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 5 +- 4 files changed, 226 insertions(+), 10 deletions(-)
drivers/net/ice/ice_dcf.c +5 -4
@@ -1089,10 +1089,11 @@ ice_dcf_query_stats(struct ice_dcf_hw *hw, }int -ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add) +ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr, +bool add,uint8_t type) {struct virtchnl_ether_addr_list *list; -struct rte_ether_addr *addr;struct dcf_virtchnl_cmd args;int len, err =0 ;
@@ -1105,7 +1106,6 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add) } len =sizeof (struct virtchnl_ether_addr_list ); - addr = hw->eth_dev->data->mac_addrs; len +=sizeof (struct virtchnl_ether_addr ); list =rte_zmalloc (NULL , len,0 );
@@ -1116,9 +1116,10 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add)rte_memcpy (list->list[0 ].addr, addr->addr_bytes,sizeof (addr->addr_bytes)); +PMD_DRV_LOG (DEBUG ,"add/rm mac:" RTE_ETHER_ADDR_PRT_FMT ,RTE_ETHER_ADDR_BYTES (addr)); - + list->list[0 ].type = type; list->vsi_id = hw->vsi_res->vsi_id; list->num_elements =1 ;
drivers/net/ice/ice_dcf.h +3 -1
@@ -131,7 +131,9 @@ int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); -int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add); +int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr,bool add, +uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);
drivers/net/ice/ice_dcf_ethdev.c +215 -3
259 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +3 -2
@@ -14,7 +14,7 @@#include "ice_dcf.h" #define ICE_DCF_MAX_RINGS 1 - +#define DCF_NUM_MACADDR_MAX 64#define ICE_DCF_FRAME_SIZE_MAX 9728#define ICE_DCF_VLAN_TAG_SIZE 4#define ICE_DCF_ETH_OVERHEAD \
@@ -35,7 +35,8 @@ struct ice_dcf_adapter {bool promisc_unicast_enabled;bool promisc_multicast_enabled; - +uint32_t mc_addrs_num; +struct rte_ether_addr mc_addrs[DCF_NUM_MACADDR_MAX ];int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH v4 8/23 net/ice: support dcf VLAN filter and offload configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Below PMD ops are supported in this patch:
.vlan_filter_set = dcf_dev_vlan_filter_set
.vlan_offload_set = dcf_dev_vlan_offload_set
--- drivers/net/ice/ice_dcf_ethdev.c | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +101 -0
@@ -1026,6 +1026,105 @@ dcf_dev_set_default_mac_addr(struct rte_eth_dev *dev,return 0 ; } +static int +dcf_add_del_vlan (struct ice_dcf_hw *hw,uint16_t vlanid,bool add) +{ +struct virtchnl_vlan_filter_list *vlan_list; +uint8_t cmd_buffer[sizeof (struct virtchnl_vlan_filter_list ) + +sizeof (uint16_t )]; +struct dcf_virtchnl_cmd args; +int err; + + vlan_list = (struct virtchnl_vlan_filter_list *)cmd_buffer; + vlan_list->vsi_id = hw->vsi_res->vsi_id; + vlan_list->num_elements =1 ; + vlan_list->vlan_id[0 ] = vlanid; + +memset (&args,0 ,sizeof (args)); + args.v_op = add ?VIRTCHNL_OP_ADD_VLAN :VIRTCHNL_OP_DEL_VLAN ; + args.req_msg = cmd_buffer; + args.req_msglen =sizeof (cmd_buffer); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command %s" , + add ?"OP_ADD_VLAN" :"OP_DEL_VLAN" ); + +return err; +} + +static int +dcf_enable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_ENABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_ENABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_disable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_DISABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_dev_vlan_filter_set (struct rte_eth_dev *dev,uint16_t vlan_id,int on) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + + err =dcf_add_del_vlan (hw, vlan_id, on); +if (err) +return -EIO ; +return 0 ; +} + +static int +dcf_dev_vlan_offload_set (struct rte_eth_dev *dev,int mask) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +struct rte_eth_conf *dev_conf = &dev->data->dev_conf; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + +/* Vlan stripping setting */ +if (mask &RTE_ETH_VLAN_STRIP_MASK ) { +/* Enable or disable VLAN stripping */ +if (dev_conf->rxmode.offloads &RTE_ETH_RX_OFFLOAD_VLAN_STRIP ) + err =dcf_enable_vlan_strip (hw); +else + err =dcf_disable_vlan_strip (hw); + +if (err) +return -EIO ; + } +return 0 ; +} +static int ice_dcf_dev_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops)
@@ -1538,6 +1637,8 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .mac_addr_remove = dcf_dev_del_mac_addr, .set_mc_addr_list = dcf_set_mc_addr_list, .mac_addr_set = dcf_dev_set_default_mac_addr, + .vlan_filter_set = dcf_dev_vlan_filter_set, + .vlan_offload_set = dcf_dev_vlan_offload_set, .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,
Signature · 1 line
2.33.1
PATCH v4 9/23 net/ice: support DCF new VLAN capabilities
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
The new VLAN virtchnl opcodes introduce new capabilities like VLAN filtering, stripping and insertion.
The DCF needs to query the VLAN capabilities based on current device configuration firstly.
DCF is able to configure inner VLAN filter when port VLAN is enabled base on negotiation; and DCF is able to configure outer VLAN (0x8100) if port VLAN is disabled to be compatible with legacy mode.
When port VLAN is updated by DCF, the DCF needs to reset to query the new VLAN capabilities.
--- drivers/net/ice/ice_dcf.c | 27 +++++ drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 171 ++++++++++++++++++++++++++++--- 3 files changed, 182 insertions(+), 17 deletions(-)
drivers/net/ice/ice_dcf.c +27 -0
@@ -587,6 +587,29 @@ ice_dcf_get_supported_rxdid(struct ice_dcf_hw *hw)return 0 ; } +static int +dcf_get_vlan_offload_caps_v2 (struct ice_dcf_hw *hw) +{ +struct virtchnl_vlan_caps vlan_v2_caps; +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS ; + args.rsp_msgbuf = (uint8_t *)&vlan_v2_caps; + args.rsp_buflen =sizeof (vlan_v2_caps); + + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) { +PMD_DRV_LOG (ERR , +"Failed to execute command of VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS" ); +return ret; + } + +rte_memcpy (&hw->vlan_v2_caps, &vlan_v2_caps,sizeof (vlan_v2_caps)); +return 0 ; +} +int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw) {
@@ -701,6 +724,10 @@ ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)rte_intr_enable (pci_dev->intr_handle);ice_dcf_enable_irq0 (hw); +if ((hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN_V2 ) && +dcf_get_vlan_offload_caps_v2 (hw)) + goto err_rss; +return 0 ; err_rss:
drivers/net/ice/ice_dcf.h +1 -0
@@ -107,6 +107,7 @@ struct ice_dcf_hw {uint16_t nb_msix;uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset; +struct virtchnl_vlan_caps vlan_v2_caps;/* Link status */ bool link_up;
drivers/net/ice/ice_dcf_ethdev.c +154 -17
196 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v4 10/23 net/ice: enable CVL DCF device reset API
In reply to Kevin LiuFrom: Dapeng Yu <[email protected]>
Enable CVL DCF device reset API.
--- drivers/net/ice/ice_dcf.c | 24 ++++++++++++++++++++++++ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 25 insertions(+)
drivers/net/ice/ice_dcf.c +24 -0
@@ -1163,3 +1163,27 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,rte_free (list);return err; } + +int +ice_dcf_cap_reset (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw) +{ +int ret; + +struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); +struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + +ice_dcf_disable_irq0 (hw); +rte_intr_disable (intr_handle); +rte_intr_callback_unregister (intr_handle, ice_dcf_dev_interrupt_handler, + hw); + ret =ice_dcf_mode_disable (hw); +if (ret) + goto err; + ret =ice_dcf_get_vf_resource (hw); +err: +rte_intr_callback_register (intr_handle, ice_dcf_dev_interrupt_handler, + hw); +rte_intr_enable (intr_handle); +ice_dcf_enable_irq0 (hw); +return ret; +}
drivers/net/ice/ice_dcf.h +1 -0
@@ -137,6 +137,7 @@ int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete); +int ice_dcf_cap_reset (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);void ice_dcf_tm_conf_uninit (struct rte_eth_dev *dev);int ice_dcf_replay_vf_bw (struct ice_dcf_hw *hw,uint16_t vf_id);
Signature · 1 line
2.33.1
PATCH v4 11/23 net/ice: support IPv6 NVGRE tunnel
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add protocol definition and pattern matching for IPv6 NVGRE tunnel.
--- drivers/net/ice/ice_switch_filter.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/ice_switch_filter.c +5 -0
@@ -31,6 +31,7 @@#define ICE_PPP_IPV4_PROTO 0x0021#define ICE_PPP_IPV6_PROTO 0x0057#define ICE_IPV4_PROTO_NVGRE 0x002F +#define ICE_IPV6_PROTO_NVGRE 0x002F#define ICE_SW_PRI_BASE 6#define ICE_SW_INSET_ETHER ( \
@@ -763,6 +764,10 @@ ice_switch_parse_pattern(const struct rte_flow_item pattern[],break ; } } +if ((ipv6_spec->hdr.proto & + ipv6_mask->hdr.proto) == +ICE_IPV6_PROTO_NVGRE ) + *tun_type =ICE_SW_TUN_AND_NON_TUN ;if (ipv6_mask->hdr.proto) *input |=ICE_INSET_IPV6_NEXT_HDR ;if (ipv6_mask->hdr.hop_limits)
Signature · 1 line
2.33.1
PATCH v4 12/23 net/ice: support new pattern of IPv4
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Add definition and pattern entry for IPv4 pattern: MAC/VLAN/IPv4
--- drivers/net/ice/ice_switch_filter.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ice/ice_switch_filter.c +3 -0
@@ -38,6 +38,8 @@ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE)#define ICE_SW_INSET_MAC_VLAN ( \ ICE_SW_INSET_ETHER | ICE_INSET_VLAN_INNER) +#define ICE_SW_INSET_MAC_VLAN_IPV4 ( \ + ICE_SW_INSET_MAC_VLAN | ICE_SW_INSET_MAC_IPV4)#define ICE_SW_INSET_MAC_QINQ ( \ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_VLAN_INNER | \ ICE_INSET_VLAN_OUTER)
@@ -215,6 +217,7 @@ ice_pattern_match_item ice_switch_pattern_dist_list[] = { {pattern_eth_ipv4, ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_udp, ICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv4_tcp, ICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE, ICE_INSET_NONE}, + {pattern_eth_vlan_ipv4, ICE_SW_INSET_MAC_VLAN_IPV4, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6, ICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_udp, ICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_ipv6_tcp, ICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE, ICE_INSET_NONE},
Signature · 1 line
2.33.1
PATCH v4 13/23 net/ice: treat unknown package as OS default package
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
In order to use custom package, unknown package should be treated as OS default package.
--- drivers/net/ice/ice_ethdev.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/ice/ice_ethdev.c +8 -5
@@ -1710,13 +1710,16 @@ ice_load_pkg_type(struct ice_hw *hw)/* store the activated package type (OS default or Comms) */ if (!strncmp ((char *)hw->active_pkg_name,ICE_OS_DEFAULT_PKG_NAME , -ICE_PKG_NAME_SIZE )) +ICE_PKG_NAME_SIZE )) { package_type =ICE_PKG_TYPE_OS_DEFAULT ; -else if (!strncmp ((char *)hw->active_pkg_name,ICE_COMMS_PKG_NAME , -ICE_PKG_NAME_SIZE )) + }else if (!strncmp ((char *)hw->active_pkg_name,ICE_COMMS_PKG_NAME , +ICE_PKG_NAME_SIZE )) { package_type =ICE_PKG_TYPE_COMMS ; -else - package_type =ICE_PKG_TYPE_UNKNOWN ; + }else { +PMD_INIT_LOG (WARNING , +"The package type is not identified, treaded as OS default type" ); + package_type =ICE_PKG_TYPE_OS_DEFAULT ; + } PMD_INIT_LOG(NOTICE, "Active package is: %d.%d.%d.%d, %s (%s VLAN mode)", hw->active_pkg_ver.major, hw->active_pkg_ver.minor,
Signature · 1 line
2.33.1
PATCH v4 14/23 net/ice: handle virtchnl event message without interrupt
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Currently, VF can only handle virtchnl event message by calling interrupt. It is not available in two cases:
1. If the event message comes during VF initialization before interrupt is enabled, this message will not be handled correctly.
2. Some virtchnl commands need to receive the event message and handle it with interrupt disabled.
To solve this issue, we add the virtchnl event message handling in the process of reading vitchnl messages in adminq from PF.
--- drivers/net/ice/ice_dcf.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +23 -2
@@ -63,11 +63,32 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, goto again; v_op =rte_le_to_cpu_32 (event.desc.cookie_high); -if (v_op != op) - goto again; + +if (v_op ==VIRTCHNL_OP_EVENT ) { +struct virtchnl_pf_event *vpe = + (struct virtchnl_pf_event *)event.msg_buf; +switch (vpe->event) { +case VIRTCHNL_EVENT_RESET_IMPENDING : + hw->resetting = true; +if (rsp_msglen) + *rsp_msglen =0 ; +return IAVF_SUCCESS ; +default : + goto again; + } + }else { +/* async reply msg on command issued by vf previously */ +if (v_op != op) { +PMD_DRV_LOG (WARNING , +"command mismatch, expect %u, get %u" , + op, v_op); + goto again; + } + }if (rsp_msglen !=NULL ) *rsp_msglen = event.msg_len; +return rte_le_to_cpu_32 (event.desc.cookie_low); again:
Signature · 1 line
2.33.1
PATCH v4 15/23 net/ice: add DCF request queues function
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Add a new virtchnl function to request additional queues from PF. Current default queue pairs number is 16. In order to support up to 256 queue pairs DCF port, enable this request queues function.
--- drivers/net/ice/ice_dcf.c | 98 +++++++++++++++++++++++++++++++++------ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 86 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +85 -13
@@ -257,7 +257,7 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)VIRTCHNL_VF_CAP_ADV_LINK_SPEED |VIRTCHNL_VF_CAP_DCF |VIRTCHNL_VF_OFFLOAD_VLAN_V2 |VF_BASE_MODE_OFFLOADS |VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | -VIRTCHNL_VF_OFFLOAD_QOS ; +VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES ; err =ice_dcf_send_cmd_req_no_irq (hw,VIRTCHNL_OP_GET_VF_RESOURCES , (uint8_t *)&caps,sizeof (caps));
@@ -468,18 +468,38 @@ ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw, goto ret; } -do { -if (!cmd->pending) -break ; - -rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); - }while (i++ <ICE_DCF_ARQ_MAX_RETRIES ); - -if (cmd->v_ret !=IAVF_SUCCESS ) { - err =-1 ; -PMD_DRV_LOG (ERR , -"No response (%d times) or return failure (%d) for cmd %d" , - i, cmd->v_ret, cmd->v_op); +switch (cmd->v_op) { +case VIRTCHNL_OP_REQUEST_QUEUES : + err =ice_dcf_recv_cmd_rsp_no_irq (hw, +VIRTCHNL_OP_REQUEST_QUEUES , + cmd->rsp_msgbuf, + cmd->rsp_buflen, +NULL ); +if (err !=IAVF_SUCCESS || !hw->resetting) { + err =-1 ; +PMD_DRV_LOG (ERR , +"Failed to get response of " +"VIRTCHNL_OP_REQUEST_QUEUES %d" , + err); + } +break ; +default : +/* For other virtchnl ops in running time, +* wait for the cmd done flag. +*/ +do { +if (!cmd->pending) +break ; +rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); + }while (i++ <ICE_DCF_ARQ_MAX_RETRIES ); + +if (cmd->v_ret !=IAVF_SUCCESS ) { + err =-1 ; +PMD_DRV_LOG (ERR , +"No response (%d times) or " +"return failure (%d) for cmd %d" , + i, cmd->v_ret, cmd->v_op); + } } ret:
@@ -1011,6 +1031,58 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num) +{ +struct virtchnl_vf_res_request vfres; +struct dcf_virtchnl_cmd args; +uint16_t num_queue_pairs; +int err; + +if (!(hw->vf_res->vf_cap_flags & +VIRTCHNL_VF_OFFLOAD_REQ_QUEUES )) { +PMD_DRV_LOG (ERR ,"request queues not supported" ); +return -1 ; + } + +if (num ==0 ) { +PMD_DRV_LOG (ERR ,"queue number cannot be zero" ); +return -1 ; + } + vfres.num_queue_pairs = num; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_REQUEST_QUEUES ; + + args.req_msg = (u8 *)&vfres; + args.req_msglen =sizeof (vfres); + + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + +/* +* disable interrupt to avoid the admin queue message to be read +* before iavf_read_msg_from_pf. +*/ +rte_intr_disable (hw->eth_dev->intr_handle); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +rte_intr_enable (hw->eth_dev->intr_handle); +if (err) { +PMD_DRV_LOG (ERR ,"fail to execute command OP_REQUEST_QUEUES" ); +return err; + } + +/* request additional queues failed, return available number */ + num_queue_pairs = ((struct virtchnl_vf_res_request *) + args.rsp_msgbuf)->num_queue_pairs; +PMD_DRV_LOG (ERR , +"request queues failed, only %u queues available" , + num_queue_pairs); + +return -1 ; +} +int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
drivers/net/ice/ice_dcf.h +1 -0
@@ -127,6 +127,7 @@ int ice_dcf_configure_rss_key(struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw); +int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);
Signature · 1 line
2.33.1
PATCH v4 16/23 net/ice: negotiate large VF and request more queues
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Negotiate large VF capability with PF during VF initialization. If large VF is supported and the number of queues larger than 16 is required, VF requests additional queues from PF. Mark the state that large VF is supported.
If the allocated queues number is larger than 16, the max RSS queue region cannot be 16 anymore. Add the function to query max RSS queue region from PF, use it in the RSS initialization and future filters configuration.
--- drivers/net/ice/ice_dcf.c | 34 +++++++++++++++- drivers/net/ice/ice_dcf.h | 4 ++ drivers/net/ice/ice_dcf_ethdev.c | 69 +++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 2 + 4 files changed, 106 insertions(+), 3 deletions(-)
drivers/net/ice/ice_dcf.c +33 -1
@@ -257,7 +257,8 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)VIRTCHNL_VF_CAP_ADV_LINK_SPEED |VIRTCHNL_VF_CAP_DCF |VIRTCHNL_VF_OFFLOAD_VLAN_V2 |VF_BASE_MODE_OFFLOADS |VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | -VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES ; +VIRTCHNL_VF_OFFLOAD_QOS |VIRTCHNL_VF_OFFLOAD_REQ_QUEUES | +VIRTCHNL_VF_LARGE_NUM_QPAIRS ; err =ice_dcf_send_cmd_req_no_irq (hw,VIRTCHNL_OP_GET_VF_RESOURCES , (uint8_t *)&caps,sizeof (caps));
@@ -1083,6 +1084,37 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)return -1 ; } +int +ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +uint16_t qregion_width; +int err; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_GET_MAX_RSS_QREGION ; + args.req_msg =NULL ; + args.req_msglen =0 ; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"Failed to execute command of " +"VIRTCHNL_OP_GET_MAX_RSS_QREGION" ); +return err; + } + + qregion_width = ((struct virtchnl_max_rss_qregion *) + args.rsp_msgbuf)->qregion_width; + hw->max_rss_qregion = (uint16_t )(1 << qregion_width); + +return 0 ; +} + +int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
drivers/net/ice/ice_dcf.h +4 -0
@@ -105,6 +105,7 @@ struct ice_dcf_hw {uint16_t msix_base;uint16_t nb_msix; +uint16_t max_rss_qregion;/* max RSS queue region supported by PF */ uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset;struct virtchnl_vlan_caps vlan_v2_caps;
@@ -114,6 +115,8 @@ struct ice_dcf_hw {uint32_t link_speed;bool resetting; +/* Indicate large VF support enabled or not */ +bool lv_enabled; }; int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,
@@ -128,6 +131,7 @@ int ice_dcf_configure_rss_lut(struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num); +int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +67 -2
99 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +2 -0
@@ -20,6 +20,8 @@#define ICE_DCF_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 +#define ICE_DCF_MAX_NUM_QUEUES_LV 256struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v4 17/23 net/ice: enable multiple queues configurations for large VF
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
Since the adminq buffer size has a 4K limitation, the current virtchnl command VIRTCHNL_OP_CONFIG_VSI_QUEUES cannot send the message only once to configure up to 256 queues. In this patch, we send the messages multiple times to make sure that the buffer size is less than 4K each time.
--- drivers/net/ice/ice_dcf.c | 11 ++++++----- drivers/net/ice/ice_dcf.h | 3 ++- drivers/net/ice/ice_dcf_ethdev.c | 20 ++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 27 insertions(+), 8 deletions(-)
drivers/net/ice/ice_dcf.c +6 -5
@@ -949,7 +949,8 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw)#define IAVF_RXDID_COMMS_OVS_1 22int -ice_dcf_configure_queues (struct ice_dcf_hw *hw) +ice_dcf_configure_queues (struct ice_dcf_hw *hw, +uint16_t num_queue_pairs,uint16_t index) {struct ice_rx_queue **rxq = (struct ice_rx_queue **)hw->eth_dev->data->rx_queues;
@@ -962,16 +963,16 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)int err; size =sizeof (*vc_config) + -sizeof (vc_config->qpair[0 ]) * hw->num_queue_pairs; +sizeof (vc_config->qpair[0 ]) * num_queue_pairs; vc_config =rte_zmalloc ("cfg_queue" , size,0 );if (!vc_config)return -ENOMEM ; vc_config->vsi_id = hw->vsi_res->vsi_id; - vc_config->num_queue_pairs = hw->num_queue_pairs; + vc_config->num_queue_pairs = num_queue_pairs; -for (i =0 , vc_qp = vc_config->qpair; - i < hw->num_queue_pairs; +for (i = index, vc_qp = vc_config->qpair; + i < index + num_queue_pairs; i++, vc_qp++) { vc_qp->txq.vsi_id = hw->vsi_res->vsi_id; vc_qp->txq.queue_id = i;
drivers/net/ice/ice_dcf.h +2 -1
@@ -129,7 +129,8 @@ void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw);int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw); -int ice_dcf_configure_queues (struct ice_dcf_hw *hw); +int ice_dcf_configure_queues (struct ice_dcf_hw *hw, +uint16_t num_queue_pairs,uint16_t index);int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +18 -2
@@ -513,6 +513,8 @@ ice_dcf_dev_start(struct rte_eth_dev *dev)struct rte_intr_handle *intr_handle = dev->intr_handle;struct ice_adapter *ad = &dcf_ad->parent;struct ice_dcf_hw *hw = &dcf_ad->real_hw; +uint16_t num_queue_pairs; +uint16_t index =0 ;int ret;if (hw->resetting) {
@@ -531,6 +533,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) hw->num_queue_pairs =RTE_MAX (dev->data->nb_rx_queues, dev->data->nb_tx_queues); + num_queue_pairs = hw->num_queue_pairs; ret =ice_dcf_init_rx_queues (dev);if (ret) {
@@ -546,7 +549,20 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) } } - ret =ice_dcf_configure_queues (hw); +/* If needed, send configure queues msg multiple times to make the +* adminq buffer length smaller than the 4K limitation. +*/ +while (num_queue_pairs >ICE_DCF_CFG_Q_NUM_PER_BUF ) { +if (ice_dcf_configure_queues (hw, +ICE_DCF_CFG_Q_NUM_PER_BUF , index) !=0 ) { +PMD_DRV_LOG (ERR ,"configure queues failed" ); + goto err_queue; + } + num_queue_pairs -=ICE_DCF_CFG_Q_NUM_PER_BUF ; + index +=ICE_DCF_CFG_Q_NUM_PER_BUF ; + } + + ret =ice_dcf_configure_queues (hw, num_queue_pairs, index);if (ret) {PMD_DRV_LOG (ERR ,"Fail to config queues" );return ret;
@@ -586,7 +602,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) dev->data->dev_link.link_status =RTE_ETH_LINK_UP ; - +err_queue:return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +1 -0
@@ -22,6 +22,7 @@#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD)#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16#define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v4 18/23 net/ice: enable IRQ mapping configuration for large VF
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
The current IRQ mapping configuration only supports max 16 queues and 16 MSIX vectors. Change the queue vector mapping structure to indicate up to 256 queues. A new opcode is used to handle the case with large number of queues. To avoid adminq buffer size limitation, we support to send the virtchnl message multiple times if needed.
--- drivers/net/ice/ice_dcf.c | 50 +++++++++++++++++++++++++++---- drivers/net/ice/ice_dcf.h | 10 ++++++- drivers/net/ice/ice_dcf_ethdev.c | 51 +++++++++++++++++++++++++++----- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 99 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +45 -5
@@ -1115,7 +1115,6 @@ ice_dcf_get_max_rss_queue_region(struct ice_dcf_hw *hw)return 0 ; } -int ice_dcf_config_irq_map (struct ice_dcf_hw *hw) {
@@ -1132,13 +1131,14 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)return -ENOMEM ; map_info->num_vectors = hw->nb_msix; -for (i =0 ; i < hw->nb_msix; i++) { - vecmap = &map_info->vecmap[i]; +for (i =0 ; i < hw->eth_dev->data->nb_rx_queues; i++) { + vecmap = + &map_info->vecmap[hw->qv_map[i].vector_id - hw->msix_base]; vecmap->vsi_id = hw->vsi_res->vsi_id; vecmap->rxitr_idx =0 ; - vecmap->vector_id = hw->msix_base + i; + vecmap->vector_id = hw->qv_map[i].vector_id; vecmap->txq_map =0 ; - vecmap->rxq_map = hw->rxq_map[hw->msix_base + i]; + vecmap->rxq_map |=1 << hw->qv_map[i].queue_id; }memset (&args,0 ,sizeof (args));
@@ -1154,6 +1154,46 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw, +uint16_t num,uint16_t index) +{ +struct virtchnl_queue_vector_maps *map_info; +struct virtchnl_queue_vector *qv_maps; +struct dcf_virtchnl_cmd args; +int len, i, err; +int count =0 ; + + len =sizeof (struct virtchnl_queue_vector_maps ) + +sizeof (struct virtchnl_queue_vector ) * (num -1 ); + + map_info =rte_zmalloc ("map_info" , len,0 ); +if (!map_info) +return -ENOMEM ; + + map_info->vport_id = hw->vsi_res->vsi_id; + map_info->num_qv_maps = num; +for (i = index; i < index + map_info->num_qv_maps; i++) { + qv_maps = &map_info->qv_maps[count++]; + qv_maps->itr_idx =VIRTCHNL_ITR_IDX_0 ; + qv_maps->queue_type =VIRTCHNL_QUEUE_TYPE_RX ; + qv_maps->queue_id = hw->qv_map[i].queue_id; + qv_maps->vector_id = hw->qv_map[i].vector_id; + } + + args.v_op =VIRTCHNL_OP_MAP_QUEUE_VECTOR ; + args.req_msg = (u8 *)map_info; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.req_msglen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command OP_MAP_QUEUE_VECTOR" ); + +rte_free (map_info); +return err; +} +int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on) {
drivers/net/ice/ice_dcf.h +9 -1
@@ -74,6 +74,11 @@ struct ice_dcf_tm_conf {bool committed; }; +struct ice_dcf_qv_map { +uint16_t queue_id; +uint16_t vector_id; +}; +struct ice_dcf_hw {struct iavf_hw avf;
@@ -106,7 +111,8 @@ struct ice_dcf_hw {uint16_t msix_base;uint16_t nb_msix;uint16_t max_rss_qregion;/* max RSS queue region supported by PF */ -uint16_t rxq_map[16 ]; + +struct ice_dcf_qv_map *qv_map;/* queue vector mapping */ struct virtchnl_eth_stats eth_stats_offset;struct virtchnl_vlan_caps vlan_v2_caps;
@@ -134,6 +140,8 @@ int ice_dcf_configure_queues(struct ice_dcf_hw *hw,int ice_dcf_request_queues (struct ice_dcf_hw *hw,uint16_t num);int ice_dcf_get_max_rss_queue_region (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw); +int ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw, +uint16_t num,uint16_t index);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw); int ice_dcf_query_stats(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_ethdev.c +44 -7
94 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +1 -0
@@ -23,6 +23,7 @@#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16#define ICE_DCF_MAX_NUM_QUEUES_LV 256#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 +#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v4 19/23 net/ice: add enable/disable queues for DCF large VF
In reply to Kevin LiuThe current virtchnl structure for enable/disable queues only supports max 32 queue pairs. Use a new opcode and structure to indicate up to 256 queue pairs, in order to enable/disable queues in large VF case.
--- drivers/net/ice/ice_dcf.c | 99 +++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf.h | 5 ++ drivers/net/ice/ice_dcf_ethdev.c | 26 +++++++-- drivers/net/ice/ice_dcf_ethdev.h | 8 +-- 4 files changed, 125 insertions(+), 13 deletions(-)
drivers/net/ice/ice_dcf.c +96 -3
@@ -90,7 +90,6 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, *rsp_msglen = event.msg_len;return rte_le_to_cpu_32 (event.desc.cookie_low); - again:rte_delay_ms (ICE_DCF_ARQ_CHECK_TIME ); }while (i++ <ICE_DCF_ARQ_MAX_RETRIES );
@@ -896,7 +895,7 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw) {struct rte_eth_dev *dev = hw->eth_dev;struct rte_eth_rss_conf *rss_conf; -uint8_t i, j, nb_q; +uint16_t i, j, nb_q;int ret; rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
@@ -1075,6 +1074,12 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)return err; } +/* request queues succeeded, vf is resetting */ +if (hw->resetting) { +PMD_DRV_LOG (INFO ,"vf is resetting" ); +return 0 ; + } +/* request additional queues failed, return available number */ num_queue_pairs = ((struct virtchnl_vf_res_request *) args.rsp_msgbuf)->num_queue_pairs;
@@ -1185,7 +1190,8 @@ ice_dcf_config_irq_map_lv(struct ice_dcf_hw *hw, args.req_msg = (u8 *)map_info; args.req_msglen = len; args.rsp_msgbuf = hw->arq_buf; - args.req_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; err =ice_dcf_execute_virtchnl_cmd (hw, &args);if (err)PMD_DRV_LOG (ERR ,"fail to execute command OP_MAP_QUEUE_VECTOR" );
@@ -1225,6 +1231,50 @@ ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on)return err; } +int +ice_dcf_switch_queue_lv (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on) +{ +struct virtchnl_del_ena_dis_queues *queue_select; +struct virtchnl_queue_chunk *queue_chunk; +struct dcf_virtchnl_cmd args; +int err, len; + + len =sizeof (struct virtchnl_del_ena_dis_queues ); + queue_select =rte_zmalloc ("queue_select" , len,0 ); +if (!queue_select) +return -ENOMEM ; + + queue_chunk = queue_select->chunks.chunks; + queue_select->chunks.num_chunks =1 ; + queue_select->vport_id = hw->vsi_res->vsi_id; + +if (rx) { + queue_chunk->type =VIRTCHNL_QUEUE_TYPE_RX ; + queue_chunk->start_queue_id = qid; + queue_chunk->num_queues =1 ; + }else { + queue_chunk->type =VIRTCHNL_QUEUE_TYPE_TX ; + queue_chunk->start_queue_id = qid; + queue_chunk->num_queues =1 ; + } + +if (on) + args.v_op =VIRTCHNL_OP_ENABLE_QUEUES_V2 ; +else + args.v_op =VIRTCHNL_OP_DISABLE_QUEUES_V2 ; + args.req_msg = (u8 *)queue_select; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"Failed to execute command of %s" , + on ?"OP_ENABLE_QUEUES_V2" :"OP_DISABLE_QUEUES_V2" ); +rte_free (queue_select); +return err; +} +int ice_dcf_disable_queues (struct ice_dcf_hw *hw) {
@@ -1254,6 +1304,49 @@ ice_dcf_disable_queues(struct ice_dcf_hw *hw)return err; } +int +ice_dcf_disable_queues_lv (struct ice_dcf_hw *hw) +{ +struct virtchnl_del_ena_dis_queues *queue_select; +struct virtchnl_queue_chunk *queue_chunk; +struct dcf_virtchnl_cmd args; +int err, len; + + len =sizeof (struct virtchnl_del_ena_dis_queues ) + +sizeof (struct virtchnl_queue_chunk ) * + (ICE_DCF_RXTX_QUEUE_CHUNKS_NUM -1 ); + queue_select =rte_zmalloc ("queue_select" , len,0 ); +if (!queue_select) +return -ENOMEM ; + + queue_chunk = queue_select->chunks.chunks; + queue_select->chunks.num_chunks =ICE_DCF_RXTX_QUEUE_CHUNKS_NUM ; + queue_select->vport_id = hw->vsi_res->vsi_id; + + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].type =VIRTCHNL_QUEUE_TYPE_TX ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].start_queue_id =0 ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_TX ].num_queues = + hw->eth_dev->data->nb_tx_queues; + + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].type =VIRTCHNL_QUEUE_TYPE_RX ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].start_queue_id =0 ; + queue_chunk[VIRTCHNL_QUEUE_TYPE_RX ].num_queues = + hw->eth_dev->data->nb_rx_queues; + + args.v_op =VIRTCHNL_OP_DISABLE_QUEUES_V2 ; + args.req_msg = (u8 *)queue_select; + args.req_msglen = len; + args.rsp_msgbuf = hw->arq_buf; + args.rsp_msglen =ICE_DCF_AQ_BUF_SZ ; + args.rsp_buflen =ICE_DCF_AQ_BUF_SZ ; + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_QUEUES_V2" ); +rte_free (queue_select); +return err; +} +int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats)
drivers/net/ice/ice_dcf.h +5 -0
@@ -15,6 +15,8 @@#include "base/ice_type.h" #include "ice_logs.h" +#define ICE_DCF_RXTX_QUEUE_CHUNKS_NUM 2 +struct dcf_virtchnl_cmd {TAILQ_ENTRY (dcf_virtchnl_cmd) next;
@@ -143,7 +145,10 @@ int ice_dcf_config_irq_map(struct ice_dcf_hw *hw);int ice_dcf_config_irq_map_lv (struct ice_dcf_hw *hw,uint16_t num,uint16_t index);int ice_dcf_switch_queue (struct ice_dcf_hw *hw,uint16_t qid,bool rx,bool on); +int ice_dcf_switch_queue_lv (struct ice_dcf_hw *hw, +uint16_t qid,bool rx,bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw); +int ice_dcf_disable_queues_lv (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_ethdev.c +20 -6
@@ -317,6 +317,7 @@ static int ice_dcf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) {struct ice_dcf_adapter *ad = dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &ad->real_hw;struct iavf_hw *hw = &ad->real_hw.avf;struct ice_rx_queue *rxq;int err =0 ;
@@ -339,7 +340,11 @@ ice_dcf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)IAVF_WRITE_FLUSH (hw);/* Ready to switch the queue on */ - err =ice_dcf_switch_queue (&ad->real_hw, rx_queue_id, true, true); +if (!dcf_hw->lv_enabled) + err =ice_dcf_switch_queue (dcf_hw, rx_queue_id, true, true); +else + err =ice_dcf_switch_queue_lv (dcf_hw, rx_queue_id, true, true); +if (err) {PMD_DRV_LOG (ERR ,"Failed to switch RX queue %u on" , rx_queue_id);
@@ -448,6 +453,7 @@ static int ice_dcf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) {struct ice_dcf_adapter *ad = dev->data->dev_private; +struct ice_dcf_hw *dcf_hw = &ad->real_hw;struct iavf_hw *hw = &ad->real_hw.avf;struct ice_tx_queue *txq;int err =0 ;
@@ -463,7 +469,10 @@ ice_dcf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)IAVF_WRITE_FLUSH (hw);/* Ready to switch the queue on */ - err =ice_dcf_switch_queue (&ad->real_hw, tx_queue_id, false, true); +if (!dcf_hw->lv_enabled) + err =ice_dcf_switch_queue (dcf_hw, tx_queue_id, false, true); +else + err =ice_dcf_switch_queue_lv (dcf_hw, tx_queue_id, false, true);if (err) { PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on",
@@ -650,12 +659,17 @@ ice_dcf_stop_queues(struct rte_eth_dev *dev)struct ice_dcf_hw *hw = &ad->real_hw;struct ice_rx_queue *rxq;struct ice_tx_queue *txq; -int ret, i; +int i;/* Stop All queues */ - ret =ice_dcf_disable_queues (hw); -if (ret) -PMD_DRV_LOG (WARNING ,"Fail to stop queues" ); +if (!hw->lv_enabled) { +if (ice_dcf_disable_queues (hw)) +PMD_DRV_LOG (WARNING ,"Fail to stop queues" ); + }else { +if (ice_dcf_disable_queues_lv (hw)) +PMD_DRV_LOG (WARNING , +"Fail to stop queues for large VF" ); + }for (i =0 ; i < dev->data->nb_tx_queues; i++) { txq = dev->data->tx_queues[i];
drivers/net/ice/ice_dcf_ethdev.h +4 -4
@@ -20,10 +20,10 @@#define ICE_DCF_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) -#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 -#define ICE_DCF_MAX_NUM_QUEUES_LV 256 -#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 -#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128 +#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 +#define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 +#define ICE_DCF_IRQ_MAP_NUM_PER_BUF 128struct ice_dcf_queue {uint64_t dummy;
Signature · 1 line
2.33.1
PATCH v4 20/23 net/ice: add extended stats
In reply to Kevin LiuAdd implementation of xstats() functions in DCF PMD.
--- drivers/net/ice/ice_dcf.h | 23 +++++++++- drivers/net/ice/ice_dcf_ethdev.c | 75 ++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.h +22 -1
@@ -16,7 +16,11 @@#include "ice_logs.h" #define ICE_DCF_RXTX_QUEUE_CHUNKS_NUM 2 - +/* ICE_DCF_DEV_PRIVATE_TO */ +#define ICE_DCF_DEV_PRIVATE_TO_ADAPTER (adapter) \ + ((struct ice_dcf_adapter *)adapter) +#define ICE_DCF_DEV_PRIVATE_TO_VF (adapter) \ + (&((struct ice_dcf_adapter *)adapter)->vf)struct dcf_virtchnl_cmd {TAILQ_ENTRY (dcf_virtchnl_cmd) next;
@@ -81,6 +85,23 @@ struct ice_dcf_qv_map {uint16_t vector_id; }; +struct ice_dcf_eth_stats { +u64 rx_bytes;/* gorc */ +u64 rx_unicast;/* uprc */ +u64 rx_multicast;/* mprc */ +u64 rx_broadcast;/* bprc */ +u64 rx_discards;/* rdpc */ +u64 rx_unknown_protocol;/* rupp */ +u64 tx_bytes;/* gotc */ +u64 tx_unicast;/* uptc */ +u64 tx_multicast;/* mptc */ +u64 tx_broadcast;/* bptc */ +u64 tx_discards;/* tdpc */ +u64 tx_errors;/* tepc */ +u64 rx_no_desc;/* repc */ +u64 rx_errors;/* repc */ +}; +struct ice_dcf_hw {struct iavf_hw avf;
drivers/net/ice/ice_dcf_ethdev.c +75 -0
93 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v4 21/23 net/ice: support queue information getting
In reply to Kevin LiuAdd below ops,rxq_info_gettxq_info_get
--- drivers/net/ice/ice_dcf_ethdev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +2 -0
@@ -1950,6 +1950,8 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .tx_queue_start = ice_dcf_tx_queue_start, .rx_queue_stop = ice_dcf_rx_queue_stop, .tx_queue_stop = ice_dcf_tx_queue_stop, + .rxq_info_get = ice_rxq_info_get, + .txq_info_get = ice_txq_info_get, .link_update = ice_dcf_link_update, .stats_get = ice_dcf_stats_get, .stats_reset = ice_dcf_stats_reset,
Signature · 1 line
2.33.1
PATCH v4 22/23 net/ice: implement power management
In reply to Kevin LiuImplement support for the power management API by implementing a 'get_monitor_addr' function that will return an address of an RX ring's status bit.
--- drivers/net/ice/ice_dcf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/ice_dcf_ethdev.c +1 -0
@@ -1952,6 +1952,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .tx_queue_stop = ice_dcf_tx_queue_stop, .rxq_info_get = ice_rxq_info_get, .txq_info_get = ice_txq_info_get, + .get_monitor_addr = ice_get_monitor_addr, .link_update = ice_dcf_link_update, .stats_get = ice_dcf_stats_get, .stats_reset = ice_dcf_stats_reset,
Signature · 1 line
2.33.1
PATCH v4 23/23 doc: update for ice DCF datapath configuration
In reply to Kevin LiuUpdate "ice_dcf" driver feature list.
--- doc/guides/nics/features/ice_dcf.ini | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
doc/guides/nics/features/ice_dcf.ini +15 -0
@@ -15,6 +15,21 @@ L3 checksum offload = P L4 checksum offload = P Inner L3 checksum = P Inner L4 checksum = P +Promiscuous mode = Y +Allmulticast mode = Y +Unicast MAC filter = Y +Link status = Y +Link status event = Y +Packet type parsing = Y +VLAN filter = Y +VLAN offload = Y +RSS hash = Y +RSS key update = Y +RSS reta update = Y +Basic stats = Y +Extended stats = Y +MTU update = Y +Power mgmt address monitor = Y Basic stats = Y Linux = Y x86-32 = Y
Signature · 1 line
2.33.1
v5 cover complete common VF features for DCF
In reply to Kevin LiuThe DCF PMD support the below dev ops,dev_supported_ptypes_getdev_link_updatexstats_getxstats_get_namesxstats_resetpromiscuous_enablepromiscuous_disableallmulticast_enableallmulticast_disablemac_addr_addmac_addr_removeset_mc_addr_listvlan_filter_setvlan_offload_setmac_addr_setreta_updatereta_queryrss_hash_updaterss_hash_conf_getrxq_info_gettxq_info_getmtu_settx_done_cleanupget_monitor_addr
v5:
* remove patch:
1.complete common VF features for DCF
2.net/ice: enable CVL DCF device reset API 3.net/ice: support IPv6 NVGRE tunnel
4.net/ice: support new pattern of IPv4
5.net/ice: treat unknown package as OS default package 6.net/ice: handle virtchnl event message without interrupt 7.net/ice: add DCF request queues function 8.net/ice: negotiate large VF and request more queues 9.net/ice: enable multiple queues configurations for large VF 10.net/ice: enable IRQ mapping configuration for large VF 11.net/ice: add enable/disable queues for DCF large VF
v4:
* remove patch:
1.testpmd: force flow flush
2.net/ice: fix DCF ACL flow engine 3.net/ice: fix DCF reset
* add patch:
1.net/ice: add extended stats 2.net/ice: support queue information getting 3.net/ice: implement power management 4.doc: update for ice DCF datapath configuration
v3:
* remove patch:
1.net/ice/base: add VXLAN support for switch filter 2.net/ice: add VXLAN support for switch filter 3.common/iavf: support flushing rules and reporting DCF id 4.net/ice/base: fix ethertype filter input set 5.net/ice/base: support IPv6 GRE UDP pattern 6.net/ice/base: support new patterns of TCP and UDP 7.net/ice: support new patterns of TCP and UDP 8.net/ice/base: support IPv4 GRE tunnel 9.net/ice: support IPv4 GRE raw pattern type 10.net/ice/base: update Profile ID table for VXLAN 11.net/ice/base: update Protocol ID table to match DVM DDP
v2:
* remove patch:
1.net/iavf: support checking if device is an MDCF instance 2.net/ice: support MDCF(multi-DCF) instance 3.net/ice/base: support custom DDP buildin recipe 4.net/ice: support buildin recipe configuration 5.net/ice/base: support custom ddp package version 6.net/ice: disable ACL function for MDCF instance
Alvin Zhang (2):
net/ice: support dcf promisc configuration net/ice: support dcf VLAN filter and offload configuration
Jie Wang (2):
net/ice: add ops MTU-SET to dcf
net/ice: add ops dev-supported-ptypes-get to dcf
Kevin Liu (5):
net/ice: support dcf MAC configuration
net/ice: add extended stats
net/ice: support queue information getting
net/ice: implement power management
doc: update for ice DCF datapath configuration
Robin Zhang (1):
net/ice: cleanup Tx buffers
Steve Yang (2):
net/ice: enable RSS RETA ops for DCF hardware
net/ice: enable RSS HASH ops for DCF hardware
doc/guides/nics/features/ice_dcf.ini | 15 + drivers/net/ice/ice_dcf.c | 13 +- drivers/net/ice/ice_dcf.h | 28 +- drivers/net/ice/ice_dcf_ethdev.c | 683 +++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 10 + 5 files changed, 711 insertions(+), 38 deletions(-)
Signature · 1 line
2.33.1
PATCH v5 1/12 net/ice: enable RSS RETA ops for DCF hardware
From: Steve Yang <[email protected]>
RSS RETA should be updated and queried by application, Add related ops ('.reta_update', '.reta_query') for DCF.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -790,7 +790,7 @@ ice_dcf_configure_rss_key(struct ice_dcf_hw *hw)return err; } -static int +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw) {struct virtchnl_rss_lut *rss_lut;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +77 -0
89 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v5 2/12 net/ice: enable RSS HASH ops for DCF hardware
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
RSS HASH should be updated and queried by application, Add related ops ('.rss_hash_update', '.rss_hash_conf_get') for DCF.
Because DCF doesn't support configure RSS HASH, only HASH key can be updated within ops '.rss_hash_update'.
--- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 51 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
@@ -758,7 +758,7 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw) hw->ets_config =NULL ; } -static int +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw) {struct virtchnl_rss_key *rss_key;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +51 -0
63 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v5 3/12 net/ice: cleanup Tx buffers
In reply to Kevin LiuFrom: Robin Zhang <[email protected]>
Add support for ops rte_eth_tx_done_cleanup in dcf
--- drivers/net/ice/ice_dcf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/ice_dcf_ethdev.c +1 -0
@@ -1235,6 +1235,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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, }; static int
Signature · 1 line
2.33.1
PATCH v5 4/12 net/ice: add ops MTU-SET to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "mtu_set" to dcf, and it can configure the port mtu through cmdline.
--- drivers/net/ice/ice_dcf_ethdev.c | 14 ++++++++++++++ drivers/net/ice/ice_dcf_ethdev.h | 6 ++++++ 2 files changed, 20 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +14 -0
@@ -1081,6 +1081,19 @@ ice_dcf_link_update(struct rte_eth_dev *dev,return rte_eth_linkstatus_set (dev, &new_link); } +static int +ice_dcf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) +{ +/* mtu setting is forbidden if port is start */ +if (dev->data->dev_started !=0 ) { +PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , + dev->data->port_id); +return -EBUSY ; + } + +return 0 ; +} +bool ice_dcf_adminq_need_retry (struct ice_adapter *ad) {
@@ -1236,6 +1249,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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
drivers/net/ice/ice_dcf_ethdev.h +6 -0
@@ -15,6 +15,12 @@#define ICE_DCF_MAX_RINGS 1 +#define ICE_DCF_FRAME_SIZE_MAX 9728 +#define ICE_DCF_VLAN_TAG_SIZE 4 +#define ICE_DCF_ETH_OVERHEAD \ + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2) +#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +struct ice_dcf_queue {uint64_t dummy; };
Signature · 1 line
2.33.1
PATCH v5 5/12 net/ice: add ops dev-supported-ptypes-get to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "dev_supported_ptypes_get" to dcf, that dcf pmd can get ptypes through the new API.
--- drivers/net/ice/ice_dcf_ethdev.c | 80 +++++++++++++++++++------------- 1 file changed, 49 insertions(+), 31 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +49 -31
@@ -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
Signature · 1 line
2.33.1
PATCH v5 6/12 net/ice: support dcf promisc configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Support configuration of unicast and multicast promisc on dcf.
--- drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 3 ++ 2 files changed, 76 insertions(+), 4 deletions(-)
drivers/net/ice/ice_dcf_ethdev.c +73 -4
@@ -727,27 +727,95 @@ ice_dcf_dev_info_get(struct rte_eth_dev *dev, }static int -ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +dcf_config_promisc (struct ice_dcf_adapter *adapter, +bool enable_unicast, +bool enable_multicast) { +struct ice_dcf_hw *hw = &adapter->real_hw; +struct virtchnl_promisc_info promisc; +struct dcf_virtchnl_cmd args; +int err; + + promisc.flags =0 ; + promisc.vsi_id = hw->vsi_res->vsi_id; + +if (enable_unicast) + promisc.flags |=FLAG_VF_UNICAST_PROMISC ; + +if (enable_multicast) + promisc.flags |=FLAG_VF_MULTICAST_PROMISC ; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE ; + args.req_msg = (uint8_t *)&promisc; + args.req_msglen =sizeof (promisc); + + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) { +PMD_DRV_LOG (ERR , +"fail to execute command VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE" ); +return err; + } + + adapter->promisc_unicast_enabled = enable_unicast; + adapter->promisc_multicast_enabled = enable_multicast;return 0 ; } +static int +ice_dcf_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, true, + adapter->promisc_multicast_enabled); +} +static int ice_dcf_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_unicast_enabled) { +PMD_DRV_LOG (INFO ,"promiscuous has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, false, + adapter->promisc_multicast_enabled); }static int ice_dcf_dev_allmulticast_enable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been enabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + true); }static int ice_dcf_dev_allmulticast_disable(__rte_unused struct rte_eth_dev *dev) { -return 0 ; +struct ice_dcf_adapter *adapter = dev->data->dev_private; + +if (!adapter->promisc_multicast_enabled) { +PMD_DRV_LOG (INFO ,"allmulticast has been disabled" ); +return 0 ; + } + +return dcf_config_promisc (adapter, adapter->promisc_unicast_enabled, + false); } static int
@@ -1299,6 +1367,7 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev)return -1 ; } +dcf_config_promisc (adapter, false, false);return 0 ; }
drivers/net/ice/ice_dcf_ethdev.h +3 -0
@@ -33,6 +33,9 @@ struct ice_dcf_adapter {struct ice_adapter parent;/* Must be first */ struct ice_dcf_hw real_hw; +bool promisc_unicast_enabled; +bool promisc_multicast_enabled; +int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH v5 7/12 net/ice: support dcf MAC configuration
In reply to Kevin LiuBelow PMD ops are supported in this patch:
.mac_addr_add = dcf_dev_add_mac_addr
.mac_addr_remove = dcf_dev_del_mac_addr
.set_mc_addr_list = dcf_set_mc_addr_list
.mac_addr_set = dcf_dev_set_default_mac_addr--- drivers/net/ice/ice_dcf.c | 9 +- drivers/net/ice/ice_dcf.h | 4 +- drivers/net/ice/ice_dcf_ethdev.c | 218 ++++++++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 5 +- 4 files changed, 226 insertions(+), 10 deletions(-)
drivers/net/ice/ice_dcf.c +5 -4
@@ -1089,10 +1089,11 @@ ice_dcf_query_stats(struct ice_dcf_hw *hw, }int -ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add) +ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr, +bool add,uint8_t type) {struct virtchnl_ether_addr_list *list; -struct rte_ether_addr *addr;struct dcf_virtchnl_cmd args;int len, err =0 ;
@@ -1105,7 +1106,6 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add) } len =sizeof (struct virtchnl_ether_addr_list ); - addr = hw->eth_dev->data->mac_addrs; len +=sizeof (struct virtchnl_ether_addr ); list =rte_zmalloc (NULL , len,0 );
@@ -1116,9 +1116,10 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add)rte_memcpy (list->list[0 ].addr, addr->addr_bytes,sizeof (addr->addr_bytes)); +PMD_DRV_LOG (DEBUG ,"add/rm mac:" RTE_ETHER_ADDR_PRT_FMT ,RTE_ETHER_ADDR_BYTES (addr)); - + list->list[0 ].type = type; list->vsi_id = hw->vsi_res->vsi_id; list->num_elements =1 ;
drivers/net/ice/ice_dcf.h +3 -1
@@ -131,7 +131,9 @@ int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on);int ice_dcf_disable_queues (struct ice_dcf_hw *hw);int ice_dcf_query_stats (struct ice_dcf_hw *hw,struct virtchnl_eth_stats *pstats); -int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw,bool add); +int ice_dcf_add_del_all_mac_addr (struct ice_dcf_hw *hw, +struct rte_ether_addr *addr,bool add, +uint8_t type);int ice_dcf_link_update (struct rte_eth_dev *dev, __rte_unused int wait_to_complete);void ice_dcf_tm_conf_init (struct rte_eth_dev *dev);
drivers/net/ice/ice_dcf_ethdev.c +215 -3
259 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +3 -2
@@ -14,7 +14,7 @@#include "ice_dcf.h" #define ICE_DCF_MAX_RINGS 1 - +#define DCF_NUM_MACADDR_MAX 64#define ICE_DCF_FRAME_SIZE_MAX 9728#define ICE_DCF_VLAN_TAG_SIZE 4#define ICE_DCF_ETH_OVERHEAD \
@@ -35,7 +35,8 @@ struct ice_dcf_adapter {bool promisc_unicast_enabled;bool promisc_multicast_enabled; - +uint32_t mc_addrs_num; +struct rte_ether_addr mc_addrs[DCF_NUM_MACADDR_MAX ];int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1
PATCH v5 8/12 net/ice: support dcf VLAN filter and offload configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Below PMD ops are supported in this patch:
.vlan_filter_set = dcf_dev_vlan_filter_set
.vlan_offload_set = dcf_dev_vlan_offload_set
--- drivers/net/ice/ice_dcf_ethdev.c | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +101 -0
@@ -1026,6 +1026,105 @@ dcf_dev_set_default_mac_addr(struct rte_eth_dev *dev,return 0 ; } +static int +dcf_add_del_vlan (struct ice_dcf_hw *hw,uint16_t vlanid,bool add) +{ +struct virtchnl_vlan_filter_list *vlan_list; +uint8_t cmd_buffer[sizeof (struct virtchnl_vlan_filter_list ) + +sizeof (uint16_t )]; +struct dcf_virtchnl_cmd args; +int err; + + vlan_list = (struct virtchnl_vlan_filter_list *)cmd_buffer; + vlan_list->vsi_id = hw->vsi_res->vsi_id; + vlan_list->num_elements =1 ; + vlan_list->vlan_id[0 ] = vlanid; + +memset (&args,0 ,sizeof (args)); + args.v_op = add ?VIRTCHNL_OP_ADD_VLAN :VIRTCHNL_OP_DEL_VLAN ; + args.req_msg = cmd_buffer; + args.req_msglen =sizeof (cmd_buffer); + err =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (err) +PMD_DRV_LOG (ERR ,"fail to execute command %s" , + add ?"OP_ADD_VLAN" :"OP_DEL_VLAN" ); + +return err; +} + +static int +dcf_enable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_ENABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_ENABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_disable_vlan_strip (struct ice_dcf_hw *hw) +{ +struct dcf_virtchnl_cmd args; +int ret; + +memset (&args,0 ,sizeof (args)); + args.v_op =VIRTCHNL_OP_DISABLE_VLAN_STRIPPING ; + ret =ice_dcf_execute_virtchnl_cmd (hw, &args); +if (ret) +PMD_DRV_LOG (ERR , +"Failed to execute command of OP_DISABLE_VLAN_STRIPPING" ); + +return ret; +} + +static int +dcf_dev_vlan_filter_set (struct rte_eth_dev *dev,uint16_t vlan_id,int on) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + + err =dcf_add_del_vlan (hw, vlan_id, on); +if (err) +return -EIO ; +return 0 ; +} + +static int +dcf_dev_vlan_offload_set (struct rte_eth_dev *dev,int mask) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +struct rte_eth_conf *dev_conf = &dev->data->dev_conf; +int err; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN )) +return -ENOTSUP ; + +/* Vlan stripping setting */ +if (mask &RTE_ETH_VLAN_STRIP_MASK ) { +/* Enable or disable VLAN stripping */ +if (dev_conf->rxmode.offloads &RTE_ETH_RX_OFFLOAD_VLAN_STRIP ) + err =dcf_enable_vlan_strip (hw); +else + err =dcf_disable_vlan_strip (hw); + +if (err) +return -EIO ; + } +return 0 ; +} +static int ice_dcf_dev_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops)
@@ -1538,6 +1637,8 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .mac_addr_remove = dcf_dev_del_mac_addr, .set_mc_addr_list = dcf_set_mc_addr_list, .mac_addr_set = dcf_dev_set_default_mac_addr, + .vlan_filter_set = dcf_dev_vlan_filter_set, + .vlan_offload_set = dcf_dev_vlan_offload_set, .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,
Signature · 1 line
2.33.1
PATCH v5 9/12 net/ice: add extended stats
In reply to Kevin LiuAdd implementation of xstats() functions in DCF PMD.
--- drivers/net/ice/ice_dcf.h | 22 ++++++++++ drivers/net/ice/ice_dcf_ethdev.c | 75 ++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+)
drivers/net/ice/ice_dcf.h +22 -0
@@ -15,6 +15,12 @@#include "base/ice_type.h" #include "ice_logs.h" +/* ICE_DCF_DEV_PRIVATE_TO */ +#define ICE_DCF_DEV_PRIVATE_TO_ADAPTER (adapter) \ + ((struct ice_dcf_adapter *)adapter) +#define ICE_DCF_DEV_PRIVATE_TO_VF (adapter) \ + (&((struct ice_dcf_adapter *)adapter)->vf) +struct dcf_virtchnl_cmd {TAILQ_ENTRY (dcf_virtchnl_cmd) next;
@@ -74,6 +80,22 @@ struct ice_dcf_tm_conf {bool committed; }; +struct ice_dcf_eth_stats { +u64 rx_bytes;/* gorc */ +u64 rx_unicast;/* uprc */ +u64 rx_multicast;/* mprc */ +u64 rx_broadcast;/* bprc */ +u64 rx_discards;/* rdpc */ +u64 rx_unknown_protocol;/* rupp */ +u64 tx_bytes;/* gotc */ +u64 tx_unicast;/* uptc */ +u64 tx_multicast;/* mptc */ +u64 tx_broadcast;/* bptc */ +u64 tx_discards;/* tdpc */ +u64 tx_errors;/* tepc */ +u64 rx_no_desc;/* repc */ +u64 rx_errors;/* repc */ +};struct ice_dcf_hw {struct iavf_hw avf;
drivers/net/ice/ice_dcf_ethdev.c +75 -0
93 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v5 10/12 net/ice: support queue information getting
In reply to Kevin LiuAdd below ops,rxq_info_gettxq_info_get
--- drivers/net/ice/ice_dcf_ethdev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ice/ice_dcf_ethdev.c +2 -0
@@ -1698,6 +1698,8 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .tx_queue_start = ice_dcf_tx_queue_start, .rx_queue_stop = ice_dcf_rx_queue_stop, .tx_queue_stop = ice_dcf_tx_queue_stop, + .rxq_info_get = ice_rxq_info_get, + .txq_info_get = ice_txq_info_get, .link_update = ice_dcf_link_update, .stats_get = ice_dcf_stats_get, .stats_reset = ice_dcf_stats_reset,
Signature · 1 line
2.33.1
PATCH v5 11/12 net/ice: implement power management
In reply to Kevin LiuImplement support for the power management API by implementing a 'get_monitor_addr' function that will return an address of an RX ring's status bit.
--- drivers/net/ice/ice_dcf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/ice_dcf_ethdev.c +1 -0
@@ -1700,6 +1700,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .tx_queue_stop = ice_dcf_tx_queue_stop, .rxq_info_get = ice_rxq_info_get, .txq_info_get = ice_txq_info_get, + .get_monitor_addr = ice_get_monitor_addr, .link_update = ice_dcf_link_update, .stats_get = ice_dcf_stats_get, .stats_reset = ice_dcf_stats_reset,
Signature · 1 line
2.33.1
PATCH v5 12/12 doc: update for ice DCF datapath configuration
In reply to Kevin LiuUpdate "ice_dcf" driver feature list.
--- doc/guides/nics/features/ice_dcf.ini | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
doc/guides/nics/features/ice_dcf.ini +15 -0
@@ -15,6 +15,21 @@ L3 checksum offload = P L4 checksum offload = P Inner L3 checksum = P Inner L4 checksum = P +Promiscuous mode = Y +Allmulticast mode = Y +Unicast MAC filter = Y +Link status = Y +Link status event = Y +Packet type parsing = Y +VLAN filter = Y +VLAN offload = Y +RSS hash = Y +RSS key update = Y +RSS reta update = Y +Basic stats = Y +Extended stats = Y +MTU update = Y +Power mgmt address monitor = Y Basic stats = Y Linux = Y x86-32 = Y
Signature · 1 line
2.33.1
v6 cover complete common VF features for DCF
In reply to Kevin LiuThe DCF PMD support the below dev ops,dev_supported_ptypes_getdev_link_updatexstats_getxstats_get_namesxstats_resetpromiscuous_enablepromiscuous_disableallmulticast_enableallmulticast_disablemac_addr_addmac_addr_removeset_mc_addr_listvlan_filter_setvlan_offload_setmac_addr_setreta_updatereta_queryrss_hash_updaterss_hash_conf_getrxq_info_gettxq_info_getmtu_settx_done_cleanupget_monitor_addr
v6:
* add patch:
1.net/ice: support DCF new VLAN capabilities
* remove patch:
1.doc: update for ice DCF datapath configuration
* Split doc into specific patch.
v5:
* remove patch:
1.complete common VF features for DCF
2.net/ice: enable CVL DCF device reset API 3.net/ice: support IPv6 NVGRE tunnel
4.net/ice: support new pattern of IPv4
5.net/ice: treat unknown package as OS default package 6.net/ice: handle virtchnl event message without interrupt 7.net/ice: add DCF request queues function 8.net/ice: negotiate large VF and request more queues 9.net/ice: enable multiple queues configurations for large VF 10.net/ice: enable IRQ mapping configuration for large VF 11.net/ice: add enable/disable queues for DCF large VF
v4:
* remove patch:
1.testpmd: force flow flush
2.net/ice: fix DCF ACL flow engine 3.net/ice: fix DCF reset
* add patch:
1.net/ice: add extended stats 2.net/ice: support queue information getting 3.net/ice: implement power management 4.doc: update for ice DCF datapath configuration
v3:
* remove patch:
1.net/ice/base: add VXLAN support for switch filter 2.net/ice: add VXLAN support for switch filter 3.common/iavf: support flushing rules and reporting DCF id 4.net/ice/base: fix ethertype filter input set 5.net/ice/base: support IPv6 GRE UDP pattern 6.net/ice/base: support new patterns of TCP and UDP 7.net/ice: support new patterns of TCP and UDP 8.net/ice/base: support IPv4 GRE tunnel 9.net/ice: support IPv4 GRE raw pattern type 10.net/ice/base: update Profile ID table for VXLAN 11.net/ice/base: update Protocol ID table to match DVM DDP
v2:
* remove patch:
1.net/iavf: support checking if device is an MDCF instance 2.net/ice: support MDCF(multi-DCF) instance 3.net/ice/base: support custom DDP buildin recipe 4.net/ice: support buildin recipe configuration 5.net/ice/base: support custom ddp package version 6.net/ice: disable ACL function for MDCF instance
Alvin Zhang (3):
net/ice: support dcf promisc configuration net/ice: support dcf VLAN filter and offload configuration net/ice: support DCF new VLAN capabilities
Jie Wang (2):
net/ice: add ops MTU-SET to dcf
net/ice: add ops dev-supported-ptypes-get to dcf
Kevin Liu (4):
net/ice: support dcf MAC configuration
net/ice: add extended stats
net/ice: support queue information getting
net/ice: implement power management
Robin Zhang (1):
net/ice: cleanup Tx buffers
Steve Yang (2):
net/ice: enable RSS RETA ops for DCF hardware
net/ice: enable RSS HASH ops for DCF hardware
doc/guides/nics/features/ice_dcf.ini | 10 + doc/guides/rel_notes/release_22_07.rst | 14 + drivers/net/ice/ice_dcf.c | 40 +- drivers/net/ice/ice_dcf.h | 29 +- drivers/net/ice/ice_dcf_ethdev.c | 820 ++++++++++++++++++++++++- drivers/net/ice/ice_dcf_ethdev.h | 10 + 6 files changed, 885 insertions(+), 38 deletions(-)
Signature · 1 line
2.33.1
PATCH v6 1/12 net/ice: enable RSS RETA ops for DCF hardware
From: Steve Yang <[email protected]>
RSS RETA should be updated and queried by application, Add related ops ('.reta_update', '.reta_query') for DCF.
--- doc/guides/nics/features/ice_dcf.ini | 1 + doc/guides/rel_notes/release_22_07.rst | 3 + drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 1 deletion(-)
doc/guides/nics/features/ice_dcf.ini +1 -0
@@ -15,6 +15,7 @@ L3 checksum offload = P L4 checksum offload = P Inner L3 checksum = P Inner L4 checksum = P +RSS reta update = Y Basic stats = Y Linux = Y x86-32 = Y
doc/guides/rel_notes/release_22_07.rst +3 -0
@@ -60,6 +60,9 @@ New Features * Added Tx QoS queue rate limitation support. * Added quanta size configuration support. +* **Updated Intel ice driver.** + + * Added enable RSS RETA ops for DCF hardware. Removed Items -------------
drivers/net/ice/ice_dcf.c +1 -1
@@ -790,7 +790,7 @@ ice_dcf_configure_rss_key(struct ice_dcf_hw *hw)return err; } -static int +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw) {struct virtchnl_rss_lut *rss_lut;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);int ice_dcf_config_irq_map (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +77 -0
89 lines not on this page · raw message
Signature · 1 line
2.33.1
RE: [PATCH v6 01/12] net/ice: enable RSS RETA ops for DCF hardware
Quoted 45 lines
-----Original Message-----
From: Liu, KevinX <[email protected]>
Sent: Thursday, April 28, 2022 2:13 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Yang, SteveX <[email protected]>; Liu, KevinX <[email protected]>
Subject: [PATCH v6 01/12] net/ice: enable RSS RETA ops for DCF hardwareFrom: Steve Yang <[email protected]>
RSS RETA should be updated and queried by application, Add related ops ('.reta_update', '.reta_query') for DCF.
Signed-off-by Steve Yang <[email protected]>Signed-off-by Kevin Liu <[email protected]>--- doc/guides/nics/features/ice_dcf.ini | 1 + doc/guides/rel_notes/release_22_07.rst | 3 + drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 1 deletion(-)doc/guides/nics/features/ice_dcf.ini +1
-0@@ -15,6 +15,7 @@ L3 checksum offload = P L4 checksum offload = P Inner L3 checksum = P Inner L4 checksum = P +RSS reta update = Y Basic stats = Y Linux = Y x86-32 = Ydoc/guides/rel_notes/release_22_07.rst +0
-0
doc/guides/rel_notes/release_22_07.rst New Features · line 65
Quoted 6 lines
doc/guides/rel_notes/release_22_07.rst +3
-0@@ -60,6 +60,9 @@ New Features * Added Tx QoS queue rate limitation support. * Added quanta size configuration support. +* **Updated Intel ice driver.** + + * Added enable RSS RETA ops for DCF hardware.
There is no DCF hardware, better change to
Added support for RSS RETA configure in DCF mode.
PATCH v6 2/12 net/ice: enable RSS HASH ops for DCF hardware
In reply to Kevin LiuFrom: Steve Yang <[email protected]>
RSS HASH should be updated and queried by application, Add related ops ('.rss_hash_update', '.rss_hash_conf_get') for DCF.
Because DCF doesn't support configure RSS HASH, only HASH key can be updated within ops '.rss_hash_update'.
--- doc/guides/nics/features/ice_dcf.ini | 1 + doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 51 ++++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 1 deletion(-)
doc/guides/nics/features/ice_dcf.ini +1 -0
@@ -16,6 +16,7 @@ L4 checksum offload = P Inner L3 checksum = P Inner L4 checksum = P RSS reta update = Y +RSS key update = Y Basic stats = Y Linux = Y x86-32 = Y
doc/guides/rel_notes/release_22_07.rst +1 -0
@@ -63,6 +63,7 @@ New Features * **Updated Intel ice driver.** * Added enable RSS RETA ops for DCF hardware. + * Added enable RSS HASH ops for DCF hardware. Removed Items -------------
drivers/net/ice/ice_dcf.c +1 -1
@@ -758,7 +758,7 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw) hw->ets_config =NULL ; } -static int +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw) {struct virtchnl_rss_key *rss_key;
drivers/net/ice/ice_dcf.h +1 -0
@@ -122,6 +122,7 @@ int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,int ice_dcf_handle_vsi_update_event (struct ice_dcf_hw *hw);int ice_dcf_init_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw);void ice_dcf_uninit_hw (struct rte_eth_dev *eth_dev,struct ice_dcf_hw *hw); +int ice_dcf_configure_rss_key (struct ice_dcf_hw *hw);int ice_dcf_configure_rss_lut (struct ice_dcf_hw *hw);int ice_dcf_init_rss (struct ice_dcf_hw *hw);int ice_dcf_configure_queues (struct ice_dcf_hw *hw);
drivers/net/ice/ice_dcf_ethdev.c +51 -0
63 lines not on this page · raw message
Signature · 1 line
2.33.1
PATCH v6 3/12 net/ice: cleanup Tx buffers
In reply to Kevin LiuFrom: Robin Zhang <[email protected]>
Add support for ops rte_eth_tx_done_cleanup in dcf
--- doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_dcf_ethdev.c | 1 + 2 files changed, 2 insertions(+)
doc/guides/rel_notes/release_22_07.rst +1 -0
@@ -64,6 +64,7 @@ New Features * Added enable RSS RETA ops for DCF hardware. * Added enable RSS HASH ops for DCF hardware. + * Added cleanup Tx buffers. Removed Items -------------
drivers/net/ice/ice_dcf_ethdev.c +1 -0
@@ -1235,6 +1235,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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, }; static int
Signature · 1 line
2.33.1
RE: [PATCH v6 03/12] net/ice: cleanup Tx buffers
Quoted 28 lines
-----Original Message-----
From: Liu, KevinX <[email protected]>
Sent: Thursday, April 28, 2022 2:13 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; Liu, KevinX <[email protected]>
Subject: [PATCH v6 03/12] net/ice: cleanup Tx buffersFrom: Robin Zhang <[email protected]>
Add support for ops
rte_eth_tx_done_cleanupin dcfSigned-off-by Robin Zhang <[email protected]>Signed-off-by Kevin Liu <[email protected]>--- doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_dcf_ethdev.c | 1 + 2 files changed, 2 insertions(+)doc/guides/rel_notes/release_22_07.rst +0
-0
doc/guides/rel_notes/release_22_07.rst New Features · line 67
Quoted 4 lines
doc/guides/rel_notes/release_22_07.rst +1
-0@@ -64,6 +64,7 @@ New Features * Added enable RSS RETA ops for DCF hardware. * Added enable RSS HASH ops for DCF hardware. + * Added cleanup Tx buffers.
Please keep the pattern be consistent,
Added support for Tx buffer cleanup in DCF mode.
Anyway, this is not worth for a release note update, you can remove it.
Quoted 18 lines
doc/guides/rel_notes/release_22_07.rst +0
-0Removed Items -------------drivers/net/ice/ice_dcf_ethdev.c +1
-0@@ -1235,6 +1235,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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, };static int
--
2.33.1
PATCH v6 4/12 net/ice: add ops MTU-SET to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "mtu_set" to dcf, and it can configure the port mtu through cmdline.
--- doc/guides/nics/features/ice_dcf.ini | 1 + doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_dcf_ethdev.c | 14 ++++++++++++++ drivers/net/ice/ice_dcf_ethdev.h | 6 ++++++ 4 files changed, 22 insertions(+)
doc/guides/nics/features/ice_dcf.ini +1 -0
@@ -17,6 +17,7 @@ Inner L3 checksum = P Inner L4 checksum = P RSS reta update = Y RSS key update = Y +MTU update = Y Basic stats = Y Linux = Y x86-32 = Y
doc/guides/rel_notes/release_22_07.rst +1 -0
@@ -65,6 +65,7 @@ New Features * Added enable RSS RETA ops for DCF hardware. * Added enable RSS HASH ops for DCF hardware. * Added cleanup Tx buffers. + * Added add ops MTU-SET to dcf. Removed Items -------------
drivers/net/ice/ice_dcf_ethdev.c +14 -0
@@ -1081,6 +1081,19 @@ ice_dcf_link_update(struct rte_eth_dev *dev,return rte_eth_linkstatus_set (dev, &new_link); } +static int +ice_dcf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) +{ +/* mtu setting is forbidden if port is start */ +if (dev->data->dev_started !=0 ) { +PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , + dev->data->port_id); +return -EBUSY ; + } + +return 0 ; +} +bool ice_dcf_adminq_need_retry (struct ice_adapter *ad) {
@@ -1236,6 +1249,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .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
drivers/net/ice/ice_dcf_ethdev.h +6 -0
@@ -15,6 +15,12 @@#define ICE_DCF_MAX_RINGS 1 +#define ICE_DCF_FRAME_SIZE_MAX 9728 +#define ICE_DCF_VLAN_TAG_SIZE 4 +#define ICE_DCF_ETH_OVERHEAD \ + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2) +#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) +struct ice_dcf_queue {uint64_t dummy; };
Signature · 1 line
2.33.1
PATCH v6 5/12 net/ice: add ops dev-supported-ptypes-get to dcf
In reply to Kevin LiuFrom: Jie Wang <[email protected]>
add API "dev_supported_ptypes_get" to dcf, that dcf pmd can get ptypes through the new API.
--- doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_dcf_ethdev.c | 80 ++++++++++++++++---------- 2 files changed, 50 insertions(+), 31 deletions(-)
doc/guides/rel_notes/release_22_07.rst +1 -0
@@ -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. Removed Items -------------
drivers/net/ice/ice_dcf_ethdev.c +49 -31
87 lines not on this page · raw message
Signature · 1 line
2.33.1
RE: [PATCH v6 05/12] net/ice: add ops dev-supported-ptypes-get to dcf
Quoted 29 lines
-----Original Message-----
From: Liu, KevinX <[email protected]>
Sent: Thursday, April 28, 2022 2:13 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Yang, SteveX <[email protected]>; Wang, Jie1X <[email protected]>; Liu, KevinX <[email protected]>
Subject: [PATCH v6 05/12] net/ice: add ops dev-supported-ptypes-get to dcfFrom: Jie Wang <[email protected]>
add API "
dev_supported_ptypes_get" to dcf, that dcf pmd can get ptypes through the new API.Signed-off-by Jie Wang <[email protected]>Signed-off-by Kevin Liu <[email protected]>--- doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_dcf_ethdev.c | 80 ++++++++++++++++---------- 2 files changed, 50 insertions(+), 31 deletions(-)doc/guides/rel_notes/release_22_07.rst +0
-0
doc/guides/rel_notes/release_22_07.rst New Features · line 69
Quoted 4 lines
doc/guides/rel_notes/release_22_07.rst +1
-0@@ -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.
Quoted 97 lines
doc/guides/rel_notes/release_22_07.rst +0
-0Removed Items -------------drivers/net/ice/ice_dcf_ethdev.c +49
-32@@ -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
PATCH v6 6/12 net/ice: support dcf promisc configuration
In reply to Kevin LiuFrom: Alvin Zhang <[email protected]>
Support configuration of unicast and multicast promisc on dcf.
--- doc/guides/nics/features/ice_dcf.ini | 2 + doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_dcf_ethdev.c | 77 ++++++++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 3 + 4 files changed, 79 insertions(+), 4 deletions(-)
doc/guides/nics/features/ice_dcf.ini +2 -0
@@ -18,6 +18,8 @@ Inner L4 checksum = P RSS reta update = Y RSS key update = Y MTU update = Y +Promiscuous mode = Y +Allmulticast mode = Y Basic stats = Y Linux = Y x86-32 = Y
doc/guides/rel_notes/release_22_07.rst +1 -0
@@ -67,6 +67,7 @@ New Features * Added cleanup Tx buffers. * Added add ops MTU-SET to dcf. * Added add ops dev-supported-ptypes-get to dcf. + * Added support dcf promisc configuration. Removed Items -------------
drivers/net/ice/ice_dcf_ethdev.c +73 -4
106 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +3 -0
@@ -33,6 +33,9 @@ struct ice_dcf_adapter {struct ice_adapter parent;/* Must be first */ struct ice_dcf_hw real_hw; +bool promisc_unicast_enabled; +bool promisc_multicast_enabled; +int num_reprs;struct ice_dcf_repr_info *repr_infos; };
Signature · 1 line
2.33.1