From patchwork Mon Oct 19 14:17:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wenxu X-Patchwork-Id: 1384355 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ucloud.cn Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CFJys6Vhvz9sSC for ; Tue, 20 Oct 2020 01:28:37 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729477AbgJSO2g (ORCPT ); Mon, 19 Oct 2020 10:28:36 -0400 Received: from m9785.mail.qiye.163.com ([220.181.97.85]:11552 "EHLO m9785.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728311AbgJSO2f (ORCPT ); Mon, 19 Oct 2020 10:28:35 -0400 X-Greylist: delayed 681 seconds by postgrey-1.27 at vger.kernel.org; Mon, 19 Oct 2020 10:28:30 EDT Received: from localhost.localdomain (unknown [123.59.132.129]) by m9785.mail.qiye.163.com (Hmail) with ESMTPA id 89CD05C0F4E; Mon, 19 Oct 2020 22:17:07 +0800 (CST) From: wenxu@ucloud.cn To: eli@mellanox.com Cc: netdev@vger.kernel.org, jasowang@redhat.com, parav@mellanox.com Subject: [PATCH net] vdpa/mlx5: Fix miss to set VIRTIO_NET_S_LINK_UP for virtio_net_config Date: Mon, 19 Oct 2020 22:17:07 +0800 Message-Id: <1603117027-24054-1-git-send-email-wenxu@ucloud.cn> X-Mailer: git-send-email 1.8.3.1 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSUI3V1ktWUFJV1kPCR oVCBIfWUFZSUNMQ00dShoeS0hDVkpNS0hKSkxLSUxNSENVGRETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKTFVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Phw6Ohw5MT4MN0s6HhQeMxAT HzwwChNVSlVKTUtISkpMS0lMTExIVTMWGhIXVQweFQMOOw4YFxQOH1UYFUVZV1kSC1lBWUpJSFVO QlVKSElVSklCWVdZCAFZQUpMS0s3Bg++ X-HM-Tid: 0a75413891022087kuqy89cd05c0f4e Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: wenxu Qemu get virtio_net_config from the vdpa driver. So The vdpa driver should set the VIRTIO_NET_S_LINK_UP flag to virtio_net_config like vdpa_sim. Or the link of virtio net NIC in the virtual machine will never up. Fixes:1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: wenxu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 74264e59..af6c74c 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1537,6 +1537,8 @@ static int mlx5_vdpa_set_features(struct vdpa_device *vdev, u64 features) ndev->mvdev.actual_features = features & ndev->mvdev.mlx_features; ndev->config.mtu = __cpu_to_virtio16(mlx5_vdpa_is_little_endian(mvdev), ndev->mtu); + ndev->config.status = __cpu_to_virtio16(mlx5_vdpa_is_little_endian(mvdev), + VIRTIO_NET_S_LINK_UP); return err; }