Skip to contentSkip to conversation

net/iavf: initialize large VF setting at startup

PATCH Superseded Ghalem Boudour 3 participants 8 messages Feb 3, 2022 – Feb 11, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: initialize large VF setting at startup

lv_enabled is used to remember if large VF setting is configured, but its value is not initialized at startup. This can lead to a different configuration regarding the initial configuration of the PF. For example, a first start is done with 8 rx and 8 tx queues. Large VF is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed but reta size is 256 as the PF has been configured during the second start.

In order to have a consistent behavior regarding reta size whatever the configuration of the PF (may be changed by a previous boot) the lv_enabled must be set properly at the init phase.

---
 drivers/net/iavf/iavf_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/iavf/iavf_ethdev.c +2 -0
index 79397f15e54f..09410be4b712 100644
@@ -2276,6 +2276,8 @@ iavf_init_vf(struct rte_eth_dev *dev)
 			PMD_INIT_LOG(ERR, "unable to allocate rss_lut memory");
 			goto err_rss;
 		}
+		if (vf->vsi_res->num_queue_pairs > IAVF_MAX_NUM_QUEUES_DFLT)
+			vf->lv_enabled = true;
 	}
 
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
Signature · 1 line
2.30.2
#1 lore raw
Quoted 35 lines

-----Original Message-----
From: Ghalem Boudour <[email protected]>
Sent: Thursday, February 3, 2022 5:04 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Ghalem Boudour <[email protected]>; Thibaut Collet <[email protected]>; Olivier Matz <[email protected]>
Subject: [PATCH] net/iavf: initialize large VF setting at startup

lv_enabled is used to remember if large VF setting is configured, but its value is not initialized at startup. This can lead to a different configuration regarding the initial configuration of the PF.
For example, a first start is done with 8 rx and 8 tx queues. Large VF is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed but reta size is 256 as the PF has been configured during the second start.

In order to have a consistent behavior regarding reta size whatever the configuration of the PF (may be changed by a previous boot) the lv_enabled must be set properly at the init phase.

---
 drivers/net/iavf/iavf_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/iavf/iavf_ethdev.c +0 -0
index 79397f15e54f..09410be4b712 100644

drivers/net/iavf/iavf_ethdev.c iavf_init_vf(struct rte_eth_dev *dev) · line 2282

Quoted 7 lines
drivers/net/iavf/iavf_ethdev.c +2 -0
@@ -2276,6 +2276,8 @@ iavf_init_vf(struct rte_eth_dev *dev)
 			PMD_INIT_LOG(ERR, "unable to allocate rss_lut
 memory");
 			goto err_rss;
 		}
+		if (vf->vsi_res->num_queue_pairs >
 IAVF_MAX_NUM_QUEUES_DFLT)
+			vf->lv_enabled = true;

Why you put this operation in the part of " VIRTCHNL_VF_OFFLOAD_RSS_PF"?

Quoted 6 lines
drivers/net/iavf/iavf_ethdev.c +0 -0
 	}

