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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 5FB1FC1746D for ; Tue, 16 Apr 2024 06:16:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DA73440600; Tue, 16 Apr 2024 06:16:50 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id td7y_64Uuoon; Tue, 16 Apr 2024 06:16:50 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C06D740722 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1713248209; bh=GxPd7kelp3QwhTvqYH0Bcb5R5VMJcEOmNdT9Y7QgQmE=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=D/iAYUMIFDkBovdf4T2fiHQQQanupWpzOMja0vqE1HvvAm6LD8IMKDuxPgnoxx22E 9rMY2ljrxvIHKqNbgdYXGlzT9ZvDp/gGKzZHJU2xdFZwO9WFGJIjKP9+tTtsFACPbo 0hbztmmBKwuEAyLQRDO9jXU592JStIXKZ1vJ32RuMxQc0unnB7z/k07fV1mdIRoBH+ MchT6RK5jAOfB9/IHOWQgMyvcq5oyxfJ0B+4+bTQDpok2WaaiML7FadkHE38y3UKeo 2JvIZnTWUwzOnx5ur/jZR+nEgGzY7nHVt5EoKRGMebEAbgxcYeNvbQkVExUFPbb6Wq 0Tpupr0av98Pg== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id C06D740722; Tue, 16 Apr 2024 06:16:49 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AFCDF1BF329 for ; Tue, 16 Apr 2024 06:16:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A2D6A81407 for ; Tue, 16 Apr 2024 06:16:47 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Rkln4AGXUBVB for ; Tue, 16 Apr 2024 06:16:47 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=198.175.65.19; helo=mgamail.intel.com; envelope-from=michal.swiatkowski@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org C448A813CA DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org C448A813CA Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by smtp1.osuosl.org (Postfix) with ESMTPS id C448A813CA for ; Tue, 16 Apr 2024 06:16:46 +0000 (UTC) X-CSE-ConnectionGUID: FC3kkq+ATamZq8h3NOHw0Q== X-CSE-MsgGUID: JGI2N2awRAOAUrnvHXrfgQ== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="8546746" X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="8546746" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 23:16:45 -0700 X-CSE-ConnectionGUID: TflDeatzQ8WEuacwtQYjPA== X-CSE-MsgGUID: 1uQyPdlARhu2JLYl3yPx8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="26810051" Received: from unknown (HELO mev-dev) ([10.237.112.144]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 23:16:42 -0700 Date: Tue, 16 Apr 2024 08:16:17 +0200 From: Michal Swiatkowski To: Jiri Pirko Message-ID: References: <20240412063053.339795-1-michal.swiatkowski@linux.intel.com> <20240412063053.339795-4-michal.swiatkowski@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713248207; x=1744784207; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=LS6kxqMr2jweAkl/e91IqtJx4zTS2TvjSxqvBc6KXKM=; b=Su7+Myn44hcy9w6/HYpRerlpVFPTWxETmTpbO1IGlHgWcULCqoK44n7L D53+CHjBefGzzC1SawxxTM81DDyHcgw9750OcJwZNeTqYvPRz/ZaGZFg8 37mxUAYJxx67WxTrzl6pjW1L09ojeWZtj00ZSktX2rXS9KbLtwI/CWK7q vVrEPaYDOZnL+F/3TojN+Mezd5+V7a/WC6y3oOdHu+IV++/KT1IP3MbU5 iT8XzsGFj6gNywCiuAoVX8XmSumd75uKMmXseNOBShVVbVQp6IiRg1AcG eIUkUnUOChgnWz5HLiu8ZkbBCIQOpw+AYPhGV754stjVANFURbTzNs0Xp A==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Su7+Myn4 Subject: Re: [Intel-wired-lan] [iwl-next v3 3/7] ice: add basic devlink subfunctions support X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: maciej.fijalkowski@intel.com, sridhar.samudrala@intel.com, netdev@vger.kernel.org, mateusz.polchlopek@intel.com, wojciech.drewek@intel.com, michal.kubiak@intel.com, intel-wired-lan@lists.osuosl.org, pio.raczynski@gmail.com, jiri@nvidia.com, jacob.e.keller@intel.com, nex.sw.ncis.osdt.itp.upstreaming@intel.com, Piotr Raczynski , przemyslaw.kitszel@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, Apr 16, 2024 at 07:14:43AM +0200, Michal Swiatkowski wrote: > On Mon, Apr 15, 2024 at 11:10:50AM +0200, Jiri Pirko wrote: > > Mon, Apr 15, 2024 at 10:39:39AM CEST, michal.swiatkowski@linux.intel.com wrote: > > >On Fri, Apr 12, 2024 at 09:12:18AM +0200, Jiri Pirko wrote: > > >> Fri, Apr 12, 2024 at 08:30:49AM CEST, michal.swiatkowski@linux.intel.com wrote: > > >> >From: Piotr Raczynski > > > > [...] > > > > >> >+static int > > >> >+ice_devlink_port_fn_state_get(struct devlink_port *port, > > >> >+ enum devlink_port_fn_state *state, > > >> >+ enum devlink_port_fn_opstate *opstate, > > >> >+ struct netlink_ext_ack *extack) > > >> >+{ > > >> >+ struct ice_dynamic_port *dyn_port; > > >> >+ > > >> >+ dyn_port = ice_devlink_port_to_dyn(port); > > >> >+ > > >> >+ if (dyn_port->active) { > > >> >+ *state = DEVLINK_PORT_FN_STATE_ACTIVE; > > >> >+ *opstate = DEVLINK_PORT_FN_OPSTATE_ATTACHED; > > >> > > >> Interesting. This means that you don't distinguish between admin state > > >> and operational state. Meaning, when user does activate, you atomically > > >> achive the hw attachment and it is ready to go before activation cmd > > >> returns, correct? I'm just making sure I understand the code. > > >> > > > > > >I am setting the dyn_port->active after the activation heppens, so it is > > >true, when active is set it is ready to go. > > > > > >Do you mean that dyn_port->active should be set even before the activation is > > >finished? I mean when user only call devlink to active the port? > > > > The devlink instance lock is taken the whole time, isn't it? > > > > I don't take PF devlink lock here. Only subfunction devlink lock is > taken during the initialization of subfunction. > Did you mean that the devlink lock is taken for DEVLINK_CMD_PORT_SET/GET command? In this case, I think so, it is for the whole time of the command execution. Sorry I probably missed the point. > > > > > >> > > >> >+ } else { > > >> >+ *state = DEVLINK_PORT_FN_STATE_INACTIVE; > > >> >+ *opstate = DEVLINK_PORT_FN_OPSTATE_DETACHED; > > >> >+ } > > >> >+ > > >> >+ return 0; > > >> >+} > > >> >+ > > > > [...] From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DC023C08A for ; Tue, 16 Apr 2024 06:16:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713248207; cv=none; b=VW+bYC6SRjCnYk9WgaE26mDwFMTSugwn4TUr/whd9zzNhk13TZ/ndkrcT3+62V6P+nN8AJ9PUDauqg7z+61H+krh2n+hw5CPF9sJwvMBsgiaEPkdTfqQ1A4HUJArFFZo67sPhg9MsErYcPqiDzyr8P1uKNwVj6g+thkbH377cBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713248207; c=relaxed/simple; bh=LS6kxqMr2jweAkl/e91IqtJx4zTS2TvjSxqvBc6KXKM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SC4zvJqcyhPdLjoJBzUtA2C8g1bSbPU/VW5ljKNYNSxx0OwQwV/rJaGiL2eSLKzRxYIocNVOoqbFm5DpFRowySDaEi8CaJouIRsMsDFmTf6hxPAzmrkgHpfL7YYmE+cF+jf42Uk6NAuVlJV9z67xFetS5PPcbu3UDdg4LvOCYP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=QOPcagGg; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="QOPcagGg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713248206; x=1744784206; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=LS6kxqMr2jweAkl/e91IqtJx4zTS2TvjSxqvBc6KXKM=; b=QOPcagGgesHwE9tB5OEBQ3ViS+8aEbnmGFDCdkOW0X+dOXw2+FznWtKK h4M9hhIWDSZkgjLnsT/7yxofVHNB97GcidJhEH7mV2Jr4OSji5TJrXwC2 mg0hYQkFAEcYFjcp63TnAz9v3r8dCkJJRotUH6/KcoSynX64aDV7SiP5V LWv5U3p8ERhWsJMO7x0E7G6sBzwf5w7PUVVdB1Ifz9TCQuCwIteYOfT3A qjHNvGQppf4yRYkr4AAPC8xEGgX4Bq3sqmMoRov4evge+FHexp1BYhe7G m4zT2KI9hsCsFIaHeBtzR+xnVu2l/b8VISKcar0jW7qRSzvvUrUfbRj0v w==; X-CSE-ConnectionGUID: IYR/9OlERm6IUJgTfmQSbw== X-CSE-MsgGUID: pjbqGvBHTEmw3eFLiGUvuQ== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="8546745" X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="8546745" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 23:16:45 -0700 X-CSE-ConnectionGUID: TflDeatzQ8WEuacwtQYjPA== X-CSE-MsgGUID: 1uQyPdlARhu2JLYl3yPx8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="26810051" Received: from unknown (HELO mev-dev) ([10.237.112.144]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 23:16:42 -0700 Date: Tue, 16 Apr 2024 08:16:17 +0200 From: Michal Swiatkowski To: Jiri Pirko Cc: maciej.fijalkowski@intel.com, mateusz.polchlopek@intel.com, nex.sw.ncis.osdt.itp.upstreaming@intel.com, netdev@vger.kernel.org, jiri@nvidia.com, michal.kubiak@intel.com, intel-wired-lan@lists.osuosl.org, pio.raczynski@gmail.com, sridhar.samudrala@intel.com, jacob.e.keller@intel.com, wojciech.drewek@intel.com, Piotr Raczynski , przemyslaw.kitszel@intel.com Subject: Re: [Intel-wired-lan] [iwl-next v3 3/7] ice: add basic devlink subfunctions support Message-ID: References: <20240412063053.339795-1-michal.swiatkowski@linux.intel.com> <20240412063053.339795-4-michal.swiatkowski@linux.intel.com> Precedence: bulk X-Mailing-List: netdev@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: On Tue, Apr 16, 2024 at 07:14:43AM +0200, Michal Swiatkowski wrote: > On Mon, Apr 15, 2024 at 11:10:50AM +0200, Jiri Pirko wrote: > > Mon, Apr 15, 2024 at 10:39:39AM CEST, michal.swiatkowski@linux.intel.com wrote: > > >On Fri, Apr 12, 2024 at 09:12:18AM +0200, Jiri Pirko wrote: > > >> Fri, Apr 12, 2024 at 08:30:49AM CEST, michal.swiatkowski@linux.intel.com wrote: > > >> >From: Piotr Raczynski > > > > [...] > > > > >> >+static int > > >> >+ice_devlink_port_fn_state_get(struct devlink_port *port, > > >> >+ enum devlink_port_fn_state *state, > > >> >+ enum devlink_port_fn_opstate *opstate, > > >> >+ struct netlink_ext_ack *extack) > > >> >+{ > > >> >+ struct ice_dynamic_port *dyn_port; > > >> >+ > > >> >+ dyn_port = ice_devlink_port_to_dyn(port); > > >> >+ > > >> >+ if (dyn_port->active) { > > >> >+ *state = DEVLINK_PORT_FN_STATE_ACTIVE; > > >> >+ *opstate = DEVLINK_PORT_FN_OPSTATE_ATTACHED; > > >> > > >> Interesting. This means that you don't distinguish between admin state > > >> and operational state. Meaning, when user does activate, you atomically > > >> achive the hw attachment and it is ready to go before activation cmd > > >> returns, correct? I'm just making sure I understand the code. > > >> > > > > > >I am setting the dyn_port->active after the activation heppens, so it is > > >true, when active is set it is ready to go. > > > > > >Do you mean that dyn_port->active should be set even before the activation is > > >finished? I mean when user only call devlink to active the port? > > > > The devlink instance lock is taken the whole time, isn't it? > > > > I don't take PF devlink lock here. Only subfunction devlink lock is > taken during the initialization of subfunction. > Did you mean that the devlink lock is taken for DEVLINK_CMD_PORT_SET/GET command? In this case, I think so, it is for the whole time of the command execution. Sorry I probably missed the point. > > > > > >> > > >> >+ } else { > > >> >+ *state = DEVLINK_PORT_FN_STATE_INACTIVE; > > >> >+ *opstate = DEVLINK_PORT_FN_OPSTATE_DETACHED; > > >> >+ } > > >> >+ > > >> >+ return 0; > > >> >+} > > >> >+ > > > > [...]