[dpdk-dev] net/mlx5: fix init on secondary process

Message ID 1475072658-29534-1-git-send-email-ogournet@corp.free.fr
State Superseded, archived
Delegated to: Bruce Richardson
Headers show

Commit Message

Olivier Gournet Sept. 28, 2016, 2:24 p.m.
Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")

Signed-off-by: Olivier Gournet <ogournet@corp.free.fr>
---
 drivers/net/mlx5/mlx5_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Ferruh Yigit Oct. 10, 2016, 1:32 p.m. | #1
On 9/28/2016 3:24 PM, Olivier Gournet wrote:
> Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
> 
> Signed-off-by: Olivier Gournet <ogournet@corp.free.fr>
> ---

Adding maintainer to the thread
Adrien Mazarguil Oct. 11, 2016, 9:45 a.m. | #2
Hi Olivier,

Secondary process support's got overlooked during this refactoring, thanks
for the patch. However can you describe the issue you're addressing as part
of the commit log?

I think problems started when txq got mistakenly converted to
primary_txq_ctrl in 21c8bb4928c9 ("net/mlx5: split Tx queue structure"), you
may add a Fixes line for that one as well.

Otherwise, this patch looks fine to me.

On Wed, Sep 28, 2016 at 04:24:18PM +0200, Olivier Gournet wrote:
> Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
> 
> Signed-off-by: Olivier Gournet <ogournet@corp.free.fr>
> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index 130e15d..6f39965 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -1308,11 +1308,13 @@ mlx5_secondary_data_setup(struct priv *priv)
>  			continue;
>  		primary_txq_ctrl = container_of(primary_txq,
>  						struct txq_ctrl, txq);
> -		txq_ctrl = rte_calloc_socket("TXQ", 1, sizeof(*txq_ctrl), 0,
> +		txq_ctrl = rte_calloc_socket("TXQ", 1, sizeof(*txq_ctrl) +
> +					     primary_txq->elts_n *
> +					     sizeof(struct rte_mbuf *), 0,
>  					     primary_txq_ctrl->socket);
>  		if (txq_ctrl != NULL) {
>  			if (txq_ctrl_setup(priv->dev,
> -					   primary_txq_ctrl,
> +					   txq_ctrl,
>  					   primary_txq->elts_n,
>  					   primary_txq_ctrl->socket,
>  					   NULL) == 0) {
> -- 
> 2.1.4
Ferruh Yigit Oct. 17, 2016, 12:05 p.m. | #3
Hi Olivier,

On 10/11/2016 10:45 AM, Adrien Mazarguil wrote:
> Hi Olivier,
> 
> Secondary process support's got overlooked during this refactoring, thanks
> for the patch. However can you describe the issue you're addressing as part
> of the commit log?
> 
> I think problems started when txq got mistakenly converted to
> primary_txq_ctrl in 21c8bb4928c9 ("net/mlx5: split Tx queue structure"), you
> may add a Fixes line for that one as well.
> 
> Otherwise, this patch looks fine to me.
> 

Patch doesn't apply cleanly, can you please rebase the patch on top of
latest dpdk-next-net?

Thanks,
ferruh

Patch

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 130e15d..6f39965 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1308,11 +1308,13 @@  mlx5_secondary_data_setup(struct priv *priv)
 			continue;
 		primary_txq_ctrl = container_of(primary_txq,
 						struct txq_ctrl, txq);
-		txq_ctrl = rte_calloc_socket("TXQ", 1, sizeof(*txq_ctrl), 0,
+		txq_ctrl = rte_calloc_socket("TXQ", 1, sizeof(*txq_ctrl) +
+					     primary_txq->elts_n *
+					     sizeof(struct rte_mbuf *), 0,
 					     primary_txq_ctrl->socket);
 		if (txq_ctrl != NULL) {
 			if (txq_ctrl_setup(priv->dev,
-					   primary_txq_ctrl,
+					   txq_ctrl,
 					   primary_txq->elts_n,
 					   primary_txq_ctrl->socket,
 					   NULL) == 0) {