From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0082.outbound.protection.outlook.com [104.47.42.82]) by dpdk.org (Postfix) with ESMTP id C6A002BB8 for ; Fri, 9 Jun 2017 12:28:16 +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=aErJ/Hwqx+isfRrWXwgfM3+u45uSVkflqRAmbni9tU0=; b=Jg1vAa4Y3qLzrOjiGd/GVz+ZSIKQgKNHyzfTL2yETcti8AVt5JivAXxYDaYkfq37w3MHKQ1rOJISqitD3TQSN3F6b4xfPLl5RCI+IelGXDVV0G8vCHqdYnE2HA4OXflb1wO4FWOu8x6VFF81NQAZTpvQrkjzvdPtbx8Db8iD53E= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Fri, 9 Jun 2017 10:28:09 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, Jerin Jacob Date: Fri, 9 Jun 2017 15:57:45 +0530 Message-Id: <20170609102746.13828-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170608114414.8787-1-jerin.jacob@caviumnetworks.com> References: <20170608114414.8787-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1714: X-MS-Office365-Filtering-Correlation-Id: 82f744d0-8e82-4e32-94c7-08d4af223a59 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:iMWUp7gp2p4Pxsk08IL0Vomfuy8OL6QRMge8uDQiPHBq/s63qFErnvPyhhohpBmHuQkPGKCKdjdQW4EWduzSHmJsB4sRSMl6WYpuCSUGRyAi2bBdkKGgOgE3yvb4VuW9uahobFZKtZdtWX0whGGt0SQi0v47/gVe3SUEfUPbY7gmo/NP9MqdaBfmlDqKYUC4Y1KjyTP4nGCCtP0Pa578Sfl9q9NAd2J+VSoJhmtva2nMaHLAS0m61d307kC34mjeIf4tl67iXDcK1l91WiPN7pdFqyGMMznQdkqrlqXLDWrXyWxQGnhPMMYE5aF0n5Puda73GvgOb4T7RY64dUmigw==; 25:JSEJ1IWaY0+19grW+ye8hLtrpU+BVlBmWB3G74lo2FnRc+GoDYUTT9h/J+16KmQtBcFhrEzC1InVBIANq9r6QOOVGaYRi8lq2XeGnupYfABtxVezwJVQ5AyML+TdqayUykjHs26dEEe+UU7Fiv7b1W/SnTM4ago0385KHcbampry3Mqg3+ZIXgJBzHcmqA8ijsSXR+eVjUWSpEBjDkB7vQN6k9IXKlgKQvfyxIk91NJt/PROAmMnGUnaZnI18zlxq5YX8L5Rst8viXsm4NOAqKOPMK/IBx4XQJETbL0JlKu11LLmorjgFiLqxqoS3WyaejRwWdgmyI5VJD9HzAeynLy8w3FabA/emd20Ky81qz34ZM1CPp0PpkZCLXsT3ifQcYn2TvBiurdMy+zbABgVOOTDiNQG9egKw7H2VYhlHuskb25USf/uYZkQ5X8RBTmMZ8nzLqzr6Ez8T7xO90bkG7/G0BSANMAJDj5sVnZvaGg= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:TSU3Ay3x4u64FlVVtEpg7adaH8n4TssdDJHXOqLeVUTgiBmvzthUcpYvnMCOLnKrE1mqPetqPikYm5XKjYuW1dfPqUCdQJu07RiOEV20rPd2lT7puadyON3DbMyRAkvXSA8kgov3eX3CPnSpkAqAOWWksFyQNw/K8isUhjAtNUNvhKvZJVHvRdYzpWNQzwPz7l4XyzlU8FVr/fuGrVCrzzEfmx1mbsgMsi6PWtvXKJY=; 20:Q+/+6dbF/eoeqDzOi8l23QL2LNK9JkfxXVoVl6ekmmIyGCa6yU1azjkHLH/ZxNBJUYBPiqhRVsROn9ZemZHpkD8x5Vdyb4OtWRUTEBkfCz/bU5MXkU6mP2rpoDZqDpWBQKBanJwhscsEfZVjljlySjg6YKY2dCD4pRjuufNQ5lw9wfce+XVW1eoHGxMpk1scNuU8m/+Gt4ZQo9/Igc71MC9t4kz4SgSeB1a2JpPRB3MWw1kvWgoNw7noPfcqtq4R1hMTwhh4ZvagXhDEDcwJit+B9sApSBSQMzjCXjtZFJ7TGngvRtExDvEb+dIglDPaWGWimTlGS5+CmY6rOew/4wRORIAzXcGpbOgTIU0+kcD4hgrYF0SR8jWuUvh0cr9LR+SIIumnEO2fsko5vByuyAo9kMyYzMr9GFhpkz0/6jmWiqgP7Fmlf3+x4h9MtW9/WFED6/wEZT+KTMliiFdeiuM+wLzu6sUbrMFS+vCG+J9sdhLsqbkX3PepaYQ9FWUM2JjpLDbcv7SlXBKkz+IcHcgIvHYpspPR7vzeocMxYLQO29GZzuS1eMWzk5LWg8O53rzOWyUtoDWHzsr2g0miE5GqKVBqTrbAvdZ3fvhLx3A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(6041248)(20161123564025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 4:MG4ssDaUi2/Y6VEh2DbOw6QHPNcA5Fiv2O4LAp7U?= =?us-ascii?Q?z2KCDiezBdQvgs4VyhTMVofEEe92qt7D/SARIvDqog/LAm0LtpmeRt1rtro8?= =?us-ascii?Q?8V0NJwYut4F1SlrRCvf36biDwFljqYuoHgZVD4x3Xfg7FvVPRqWvMVpU3ms2?= =?us-ascii?Q?foY+e+P2BdqamkMr0taFDI8Es+QFl/Me2BynjcCmClywBjbKLa3yMWWSfaiB?= =?us-ascii?Q?9dhY61QDmpKtYb/5IL+HhqqKNX22OXlc9yegPQjr6ZGiFFraAwKmSrjZpdHZ?= =?us-ascii?Q?xIon72Y4NMQeeC7AXTP4iQnThwatC83NhBUjOhHK1buLynrJ+4KcdQiApPTd?= =?us-ascii?Q?GDBZbn02lZptegWNpRhsLToG/ZuVC5rXrr0/xH+UCboCC1xBgyCnDogJ7nmw?= =?us-ascii?Q?xNXwaORyDUvJlg15APXtDi2KHgmZARIZewF/I/i5ZYogKVIaztGiUvJv9rnn?= =?us-ascii?Q?xm06XdgMFdUjW9BoLbsxWhtXcTm1v3W7+F+zvofIxDAJ3mg1HOXcuZT5pERo?= =?us-ascii?Q?7xK1kpT3vAWe3Zx9er5cojcAWSnpDNUPxHB/AtQWNkNSOmR5zZC4kOKc7yLC?= =?us-ascii?Q?GKlwWDn/pS/CLaddnHLV45wRTbZDgr4LVA3Pszz8psgf5icjzKMBWZ/ECOgX?= =?us-ascii?Q?vf9Ftl6+WJxBE1fz64BZgcaorpyMLz6i8Z+aZ0XlcDp0s+ML8d45ZZb0c/1s?= =?us-ascii?Q?FdZ4AU1i6bUK9iPnx96DWxkNl/oQCqmxSCzrV+p0+ejh1JHwInRRtvIJGn2N?= =?us-ascii?Q?T9qSjINmuLLGBwobxyFE2OmjPbTQTWAEcWKWfDz6o4Ul7i3WOakPHgUvaEz3?= =?us-ascii?Q?Y6xe7tdAhyENHJPc0O48zJE6BzZY1UqDZCuu9ZYGpErcpGgki5u5R5Ni5R6s?= =?us-ascii?Q?LLRJ/1iEVikvsGEul1ZWThSCorpbs9iJEwgCLOlcMuqJqIcwN5Hy5F6z974Z?= =?us-ascii?Q?KpHP0y19rAWo+7BmCdXnrWkCj3IzkreOhT2Z1v4a2xpNMGjUB5/9k9C4BO2H?= =?us-ascii?Q?87Jne1FiUVYHmW+7tHHVD0rQOGcYM/0q5MG0k3bcbM+7lNPL1P5M48Tw1llj?= =?us-ascii?Q?BXIRMVxolxCcIPtAgIytzbuzhnEBsHrZbkECdsS13d5Xz0uINBAhR2VABiU+?= =?us-ascii?Q?xPQ4ZMpzrOwLHAeIh/diM4go+oIh8mFyCuJjw/t+cWR+4OLH1HzV1A=3D=3D?= X-Forefront-PRVS: 03333C607F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(53416004)(53376002)(38730400002)(107886003)(42186005)(36756003)(3846002)(8676002)(110136004)(48376002)(1076002)(33646002)(81166006)(47776003)(66066001)(6916009)(5660300001)(6666003)(53936002)(42882006)(5003940100001)(6512007)(2906002)(6306002)(7736002)(72206003)(2361001)(76176999)(50226002)(50986999)(2950100002)(25786009)(5009440100003)(6486002)(2351001)(966005)(6506006)(189998001)(4326008)(478600001)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:jerin.caveonetworks.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;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UoqTpIyqS2wKxh5XRe59xlOxv40aG3ceL5jD+tA6vAlmzrKRwm5UsIDENW680B6Q3WYOliY4SBXydoZjRNUbVox2b6eDBasJNbGjR2XKbI+GMjcF4BNRrwubU0141HEbJ5St2xZRztgxQHjTvm/AuxheZLWCM+kvafCz+otIwMQqKwMbXtSawr//k7BNFBEzy4yKO2mZQtOQhvXbJbKZURbrgOzUWJJIzg3I9wsFn/SNaZQr9t6R9UPdXwWAabdk1+/NFrGxNG+YEoks/N21xryyzx9ANZHnrgkvSzuOX1P4ezOBEWLYjHgtxzBFv56uCJcV2I+VT5Y+gO6ywbUHJrItrJFp0rEBcdgD4qtGfllXRLVB8WLaPWJSPXe330Q9mmPP1zc324iiz+26j9T6E6vyRBtreVSnZsBHFOsikoMWBlH2Bh+uEnoZwsw2cSrxtUqsup2xKLi1w+SZn1M2153fMVA8PvThbe0ApVz; 24:hTsbwqj1KFqrSimV8q6QAxerHZadIWI94zN0QJOtHKWg0p1zaHGbmhnx8qCOQuM0nUozWdWqqxMgU9KdWPXLv+d6yQ/lkPtR/IoE23LD9ck= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:DmJ5vdNn6YZsuVNTkSG4508RlH0YscepkZQNkW0ZqQ4eKf4lyA6ON9Qfzke/h57k2ToSxNRZb/2trZPqrVSwJ1s4Cjgh7ila19Ruyp+WGaIs6aKYQJ6c8Mh3lXQk0CHVkhqFJ1Hxn7s77MooOKrPEP4x7QGmEGB0lNzI46Hg4tJNhyLLT+Apd1CU47Qs6xEUdqOiUSYAW/lWOM3kHIhafVbW2Q0pXAdScYHnyNo9pF2rZEWn5mqSHY6kyKTLsh4fmb16hi77FG144wZWciEp/u4HvulS/qXg5Wt+o0A9limNbndpKrVjC+0OxWwIieJpvE3Ce2w5eR1GZNhjz9UEWg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2017 10:28:09.5811 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH v3 1/2] eal/pci: introduce a PCI driver flag 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, 09 Jun 2017 10:28:17 -0000 Some ethdev devices like nicvf thunderx PMD need special treatment for Secondary queue set(SQS) PCIe VF devices, where, it expects to not unmap or free the memory without registering the ethdev subsystem. Introducing a new RTE_PCI_DRV_KEEP_MAPPED_RES PCI driver flag to request PCI subsystem to not unmap the mapped PCI resources(PCI BAR address) if unsupported device detected. Suggested-by: Ferruh Yigit Signed-off-by: Jerin Jacob --- v3: Remove the use of RTE_PCI_DRV_KEEP_MAPPED_RES in detach()(Ferruh) http://dpdk.org/ml/archives/dev/2017-June/067691.html v2: Introduced RTE_PCI_DRV_KEEP_MAPPED_RES flag scheme(Ferruh), Based on the discussion in the following thread. http://dpdk.org/ml/archives/dev/2017-June/067091.html --- lib/librte_eal/common/eal_common_pci.c | 7 ++++++- lib/librte_eal/common/include/rte_pci.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 5ae520186..78b097e61 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -221,7 +221,12 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, ret = dr->probe(dr, dev); if (ret) { dev->driver = NULL; - if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) + if ((dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) && + /* Don't unmap if device is unsupported and + * driver needs mapped resources. + */ + !(ret > 0 && + (dr->drv_flags & RTE_PCI_DRV_KEEP_MAPPED_RES))) rte_pci_unmap_device(dev); } diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index b82ab9e79..0284a6208 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -212,6 +212,8 @@ struct rte_pci_bus { #define RTE_PCI_DRV_INTR_LSC 0x0008 /** Device driver supports device removal interrupt */ #define RTE_PCI_DRV_INTR_RMV 0x0010 +/** Device driver needs to keep mapped resources if unsupported dev detected */ +#define RTE_PCI_DRV_KEEP_MAPPED_RES 0x0020 /** * A structure describing a PCI mapping. -- 2.13.1