Message ID | 1505559161-29222-28-git-send-email-hemant.agrawal@nxp.com |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1618514qgf; Sat, 16 Sep 2017 03:59:34 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAsflzkyzBXjcCS51i5oK8bOSxHSCR1Yzy2cBs/ggf0x0jnHh4PP5iTJFESoRczK2V5WM5A X-Received: by 10.28.203.196 with SMTP id b187mr5252237wmg.126.1505559574608; Sat, 16 Sep 2017 03:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505559574; cv=none; d=google.com; s=arc-20160816; b=aqVEdW+a87VuCQc6/85s/lITtOwiBUhhP1dWpLQbhul6/m81ly+yt/Zo/+bmqG+u+F F2npoK/jXgCMhN2DYOPXfm7HYpJM3N6/LVvr8w0taM/6ikTzETvF5sC67gQK0K7szq63 uhhglXLgV5Li1/cQhJIrpBDg47OM0B5nBLQVjm6zX/72ORyPLBq4L+VJ7Pzyzq0O96eZ WF5kdFnRD5HeR0tQ96gCwa6rXXhUAPL32uwLiDh1GJ4XLgz55J9qNiQziQMp4pwdADkM xMNmV4bKJS+FpKo3IMnkxN3zwUlLLYWIy2gB83YNk61/H49bepRXZXE3zFm0Z3ZFFF91 Il3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=D9yBFm4MYQ6IqXbdDSeWDWaikTR3C+aEs1zK7J75jkw=; b=lzFVyaDMha2uqwb89OGfgyraBoFnEwYAJXIlcSY9Mcuwx9llqqNyxHagEBJa6y4rYb 0tObtqJSJPQRxeWG8hw1j0oIGaPVX3WmneHsC+f2idKwwJ5/iQKmNrUHAtUUbqoDePA5 DZmBP20F5gwxtnU94pB0W9txsG4m4iOK18S+hvSxRYzrb9CS6+uYVqA0ZN5WRDS/Tzxe wMYngorO4QDtkjKwyKiRG2m/CLAgg3rmMAeqn9XMlFmjLDcSJeNpZKaAfuLTMgC96Fv0 eG8NvPlGkvUIitYY5XbRnhwPU7T5ikiESpFjm+xshYV/mXXcICG0oYUaUeEqUL3kiSxJ OKTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: <dev-bounces@dpdk.org> Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id e203si2575730wmd.102.2017.09.16.03.59.34; Sat, 16 Sep 2017 03:59:34 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C1D81B252; Sat, 16 Sep 2017 12:54:16 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0083.outbound.protection.outlook.com [104.47.34.83]) by dpdk.org (Postfix) with ESMTP id 6D52B1B1A9 for <dev@dpdk.org>; Sat, 16 Sep 2017 12:54:01 +0200 (CEST) Received: from CY1PR03CA0019.namprd03.prod.outlook.com (2603:10b6:600::29) by BN1PR0301MB0724.namprd03.prod.outlook.com (2a01:111:e400:4c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Sat, 16 Sep 2017 10:53:59 +0000 Received: from BL2FFO11FD052.protection.gbl (2a01:111:f400:7c09::162) by CY1PR03CA0019.outlook.office365.com (2603:10b6:600::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via Frontend Transport; Sat, 16 Sep 2017 10:53:59 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.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 BL2FFO11FD052.mail.protection.outlook.com (10.173.161.214) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Sat, 16 Sep 2017 10:53:58 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8GAr6vE028328; Sat, 16 Sep 2017 03:53:56 -0700 From: Hemant Agrawal <hemant.agrawal@nxp.com> To: <dev@dpdk.org> CC: <ferruh.yigit@intel.com>, <shreyansh.jain@nxp.com> Date: Sat, 16 Sep 2017 16:22:41 +0530 Message-ID: <1505559161-29222-28-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> References: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131500328385517707; (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)(39860400002)(346002)(376002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(498600001)(2906002)(5003940100001)(36756003)(68736007)(50986999)(104016004)(85426001)(189998001)(76176999)(50466002)(110136004)(6916009)(2950100002)(6666003)(4326008)(53936002)(47776003)(105606002)(106466001)(16586007)(2351001)(316002)(48376002)(77096006)(33646002)(8656003)(97736004)(356003)(305945005)(86362001)(50226002)(8936002)(8676002)(5660300001)(81166006)(81156014)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0724; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD052; 1:hg2lrWf3I6uhyrMJp92kjYNY8PmhSHy53QUwRySh2yCHm0sxHYlD1jlqY5wOqwCK8mBLlgwfDyNLtaFJ8Zpe+5nePTVuVYK2Swve1XBJIJYyHInw5bV0BkvxZD/vhgv5 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef2dc2ff-0ed7-4b82-b72b-08d4fcf13bb8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN1PR0301MB0724; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 3:+tmqYvkKQ8AZG6/+agJmP7TZX/kbf0cpIwNF3Ua1eydKJ7FXfRAk82haUABPjyTZ8tp2HDhOj/AMKTletXRZTYfC3Esn3bw+vzBUOU/t4Imxe5JCN7l/J39OEpNTF7kguzVRhkoMhaRCuV0Fpmu2BMw6c9ZMye00TjbWZijCQbNBavZuetcFUQDJgMHqPLIzHu7+wgKRJflffngHhrnvIV2jg/5lDKad2s6fbPmiHHWmyj+gcKYUNFNCLs8fhp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ZLhcSc61ote38E= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: <BN1PR0301MB0724210A7F787254AFFAE92F896D0@BN1PR0301MB0724.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(20161123556025)(20161123559100)(20161123565025)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN1PR0301MB0724; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN1PR0301MB0724; X-Forefront-PRVS: 0432A04947 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0724; 23:WKcwSgO7U0TjyP31WIaLNKq730qm03Lkkl5/j7a?= R8WyEpmDSPHUY3z3Y4wX54gJLEe5R1FndQWXFW7XxnBUMdFEbQeE42AqgcDz5/9m2dIo34YUrU9twdfY9gWx1L3hOrMUB3K4TK3XCbOQaxW97/gM0qLOUIhawOfHkV9jSAjQTmjX3eiPZK3h5v5I/DHvvbQMujniRdVqy5OB6W8f6V7DrUkiQUyLKu6Gh0D/MozaCoDhaNA7Zc4TXq2Z6ITbRZUx1BxzckYkl322I+yT1NNUA3ZZ4U0we2dL4cvj9SilOFVmMr9i3DJJ/SFVG3Qu2DYhDrd/e+sphrIyzGKHUpXRoN7NYi9c4SowemYsuTKMUbaJPG9V81i49aZCu0DwYK+s80fjjhigdsNxz4b2qJTEgN0TkQYBrvKs8oB4Zpy111RPwrmqLlL4pfhJuow0VMcdYnD96syUJWh1scEh15m5ESfOZfyw3+QYyz35D31NT2nZ5Q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Baw==; 5:Rr5+/IOo7RSwy/R5NfC6hM4NUh25c7fwomda68wWpn0cuuZ2LVrJm9OjMjuDOaXpKVKxz/9pE0rgTlp50Y+hW4MoOiPYheB0pc+3uW2dG1x3sUjVCUn5da+TqsL9pTNiwlk8MK/CUeFVggHr7po6i//l5DGJR+UN53nM8Vo8lCw=; 24:67/Yljs76D54HVrTbiWXp4TIKROiDNhx96MByeQfIQsQcrePGrnQBiWxvc5lvcJeRUai/PId1XlU6xhNXHBo1CNbILVgjB+ctmOHh7mOyRk=; 7:CCjVflawRRFURUlLT1YuzDE/q6zfV0Pqt+LD+WxoGvcknB1L3FZWzJn9jxvohg/UyCuN8P4lWVZlkNIaKm+CFmID3esVjtF+TgTSfSjMNt6eHXoLl6xWcOYc+Pw3Xxa3MkIYtjBIcBIlffdtLKIlvzVXyDPg+I8YsAA/XaXKLmTjWmc+jpOnGS/k33p8KyReReEcI0OCAGyy0XBK39bcy1CtuaroJJrMAcCap8mmNtc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2017 10:53:58.3801 (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: BN1PR0301MB0724 Subject: [dpdk-dev] [PATCH v3 27/27] bus/fslmc: add devices in sorted order X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
NXP DPAA2 PMD updates
|
expand
|
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index d50c303..0a8229f 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -66,6 +66,49 @@ cleanup_fslmc_device_list(void) } static int +compare_dpaa2_devname(struct rte_dpaa2_device *dev1, + struct rte_dpaa2_device *dev2) +{ + int comp; + + if (dev1->dev_type > dev2->dev_type) { + comp = 1; + } else if (dev1->dev_type < dev2->dev_type) { + comp = -1; + } else { + /* Check the ID as types match */ + if (dev1->object_id > dev2->object_id) + comp = 1; + else if (dev1->object_id < dev2->object_id) + comp = -1; + else + comp = 0; /* Duplicate device name */ + } + + return comp; +} + +static void +insert_in_device_list(struct rte_dpaa2_device *newdev) +{ + int comp, inserted = 0; + struct rte_dpaa2_device *dev = NULL; + struct rte_dpaa2_device *tdev = NULL; + + TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, tdev) { + comp = compare_dpaa2_devname(newdev, dev); + if (comp < 0) { + TAILQ_INSERT_BEFORE(dev, newdev, next); + inserted = 1; + break; + } + } + + if (!inserted) + TAILQ_INSERT_TAIL(&rte_fslmc_bus.device_list, newdev, next); +} + +static int scan_one_fslmc_device(char *dev_name) { char *dup_dev_name, *t_ptr; @@ -135,7 +178,7 @@ scan_one_fslmc_device(char *dev_name) } /* Add device in the fslmc device list */ - TAILQ_INSERT_TAIL(&rte_fslmc_bus.device_list, dev, next); + insert_in_device_list(dev); /* Don't need the duplicated device filesystem entry anymore */ if (dup_dev_name)