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 247AC4550C;
	Thu, 27 Jun 2024 16:00:50 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 53078427A6;
	Thu, 27 Jun 2024 16:00:49 +0200 (CEST)
Received: from fhigh4-smtp.messagingengine.com
 (fhigh4-smtp.messagingengine.com [103.168.172.155])
 by mails.dpdk.org (Postfix) with ESMTP id 7FE6940BA3;
 Thu, 27 Jun 2024 16:00:47 +0200 (CEST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailfhigh.nyi.internal (Postfix) with ESMTP id 1DBBF1140207;
 Thu, 27 Jun 2024 10:00:47 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Thu, 27 Jun 2024 10:00:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1719496847;
 x=1719583247; bh=/jKtO1n5UV6G4wZDX9I1SCQ8p3IlvwGGz5rUVICdh04=; b=
 E+U/z9YxihtPl3790BUgAWisMiV6GLxib4YGG2KUDhV3MC2VWtwdM6nHpsLDRGXl
 av+LZmzMEEjuahmngiJgJ+nIyV4GF0HvtGdthUJOjSz/OSvWcnAU25MoxIkE9XDK
 LxkejxrsZoVLKuRYeymcJ6w4yev/OjWPYuGSYMV4W1a1u4FCepwkWRc9H5LlYN/B
 WgdnVW7YDXIIM6EnkEnN32qZwYsU3xvTCcssimyHlmXlQNjIm+RqY7tNWYWPc/qN
 S+KyzIISgV4cUXuDTzRVlFrr5ZDPcBecTeFSBWrsPYkC3x2fdlKnT8iln+JVib6P
 heRaSiY+GY2P5JJU8g5Omg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719496847; x=
 1719583247; bh=/jKtO1n5UV6G4wZDX9I1SCQ8p3IlvwGGz5rUVICdh04=; b=V
 nABoaLKg8k4zB13zDAXJetjzT3uR1uREjX/CiK/CXIS4apQIWKUrnZ3GELTe8qLG
 KQp1mVgYfZgIosEySJja1QS7NLjHkL5JWElv6UTWqCIp9N4HctbJTObQzZW11+oC
 xh9wKRv03zlPdZvIxd8ENVFz1tm5/pTWNnVjbsprCMZMQSta9esCM0jbu+3pJ3WH
 84tjyh8VjIK+RGSVmU0ytIe0CTgvnwAqcyrVEoKNUO9MeRr2s/LwUA/wL5j3oP3W
 qrxTwk/7XGl01Je4H5YAUwZStOCmWv2uY0YuCii/wBBUeQCIG98MuXbf1QHWcR5x
 zCowuXftyJwdwsh4Hi97w==
X-ME-Sender: <xms:jXB9ZnJuFc3CJFuIYfDUGUxakjGzawf317lE5sbBW3DjiEGTUVbZvw>
 <xme:jXB9ZrKOaIimhNmaxMOMJC7Ccz65Rjau8rcI4qGuJ2wDl5pAO5ZkYsifxUEfepSSs
 kxre2mF6sa3MrXIWw>
X-ME-Received: <xmr:jXB9ZvsFMeRFYstjRZD1ouUkTUWpFRqzD3EeIYU8dKTdGU62omqosQ8pM-_SKyoA--jGMqH1rdjknaJnjI49l-PDYQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdeggdejvdcutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepjeduveehieevuddutdevfffgtdegkeeuveejffejgedtgeegkefg
 vdeugfefkeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh
 homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth
X-ME-Proxy: <xmx:jnB9ZgZ6hqaPX3mwh7ZRARIoMRoHub4s0I_I0TVSP4avd6_7lLa7jQ>
 <xmx:jnB9ZuYcr6Yv0UnpEEzrXjFb-FSZ6ulK_vNOy6rDml4O7XSr_2bzoA>
 <xmx:jnB9ZkCOdOXmD5tT0uu4ncR_4aUX7052xQ_8Io190-I5Ew_bEk6ckw>
 <xmx:jnB9ZsaiC4B9FK50BAb6QRsFTA8QDtPGgsh3JAoNyQBCkUdEiKhwkg>
 <xmx:j3B9ZrS0TplNdwbQdtsFAMxw0OIevMs3fvA1GdwQuQdiSrTwWGMC7ADm>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 27 Jun 2024 10:00:44 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Chaoyong He <chaoyong.he@corigine.com>
Cc: dev@dpdk.org, stable@dpdk.org, oss-drivers@corigine.com,
 Zerun Fu <zerun.fu@corigine.com>, mukawa@igel.co.jp, stable@dpdk.org,
 Chaoyong He <chaoyong.he@corigine.com>, Long Wu <long.wu@corigine.com>,
 Peng Zhang <peng.zhang@corigine.com>
Subject: Re: [PATCH v3 1/2] bus/pci: fix secondary process PCI uio resource map
 problem
Date: Thu, 27 Jun 2024 16:00:42 +0200
Message-ID: <2723233.FGBNh6B6GM@thomas>
In-Reply-To: <20240419032630.1215256-2-chaoyong.he@corigine.com>
References: <20240129092231.3531217-1-chaoyong.he@corigine.com>
 <20240419032630.1215256-1-chaoyong.he@corigine.com>
 <20240419032630.1215256-2-chaoyong.he@corigine.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="utf-8"
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

19/04/2024 05:26, Chaoyong He:
> From: Zerun Fu <zerun.fu@corigine.com>
> 
> For the primary process, the logic loops all BARs and will skip
> the map of BAR with an invalid physical address (0), also will
> assign 'uio_res->nb_maps' with the real mapped BARs number. But
> for the secondary process, instead of loops all BARs, the logic
> using the 'uio_res->nb_map' as index. If the device uses continuous
> BARs there will be no problem, whereas if it uses discrete BARs,
> it will lead to mapping errors.
> 
> Fix this problem by also loops all BARs and skip the map of BAR
> with an invalid physical address in secondary process.
> 
> Fixes: 9b957f378abf ("pci: merge uio functions for linux and bsd")
> Cc: mukawa@igel.co.jp
> Cc: stable@dpdk.org
> 
> Signed-off-by: Zerun Fu <zerun.fu@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>

You should have kept the ack from Anatoly here.

>  drivers/bus/pci/pci_common_uio.c | 40 ++++++++++++++++++++------------
>  1 file changed, 25 insertions(+), 15 deletions(-)

There are too many changes in this sensitive code.
Please could you introduce a first patch for the renaming of the variable "i"?
It should make this patch simpler to read.

Thank you