if (vf->vf_res->vf_cap_flags &
VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
--
2.30.2

#2 lore raw

Hi Ting,

The purpose of the correction is to ensure that the rss configuration is aligned with the number of queues
allocated on the current boot and not impacted by a previous configuration done in a previous boot.
The rss configuration is only available if VIRTCHNL_VF_OFFLOAD_RSS_PF is present and that is the reason
that we have set the operation in part of VIRTCHNL_VF_OFFLOAD_RSS_PF.

Nevertheless this operation can be moved outside to be more generic and also covers iavf_config_irq_map.

Quoted 53 lines · Ting
Quoted 36 lines

-----Original Message-----
From: Ghalem Boudour <[email protected]>
Sent: Thursday, February 3, 2022 5:04 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Ghalem Boudour <[email protected]>; Thibaut Collet <[email protected]>; Olivier Matz <[email protected]>
Subject: [PATCH] net/iavf: initialize large VF setting at startup

lv_enabled is used to remember if large VF setting is configured, but its value is not initialized at startup. This can lead to a different configuration regarding the initial configuration of the PF.
For example, a first start is done with 8 rx and 8 tx queues. Large VF is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed but reta size is 256 as the PF has been configured during the second start.

In order to have a consistent behavior regarding reta size whatever the configuration of the PF (may be changed by a previous boot) the lv_enabled must be set properly at the init phase.

---
 drivers/net/iavf/iavf_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/iavf/iavf_ethdev.c +0 -0
index 79397f15e54f..09410be4b712 100644

drivers/net/iavf/iavf_ethdev.c iavf_init_vf(struct rte_eth_dev *dev) · line 2282

Quoted 7 lines
drivers/net/iavf/iavf_ethdev.c +2 -0
@@ -2276,6 +2276,8 @@ iavf_init_vf(struct rte_eth_dev *dev)
                      PMD_INIT_LOG(ERR, "unable to allocate rss_lut
 memory");
                      goto err_rss;
              }
+             if (vf->vsi_res->num_queue_pairs >
 IAVF_MAX_NUM_QUEUES_DFLT)
+                     vf->lv_enabled = true;

Why you put this operation in the part of " VIRTCHNL_VF_OFFLOAD_RSS_PF"?

Quoted 6 lines
drivers/net/iavf/iavf_ethdev.c +0 -0
      }
      if (vf->vf_res->vf_cap_flags &

VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
--
2.30.2

#3 lore raw
Quoted 71 lines

-----Original Message-----
From: Ghalem Boudour <[email protected]>
Sent: Thursday, February 10, 2022 3:27 AM
To: Xu, Ting <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; Thibaut Collet <[email protected]>; Olivier Matz <[email protected]>
Subject: Re: [PATCH] net/iavf: initialize large VF setting at startup

Hi Ting,

The purpose of the correction is to ensure that the rss configuration is aligned with the number of queues allocated on the current boot and not impacted by a previous configuration done in a previous boot. The rss configuration is only available if VIRTCHNL_VF_OFFLOAD_RSS_PF is present and that is the reason that we have set the operation in part of VIRTCHNL_VF_OFFLOAD_RSS_PF.

Nevertheless this operation can be moved outside to be more generic and also covers iavf_config_irq_map.

Quoted 7 lines · Ting
Quoted 7 lines

-----Original Message-----
From: Ghalem Boudour <[email protected]>
Sent: Thursday, February 3, 2022 5:04 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Ghalem Boudour <[email protected]>;

Thibaut

Quoted 4 lines
Quoted 4 lines

Collet <[email protected]>; Olivier Matz <[email protected]>
Subject: [PATCH] net/iavf: initialize large VF setting at startup

Quoted 9 lines
Quoted 9 lines

lv_enabled is used to remember if large VF setting is configured, but its value is not initialized at startup. This can lead to a different configuration regarding the initial configuration of the PF. For example, a first start is done with 8 rx and 8 tx queues. Large VF is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed but reta size is 256 as the PF has been configured during the

second start.

Quoted 12 lines
Quoted 12 lines

In order to have a consistent behavior regarding reta size whatever the configuration of the PF (may be changed by a previous boot) the lv_enabled must be set properly at the init phase.

---
 drivers/net/iavf/iavf_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 15 lines

drivers/net/iavf/iavf_ethdev.c iavf_init_vf(struct rte_eth_dev *dev) · line 2282

Quoted 13 lines
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_ethdev.c index 79397f15e54f..09410be4b712 100644

drivers/net/iavf/iavf_ethdev.c +2 -0
@@ -2276,6 +2276,8 @@ iavf_init_vf(struct rte_eth_dev *dev)
                      PMD_INIT_LOG(ERR, "unable to allocate rss_lut
 memory");
                      goto err_rss;
              }
+             if (vf->vsi_res->num_queue_pairs >
 IAVF_MAX_NUM_QUEUES_DFLT)
+                     vf->lv_enabled = true;

Why you put this operation in the part of "

Quoted 9 lines

VIRTCHNL_VF_OFFLOAD_RSS_PF"?

Quoted 8 lines
Quoted 7 lines
drivers/net/iavf/iavf_ethdev.c +0 -0
      }
      if (vf->vf_res->vf_cap_flags &

VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
--
2.30.2

I think it is OK to move outside to the generic vf initialization since it is not only bound with RSS, what's your opinion?

#4 lore raw

I agree with you.
Will submit a new revision.
Thanks

Quoted 83 lines · Ting
Quoted 72 lines

-----Original Message-----
From: Ghalem Boudour <[email protected]>
Sent: Thursday, February 10, 2022 3:27 AM
To: Xu, Ting <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; Thibaut Collet <[email protected]>; Olivier Matz <[email protected]>
Subject: Re: [PATCH] net/iavf: initialize large VF setting at startup

Hi Ting,

The purpose of the correction is to ensure that the rss configuration is aligned with the number of queues allocated on the current boot and not impacted by a previous configuration done in a previous boot. The rss configuration is only available if VIRTCHNL_VF_OFFLOAD_RSS_PF is present and that is the reason that we have set the operation in part of VIRTCHNL_VF_OFFLOAD_RSS_PF.

Nevertheless this operation can be moved outside to be more generic and also covers iavf_config_irq_map.

Quoted 7 lines · Ting
Quoted 7 lines

-----Original Message-----
From: Ghalem Boudour <[email protected]>
Sent: Thursday, February 3, 2022 5:04 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Ghalem Boudour <[email protected]>;

Thibaut

Quoted 4 lines
Quoted 4 lines

Collet <[email protected]>; Olivier Matz <[email protected]>
Subject: [PATCH] net/iavf: initialize large VF setting at startup

Quoted 9 lines
Quoted 9 lines

lv_enabled is used to remember if large VF setting is configured, but its value is not initialized at startup. This can lead to a different configuration regarding the initial configuration of the PF. For example, a first start is done with 8 rx and 8 tx queues. Large VF is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed but reta size is 256 as the PF has been configured during the

second start.

Quoted 12 lines
Quoted 12 lines

In order to have a consistent behavior regarding reta size whatever the configuration of the PF (may be changed by a previous boot) the lv_enabled must be set properly at the init phase.

---
 drivers/net/iavf/iavf_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 15 lines

drivers/net/iavf/iavf_ethdev.c iavf_init_vf(struct rte_eth_dev *dev) · line 2282

Quoted 13 lines
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_ethdev.c index 79397f15e54f..09410be4b712 100644

drivers/net/iavf/iavf_ethdev.c +2 -0
@@ -2276,6 +2276,8 @@ iavf_init_vf(struct rte_eth_dev *dev)
                      PMD_INIT_LOG(ERR, "unable to allocate rss_lut
 memory");
                      goto err_rss;
              }
+             if (vf->vsi_res->num_queue_pairs >
 IAVF_MAX_NUM_QUEUES_DFLT)
+                     vf->lv_enabled = true;

Why you put this operation in the part of "

Quoted 9 lines

VIRTCHNL_VF_OFFLOAD_RSS_PF"?

Quoted 8 lines
Quoted 7 lines
drivers/net/iavf/iavf_ethdev.c +0 -0
      }
      if (vf->vf_res->vf_cap_flags &

VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
--
2.30.2

I think it is OK to move outside to the generic vf initialization since it is not only bound with RSS, what's your opinion?

#5 lore raw

PATCH v2 1/1 net/iavf: initialize large VF setting at startup

In reply to Ghalem Boudour

lv_enabled is used to remember if large VF setting is configured, but its value is not initialized at startup. This can lead to a different configuration regarding the initial configuration of the PF. For example, a first start is done with 8 rx and 8 tx queues. Large VF is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed but reta size is 256 as the PF has been configured during the second start.

In order to have a consistent behavior regarding reta size whatever the configuration of the PF (may be changed by a previous boot) the lv_enabled must be set properly at the init phase.

---
v2:
* Enable large VF at initialization independently of rss configuration

---
 drivers/net/iavf/iavf_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/iavf/iavf_ethdev.c +3 -0
index 79397f15e54f..d6190ac24ac6 100644
@@ -2278,6 +2278,9 @@ iavf_init_vf(struct rte_eth_dev *dev)
 		}
 	}
 
