net/bonding: fix destroy dedicated queues flow

Message ID 20230608025903.814504-1-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/bonding: fix destroy dedicated queues flow |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Chaoyong He June 8, 2023, 2:59 a.m. UTC
  From: Long Wu <long.wu@corigine.com>

Bonding port in mode 4 enables dedicated queues, we
will create a flow for this feature. So we need to
destroy this flow when we remove the member port.

Furthermore if we don't destroy the flow that created
for dedicated queues when we remove the member port,
maybe we couldn't add the member port to a new bonding
port that needed dedicated queues.

We add the destroy action in removing member port
function.

Fixes: 49dad9028e2a ("net/bonding: support flow API")
Cc: matan@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/bonding/rte_eth_bond_api.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

humin (Q) June 20, 2023, 3:02 a.m. UTC | #1
Acked-by: Min Hu (Connor) <humin29@huawei.com>

在 2023/6/8 10:59, Chaoyong He 写道:
> From: Long Wu <long.wu@corigine.com>
>
> Bonding port in mode 4 enables dedicated queues, we
> will create a flow for this feature. So we need to
> destroy this flow when we remove the member port.
>
> Furthermore if we don't destroy the flow that created
> for dedicated queues when we remove the member port,
> maybe we couldn't add the member port to a new bonding
> port that needed dedicated queues.
>
> We add the destroy action in removing member port
> function.
>
> Fixes: 49dad9028e2a ("net/bonding: support flow API")
> Cc: matan@mellanox.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> ---
>   drivers/net/bonding/rte_eth_bond_api.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
> index c0178369b4..85d0528b7c 100644
> --- a/drivers/net/bonding/rte_eth_bond_api.c
> +++ b/drivers/net/bonding/rte_eth_bond_api.c
> @@ -712,6 +712,16 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
>   		}
>   	}
>   
> +	/* Remove the dedicated queues flow */
> +	if (internals->mode == BONDING_MODE_8023AD &&
> +		internals->mode4.dedicated_queues.enabled == 1 &&
> +		internals->mode4.dedicated_queues.flow[slave_port_id] != NULL) {
> +		rte_flow_destroy(slave_port_id,
> +				internals->mode4.dedicated_queues.flow[slave_port_id],
> +				&flow_error);
> +		internals->mode4.dedicated_queues.flow[slave_port_id] = NULL;
> +	}
> +
>   	slave_eth_dev = &rte_eth_devices[slave_port_id];
>   	slave_remove(internals, slave_eth_dev);
>   	slave_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDED_SLAVE);
  
Ferruh Yigit June 20, 2023, 11:20 a.m. UTC | #2
On 6/20/2023 4:02 AM, humin (Q) wrote:

> 在 2023/6/8 10:59, Chaoyong He 写道:
>> From: Long Wu <long.wu@corigine.com>
>>
>> Bonding port in mode 4 enables dedicated queues, we
>> will create a flow for this feature. So we need to
>> destroy this flow when we remove the member port.
>>
>> Furthermore if we don't destroy the flow that created
>> for dedicated queues when we remove the member port,
>> maybe we couldn't add the member port to a new bonding
>> port that needed dedicated queues.
>>
>> We add the destroy action in removing member port
>> function.
>>
>> Fixes: 49dad9028e2a ("net/bonding: support flow API")
>> Cc: matan@mellanox.com
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Long Wu <long.wu@corigine.com>
>> Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
>> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
>> 
>
> Acked-by: Min Hu (Connor) <humin29@huawei.com>
>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index c0178369b4..85d0528b7c 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -712,6 +712,16 @@  __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
 		}
 	}
 
+	/* Remove the dedicated queues flow */
+	if (internals->mode == BONDING_MODE_8023AD &&
+		internals->mode4.dedicated_queues.enabled == 1 &&
+		internals->mode4.dedicated_queues.flow[slave_port_id] != NULL) {
+		rte_flow_destroy(slave_port_id,
+				internals->mode4.dedicated_queues.flow[slave_port_id],
+				&flow_error);
+		internals->mode4.dedicated_queues.flow[slave_port_id] = NULL;
+	}
+
 	slave_eth_dev = &rte_eth_devices[slave_port_id];
 	slave_remove(internals, slave_eth_dev);
 	slave_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDED_SLAVE);