From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ADE1942BF4; Wed, 31 May 2023 14:01:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 460E940ED7; Wed, 31 May 2023 14:01:30 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 0FBA240A82 for ; Wed, 31 May 2023 14:01:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685534488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r4kW6Il1VMyDqDaTrogzORrcmgBTO6O2x+sf6lROfhk=; b=NpKhqZvIh2eei4JDYx9MyXtUhtPBzMOdX4hvf7F1Fjgf9sa9CYE2+4hf6FCtj+jtTEsYfq UFaD5EV2YrIAsWuB/LVsw1Xhw2Fd1l2/TgDx7/WNJZkLG5IRo8KS97hSTNHgNVuIaXsobI TbZRYO125BTUnBcd/ZpyvvcVw/1rNkY= Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-132-mSGMeTfDOLe6-01I8EZrqQ-1; Wed, 31 May 2023 08:01:27 -0400 X-MC-Unique: mSGMeTfDOLe6-01I8EZrqQ-1 Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-5571c6e4223so4675707eaf.2 for ; Wed, 31 May 2023 05:01:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685534486; x=1688126486; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r4kW6Il1VMyDqDaTrogzORrcmgBTO6O2x+sf6lROfhk=; b=Duyu1FjK3gvm/vPn+0ggiD/nFJyG6z/ptwwWRD/5zyVzTAFzS6BNP9LNH9BTbAQA36 mNuwDGZe5fhbtM6jRj5sn6swjYYoaStsJGYRS1yeG0s9IB/BxPh5rSuCcVOLf8BTu4ca pkL8KUKFrQIBUi179UMVPhu2WJ82zSo3q5Xmo2Kh1nFX1YjXPExtUkeeTtz2tFG2RdvB IJyMVuLpBuZuXpg43SKSXdl5j7IMyw05sSCTu+tRjAZkBkBNV4zbqKaTBO4HTbkiMn6I y6pFMrEeCGYdqoUbMjVn0nhtJz120bCzFWwHeZ5m6iryWGgRhO13VCJEgSb5SLeCg4By QktA== X-Gm-Message-State: AC+VfDxGuz5JdZbQjpXVARSRO/w8lYiQbMXv5CVBZqsr3LAg9ioMmuYy 9UmSxdD6bLQ7yP8ipT0BiltlfHTFO6EtYFFV1O50T0I7XI/L/IAsFp9VsVC3YlZArny7gZk8UgM kFs3Mj/szMqL5R6Cjxf8= X-Received: by 2002:a05:6358:7208:b0:125:83c8:72f6 with SMTP id h8-20020a056358720800b0012583c872f6mr2482526rwa.0.1685534486467; Wed, 31 May 2023 05:01:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74J515Ge/vSRa5Gw5yRNZLErPcggAsD5Q2JpxEfYMGvgx1gTSXop/Y63KPEn1MzUwgimOLzSuP3JRs9HNXkSI= X-Received: by 2002:a05:6358:7208:b0:125:83c8:72f6 with SMTP id h8-20020a056358720800b0012583c872f6mr2482505rwa.0.1685534486150; Wed, 31 May 2023 05:01:26 -0700 (PDT) MIME-Version: 1.0 References: <168431450017.558450.16680518469610688737.stgit@ebuild.local> <168431455219.558450.14986601389394385835.stgit@ebuild.local> In-Reply-To: <168431455219.558450.14986601389394385835.stgit@ebuild.local> From: David Marchand Date: Wed, 31 May 2023 14:01:14 +0200 Message-ID: Subject: Re: [PATCH v3 4/4] vhost: add device op to offload the interrupt kick To: Eelco Chaudron , maxime.coquelin@redhat.com Cc: chenbo.xia@intel.com, dev@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Eelco, Maxime, On Wed, May 17, 2023 at 11:09=E2=80=AFAM Eelco Chaudron wrote: > @@ -846,6 +848,11 @@ vhost_user_socket_mem_free(struct vhost_user_socket = *vsocket) > vsocket->path =3D NULL; > } > > + if (vsocket && vsocket->malloc_notify_ops) { > + free(vsocket->malloc_notify_ops); > + vsocket->malloc_notify_ops =3D NULL; > + } > + > if (vsocket) { > free(vsocket); > vsocket =3D 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 =3D=3D NULL) return; free(vsocket->path); free(vsocket->malloc_notify_ops); free(vsocket); } --=20 David Marchand