From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0068.outbound.protection.outlook.com [104.47.37.68]) by dpdk.org (Postfix) with ESMTP id 93BAD2FDD for ; Tue, 4 Apr 2017 09:29:18 +0200 (CEST) Received: from BN6PR03CA0028.namprd03.prod.outlook.com (10.175.124.14) by BY2PR03MB287.namprd03.prod.outlook.com (10.242.37.26) 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 07:29:16 +0000 Received: from BN1BFFO11FD016.protection.gbl (2a01:111:f400:7c10::1:186) by BN6PR03CA0028.outlook.office365.com (2603:10b6:404:10c::14) 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 07:29:15 +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 BN1BFFO11FD016.mail.protection.outlook.com (10.58.144.79) 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 07:29:15 +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 v347T8qk032181; Tue, 4 Apr 2017 00:29:12 -0700 To: Thomas Monjalon References: <1491210729-9755-1-git-send-email-hemant.agrawal@nxp.com> <20170403171958.5ff2f3ab@platinum> <3c18f62b-252b-5184-07e0-0b4cb136d467@nxp.com> <6998997.LVRpf6MECD@xps13> CC: , Olivier Matz , From: Hemant Agrawal Message-ID: Date: Tue, 4 Apr 2017 12:59:08 +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: <6998997.LVRpf6MECD@xps13> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131357645553456390; (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)(39850400002)(39410400002)(39380400002)(39840400002)(39860400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(24454002)(377454003)(43544003)(377424004)(9170700003)(7246003)(356003)(65956001)(65806001)(7126002)(5660300001)(31696002)(8656002)(305945005)(54906002)(64126003)(93886004)(230700001)(50466002)(47776003)(189998001)(81166006)(77096006)(8676002)(85426001)(83506001)(8936002)(86362001)(53936002)(50986999)(4326008)(104016004)(76176999)(105606002)(36756003)(54356999)(229853002)(65826007)(6916009)(53546009)(6666003)(2950100002)(33646002)(23746002)(4001350100001)(106466001)(110136004)(31686004)(6246003)(38730400002)(2906002)(120886001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB287; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD016; 1:14/NbHcyTPoPOt0vJK5+9bFbyfKYAClbVP/IJ/dBrJg9Iuz7pMgjKPeUxEg5UPWwy7OzHt3Bf+OMfsnTpAAbvxQlfvIIL+IVK+PXP8sENVlAtn7y8S/n8sqH4v4UgcpW7SdtwbjFqsY4xEFUlAMhuJvGRQtFi++9ZcA5VrNehRk0Jc1afbN0XF4IJwssitGFNvoHnu0ab1UcxdUuegnX5unR4g+5m4D2uSz+7Z2lN+1lHkom03y+sTbXOAg8OF1/Y6a3bEB2wMJPo3HdhtQ5dgp2tgAIWIzYh7vCiMgjb20wAbWGULbgsNtB5EQXedruO/ki3AKu4lM3hHb9COgpK+NvjGWGzetkq/SXlO5McZyXnuXzNZtYwdExKslUb5KSnFEyVUKX+r+2ktVPEOTBhlgSCc2BgyOP6pgU43i7m/ixiDmLnYW64zS+JQ7/fg4FmSMFXqqLxFaqejqUBTDsb5U9qqFqZWRBZtc9hX/EaAODaeb7JnUI/sQ3aftApdpTtypXIsVcMWElYR/VenfShEa1/wFv6kO0CXQ2vh5euOEy8PTQK+KSrD1BZ9fGU/1TnfxlwfGF5O6CMKM1p3cEBg== X-MS-Office365-Filtering-Correlation-Id: eff801c2-b77e-4acf-1244-08d47b2c4c31 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY2PR03MB287; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB287; 3:9uajJizUB1oVNKVY0d9T+c/lO08MUvO3MwlMNCfwlPoWn10PffT3IfUTTJe3oFyr2nd9fjOf1QtRqyBraSZSV/gF/R5SFzGZKzU3mZXh+03yWzH1IYiusg8FJpIXh6qr8xJfGYuYeB/yOl01ZFf6Hw5cpuOBoC22CIFdR3tt5d0c2d4PTKIH7IxC7cmdnQPHVLgIwmEyTXkO78X6pyj/3n5rtb1CrzNS9c60wwpQayhMqiQ0OpzxL1WOidIrjKougpTg4uzczG9ed/3+VYdHhT9vhTJyQ1xeuxm0vcn+r4Klox0McyASvc0zZIcBz+xH2ylMBvyLndR+IoSPQRVanh3bPZpbfhjGwjSPCmS4nearNSqYr+nwZYZ2/jFlfM915TJuTKngihGazPlyTvwvn7vvabFJ8FshVCnbGQ9FAG3w5Ud6bj8SQzre9XrGrghT; 25:6JfiHhuvp7HgE3PFqPwN5hOIQ+Es0hFDfaHt8TAn0PTQQHIPlv7tUKfRHqVWpZqXvkudieGOmfT72sf094t2gl0kz8YqKUD9jfVpXKngyHd9Yhk+afHZ7NhOORYVFNk2inn/jLvGe9vaFzYDqDfGzCTpiQyYCXCkX4Ef1+LjWWsT3hjMfDZzKSz43DrMk8LPas0zeV7ZZcAlWWkvQ/nPv17pqwVj6WkuXTuahJ3211A8CQSZV4VSQ0kAVNRBqdT4A1pRC++rtiYghuZuFqF142UBL+znHN7r1wCsLXwDm59cyURK8BIUiZZO640y4/T6xk3h3kkzbtiquYSTbUkHFnYnmOX0QSjwLhmUEzYrqsUmxONIBuO+whFKB+qSX4FLc5eiHxiFsmKm0wUd605ngi1LtCJJOZNOV5xotZh2cTFD/5kIkCuiF6YY+NGi6zBM/Fi3ZjSfsftOT4oKm86cVA== X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB287; 31:DLwzS7cw2xGpqeGJhhZWq2550OT0ESh7bIo/9IeCfqameuaMBW+I1EJcwtvTN1fcQvcRiT75kZgmUCQ6G/58Bp9e8Hw1fstWRQcEI5Khn0S52rwadnLa8QknEqwL118qWs8wvZWIBuuul6r6W9w7L6Rdwz+CqLkH9J8RybzQR36Ig0J75qHUMFjJlsuCNJMnxNv+UixOLSO2bA/k5QzFXf9rdrTO3Gen8Efrfvg7QubQi2KdkZ0GQUrmNXe9pmkSno4K2NiD3fmefCNg3ZKJNQ== 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)(13018025)(13024025)(13023025)(8121501046)(5005006)(13015025)(13017025)(93006095)(93001095)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703161259075)(20161123563025)(20161123561025)(20161123565025); SRVR:BY2PR03MB287; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB287; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB287; 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jYFWdeHlOgFCIki5PFoOwh9YD6e3bbrC04P?= =?Windows-1252?Q?PNBRNELn3jGRbbdvktFs8j4sLuowg/bIRDW6Y2HjtAOFJKpWvsZoB5nW?= =?Windows-1252?Q?RLMjWK9+wLdfYd0ay+IfzJDVv2uvdHhligS9OwFYtzEEgABijvKCMxWA?= =?Windows-1252?Q?ezTQC6lTMXSitAVID5DJBxKdagXnO50NaUkoCopsVRv5sMN9lZ9cebQ9?= =?Windows-1252?Q?ByGWbeU9f0JN7+11cW/n3fUCx6q/hsGYsFPzUjhV0r74Eq9M2Os7Diap?= =?Windows-1252?Q?9gp+GJ/RFD6faChNftr+IqQiR4V3j0e+kMkLJEoXVXB68srW2H0HQOcH?= =?Windows-1252?Q?YY3tv4xc2JqT1Q0RmdUgVgMxnaGsZyXKa6FBXq1Hr4qWaq6llKknFCMg?= =?Windows-1252?Q?DHpbk2f1DogKj5JnnEau8x+zpJpXQePz6VuNiVVun1mJ8tfWzWHWO6j9?= =?Windows-1252?Q?xF48ClQdMVpbdcLH80acxDJaVaIIl2dtKhYrMoPGP/0XyjbttYmoZLCz?= =?Windows-1252?Q?fE6W/2pR4YweNDyoOYMYyxc5b/N5/djBn/RJjxepm+PBj6RJkXHpqyB2?= =?Windows-1252?Q?QFdUfQus1TupUw7k6jDrH9wbwXfVKvwEFWWWRIj6SEtkafkIXp9YwxPx?= =?Windows-1252?Q?JxWI0tbmSESJmkfC7+pwKtHvhBVa6mu3Q6sh0v7XyP2kisM14HW9Kooa?= =?Windows-1252?Q?IUkxLof+kvYDeRO/S/10J4a2CZLFzCWA7/Iy6s3lgB9j4fN/zbDG+9s/?= =?Windows-1252?Q?sIW9yJK3AaEm5vBfg5FkPj/T0AUwQG7PkeQBuPV4YqIr7wb9XbLLj7ZF?= =?Windows-1252?Q?nUfbemFlRQx0gfs8xTZIgN5Ps17RmoEVYKe24qBrzdJY4TNeyB5L8+Oc?= =?Windows-1252?Q?qpTJPU7tRYpKYSDHDL2IXM45ArWDGWURoWDCJ2yHnOXMC7KBYtPllUjU?= =?Windows-1252?Q?EfMdZZq3LH1wRsyi9CV4J0bpYwEIEOUEL7uCi5u+AiFhFk7SSeY4XXLh?= =?Windows-1252?Q?bzep1s3VTj1hjIg16LnE4rZeIEzC8unAwn3O6IN3H8jftpFAHpHd00b3?= =?Windows-1252?Q?wWn/9UBy/OnZPVqofgfBG9y9vc1PaE2lRD1EdQJgl5Go4g4zRqMeR/ho?= =?Windows-1252?Q?M6WaZdcOURfzOa57rjpg4y5UZ1Ykcu2XJj/4ShesMh8e6SzaoyjkOgYs?= =?Windows-1252?Q?YCm9sC8jHUOp1UcHxCjAovh8lnNXlnIgztzNHfk/fOzrEP3rfAzTs4wQ?= =?Windows-1252?Q?2s3QXDECaOhKvueuYYuF+GvIc0sgmUlyPWDwyiR7qllUiByjIsrlIdPP?= =?Windows-1252?Q?IMBPvWUDPIvu/w4yUEPRTvYyol8uhP39bWluMT/+I8rrDL1xyyrnqzTT?= =?Windows-1252?Q?mnXra8GrjfHbJoL6Ea2YpJrasDcBXuiJi9RYn88cVFgB75l49awJqDFr?= =?Windows-1252?Q?YkzQwsIkE5KNNzFChdhkvo+yqbxTZ+lKVHHUU7GvA4Pu3oGBhp2TsIyk?= =?Windows-1252?Q?3Uldd+uQdE+T6N8z9p1nMkcXB+9+iyGvmAWKHgB6/UtCKZXKaOioCtwd?= =?Windows-1252?Q?OsyrRp/w9YQhEmkLmBkrlz94ZK1Mk6WqMD7OVOQuVaDGlQso9NJnmitF?= =?Windows-1252?Q?BAUIxkRkkR/9QzRzvKQZ/pRhA+2Mmks/hGWKsAh1MrMfTUTltKGFyJE+?= =?Windows-1252?Q?PxRDKdBXcN/XPX/Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB287; 6:tmgGnH8sidXOLdrNKBKAWe5ndt+PaRXu6JmHjjmas/g/wX58L8PbZ4t79OY/MVCwDHy7NbrkvHNj+svN7rct0IOpz+Q1uLC2Gow8tPC3IRoTN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07:29:15.1428 (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: BY2PR03MB287 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 07:29:19 -0000 Hi Thomas/Olivier, On 4/4/2017 12:28 PM, Thomas Monjalon wrote: > 2017-04-04 11:05, Hemant Agrawal: >> 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(). > > No you could have different HW mempools on one system. > Please imagine PCI NICs which provide a mempool. > (other argument: never say never ;) > Thanks. Good Advice :) >> 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. > > Is it difficult to store this pointer? > Yes! Something is workable here. PMD stores the "rte_mempool_ops_table" ops_index for dpaa2 (the default buffer pool). The mbuf contains the pool pointer, which will also have the pool->ops_index. so, it can be compared on per packet basis. Olivier, do you see any issue with above approach. >