netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: "Brady, Alan" <alan.brady@intel.com>
Cc: "intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"willemdebruijn.kernel@gmail.com"
	<willemdebruijn.kernel@gmail.com>,
	"Bagnucki, Igor" <igor.bagnucki@intel.com>,
	"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH v2 0/7 iwl-next] idpf: refactor virtchnl messages
Date: Mon, 29 Jan 2024 16:43:12 +0100	[thread overview]
Message-ID: <a022d442-db42-4f27-97b2-4738d862d46c@intel.com> (raw)
In-Reply-To: <CO1PR11MB518654C3B590812C4155C2138F7E2@CO1PR11MB5186.namprd11.prod.outlook.com>

From: Brady, Alan <alan.brady@intel.com>
Date: Mon, 29 Jan 2024 16:12:06 +0100

>> -----Original Message-----
>> From: Lobakin, Aleksander <aleksander.lobakin@intel.com>
>> Sent: Monday, January 29, 2024 5:24 AM
>> To: Brady, Alan <alan.brady@intel.com>
>> Cc: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org;
>> willemdebruijn.kernel@gmail.com; Bagnucki, Igor
>> <igor.bagnucki@intel.com>; Kitszel, Przemyslaw
>> <przemyslaw.kitszel@intel.com>
>> Subject: Re: [Intel-wired-lan] [PATCH v2 0/7 iwl-next] idpf: refactor virtchnl
>> messages
>>
>> From: Alan Brady <alan.brady@intel.com>
>> Date: Thu, 25 Jan 2024 21:47:40 -0800
>>
>>> The motivation for this series has two primary goals. We want to
>>> enable support of multiple simultaneous messages and make the channel
>>> more robust. The way it works right now, the driver can only send and
>>> receive a single message at a time and if something goes really wrong,
>>> it can lead to data corruption and strange bugs.
>>
>> [...]
>>
>> There are a fistful of functions in this series and IDPF's virtchnl code in general
>> that allocate a memory chunk via kzalloc() family and then free it at the end of
>> the function, i.e. the lifetime of those buffers are the lifetime of the function.
>> Since recently, we have auto-variables in the kernel, so that the pieces I
>> described could be converted to:
>>
>> 	struct x *ptr __free(kfree) = NULL;
>>
>> 	ptr = kzalloc(sizeof(*x), GPF_KERNEL);
>>
>> 	// some code
>>
>> 	return 0; // kfree() is not needed anymore
>>
>> err:
>> 	return err; // here as well
>>
>> That would allow to simplify the code and reduce its size.
>> I'd like you to convert such functions to use auto-variables.
> 
> Certainly, should be straightforward and make the code much better, sounds good to me. Just to clarify I'm only going to mess with the virtchnl functions I've otherwise altered in this patch series to maintain appropriate scope, yes?

Yes, only virtchnl functions. New functions that you introduce 100%, the
rest only if you touch them.

> 
> -Alan
> 
>>
>> Thanks,
>> Olek

Thanks,
Olek

  reply	other threads:[~2024-01-29 15:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26  5:47 [PATCH v2 0/7 iwl-next] idpf: refactor virtchnl messages Alan Brady
2024-01-26  5:47 ` [PATCH v2 1/7 iwl-next] idpf: implement virtchnl transaction manager Alan Brady
2024-01-26  5:47 ` [PATCH v2 2/7 iwl-next] idpf: refactor vport virtchnl messages Alan Brady
2024-01-26  5:47 ` [PATCH v2 3/7 iwl-next] idpf: refactor queue related " Alan Brady
2024-01-26  5:47 ` [PATCH v2 4/7 iwl-next] idpf: refactor remaining " Alan Brady
2024-01-26  5:47 ` [PATCH v2 5/7 iwl-next] idpf: add async_handler for MAC filter messages Alan Brady
2024-01-26  5:47 ` [PATCH v2 6/7 iwl-next] idpf: refactor idpf_recv_mb_msg Alan Brady
2024-01-26  5:47 ` [PATCH v2 7/7 iwl-next] idpf: cleanup virtchnl cruft Alan Brady
2024-01-29 13:23 ` [Intel-wired-lan] [PATCH v2 0/7 iwl-next] idpf: refactor virtchnl messages Alexander Lobakin
2024-01-29 15:12   ` Brady, Alan
2024-01-29 15:43     ` Alexander Lobakin [this message]
2024-01-31 17:52       ` Alan Brady

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a022d442-db42-4f27-97b2-4738d862d46c@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=alan.brady@intel.com \
    --cc=igor.bagnucki@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).