net/ice: support based RSS configure
PATCH 1/1 net/ice: support based RSS configure
Enable/disable RSS for corresponding flow
base on the user's requirement.
--- drivers/net/ice/ice_ethdev.c | 181 ++++++++++++++++++++++------------- 1 file changed, 115 insertions(+), 66 deletions(-)
drivers/net/ice/ice_ethdev.c +115 -66
@@ -2436,6 +2436,103 @@ ice_dev_uninit(struct rte_eth_dev *dev)return 0 ; } +static void +ice_rss_hash_set (struct ice_pf *pf,uint64_t rss_hf) +{ +struct ice_hw *hw =ICE_PF_TO_HW (pf); +struct ice_vsi *vsi = pf->main_vsi; +int ret; + +/** +* configure RSS for IPv4 with input set IPv4 src/dst +* configure RSS for IPv6 with input set IPv6 src/dst +*/ +if (rss_hf Ð_RSS_IP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , + __func__, ret); + + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , + __func__, ret); + } +/** +*configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst +*configure RSS for udp4 with input set IP src/dst, UDP src/dst +*/ +if (rss_hf Ð_RSS_UDP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , + __func__, ret); + + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , + __func__, ret); + } +/** +* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst +* configure RSS for tcp4 with input set IP src/dst, TCP src/dst +*/ +if (rss_hf Ð_RSS_TCP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , + __func__, ret); + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , + __func__, ret); + } +/** +* configure RSS for sctp6 with input set IPv6 src/dst +* configure RSS for sctp4 with input set IP src/dst +*/ +if (rss_hf Ð_RSS_SCTP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , + __func__, ret); + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , + __func__, ret); + } + +/* configure RSS for gtpu with input set TEID */ + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_GTP_U_IPV4_TEID , +ICE_FLOW_SEG_HDR_GTPU_IP ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s GTPU_TEID rss flow fail %d" , + __func__, ret); +/** +* configure RSS for pppoe/pppod with input set +* Source MAC and Session ID +*/ + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_PPPOE_SESS_ID_ETH , +ICE_FLOW_SEG_HDR_PPPOE ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s PPPoE/PPPoD_SessionID rss flow fail %d" , + __func__, ret); +} +static int ice_init_rss (struct ice_pf *pf) {struct ice_hw *hw =ICE_PF_TO_HW (pf);
@@ -2496,72 +2593,12 @@ static int ice_init_rss(struct ice_pf *pf) (1 <<VSIQF_HASH_CTL_HASH_SCHEME_S );ICE_WRITE_REG (hw,VSIQF_HASH_CTL (vsi->vsi_id), reg); -/* configure RSS for IPv4 with input set IPv4 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for IPv6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , - __func__, ret); - -/* configure RSS for tcp4 with input set IP src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp4 with input set IP src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp4 with input set IP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , - __func__, ret); - -/* configure RSS for gtpu with input set TEID */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_GTP_U_IPV4_TEID , -ICE_FLOW_SEG_HDR_GTPU_IP ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s GTPU_TEID rss flow fail %d" , - __func__, ret); +/* Disable RSS */ +if (rss_conf->rss_hf ==0 ) +return 0 ; -/** -* configure RSS for pppoe/pppod with input set -* Source MAC and Session ID -*/ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_PPPOE_SESS_ID_ETH , -ICE_FLOW_SEG_HDR_PPPOE ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s PPPoE/PPPoD_SessionID rss flow fail %d" , - __func__, ret); +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf);return 0 ; }
@@ -3675,6 +3712,7 @@ ice_rss_hash_update(struct rte_eth_dev *dev, {enum ice_status status =ICE_SUCCESS ;struct ice_pf *pf =ICE_DEV_PRIVATE_TO_PF (dev->data->dev_private); +struct ice_hw *hw =ICE_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct ice_vsi *vsi = pf->main_vsi;/* set hash key */
@@ -3682,7 +3720,18 @@ ice_rss_hash_update(struct rte_eth_dev *dev,if (status)return status; -/* TODO: hash enable config, ice_add_rss_cfg */ +if (rss_conf->rss_hf ==0 ) +return -EINVAL ; + + status =ice_rem_vsi_rss_cfg (hw, vsi->idx); +if (status !=ICE_SUCCESS ) { +PMD_DRV_LOG (ERR ,"Failed to remove rss cfg!" ); +return status; + } + +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf); +return 0 ; }
Signature · 1 line
2.17.1
PATCH v2 1/1 net/ice: support based RSS configure
Enable/disable RSS for corresponding flow
base on the user's requirement.
---v1->v2:
remove gtpu and pppoe/pppod configuration from rss init
--- drivers/net/ice/ice_ethdev.c | 162 +++++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 66 deletions(-)
drivers/net/ice/ice_ethdev.c +96 -66
@@ -2441,6 +2441,87 @@ ice_dev_uninit(struct rte_eth_dev *dev)return 0 ; } +static void +ice_rss_hash_set (struct ice_pf *pf,uint64_t rss_hf) +{ +struct ice_hw *hw =ICE_PF_TO_HW (pf); +struct ice_vsi *vsi = pf->main_vsi; +int ret; + +/** +* configure RSS for IPv4 with input set IPv4 src/dst +* configure RSS for IPv6 with input set IPv6 src/dst +*/ +if (rss_hf Ð_RSS_IP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , + __func__, ret); + + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , + __func__, ret); + } +/** +*configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst +*configure RSS for udp4 with input set IP src/dst, UDP src/dst +*/ +if (rss_hf Ð_RSS_UDP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , + __func__, ret); + + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , + __func__, ret); + } +/** +* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst +* configure RSS for tcp4 with input set IP src/dst, TCP src/dst +*/ +if (rss_hf Ð_RSS_TCP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , + __func__, ret); + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , + __func__, ret); + } +/** +* configure RSS for sctp6 with input set IPv6 src/dst +* configure RSS for sctp4 with input set IP src/dst +*/ +if (rss_hf Ð_RSS_SCTP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , + __func__, ret); + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , + __func__, ret); + } +} +static int ice_init_rss (struct ice_pf *pf) {struct ice_hw *hw =ICE_PF_TO_HW (pf);
@@ -2501,72 +2582,9 @@ static int ice_init_rss(struct ice_pf *pf) (1 <<VSIQF_HASH_CTL_HASH_SCHEME_S );ICE_WRITE_REG (hw,VSIQF_HASH_CTL (vsi->vsi_id), reg); -/* configure RSS for IPv4 with input set IPv4 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for IPv6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , - __func__, ret); - -/* configure RSS for tcp4 with input set IP src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp4 with input set IP src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp4 with input set IP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , - __func__, ret); - -/* configure RSS for gtpu with input set TEID */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_GTP_U_IPV4_TEID , -ICE_FLOW_SEG_HDR_GTPU_IP ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s GTPU_TEID rss flow fail %d" , - __func__, ret); -/** -* configure RSS for pppoe/pppod with input set -* Source MAC and Session ID -*/ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_PPPOE_SESS_ID_ETH , -ICE_FLOW_SEG_HDR_PPPOE ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s PPPoE/PPPoD_SessionID rss flow fail %d" , - __func__, ret); +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf);return 0 ; }
@@ -3680,6 +3698,7 @@ ice_rss_hash_update(struct rte_eth_dev *dev, {enum ice_status status =ICE_SUCCESS ;struct ice_pf *pf =ICE_DEV_PRIVATE_TO_PF (dev->data->dev_private); +struct ice_hw *hw =ICE_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct ice_vsi *vsi = pf->main_vsi;/* set hash key */
@@ -3687,7 +3706,18 @@ ice_rss_hash_update(struct rte_eth_dev *dev,if (status)return status; -/* TODO: hash enable config, ice_add_rss_cfg */ +if (rss_conf->rss_hf ==0 ) +return -EINVAL ; + + status =ice_rem_vsi_rss_cfg (hw, vsi->idx); +if (status !=ICE_SUCCESS ) { +PMD_DRV_LOG (ERR ,"Failed to remove rss cfg!" ); +return status; + } + +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf); +return 0 ; }
Signature · 1 line
2.17.1
Quoted 10 lines
-----Original Message-----
From: Jiang, JunyuX <[email protected]>
Sent: Monday, June 22, 2020 1:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Su, Simei <[email protected]>; Jiang, JunyuX <[email protected]>
Subject: [PATCH v2] net/ice: support based RSS configure
The title is misleading, how about "initialize and update RSS based on user request"
Quoted 2 lines
Enable/disable RSS for corresponding flow base on the user's requirement
Initialize and update RSS configure based on user request (rte_eth_rss_conf) from dev_configure and .rss_hash_update ops. All previous default configure has been removed.
.
Quoted 17 lines
Signed-off-by Junyu Jiang <[email protected]>---
v1->v2:
remove gtpu and pppoe/pppod configuration from rss init--- drivers/net/ice/ice_ethdev.c | 162 +++++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 66 deletions(-)drivers/net/ice/ice_ethdev.c index renamed from drivers/net/ice/ice_ethdev.c +0
-0
5a89a1955..cbe59a40e100644drivers/net/ice/ice_ethdev.c +0
-0@@ -2441,6 +2441,87 @@ ice_dev_uninit(struct rte_eth_dev *dev)return 0 ; }
drivers/net/ice/ice_ethdev.c ice_dev_uninit(struct rte_eth_dev *dev) · line 2452
Quoted 10 lines
drivers/net/ice/ice_ethdev.c +9
-0+static void +ice_rss_hash_set (struct ice_pf *pf,uint64_t rss_hf) { +struct ice_hw *hw =ICE_PF_TO_HW (pf); +struct ice_vsi *vsi = pf->main_vsi; +int ret; + +/** +* configure RSS for IPv4 with input set IPv4 src/dst +* configure RSS for IPv6 with input set IPv6 src/dst
The comment looks redundant, please merge into one line.
/* Configure RSS for IP with src/dst address as input set */
drivers/net/ice/ice_ethdev.c ice_dev_uninit(struct rte_eth_dev *dev) · line 2455
Quoted 2 lines
drivers/net/ice/ice_ethdev.c +2
-0+*/ +if (rss_hf Ð_RSS_IP ) {
This is not correct, it is possible user only want IPv4 but not IPv6.
For ice, I think we can do like below
If (rss_hf & ETH_RSS_IPV4) {
Ice_add_rss_cfg (... ICE_FLOW_HASH_IPV4 ...)
}
If (rss_hf & ETH_RSS_IPV6) {
Ice_add_rss_cfg (... ICE_FLOW_HASH_IPv6 ...)
}We can just ignore ETH_RSS_FRAG_IPV4 and ETH_RSS_NONFRAG_IPV4_OTHER and same for UDP/TCP and SCTP.
drivers/net/ice/ice_ethdev.c ice_dev_uninit(struct rte_eth_dev *dev) · line 2456
Quoted 2 lines
drivers/net/ice/ice_ethdev.c +2
-0+ ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_IPV4 ,0 );
You need ICE_FLOW_SEG_HDR_IPV_OTHER, see patch
http://patchwork.dpdk.org/patch/71584/
Quoted 161 lines
drivers/net/ice/ice_ethdev.c +67
-61+if (ret) +PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , + __func__, ret); + + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , + __func__, ret); + } +/** +*configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst +*configure RSS for udp4 with input set IP src/dst, UDP src/dst +*/ +if (rss_hf Ð_RSS_UDP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , + __func__, ret); + + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , + __func__, ret); + } +/** +* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst +* configure RSS for tcp4 with input set IP src/dst, TCP src/dst +*/ +if (rss_hf Ð_RSS_TCP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , + __func__, ret); + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , + __func__, ret); + } +/** +* configure RSS for sctp6 with input set IPv6 src/dst +* configure RSS for sctp4 with input set IP src/dst +*/ +if (rss_hf Ð_RSS_SCTP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV6 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , + __func__, ret); + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV4 ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , + __func__, ret); + } +} +static int ice_init_rss (struct ice_pf *pf) {struct ice_hw *hw =ICE_PF_TO_HW (pf);@@ -2501,72 +2582,9 @@ static int ice_init_rss(struct ice_pf *pf) (1 <<VSIQF_HASH_CTL_HASH_SCHEME_S );ICE_WRITE_REG (hw,VSIQF_HASH_CTL (vsi->vsi_id), reg); -/* configure RSS for IPv4 with input set IPv4 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for IPv6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV6 , 0); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV6 , 0); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV6 , 0); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , - __func__, ret); - -/* configure RSS for tcp4 with input set IP src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV4 , 0); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp4 with input set IP src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV4 , 0); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp4 with input set IP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV4 , 0); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , - __func__, ret); - -/* configure RSS for gtpu with input set TEID */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_GTP_U_IPV4_TEID , -ICE_FLOW_SEG_HDR_GTPU_IP ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s GTPU_TEID rss flow fail %d" , - __func__, ret); -/** -* configure RSS for pppoe/pppod with input set -* Source MAC and Session ID -*/ - ret = ice_add_rss_cfg(hw, vsi->idx,
ICE_FLOW_HASH_PPPOE_SESS_ID_ETH,drivers/net/ice/ice_ethdev.c +3
-4- ICE_FLOW_SEG_HDR_PPPOE, 0); -if (ret) -PMD_DRV_LOG (ERR ,"%s PPPoE/PPPoD_SessionID rss flow fail %d" , - __func__, ret); +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf);return 0 ; }@@ -3680,6 +3698,7 @@ ice_rss_hash_update(struct rte_eth_dev *dev, {enum ice_status status =ICE_SUCCESS ;struct ice_pf *pf =ICE_DEV_PRIVATE_TO_PF (dev->data->dev_private); +struct ice_hw *hw =ICE_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct ice_vsi *vsi = pf->main_vsi;/* set hash key */ @@ -3687,7 +3706,18 @@ ice_rss_hash_update(struct rte_eth_dev *dev,if (status)return status;
drivers/net/ice/ice_ethdev.c ice_rss_hash_update(struct rte_eth_dev *dev, · line 3716
Quoted 10 lines
drivers/net/ice/ice_ethdev.c +8
-1-/* TODO: hash enable config, ice_add_rss_cfg */ +if (rss_conf->rss_hf ==0 ) +return -EINVAL ; + + status =ice_rem_vsi_rss_cfg (hw, vsi->idx); +if (status !=ICE_SUCCESS ) { +PMD_DRV_LOG (ERR ,"Failed to remove rss cfg!" ); +return status; + }
No need to remove exist configure,
we just need to make sure all the configure from rss_hf has been applied.
Quoted 9 lines
drivers/net/ice/ice_ethdev.c +4
-1+ +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf); +return 0 ; } --2.17.1
Hi qi,
Quoted 21 lines
-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Monday, June 22, 2020 10:37 PM
To: Jiang, JunyuX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Su, Simei <[email protected]>
Subject: RE: [PATCH v2] net/ice: support based RSS configureQuoted 8 lines
-----Original Message-----
From: Jiang, JunyuX <[email protected]>
Sent: Monday, June 22, 2020 1:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Su, Simei <[email protected]>; Jiang, JunyuX <[email protected]>
Subject: [PATCH v2] net/ice: support based RSS configureThe title is misleading, how about "initialize and update RSS based on user request"
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
Enable/disable RSS for corresponding flow base on the user's requirement
Initialize and update RSS configure based on user request (
rte_eth_rss_conf) fromdev_configureand .rss_hash_update ops.
All previous default configure has been removed.
.
Got it, it looks better.
Quoted 30 lines
Quoted 18 lines
Signed-off-by Junyu Jiang <[email protected]>---
v1->v2:
remove gtpu and pppoe/pppod configuration from rss init--- drivers/net/ice/ice_ethdev.c | 162 +++++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 66 deletions(-)(quoted diff) +0
-0
b/drivers/net/ice/ice_ethdev.cindex5a89a1955..cbe59a40e100644drivers/net/ice/ice_ethdev.c +0
-0@@ -2441,6 +2441,87 @@ ice_dev_uninit(struct rte_eth_dev *dev)return 0 ; }drivers/net/ice/ice_ethdev.c ice_dev_uninit(struct rte_eth_dev *dev) · line 2452
Quoted 10 lines
drivers/net/ice/ice_ethdev.c +9
-0+static void +ice_rss_hash_set (struct ice_pf *pf,uint64_t rss_hf) { +struct ice_hw *hw =ICE_PF_TO_HW (pf); +struct ice_vsi *vsi = pf->main_vsi; +int ret; + +/** +* configure RSS for IPv4 with input set IPv4 src/dst +* configure RSS for IPv6 with input set IPv6 src/dst The comment looks redundant, please merge into one line.
Quoted 2 lines
/* Configure RSS for IP with src/dst address as input set */
Got it.
Quoted 15 lines
drivers/net/ice/ice_ethdev.c ice_dev_uninit(struct rte_eth_dev *dev) · line 2455
Quoted 2 lines
drivers/net/ice/ice_ethdev.c +2
-0+*/ +if (rss_hf Ð_RSS_IP ) {This is not correct, it is possible user only want IPv4 but not IPv6.
For ice, I think we can do like below
If (rss_hf & ETH_RSS_IPV4) { Ice_add_rss_cfg (... ICE_FLOW_HASH_IPV4 ...) } If (rss_hf &
ETH_RSS_IPV6) {
Ice_add_rss_cfg(...ICE_FLOW_HASH_IPv6...) } We can just ignoreETH_RSS_FRAG_IPV4andETH_RSS_NONFRAG_IPV4_OTHERand same for UDP/TCP and SCTP.
Quoted 6 lines
drivers/net/ice/ice_ethdev.c ice_dev_uninit(struct rte_eth_dev *dev) · line 2456
Quoted 2 lines
drivers/net/ice/ice_ethdev.c +2
-0+ ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_IPV4 ,0 );You need
ICE_FLOW_SEG_HDR_IPV_OTHER, see patch
http://patchwork.dpdk.org/patch/71584/
Got it, same for UDP/TCP and SCTP.
Quoted 1 line
[...]
Quoted 5 lines
Quoted 5 lines
drivers/net/ice/ice_ethdev.c +0
-0/* set hash key */ @@ -3687,7 +3706,18 @@ ice_rss_hash_update(struct rte_eth_dev *dev,if (status)return status;
Quoted 12 lines
drivers/net/ice/ice_ethdev.c ice_rss_hash_update(struct rte_eth_dev *dev, · line 3716
Quoted 9 lines
drivers/net/ice/ice_ethdev.c +8
-1-/* TODO: hash enable config, ice_add_rss_cfg */ +if (rss_conf->rss_hf ==0 ) +return -EINVAL ; + + status =ice_rem_vsi_rss_cfg (hw, vsi->idx); +if (status !=ICE_SUCCESS ) { +PMD_DRV_LOG (ERR ,"Failed to remove rss cfg!" ); +return status; + }No need to remove exist configure,
we just need to make sure all the configure fromrss_hfhas been applied.
Got it.
Quoted 10 lines
Quoted 10 lines
drivers/net/ice/ice_ethdev.c +4
-1+ +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf); +return 0 ; } --2.17.1
Hi, Junyu
Quoted 9 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Monday, June 22, 2020 1:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Su, Simei <[email protected]>; Jiang, JunyuX <[email protected]>
Subject: [dpdk-dev] [PATCH v2] net/ice: support based RSS configure
Quoted 7 lines
Enable/disable RSS for corresponding flow base on the user's requirement.
Signed-off-by Junyu Jiang <[email protected]>---
v1->v2:
remove gtpu and pppoe/pppod configuration from rss init
Why do we remove the rss for PPPOE or GTP-U?
The switch cmd can not work now. Maybe we also need a rss CMD to enable it before using this CMD?
flow create 0 priority 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions rss queues 2 3 end / end
Quoted 11 lines
--- drivers/net/ice/ice_ethdev.c | 162 +++++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 66 deletions(-)drivers/net/ice/ice_ethdev.c index renamed from drivers/net/ice/ice_ethdev.c +0
-1return 0; } --2.17.1
Hi, all
Quoted 28 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Friday, July 3, 2020 4:17 PM
To: Junyu Jiang <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Su, Simei <[email protected]>; Jiang, JunyuX <[email protected]>; Lu, Nannan <[email protected]>
Subject: RE: [dpdk-dev] [PATCH v2] net/ice: support based RSS configureHi, Junyu
Quoted 9 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Monday, June 22, 2020 1:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Su, Simei <[email protected]>; Jiang, JunyuX <[email protected]>
Subject: [dpdk-dev] [PATCH v2] net/ice: support based RSS configureQuoted 7 lines
Enable/disable RSS for corresponding flow base on the user's requirement.
Signed-off-by Junyu Jiang <[email protected]>---
v1->v2:
remove gtpu and pppoe/pppod configuration from rss init
Quoted 8 lines
Why do we remove the rss for PPPOE or GTP-U?
The switch cmd can not work now. Maybe we also need a rss CMD to enable it before using this CMD?flow create 0 priority 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions rss queues 2 3 end / end
Btw, RSS hash not support IPV6 type hash cmd, how can we enable it?
flow create 0 ingress pattern eth / pppoes / ipv6 / udp / end actions rss types ipv6 end key_len 0 queues end / end
so, the flow create 0 priority 0 ingress pattern eth / pppoes / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2022 / udp src is 25 dst is 23 / end actions rss queues 2 3 end / end can not work at all.
Quoted 14 lines
Quoted 14 lines
--- drivers/net/ice/ice_ethdev.c | 162 +++++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 66 deletions(-)(quoted diff) +0
-0
b/drivers/net/ice/ice_ethdev.cindexreturn 0;
}--
2.17.1
PATCH v3 1/1 net/ice: initialize and update RSS based on user request
In reply to Junyu JiangInitialize and update RSS configure based on user request (rte_eth_rss_conf) from dev_configure and .rss_hash_update ops. All previous default configure has been removed.
---v2->v3:
change the commit log
Separate ipv4 and ipv6
Remove the call of ice_rem_vsi_rss_cfg()
v1->v2:
remove gtpu and pppoe/pppod configuration from rss init
--- drivers/net/ice/ice_ethdev.c | 169 +++++++++++++++++++++-------------- drivers/net/ice/ice_ethdev.h | 2 + 2 files changed, 104 insertions(+), 67 deletions(-)
drivers/net/ice/ice_ethdev.c +102 -67
@@ -2441,6 +2441,100 @@ ice_dev_uninit(struct rte_eth_dev *dev)return 0 ; } +static void +ice_rss_hash_set (struct ice_pf *pf,uint64_t rss_hf) +{ +struct ice_hw *hw =ICE_PF_TO_HW (pf); +struct ice_vsi *vsi = pf->main_vsi; +int ret; + +/* Configure RSS for IPv4 with src/dst addr as input set */ +if (rss_hf Ð_RSS_IPV4 ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_IPV4 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for IPv6 with src/dst addr as input set */ +if (rss_hf Ð_RSS_IPV6 ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_IPV6 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for udp4 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV4_UDP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV4 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for udp6 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV6_UDP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV6 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for tcp4 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV4_TCP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV4 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for tcp6 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV6_TCP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV6 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for sctp4 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV4_SCTP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV4 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for sctp6 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV6_SCTP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV6 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , + __func__, ret); + } +} +static int ice_init_rss (struct ice_pf *pf) {struct ice_hw *hw =ICE_PF_TO_HW (pf);
@@ -2501,72 +2595,8 @@ static int ice_init_rss(struct ice_pf *pf) (1 <<VSIQF_HASH_CTL_HASH_SCHEME_S );ICE_WRITE_REG (hw,VSIQF_HASH_CTL (vsi->vsi_id), reg); -/* configure RSS for IPv4 with input set IPv4 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for IPv6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , - __func__, ret); - -/* configure RSS for tcp4 with input set IP src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp4 with input set IP src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp4 with input set IP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , - __func__, ret); - -/* configure RSS for gtpu with input set TEID */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_GTP_U_IPV4_TEID , -ICE_FLOW_SEG_HDR_GTPU_IP ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s GTPU_TEID rss flow fail %d" , - __func__, ret); - -/** -* configure RSS for pppoe/pppod with input set -* Source MAC and Session ID -*/ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_PPPOE_SESS_ID_ETH , -ICE_FLOW_SEG_HDR_PPPOE ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s PPPoE/PPPoD_SessionID rss flow fail %d" , - __func__, ret); +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf);return 0 ; }
@@ -3687,7 +3717,12 @@ ice_rss_hash_update(struct rte_eth_dev *dev,if (status)return status; -/* TODO: hash enable config, ice_add_rss_cfg */ +if (rss_conf->rss_hf ==0 ) +return -EINVAL ; + +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf); +return 0 ; }
drivers/net/ice/ice_ethdev.h +2 -0
@@ -112,11 +112,13 @@ ICE_FLAG_VF_MAC_BY_PF)#define ICE_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ ETH_RSS_FRAG_IPV4 | \ ETH_RSS_NONFRAG_IPV4_TCP | \ ETH_RSS_NONFRAG_IPV4_UDP | \ ETH_RSS_NONFRAG_IPV4_SCTP | \ ETH_RSS_NONFRAG_IPV4_OTHER | \ + ETH_RSS_IPV6 | \ ETH_RSS_FRAG_IPV6 | \ ETH_RSS_NONFRAG_IPV6_TCP | \ ETH_RSS_NONFRAG_IPV6_UDP | \
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3] net/ice: initialize and update RSS based on user request
Quoted 30 lines
-----Original Message-----
From: Jiang, JunyuX <[email protected]>
Sent: Tuesday, June 23, 2020 4:33 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>; Su, Simei <[email protected]>; Jiang, JunyuX <[email protected]>
Subject: [PATCH v3] net/ice: initialize and update RSS based on user requestInitialize and update RSS configure based on user request (
rte_eth_rss_conf) fromdev_configureand .rss_hash_update ops. All previous default configure has been removed.Signed-off-by Junyu Jiang <[email protected]>---
v2->v3:
change the commit log
Separate ipv4 and ipv6
Remove the call ofice_rem_vsi_rss_cfg()
v1->v2:
remove gtpu and pppoe/pppod configuration from rss init--- drivers/net/ice/ice_ethdev.c | 169 +++++++++++++++++++++-------------- drivers/net/ice/ice_ethdev.h | 2 + 2 files changed, 104 insertions(+), 67 deletions(-)
...
drivers/net/ice/ice_ethdev.c ice_rss_hash_update(struct rte_eth_dev *dev, · line 3721
Quoted 2 lines
drivers/net/ice/ice_ethdev.c +2
-0+if (rss_conf->rss_hf ==0 ) +return -EINVAL ;
This looks not correct, user may only want to update hash key but without any RSS configure, just return success here.
Quoted 7 lines
drivers/net/ice/ice_ethdev.c +4
-0+ +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf); +return 0 ; }
PATCH v4 1/1 net/ice: initialize and update RSS based on user request
In reply to Junyu JiangInitialize and update RSS configure based on user request (rte_eth_rss_conf) from dev_configure and .rss_hash_update ops. All previous default configure has been removed.
---v3->v4:
change the return value to success when rss_hf value update to 0.
v2->v3:
change the commit log
Separate ipv4 and ipv6
Remove the call of ice_rem_vsi_rss_cfg()
v1->v2:
remove gtpu and pppoe/pppod configuration from rss init
--- drivers/net/ice/ice_ethdev.c | 169 +++++++++++++++++++++-------------- drivers/net/ice/ice_ethdev.h | 2 + 2 files changed, 104 insertions(+), 67 deletions(-)
drivers/net/ice/ice_ethdev.c +102 -67
@@ -2441,6 +2441,100 @@ ice_dev_uninit(struct rte_eth_dev *dev)return 0 ; } +static void +ice_rss_hash_set (struct ice_pf *pf,uint64_t rss_hf) +{ +struct ice_hw *hw =ICE_PF_TO_HW (pf); +struct ice_vsi *vsi = pf->main_vsi; +int ret; + +/* Configure RSS for IPv4 with src/dst addr as input set */ +if (rss_hf Ð_RSS_IPV4 ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_IPV4 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for IPv6 with src/dst addr as input set */ +if (rss_hf Ð_RSS_IPV6 ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_IPV6 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for udp4 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV4_UDP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV4 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for udp6 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV6_UDP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , +ICE_FLOW_SEG_HDR_UDP | +ICE_FLOW_SEG_HDR_IPV6 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for tcp4 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV4_TCP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV4 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for tcp6 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV6_TCP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , +ICE_FLOW_SEG_HDR_TCP | +ICE_FLOW_SEG_HDR_IPV6 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for sctp4 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV4_SCTP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV4 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , + __func__, ret); + } + +/* Configure RSS for sctp6 with src/dst addr and port as input set */ +if (rss_hf Ð_RSS_NONFRAG_IPV6_SCTP ) { + ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , +ICE_FLOW_SEG_HDR_SCTP | +ICE_FLOW_SEG_HDR_IPV6 | +ICE_FLOW_SEG_HDR_IPV_OTHER ,0 ); +if (ret) +PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , + __func__, ret); + } +} +static int ice_init_rss (struct ice_pf *pf) {struct ice_hw *hw =ICE_PF_TO_HW (pf);
@@ -2501,72 +2595,8 @@ static int ice_init_rss(struct ice_pf *pf) (1 <<VSIQF_HASH_CTL_HASH_SCHEME_S );ICE_WRITE_REG (hw,VSIQF_HASH_CTL (vsi->vsi_id), reg); -/* configure RSS for IPv4 with input set IPv4 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for IPv6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV6 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV6 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV6 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp6 with input set IPv6 src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV6 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV6 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV6 rss flow fail %d" , - __func__, ret); - -/* configure RSS for tcp4 with input set IP src/dst, TCP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_TCP_IPV4 , -ICE_FLOW_SEG_HDR_TCP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s TCP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for udp4 with input set IP src/dst, UDP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_HASH_UDP_IPV4 , -ICE_FLOW_SEG_HDR_UDP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s UDP_IPV4 rss flow fail %d" , __func__, ret); - -/* configure RSS for sctp4 with input set IP src/dst */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_IPV4 , -ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV4 ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s SCTP_IPV4 rss flow fail %d" , - __func__, ret); - -/* configure RSS for gtpu with input set TEID */ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_GTP_U_IPV4_TEID , -ICE_FLOW_SEG_HDR_GTPU_IP ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s GTPU_TEID rss flow fail %d" , - __func__, ret); - -/** -* configure RSS for pppoe/pppod with input set -* Source MAC and Session ID -*/ - ret =ice_add_rss_cfg (hw, vsi->idx,ICE_FLOW_HASH_PPPOE_SESS_ID_ETH , -ICE_FLOW_SEG_HDR_PPPOE ,0 ); -if (ret) -PMD_DRV_LOG (ERR ,"%s PPPoE/PPPoD_SessionID rss flow fail %d" , - __func__, ret); +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf);return 0 ; }
@@ -3687,7 +3717,12 @@ ice_rss_hash_update(struct rte_eth_dev *dev,if (status)return status; -/* TODO: hash enable config, ice_add_rss_cfg */ +if (rss_conf->rss_hf ==0 ) +return 0 ; + +/* RSS hash configuration */ +ice_rss_hash_set (pf, rss_conf->rss_hf); +return 0 ; }
drivers/net/ice/ice_ethdev.h +2 -0
@@ -112,11 +112,13 @@ ICE_FLAG_VF_MAC_BY_PF)#define ICE_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ ETH_RSS_FRAG_IPV4 | \ ETH_RSS_NONFRAG_IPV4_TCP | \ ETH_RSS_NONFRAG_IPV4_UDP | \ ETH_RSS_NONFRAG_IPV4_SCTP | \ ETH_RSS_NONFRAG_IPV4_OTHER | \ + ETH_RSS_IPV6 | \ ETH_RSS_FRAG_IPV6 | \ ETH_RSS_NONFRAG_IPV6_TCP | \ ETH_RSS_NONFRAG_IPV6_UDP | \
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v4] net/ice: initialize and update RSS based on user request
Quoted 11 lines
-----Original Message-----
From: Jiang, JunyuX <[email protected]>
Sent: Wednesday, June 24, 2020 10:10 AM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>; Su, Simei <[email protected]>; Jiang, JunyuX <[email protected]>
Subject: [PATCH v4] net/ice: initialize and update RSS based on user request
Quoted 5 lines
Initialize and update RSS configure based on user request (
rte_eth_rss_conf) fromdev_configureand .rss_hash_update ops. All previous default configure has been removed.Signed-off-by Junyu Jiang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi