From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0044.outbound.protection.outlook.com [104.47.40.44]) by dpdk.org (Postfix) with ESMTP id 5E9042B9A for ; Fri, 29 Sep 2017 07:00: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=yk6VXnDqJzRtO36NcO8pX9pO8bpknp4saHL76Ai9D6E=; b=UwhkfytWs4phLIBewaUbPneHawwMTGNTm/XLlIjYI4gJ7/RVtH2e8KVsSiQBm+hgZ+s6QhCA3Ft8VVf9rmQck06sPBg0kCV4EAm9kAiIQGHXyiDTSGFpUQw7m/BNdnvJ7ttInyL4QDVxxV24IT26Jn8arc66kG4Ie09UKjHJlss= Received: from [192.168.88.32] (31.216.236.195) by MWHPR07MB3102.namprd07.prod.outlook.com (10.172.95.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 05:00:22 +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> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: <385a9723-9831-e5c0-6d4a-ecd69d0f34e3@caviumnetworks.com> Date: Fri, 29 Sep 2017 06:00:13 +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: <8b832367-e8fa-077a-1732-50627e977f9c@caviumnetworks.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [31.216.236.195] X-ClientProxiedBy: DB6PR0802CA0037.eurprd08.prod.outlook.com (10.172.252.151) To MWHPR07MB3102.namprd07.prod.outlook.com (10.172.95.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 47da8f24-3256-4195-f017-08d506f6fe3a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR07MB3102; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3102; 3:yJLd1Bcof06KSEPaykuQU4R6fZoOdakOa1fSBl8yy6/6H3+a30N1gL9whNERt/CzRr5AlOSC0deKJvtkqdU0zpwS7uz0mTfzANatz9L7EXSVw7vwt1xhE41FugDK9YsCl6WwBu3C3EiODaNlQWn+S5TQi718JBKIxwXzrZyTPF2piZcmVnLP073lg5dxaWO1CsuKfaI9P9egk1HCPm4Mw8oEuYJYlef7DGwejBtTB89+lpPuUvRqbdemmzragVb2; 25:XW+2LyEzBu7tX73TGzFT5uavrxxujJfzFnOnlgO3JmhSh71ZnKAkBit6ZdkbwkywUUiFf/GSWx16BK1a1QtrDC10b+dySKJnEcrAuiXFuE6EHOV6rk+9zC/yad10Vyl3cZwb9n3dbF45BbVYWR7+olqVGJHby96G2Dj5jliCwvxjLWhhbphlJ35+N9U5M2Ej7ubFUG+XHRsfy/VGpHiLQ0hZXtfL7vYbX/hkgITuAFsS12e95cTwLorCHQWS2YeoiPKGsLaJFsvtKN3BAyxioeRoptH5lIDjXe5hrXEoE5PvwpZl+LIDqNbmGZE2/QZOWyuit5MzShnqQgTGh9Kzow==; 31:ENkH3a/SdGx4CyyauDfINNS7wJ0tvbaVY9KaFI9tkCkp+6Teu/sUzd3LWi0K1GtFpqS63danrHNZAtqnNdfyu6XpvzBAYs4aZI6gnBDKsoMd6amTQm/EvArp7nhmxI2Aalhr/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an:; 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)(93006095)(100000703101)(100105400095)(3002001)(6041248)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3102; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3102; X-Forefront-PRVS: 0445A82F82 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(376002)(346002)(189002)(199003)(377454003)(51444003)(24454002)(105586002)(6666003)(64126003)(2906002)(90366009)(189998001)(305945005)(77096006)(6486002)(7736002)(31686004)(106356001)(81166006)(42882006)(65826007)(33646002)(229853002)(230700001)(8936002)(5660300001)(31696002)(6916009)(81156014)(50466002)(6116002)(3846002)(8656003)(2950100002)(117156002)(101416001)(50986999)(53936002)(76176999)(6246003)(47776003)(83506001)(25786009)(68736007)(65956001)(65806001)(66066001)(54356999)(93886005)(36756003)(16526017)(478600001)(16576012)(8676002)(4326008)(23746002)(86152003)(58126008)(72206003)(97736004)(316002)(15583001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3102; H:[192.168.88.32]; 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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR07MB3102; 23:UdWvSPVWCBy7KOpEIIRU+jqh5aI6UE0ar/azI?= =?Windows-1252?Q?bDlQerhucTmb8Ir3R45oQX942SrVQ8SSyPjmc29azVcSwUOWF6d5g+OO?= =?Windows-1252?Q?MzWfDIvVVeeibfCOaPEXvB5wJ0m48Ch53WVo9iqYjMHTjBQ8/UWHgrjo?= =?Windows-1252?Q?9dNRn8+1P+sRwakmsDzT9d3GV6gvvgqgt5jyoeDiZJyCLcy1af/NhLQN?= =?Windows-1252?Q?uAPF1P88K21NE7YUKB45TwrcRlr6l6BNvmTiFRpqreaxIwaNsFoc9o2x?= =?Windows-1252?Q?85bo+ZS7HThQ/Ez0TG7A4PqhyQOIIZTG4l724KBp+u4kua+df+2mCSIK?= =?Windows-1252?Q?2w9kslbaoFD+9Qwpmw0wDckKv7Wy0lh2ttFCz9RqD+ZTHlqtrmI78w1N?= =?Windows-1252?Q?3ysnMJc9Lx3z+0kTY1CcyE/2uxYrlgbp+bRouIx8hPOVg6PUMb+8OtHq?= =?Windows-1252?Q?5D2sIXuDRpRMSCs0OYXkSvrZhTFP55vflNAYWKLYKyqqYBmCONY8aIea?= =?Windows-1252?Q?jyE6bQlw26V9V5JEq4ZLkzQdJarTFPNCwS3bwiC2y0P30TnvFfgJlcQN?= =?Windows-1252?Q?jl8nJc9WCxv5KqsV33fvcm38ZTcVjbqTbW6vv9G+JsfGAO44zKBDIe3e?= =?Windows-1252?Q?hsn+yFRgaY7SU18PHpeEaKlhsCBkq66bsVzkc5wC46u5XOGXr/hzBWqW?= =?Windows-1252?Q?PhNN/jGblbNjPzL+aH2qUPJImf1KH205HMPZWapQL/UlVPFVjwJQZq7Y?= =?Windows-1252?Q?c5keC+6mdCrufzwMyol26JVKiSCZTOWCB9vkQnklL6CA6v+nKj2f+rdg?= =?Windows-1252?Q?mZpwxobcBLdm4ko9mQeeEMH7QZNLTWxpW+53UbZd1J4GWTOiTWtiWT1o?= =?Windows-1252?Q?C+cFBun/RP6J0iW4/ViCy7Q65viwKyJNSMDwX1RQBKhvMCmybdbxQuz7?= =?Windows-1252?Q?SlnhwfZW1xrTyEvlkU1Ugk26rAb4AHqXhyzlKrMpwpncZb8kGwjOKHJF?= =?Windows-1252?Q?VqoldhtmDiHBwc6e6e9p7zURhfYlPNTIznrRhFhBK2GowPGg1I5hLwHv?= =?Windows-1252?Q?16DnfAIMMrq9rdQxR0m4eyNpfmZTuf5p13ijvnzG2j91SmlmNr/44bYP?= =?Windows-1252?Q?hjwmvnRBqzAc19BttW9xt768FQUnsN+DM75HseofPqE/u+HJeCYlVmm1?= =?Windows-1252?Q?xbTCq69TMkPhCr1sHjEhMlryyxugLGfkwJ5hkdYspZnrCAHxUVfe5cve?= =?Windows-1252?Q?/BauqnXVFpT+qRh9IGUEChenn7khs1oJbRBT6IeWZfjLXk1c0Z56CIO8?= =?Windows-1252?Q?/HO0TQW1KnY46QAPzu5ZwCoCjQwI0rd7jjZtiQBZktFFenK3qpryAoVW?= =?Windows-1252?Q?2XMlQYQseagoHKlMaW/WVdr1aNvY3WojHOd1j7ePjDTKHcHRK7LmN1f+?= =?Windows-1252?Q?IyMmdoSami2UFXlUk3OYfjMyRdh+46ZCaynA7GX4gbrZnAqizmQB/bLl?= =?Windows-1252?Q?2hshyKCManGU5NP8PEFR1Z0+CaYsoMmciV6JVXMn2L8UxTiQe7Zvs5Z6?= =?Windows-1252?Q?QS4zdKXZAvbNXBAag786PUSiVBm1tVKJtNohYRx4Ys4r7CVMMOfbIzBi?= =?Windows-1252?B?UT09?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3102; 6:uS987hXwjUfYRe2hfU7h6ZfzKjfEQAHaKwGJkotqjwdghCz2frS5vtO3sc1/5GyIMw7R27u9ScoIbrGGGy5TmTn/J3pcDoVGW6RxYjfqrRznbPxlB4woZ/V6Cr7qbvGc2naRt298uqFCvDXbGdUz9+MjzZbPGKYuKfA57HVspdwS7YjBHK/QGGVgn7X/YvsuRrZn84ZFij8BQK3I+zKNbLmy3fpS7upH0xf2Z494GDRq8kkHR0/eKujJ1E24hPMrZPeIG46SbAIoM1NE5A7xSQXnDfB9ZRnvSnZlOBw6H0uwKh8BZ6Z03fn1HagNKAagejn/WM240XUpUYqwG/XLVg==; 5:Pr7DcZYX7mEb8rNUJM5EyzO3ORPwijnWRAoew/3XTqihobvYORqfcl4BhmkT/IJ6ZGapmcy2Q/S8gCdtXQ5oolMQTUgcZVTeSfKAQ7c+2hWnK1Y2B5V0lzSbH3IDjQsmwT+nGs8dGUa7wZOLIk+C/4rJbax2RPbgcXfntyXi370=; 24:mFrtPqbFu5KTacrLaOwXBn1bY72o4LgWKyL2S0UcHSWRcM5qO8aZ9S2gCQPBiN+uZlOsbl5JBEMaMX2vLfItU47VRbSFEJfiuLUfziZo7cY=; 7:yVByFJNEysToFwBPUUaJsyNn3mGrcjVoJrvoBEWYMxvArOIDbbAoS82iAbOlBOyFoWPhEnpIXRQGxXWAs18Sn2y5XHkXQX0rFDTWaT0NfdVjnUE2pFMFeAUwrBfIVgN35ko96SFjl6bt26DVotwnyGrWiVDwrNdy5sE0cHXaBGN7UXhH9rXCRPgKLgeo2ZkhBWVSf6Z9SkQ7EfgfOmOjGLHUhnzTngx/Ezn1E/XTbAY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2017 05:00:22.9165 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3102 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 05:00:27 -0000 Hi Olivier, On Monday 25 September 2017 10:52 PM, 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). > 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? Ping? Are you fine with said explanation if not then would you share your thought in case if ops not supported returns simply 1 if then how application differentiate whether to use default_ops Or inputted param ops.. as return value 1 holds true for both cases, so how application will pick and choose which ops to use? Can we pl. close on this? need to send v5 for -rc1 release. Thanks.