From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 3399043095;
	Fri, 18 Aug 2023 11:13:32 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B2C5E40ED9;
	Fri, 18 Aug 2023 11:13:31 +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 DE83540395
 for <dev@dpdk.org>; Fri, 18 Aug 2023 11:13:30 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1692350010;
 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;
 bh=fQ6oeEkMHsjb16IuyeMmVzdyPgTvsV4PdJzWWBDFHu8=;
 b=XcqROJTdLbakbW9T5rkWI7ELIbs9l+a2KeHSpze0C57KUWFQP17BYPj/N5V8g8BHeETvyl
 aYpRzzdfNJ/PU/qErBk8SvMqfl1O7CM5qeb+3dq2rwW7DVk5Em/AkLWG0NtsyHforTBsTJ
 jegRyxdMZ7167j5QOHKIprBTMJ7nXnQ=
Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-614-RD8exDx8M4SCSQdW306Q9A-1; Fri, 18 Aug 2023 05:13:28 -0400
X-MC-Unique: RD8exDx8M4SCSQdW306Q9A-1
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com
 [10.11.54.1])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5652829AB3F1;
 Fri, 18 Aug 2023 09:13:28 +0000 (UTC)
Received: from dmarchan.redhat.com (unknown [10.45.226.19])
 by smtp.corp.redhat.com (Postfix) with ESMTP id BA92340C207B;
 Fri, 18 Aug 2023 09:13:27 +0000 (UTC)
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: probb@iol.unh.edu
Subject: [PATCH 0/2] Release ethdev shared memory on port cleanup
Date: Fri, 18 Aug 2023 11:13:19 +0200
Message-ID: <20230818091321.2404089-1-david.marchand@redhat.com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="US-ASCII"; x-default=true
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

This series was triggered after investigating why the
eal_flags_file_prefix_autotest unit test was failing in the case of
statically built binaries [1]).

For now, I went with a simple (naive) approach and put all accesses to the
shared data under a single lock: ethdev maintainers, it is your turn to
shine and give me reasons why we should keep the locks the way they
were ;-).
And let's see what the CI reports...

1: https://inbox.dpdk.org/dev/20230816153439.551501-12-bruce.richardson@intel.com/T/#m0e4c23f7be80bbdac076a387f4a2f9094dd07e0a


-- 
David Marchand

David Marchand (2):
  ethdev: protect shared memory accesses under one lock
  ethdev: cleanup shared data with the last port

 lib/eal/common/eal_common_mcfg.c    |  6 +++
 lib/eal/common/eal_memcfg.h         |  1 +
 lib/eal/include/rte_eal_memconfig.h |  4 ++
 lib/eal/version.map                 |  1 +
 lib/ethdev/ethdev_driver.c          | 36 ++++++++++-------
 lib/ethdev/ethdev_private.c         | 23 ++++++-----
 lib/ethdev/ethdev_private.h         | 12 ++++--
 lib/ethdev/rte_ethdev.c             | 60 ++++++++++++++++-------------
 8 files changed, 91 insertions(+), 52 deletions(-)

-- 
2.41.0