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 5AFD143099; Fri, 18 Aug 2023 13:36:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2859B40ED9; Fri, 18 Aug 2023 13:36:27 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9ACDE40395 for ; Fri, 18 Aug 2023 13:36:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692358585; 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=WAhQnlBXYvS3FxPAudEYvcolo1zkDG6vjSMWVq4fUG8=; b=XbX/Hy9SVbyiGj82bbUYFTMOfq1j+aWXLhRF1rXE6x8gVc6/uyVKajijp09lzWI1aokJun BjKUsNjbVqqKsQH0Qn1VkTu7cOJ2FIF9p5fth9j2OeRkKubn2wnbIkucX8p5s28XQm3iEL 7ps6P63p7SyqO/sZwUp03PhBJBTiGWc= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-hGU-IjUHMRK1-FDbV96zyg-1; Fri, 18 Aug 2023 07:36:23 -0400 X-MC-Unique: hGU-IjUHMRK1-FDbV96zyg-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-4fe4a1ce065so814332e87.3 for ; Fri, 18 Aug 2023 04:36:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692358582; x=1692963382; 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=WAhQnlBXYvS3FxPAudEYvcolo1zkDG6vjSMWVq4fUG8=; b=MAqT9GV5CUczpzpkhFiVh47uGsZOv5ITC30WhABabMQ+C6513sPfOVLzq8Kdo2tVvz bs9eeCLWKmdrm80DRd5RG63OUBdvTwTgPLFHR6AoSYyegfzcVepyFVW2+g2H6vcysJmY FIygumu/nlWc7L14gaw+ig14CpYRboLKxHR8WJbjbGGHjL7bL3gp8juI6YyD1salwOEr ADl8VrBN5OaI236VksFmYqRdwR6tO1DR7KJUI3lqX5dZECP7GKdLUxpfgWmnbQNysUTi ConElwdc01GkAGXB2M6ys0YdZPnOlTlAZHf5NeGYLflTSbJXBGvUUHmmII4Hq+94trxq 2x3w== X-Gm-Message-State: AOJu0Yzg7j6avtNQ4QpPhGAoRGsSbPjj9B/Nh0YBJzSGuBKCg/9UcO/z TF2TDbZetbPZpSQpaLrCB/0mZzid01gqp2Te2bTHA8XBQX976RkHmBEWPlTirRRpcRvokBEhsp4 hVJ5z+BQxJpd7HoB2AMOnnWQzcF88XQ== X-Received: by 2002:a19:8c01:0:b0:4f8:6bca:50d7 with SMTP id o1-20020a198c01000000b004f86bca50d7mr1512277lfd.13.1692358582290; Fri, 18 Aug 2023 04:36:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEfZ98jUPuPOoH2unXMaOnVuRmwZMjgjZ1q7+9Nhligw7pFaHoJ5fPo/Cns5cuu3drqJhR1Ou6LILV/ECRDcGk= X-Received: by 2002:a19:8c01:0:b0:4f8:6bca:50d7 with SMTP id o1-20020a198c01000000b004f86bca50d7mr1512265lfd.13.1692358581955; Fri, 18 Aug 2023 04:36:21 -0700 (PDT) MIME-Version: 1.0 References: <20230818091321.2404089-1-david.marchand@redhat.com> <20230818091321.2404089-3-david.marchand@redhat.com> In-Reply-To: <20230818091321.2404089-3-david.marchand@redhat.com> From: David Marchand Date: Fri, 18 Aug 2023 13:36:10 +0200 Message-ID: Subject: Re: [PATCH 2/2] ethdev: cleanup shared data with the last port To: dev@dpdk.org Cc: probb@iol.unh.edu, Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Anatoly Burakov 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 On Fri, Aug 18, 2023 at 11:13=E2=80=AFAM David Marchand wrote: > @@ -253,6 +255,10 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev= ) > rte_free(eth_dev->data->dev_private); > pthread_mutex_destroy(ð_dev->data->flow_ops_mutex); > memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data))= ; At device cleanup stage (rte_eal_cleanup -> bus -> device), eth_dev_allocated() may still be called and use a leftover reference to (freed) data. So here, we need to reset it to NULL (caught by ASan with test-null.sh in the CI). This will be in v2. > + > + eth_dev_shared_data->allocated_count--; > + if (eth_dev_shared_data->allocated_count =3D=3D 0) > + eth_dev_shared_data_release(); > } > > rte_spinlock_unlock(rte_mcfg_ethdev_get_lock()); --=20 David Marchand