net/iavf: fix RSS RETA settings invalid
PATCH 1/1 net/iavf: fix RSS RETA settings invalid
This patch moved the RSS initialization from dev start to dev configure, to fix the issue that RSS redirection table can not be kept after restarting port.
--- drivers/net/iavf/iavf_ethdev.c | 71 +++++++++++++++++----------------- 1 file changed, 35 insertions(+), 36 deletions(-)
drivers/net/iavf/iavf_ethdev.c +35 -36
@@ -136,34 +136,6 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { .filter_ctrl = iavf_dev_filter_ctrl, }; -static int -iavf_dev_configure (struct rte_eth_dev *dev) -{ -struct iavf_adapter *ad = -IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); -struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (ad); -struct rte_eth_conf *dev_conf = &dev->data->dev_conf; - - ad->rx_bulk_alloc_allowed = true; -/* Initialize to TRUE. If any of Rx queues doesn't meet the -* vector Rx/Tx preconditions, it will be reset. -*/ - ad->rx_vec_allowed = true; - ad->tx_vec_allowed = true; - -if (dev->data->dev_conf.rxmode.mq_mode Ð_MQ_RX_RSS_FLAG ) - dev->data->dev_conf.rxmode.offloads |=DEV_RX_OFFLOAD_RSS_HASH ; - -/* Vlan stripping setting */ -if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN ) { -if (dev_conf->rxmode.offloads &DEV_RX_OFFLOAD_VLAN_STRIP ) -iavf_enable_vlan_strip (ad); -else -iavf_disable_vlan_strip (ad); - } -return 0 ; -} -static int iavf_init_rss (struct iavf_adapter *adapter) {
@@ -220,6 +192,41 @@ iavf_init_rss(struct iavf_adapter *adapter)return 0 ; } +static int +iavf_dev_configure (struct rte_eth_dev *dev) +{ +struct iavf_adapter *ad = +IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); +struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (ad); +struct rte_eth_conf *dev_conf = &dev->data->dev_conf; + + ad->rx_bulk_alloc_allowed = true; +/* Initialize to TRUE. If any of Rx queues doesn't meet the +* vector Rx/Tx preconditions, it will be reset. +*/ + ad->rx_vec_allowed = true; + ad->tx_vec_allowed = true; + +if (dev->data->dev_conf.rxmode.mq_mode Ð_MQ_RX_RSS_FLAG ) + dev->data->dev_conf.rxmode.offloads |=DEV_RX_OFFLOAD_RSS_HASH ; + +/* Vlan stripping setting */ +if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN ) { +if (dev_conf->rxmode.offloads &DEV_RX_OFFLOAD_VLAN_STRIP ) +iavf_enable_vlan_strip (ad); +else +iavf_disable_vlan_strip (ad); + } + +if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ) { +if (iavf_init_rss (ad) !=0 ) { +PMD_DRV_LOG (ERR ,"configure rss failed" ); +return -1 ; + } + } +return 0 ; +} +static int iavf_init_rxq (struct rte_eth_dev *dev,struct iavf_rx_queue *rxq) {
@@ -440,13 +447,6 @@ iavf_dev_start(struct rte_eth_dev *dev)return -1 ; } -if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ) { -if (iavf_init_rss (adapter) !=0 ) { -PMD_DRV_LOG (ERR ,"configure rss failed" ); - goto err_rss; - } - } -if (iavf_configure_queues (adapter) !=0 ) {PMD_DRV_LOG (ERR ,"configure queues failed" ); goto err_queue;
@@ -475,7 +475,6 @@ iavf_dev_start(struct rte_eth_dev *dev) err_mac:iavf_add_del_all_mac_addr (adapter, false); err_queue: -err_rss:return -1 ; }
Signature · 1 line
2.17.1
Quoted 127 lines
-----Original Message-----
From: Jiang, JunyuX <[email protected]>
Sent: Friday, June 19, 2020 15:44
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix RSS RETA settings invalidThis patch moved the RSS initialization from dev start to dev configure, to fix the issue that RSS redirection table can not be kept after restarting port.
Fixes 69dd4c3d0898 ("net/avf: enable queue and device")Signed-off-by Junyu Jiang <[email protected]>--- drivers/net/iavf/iavf_ethdev.c | 71 +++++++++++++++++----------------- 1 file changed, 35 insertions(+), 36 deletions(-)drivers/net/iavf/iavf_ethdev.c +0
-20@@ -136,34 +136,6 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { .filter_ctrl = iavf_dev_filter_ctrl, }; -static int -iavf_dev_configure(struct rte_eth_dev *dev) -{ -struct iavf_adapter *ad = -IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); -struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (ad); -struct rte_eth_conf *dev_conf = &dev->data->dev_conf; - - ad->rx_bulk_alloc_allowed = true; -/* Initialize to TRUE. If any of Rx queues doesn't meet the -* vector Rx/Tx preconditions, it will be reset. -*/ - ad->rx_vec_allowed = true; - ad->tx_vec_allowed = true; - -if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) - dev->data->dev_conf.rxmode.offloads |=DEV_RX_OFFLOAD_RSS_HASH ; - -/* Vlan stripping setting */ -if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN ) { - if (dev_conf->rxmode.offloads &
DEV_RX_OFFLOAD_VLAN_STRIP)drivers/net/iavf/iavf_ethdev.c +0
-7-iavf_enable_vlan_strip (ad); - else -iavf_disable_vlan_strip (ad ); - } -return 0 ; -} -static int iavf_init_rss(struct iavf_adapter *adapter) { @@ -220,6 +192,41 @@
iavf_init_rss(struct iavf_adapter *adapter)drivers/net/iavf/iavf_ethdev.c +15
-0return 0 ; } +static int +iavf_dev_configure (struct rte_eth_dev *dev) { +struct iavf_adapter *ad = +IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); +struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (ad); +struct rte_eth_conf *dev_conf = &dev->data->dev_conf; + + ad->rx_bulk_alloc_allowed = true; +/* Initialize to TRUE. If any of Rx queues doesn't meet the +* vector Rx/Tx preconditions, it will be reset. +*/ + ad->rx_vec_allowed = true; + ad->tx_vec_allowed = true; + + if (dev->data->dev_conf.rxmode.mq_mode &
ETH_MQ_RX_RSS_FLAG)drivers/net/iavf/iavf_ethdev.c +1
-0+ dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_RSS_HASH;drivers/net/iavf/iavf_ethdev.c +4
-0+ +/* Vlan stripping setting */ +if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN ) { + if (dev_conf->rxmode.offloads &
DEV_RX_OFFLOAD_VLAN_STRIP)drivers/net/iavf/iavf_ethdev.c +14
-0+iavf_enable_vlan_strip (ad); + else +iavf_disable_vlan_strip (ad ); + } + +if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ) { +if (iavf_init_rss (ad) !=0 ) { +PMD_DRV_LOG (ERR ,"configure rss failed" ); +return -1 ; + } + } +return 0 ; +} +static int iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq) { @@ -440,13 +447,6 @@
iavf_dev_start(struct rte_eth_dev *dev)drivers/net/iavf/iavf_ethdev.c +0
-9return -1 ; } -if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ) { -if (iavf_init_rss (adapter) !=0 ) { -PMD_DRV_LOG (ERR ,"configure rss failed" ); - goto err_rss; - } - } -if (iavf_configure_queues (adapter) !=0 ) {PMD_DRV_LOG (ERR ,"configure queues failed" ); goto err_queue;@@ -475,7 +475,6 @@ iavf_dev_start(struct rte_eth_dev *dev) err_mac:iavf_add_del_all_mac_addr (adapter, false); err_queue: -err_rss:return -1 ; } --
Quoted 1 line
2.17.1
Quoted 140 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Yang, Qiming
Sent: Wednesday, July 1, 2020 10:10 AM
To: Jiang, JunyuX <[email protected]>; [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix RSS RETA settings invalidQuoted 11 lines
-----Original Message-----
From: Jiang, JunyuX <[email protected]>
Sent: Friday, June 19, 2020 15:44
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix RSS RETA settings invalidThis patch moved the RSS initialization from dev start to dev configure, to fix the issue that RSS redirection table can not be kept after
restarting port.
drivers/net/iavf/iavf_ethdev.c static const struct eth_dev_ops
Quoted 15 lines
Fixes 69dd4c3d0898 ("net/avf: enable queue and device")Signed-off-by Junyu Jiang <[email protected]>--- drivers/net/iavf/iavf_ethdev.c | 71 +++++++++++++++++----------------- 1 file changed, 35 insertions(+), 36 deletions(-)(quoted diff) +0
-0
b/drivers/net/iavf/iavf_ethdev.cindex2b1066b0a..5e79a2d03100644drivers/net/iavf/iavf_ethdev.c +0
-0@@ -136,34 +136,6 @@ static const struct eth_dev_ops
iavf_eth_dev_opsQuoted 102 lines
drivers/net/iavf/iavf_ethdev.c +0
-20= { .filter_ctrl = iavf_dev_filter_ctrl, }; -static int -iavf_dev_configure(struct rte_eth_dev *dev) -{ -struct iavf_adapter *ad = -IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); -struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (ad); -struct rte_eth_conf *dev_conf = &dev->data->dev_conf; - - ad->rx_bulk_alloc_allowed = true; -/* Initialize to TRUE. If any of Rx queues doesn't meet the -* vector Rx/Tx preconditions, it will be reset. -*/ - ad->rx_vec_allowed = true; - ad->tx_vec_allowed = true; - -if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) - dev->data->dev_conf.rxmode.offloads |=DEV_RX_OFFLOAD_RSS_HASH ; - -/* Vlan stripping setting */ -if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN ) { - if (dev_conf->rxmode.offloads &
DEV_RX_OFFLOAD_VLAN_STRIP)drivers/net/iavf/iavf_ethdev.c +0
-7-iavf_enable_vlan_strip (ad); - else -iavf_disable_vlan_strip (ad ); - } -return 0 ; -} -static int iavf_init_rss(struct iavf_adapter *adapter) { @@ -220,6 +192,41 @@
iavf_init_rss(struct iavf_adapter *adapter)drivers/net/iavf/iavf_ethdev.c +15
-0return 0 ; } +static int +iavf_dev_configure (struct rte_eth_dev *dev) { +struct iavf_adapter *ad = +IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); +struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (ad); +struct rte_eth_conf *dev_conf = &dev->data->dev_conf; + + ad->rx_bulk_alloc_allowed = true; +/* Initialize to TRUE. If any of Rx queues doesn't meet the +* vector Rx/Tx preconditions, it will be reset. +*/ + ad->rx_vec_allowed = true; + ad->tx_vec_allowed = true; + + if (dev->data->dev_conf.rxmode.mq_mode &
ETH_MQ_RX_RSS_FLAG)drivers/net/iavf/iavf_ethdev.c +1
-0+ dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_RSS_HASH;drivers/net/iavf/iavf_ethdev.c +4
-0+ +/* Vlan stripping setting */ +if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_VLAN ) { + if (dev_conf->rxmode.offloads &
DEV_RX_OFFLOAD_VLAN_STRIP)drivers/net/iavf/iavf_ethdev.c +14
-0+iavf_enable_vlan_strip (ad); + else +iavf_disable_vlan_strip (ad ); + } + +if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ) { +if (iavf_init_rss (ad) !=0 ) { +PMD_DRV_LOG (ERR ,"configure rss failed" ); +return -1 ; + } + } +return 0 ; +} +static int iavf_init_rxq (struct rte_eth_dev *dev,struct iavf_rx_queue *rxq) {@@ -
440,13 +447,6 @@iavf_dev_start(struct rte_eth_dev *dev)drivers/net/iavf/iavf_ethdev.c +0
-8return -1 ; } -if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RSS_PF ) { -if (iavf_init_rss (adapter) !=0 ) { -PMD_DRV_LOG (ERR ,"configure rss failed" ); - goto err_rss; - } - } -if (iavf_configure_queues (adapter) !=0 ) {PMD_DRV_LOG (ERR ,"configure queues failed" ); goto err_queue;@@ -475,7 +475,6 @@ iavf_dev_start(struct rte_eth_dev *dev) err_mac:iavf_add_del_all_mac_addr (adapter, false); err_queue: -err_rss:return -1 ; }
Quoted 4 lines
Quoted 2 lines
--
2.17.1Acked-by Qiming Yang <[email protected]>
Applied dpdk-next-net-intel.
Thanks
Qi