From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAE56C54E94 for ; Mon, 23 Jan 2023 12:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231515AbjAWMBb convert rfc822-to-8bit (ORCPT ); Mon, 23 Jan 2023 07:01:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230366AbjAWMBZ (ORCPT ); Mon, 23 Jan 2023 07:01:25 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DFEF166C2; Mon, 23 Jan 2023 04:00:40 -0800 (PST) Received: from lenovo-t14s.redhat.com ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MKsaz-1ozEsm05Ph-00LEs8; Mon, 23 Jan 2023 13:00:25 +0100 From: Laurent Vivier To: linux-kernel@vger.kernel.org Cc: Gautam Dawar , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, Eli Cohen , Cindy Lu , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Parav Pandit Subject: [PATCH v2 0/1] virtio_net: vdpa: update MAC address when it is generated by virtio-net Date: Mon, 23 Jan 2023 13:00:21 +0100 Message-Id: <20230123120022.2364889-1-lvivier@redhat.com> X-Mailer: git-send-email 2.39.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:kdTrXlXOuCPL7jiaWQI9WXzof8NAdeOnvouqUAL01MTUIA8Kr22 a+qTMVEaaSrBI0VFplVwJylyy5FsY/N2Fh6X3LAN6xN8vLhVxTMCNxF4RVMom0Z48j1F9XX PYk/4LPcCGTy87kGYnE+G1x306j2vLfBNCd/KoZHXDq8Q7Y3Pw2JVLb7vQWAK0yl4U21OvF Adg/ranDnGinlVzhTbjxA== UI-OutboundReport: notjunk:1;M01:P0:2nLqAPfkmz4=;ME1dtv68aATFXykiq24doQVfAG3 px94zx7FpfJojGIffpqGI0gEddgCxUoyUu8xMFtMPFPpT4e5J9ZPG14SQ/H2N+WLxDDvBqjSp ZHpp2KQE5av3925WWsb7Gvne9hhW/wciGi9ASYBT0uQNRLY1tK46uTrcE4OYAML9dqFRnVt2U cNtleIPJgELbjwenHR8tIkjMjInKxTXX+2YJoa6Ly7lcIHjQ5LrNF5s1SXDZ0nWiQCfncDRFM LXIDUd1zMiZbFMGWihNztjI18Ky4YbUgVuv4Pp5+Dgn2Tp9I2BuROtn2WJ33H851L85zyaCPD eEXuqVaLe2ZX9dV2Pn56NcKClLNNQLVtxexhk+ybjqGZt5FI+shevGlBPBaj9nMHL6Edqmimk MjjgB9fW7ZzPOYFmQd3tco0gHFHeAI/f0yMdUYgyUyhv5UUNPcFFwpn/JyNiEPVWfitGUxM7F w6t7ydLW0gKDH/nFl869B8VqfdsrZeCAroz9CpsuoOkW8RYtHjgyISUVgysuONhbDnbK1s6sv Sj9HLDmc05t9+wf5slzHVgDl7fg2V1kaMaOMdf7fyfZ7mJtVrU2mTpgZfYfrmTmGAiWGyPaM6 1GwOJardTxWUgLh0jS1OLVk2iTcIWuSKY5YTb2iM3XPk7LPd6VWBdWcb9fT4ErYttFRXsm9z8 t64BYa8PFMOCvrkqE4GwoyLYgJkgoXZ17IPLFiTpzA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the MAC address is not provided by the vdpa device virtio_net driver assigns a random one without notifying the device. The consequence, in the case of mlx5_vdpa, is the internal routing tables of the device are not updated and this can block the communication between two namespaces. To fix this problem, use virtnet_send_command(VIRTIO_NET_CTRL_MAC) to set the address from virtnet_probe() when the MAC address is not provided by the device. v2: - remove vdpa_sim related fixes - check virtio_has_feature(vdev, VIRTIO_NET_F_MAC) rather than addr_assign_type Laurent Vivier (1): virtio_net: notify MAC address change on device initialization drivers/net/virtio_net.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.39.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EA1DC54E94 for ; Mon, 23 Jan 2023 12:00:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5ED6281F1E; Mon, 23 Jan 2023 12:00:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5ED6281F1E X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0PU7ZoQQsB_X; Mon, 23 Jan 2023 12:00:48 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id EACB381F43; Mon, 23 Jan 2023 12:00:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org EACB381F43 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3B3D9C007D; Mon, 23 Jan 2023 12:00:47 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id B4995C0033 for ; Mon, 23 Jan 2023 12:00:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 81A7E60D68 for ; Mon, 23 Jan 2023 12:00:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 81A7E60D68 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fGQ1lda52CSC for ; Mon, 23 Jan 2023 12:00:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 064F660C33 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by smtp3.osuosl.org (Postfix) with ESMTPS id 064F660C33 for ; Mon, 23 Jan 2023 12:00:43 +0000 (UTC) Received: from lenovo-t14s.redhat.com ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MKsaz-1ozEsm05Ph-00LEs8; Mon, 23 Jan 2023 13:00:25 +0100 From: Laurent Vivier To: linux-kernel@vger.kernel.org Subject: [PATCH v2 0/1] virtio_net: vdpa: update MAC address when it is generated by virtio-net Date: Mon, 23 Jan 2023 13:00:21 +0100 Message-Id: <20230123120022.2364889-1-lvivier@redhat.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:kdTrXlXOuCPL7jiaWQI9WXzof8NAdeOnvouqUAL01MTUIA8Kr22 a+qTMVEaaSrBI0VFplVwJylyy5FsY/N2Fh6X3LAN6xN8vLhVxTMCNxF4RVMom0Z48j1F9XX PYk/4LPcCGTy87kGYnE+G1x306j2vLfBNCd/KoZHXDq8Q7Y3Pw2JVLb7vQWAK0yl4U21OvF Adg/ranDnGinlVzhTbjxA== UI-OutboundReport: notjunk:1;M01:P0:2nLqAPfkmz4=;ME1dtv68aATFXykiq24doQVfAG3 px94zx7FpfJojGIffpqGI0gEddgCxUoyUu8xMFtMPFPpT4e5J9ZPG14SQ/H2N+WLxDDvBqjSp ZHpp2KQE5av3925WWsb7Gvne9hhW/wciGi9ASYBT0uQNRLY1tK46uTrcE4OYAML9dqFRnVt2U cNtleIPJgELbjwenHR8tIkjMjInKxTXX+2YJoa6Ly7lcIHjQ5LrNF5s1SXDZ0nWiQCfncDRFM LXIDUd1zMiZbFMGWihNztjI18Ky4YbUgVuv4Pp5+Dgn2Tp9I2BuROtn2WJ33H851L85zyaCPD eEXuqVaLe2ZX9dV2Pn56NcKClLNNQLVtxexhk+ybjqGZt5FI+shevGlBPBaj9nMHL6Edqmimk MjjgB9fW7ZzPOYFmQd3tco0gHFHeAI/f0yMdUYgyUyhv5UUNPcFFwpn/JyNiEPVWfitGUxM7F w6t7ydLW0gKDH/nFl869B8VqfdsrZeCAroz9CpsuoOkW8RYtHjgyISUVgysuONhbDnbK1s6sv Sj9HLDmc05t9+wf5slzHVgDl7fg2V1kaMaOMdf7fyfZ7mJtVrU2mTpgZfYfrmTmGAiWGyPaM6 1GwOJardTxWUgLh0jS1OLVk2iTcIWuSKY5YTb2iM3XPk7LPd6VWBdWcb9fT4ErYttFRXsm9z8 t64BYa8PFMOCvrkqE4GwoyLYgJkgoXZ17IPLFiTpzA== Cc: Cindy Lu , "Michael S. Tsirkin" , netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, =?UTF-8?q?Eugenio=20P=C3=A9rez?= , "David S. Miller" , Gautam Dawar , Eli Cohen X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" When the MAC address is not provided by the vdpa device virtio_net driver assigns a random one without notifying the device. The consequence, in the case of mlx5_vdpa, is the internal routing tables of the device are not updated and this can block the communication between two namespaces. To fix this problem, use virtnet_send_command(VIRTIO_NET_CTRL_MAC) to set the address from virtnet_probe() when the MAC address is not provided by the device. v2: - remove vdpa_sim related fixes - check virtio_has_feature(vdev, VIRTIO_NET_F_MAC) rather than addr_assign_type Laurent Vivier (1): virtio_net: notify MAC address change on device initialization drivers/net/virtio_net.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.39.0 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization