From patchwork Fri Jan 27 20:44:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13119405 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 AE15AC54EAA for ; Fri, 27 Jan 2023 20:46:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229620AbjA0UqR convert rfc822-to-8bit (ORCPT ); Fri, 27 Jan 2023 15:46:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjA0UqP (ORCPT ); Fri, 27 Jan 2023 15:46:15 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BF4E212A2; Fri, 27 Jan 2023 12:45:17 -0800 (PST) Received: from lenovo-t14s.redhat.com ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mg6qO-1ojgP34AIw-00heND; Fri, 27 Jan 2023 21:45:04 +0100 From: Laurent Vivier To: linux-kernel@vger.kernel.org Cc: "David S. Miller" , virtualization@lists.linux-foundation.org, Cindy Lu , "Michael S. Tsirkin" , Eli Cohen , Gautam Dawar , =?utf-8?q?Eugenio_P=C3=A9rez?= , Jason Wang , netdev@vger.kernel.org, Parav Pandit Subject: [PATCH v3 0/2] virtio_net: vdpa: update MAC address when it is generated by virtio-net Date: Fri, 27 Jan 2023 21:44:58 +0100 Message-Id: <20230127204500.51930-1-lvivier@redhat.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:TfZQpimzNNMv8hqbL9D41vCDh9lvaXnjCJ//uRr4zVq2ql49+Uq mIZBp/ghKq5cLNQR/0TfdSTWsccWk0W0aQXSsk2fkNQzFtjg0JSXagemyDEAD8zKalRSIkW Tb/biSu28xjL8Q5lkFtL/bCcDf6//ri/JJC6R5s3Fui3kZK2J0rx+W6laqlley4C43BVzWc 8Nl5AHMscT9CjCXjC2Xjg== UI-OutboundReport: notjunk:1;M01:P0:/3v2sPHDpDU=;/QlqnRL0Ye4werfVQsF+bmQ9GrU fjBL13kMkzSgByrRrT9SnS5fUsxpBzkdf6BK895o6v9pMFBEthCon9IEzBbp3wiD37W0+uItx AGkOKa3+33lmSZrW63hWT8S0E/TGkWKjUE0AwmHDcNYaLXhkcIXT0QlGnsmk0gWnN0DmSGGaz 345JH3rMxOLW+qFAhthdxAD2ix8IHOLibECYNgrEbJUQovl4551Q+K8vHd8L3NUaExHZRqJn3 nJHQFuQEP6aB1UXEo18HMWO+U5dbmu3WcgPM+V2WgUg1CwhawT6lzJqjTknLcgncItiWCB45W Ceb487kyurYxl7JARHkUxIwAsGoD/PuhztOAowp239SW1ZzBsgrOBy2OVzuXqE2bIO/3dN9IB iLXTq1815MLXag7Jm4YW+CWs/zANVsDmqZlP1Mz5a3d12YMN14dJcYCP6SKAn2/U3AI4T/pye TQB4Nyl9Rkn5c52fXvJZYDrPMgd/oSID65ak5iE+yPbxPvEn1NgZBVXgRvTKrZafrBlLCL5Au QgMNr1PjpwJUMkGt3a0MJFVKonqQQG2qFKL3HiYd0cD+2muBnfw8jqEKfLnKtrBeYDdXNlNmT kjXJuOgS/u8KTzMik7WLQjfsAI+zWXPrcBXlrkHoPDbzbezKChcUGZmHj6A+2EYYvodj70AVx o3lnPpPF00MJYJglvSM8778U+OEzPUg8S2UHfhXaaQ== Precedence: bulk List-ID: X-Mailing-List: netdev@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. v3: - update comments - fail probe if VIRTIO_NET_CTRL_MAC_ADDR_SET fails - move the virtnet_send_command() upper, inside the RTNL lock, this simplifies the cleanup in case of error, and a future patch from Jason adds an ASSERT_RTNL() in virtnet_send_command() ("virtio-net: convert rx mode setting to use workqueue") - add a patch to disable F_STANDBY if F_MAC is not set v2: - remove vdpa_sim related fixes - check virtio_has_feature(vdev, VIRTIO_NET_F_MAC) rather than addr_assign_type Laurent Vivier (2): virtio_net: disable VIRTIO_NET_F_STANDBY if VIRTIO_NET_F_MAC is not set virtio_net: notify MAC address change on device initialization drivers/net/virtio_net.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)