From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0057.outbound.protection.outlook.com [104.47.32.57]) by dpdk.org (Postfix) with ESMTP id 531671B22C for ; Fri, 29 Sep 2017 12:16:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cmcwWeZg4aNtygaezGeTGL0/aKypXHbVlMRLYtsZ7aI=; b=hG4auVJro1izKINl+/fSP6fe6TfLsBcxfcBt+Nvgxt8iojjg+FrQhHu9RIp4vvyDRTlfTeINBTwFek8XxPnGzvxTrCAAN4baeoiK/F+tq2IXTHUj1dOSNz6horic5wYReGbjCMl61lGOGXQz7n8e7sBZk0BZPPJqiZ0Rge2l6XI= Received: from [10.200.53.183] (82.141.252.178) by DM5PR07MB3097.namprd07.prod.outlook.com (10.172.85.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 29 Sep 2017 10:16:23 +0000 To: Olivier MATZ References: <20170815080717.9413-1-santosh.shukla@caviumnetworks.com> <20170911151837.25092-1-santosh.shukla@caviumnetworks.com> <20170911151837.25092-3-santosh.shukla@caviumnetworks.com> <20170925073728.auchwn7mxx63b32j@platinum> <8b832367-e8fa-077a-1732-50627e977f9c@caviumnetworks.com> <20170929083242.a4arzpf2drfqyxpj@platinum> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: Date: Fri, 29 Sep 2017 11:16:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170929083242.a4arzpf2drfqyxpj@platinum> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [82.141.252.178] X-ClientProxiedBy: BN6PR1801CA0002.namprd18.prod.outlook.com (10.174.119.143) To DM5PR07MB3097.namprd07.prod.outlook.com (10.172.85.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31808f79-d2dc-4ceb-bd79-08d5072323e1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3097; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 3:w3XzcMXFCL5WxestfykbgjbmgvJBPfJF5fEjYUUQzQdVX+5QzJTolQNQHrDwtCN3gGzriO2mUJq7pXw46tf4rwlud9I7qcGgV0AvYhOin3VB+MqQIZdTreWLGrGoVTLvtC9CPzh8cnrv8P2hT68dQNISxsBZ6pekfR7SeodCNBAmgxU7T87F01oMLl0z9CgCj4X+BRXuF3PJ0k8mtf8KKtgvmq0leOiWXoNxuHqQom5pjzY6LAp1KypRpf5hwx5+; 25:6KCFvIinhquzwdcLIq5kO3F8mrLHHeq0SAIL3A8nHnJLXBCxWRSrcLKvuwZjCSLVzey8auzf0OOqxt64a+6Pur/WgbxNEKOHV+tncvDl5qHFBUfVPvWe3+4cGMfKPRPvJuYAOcPHOaJ+nuIA52kGE2zShBJYaAIFTIPsLOBoSAKqF+hEdsn/pLMvxgKL6uWjKZivNAuLZSvqCQEWI2NpMF6vDejw89GqwXyJUAs6gHuPFDuLkDn7cis8sZiNwREE989F95fiYFHkliDlGDfhIS/+ahzgnHwy+Ag92nYFSspGAktCPNwUjwQKr1rZ3lhfOvCw9pEgO15KOGDbC/WZHg==; 31:I4o3m2QL+hrddh2DnCZXZ66SX5Gw3JPkuFPC/s02cfEFhkNItihyhdXw61UJnXp6DbrbX4xGQgylzMNI+hF0LjC0uFTOdVs23Il4wnic8N2+NxaQv/sgODnt+BZBK/bDQMxW2lnqbSlu9Q2ad9QTyyUJHQkl/eykUEy5clumUVfRheQSBS5qKW8vZNl/RkBma9CbZdcxLH2Y/jA51/exVafpaT+Jp3JgpgazyxGI7fY= X-MS-TrafficTypeDiagnostic: DM5PR07MB3097: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 20:AWRHV/SVWJIGfz6FnqMKg9Z/l23L2pk8+YiYWg1RQ1OBOAC/iCUhKdUjLBHDR7H2FQEa864YUjJERZb/QRo0e86AdsJgHAaXnhjkxghAKVm4aU/KYh5OOgpFEWoF5Z31K34wjpo50oGMGo+eomzajPiACHG1c+LdeABJAvLYjDX3DBlJYt3JBwBmd8A/1wAP7Cqv135udnz5pc9GpVJEXQWCa79lVng0V7Hl4oS/GX5INTw1jUmLWbK9HSUyML3MNptnl/UL52u9ELk+IyP7iDi4uYL5t5VhB4H2+5Zk5lO7+5ToB3BCBx7BSJel3qJB/XC8OkciZHs/8Ki0mwF5UCsJq0IwsR7tGuGyWIBPILbBRLIJb7WdAb2hPsYJ1v44i5eqYZiJSPusM4Is8nDfZtzErYBrtoXGo/qFbNvTrKKj1Aum3TeZCIvyf0tqYZ/+G6BwclKnoEWRipJ3E3vWHIXWDjbkBUHokfdwSQ7qKj9H17CLveqwciPR79CLVospmaiL4navcJuSfaJLw6rFkJ7SIYejaFABNBTKj/AF4sP5zTOu5u2/420ZssvbzMAwiMeyGa4Qiuyxliyv1R8tkY+0giRFBKw9ikK511xjNw4=; 4:D48XlRDPG6HqIF8M4P39cjeg0lG7SW/QAD+NWCF5kmwIWe7qriWfm5eNKBtTXHfLQen45oKswt7CMpV/lnxkj+Wm032Ry80DGGYV6S2859CZSbs7zk1FjOQVj/uRG+ztL3XiuVlTH7xDCQRJiAenWd73yjzCDb/AYuHmi8C6bOZp0f7R+JtRzzoYVSc32MSpQLL8HdO0Ga4uFjPf4UCmKXpmCNE3O+Lnckom9ioXyfE9oPhFLUHuuiExu8A9uGiW X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(93006095)(10201501046)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3097; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3097; X-Forefront-PRVS: 0445A82F82 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(346002)(376002)(51444003)(377454003)(199003)(189002)(24454002)(101416001)(50986999)(65826007)(6486002)(81156014)(189998001)(76176999)(47776003)(54356999)(77096006)(5660300001)(229853002)(50466002)(2950100002)(86152003)(305945005)(316002)(65956001)(25786009)(16576012)(64126003)(83506001)(105586002)(23746002)(97736004)(42882006)(65806001)(66066001)(93886005)(6246003)(90366009)(4326008)(6916009)(33646002)(7736002)(58126008)(31696002)(36756003)(2906002)(478600001)(3846002)(31686004)(6116002)(230700001)(53936002)(68736007)(8656003)(81166006)(8676002)(106356001)(72206003)(8936002)(15583001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3097; H:[10.200.53.183]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DM5PR07MB3097; 23:UigMd1zAv2NxdaowgJrjXKE7TXh2X4o+8DH8/?= =?Windows-1252?Q?jp5PKDBQtXTLb4ingoRhR4rxEL4UXNjmF24ZeopdxR+TVCtEN/mjHMG5?= =?Windows-1252?Q?21yViOPnjj+6P1HBqbHzyQsmRjeDYP/V5nGlXfVtaqWwdjz3x8EbWgww?= =?Windows-1252?Q?4mEYImhN2k9NvjSgkIIU2NxBTo9juDmcA10+KEnAunJ/f1lWoxpLE9Kf?= =?Windows-1252?Q?cVSPkPXnVJvO3tZ209aOcOKkWsjJ9D+SNZdJVzaU8zpqacwFDHQg0eFv?= =?Windows-1252?Q?QDR1D+oJltsNj9g5k7xTYa5L3oYbqWmi3FpeT8nzklzL9dO0m2Mph4VA?= =?Windows-1252?Q?z52xxh34Gm7MWVEZ7WGtIybDlaMgj5ACYFHhJa+k7JFc3mSXq1YgwGkZ?= =?Windows-1252?Q?LrL+IqAFGxP3X1l57Lzta5COk8vD1AR50IyCxEs7Lp+HA+MVpMzHhiJy?= =?Windows-1252?Q?ulGValkPySEOzpNaQQjZ9VYRcCxOGHAVCk2O3Tq06P2J40mLnGxOsZEd?= =?Windows-1252?Q?Q+DbTaZOiaH2VbW8TTjh4sLonl+KRVmLJfku6cx41BtOS0w0BK5sKRt+?= =?Windows-1252?Q?cUlcGG0EC0pFm6avSWGfhnrpNrcLyGModzFq5EMAcdKVsFiir/ofoysd?= =?Windows-1252?Q?AdZs/T31s1MsRorWnH5AMGoQURlLbpLB9659ENBA582uPVB9HN37rKl8?= =?Windows-1252?Q?7ZOOWbZ4AWDU8DzfJ1h7xSSVdaxUc3mDCvpliYGfq5e5b3EhRuV1bI21?= =?Windows-1252?Q?Sa9bwWgYy3yAuxPo/Vtuy+gLoVAr1EzYwkOBcxc5unBYREG1gJ6b5J0A?= =?Windows-1252?Q?bbjxukl180bpKOK9KCCof6Sg6CTlrjT0NIumZomZkIcKF3Dgkqp6XNsF?= =?Windows-1252?Q?LDdhjOYVlmzLvywhje3r3ZMnG156ODUYZG/BMgBHkEMdLueHOIwXjZwN?= =?Windows-1252?Q?WXwAYO5Ofsw5ew4CvVKOh61Sc+vHhvbwWdMee3RsermgO+n3ljsC7a/T?= =?Windows-1252?Q?goDc7thyPO8WNWuJIgAT5pnZ2c0NLYubIwFOuIOMHOO/T4UfknCKYKNX?= =?Windows-1252?Q?TCz7eX+iLe29q0omrFJa/3ECQNjXNdUJajxKKQFFEaax828tjoUWHiFn?= =?Windows-1252?Q?4ZlaGHAwyVa+CJeJBYuFr5C8ffjIHKhJKeQnUzE+8Jq4KmYdyC0sSYL2?= =?Windows-1252?Q?eVwkZzRO42CKED355Z4DPBTMugUHUEj7oYstf/OgS+PtchgmOtmnP7Gu?= =?Windows-1252?Q?uD3R20/uDXBna/NWq3Gzhb3JowLI+tDDIIHLAhYEh8HJrwQQ4DyoaQBy?= =?Windows-1252?Q?1AJnT15N7KJ0SKQay2enLURY9MXihu/zArufRfDD+mRqSoVEJPFbutPO?= =?Windows-1252?Q?E69MyJS1O04X3z6Q34P1IAzLFwTSX/7xn044O6yIlzEPxXgFRoZfcoeT?= =?Windows-1252?Q?NbtcKrfEziQQ95MEwiFDKzKxQ/CJF8lck7ITxdYwQNwz3f493R1qaIAZ?= =?Windows-1252?Q?1JFhqKpdoeqK4P9djHADRUmtNTL6s+Tw0VATUDSbiGfM+ltvQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 6:JRqP+ZPFwpyn4fCkfKL9Oqq+rwRtkurSsEIMvWV5yD/WRT9HkAO4US84xeoPZv88dPgPONczCMApC5UVt7GdeZlGH2cpt5H6ve1sbUfTwWtdT3pYHouKdpCPX8O1tHgekENkoJ0IV6+CUD9qmCyL8YCk5PcWH5yHoY/IlxwUiLHLY6o0tJ3B6Gn93X1R1Dror1XtQiEZXhx2ARPIz8CU1NoYCtOW9za6DiA260Lii7X+E9w9YNdWICeuO+Wx5jPE2hz0/6aHl/MjefX/+rBCVYv9fm8rG/4PK2Z+KsbRfNAhMJqgZBlOfQfySPoY+So61yp9LCM/Cdjw1NkRmY2nSw==; 5:P8CUhjcfXvXSpg8+HqXD5NB9wc9lFR6dfqgd7sNXfFs/P1fh5VEgEy15qF1ZuIQWZbMw39cJhFdbNi4fjBvd+OMVDt9bIZw4GCaHahjvl8qLuvvF8M34PrBMyJOKTZwQ8toSh594MQHCLN5HD/lY8A==; 24:e9BEKVzos3LEQlXMwiyeoIlLlrTfB4qZ3dKAF8w2W6iy4rumeUJWm8ZUczyBqAyE4wMXa6MGsJwC4ua7R69bHGYnGULnPaUVVid384Abid0=; 7:jGM6HhC88G5O9eDxE6goFmoJvBOMvQiC/gOzbCc4z/C0YSM3tFC/SZWRzwFAzn3s6xA+uO92DfIc90+Vw5J66DnIhWzRC6czahuFlG2JwztbP/235a5Wwtj02BShalqz2/FNQ64JgMDGJN7kCLeAKDur0S417ZeG59yI+M/7xElUi7sGYXWrvh3l38NbX8U0FKzIRUdLrEi4+iuXm2wq9NMVZL8/L7m18r1e4xJZOsI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2017 10:16:23.9883 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3097 Subject: Re: [dpdk-dev] [PATCH v4 2/2] ethdev: get the supported pools for a port 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: Fri, 29 Sep 2017 10:16:27 -0000 Hi Olivier, On Friday 29 September 2017 09:32 AM, Olivier MATZ wrote: > On Mon, Sep 25, 2017 at 10:52:31PM +0100, santosh wrote: >> Hi Olivier, >> >> >> On Monday 25 September 2017 08:37 AM, Olivier MATZ wrote: >> >>>> +{ >>>> + struct rte_eth_dev *dev; >>>> + const char *tmp; >>>> + >>>> + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >>>> + >>>> + if (pool == NULL) >>>> + return -EINVAL; >>>> + >>>> + dev = &rte_eth_devices[port_id]; >>>> + >>>> + if (*dev->dev_ops->pools_ops_supported == NULL) { >>>> + tmp = rte_eal_mbuf_default_mempool_ops(); >>>> + if (!strcmp(tmp, pool)) >>>> + return 0; >>>> + else >>>> + return -ENOTSUP; >>> I don't understand why we are comparing with >>> rte_eal_mbuf_default_mempool_ops(). >>> >>> It means that the result of the function would be influenced >>> by the parameter given by the user. >> But that will be only for ops not supported case and in that case, >> function _must_ make sure that if inputted param is _default_ops_name >> then function should return ops supported correct info (whether >> returning '0' : Best ops or '1': ops does support >> , this part is arguable.. meaning One can say that default_ops ='handle-name' is best possible handle Or >> one of handle which platform supports). >> >>> I think that a PMD that does not implement ->pools_ops_supported >>> should always return 1 (mempool is supported). > I don't agree. > The result of this API (mempool ops supported or not by a PMD) > should not depend on what user asks for. > >> Return 1 says: PMD support this ops.. >> >> So if ops is not supported and func returns with 1, then which ops application will use? >> If that ops is default_ops.. then How application will distinguish when to use default ops or >> param ops?.. as because in both cases func will return with value 1. >> >> The approach in the patch takes care of that condition and func will return -ENOTSUP >> if (ops not support || inputted param not matching with default ops) otherwise will return >> 0 or 1. >> >> At application side; >> For error case: In case of -ENOTSUP, its upto application to use _default_ops or exit. >> For good case: 0 or 1 case, func gaurantee that handle is either best handle for pool or pool supports >> that handle.. However in your suggestion if ops not supported case returns 1 then application is not >> sure which ops to use.. default_ops Or input ops given to func. >> >> make sense? > My proposition is: > > - what a PMD returns does not depend on used parameter: > - 0: best support > - 1: support > - -ENOTSUP: not supported > > - if a PMD does not implement the _ops_supported() API, assume all pools > are supported (returns 1) If API returns 1 for PMD does not implement _ops_supported() case, then do we really need -ENOTSUP? If so then in which case API will return -ENOTSUP error, wondering. > - if the user does not pass a specific mempool ops, the application asks > the PMDs, finds the best mempool ops, and use it. This could even be > done in rte_pktmbuf_pool_create() as discussed at the summit. Right. > - if the user passes a specific mempool ops, we don't need to call the > _ops_supported() api, we just try to use this pool. > > > The _ops_supported() returns a property of a PMD, in my opinion it > should not be impacted by a user argument. > Thanks.