+	if (vf->vsi_res->num_queue_pairs > IAVF_MAX_NUM_QUEUES_DFLT)
+		vf->lv_enabled = true;
+
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
 		if (iavf_get_supported_rxdid(adapter) != 0) {
 			PMD_INIT_LOG(ERR, "failed to do get supported rxdid");
Signature · 1 line
2.30.2
Acked-by on v2 1/1
#6 lore raw
Quoted 47 lines

-----Original Message-----
From: Ghalem Boudour <[email protected]>
Sent: Thursday, February 10, 2022 6:49 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Xu, Ting <[email protected]>; Ghalem Boudour <[email protected]>; Thibaut Collet <[email protected]>; Olivier Matz <[email protected]>
Subject: [PATCH v2] net/iavf: initialize large VF setting at startup

lv_enabled is used to remember if large VF setting is configured, but its value is not initialized at startup. This can lead to a different configuration regarding the initial configuration of the PF.
For example, a first start is done with 8 rx and 8 tx queues. Large VF is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed but reta size is 256 as the PF has been configured during the second start.

In order to have a consistent behavior regarding reta size whatever the configuration of the PF (may be changed by a previous boot) the lv_enabled must be set properly at the init phase.

---
v2:
* Enable large VF at initialization independently of rss configuration

---
 drivers/net/iavf/iavf_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/iavf/iavf_ethdev.c +3 -0
index 79397f15e54f..d6190ac24ac6 100644
@@ -2278,6 +2278,9 @@ iavf_init_vf(struct rte_eth_dev *dev)
 		}
 	}
 
