net/ice: fix DCF RSS hash update
PATCH 1/1 net/ice: fix DCF RSS hash update
Get rss hash configuration, rss_hf is always the default value. The driver does nothing if the rss key is invalid during the rss hash update.
This patch is get the current configuration of rss_hf. Extract the update rss key code from ice_dcf_dev_rss_hash_update to ice_dcf_set_rss_key and make it consistent with the pf behaviour.
--- drivers/net/intel/ice/ice_dcf_ethdev.c | 38 +++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-)
drivers/net/intel/ice/ice_dcf_ethdev.c +22 -16
@@ -1394,31 +1394,38 @@ ice_dcf_dev_rss_reta_query(struct rte_eth_dev *dev, }static int -ice_dcf_dev_rss_hash_update (struct rte_eth_dev *dev, -struct rte_eth_rss_conf *rss_conf) +ice_dcf_set_rss_key (struct ice_dcf_hw *hw,uint8_t *key,uint8_t key_len) { -struct ice_dcf_adapter *adapter = dev->data->dev_private; -struct ice_dcf_hw *hw = &adapter->real_hw; -int ret; - -if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF )) -return -ENOTSUP ; -/* HENA setting, it is enabled by default, no change */ -if (!rss_conf->rss_key || rss_conf->rss_key_len ==0 ) { +if (!key || key_len ==0 ) {PMD_DRV_LOG (DEBUG ,"No key to be configured" );return 0 ; - }else if (rss_conf->rss_key_len != hw->vf_res->rss_key_size) { + }else if (key_len != hw->vf_res->rss_key_size) {PMD_DRV_LOG (ERR ,"The size of hash key configured " "(%d) doesn't match the size of hardware can " -"support (%d)" , rss_conf->rss_key_len, +"support (%d)" , key_len, hw->vf_res->rss_key_size);return -EINVAL ; } -rte_memcpy (hw->rss_key, rss_conf->rss_key, rss_conf->rss_key_len); +rte_memcpy (hw->rss_key, key, key_len); + +return ice_dcf_configure_rss_key (hw); +} + +static int +ice_dcf_dev_rss_hash_update (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int ret; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF )) +return -ENOTSUP ; - ret =ice_dcf_configure_rss_key (hw); +/* set hash key */ + ret =ice_dcf_set_rss_key (hw, rss_conf->rss_key, rss_conf->rss_key_len);if (ret)return ret;
@@ -1452,8 +1459,7 @@ ice_dcf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ))return -ENOTSUP ; -/* Just set it to default value now. */ - rss_conf->rss_hf =ICE_RSS_OFFLOAD_ALL ; + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;if (!rss_conf->rss_key)return 0 ;
Signature · 1 line
2.25.1
Quoted 16 lines
-----Original Message-----
From: Mingjin Ye <[email protected]>
Sent: Wednesday, June 11, 2025 5:51 PM
To: [email protected]
Cc: Ye, MingjinX <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>; Burakov, Anatoly <[email protected]>
Subject: [PATCH] net/ice: fix DCF RSS hash updateGet rss hash configuration,
rss_hfis always the default value. The driver does nothing if the rss key is invalid during the rss hash update.This patch is get the current configuration of
rss_hf. Extract the update rss key code fromice_dcf_dev_rss_hash_updatetoice_dcf_set_rss_keyand make it consistent with the pf behaviour.
Quoted 5 lines
Fixes c223cadc9e5f ("net/ice: support RSS hash configuration in DCF mode")Signed-off-by Mingjin Ye <[email protected]>---
Quoted 4 lines · Mingjin Ye
Get rss hash configuration,
rss_hfis always the default value. The driver does nothing if the rss key is invalid during the rss hash update.
Quoted 8 lines
This patch is get the current configuration of
rss_hf. Extract the update rss key code fromice_dcf_dev_rss_hash_updatetoice_dcf_set_rss_keyand make it consistent with the pf behaviour.Fixes c223cadc9e5f ("net/ice: support RSS hash configuration in DCF mode")Signed-off-by Mingjin Ye <[email protected]>
Hi,
some comments inline below.
/Bruce
Quoted 51 lines
--- drivers/net/intel/ice/ice_dcf_ethdev.c | 38 +++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-)drivers/net/intel/ice/ice_dcf_ethdev.c +16
-13@@ -1394,31 +1394,38 @@ ice_dcf_dev_rss_reta_query(struct rte_eth_dev *dev, }static int -ice_dcf_dev_rss_hash_update (struct rte_eth_dev *dev, -struct rte_eth_rss_conf *rss_conf) +ice_dcf_set_rss_key (struct ice_dcf_hw *hw,uint8_t *key,uint8_t key_len) { -struct ice_dcf_adapter *adapter = dev->data->dev_private; -struct ice_dcf_hw *hw = &adapter->real_hw; -int ret; - -if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF )) -return -ENOTSUP ; -/* HENA setting, it is enabled by default, no change */ -if (!rss_conf->rss_key || rss_conf->rss_key_len ==0 ) { +if (!key || key_len ==0 ) {PMD_DRV_LOG (DEBUG ,"No key to be configured" );return 0 ; - }else if (rss_conf->rss_key_len != hw->vf_res->rss_key_size) { + }else if (key_len != hw->vf_res->rss_key_size) {PMD_DRV_LOG (ERR ,"The size of hash key configured " "(%d) doesn't match the size of hardware can " -"support (%d)" , rss_conf->rss_key_len, +"support (%d)" , key_len, hw->vf_res->rss_key_size);return -EINVAL ; } -rte_memcpy (hw->rss_key, rss_conf->rss_key, rss_conf->rss_key_len); +rte_memcpy (hw->rss_key, key, key_len); + +return ice_dcf_configure_rss_key (hw); +} + +static int +ice_dcf_dev_rss_hash_update (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int ret;
drivers/net/intel/ice/ice_dcf_ethdev.c ice_dcf_dev_rss_reta_query(struct rte_eth_dev *dev, · line 1431
Quoted 10 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +5
-1+ +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF )) +return -ENOTSUP ; - ret =ice_dcf_configure_rss_key (hw); +/* set hash key */ + ret =ice_dcf_set_rss_key (hw, rss_conf->rss_key, rss_conf->rss_key_len);if (ret)return ret;
This part of the diff (from start of the patch to here) is just extracting the existing code into a new function, right? There is no change to behaviour here?
drivers/net/intel/ice/ice_dcf_ethdev.c ice_dcf_dev_rss_hash_conf_get(struct rte_eth_dev *dev, · line 1463
Quoted 8 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +1
-2@@ -1452,8 +1459,7 @@ ice_dcf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ))return -ENOTSUP ; -/* Just set it to default value now. */ - rss_conf->rss_hf =ICE_RSS_OFFLOAD_ALL ; + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;
This line seems to be the main fix in this patch. Is it worth splitting the patch in two - having this fix and the code refactor above in separate patches?
Quoted 5 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +0
-0if (!rss_conf->rss_key)return 0 ;Signature · 1 line
2.25.1
Quoted 89 lines
-----Original Message-----
From: Richardson, Bruce <[email protected]>
Sent: Tuesday, June 17, 2025 7:34 PM
To: Ye, MingjinX <[email protected]>
Cc: [email protected]; [email protected]; Burakov, Anatoly <[email protected]>
Subject: Re: [PATCH] net/ice: fix DCF RSS hash updateQuoted 8 lines · Mingjin Ye
Get rss hash configuration,
rss_hfis always the default value. The driver does nothing if the rss key is invalid during the rss hash update.This patch is get the current configuration of
rss_hf. Extract the update rss key code fromice_dcf_dev_rss_hash_updatetoice_dcf_set_rss_keyand make it consistent with the pf behaviour.Quoted 5 lines
Fixes c223cadc9e5f ("net/ice: support RSS hash configuration in DCFmode")
Cc: [email protected]Signed-off-by Mingjin Ye <[email protected]>Hi,
some comments inline below.
/Bruce
drivers/net/intel/ice/ice_dcf_ethdev.c ice_dcf_dev_rss_reta_query(struct
Quoted 11 lines
--- drivers/net/intel/ice/ice_dcf_ethdev.c | 38 +++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-)drivers/net/intel/ice/ice_dcf_ethdev.c +0
-0@@ -1394,31 +1394,38 @@ ice_dcf_dev_rss_reta_query(struct
rte_eth_devQuoted 46 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +18
-13*dev, }static int -ice_dcf_dev_rss_hash_update (struct rte_eth_dev *dev, -struct rte_eth_rss_conf *rss_conf) +ice_dcf_set_rss_key (struct ice_dcf_hw *hw,uint8_t *key,uint8_t +key_len) { -struct ice_dcf_adapter *adapter = dev->data->dev_private; -struct ice_dcf_hw *hw = &adapter->real_hw; -int ret; - -if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF )) -return -ENOTSUP ; -/* HENA setting, it is enabled by default, no change */ -if (!rss_conf->rss_key || rss_conf->rss_key_len ==0 ) { +if (!key || key_len ==0 ) {PMD_DRV_LOG (DEBUG ,"No key to be configured" );return 0 ; - }else if (rss_conf->rss_key_len != hw->vf_res->rss_key_size) { + }else if (key_len != hw->vf_res->rss_key_size) {PMD_DRV_LOG (ERR ,"The size of hash key configured " "(%d) doesn't match the size of hardware can " -"support (%d)" , rss_conf->rss_key_len, +"support (%d)" , key_len, hw->vf_res->rss_key_size);return -EINVAL ; } -rte_memcpy (hw->rss_key, rss_conf->rss_key, rss_conf- rss_key_len); +rte_memcpy (hw->rss_key, key, key_len); + +return ice_dcf_configure_rss_key (hw); } + +static int +ice_dcf_dev_rss_hash_update (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) { +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int ret; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF )) +return -ENOTSUP ;
Quoted 11 lines
drivers/net/intel/ice/ice_dcf_ethdev.c ice_dcf_dev_rss_reta_query(struct rte_eth_dev *dev, · line 1430
Quoted 7 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +3
-1- ret =ice_dcf_configure_rss_key (hw); +/* set hash key */ + ret =ice_dcf_set_rss_key (hw, rss_conf->rss_key, +rss_conf->rss_key_len);if (ret)return ret;This part of the diff (from start of the patch to here) is just extracting the existing code into a new function, right? There is no change to behaviour here?
No logic was changed. There is a difference in behavior. Previously, when the rss_key is null, noting will happen. But now it continues to perform the next steps. This patch makes the behavior of PF and VF consistent.
Quoted 6 lines
drivers/net/intel/ice/ice_dcf_ethdev.c ice_dcf_dev_rss_hash_conf_get(struct
Quoted 2 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +0
-0@@ -1452,8 +1459,7 @@ ice_dcf_dev_rss_hash_conf_get(struct
rte_eth_dev*dev,Quoted 3 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +0
-0if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ))return -ENOTSUP ;
Quoted 8 lines
drivers/net/intel/ice/ice_dcf_ethdev.c ice_dcf_dev_rss_hash_conf_get(struct rte_eth_dev *dev, · line 1463
Quoted 5 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +1
-2-/* Just set it to default value now. */ - rss_conf->rss_hf =ICE_RSS_OFFLOAD_ALL ; + rss_conf->rss_hf = dev->data- dev_conf.rx_adv_conf.rss_conf.rss_hf;This line seems to be the main fix in this patch. Is it worth splitting the patch in two - having this fix and the code refactor above in separate patches?
It is okay to split the patch as these two are for separate purpose.
Quoted 6 lines
Quoted 6 lines
drivers/net/intel/ice/ice_dcf_ethdev.c +0
-0if (!rss_conf->rss_key)return 0;
--
2.25.1
PATCH v2 1/2 net/ice: fix getting DCF RSS hash
In reply to Mingjin YeWhen getting the rss hash configuration, it returns the currently configured rss_hf instead of the default value.
---
v2: Split into 2 patches
--- drivers/net/intel/ice/ice_dcf_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/intel/ice/ice_dcf_ethdev.c +1 -2
@@ -1452,8 +1452,7 @@ ice_dcf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ))return -ENOTSUP ; -/* Just set it to default value now. */ - rss_conf->rss_hf =ICE_RSS_OFFLOAD_ALL ; + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;if (!rss_conf->rss_key)return 0 ;
Signature · 1 line
2.25.1
PATCH v2 2/2 net/ice: fix updating DCF RSS hash
The driver does nothing if the rss key is invalid during the rss hash update.
Extract the update rss key code from ice_dcf_dev_rss_hash_update to ice_dcf_set_rss_key and make it consistent with the pf behaviour.
---
v2: Split into 2 patches
--- drivers/net/intel/ice/ice_dcf_ethdev.c | 35 +++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-)
drivers/net/intel/ice/ice_dcf_ethdev.c +21 -14
@@ -1394,31 +1394,38 @@ ice_dcf_dev_rss_reta_query(struct rte_eth_dev *dev, }static int -ice_dcf_dev_rss_hash_update (struct rte_eth_dev *dev, -struct rte_eth_rss_conf *rss_conf) +ice_dcf_set_rss_key (struct ice_dcf_hw *hw,uint8_t *key,uint8_t key_len) { -struct ice_dcf_adapter *adapter = dev->data->dev_private; -struct ice_dcf_hw *hw = &adapter->real_hw; -int ret; - -if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF )) -return -ENOTSUP ; -/* HENA setting, it is enabled by default, no change */ -if (!rss_conf->rss_key || rss_conf->rss_key_len ==0 ) { +if (!key || key_len ==0 ) {PMD_DRV_LOG (DEBUG ,"No key to be configured" );return 0 ; - }else if (rss_conf->rss_key_len != hw->vf_res->rss_key_size) { + }else if (key_len != hw->vf_res->rss_key_size) {PMD_DRV_LOG (ERR ,"The size of hash key configured " "(%d) doesn't match the size of hardware can " -"support (%d)" , rss_conf->rss_key_len, +"support (%d)" , key_len, hw->vf_res->rss_key_size);return -EINVAL ; } -rte_memcpy (hw->rss_key, rss_conf->rss_key, rss_conf->rss_key_len); +rte_memcpy (hw->rss_key, key, key_len); + +return ice_dcf_configure_rss_key (hw); +} + +static int +ice_dcf_dev_rss_hash_update (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct ice_dcf_adapter *adapter = dev->data->dev_private; +struct ice_dcf_hw *hw = &adapter->real_hw; +int ret; + +if (!(hw->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF )) +return -ENOTSUP ; - ret =ice_dcf_configure_rss_key (hw); +/* set hash key */ + ret =ice_dcf_set_rss_key (hw, rss_conf->rss_key, rss_conf->rss_key_len);if (ret)return ret;
Signature · 1 line
2.25.1
Re: [PATCH v2 2/2] net/ice: fix updating DCF RSS hash
Quoted 11 lines · Mingjin Ye
The driver does nothing if the rss key is invalid during the rss hash update.
Extract the update rss key code from
ice_dcf_dev_rss_hash_updatetoice_dcf_set_rss_keyand make it consistent with the pf behaviour.Fixes c223cadc9e5f ("net/ice: support RSS hash configuration in DCF mode")Signed-off-by Mingjin Ye <[email protected]>---
So just to confirm. The behaviour change here is that, if an empty (zero-length) or null key is provided, the function continues to clearing existing RSS, rather than just exiting immediately, right?
/Bruce
RE: [PATCH v2 2/2] net/ice: fix updating DCF RSS hash
Quoted 21 lines
-----Original Message-----
From: Richardson, Bruce <[email protected]>
Sent: Wednesday, June 18, 2025 9:41 PM
To: Ye, MingjinX <[email protected]>
Cc: [email protected]; [email protected]; Burakov, Anatoly <[email protected]>
Subject: Re: [PATCH v2 2/2] net/ice: fix updating DCF RSS hashQuoted 10 lines · Mingjin Ye
The driver does nothing if the rss key is invalid during the rss hash update.
Extract the update rss key code from
ice_dcf_dev_rss_hash_updatetoice_dcf_set_rss_keyand make it consistent with the pf behaviour.Fixes c223cadc9e5f ("net/ice: support RSS hash configuration in DCFmode")
Cc: [email protected]
Quoted 6 lines
Quoted 2 lines
Signed-off-by Mingjin Ye <[email protected]>---
So just to confirm. The behaviour change here is that, if an empty (zero- length) or null key is provided, the function continues to clearing existing RSS, rather than just exiting immediately, right?
Yes, this change is referred to other PMD like i40e, iavf.
Re: [PATCH v2 2/2] net/ice: fix updating DCF RSS hash
In reply to Mingjin YeQuoted 11 lines · Mingjin Ye
The driver does nothing if the rss key is invalid during the rss hash update.
Extract the update rss key code from
ice_dcf_dev_rss_hash_updatetoice_dcf_set_rss_keyand make it consistent with the pf behaviour.Fixes c223cadc9e5f ("net/ice: support RSS hash configuration in DCF mode")Signed-off-by Mingjin Ye <[email protected]>---
Patchset applied to dpdk-next-net-intel.
Thanks,
/Bruce
Re: [PATCH v2 1/2] net/ice: fix getting DCF RSS hash
In reply to Mingjin YeQuoted 8 lines · Mingjin Ye
When getting the rss hash configuration, it returns the currently configured
rss_hfinstead of the default value.Fixes c223cadc9e5f ("net/ice: support RSS hash configuration in DCF mode")Signed-off-by Mingjin Ye <[email protected]>---