From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0053.outbound.protection.outlook.com [104.47.38.53]) by dpdk.org (Postfix) with ESMTP id 29E1F326B for ; Tue, 4 Apr 2017 07:35:51 +0200 (CEST) Received: from BN6PR03CA0072.namprd03.prod.outlook.com (10.173.137.34) by BL2PR03MB276.namprd03.prod.outlook.com (10.255.231.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Tue, 4 Apr 2017 05:35:51 +0000 Received: from BL2FFO11FD008.protection.gbl (2a01:111:f400:7c09::196) by BN6PR03CA0072.outlook.office365.com (2603:10b6:404:4c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Tue, 4 Apr 2017 05:35:50 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD008.mail.protection.outlook.com (10.173.161.4) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1005.5 via Frontend Transport; Tue, 4 Apr 2017 05:35:50 +0000 Received: from [127.0.0.1] ([10.214.249.181]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v345Zg2n004934; Mon, 3 Apr 2017 22:35:47 -0700 To: Olivier Matz References: <1491210729-9755-1-git-send-email-hemant.agrawal@nxp.com> <20170403171958.5ff2f3ab@platinum> CC: , From: Hemant Agrawal Message-ID: <3c18f62b-252b-5184-07e0-0b4cb136d467@nxp.com> Date: Tue, 4 Apr 2017 11:05:42 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170403171958.5ff2f3ab@platinum> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131357577503198902; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39400400002)(39840400002)(39450400003)(39380400002)(39860400002)(39850400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(24454002)(43544003)(377454003)(9170700003)(189998001)(5660300001)(6916009)(2950100002)(85426001)(83506001)(8656002)(31686004)(7246003)(7126002)(36756003)(120886001)(105606002)(47776003)(65806001)(50466002)(65956001)(6666003)(53936002)(77096006)(53546009)(4326008)(106466001)(2906002)(81166006)(356003)(54906002)(230700001)(6246003)(23746002)(8676002)(8936002)(86362001)(76176999)(104016004)(31696002)(50986999)(33646002)(110136004)(64126003)(229853002)(65826007)(38730400002)(4001350100001)(54356999)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB276; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD008; 1:wCLPKn/Loa4y1I0i6gxNxC9Snle3SAefUl/dc8qwoQUIRfWXtd/CPsFVyAXcBkc8RbDkZDoTI/VDlg1hGnaKrdguQK+dXqBYFCGRUrfJb/hHhzMHIHsEabjl78sf09X+5dO45Mhk5ALoRUPS0d+I2WHv9LwWqDpoUhAzh0egWnKozB8WIYlOJ25k9F+xQr5gw8qY2vBgRpbpgjIygv+m4IdP+yohCd/aJaNCbHialThlB/Cc8Gb1Sj2A4chwttP21hwecR0Ma7ZJua6iUd0W4KkWVwOyjum6bWh+bO/bOCp2Y/KcfOfxlF0Kz4aVG0qs0wkDPyGHx2yvYu4JilcnwhVKv0WHXKbXzI9C4ymgrfQd0TwTngc676aGYY8tqDgHmxLFokvJiNPlvHOvlGzlLnZ9tBZyNbIB8fY9p5ayXiZN5eYMw7rgcXfSC6pL9Pq3qcGzQczBEu41cQSvBVZVsnLxWkyW/hoemAxugEhaQVgTxs8DnTFTUuxtky7TENiBwqDG7T+OAVWbOS1oVC6uwCk92ATRNd9gSfivAeCZYQEuKjtaEmB6ElqtE8VWshlIYkj0r9mm8Op6b08rPYfuIQ== X-MS-Office365-Filtering-Correlation-Id: 2c752993-a444-42c8-ed56-08d47b1c7416 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BL2PR03MB276; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB276; 3:jDhs2IEtp9Hr1cOAR3lO5BXAhAnUbrTgPVaYSEjeX3zS4yJkGj+l608GEGtuOvZmu16X4Dy2svSCg3fCG9HdwjO6Fe3O0qT9GyVNxNd+c4PTA1y2K1of7EOus/cMt/qebSE/uLGtB4zFaEr0r8tQCrcEz6tksKPm1LuhKI/Be7XSpSm3WGNdmIXkF6rl4xvzqeQTKbM+c7G5iyApA2BBM/nuxO8F5y7xgLY/W2ZZ0zQAgvYAHyrTjVnDLHlk9vQ4tM9xKFuS+2En87GBAHyYyEp4S5yAKVlX8A0f8I8CPN2dEhQ6qrRGqJTA4YkVbmbC9wy7wQTZlRcMgg9215J3qQUwBVVldV84GFik4XDbgQ9K+al4Z3YHPAjX+N4bnPL7gfAyMMyl+s3ddKs1yk7kujAlGxtNDHuwrXr9rdbPzSnVCVfoyUiAaDR2MtSOr0G+; 25:l4gp7Efj4yCyuzdNtfWS4Z5cBW6MzTnFl0F9yFix5JCRr53zS1JaRcCumxXGP4fJBh7IYRPGh7sP0VAufKp1dNobXHos2lOkbwsIVLue3sgxLAdwM6m6KlSmcuf4Fim1HzLYTlipaQIhssG7lwfgHOhcPivqTFozbaReHKF0eQfAs9SrYxyYQ/QLcGDT9Vk6jtSqxh570Pz2fWIEdKsStJpHLIYXQP9iPdv2XmJUISpM/QbhV0wOKejFOFEgt7PFdCt7lIfy8xVu2nriPOItlkOjTT2GurQJema2KxY30A3OvBTwwL9wTGz5Gclko1jN0c+6dNAmgU8UlK92+8CG7OWigH2TCFb9WtVMP+0Wr4IGa3OhMEZq3dmbLwH+HLTNVQSAUqxk1lMIBLekcTzS1WZ42+T+GtfP5guOZnvl8/uO9Y0gpKPGV/A16n/PCz7AOiIRsomvAkqspriCyyc4xw== X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB276; 31:kiU+oo5b3+qyz9f8UAbCbUXa1Dnab1AIk381ikyGoRKhunfNWN3N/yrVa8vty7XV0SNA/CsuBRZP8wyUNCbSv/w/Qi3Is3MM5onRGnHnSn3p2EnjrcSBtBhjcxSvLkdb3ZekFdbgmAZ02UtYUjSKJchrbWSgutNxp49p5fxI0Qx/0biKQiBUTDjOd8s9L+cHyNVeo3N0yYf9aaYjbtVMx49PkV0F88yEVxa0+f8GYDeUEcIzV90csnm0d8lT5E+G1s9C8qNFV72ylVubUb1u2Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13015025)(13017025)(5005006)(8121501046)(13024025)(13018025)(13023025)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(201703131430075)(201703131433075)(201703131448075)(201703161259075); SRVR:BL2PR03MB276; BCL:0; PCL:0; RULEID:(400006); SRVR:BL2PR03MB276; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB276; 4:KiCnFnkJhLSB3iWLE2mYcXaer6aSJjlqEkImZ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252?Q?Olj2rpTD+JaWqw1pYE/HBcmXjgcUpLtEiM4sDQA4ERUNvi/E8vtxpFJ+?= =?Windows-1252?Q?DrV58YvMG+5GVatdZn3apXDxuLQgioTGya+SNpEeakgWImTKcZsOBUmJ?= =?Windows-1252?Q?Gaja8WHmIk02smkm1CDUH5th/UpDFoG9idgzlaKoIuBzGJ1/vH/ITddO?= =?Windows-1252?Q?OzqTIVHq10d9kdHpDZGDDIohVVi2BZ7QM7gUo9Mv37+HMNkSRK2DeB6B?= =?Windows-1252?Q?cU321q1sEClPEcPbx+GGAHmm9+4dsu0HzXb9jpoNFyf9TK9XZupDffPy?= =?Windows-1252?Q?30gvjCo9kOXdVE3gfis88V5hIQHmWs4kY1OnJCUiLtNgA3AGqekL5fhB?= =?Windows-1252?Q?KiCrbrQ4Hy5Dhg34LOvNEEGZnk2txbx3w4oKgTJFo1R6INAW1oLrSHtS?= =?Windows-1252?Q?Msg2jtdYkEN7CoQ9z2+SLQpgrVasEsLPp37r66Yy2NAG6c2SoxF7fiqi?= =?Windows-1252?Q?GDa+QGxay4DTEqOWr/tHtFE3R/DH8teNDy+QVFjfqUQ2CgMtyROk3C4N?= =?Windows-1252?Q?S/QuBIo5NUaABLYW2Rhd+OfAQgN9V9NwgcyYHqh4YaLI6IRnUaNlmp2B?= =?Windows-1252?Q?wb64lOshfN6QDgsbjSnksTI8jBVg4LtRWAvt2VwpkObuRG6yLc4UJrrR?= =?Windows-1252?Q?Et9FGv8mPTkFASRTSMiQU97WgnARPX1kx/wc2rFBlTQVVGldM1We/Bjl?= =?Windows-1252?Q?yGdfX3ZURqeSHJ8fH4H1ZP8ws91x7wY1YA6gpkJFFDfCg/4E8/TTxUYZ?= =?Windows-1252?Q?cdHPH5aQ7QKx/h3xoqTWN08aya3q5z+3hU9wSi4EX0cXiY7ofjBYmYCK?= =?Windows-1252?Q?2UDEbq0AV0FMX9nAps/VD+HY1gdtjjI5Bw6xhn1UD1XZVbjXksJ1+WTM?= =?Windows-1252?Q?gt/xaQg9rINNpwa4D3C1rgUsLQ0VWt4uobYLBnfEqU+NPBhmmF6SpVes?= =?Windows-1252?Q?G2d06aphUiHQ/dxwdTdMR17H5oVp5fjBViKPzccGNct9erBMrDhUkwee?= =?Windows-1252?Q?6mwaXnY11PcPibIbo0Nortu4/gYlv21tdqo0D49jFpxaklyKT2TEYzv1?= =?Windows-1252?Q?TvbtjMWq+agtMtDzJLlIodTFC2F3Yyl8ZLlWv7G7ec/IWVMPe6QEFYZH?= =?Windows-1252?Q?z5tHA/zsXPhW5bAg6Wak1mdMFCkfdHy56vOAOUXkqesccIE/WCuF5Rv0?= =?Windows-1252?Q?P2sm+NZZSUPKRQr7AFsFV8SfeXSBNM4xijEDm1hmYPFRf9zy5gWoPq9g?= =?Windows-1252?Q?RV9veTf5cnMwNh0itO0nYbNGDtxS3mmM/Oygfq11RnKY6IH92H+qUe6I?= =?Windows-1252?Q?Z1JHDCHNDE48WVT+3poDmzYaZFaVJrkXv1swOhggOV6+4LSg/L//5YI4?= =?Windows-1252?Q?lWZycl454A7QvpwdY+psJ4NYPPzAOGqCbu5YsgM1D6ypaBy5GKVoERPl?= =?Windows-1252?Q?7T6FwLKJSoFOSAsW4c139GGGH0ZjK77VMAC1Kj7rpbbNA3Qi1wYIMof6?= =?Windows-1252?Q?Nsbmp8BzoMyeMIHqE0sh3lpNUsR1PGRV2txSNLUrdvYQFI/JMnRDjPqL?= =?Windows-1252?Q?lmQ4VmzQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB276; 6:+Yjpmmr1jAd/WukWhYx92u77YpKUeT9sjXhISUv2dVD7OrH9kbqf67QKiExY6X042vWsA7TuR4pPU4JhTHog+uD/7G0yUaI0ef2etz7hYze+urJ/CsMC1+PZYixnaf9BvIL6nTF9cmsZMBQMGV+vEi7ggvT/YoKvPnb6KJeeywEjw/ER+G/MRlWAEU1eqkyarWaAZs7+ocTuLNutRLch/Zi4RWVotTLnAA6ZVZTPMxC56Sb+83rULdAL4663eA5BGIH9JizuFoSmtUWMo0gY13ouT/UVijSjcUjvD0Xyo6EG6ZYyaBCEU5yubZa1KMJVd/9oIzBjC/qpBIF75FWUq8TWcSkGCDuvl9FIJI6EEpX535rEDoQ/JCWdHLICfcTF/b+sTdhR3ybzCsUu/rSXHg==; 5:AAK41EwXfnA9KTM2uuUozJziVvZMxn1fGSGdH8MSTE+0bhOTnP48c7MBNmU0SfhsMZsHgmVd9meGKgqF2/EtYroPO9b2mr3QFsRxr4VP2qUVncLuFg66yNuCdaZVJU6rq9T1lA9lktOgftKihwDWG/jmJmayliI41jRklpYlypcEXRNT1oFMs7G3gJfLPgRc; 24:QGD9Zl3Why21kXqLDAEE2e1ZEo441NMGzSGF1819SWIgN9+hxkVlZK9Vk11Hqjw9F8rs7jBL4oi9aZstCRb8oHE8JFKa308aXXPs/qQ2Xtg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB276; 7:b4p7ltBG+mjhrUh5VhqpFXkmxj70Dl2f4PveNoK7MI+xnqkd78d7Heozicj7Ef6DQEEe4XGb2hUJSsUZza+CRS1qP4unMIIH+/bqPXEEnNWwqYfZI/ZLplRzXJFJnOdhQeNkHZNJJ45oNWGFXg2IhZWl806F+YCq45ZFL4KTmZMzqWSHOGwYlrlzNcBLtoz+ZdBdSQKnV8W9bXBODt/K+zMSuC0rCi5gStPd34XbCxypPbO/lRd6DEAzgVfvbbNZ/lf/heEO3b8jZaRdhYj156s5jf+Yc/yxsHrjnyR+dR8UXh6Cm+1guCriB9JudBt0Rk2F8ep6LmVIP/qV7YfDjw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2017 05:35:50.1482 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB276 Subject: Re: [dpdk-dev] [PATCH] mempool: introduce flag to indicate hw mempool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Apr 2017 05:35:52 -0000 Hi Olivier, On 4/3/2017 8:49 PM, Olivier Matz wrote: > Hi Hemant, > > On Mon, 3 Apr 2017 14:42:09 +0530, Hemant Agrawal wrote: >> Hardware pools need to distinguish between buffers allocated using >> software or hardware backed pools. >> >> Some HW NICs may choose to autonomously free the pickets during >> transmit if the packet is from HW pool. While they should not do >> it for software backed pools. >> >> Such flag would also help when multiple pools are being handled by >> a PMD, saving costly compare operations for any internal marker. >> >> Signed-off-by: Hemant Agrawal >> --- >> lib/librte_mempool/rte_mempool.h | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h >> index 991feaa..91dbd21 100644 >> --- a/lib/librte_mempool/rte_mempool.h >> +++ b/lib/librte_mempool/rte_mempool.h >> @@ -263,6 +263,11 @@ struct rte_mempool { >> #define MEMPOOL_F_SC_GET 0x0008 /**< Default get is "single-consumer".*/ >> #define MEMPOOL_F_POOL_CREATED 0x0010 /**< Internal: pool is created. */ >> #define MEMPOOL_F_NO_PHYS_CONTIG 0x0020 /**< Don't need physically contiguous objs. */ >> +#define MEMPOOL_F_HW_POOL (1 << ((sizeof(int) * 8) - 1)) /**< Internal: >> + * Hardware offloaded pool. This information may be used by the >> + * NIC or other hw. Some NICs autonomously free the HW backed pool packets. */ >> + >> +/**< Don't need physically contiguous objs. */ >> >> /** >> * @internal When debug is enabled, store some statistics. > > > One thing is still not clear to me: in your driver, you check this flag: > - if it is unset, you reallocate a packet from your hw pool, you copy > some metadata, and you send it to the hw. > - if it is set, you assume that you can call mempool_to_bpid(mp) and directly > send it to the hw. > > I think this is not correct. The test you want to do in your driver is: > "is it the pool that I registered for my hardware"? > It is not: > "is it a hardware managed pool?". > I think what you are doing here prevents to use 2 hardware mempools > at the same time, because they would all have this flag, and mempool_to_bpid() > would probably crash. > No, I am only trying to differentiate between hw and software pool packets. I don't see a possiblity of having two different orthogonal hw mempool types working in the system. At any point of time when you are running DPDK on a particular type of hardware, you will only have *one* type of hardware backed pools in your implementation. The number of mempool instances may be many but all will able to work with mempool_to_bpid(). The application may send packet allocated from a *ring* pool instead of using "hw" pool. So, it is sufficient to just check if the pool is offloaded or not. HW can take care of all the supported pools. > Instead, can't you just compare the mempool pointer to a value stored internally > in the driver? There can be more than one instance of mempool, the driver is capable of supporting multiple hw offloaded mempools. Each dpaa2 PMD port may have different mempool instance registered. So, pointer comparison is not practical unless I start storing the mempool driver pointer. I guess, we are going into long discussion about how the hw mempool works. If you are still not convinced, will any of the following works for you: 1. As proposed, A generic hw managaged pool flag - I don't see any issue with it. 2. A specific flag - *MEMPOOL_F_HW_DPAA2* - There are instances where driver specific flags are added to lib. 3. Maintaining this flag within the dpaa2 driver at the risk of it being overwritten by the application. This will be temporary, till we arrive to a solution. > Olivier >