All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Parav Pandit <parav@nvidia.com>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>
Cc: Eli Cohen <elic@nvidia.com>, "mst@redhat.com" <mst@redhat.com>
Subject: Re: [PATCH linux-next v4 6/8] vdpa/mlx5: Fix clearing of VIRTIO_NET_F_MAC feature bit
Date: Tue, 26 Oct 2021 10:42:20 +0800	[thread overview]
Message-ID: <1d2a05d5-48af-89e2-ec7d-8ae0018ffa7a@redhat.com> (raw)
In-Reply-To: <PH0PR12MB5481233AF957874DF60575CEDC839@PH0PR12MB5481.namprd12.prod.outlook.com>


在 2021/10/25 下午3:08, Parav Pandit 写道:
>
>> From: Jason Wang <jasowang@redhat.com>
>> Sent: Monday, October 25, 2021 12:35 PM
>>
>> 在 2021/10/22 上午12:35, Parav Pandit 写道:
>>> Cited patch in the fixes tag clears the features bit during reset.
>>> mlx5 vdpa device feature bits are static decided by device capabilities.
>>
>> This is not what I read at least from mlx5_vdpa_get_features:
>>
>> static u64 mlx5_vdpa_get_features(struct vdpa_device *vdev) {
>>           struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
>>           struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
>>           u16 dev_features;
>>
>>           dev_features = MLX5_CAP_DEV_VDPA_EMULATION(mvdev->mdev,
>> device_features_bits_mask);
> Not sure I follow. Feature bits are decided by the device capabilities exposed by the MLX5_CAP_DEV_VDPA_EMULATION.
> Other fields below are pretty much static.


Ok, so I think in the commit log we need also mention that the 
VIRTIO_NET_F_MAC is determined and stored in device adding.

Thanks


>
>>           ndev->mvdev.mlx_features |= mlx_to_vritio_features(dev_features);
>>           if (MLX5_CAP_DEV_VDPA_EMULATION(mvdev->mdev,
>> virtio_version_1_0))
>>                   ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_F_VERSION_1);
>>           ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_F_ACCESS_PLATFORM);
>>           ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_NET_F_CTRL_VQ);
>>           ndev->mvdev.mlx_features |=
>> BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR);
>>           ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_NET_F_MQ);
>>
>>           print_features(mvdev, ndev->mvdev.mlx_features, false);
>>           return ndev->mvdev.mlx_features; }
>>
>>
>> Thanks
>>
>>
>>> Clearing features bit cleared the VIRTIO_NET_F_MAC. Due to this MAC
>>> address provided by the device is not honored.
>>>
>>> Fix it by not clearing the static feature bits during reset.
>>>
>>> Fixes: 0686082dbf7a ("vdpa: Add reset callback in vdpa_config_ops")
>>> Signed-off-by: Parav Pandit <parav@nvidia.com>
>>> Reviewed-by: Eli Cohen <elic@nvidia.com>
>>> ---
>>>    drivers/vdpa/mlx5/net/mlx5_vnet.c | 1 -
>>>    1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c
>>> b/drivers/vdpa/mlx5/net/mlx5_vnet.c
>>> index ca05f69054b6..0a2b79887085 100644
>>> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
>>> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
>>> @@ -2192,7 +2192,6 @@ static int mlx5_vdpa_reset(struct vdpa_device
>> *vdev)
>>>    	clear_vqs_ready(ndev);
>>>    	mlx5_vdpa_destroy_mr(&ndev->mvdev);
>>>    	ndev->mvdev.status = 0;
>>> -	ndev->mvdev.mlx_features = 0;
>>>    	memset(ndev->event_cbs, 0, sizeof(ndev->event_cbs));
>>>    	ndev->mvdev.actual_features = 0;
>>>    	++mvdev->generation;

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2021-10-26  2:42 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 16:35 [PATCH linux-next v4 0/8] vdpa: enable user to set mac, mtu Parav Pandit via Virtualization
2021-10-21 16:35 ` [PATCH linux-next v4 1/8] vdpa: Introduce and use vdpa device get, set config helpers Parav Pandit via Virtualization
2021-10-25  6:03   ` Jason Wang
2021-10-25 11:24     ` Parav Pandit via Virtualization
2021-10-21 16:35 ` [PATCH linux-next v4 2/8] vdpa: Introduce query of device config layout Parav Pandit via Virtualization
2021-10-25  6:05   ` Jason Wang
2021-10-25  6:59     ` Parav Pandit via Virtualization
2021-10-25  8:10       ` Michael S. Tsirkin
2021-10-26  2:45       ` Jason Wang
2021-10-25 11:43     ` Parav Pandit via Virtualization
2021-10-21 16:35 ` [PATCH linux-next v4 3/8] vdpa: Use kernel coding style for structure comments Parav Pandit via Virtualization
2021-10-25  6:06   ` Jason Wang
2021-10-21 16:35 ` [PATCH linux-next v4 4/8] vdpa: Enable user to set mac and mtu of vdpa device Parav Pandit via Virtualization
2021-10-25  7:01   ` Jason Wang
2021-10-25  7:06     ` Parav Pandit via Virtualization
2021-10-25  8:08       ` Michael S. Tsirkin
2021-10-25  8:26         ` Parav Pandit via Virtualization
2021-10-26  2:40       ` Jason Wang
2021-10-21 16:35 ` [PATCH linux-next v4 5/8] vdpa_sim_net: Enable user to set mac address and mtu Parav Pandit via Virtualization
2021-10-25  7:02   ` Jason Wang
2021-10-25  7:11     ` Parav Pandit via Virtualization
2021-10-25  8:09       ` Michael S. Tsirkin
2021-10-25  8:10         ` Parav Pandit via Virtualization
2021-10-25  8:16           ` Michael S. Tsirkin
2021-10-21 16:35 ` [PATCH linux-next v4 6/8] vdpa/mlx5: Fix clearing of VIRTIO_NET_F_MAC feature bit Parav Pandit via Virtualization
2021-10-25  7:05   ` Jason Wang
2021-10-25  7:08     ` Parav Pandit via Virtualization
2021-10-26  2:42       ` Jason Wang [this message]
2021-10-21 16:35 ` [PATCH linux-next v4 7/8] vdpa/mlx5: Support configuration of MAC Parav Pandit via Virtualization
2021-10-25  7:07   ` Jason Wang
2021-10-21 16:35 ` [PATCH linux-next v4 8/8] vdpa/mlx5: Forward only packets with allowed MAC address Parav Pandit via Virtualization
2021-10-22 10:41 ` [PATCH linux-next v4 0/8] vdpa: enable user to set mac, mtu Michael S. Tsirkin
2021-10-22 15:07   ` Parav Pandit via Virtualization
2021-10-23 20:03     ` Michael S. Tsirkin
2021-10-23 21:15       ` Michael S. Tsirkin
2021-10-25  3:43         ` Parav Pandit via Virtualization
2021-10-25  7:27           ` Parav Pandit via Virtualization

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d2a05d5-48af-89e2-ec7d-8ae0018ffa7a@redhat.com \
    --to=jasowang@redhat.com \
    --cc=elic@nvidia.com \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.