Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2841231rwl; Sun, 9 Apr 2023 02:29:21 -0700 (PDT) X-Google-Smtp-Source: AKy350YVkMhJYHmOotM96QD3cNeZN5GqdVRLGpMLPRQ4p8MXiFPXT8+lX5g9y5ehGF9xj7VjZ1yj X-Received: by 2002:a17:903:11c3:b0:1a1:a830:cef8 with SMTP id q3-20020a17090311c300b001a1a830cef8mr10152252plh.27.1681032560744; Sun, 09 Apr 2023 02:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681032560; cv=none; d=google.com; s=arc-20160816; b=hE0k2WhOJT8Ij6PFz1Tdivm6tWyyrZDxDyM/qZTRxFm367WtXXFZDA5VNQBY8uUw+o H/m+5P/F8qiaSiK3f6C2XsAp+LAB0RGUqWnfqZ5lsofC8+XKvoeMREuYz3r51Z6fEFxs ykBr8Kv3LOoxZtuehRSMUwTjtP7oJpr1P/GbUpe2HWeZd3QX5ojCDYu89fJJ7O2IVGOg yI6NxfGz863Ca+NSoJbQi6bl4P685/gSFIZRkXbJgpq+RtS3jTdHY2PYCTLeLBwpiM2N ZwrZSR7tDVs6mT7jgPcFhs4oAgJ+yqoY45JeB+DvxvDF13V+FzFn1FeNtp96AVrzTvEp dmDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h5QrTThWFWOsujw9Aoyj0mUWx71lnrjFvvzGgyyOtqE=; b=yTbrgBFsWojcJVdsaChEqhxu+kOhi3gXQvzhovdPMflPP0WWQ3S67U/AIBcHXjNzmq /O0J2kxNtOnGSFwwqoHC0jbP8DhkypQ8IJT5k7ilM84hh3zqpIAL6i0NQqE44RgnBLa7 8YHCOW5Nnkra9wccHXnzUJzQHtmyCmEyv2afFJIEH6YhIeE/lHt09RTftcWwTNSB3HJa xBNeXwl+NULBWyPxS8ZxI7WNWbYP2pJA42MhKOYpAaHMzQTcgW2WSxb7PFEaVNrdADxr VHEQmOjdwv7bMI9tuol3RkcDL1zLPYDyDf+vmyKfbwAnGKQFa8PAdzRmifiQHfXKuvgP qq+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e890w4A1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kw8-20020a170902f90800b001a51bb4ad81si4681568plb.44.2023.04.09.02.29.06; Sun, 09 Apr 2023 02:29:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e890w4A1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229462AbjDIJCb (ORCPT + 99 others); Sun, 9 Apr 2023 05:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjDIJCa (ORCPT ); Sun, 9 Apr 2023 05:02:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B74724C1B; Sun, 9 Apr 2023 02:02:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4F45860B8C; Sun, 9 Apr 2023 09:02:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDA67C433D2; Sun, 9 Apr 2023 09:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681030948; bh=LVtFFA0AXEhOsnryskGF2zy05qjqLGb8A6vGLQS1SBs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e890w4A1/yisEf/4re8ZeWrx2Q5nu0WrTNqPYUHGl4NqfUHIBcXlqRqe+zmx0LcTd 9TcKQj/8Jar7dsYdPKn/SMvC/nTOJ2IM/rDgKd7QqNa1ei0PvQaktdxsDGSIEx/WPJ VjbaGJMxzh2nGl3gThPP/WOaWtWhvIfFxITlMvwCI7647jyPnJHiYipso/jcim+top FJBTcmpiA4pAaRW2cJjxJ2R9ZIwcPqwb/Ha0QLV5Tw9jeyZOCQb2n4oZYAjB8mxDa3 ohFV/FAgyLDUKe1DdBJOEqiTrLWKcrJy0QcDK5opzog27IZP4qMpZ4L0iAVxRFwHQi M3zQi/nLchIag== Date: Sun, 9 Apr 2023 12:02:24 +0300 From: Leon Romanovsky To: Ivan Vecera Cc: netdev@vger.kernel.org, mschmidt@redhat.com, Michael Chan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , open list Subject: Re: [PATCH net-next] bnxt_en: Allow to set switchdev mode without existing VFs Message-ID: <20230409090224.GE14869@unreal> References: <20230406130455.1155362-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230406130455.1155362-1-ivecera@redhat.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 06, 2023 at 03:04:55PM +0200, Ivan Vecera wrote: > Remove an inability of bnxt_en driver to set eswitch to switchdev > mode without existing VFs by: > > 1. Allow to set switchdev mode in bnxt_dl_eswitch_mode_set() so > representors are created only when num_vfs > 0 otherwise just > set bp->eswitch_mode > 2. Do not automatically change bp->eswitch_mode during > bnxt_vf_reps_create() and bnxt_vf_reps_destroy() calls so > the eswitch mode is managed only by an user by devlink. > Just set temporarily bp->eswitch_mode to legacy to avoid > re-opening of representors during destroy. > 3. Create representors in bnxt_sriov_enable() if current eswitch > mode is switchdev one > > Tested by this sequence: > 1. Set PF interface up > 2. Set PF's eswitch mode to switchdev > 3. Created N VFs > 4. Checked that N representors were created > 5. Set eswitch mode to legacy > 6. Checked that representors were deleted > 7. Set eswitch mode back to switchdev > 8. Checked that representros were re-created Why do you think that this last item is the right behavior? IMHO all configurations which were done after you switched mode should be cleared and not recreated while toggling. Thanks > 9. Deleted all VFs > 10. Checked that all representors were deleted as well > 11. Checked that current eswitch mode is still switchdev > > Signed-off-by: Ivan Vecera > ---