From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E267DA0524; Fri, 31 Jan 2020 17:01:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 496C81C0CF; Fri, 31 Jan 2020 17:01:49 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id BE7201C0CC for ; Fri, 31 Jan 2020 17:01:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580486507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ZFwbQcX7kZaC81xDG+gPsi8INwFBHhvuoA3XsJTUquc=; b=QfvC6KSneWimDN6nhWMkVm/X1r/P3hBeANxcN4gR9MrbIJgG9GUJPjI6gyA5reX+noapdC gR2ZzY4APgp4CoTuklFI45kw0Xdy7/bsygr5xDjficmrqSBUra0nHu5Hd0w+PsL8uaD9DR RbCKApyfCSDwX604kfZbN2Trd8QbeT0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-111-xHzbww_-M4aDruIhl_Hnpw-1; Fri, 31 Jan 2020 11:01:43 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 046BB802CB8; Fri, 31 Jan 2020 16:01:42 +0000 (UTC) Received: from [10.36.112.51] (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2512C84DBA; Fri, 31 Jan 2020 16:01:39 +0000 (UTC) To: Matan Azrad , dev@dpdk.org, Viacheslav Ovsiienko References: <1579539790-3882-1-git-send-email-matan@mellanox.com> <1580292549-27439-1-git-send-email-matan@mellanox.com> <1580292549-27439-12-git-send-email-matan@mellanox.com> From: Maxime Coquelin Autocrypt: addr=maxime.coquelin@redhat.com; keydata= mQINBFOEQQIBEADjNLYZZqghYuWv1nlLisptPJp+TSxE/KuP7x47e1Gr5/oMDJ1OKNG8rlNg kLgBQUki3voWhUbMb69ybqdMUHOl21DGCj0BTU3lXwapYXOAnsh8q6RRM+deUpasyT+Jvf3a gU35dgZcomRh5HPmKMU4KfeA38cVUebsFec1HuJAWzOb/UdtQkYyZR4rbzw8SbsOemtMtwOx YdXodneQD7KuRU9IhJKiEfipwqk2pufm2VSGl570l5ANyWMA/XADNhcEXhpkZ1Iwj3TWO7XR uH4xfvPl8nBsLo/EbEI7fbuUULcAnHfowQslPUm6/yaGv6cT5160SPXT1t8U9QDO6aTSo59N jH519JS8oeKZB1n1eLDslCfBpIpWkW8ZElGkOGWAN0vmpLfdyiqBNNyS3eGAfMkJ6b1A24un /TKc6j2QxM0QK4yZGfAxDxtvDv9LFXec8ENJYsbiR6WHRHq7wXl/n8guyh5AuBNQ3LIK44x0 KjGXP1FJkUhUuruGyZsMrDLBRHYi+hhDAgRjqHgoXi5XGETA1PAiNBNnQwMf5aubt+mE2Q5r qLNTgwSo2dpTU3+mJ3y3KlsIfoaxYI7XNsPRXGnZi4hbxmeb2NSXgdCXhX3nELUNYm4ArKBP LugOIT/zRwk0H0+RVwL2zHdMO1Tht1UOFGfOZpvuBF60jhMzbQARAQABtCxNYXhpbWUgQ29x dWVsaW4gPG1heGltZS5jb3F1ZWxpbkByZWRoYXQuY29tPokCOAQTAQIAIgUCV3u/5QIbAwYL CQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQyjiNKEaHD4ma2g/+P+Hg9WkONPaY1J4AR7Uf kB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Message-ID: Date: Fri, 31 Jan 2020 17:01:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <1580292549-27439-12-git-send-email-matan@mellanox.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: xHzbww_-M4aDruIhl_Hnpw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 11/13] vdpa/mlx5: support live migration X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/29/20 11:09 AM, Matan Azrad wrote: > Add support for live migration feature by the HW: > Create a single Mkey that maps the memory address space of the > VHOST live migration log file. > Modify VIRTIO_NET_Q object and provide vhost_log_page, > dirty_bitmap_mkey, dirty_bitmap_size, dirty_bitmap_addr > and dirty_bitmap_dump_enable. > Modify VIRTIO_NET_Q object and move state to SUSPEND. > Query VIRTIO_NET_Q and get hw_available_idx and hw_used_idx. > > Signed-off-by: Matan Azrad > Acked-by: Viacheslav Ovsiienko > --- > doc/guides/vdpadevs/features/mlx5.ini | 1 + > drivers/vdpa/mlx5/Makefile | 1 + > drivers/vdpa/mlx5/meson.build | 1 + > drivers/vdpa/mlx5/mlx5_vdpa.c | 44 +++++++++++- > drivers/vdpa/mlx5/mlx5_vdpa.h | 55 ++++++++++++++ > drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 130 ++++++++++++++++++++++++++++++++++ > drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 7 +- > 7 files changed, 236 insertions(+), 3 deletions(-) > create mode 100644 drivers/vdpa/mlx5/mlx5_vdpa_lm.c > > diff --git a/doc/guides/vdpadevs/features/mlx5.ini b/doc/guides/vdpadevs/features/mlx5.ini > index e4ee34b..1da9c1b 100644 > --- a/doc/guides/vdpadevs/features/mlx5.ini > +++ b/doc/guides/vdpadevs/features/mlx5.ini > @@ -9,6 +9,7 @@ guest csum = Y > host tso4 = Y > host tso6 = Y > version 1 = Y > +log all = Y > any layout = Y > guest announce = Y > mq = Y > diff --git a/drivers/vdpa/mlx5/Makefile b/drivers/vdpa/mlx5/Makefile > index 2f70a98..4d1f528 100644 > --- a/drivers/vdpa/mlx5/Makefile > +++ b/drivers/vdpa/mlx5/Makefile > @@ -12,6 +12,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD) += mlx5_vdpa_mem.c > SRCS-$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD) += mlx5_vdpa_event.c > SRCS-$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD) += mlx5_vdpa_virtq.c > SRCS-$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD) += mlx5_vdpa_steer.c > +SRCS-$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD) += mlx5_vdpa_lm.c > > > # Basic CFLAGS. > diff --git a/drivers/vdpa/mlx5/meson.build b/drivers/vdpa/mlx5/meson.build > index 2849178..2e521b8 100644 > --- a/drivers/vdpa/mlx5/meson.build > +++ b/drivers/vdpa/mlx5/meson.build > @@ -16,6 +16,7 @@ sources = files( > 'mlx5_vdpa_event.c', > 'mlx5_vdpa_virtq.c', > 'mlx5_vdpa_steer.c', > + 'mlx5_vdpa_lm.c', > ) > cflags_options = [ > '-std=c11', > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c > index 71189c4..4ce0ba0 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c > @@ -19,7 +19,8 @@ > (1ULL << VIRTIO_F_ANY_LAYOUT) | \ > (1ULL << VIRTIO_NET_F_MQ) | \ > (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | \ > - (1ULL << VIRTIO_F_ORDER_PLATFORM)) > + (1ULL << VIRTIO_F_ORDER_PLATFORM) | \ > + (1ULL << VHOST_F_LOG_ALL)) > > #define MLX5_VDPA_PROTOCOL_FEATURES \ > ((1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ) | \ > @@ -127,6 +128,45 @@ > return mlx5_vdpa_virtq_enable(virtq, state); > } > > +static int > +mlx5_vdpa_features_set(int vid) > +{ > + int did = rte_vhost_get_vdpa_device_id(vid); > + struct mlx5_vdpa_priv *priv = mlx5_vdpa_find_priv_resource_by_did(did); > + uint64_t log_base, log_size; > + uint64_t features; > + int ret; > + > + if (priv == NULL) { > + DRV_LOG(ERR, "Invalid device id: %d.", did); > + return -EINVAL; > + } > + ret = rte_vhost_get_negotiated_features(vid, &features); > + if (ret) { > + DRV_LOG(ERR, "Failed to get negotiated features."); > + return ret; > + } > + if (RTE_VHOST_NEED_LOG(features)) { > + ret = rte_vhost_get_log_base(vid, &log_base, &log_size); > + if (ret) { > + DRV_LOG(ERR, "Failed to get log base."); > + return ret; > + } > + ret = mlx5_vdpa_dirty_bitmap_set(priv, log_base, log_size); > + if (ret) { > + DRV_LOG(ERR, "Failed to set dirty bitmap."); > + return ret; > + } > + DRV_LOG(INFO, "mlx5 vdpa: enabling dirty logging..."); > + ret = mlx5_vdpa_logging_enable(priv, 1); > + if (ret) { > + DRV_LOG(ERR, "Failed t enable dirty logging."); > + return ret; > + } > + } > + return 0; > +} > + > static struct rte_vdpa_dev_ops mlx5_vdpa_ops = { > .get_queue_num = mlx5_vdpa_get_queue_num, > .get_features = mlx5_vdpa_get_vdpa_features, > @@ -134,7 +174,7 @@ > .dev_conf = NULL, > .dev_close = NULL, > .set_vring_state = mlx5_vdpa_set_vring_state, > - .set_features = NULL, > + .set_features = mlx5_vdpa_features_set, > .migration_done = NULL, > .get_vfio_group_fd = NULL, > .get_vfio_device_fd = NULL, > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.h b/drivers/vdpa/mlx5/mlx5_vdpa.h > index af78ea1..70264e4 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa.h > +++ b/drivers/vdpa/mlx5/mlx5_vdpa.h > @@ -244,4 +244,59 @@ int mlx5_vdpa_event_qp_create(struct mlx5_vdpa_priv *priv, uint16_t desc_n, > */ > int mlx5_vdpa_steer_setup(struct mlx5_vdpa_priv *priv); > > +/** > + * Enable\Disable live migration logging. > + * > + * @param[in] priv > + * The vdpa driver private structure. > + * @param[in] enable > + * Set for enable, unset for disable. > + * > + * @return > + * 0 on success, a negative value otherwise. > + */ > +int mlx5_vdpa_logging_enable(struct mlx5_vdpa_priv *priv, int enable); > + > +/** > + * Set dirty bitmap logging to allow live migration. > + * > + * @param[in] priv > + * The vdpa driver private structure. > + * @param[in] log_base > + * Vhost log base. > + * @param[in] log_size > + * Vhost log size. > + * > + * @return > + * 0 on success, a negative value otherwise. > + */ > +int mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base, > + uint64_t log_size); > + > +/** > + * Log all virtqs information for live migration. > + * > + * @param[in] priv > + * The vdpa driver private structure. > + * @param[in] enable > + * Set for enable, unset for disable. > + * > + * @return > + * 0 on success, a negative value otherwise. > + */ > +int mlx5_vdpa_lm_log(struct mlx5_vdpa_priv *priv); > + > +/** > + * Modify virtq state to be ready or suspend. > + * > + * @param[in] virtq > + * The vdpa driver private virtq structure. > + * @param[in] state > + * Set for ready, otherwise suspend. > + * > + * @return > + * 0 on success, a negative value otherwise. > + */ > +int mlx5_vdpa_virtq_modify(struct mlx5_vdpa_virtq *virtq, int state); > + > #endif /* RTE_PMD_MLX5_VDPA_H_ */ > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c > new file mode 100644 > index 0000000..cfeec5f > --- /dev/null > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c > @@ -0,0 +1,130 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2019 Mellanox Technologies, Ltd > + */ > +#include > +#include > + > +#include "mlx5_vdpa_utils.h" > +#include "mlx5_vdpa.h" > + > + > +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, > + .dirty_bitmap_dump_enable = enable, > + }; > + struct mlx5_vdpa_virtq *virtq; > + > + SLIST_FOREACH(virtq, &priv->virtq_list, next) { > + attr.queue_index = virtq->index; > + if (mlx5_devx_cmd_modify_virtq(virtq->virtq, &attr)) { > + DRV_LOG(ERR, "Failed to modify virtq %d logging.", > + virtq->index); > + return -1; > + } > + } > + return 0; > +} > + > +int > +mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base, > + uint64_t log_size) > +{ > + struct mlx5_devx_mkey_attr mkey_attr = { > + .addr = (uintptr_t)log_base, > + .size = log_size, > + .pd = priv->pdn, > + .pg_access = 1, > + .klm_array = NULL, > + .klm_num = 0, > + }; > + struct mlx5_devx_virtq_attr attr = { > + .type = MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_PARAMS, > + .dirty_bitmap_addr = log_base, > + .dirty_bitmap_size = log_size, > + }; > + struct mlx5_vdpa_query_mr *mr = rte_malloc(__func__, sizeof(*mr), 0); > + struct mlx5_vdpa_virtq *virtq; > + > + if (!mr) { > + DRV_LOG(ERR, "Failed to allocate mem for lm mr."); > + return -1; > + } > + mr->umem = mlx5_glue->devx_umem_reg(priv->ctx, > + (void *)(uintptr_t)log_base, > + log_size, IBV_ACCESS_LOCAL_WRITE); > + if (!mr->umem) { > + DRV_LOG(ERR, "Failed to register umem for lm mr."); > + goto err; > + } > + mkey_attr.umem_id = mr->umem->umem_id; > + mr->mkey = mlx5_devx_cmd_mkey_create(priv->ctx, &mkey_attr); > + if (!mr->mkey) { > + DRV_LOG(ERR, "Failed to create Mkey for lm."); > + goto err; > + } > + attr.dirty_bitmap_mkey = mr->mkey->id; > + SLIST_FOREACH(virtq, &priv->virtq_list, next) { > + attr.queue_index = virtq->index; > + if (mlx5_devx_cmd_modify_virtq(virtq->virtq, &attr)) { > + DRV_LOG(ERR, "Failed to modify virtq %d for lm.", > + virtq->index); > + goto err; > + } > + } > + mr->is_indirect = 0; > + SLIST_INSERT_HEAD(&priv->mr_list, mr, next); > + return 0; > +err: > + if (mr->mkey) > + mlx5_devx_cmd_destroy(mr->mkey); > + if (mr->umem) > + mlx5_glue->devx_umem_dereg(mr->umem); > + rte_free(mr); > + return -1; > +} > + > +#define MLX5_VDPA_USED_RING_LEN(size) \ > + ((size) * sizeof(struct vring_used_elem) + sizeof(uint16_t) * 3) > + > +int > +mlx5_vdpa_lm_log(struct mlx5_vdpa_priv *priv) > +{ > + struct mlx5_devx_virtq_attr attr = {0}; > + struct mlx5_vdpa_virtq *virtq; > + uint64_t features; > + int ret = rte_vhost_get_negotiated_features(priv->vid, &features); > + > + if (ret) { > + DRV_LOG(ERR, "Failed to get negotiated features."); > + return -1; > + } > + if (RTE_VHOST_NEED_LOG(features)) { > + SLIST_FOREACH(virtq, &priv->virtq_list, next) { > + ret = mlx5_vdpa_virtq_modify(virtq, 0); > + if (ret) > + return -1; > + if (mlx5_devx_cmd_query_virtq(virtq->virtq, &attr)) { > + DRV_LOG(ERR, "Failed to query virtq %d.", > + virtq->index); > + return -1; > + } > + DRV_LOG(INFO, "Query vid %d vring %d: hw_available_idx=" > + "%d, hw_used_index=%d", priv->vid, virtq->index, > + attr.hw_available_index, attr.hw_used_index); > + ret = rte_vhost_set_vring_base(priv->vid, virtq->index, > + attr.hw_available_index, > + attr.hw_used_index); > + if (ret) { > + DRV_LOG(ERR, "Failed to set virtq %d base.", > + virtq->index); > + return -1; > + } > + rte_vhost_log_used_vring(priv->vid, virtq->index, 0, > + MLX5_VDPA_USED_RING_LEN(virtq->vq_size)); > + } > + } > + return 0; > +} To avoid one more level of indentation, I would do: if (!RTE_VHOST_NEED_LOG(features)) return 0; Other than that: Acked-by: Maxime Coquelin Thanks, Maxime