From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 453FFA054F; Mon, 15 Mar 2021 17:11:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0C234068C; Mon, 15 Mar 2021 17:11:20 +0100 (CET) Received: from office2.cesnet.cz (office2.cesnet.cz [195.113.144.244]) by mails.dpdk.org (Postfix) with ESMTP id 1A79C4068B for ; Mon, 15 Mar 2021 17:11:20 +0100 (CET) Received: from tanguero.localdomain (unknown [95.82.133.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id B25CD400052; Mon, 15 Mar 2021 17:11:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2-2020; t=1615824679; bh=HRXHPuwZuHDxjNWl4iCeEg90TjABa82GTyzyh1RssoU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=e4X1m9/KWGoBlNJybk76K/lupRopEAxeyWiqKVNXUjad7+UhwfXtTrmZyKjET8l2m +u2Wl3M4QtmuJWGh/ycT1sEuGIzQUFfl1YF2rUbVsBZRlykNGgexf8WMsvGAsL8Eqx YmJR2wIFPeZIQBVbG0klZT4aY1zRY0u56L96e2xgLBshO76OSxnYm4PBv6V4SyEfXT 1WI9BOIyfK4iSnll5lGATN0y2kZyXZOp7N74aDz9JjO0sMDpWYNIYh6ETdckOTIlii KCNXRHf3iR6IxVgA7iYGV74Xpuc2wLFShFtGOKkN0mxw+zFxE/dhLZz8vBBEnthWYf VQHeLdS4/XjkQ== Date: Mon, 15 Mar 2021 17:11:18 +0100 From: Jan Viktorin To: Slava Ovsiienko Cc: "dev@dpdk.org" , Asaf Penso , Shahaf Shuler , Matan Azrad Message-ID: <20210315171039.16b3965e@tanguero.localdomain> In-Reply-To: References: <1615822438-10082-1-git-send-email-iviktorin@fit.vutbr.cz> <1615822438-10082-2-git-send-email-iviktorin@fit.vutbr.cz> Organization: CESNET MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/2] net/mlx5: avoid unbind step to enable switchdev mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello Salva, On Mon, 15 Mar 2021 15:53:51 +0000 Slava Ovsiienko wrote: > Hi, Jan > > Yes, bullet [4] explicitly requires to unbind VFs, and detach the netdevs from the mlx5_core driver. > Otherwise, kernel driver refuses to be configured with switchdev mode in [5]. So, [4] can't be skipped. > After setting swithdev mode, VFs can be bound back (if it is needed, and these ones are not mapped to VMs): OK, but I believe that it is **not possible** to follow the rule [5]. The guide explicitly says in [4] "can be rebind **after** the switchdev mode". Just, if you unbind the device, there is no way how to configure the switchdev mode, this is the contradiction I mentioned in the commit. You cannot configure switchdev mode because the interface is gone and the path /sys/class/net//compat/devlink/mode no longer exists. So, maybe, just the formulation is wrong. So, what is the **exact right** way how to do it? I would change the commit accordingly. Just, let's make it right. Would it work this way? # echo -n "" > /sys/bus/pci/drivers/mlx5_core/unbind # echo -n "" > /sys/bus/pci/drivers/mlx5_core/bind # echo switchdev > /sys/class/net//compat/devlink/mode It is good to mention that after the rebind, the can change. Regards, Jan > > echo -n "" > > /sys/bus/pci/drivers/mlx5_core/bind > > With best regards, > Slava > > > -----Original Message----- > > From: Jan Viktorin > > Sent: Monday, March 15, 2021 17:34 > > To: dev@dpdk.org > > Cc: Jan Viktorin ; Asaf Penso ; > > Shahaf Shuler ; Slava Ovsiienko > > ; Matan Azrad > > Subject: [PATCH 2/2] net/mlx5: avoid unbind step to enable switchdev mode > > > > From: Jan Viktorin > > > > The step 4 is a contradiction. It advices to unbind the device from the > > mlx5_core which removes the associated system network interface (e.g. > > eth0). In the step 5, the same system network interface (e.g. eth0) is > > required to exist. > > > > Signed-off-by: Jan Viktorin > > --- > > doc/guides/nics/mlx5.rst | 6 +----- > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index > > 0a2dc3dee..122d8e0fc 100644 > > --- a/doc/guides/nics/mlx5.rst > > +++ b/doc/guides/nics/mlx5.rst > > @@ -1370,11 +1370,7 @@ the DPDK application. > > > > echo /sys/class/net//device/sriov_numvfs > > > > -4. Unbind the device (can be rebind after the switchdev mode):: > > - > > - echo -n "" > > > /sys/bus/pci/drivers/mlx5_core/unbind > > - > > -5. Enable switchdev mode:: > > +4. Enable switchdev mode:: > > > > echo switchdev > /sys/class/net//compat/devlink/mode > > > > -- > > 2.30.1 >