From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E74883EB809 for ; Wed, 8 Jul 2026 08:34:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783499703; cv=none; b=b2ZKoHH3LZUVQcj+OFHePVfwIVsog/1VMUhNgPr1/BVewZKFuUBLbbkAmczDFHrgIMTFyBTkQKvgt3OKNYo7TW7HEkSgifjd/hfj+Pb7eayHSNBpSyJmcj8jOiEhKd4SzDIiMudxgBK+YL5zDdnQ6IXAHEPI/bJLmAZDtrOyQ1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783499703; c=relaxed/simple; bh=i8NUcW/oTATrxmS6+QrhnDTWblS1EuQ+OATB9E3pmdE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ChE/dscT69yn6bPAgKByOBQJlyJGDQLDTMRMbpxdpeo7PQ12UoulxBkqRQ7CmKKsffw6pqD1INjjRbJczH6Yw96O+c1oF0xRs2PjS/Zfx3ChMlRr/dg/RQHF+0Y8r1pD37tX8VFucjvZlT50+LLrwOV8puiUBt5+2/lSvi0Q9oY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20251104.gappssmtp.com header.i=@resnulli-us.20251104.gappssmtp.com header.b=SS000QVm; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20251104.gappssmtp.com header.i=@resnulli-us.20251104.gappssmtp.com header.b="SS000QVm" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-493b6f1b14bso1500295e9.0 for ; Wed, 08 Jul 2026 01:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20251104.gappssmtp.com; s=20251104; t=1783499698; x=1784104498; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=d65vlscf3MRlCdV5SPB30z4zAVCml2R2BL0nflKn+XI=; b=SS000QVmxWWkm0E2IwPRChuI4Jrwye4c14r18/hTPNnyc8J9csQxLTMNKw4GORlHxV Rgw8bXpbGXcZsKbpTVYabF/b0Ag5w6gSVTgY60HsyuJsjHDcn7ENn8MfsMdE84jW4A2v 2f655a9u+N6xXeU5nY2NpenbxRQ7yiWfG9ld6LfGgDq+L6zF0/m+pFPUNnYwUDPL1CvC weUBeSTfZI1GOyxqrEQNoDNM9NS2C7d/ERUYQObPceIk9EHjFJTQFhqe3FWt54/OjULu 0JLP8vAYCzfJADPAxhH8p1Gr+aaxtbhwchNnGSwQbS27OMhYU4llfa2er3B9FbSMlQwG 9USw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783499698; x=1784104498; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d65vlscf3MRlCdV5SPB30z4zAVCml2R2BL0nflKn+XI=; b=R3Sxm96Obvj7wzwxDLJVTotLwPKNfODHULoV8MQvD8LKORKAiT2+dTiKs/5X5s6Oww 1aMA4K8fMBedg9iOyCqD061oCDcU02N6jx1t0NAwH7Df5M797qabWr8n6sAT49YpSFj0 pTXNTD0RGLB3Jlzw5j4IS9tm4SzsrENDIKObH20thKbWHdaivl3k9jEehwffIrL1sguV ynHMYD20RcOgzongN/awp6bgf3cNIOD45dhUl8gec818bEs6spTmKKMQSXsB7b+DzHcA Udd60RSB2GU998f0NFjWpSrnxBjY13vrK8BsJAFTAKLmkYukCFLDbw5FWrIN6+vW87PU +gpw== X-Forwarded-Encrypted: i=1; AHgh+Rr9xayQIcb77a9otP2fUo8MINPHfEAdHGmLziFOCLAOzGM1wcRthwnXExOmynTp6/t96iZi3z9XXc4=@vger.kernel.org X-Gm-Message-State: AOJu0YzH1tQWo7EjYg+vXCPGK+1zbqLtgh3oTEj3pxcV08Vh+1A8SD2P l+zZLqkpp3W8z/Mh8iqCxNdtnypkeIaW2A34nTMZvY+RZzOWID1qR/tmWJZD/YjhGWw= X-Gm-Gg: AfdE7cljkD+dDf75amLM6ttRTn/NSfVnuJyKJqAuDYmbWDJ6FPiLNd8gxhZzuXEDlWD H74mK1TbUTIIzaTBxQwvmxk4Zsr+Tkhu9aJUUcM1hfiPUDw95CuHF4srZTM515U+Em+DIoAjXdn sUHwe38BSnpCEWi8X2P+1PhlO2kvZ3XQqjKVaoXZTugVilPxhGd5gqSlxQdDzWEwU6VeTRUTpYG EoAtcCEuRPsmP9lU5e+xcP49CsRiGMQwNb+gfVUkSkZYRESdLvUfDOKjLd3z/Rtd0z1I+b57ras lrXSo59zO7CJ0n2U+PXduqngi1/iwbUedlzG04zEtFVb+55tRU8LD02EOkbqTdGUo2RxXxoYDPq ojolPwRbHgQGYt1aGCH1m0mtJf4l3yVItwjlI2F5VsITPmnJRroee0KjFb5zcWlzmtlpJuQqaND cArAeRNP5zK9ohTgtARPZ0 X-Received: by 2002:a05:600c:82c3:b0:492:45a0:dcef with SMTP id 5b1f17b1804b1-493e683c514mr13471085e9.5.1783499698217; Wed, 08 Jul 2026 01:34:58 -0700 (PDT) Received: from localhost ([208.127.45.21]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0a558easm40791770f8f.27.2026.07.08.01.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 01:34:57 -0700 (PDT) Date: Wed, 8 Jul 2026 10:34:54 +0200 From: Jiri Pirko To: Mark Bloch Cc: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Andrew Lunn , Jonathan Corbet , Shuah Khan , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH net-next V5 6/6] net/mlx5: Apply devlink eswitch mode boot default on probe Message-ID: References: <20260707174527.425134-1-mbloch@nvidia.com> <20260707174527.425134-7-mbloch@nvidia.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260707174527.425134-7-mbloch@nvidia.com> Tue, Jul 07, 2026 at 07:45:27PM +0200, mbloch@nvidia.com wrote: >Apply devlink_eswitch_mode= boot defaults for mlx5 after the initial >probe finishes device initialization while holding the devlink instance >lock. > >At this point the devlink instance is registered and mlx5 can perform an >eswitch mode change. Calling devl_apply_default_esw_mode() also clears >any pending default apply work queued by devl_register(), so the queued >work will not apply the same default again. > >Keep this call in mlx5_init_one() rather than the lower-level >devl-locked init helper. That helper is also used by devlink reload, and >devlink core already applies the boot default after a successful >DRIVER_REINIT reload. > >Signed-off-by: Mark Bloch >--- > drivers/net/ethernet/mellanox/mlx5/core/main.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c >index 643b4aac2033..0712efea74cc 100644 >--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c >+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c >@@ -1392,6 +1392,17 @@ static void mlx5_unload(struct mlx5_core_dev *dev) > mlx5_free_bfreg(dev, &dev->priv.bfreg); > } > >+static void mlx5_devl_apply_default_esw_mode(struct mlx5_core_dev *dev) >+{ >+ struct devlink *devlink = priv_to_devlink(dev); >+ >+ if (!MLX5_ESWITCH_MANAGER(dev)) >+ return; >+ >+ devl_assert_locked(devlink); >+ devl_apply_default_esw_mode(devlink); >+} >+ > int mlx5_init_one_devl_locked(struct mlx5_core_dev *dev) > { > bool light_probe = mlx5_dev_is_lightweight(dev); >@@ -1471,6 +1482,8 @@ int mlx5_init_one(struct mlx5_core_dev *dev) > err = mlx5_init_one_devl_locked(dev); > if (err) > devl_unregister(devlink); >+ else >+ mlx5_devl_apply_default_esw_mode(dev); I don't understand why this patch is needed at all. Just leave the job to the devlink core, no? That was the point to not pollute drivers with code like this. Is it some kind of leftover? > unlock: > devl_unlock(devlink); > return err; >-- >2.43.0 >