From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E62B6A00C3; Fri, 17 Jun 2022 17:53:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81B9B42B7E; Fri, 17 Jun 2022 17:53:47 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 3833C40F19 for ; Fri, 17 Jun 2022 17:53:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655481225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9XMvRDM4cD9Ana0lqAm6ElPq3fJ/Zbn2TVGrdYZYiW4=; b=hL9yZJw5UiDcLZLmb20M+cvHFU/Ytebv0wruMb7pOeIXwgWUdNrWXUZqwLaP4cHou6JD9v /4TR48Y/C3FKrKgeFJzEEZuVfrINLlvtOFa5UUqbicqPqi2LEdv8kwVaFv0gEg7kFUY1NV TharP8Elyax3zTn8+KJYmBgWQlQkPps= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-629-h7f6itiFNQ6xlhjFk6dMhQ-1; Fri, 17 Jun 2022 11:53:42 -0400 X-MC-Unique: h7f6itiFNQ6xlhjFk6dMhQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD870800882; Fri, 17 Jun 2022 15:53:41 +0000 (UTC) Received: from [10.39.208.34] (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D128814B; Fri, 17 Jun 2022 15:53:40 +0000 (UTC) Message-ID: <60b16003-85bc-b4b2-97b7-6f827b949592@redhat.com> Date: Fri, 17 Jun 2022 17:53:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 To: Li Zhang , orika@nvidia.com, viacheslavo@nvidia.com, matan@nvidia.com, shahafs@nvidia.com Cc: dev@dpdk.org, thomas@monjalon.net, rasland@nvidia.com, roniba@nvidia.com References: <20220408075606.33056-1-lizh@nvidia.com> <20220616023012.16013-1-lizh@nvidia.com> <20220616023012.16013-7-lizh@nvidia.com> From: Maxime Coquelin Subject: Re: [PATCH v2 06/15] vdpa/mlx5: pre-create virtq in the prob In-Reply-To: <20220616023012.16013-7-lizh@nvidia.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org I would rename the title to something like: "vdpa/mlx5: pre-create virtq at probe time" On 6/16/22 04:30, Li Zhang wrote: > dev_config operation is called in LM progress. > LM time is very critical because all > the VM packets are dropped directly at that time. > > Move the virtq creation to probe time and > only modify the configuration later in > the dev_config stage using the new ability > to modify virtq. > > This optimization accelerates the LM process and > reduces its time by 70%. Nice. > Signed-off-by: Li Zhang > Acked-by: Matan Azrad > --- > doc/guides/rel_notes/release_22_07.rst | 4 + > drivers/vdpa/mlx5/mlx5_vdpa.h | 4 + > drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 13 +- > drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 257 +++++++++++++++---------- > 4 files changed, 174 insertions(+), 104 deletions(-) > > diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst > index f2cf41def9..2056cd9ee7 100644 > --- a/doc/guides/rel_notes/release_22_07.rst > +++ b/doc/guides/rel_notes/release_22_07.rst > @@ -175,6 +175,10 @@ New Features > This is a fall-back implementation for platforms that > don't support vector operations. > > +* **Updated Nvidia mlx5 vDPA driver.** > + > + * Added new devargs ``queue_size`` and ``queues`` to allow prior creation of virtq resources. > + > > Removed Items > ------------- > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.h b/drivers/vdpa/mlx5/mlx5_vdpa.h > index bf82026e37..e5553079fe 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa.h > +++ b/drivers/vdpa/mlx5/mlx5_vdpa.h > @@ -80,6 +80,7 @@ struct mlx5_vdpa_virtq { > uint16_t vq_size; > uint8_t notifier_state; > bool stopped; > + uint32_t configured:1; > uint32_t version; > struct mlx5_vdpa_priv *priv; > struct mlx5_devx_obj *virtq; > @@ -489,4 +490,7 @@ mlx5_vdpa_virtq_stats_reset(struct mlx5_vdpa_priv *priv, int qid); > */ > void > mlx5_vdpa_drain_cq(struct mlx5_vdpa_priv *priv); > + > +bool > +mlx5_vdpa_is_modify_virtq_supported(struct mlx5_vdpa_priv *priv); > #endif /* RTE_PMD_MLX5_VDPA_H_ */ > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c > index 43a2b98255..a8faf0c116 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c > @@ -12,14 +12,17 @@ int > mlx5_vdpa_logging_enable(struct mlx5_vdpa_priv *priv, int enable) > { > struct mlx5_devx_virtq_attr attr = { > - .type = MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_DUMP_ENABLE, > + .mod_fields_bitmap = > + MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_DUMP_ENABLE, > .dirty_bitmap_dump_enable = enable, > }; > + struct mlx5_vdpa_virtq *virtq; > int i; > > for (i = 0; i < priv->nr_virtqs; ++i) { > attr.queue_index = i; > - if (!priv->virtqs[i].virtq) { > + virtq = &priv->virtqs[i]; > + if (!virtq->configured) { > DRV_LOG(DEBUG, "virtq %d is invalid for dirty bitmap " > "enabling.", i); Please avoid cutting logs, it makes it harder to grep in the code. Also, now we can have up to 100 chars, so maybe it would fit anyway. Other than that: Reviewed-by: Maxime Coquelin Thanks, Maxime