DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David Marchand <david.marchand@redhat.com>,
	Eelco Chaudron <echaudro@redhat.com>
Cc: chenbo.xia@intel.com, dev@dpdk.org
Subject: Re: [PATCH v3 4/4] vhost: add device op to offload the interrupt kick
Date: Wed, 31 May 2023 14:48:09 +0200	[thread overview]
Message-ID: <92de0a57-d3ce-b37e-91d4-7ed87dc05fff@redhat.com> (raw)
In-Reply-To: <CAJFAV8zEM7v8=DJtY7wNLd8mxtzsLp=ZODqwcT51Gshk-nmS0A@mail.gmail.com>



On 5/31/23 14:01, David Marchand wrote:
> Eelco, Maxime,
> 
> On Wed, May 17, 2023 at 11:09 AM Eelco Chaudron <echaudro@redhat.com> wrote:
>> @@ -846,6 +848,11 @@ vhost_user_socket_mem_free(struct vhost_user_socket *vsocket)
>>                  vsocket->path = NULL;
>>          }
>>
>> +       if (vsocket && vsocket->malloc_notify_ops) {
>> +               free(vsocket->malloc_notify_ops);
>> +               vsocket->malloc_notify_ops = NULL;
>> +       }
>> +
>>          if (vsocket) {
>>                  free(vsocket);
>>                  vsocket = NULL;
> 
> Nit: we had several cleanups in the tree to remove patterns like if
> (ptr) free(ptr).
> Here, this helper could look for vsocket being NULL first thing, then
> call free() unconditionnally.
> And resetting the fields to NULL is probably not that useful, since
> the vsocket is freed at the end.
> Wdyt of:
> 
> static void
> vhost_user_socket_mem_free(struct vhost_user_socket *vsocket)
> {
>          if (vsocket == NULL)
>                  return;
> 
>          free(vsocket->path);
>          free(vsocket->malloc_notify_ops);
>          free(vsocket);
> }
> 
> 

It is indeed better, I can fix while applying if Eelco agrees.

Thanks,
Maxime


  reply	other threads:[~2023-05-31 12:48 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17  9:08 [PATCH v3 0/4] " Eelco Chaudron
2023-05-17  9:08 ` [PATCH v3 1/4] vhost: change vhost_virtqueue access lock to a read/write one Eelco Chaudron
2023-05-17 17:33   ` Maxime Coquelin
2023-05-18 14:46     ` Eelco Chaudron
2023-05-31  6:37   ` Xia, Chenbo
2023-05-31  9:27     ` Maxime Coquelin
2023-05-31 11:13       ` Eelco Chaudron
2023-06-01  1:45         ` Xia, Chenbo
2023-05-17  9:08 ` [PATCH v3 2/4] vhost: make the guest_notifications statistic counter atomic Eelco Chaudron
2023-05-30 12:52   ` Maxime Coquelin
2023-05-31  7:03   ` Xia, Chenbo
2023-05-17  9:09 ` [PATCH v3 3/4] vhost: fix invalid call FD handling Eelco Chaudron
2023-05-30 12:54   ` Maxime Coquelin
2023-05-31  6:12     ` Xia, Chenbo
2023-05-31  9:30       ` Maxime Coquelin
2023-05-17  9:09 ` [PATCH v3 4/4] vhost: add device op to offload the interrupt kick Eelco Chaudron
2023-05-30 13:02   ` Maxime Coquelin
2023-05-30 13:16     ` Thomas Monjalon
2023-05-30 15:16       ` Maxime Coquelin
2023-05-31  6:19         ` Xia, Chenbo
2023-05-31  9:29           ` Maxime Coquelin
2023-05-31 11:21             ` Eelco Chaudron
2023-06-01  2:18             ` Xia, Chenbo
2023-06-01  8:15               ` Eelco Chaudron
2023-06-01  8:29                 ` Maxime Coquelin
2023-06-01  8:49                   ` Eelco Chaudron
2023-06-01  8:53                     ` Maxime Coquelin
2023-05-31 11:49     ` David Marchand
2023-05-31 12:01   ` David Marchand
2023-05-31 12:48     ` Maxime Coquelin [this message]
2023-05-31 13:13       ` Eelco Chaudron
2023-05-31 14:12   ` David Marchand
2023-05-31 14:18     ` Maxime Coquelin
2023-06-01 20:00 ` [PATCH v3 0/4] " Maxime Coquelin
2023-06-02  6:20   ` Eelco Chaudron

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=92de0a57-d3ce-b37e-91d4-7ed87dc05fff@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=echaudro@redhat.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).