+	if (vf->vsi_res->num_queue_pairs > IAVF_MAX_NUM_QUEUES_DFLT)
+		vf->lv_enabled = true;
+
 	if (vf->vf_res->vf_cap_flags &
 VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
 		if (iavf_get_supported_rxdid(adapter) != 0) {
Quoted 4 lines

PMD_INIT_LOG(ERR, "failed to do get supported
rxdid");
--
2.30.2

Applied
#7 lore raw
Quoted 64 lines

-----Original Message-----
From: Xu, Ting <[email protected]>
Sent: Thursday, February 10, 2022 10:17 PM
To: Ghalem Boudour <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Thibaut Collet <[email protected]>; Olivier Matz <[email protected]>
Subject: RE: [PATCH v2] net/iavf: initialize large VF setting at startup

Quoted 7 lines

-----Original Message-----
From: Ghalem Boudour <[email protected]>
Sent: Thursday, February 10, 2022 6:49 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Xu, Ting <[email protected]>; Ghalem Boudour <[email protected]>; Thibaut Collet

<[email protected]>;

Quoted 33 lines

Olivier Matz <[email protected]>
Subject: [PATCH v2] net/iavf: initialize large VF setting at startup

lv_enabled is used to remember if large VF setting is configured, but its value is not initialized at startup. This can lead to a different configuration regarding the initial configuration of the PF. For example, a first start is done with 8 rx and 8 tx queues. Large VF is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed but reta size is 256 as the PF has been configured during the second start.

In order to have a consistent behavior regarding reta size whatever the configuration of the PF (may be changed by a previous boot) the lv_enabled must be set properly at the init phase.

---
v2:
* Enable large VF at initialization independently of rss configuration

---
 drivers/net/iavf/iavf_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_ethdev.c index 79397f15e54f..d6190ac24ac6 100644

drivers/net/iavf/iavf_ethdev.c iavf_init_vf(struct rte_eth_dev *dev) · line 2281

Quoted 4 lines
drivers/net/iavf/iavf_ethdev.c +1 -0
@@ -2278,6 +2278,9 @@ iavf_init_vf(struct rte_eth_dev *dev)
 		}
 	}
 
+	if (vf->vsi_res->num_queue_pairs >

IAVF_MAX_NUM_QUEUES_DFLT)

Quoted 6 lines
drivers/net/iavf/iavf_ethdev.c +2 -0
+		vf->lv_enabled = true;
+
 	if (vf->vf_res->vf_cap_flags &
 VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
 		if (iavf_get_supported_rxdid(adapter) != 0) {

PMD_INIT_LOG(ERR, "failed to do get supported

rxdid");

Quoted 4 lines
Quoted 2 lines

--
2.30.2

Applied to dpdk-next-net-intel.

Thanks
Qi