Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1109900rdb; Fri, 1 Dec 2023 07:19:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2bBM/aXKIPTYmoGywwd3lWkWIeRndzFYfSVWeQI9uDPrEhSMeRxA1+cyAFCUfNkSZezvt X-Received: by 2002:a17:903:22c4:b0:1cf:c929:d681 with SMTP id y4-20020a17090322c400b001cfc929d681mr20404501plg.60.1701443981548; Fri, 01 Dec 2023 07:19:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701443981; cv=none; d=google.com; s=arc-20160816; b=spaQuSP1y06eai2bUa8zbqMW65PwP9qBrGUThruTMlI28Ud/nraNBcLb1GVHQaH6RY h86mj38vixEtiyCEqZZIiWlzYuA6r88NtFIh42v+9s8865ZlNoMkn9DjD8a8A7ghqwaO UKTwd7DK1QD+xLb0DUChNKBfFGB9iYJZT9b8vNsB2xNtj//UM945dG/g3JVwmQI6Kxj6 0qwteloXz8KT6urZPO4bb5PlrRMpaHDYrVWX4ecd+rpZtyfUP9wHOqPbmVMC/m6Vyxjp HL4oTY48kjdapG/UeYn6wiccU9elB9m/VmiA+rm2Kptk5eVZm+GsrT9zQVrOFPlW6sNj NC+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZXm7ORGqBZRQibD2CXBq2iXnUxr20ROajaE6s0OsD8s=; fh=JqrXZ/hxBqEZkqRbynoXzQzhQXe6pWuIw9AElvFpeBU=; b=GgyjatWW0APF+bk1wc97V7lttyXA/7kYV18Ay0nwZrt7IihvmrV53sf+liXbwVKyYF VN73olm0Ra1RSy0p/XGNeWLHOb0IE66ceWMNPvcKf+MXAQY/+V7d1rj4KzEDh8xJ2BvI S7lh3/NxSzmKr8YD8AcBVteasfW2ChUWznUt4/RCfgdyIiPgB2M+1sSWiCXy66GfcqHt u0HqYXGfe8bAVKl6VS4EVh3f+sdUYBfDnugAgiC6T1bl6NFXlZKSZdy7jgfWR0z6t8+P TvZoCgyhlyxmWrLg0AmRfVU2tw67opkutMKBQrsTUKxtLOZw0/lWQp4+1Zw/0zbJKpTd 9P2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aMYR9A4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a5-20020a1709027d8500b001cfdd2fe630si3192092plm.281.2023.12.01.07.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 07:19:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aMYR9A4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B7A3F807799C; Fri, 1 Dec 2023 07:19:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379333AbjLAPTR (ORCPT + 99 others); Fri, 1 Dec 2023 10:19:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379307AbjLAPTQ (ORCPT ); Fri, 1 Dec 2023 10:19:16 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F36A91 for ; Fri, 1 Dec 2023 07:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701443962; 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=ZXm7ORGqBZRQibD2CXBq2iXnUxr20ROajaE6s0OsD8s=; b=aMYR9A4jY9PDP3NFrrk4G6TV922cESTNuZaSwkLtWtk4jtstu9mWBbZodXjkRrOTq+fa37 1RfPsyp9viRS/NiqCCSGHfjDgDTX5PeY4feIwvFWQqO/N17wzszQXhoeQVllgHQd19JMct 7CYVsZqAyRAGMwhiRSWxM0STXUotj4w= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-690-t0I11RqgMy6UtQljs1pW7g-1; Fri, 01 Dec 2023 10:19:21 -0500 X-MC-Unique: t0I11RqgMy6UtQljs1pW7g-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-5caf61210e3so33333137b3.0 for ; Fri, 01 Dec 2023 07:19:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701443960; x=1702048760; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZXm7ORGqBZRQibD2CXBq2iXnUxr20ROajaE6s0OsD8s=; b=nqU/mslpDNQXvqJhRdUrl7F7ZakZrK/a2jMqFBYIyRPxXKXa8mlRePBN1Xhs9tL+DH b+71Bz6OWUssJLvPmMWVj3b56uC+h2poSCPL27G+knTyOYRlan3ageE2roFae/VsER6B EJQgI1DonB2pip3cw5pcYMWV68oXY+vIXYaP6MCrKpsOlViqgOW82UfxrXiP1BywT3Hq 9D/6uEhJeE2qzt9yO+PyJYPcbJCF4LLb3hqCJ6ksr70J6ek3c54oQ1D+pHmrxyMkhNag 5kHT00QMmA+5tJ2TMO5J7rBGgshPFaZe0UTQhhM2I7ySaTpcJimeoBfp0dWCD/cTMxjT LrCA== X-Gm-Message-State: AOJu0YwDBv4qIZ8RQbVJ6XaapCoMkvfy127XVC+AILmDkYBJpar/uvLh CZxp5DL+T3o1Ut3IwAWfrerfP1Svs5DdNQcuA2DfAYvuxPT0mrEV1wqjrrtbEj3pThJnCmZ3LRT 7d7er4OjX63LwtUHryqpCNXAb/RYaASBCa1dFS02g X-Received: by 2002:a0d:db0f:0:b0:5d6:b412:19dc with SMTP id d15-20020a0ddb0f000000b005d6b41219dcmr1122969ywe.8.1701443960725; Fri, 01 Dec 2023 07:19:20 -0800 (PST) X-Received: by 2002:a0d:db0f:0:b0:5d6:b412:19dc with SMTP id d15-20020a0ddb0f000000b005d6b41219dcmr1122957ywe.8.1701443960471; Fri, 01 Dec 2023 07:19:20 -0800 (PST) MIME-Version: 1.0 References: <20231201104857.665737-1-dtatulea@nvidia.com> <20231201104857.665737-7-dtatulea@nvidia.com> In-Reply-To: <20231201104857.665737-7-dtatulea@nvidia.com> From: Eugenio Perez Martin Date: Fri, 1 Dec 2023 16:18:44 +0100 Message-ID: Subject: Re: [PATCH vhost 6/7] vdpa/mlx5: Mark vq state for modification in hw vq To: Dragos Tatulea Cc: "Michael S . Tsirkin" , Jason Wang , Si-Wei Liu , Saeed Mahameed , Leon Romanovsky , virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Gal Pressman , Parav Pandit , Xuan Zhuo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 07:19:28 -0800 (PST) On Fri, Dec 1, 2023 at 11:50=E2=80=AFAM Dragos Tatulea wrote: > > .set_vq_state will set the indices and mark the fields to be modified in > the hw vq. > > Signed-off-by: Dragos Tatulea Acked-by: Eugenio P=C3=A9rez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 8 ++++++++ > include/linux/mlx5/mlx5_ifc_vdpa.h | 2 ++ > 2 files changed, 10 insertions(+) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/ml= x5_vnet.c > index 2277daf4814f..6325aef045e2 100644 > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > @@ -1249,6 +1249,12 @@ static int modify_virtqueue(struct mlx5_vdpa_net *= ndev, > MLX5_SET64(virtio_q, vq_ctx, available_addr, mvq->driver_= addr); > } > > + if (mvq->modified_fields & MLX5_VIRTQ_MODIFY_MASK_VIRTIO_Q_AVAIL_= IDX) > + MLX5_SET(virtio_net_q_object, obj_context, hw_available_i= ndex, mvq->avail_idx); > + > + if (mvq->modified_fields & MLX5_VIRTQ_MODIFY_MASK_VIRTIO_Q_USED_I= DX) > + MLX5_SET(virtio_net_q_object, obj_context, hw_used_index,= mvq->used_idx); > + > MLX5_SET64(virtio_net_q_object, obj_context, modify_field_select,= mvq->modified_fields); > err =3D mlx5_cmd_exec(ndev->mvdev.mdev, in, inlen, out, sizeof(ou= t)); > if (err) > @@ -2328,6 +2334,8 @@ static int mlx5_vdpa_set_vq_state(struct vdpa_devic= e *vdev, u16 idx, > > mvq->used_idx =3D state->split.avail_index; > mvq->avail_idx =3D state->split.avail_index; > + mvq->modified_fields |=3D MLX5_VIRTQ_MODIFY_MASK_VIRTIO_Q_AVAIL_I= DX | > + MLX5_VIRTQ_MODIFY_MASK_VIRTIO_Q_USED_IDX; > return 0; > } > > diff --git a/include/linux/mlx5/mlx5_ifc_vdpa.h b/include/linux/mlx5/mlx5= _ifc_vdpa.h > index 9594ac405740..32e712106e68 100644 > --- a/include/linux/mlx5/mlx5_ifc_vdpa.h > +++ b/include/linux/mlx5/mlx5_ifc_vdpa.h > @@ -146,6 +146,8 @@ enum { > MLX5_VIRTQ_MODIFY_MASK_DIRTY_BITMAP_PARAMS =3D (u64)1 << 3, > MLX5_VIRTQ_MODIFY_MASK_DIRTY_BITMAP_DUMP_ENABLE =3D (u64)1 << 4, > MLX5_VIRTQ_MODIFY_MASK_VIRTIO_Q_ADDRS =3D (u64)1 << 6, > + MLX5_VIRTQ_MODIFY_MASK_VIRTIO_Q_AVAIL_IDX =3D (u64)1 << 7, > + MLX5_VIRTQ_MODIFY_MASK_VIRTIO_Q_USED_IDX =3D (u64)1 << 8, > MLX5_VIRTQ_MODIFY_MASK_DESC_GROUP_MKEY =3D (u64)1 << 14, > }; > > -- > 2.42.0 >