From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0042.outbound.protection.outlook.com [104.47.42.42]) by dpdk.org (Postfix) with ESMTP id 72756397D for ; Fri, 29 Sep 2017 13:31:15 +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=i4WM5HVs61tfeSgQ7mhCTLayNo3qxbNkv/kMKrUGcmU=; b=a4cTrZW7puuGlVNHh0Ysi3ZMGQ2Zntr0B2ASUqRekAbzUdZL/m0sYuZTek3XQsTApevqzPC2krenv0FEgvrQo6VFZffwjnZeynBfaAMlRynU99dw+O3ZLyBHP1gwUZf3mqLleILH+ayr606rRkG+47l/yVEOa+d6XPlw+QYsjq4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [10.200.53.183] (82.141.252.178) by DM5PR07MB3098.namprd07.prod.outlook.com (10.172.85.8) 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 11:31:11 +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> <20170929112324.5etpxbgif2pbh7pp@platinum> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: <75420f37-2901-9782-5e95-a2257b176ed4@caviumnetworks.com> Date: Fri, 29 Sep 2017 12:31:07 +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: <20170929112324.5etpxbgif2pbh7pp@platinum> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [82.141.252.178] X-ClientProxiedBy: MWHPR13CA0013.namprd13.prod.outlook.com (10.169.208.23) To DM5PR07MB3098.namprd07.prod.outlook.com (10.172.85.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4465aedd-3b54-409e-e555-08d5072d971a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3098; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 3:HwJlNxaZgyWAh+t/TCIANSMKFh8Riou2++5x6xupzb2WJHTaoZ+rlOEKU2om9uYdorE5TGqawLXuG7LnJeK97Av+Do1ZhyZZfT7Njg88/MtVe8XtFzdMMRSYx8vl2R8McqyUVAMGwhOicaftABgUM+Epg6TnYvboOPxJpf+6pPe8Ua3Z7vwisnJ44IQDu5qX270xnL0pO0koIG3htqCLL4vX3riPM4A83kogzYWkvMvb7j3Xw5wmOEdAFD3lbR2+; 25:nDs1ht+GyTMQzrt9Ew6WANVermNio8o+dnU/zFZXpjnzDPANO+u2PhQKiAu63376Om6mR2GgpdUGrSYJFllgkGoYrtUcrzOITSbus115ry+w2sf3DlGWTCBOzQYpkubWTE1j6ebu5Sr6MrX5EIsGnMTy1Yvnd9kaynmNoAzkncebcSkRD7byKSf3bzlv0QfP7bvMi5WUBZvAA+D9vyT2d1uORmJvl9Fl56s9OfUpdK13QIqu4WjKzQ4H/Cxrvt8F3/a8ln7MvKzZ2WCIZ3NxWaZpOsziq5h49ktRS3AzPzyqeW9WC5uOn3/qB8BgSwktlByVDNaL1VS2GQIf+bAg3g==; 31:3xE9jyXrOUba2pipXxfiW9GKe7SnNm8b9XotFVEyl2inw3C5+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8mZUNc2GZ+Xzoka2rRSuZ/97hc7ZuTXaoc513ZrmipjOCtsEUf 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)(5005006)(8121501046)(10201501046)(3002001)(93006095)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3098; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3098; X-Forefront-PRVS: 0445A82F82 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(376002)(346002)(189002)(51444003)(24454002)(199003)(377454003)(90366009)(189998001)(16576012)(76176999)(316002)(36756003)(93886005)(106356001)(50986999)(81166006)(58126008)(72206003)(81156014)(64126003)(8676002)(478600001)(50466002)(68736007)(31696002)(23746002)(65826007)(8936002)(5660300001)(54356999)(2950100002)(8656003)(6916009)(42882006)(2906002)(31686004)(83506001)(65806001)(65956001)(47776003)(66066001)(230700001)(3846002)(4326008)(6116002)(105586002)(229853002)(25786009)(97736004)(101416001)(53936002)(305945005)(86152003)(33646002)(6246003)(6666003)(6486002)(7736002)(77096006)(15583001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3098; H:[10.200.53.183]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; DM5PR07MB3098; 23:s2831hIZkZEuQ1JAZNBn10q2DXHxy1hrSsJFw?= =?Windows-1252?Q?ywXHcHdlf//I2PHiBU6946ciAt2M2THz+PA6iqjbUciQesewB/rz5mOm?= =?Windows-1252?Q?eT4hb1y8zNgdO6RTjso1GJck5Wht5gkaltDchBEopRFaMi75TOlvx51T?= =?Windows-1252?Q?cNYQWx/VAiEwFp045GPFbEuGSmIJyi4DjyPDbawdkLX1Wj3dgX6v8QWx?= =?Windows-1252?Q?nqu0nsimjv2sq4n4sRurZPmP2ewkTLJfKNRddUlTfg3dXjMq6h/xCUjH?= =?Windows-1252?Q?X/gUBXUd2G+waUhtc3Ab8PSqmGDcNflA8jtkTbcqsIjI2eEFiX77Z7Ct?= =?Windows-1252?Q?FJS1N0Y3+tVCMR1GzOz/xvmHcQXABS2nQ7JtxaMH/KNKjZRBWr0NvyxO?= =?Windows-1252?Q?toqT/farjx4BCqeLTgHJHqzQIUthvGPm3sHJ2dy4tNsuXd9zFEuaMpyb?= =?Windows-1252?Q?1/pGLUC9+FRndGQ2knvWPOr07Na+RV5pTPELmyq6SHV8D8/bU/rd2ClD?= =?Windows-1252?Q?/wgo61qgaD/dVRsYQVdKtFaWg7n/FsErlcWpl/n6YwlFCCmzres72PQh?= =?Windows-1252?Q?IRPiMsDQNKezNUWi7MFh1KDOOXr1v7lcBFVAhnl7EYHIcOBOkFgUd9EW?= =?Windows-1252?Q?Cg4wHTtvpiTytT2vD47XgSx2UvxDqOIbwFaX/Qv9jtaQQKrMCy15K48F?= =?Windows-1252?Q?7SQbk25PLu+Sb1BhbXfM0EnCVtnN1jGtpxYC95wRfP3GL9mRbAOEWCiZ?= =?Windows-1252?Q?T85MCJ9OlMXCDEH4CGPytTLPdKjsr57YAMyixV3UGQ+dnkBAQKin+KuJ?= =?Windows-1252?Q?FJTolBz2PoCci0zuaFBN0QPqlXZK81wBEHUOVMosyDPMEJdzb8/Erki0?= =?Windows-1252?Q?9gsKvwSYzcNj/i04jOyfHMRSNx8EVYabavmiQYQ/aMhZ2TYUATPO8tUU?= =?Windows-1252?Q?m0/eCozcPkDqA4dPeOnzvfzcvk2NQN33yXrGtDkIDQVujXydBJC+wQ/9?= =?Windows-1252?Q?6TIBsIS1F/KjYQjavoU5LwTMgR+rMOA6CL1V9m0YW27XN76Y3nCwjPT+?= =?Windows-1252?Q?fqhY99z+7Ug3lD1DPNZbnRkwdEbV5lHj+0hcOEH3x7BWpbSCkb/co2gg?= =?Windows-1252?Q?42WXV/GTy7ID6cMMyNYldoYoLSXf/AUHDscazD3k8P7fYw6GSsG7DJLc?= =?Windows-1252?Q?dufKbNYfuSUUFaAx/6xp0wtN3rp2L20uQjg0Kib5eXyUD5jawl7GuFHz?= =?Windows-1252?Q?dVskfQ0TdOLJe8JxR4d+/YoNojP3tSBC9YOKZ1U376mRFXoi1J7HQpel?= =?Windows-1252?Q?W8oEsZM8W50tUc4Snu3JarTy0l3AnGHgwQGEl76Jilj0qC3sMDb4R63+?= =?Windows-1252?Q?cO2IzwCBS4HeJsI+tHTELnX78PI1/5QFE1FopmZUiLeIQ/qZV+tkieC4?= =?Windows-1252?Q?jrvtGgC41zDvA+gFiKoq0TwF4SJ/ikUqo07E2OClCjHMlYSzr+uW9Dp8?= =?Windows-1252?Q?ghHWSu52QZhuvdkOQnz7kl9XtqIsUUbf+Xy8dAhMgQNn60QrjHYQ58/W?= =?Windows-1252?Q?h6eAbA4bG954b0=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 6:5D/jZy8ULln5jvmHtKu2sKDFG8qgT0IPtyxpUEKM3uRHZRjN3WOMKZrDVi2I8JXzxwVPbWnyviDR89AjW93HFkAlP6ZxbZdLgEce7KcqRlZiKJrcTPstFM1RaDqQ9kSpyPB/sFpHrOpqJzsufZqx4tS12H1nPv99/1Fyvv5bFOtZnSyd/HF/jwNhnkWCCbivVjslDNpNF0jIU3u7jvRF6hjLBRCb1J4IUeZNNOXJErJ1H4AyUgV+G26XrMXN76QVUzmQYk3FUV7OnxfOdPt4cjKeUgDmrPbf9klCZP0Q8bhTnRYXYOoFrHenieVHIRzUHfpQnsUWXZu8bgcIqSEGiw==; 5:HwHd9fuUE5Af/5ZkCxMYZa6MzqXKVd5HOPqeFbNhIMI6uAc2U7u8Lpb/EEey1fzgvj4ZxcojfIFriu6xOiHZjE4T4GP2ow0Vhcy3UjdgWjnMtnz4lXy2Yh7LqYUUdy8aB3uuXHn1carNCiLt7lxNuEoSJQj4UWjWkXW25F7fK2w=; 24:J/B9FDqh/KqSto70f1pJW2oYJcVHYPvHOuN1QoCJxxUXPlOe3qkYbl0R50QNbJZPc8L5Igw+EwnJ0v7Djaalk8jhQiRKVOQgNU2XfSJU6Pc=; 7:FwkxshIKEA7Nz4k5H4lQQNirpZdfDoWBKDzPqhTOAaIQY31n6tsaNQUWbyRCoCz7B6up/oFMFL34JxUEOnt/wYyOoYkpXBa6oLoUc7B8xS/LmPUemjCvnXY+QdJAwnEmcRXvBYkwmMFpSquJW94kMF5W5Sy1JEZoqlsjg96zQQXKqHF3GUpstpYLlgJPFgaM+yOvyoBElurGBxJBpKbbgmGssFo6Vo4nqZ77GpEYYxM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2017 11:31:11.8150 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3098 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 11:31:16 -0000 On Friday 29 September 2017 12:23 PM, Olivier MATZ wrote: > On Fri, Sep 29, 2017 at 11:16:20AM +0100, santosh wrote: >> 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? > When the PMD explicitly does not support a mempool ops. > > Not implementing the API means, like today: "I don't care what > the mempool ops is, so I a priori support all the ones available, > without preference". > More confusing to me. If PMD does not implement mempool_ops then if (_ops_supported() == NULL) return 1; /// per your proposition. so I don't see why we need -ENOTSUP error code in API?