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 A992B4309C; Sat, 19 Aug 2023 03:35:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CD62410D7; Sat, 19 Aug 2023 03:35:02 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2070.outbound.protection.outlook.com [40.107.237.70]) by mails.dpdk.org (Postfix) with ESMTP id DB8EC40EDF for ; Sat, 19 Aug 2023 03:34:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bT9GDCNx3hMCEGvcSPJ+G5hAq5Mf8UIOFo/Z20pF2VZkI1aWA9vkVxrI6dcseVpp3EFKVjEk1UhtF+6cc35jU4f+lZ1fr+mWFPm4zK6YqFSOBpJCb0/kNLRLE0p2uYfrz09nlHrGBJOWL3hvcDzHVE20VHw/efVBZG4urTJ4UsuzAzDoUzfX3xd7c1dAbDuA3jh7CmictFkrWOS+yXk2oPnCqI9cmhPi14szla0e3BDc70eAv46VLmdCTpwNLHVoCifThJ1RW8X/2oPBAp7ROgEk4g8ZbEVFoubw6ZhJnG4sCjDcCgJ3/ALz6IKd/vIE+SAmJNmWrgULuL8GHvnJhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N904JC7rHV7xBQaW3C/qKM0KvU54U7DmRVhF2NwGUhQ=; b=ZqDOW3NtO03VvpU6Gho50Tv+pWMT0qCRbHCEd4YXzmzHFax720/3dPT2GQhCFMti9HEkyUDzkL/hYTS2dO41Umbex0D5TxIotrlNDtpLbNNXTn2i6Ap7hSkqeLBa43Dk+BXKYF44kunp6eiOpDrphnxUwgktlHCex6Vpjz0LUhYjEjRcBdxsVHTgi4CyC0rqIMRXifU1k1xYnRkiZtXREBtD7FX7nUqCKAr0QSUlVyLUsectJEeKa/AHFHV1S/tj0V4BSB0m0yA+nknSXZaqqJyG6EcrONnYhKOuiGLgr5/H4uUGowsX5UGGUKmUqYeXl+56F53gpIj6luzMCkj9HA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N904JC7rHV7xBQaW3C/qKM0KvU54U7DmRVhF2NwGUhQ=; b=FUYX3lj4P4Ttiq0E7hT0RLHcUhVuV3xSp8uxp3ANJoEMwyr84eon3AD/kl4iOFEQmYNtlBd6peBxv6IgrixUTI52DFExHW8dKkLL823a+52kCvbh6sqGQP1Y4Vr6nptYyMPrd5KSseEMKadHm4uDBm9ACKW0nuvpp9jvvsq6Cp74ABqjU5gaGKQx0tsof+Lq39bPdORd9rrwXAQSy1MmII19vFVu1dElOXm5ELwWWTxX+B4p1FGOsBE+jiZj6v6yqIh6LRCQgljEMGQZ89MOvihGlCQ9vEIToc8ghJRX7pD0EPqjYaL89RPM850Rl2XjEGYjsBLvfqvAkgF0V0d0Vg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CO6PR12MB5459.namprd12.prod.outlook.com (2603:10b6:303:13b::16) by DS0PR12MB7534.namprd12.prod.outlook.com (2603:10b6:8:139::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Sat, 19 Aug 2023 01:34:57 +0000 Received: from CO6PR12MB5459.namprd12.prod.outlook.com ([fe80::46b7:f479:cba8:9adf]) by CO6PR12MB5459.namprd12.prod.outlook.com ([fe80::46b7:f479:cba8:9adf%7]) with mapi id 15.20.6699.020; Sat, 19 Aug 2023 01:34:57 +0000 Content-Type: multipart/alternative; boundary="------------9MyRxgirEieLSP17A5RZEYEg" Message-ID: <7fd66332-a7cf-4947-ad5b-e1af0c5148e0@nvidia.com> Date: Sat, 19 Aug 2023 09:34:49 +0800 User-Agent: Mozilla Thunderbird Subject: Re: MLX5 PMD access ring library private data Content-Language: en-US To: Honnappa Nagarahalli , Stephen Hemminger Cc: "dev@dpdk.org" , Matan Azrad , "viacheslavo@nvidia.com" , Tyler Retzlaff , Wathsala Wathawana Vithanage , nd References: <20230817070658.45576e6d@hermes.local> <1fbe4f48-e652-4887-8949-ad9cd15e2c26@nvidia.com> From: Jack Min In-Reply-To: X-ClientProxiedBy: TYXPR01CA0058.jpnprd01.prod.outlook.com (2603:1096:403:a::28) To CO6PR12MB5459.namprd12.prod.outlook.com (2603:10b6:303:13b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR12MB5459:EE_|DS0PR12MB7534:EE_ X-MS-Office365-Filtering-Correlation-Id: f1fe3341-5c6e-4281-3c1e-08dba0547ece X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DHyqBq+zso4FkhnCfs+/vFlPFLPpnUPqOtIcW+xO3BNcbznj9h9WC0CMvDhswPuqmcIOR3h7Bv1c+gPy6uvbZxmjU9cZBqIpwO3N1MUJdyQoS1Coj2UEId3cB2go17xtJzPUQOWZ/yHxcte6sKgmiPizh7P1td8Gpx99d7tZmm18B+U25ry4SNcKcXbnua0x5/ngYHT6XNluEa7L7TlE4gE83o3TNAiePl6pf0lXmLYUbiKYfyxOJPPopH01UnMGUWH39fwE66n4mI8HFcCBrriqA5pxeSlqG/0RIzyZQ5zaLWRfGhrY66IoabAFE0w6IFHvUMW5aJpIHZhwR6Y1ak0prXe3qbYx8LJ//911TAWvrLC/I6YW1kyn3d0D1qVmxCA0mtKx9NfsMMxApeiFTB4f//6ILzlJahkcuZIyJViCzigk6cEjcxv0cBAtbyvCBFY0RUvN3x8uhkvb+xkqQuEF0PE1tgtIzxfSebnUC5o6ShienW5eBu0VrSm10fpj48E407ropluvWaaonIYOPHhWk5k3QACQIS9UUY5Oy1X3IV6oXO3DMA+j4gh3xi3UWSCp4RY4weZgbXpMRpi3RO3t2XCrbpeoMZr+AZoXG5KpKomtfPbLfwQA/8okgcgQ637u2G3lk2F04mrt0F14qw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR12MB5459.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(39860400002)(366004)(396003)(376002)(1800799009)(186009)(451199024)(6666004)(6486002)(6506007)(38100700002)(6512007)(53546011)(33964004)(31696002)(83380400001)(36756003)(26005)(2616005)(66556008)(316002)(2906002)(66946007)(66476007)(54906003)(41300700001)(110136005)(86362001)(5660300002)(8676002)(8936002)(4326008)(478600001)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?em8yK210ajIwaVJTbmk0RURRajA0ZU5waThyNU5HVCsxWU1EVEl0MFdhSTJk?= =?utf-8?B?QllNa3NJL0x6SnM5cVhmVDdYbDltY0RKOUhxTGQ4aFZvU0g5bWtmN2owTG00?= =?utf-8?B?QTg5ZjRlYkFtV2RFUDdIZkxSVUkvbURQdE5ERmVTMFp2VTZ2V2xMQjFBMjhn?= =?utf-8?B?c0Y3dlFmNWFKeDQ1MVNHV0VpT2NVSWp3VXNrQmtEMDBEam1KbGtCOU4xcnFw?= =?utf-8?B?Sk15YU5nVk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NVU3ErcDdqTkdMemVD?= =?utf-8?B?ZEtNeGozQTNQZmprNEJvUi9UY3QzVWcvdEh2eVl2S0l4SS9aV1Y2eWRrWW0w?= =?utf-8?Q?LavgWlSI5KYJpCnQeyDpB6FiL?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1fe3341-5c6e-4281-3c1e-08dba0547ece X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5459.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2023 01:34:57.2397 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4bP4MAuHzaeqOB0x+jQym3ysVS/jTGJ7mQe8wpq2uE+L4yMA/SwYt5zaET58to85HjLbUYhUlpc9eCmXPswsjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7534 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 --------------9MyRxgirEieLSP17A5RZEYEg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2023/8/18 21:59, Honnappa Nagarahalli wrote: > > *From:* Jack Min > *Sent:* Friday, August 18, 2023 12:57 AM > *To:* Honnappa Nagarahalli ; Stephen > Hemminger > *Cc:* dev@dpdk.org; Matan Azrad ; > viacheslavo@nvidia.com; Tyler Retzlaff ; > Wathsala Wathawana Vithanage ; nd > *Subject:* Re: MLX5 PMD access ring library private data > > On 2023/8/18 12:30, Honnappa Nagarahalli wrote: > > -----Original Message----- > > From: Jack Min > > Sent: Thursday, August 17, 2023 9:32 PM > > To: Stephen Hemminger ; Honnappa > > Nagarahalli > > Cc:dev@dpdk.org; Matan Azrad ; > > viacheslavo@nvidia.com; Tyler Retzlaff ; > > Wathsala Wathawana Vithanage ; nd > > > > Subject: Re: MLX5 PMD access ring library private data > > On 2023/8/17 22:06, Stephen Hemminger wrote: > > On Thu, 17 Aug 2023 05:06:20 +0000 > > Honnappa Nagarahalli wrote: > > Hi Matan, Viacheslav, > >       Tyler pointed out that the function > > __mlx5_hws_cnt_pool_enqueue_revert is accessing the ring private structure > > members (prod.head and prod.tail) directly. Even though ' struct rte_ring' is a > > public structure (mainly because the library provides inline functions), the > > structure members are considered private to the ring library. So, this needs to > > be corrected. > > It looks like the function __mlx5_hws_cnt_pool_enqueue_revert is trying > > to revert things that were enqueued. It is not clear to me why this > > functionality is required. Can you provide the use case for this? We can > > discuss possible solutions. > > How can reverting be thread safe? Consumer could have already looked at > > them? > > Hey, > > In our case, this ring is SC/SP, only accessed by one thread > > (enqueue/dequeue/revert). > > You could implement a more simpler and more efficient (For ex: such an implementation would not need any atomic operations, would require less number of cache lines) ring for this. > > Is this function being used in the dataplane? > > Yes,  we can have our own version of ring (no atomic operations) but > basic operation are still as same as rte_ring. > > Since rte ring has been well-designed and tested sufficiently, so > there is no strong reason to re-write a new simple version of it until > today :) > > The scenario we have "revert" is: > >  We use ring to manager our HW objects (counter in this case) and for each > > core (thread) has "cache" (a SC/SP ring) for sake of performance. > > 1. Get objects from "cache" firstly, if cache is empty, we fetch a bulk of free > > objects from global ring into cache. > > 2. Put (free) objects also into "cache" firstly, if cache is full, we flush a bulk of > > objects into global ring in order to make some rooms in cache. > > However, this HW object cannot be immediately reused after free. It needs > > time to be reset and then can be used again. > > So when we flush cache, we want to keep the first enqueued objects still stay > > there because they have more chance already be reset than the latest > > enqueued objects. > > Only flush recently enqueued objects back into global ring, act as "LIFO" > > behavior. > > This is why we require "revert" enqueued objects. > > You could use 'rte_ring_free_count' API before you enqueue to check for available space. > > Only when cache is full (rte_ring_free_count() is zero), we revert X > objects. > > If there is still  one free slot we will not trigger revert (flush). > > */[Honnappa]/* May be I was not clear in my recommendation. What I am > saying is, you could call ‘rte_ring_free_count’ to check if you have > enough space on the cache ring. If there is not enough space you can > enqueue the new objects on the global ring. Pseudo code below: > > If (rte_ring_free_count(cache_ring) > n) { > >              > > } else { > >              > > } > Hey, Then next n objects will still enqueue into global ring, not into cache , right? ( we enqueue nnnn objects continually) Our requirement is like this: if (rte_ring_free_count(cache_ring) > 0) {          } else { /* cache is full */            } It's not about if this enqueue on cache can success or not. It's about we need "free" more room in advance so next n objects can enqueue into cache. -Jack > -Jack > --------------9MyRxgirEieLSP17A5RZEYEg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2023/8/18 21:59, Honnappa Nagarahalli wrote:

From: Jack Min <jackmin@nvidia.com>
Sent: Friday, August 18, 2023 12:57 AM
To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; viacheslavo@nvidia.com; Tyler Retzlaff <roretzla@linux.microsoft.com>; Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com>; nd <nd@arm.com>
Subject: Re: MLX5 PMD access ring library private data

 

On 2023/8/18 12:30, Honnappa Nagarahalli wrote:

 
 
-----Original Message-----
From: Jack Min <jackmin@nvidia.com>
Sent: Thursday, August 17, 2023 9:32 PM
To: Stephen Hemminger <stephen@networkplumber.org>; Honnappa
Nagarahalli <Honnappa.Nagarahalli@arm.com>
Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>;
viacheslavo@nvidia.com; Tyler Retzlaff <roretzla@linux.microsoft.com>;
Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com>; nd
<nd@arm.com>
Subject: Re: MLX5 PMD access ring library private data
 
On 2023/8/17 22:06, Stephen Hemminger wrote:
On Thu, 17 Aug 2023 05:06:20 +0000
Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com> wrote:
 
Hi Matan, Viacheslav,
      Tyler pointed out that the function
__mlx5_hws_cnt_pool_enqueue_revert is accessing the ring private structure
members (prod.head and prod.tail) directly. Even though ' struct rte_ring' is a
public structure (mainly because the library provides inline functions), the
structure members are considered private to the ring library. So, this needs to
be corrected.
 
It looks like the function __mlx5_hws_cnt_pool_enqueue_revert is trying
to revert things that were enqueued. It is not clear to me why this
functionality is required. Can you provide the use case for this? We can
discuss possible solutions.
How can reverting be thread safe? Consumer could have already looked at
them?
 
Hey,
 
In our case, this ring is SC/SP, only accessed by one thread
(enqueue/dequeue/revert).
You could implement a more simpler and more efficient (For ex: such an implementation would not need any atomic operations, would require less number of cache lines) ring for this.
Is this function being used in the dataplane?

Yes,  we can have our own version of ring (no atomic operations) but basic operation are still as same as rte_ring.

Since rte ring has been well-designed and tested sufficiently, so there is no strong reason to re-write a new simple version of it until today :)

 

 
 
 
The scenario we have "revert" is:
 
  We use ring to manager our HW objects (counter in this case) and for each
core (thread) has "cache" (a SC/SP ring) for sake of performance.
 
1. Get objects from "cache" firstly, if cache is empty, we fetch a bulk of free
objects from global ring into cache.
 
2. Put (free) objects also into "cache" firstly, if cache is full, we flush a bulk of
objects into global ring in order to make some rooms in cache.
 
However, this HW object cannot be immediately reused after free. It needs
time to be reset and then can be used again.
 
So when we flush cache, we want to keep the first enqueued objects still stay
there because they have more chance already be reset than the latest
enqueued objects.
 
Only flush recently enqueued objects back into global ring, act as "LIFO"
behavior.
 
This is why we require "revert" enqueued objects.
You could use 'rte_ring_free_count' API before you enqueue to check for available space.

Only when cache is full (rte_ring_free_count() is zero), we revert X objects. 

If there is still  one free slot we will not trigger revert (flush).

[Honnappa] May be I was not clear in my recommendation. What I am saying is, you could call ‘rte_ring_free_count’ to check if you have enough space on the cache ring. If there is not enough space you can enqueue the new objects on the global ring. Pseudo code below:

If (rte_ring_free_count(cache_ring) > n) {

             <enqueue n objects on cache ring>

} else {

             <enqueue n objects on global ring>

}

Hey,

Then next n objects will still enqueue into global ring, not into cache , right? ( we enqueue nnnn objects continually)

Our requirement is like this:

if (rte_ring_free_count(cache_ring) > 0) {

         <enqueue this object on cache ring>

} else { /* cache is full */

      <enqueue this object into global ring>     

     <move the latest n objects into global ring too>

}

It's not about if this enqueue on cache can success or not. 

It's about we need "free" more room in advance so next n objects can enqueue into cache.

-Jack

 
 
 
-Jack
 
 
--------------9MyRxgirEieLSP17A5RZEYEg--