From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0085.outbound.protection.outlook.com [104.47.42.85]) by dpdk.org (Postfix) with ESMTP id ADE572BA1 for ; Thu, 8 Jun 2017 19:16:32 +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=r6vzryYBpGLHdwM7vza1nMTsXZsFyk6Vmthkiiu3Tp8=; b=ZpZ/8wY6OcQuGzohUDJGlbcplJwNU2CXXM9RpV7eEjHfGSkZN3tiCt3lIsgqpvEgHA/vK7wUqosoLhDI+0BuXGXu148rM3zj211qeJbSs4dUTt36Gsal2giCzwYTLVBiq+rqVhh6ibWeKrptCX+h7KT+LXWFiD4MFbGcNqSrTOs= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin (111.93.218.67) by BLUPR0701MB1716.namprd07.prod.outlook.com (10.163.85.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Thu, 8 Jun 2017 17:16:27 +0000 Date: Thu, 8 Jun 2017 22:45:58 +0530 From: Jerin Jacob To: Ferruh Yigit Cc: dev@dpdk.org, thomas@monjalon.net Message-ID: <20170608171557.GB15360@jerin> References: <20170601130530.11443-1-jerin.jacob@caviumnetworks.com> <20170608114414.8787-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0081.INDPRD01.PROD.OUTLOOK.COM (10.174.56.21) To BLUPR0701MB1716.namprd07.prod.outlook.com (10.163.85.142) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1716: X-MS-Office365-Filtering-Correlation-Id: 319c1cff-8ea4-4d81-a2a9-08d4ae921a3b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1716; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 3:feXUXk3gQxA3Sw3evpVFGBKRccFHQZG8lyr4Kgg9baGKWOKjFm+sHVk+myL6CyUOuyh4vm/lDRzF9YYekui2WdFrMZddUZAqKJF0iB02HtIBR8/RoyU4sr//dXtUZy6mMycXJTqMdJryo7bE4W6XV68L2z6GnHw7YtbdL9FOR0d8P6DzCm+j/b9N/jlkV/k9MxuLQnxhNEgw4lQ+of/6hLvPUizEXl9/mpqqbIkKxr3ZW4Ie/3l7PWxlQGWmQLmeqZqSpT6aynTPWvidRfdGf77+EPhJIJ67LKNDTMWk3/JPCMO6vnIy04oSu7elOuJSXU6UXLpbrNBtW1S93/Wfog==; 25:1waKzbGjqsNqME7EuACxnJqm1EHwa2bEEqj0idenjrZM0ouRyY0GOsNAsMXeUsUBxp4Ear/EYSHAMFmndT+zMJM39MfYB/EXOgRKAXJe7LSiXMWjsbt2mtAepIlIo5/N+caX4I6+nmDI20cf3VVo3uT+55zAOwiGwFnRqZgvO24ssniIbNrnM0JN7URmglfJkzIuXzUCb5A9cbB/WxtCHGQSqI9ymnskOS4vLha96SI2dz9T7lFAXbxL5rVJgTOkHcX3nmt7u75P8qcqczmyb+tgoVYglK6+GlOI562EOx8wenrcEg4rV0lBwCmDa/8V1+3OcrQzPTWeCsK/6J+dKKYhPVH/fTkTUFH7ByEDz0vLVvHRijxmqDcRdP3dCBaNNFhW62CrgvJOW4aFbgEEeqcKbwVvik56QxtJO84WTQzpARBi4QZSQvuKfmK0/ytJTLUbHjtYH312T/+EfpVgGAVH7t4UV0A3ujJ0kE4Ycos= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 31:H/hx5rABvc5jZ4lr0FZPPn/ajRFFSzmbRKcD5MKcdjQ4d/jrhU1eYegfl3fCd7krE7n0/d/zhSgkK+RmmdpncmALQPI+ynBNGEBEkGtUGQSHYbTU+qS7p1ubW1ak6WkbxpDJVjQG1np48flU+dN6vMkxuSkzO4Fh4zPJ+ve+QESyQw3tw8oplef25W+0cg8zinvJEPwUAe2FdYqKiz913MVzbvKIY1gy+jmaFibuAN3uNxDQbRNiOkX3Rmy9M/fZLYxQ+iNlzZfyAtuL9/0vXA==; 20:sSJ9vAipEAJDun1eVgRmJFLp9QDi2K+M46uksYckSnZnSMjP9TQTO6N8Udld5rkZzr7Prik1kl10JqirAZdNIMv6bS+hZoOmqVpvTOe6miK/9xvoyNa3eIVZwuuRjoAW0Tfa7+1dyYnqSmaLthkL6gshmr3aBS7uanXbhyQi8QckamxpnWSMaItzo7BlsYJ+xhO42APjj5d9GthSU9l81nNdBnHayFlN8+3HcEznEGTxgqdrZ0tsSAMTQfGgMD/SsYL052Pl0RIpaWwPhm/gYg6tkk3SS8hQQymMaObeMucTZmHYb35Qg0WnKDCLBHlkNwpUmpzGIbNPmy21Hv4ka0QGiy8scbG22hoHHL60nMx0QyC2Ma5HiKnWXfvAb+z5rW61uo0re2YE6ghQmPVfSFEQj/nHU5QSHlw/WRa1oEUj8PBsT9B+UUhh+XxL3vSi+erd2FXdvpjac8ByqedcOF5UYstZlhfBUm3/3Hy9M8W8p7Q3sh0lqU8/1al0FcS6Q3KzdY2sEq+J0A5B/i//29dsxoMys3O8/t7KogNhQBHOv/L6vmM1UMcYi9K+CnVax9A3sis9QHX+CbkJfyBzr/IfBz3LhMxS6ZNwyaELEaI= 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)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB1716; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB1716; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1716; 4:sU0OldpV2PbsSB5CbqgewudRf4HSjBEHF+J3NOeY?= =?us-ascii?Q?DAXAhadq+KkeSbz0gT2i4g5NV80yy+JTKTBxJTngZBsSKyO8T6GsrEdcFFQ1?= =?us-ascii?Q?wgXiPhUN993n5WJDRnbLcsieh7zggH1Ct7TYjOqZEZrpfo5vAGY5f3vFu0eJ?= =?us-ascii?Q?fZDrwED4kIRtVVj7vOSAn0wpHzdxBR05GmsdnxaptEwi2UdrAELGlJjOm6zP?= =?us-ascii?Q?n0Nxu4ZEN1oaFCArrDq4I9deJ92FuhCgMU5y+Dw+qfnGtqyGDQaaDjcRy+YG?= =?us-ascii?Q?XvJebkn/7Rt1E51c7cJDCsttAS/uT8/oPm52n5qwT4wTspGMp82Gb8FfpyjA?= =?us-ascii?Q?h7J/owcMy3uLif+HZg4+ASTO/CUdJjFgjHOUAPapeI6wPzCk3DJfgCXO9Qs+?= =?us-ascii?Q?QvLWj+NwnDmXH7+bXPaNWjq8LhVVcOk6KrJzEKxZz4nZCyGFjPvxcavsutkM?= =?us-ascii?Q?yXksMmBLcRRov2/lnkc3lnpRrYcukUejpy7+0zMnVkcdEJ2durR6uOGZ5bmJ?= =?us-ascii?Q?SqVaiXJLqrJWEVGaOvUNQMOkpifSrYSvDuM6vdyG3KkBLVE9TQSOWb6861wb?= =?us-ascii?Q?czdZBmbKiIM9tSIIFCQqx/R8jBerN6fivFG6agjT+rcCM6WHOj8H/LyVF+DB?= =?us-ascii?Q?Sg2lD3rC6TvAIcRG3EEMhyX45BEGA0AZumf+fYZThlIJShk9T8t0wvC7MxOQ?= =?us-ascii?Q?KrWAAQkW5K/5RoYA1BqyCeMVqvzpMdXavis/L8owLMelgywVpzgSNALKhPuW?= =?us-ascii?Q?BkTC9FcnnBftqfio3BlHFmqHZPGFZ4rl6HlSrduwWXGM7tDw0SIn4LUEitl3?= =?us-ascii?Q?JnkkrFKYWG3vfEnueT3HEJUCv2Lze2WwataSBpKQnAa6yJgeF8lZKXZ6CAVs?= =?us-ascii?Q?UwRUGzcfrF6j04+6fpUBEVygotkhbKe9Z1iDHEIQA2Uwhcp7YauwqwJJnAn4?= =?us-ascii?Q?BdaHMH3thmz9jteVix7JaXbtMgnwIw86+TrlFaszN+M8nk3AogQqrYKTUxFY?= =?us-ascii?Q?xHcIY+o3o5tvDrYCJHjv5tyRHqhlNi4LgQOchXg3K9jWhXEWD7HVk8M3UdIJ?= =?us-ascii?Q?kSXMpoS+WdV7ec4TB16HS7OnazPL9XwIc3MYcA36alFe34fSN+S9ljZTjM5t?= =?us-ascii?Q?kJV+7RtktmGhgGNZyKFUtnuq9kbLdGFkf+oMdXWqgejf0XAQC9Cv/Q=3D=3D?= X-Forefront-PRVS: 0332AACBC3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39850400002)(39410400002)(39840400002)(39450400003)(13464003)(377454003)(24454002)(8676002)(81166006)(4326008)(33656002)(6916009)(42186005)(6666003)(42882006)(2950100002)(1076002)(53546009)(25786009)(33716001)(23726003)(3846002)(305945005)(76176999)(54356999)(50986999)(7736002)(72206003)(47776003)(478600001)(66066001)(5009440100003)(2906002)(53936002)(229853002)(55016002)(5660300001)(110136004)(38730400002)(189998001)(9686003)(6496005)(6246003)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1716; H:jerin; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us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8mye4js7A28DxoFMYf?= =?us-ascii?Q?U/LqzTDgw28FIdJ/BcprHSJOg14rszbhah6mqRkYqBQGBZSekisa8c1tdk2D?= =?us-ascii?Q?kla8AulfjnWloICZq0EtT9VfV/B7RdJKIcVS18WHbJZPOyLpwDp7/JZw6mlB?= =?us-ascii?Q?MRwnDWtWAXpUy0RNpDNHOg0plK5NHeNsZpos1P0TVg1qgmYbFgy4TYHBhZe3?= =?us-ascii?Q?42qXEij4dAvc5T7jnZ/b8t0TwKUxckP5fGrYzheqejmrzCYAtEa6vHr8u1hz?= =?us-ascii?Q?x+CEX4GKEURcQyul5tHQHjUUTNp0InQU15/CLPBeoVW6q3sZaMerdorkz8fv?= =?us-ascii?Q?3frptZ9idDfuDqnY=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 6:A10hJRofRhu7sp0wsDtqz+GLflxH+g74qjbgks/528wMeI7lpRCC5ENG4ON54tn8gtRuVnAGX2sAz/6J924P6gbn19vU/AbapwHLbabZSd0tg34N4XZQC9D8JNFm94i1bNBY3hqalwx0OL5UDbuWhsQT3bWKWpH7d5eA8ZFjbdyf3Ph77TwiDpM9QgUjf9pF5cWf6oErlRpky3L5BeKh3Hz9yPuYnZB/pheZzgq9Rl4+O/rxlASxgh6LATLJp4tNn4MMAaUCWH1HVGBt7vCMq9GyFqCDKhdiPmCwsvkMBY3a2q6Bl3t+kzlMDixjIalBsMvWIu97NHm9YcPkT3XWm9PRbJXMpz4wROC3b/KArrn/G2UVUJkXeH1mb2kZmIkiKfJyr7Eh/a8cpOdYnWcd4T+O0qSPvjOhgcNbC8Bk10MYov9c9og4vs2chc1HWJ9WPvAmv4Mu/eUxRSB8EMN8HW7wMUr9PfVbIdb04DloZ43p+gEiSQb5A3wbVgaDQ/sTmDF5GI7KOPz/ehYxfy38aA== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 5:ZjQtdxQmiUidiUC/8uJp4vM+Eojgv3cCUigNV4IQakfdTa5l9u7mheDO8BNAzclgz2lCVctUs35ZniMy2PooMr28yLgyAAjIXtI9R57rhvChwvSq7vGht2cXqqM19bWPsc4JfjwkfcoOiivzb+v6+mwlWFChXWlManYV6hNFqRA3PIocz712NcwfSEvw2BMTv7z30W1xC3AIbFNlbL5MZcgV1L+Vxys1Flv8wZqzIbb4CTwbzlngF2qekOT/EEFm33Fmee9QX/nsd6yM/thLhu/6MbEGoiTWkFJci39B6rKDR+YUyBMMYfx5QNPODjMa/X4LvJB53J6EOghlnYGoXmx9SFVOQBkmHtPLemkbrbD2gSfviYGbu4YUxfz4J+HQFU1/MxX5x99Q/tcFEMeqiauelPdALbtSTzeU4oxG3SpxS90F2tR71Cc/i3ES8xS4MUkwozEWS6TRcmyCOU0N+cpfrwiNlAJ098RR1P83+uKjKZy5Pol7w0Ig2doL5dq1; 24:+LMxN5Tv1pk3HJSFYrchI3WLSB4vLlXluKMX9J5S+hwx91NY00f1ri4YehrD3mXaQgvfUwGdOtoFsiBmeif5JOzFvOFQQe5uAKfa1OkhjR0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 7:5gg/zvuM88N9D8+fYYZzoLv39EN8QT5lsYXTA5gGTUVUWebifqG/o2aTCxid2gnynLEGCY9vBW5BdRKRar4HcUWXlXXmalgxiQD6S4/TuQZBJFAIr5hKzHlIGyy8ybGjzPJ2OguQvgzy7QyYqQRh//+onLmyFWYjQJnZ4OlyIbdsaQ2O1gFER0GDyh3uqbmiOFNvI9MxCR9yrArf/8rYH1676CSeClq8tENCeOoUe0uhpZnmAM6RMfKfGgSxOmo4yUg3h3klWF7orjC/PrMF9XRST7MEp8u2x9s0uiIljLo9KedVSZYgAiB9AKTkYllBWArAtFQQ355rZlZ6OPXoUg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2017 17:16:27.8562 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1716 Subject: Re: [dpdk-dev] [PATCH v2 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: Thu, 08 Jun 2017 17:16:33 -0000 -----Original Message----- > Date: Thu, 8 Jun 2017 15:40:33 +0100 > From: Ferruh Yigit > To: Jerin Jacob , dev@dpdk.org > CC: thomas@monjalon.net > Subject: Re: [dpdk-dev] [PATCH v2 1/2] eal/pci: introduce a PCI driver flag > User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 > Thunderbird/52.1.1 > > On 6/8/2017 12:44 PM, Jerin Jacob wrote: > > 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. > > > > Signed-off-by: Jerin Jacob > > <...> > > > @@ -235,6 +240,7 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, > > static int > > rte_pci_detach_dev(struct rte_pci_device *dev) > > { > > + int ret = 0; > > struct rte_pci_addr *loc; > > struct rte_pci_driver *dr; > > > > @@ -251,13 +257,18 @@ rte_pci_detach_dev(struct rte_pci_device *dev) > > RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id, > > dev->id.device_id, dr->driver.name); > > > > - if (dr->remove && (dr->remove(dev) < 0)) > > - return -1; /* negative value is an error */ > > + if (dr->remove) { > > + ret = dr->remove(dev); > > + if (ret < 0) > > + return -1; /* negative value is an error */ > > + } > > > > /* clear driver structure */ > > 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 dev is unsupported and it needs mapped resources */ > > + !(ret > 0 && (dr->drv_flags & RTE_PCI_DRV_KEEP_MAPPED_RES))) > > Why it is required to keep mapping during detach? To keep symmetrical with other(on probe) unmap change. This will activated only when PMD returns the positive number on remove() so PMD has control over it. The existing use case, We cannot just detach a single VF(one SQS VF is _not_ one ethdev port i.e one ethdev port consists of multiple VFs) so we need control on when to unmap those BARs. > > > /* unmap resources for devices that use igb_uio */ > > rte_pci_unmap_device(dev); > > > > <...> >