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 D9AD842BF2; Wed, 31 May 2023 15:13:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B258440A89; Wed, 31 May 2023 15:13:59 +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 A26DA40A82 for ; Wed, 31 May 2023 15:13:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685538837; 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=wiTm5oTgJjEDiLgESOhEI1FSXHmznZ+w6nMILe/YNQk=; b=c4CsqETHj2M2zxzqvE6dbYudRHTTPgBGwkqzx8Hdk28tf8w4vtGcqcAo+Oy0WPDFzmADl+ piGhC0I8qG3QVhaL1xf1A63eDoId5LAkGNWN5bsAlZClvj+L3g0xtZ7YfcaIgedrAwEITv XTEMgelI+bjDOfRd49yy9BoFhK1MeVI= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-270-y-19_1lgPCW1gxpooWUGdA-1; Wed, 31 May 2023 09:13:55 -0400 X-MC-Unique: y-19_1lgPCW1gxpooWUGdA-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-96fd6bd135dso616178566b.1 for ; Wed, 31 May 2023 06:13:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685538834; x=1688130834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wiTm5oTgJjEDiLgESOhEI1FSXHmznZ+w6nMILe/YNQk=; b=FDDGSVWtrnAqwsKkn0olff+k7Ml4K1dqzT1SgE5sz2kaengHNI6zfCn1vpPq9H5mvP BVVPPKV5bkK/rYpNl3lLXa0FJ04bHOth4eyPBn2wM34qYhh04sfQLp4XLMjSw88x1g6u iLPe4UZnzXTWyrGAZYyyIuOvsY3KIcuzitanWjtlGGCTDNIWAm3TAMsyC5yfsKZ7lzCd fNM2HNadymIWu+CL/HfKvKudzgzPzJEvzNyO5MjAODL63w4u8J/yE5Lht6R5afu0UyTF UrZXIp3zQvG0RozJdlAiw92Q/SXxSqhoeMWjVYSrkwCPx0spRyPWe5JTfeQSCMbXEk0k sW1g== X-Gm-Message-State: AC+VfDxwWOj82wPv9N1QVFat9rVnpL6B28uRx7p7apttqWzgZfh/b+8x kQ/Jvt8Rr6wp0m3toimcZNeXA4+sDTxJAsO2Gfoozrrm8AawfML/W/I/DWrGLaF04/+CMVjdvDC qPvI= X-Received: by 2002:a17:907:2d8d:b0:969:e88a:6071 with SMTP id gt13-20020a1709072d8d00b00969e88a6071mr6086104ejc.61.1685538834770; Wed, 31 May 2023 06:13:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IK8SmaPonAxhFhA04nX59D8MU3NmNpYgOT9qO+hcU9TdTcR5ty4Fu+1RY6KAvWG9/3qnWUA== X-Received: by 2002:a17:907:2d8d:b0:969:e88a:6071 with SMTP id gt13-20020a1709072d8d00b00969e88a6071mr6086079ejc.61.1685538834444; Wed, 31 May 2023 06:13:54 -0700 (PDT) Received: from [10.39.192.204] (5920ab7b.static.cust.trined.nl. [89.32.171.123]) by smtp.gmail.com with ESMTPSA id b13-20020a1709065e4d00b00965e9b435dfsm8909017eju.65.2023.05.31.06.13.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2023 06:13:53 -0700 (PDT) From: Eelco Chaudron To: Maxime Coquelin Cc: David Marchand , 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 15:13:52 +0200 X-Mailer: MailMate (1.14r5964) Message-ID: In-Reply-To: <92de0a57-d3ce-b37e-91d4-7ed87dc05fff@redhat.com> References: <168431450017.558450.16680518469610688737.stgit@ebuild.local> <168431455219.558450.14986601389394385835.stgit@ebuild.local> <92de0a57-d3ce-b37e-91d4-7ed87dc05fff@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 On 31 May 2023, at 14:48, Maxime Coquelin wrote: > On 5/31/23 14:01, David Marchand wrote: >> Eelco, Maxime, >> >> On Wed, May 17, 2023 at 11:09 AM Eelco Chaudron 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. Looks good to me. //Eelco