From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E980FA0543 for ; Tue, 21 Jun 2022 10:13:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FF7B427E9; Tue, 21 Jun 2022 10:13:01 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2057.outbound.protection.outlook.com [40.107.243.57]) by mails.dpdk.org (Postfix) with ESMTP id 43C9E42802 for ; Tue, 21 Jun 2022 10:13:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZG7BkUzuoCnqm3Ilg5X1T78tNk/dE+Y3h4FJatR3Abir8R37Wf34l0F+xH/8lAcfP/13Xtz6C/ydjxdZD/72paENlEjPKRDmtY2L5NHKXKxjlqFOR2nyMBgk/ktRtt7yYXNnn36LnO3KeXSFP7TWf2AIsusDgZAP8qA/daw944T8c8g9B3yfyFsf3cr7CaBmXVsRYq6el9bLDbeFqwQr5DdtqDWng99swbsroBPQTwpvHeYuzi1RLFxs6iJbUj/mEUxpF8BZQiQQo01qUDZHwiflu46iqzKQDO3lIlUTlxEQNs0oZgEuSi85mpFH0eJrAkUwwAV+FV08OE/9TvFgmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=x5E391/2/5Jj2LHqXfl7dnplnraMwnuo/0Ouq+8vSME=; b=cOKaOtSICpfNAXQjwSQvbHiLelO2ys3ehlTGOpCZMnD0E12Vq2F2roJnPmrjxOhGFCRP3edgw/0Z9zYKmjyuPN0ohgn2G44BQwIM3jvqogmYrw2kIYr1dB5pky2V6UiopUfj59jRXbDELkjRxsq2ppkKT6458EKC/pY4I3G3purM/mjNV6jNrpOwRRAzasQroqUCkYeNXynpeyqiuVpxIVquieEFGsCcTjacoEf0bU/G6l2cAQGF75aaaw1WrB/Nc/X6rApPoe+n7SNYwJqdDRxh1Qiszt9zbUU6IFO1NBAVzIVe41FzB+E+DX702zkAce3JjAV5EOPOXXWFhdCkUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x5E391/2/5Jj2LHqXfl7dnplnraMwnuo/0Ouq+8vSME=; b=NQG/knqYkP8JFFAmpk3iM6KVHev/fi01Y3Ooaw/LKi5szXsbCPbEpzYJdapHiK3qAp+rKzYrZ8kYzaP+Zz1XobC44kaHwN4GOrxBKQiX+GJEEhQQqh2s/kMbDZTpfG2umy0dSTlI9O1O/7vkARm5jgud+u0FIXByS0Gua3P758ydboYtdM5utg09omaBFs2oY9amKml4al35xocaaU0l4iozKMONLXS9IQzpZ9qmKW0AW47Q30FGBIxzvjRK9ZUMxEr6Z79dI0UqWJa8ziC268CAUW/U02AGBv84szN/oTLNspcjZluX6ZT2HnrmlUKlXztUueePt/q/X06NzGffew== Received: from MW4PR03CA0359.namprd03.prod.outlook.com (2603:10b6:303:dc::34) by BN6PR1201MB2466.namprd12.prod.outlook.com (2603:10b6:404:b0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14; Tue, 21 Jun 2022 08:12:58 +0000 Received: from CO1NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dc:cafe::12) by MW4PR03CA0359.outlook.office365.com (2603:10b6:303:dc::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:12:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT048.mail.protection.outlook.com (10.13.175.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:12:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:12:57 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:12:55 -0700 From: Xueming Li To: Wei Huang CC: Tianfei Zhang , Rosen Xu , dpdk stable Subject: patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:58 +0300 Message-ID: <20220621080301.2315720-113-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc654245-cd4e-4b1a-bdf9-08da535dd9d8 X-MS-TrafficTypeDiagnostic: BN6PR1201MB2466:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aMZudExboqiZGmppGZbJItohi3BG8aFdV8jQPb83yv0aIXdityqN955zPDOa8t9v1W1SeoQMyMYBnPfCAtrU3Hraxl178KFDnRICRU03pjo1nTOCgLW1lczM7UBgHFfZ1TD7HKl4F9CsE+RUQ680F3FQlzNmzaoKT7KbMXtpzOwRURBdfDY4BYcfrda3J/sRa17GegC0zLnQjdyxlrmmA7efbSgUzX/ncJd+qJreAXWjv1xzp10cFfnwRs/ED5/uhNhDYaheKRVxTnhraV66ViKkLYvcWJpuy7FRoR5bCzfSvkLjWsYFUZF8u/UbTbfwP1ry+gJsi8zgSBka2wsQX6VDIyDgBoScQewq5SYAO6XYpmzYyO9uW/Q18innCHTvjgEgns5MLli+KMIcA4aaC284UZ3UuOwK4Zt+8BuH1xP+YSlFhlmaYArARHkjF/pGGLIgOSmQDl1m6UWlXjz49BK+eKKpSLdrm4tpmH0O2eLamYR/JIUUsxGPQXA+OBt0k0GEaOuzp9hJuVKkR3Eucto4K8KzabU0DOstRpZm54V2qGsEdglm3FhrarwogkvkYurj/1nnx2WudhBSOZWhDo+lZqLplR6ifz21J3/5mjcl2vDevTjY0UclhmkPpL6o/OXIu47KNO3v5vgtEjCiXM/mwljSzc91XXoZhjFzOiYqxizr+uEuyhTYATlBcNSNYkGhzKeaYx0dCyaCCRJfGqgoE/bhQnX/5yuiWw1pWBJ9T5QVefTtkNKxhW+YIdRlVs69bUq32takDETyfuXrBYtrkUYzoBXVMEpWlpieqSVGskfDJ0WQVwOxJZp1gPxhfh7NxirirJi5zvVyV12cmhphi2d9z+iaZswFyZ8Bgp0= X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(396003)(136003)(346002)(376002)(40470700004)(46966006)(36840700001)(356005)(7696005)(86362001)(26005)(2616005)(83380400001)(1076003)(47076005)(41300700001)(82740400003)(40460700003)(426003)(6286002)(16526019)(336012)(81166007)(186003)(53546011)(70586007)(40140700001)(8676002)(70206006)(6916009)(36860700001)(966005)(8936002)(82310400005)(55016003)(5660300002)(30864003)(316002)(36756003)(4326008)(2906002)(40480700001)(478600001)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:12:57.6864 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc654245-cd4e-4b1a-bdf9-08da535dd9d8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB2466 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/c9a4ddc1e848c4e1fcd6d928d7e8f715c0189f4f Thanks. Xueming Li --- >From c9a4ddc1e848c4e1fcd6d928d7e8f715c0189f4f Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Thu, 16 Jun 2022 23:38:21 -0400 Subject: [PATCH] raw/ifpga: remove virtual devices on close Cc: Xueming Li [ upstream commit ae835aba40349ee9631ef6b52e68a2893febe7e0 ] Virtual devices created on ifpga raw device will not be removed when ifpga device has closed. To avoid resource leak problem, this patch introduces an ifpga virtual device remove function, virtual devices will be destroyed after the ifpga raw device closed. Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver") Signed-off-by: Wei Huang Acked-by: Tianfei Zhang Reviewed-by: Rosen Xu --- drivers/raw/ifpga/ifpga_rawdev.c | 169 +++++++++++++++++++++++-------- drivers/raw/ifpga/ifpga_rawdev.h | 8 ++ 2 files changed, 136 insertions(+), 41 deletions(-) diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index 2d7f1af51d..ee6589ad01 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -135,6 +135,8 @@ ifpga_rawdev_allocate(struct rte_rawdev *rawdev) for (i = 0; i < IFPGA_MAX_IRQ; i++) dev->intr_handle[i] = NULL; dev->poll_enabled = 0; + for (i = 0; i < IFPGA_MAX_VDEV; i++) + dev->vdev_name[i] = NULL; return dev; } @@ -740,12 +742,20 @@ ifpga_rawdev_close(struct rte_rawdev *dev) struct ifpga_rawdev *ifpga_rdev = NULL; struct opae_adapter *adapter; struct opae_manager *mgr; - int ret = 0; + char *vdev_name = NULL; + int i, ret = 0; if (dev) { - ifpga_rdev = ifpga_rawdev_get(dev); - if (ifpga_rdev) + ifpga_rdev = ifpga_rawdev_get(dev); + if (ifpga_rdev) { + for (i = 0; i < IFPGA_MAX_VDEV; i++) { + vdev_name = ifpga_rdev->vdev_name[i]; + if (vdev_name) + rte_vdev_uninit(vdev_name); + } ifpga_monitor_stop_func(ifpga_rdev); + ifpga_rdev->rawdev = NULL; + } adapter = ifpga_rawdev_get_priv(dev); if (adapter) { mgr = opae_adapter_get_mgr(adapter); @@ -1637,9 +1647,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) if (ret) IFPGA_RAWDEV_PMD_DEBUG("Device cleanup failed"); - if (dev) - dev->rawdev = NULL; - return ret; } @@ -1696,75 +1703,118 @@ static int ifpga_rawdev_get_string_arg(const char *key __rte_unused, return 0; } + static int -ifpga_cfg_probe(struct rte_vdev_device *dev) +ifpga_vdev_parse_devargs(struct rte_devargs *devargs, + struct ifpga_vdev_args *args) { - struct rte_devargs *devargs; - struct rte_kvargs *kvlist = NULL; - struct rte_rawdev *rawdev = NULL; - struct ifpga_rawdev *ifpga_dev; - int port; + struct rte_kvargs *kvlist; char *name = NULL; - char dev_name[RTE_RAWDEV_NAME_MAX_LEN]; - int ret = -1; + int port = 0; + int ret = -EINVAL; - devargs = dev->device.devargs; + if (!devargs || !args) + return ret; kvlist = rte_kvargs_parse(devargs->args, valid_args); if (!kvlist) { - IFPGA_RAWDEV_PMD_LOG(ERR, "error when parsing param"); - goto end; + IFPGA_RAWDEV_PMD_ERR("error when parsing devargs"); + return ret; } if (rte_kvargs_count(kvlist, IFPGA_ARG_NAME) == 1) { if (rte_kvargs_process(kvlist, IFPGA_ARG_NAME, - &ifpga_rawdev_get_string_arg, - &name) < 0) { + &ifpga_rawdev_get_string_arg, &name) < 0) { IFPGA_RAWDEV_PMD_ERR("error to parse %s", - IFPGA_ARG_NAME); + IFPGA_ARG_NAME); goto end; + } else { + strlcpy(args->bdf, name, sizeof(args->bdf)); + rte_free(name); } } else { IFPGA_RAWDEV_PMD_ERR("arg %s is mandatory for ifpga bus", - IFPGA_ARG_NAME); + IFPGA_ARG_NAME); goto end; } if (rte_kvargs_count(kvlist, IFPGA_ARG_PORT) == 1) { - if (rte_kvargs_process(kvlist, - IFPGA_ARG_PORT, - &rte_ifpga_get_integer32_arg, - &port) < 0) { + if (rte_kvargs_process(kvlist, IFPGA_ARG_PORT, + &rte_ifpga_get_integer32_arg, &port) < 0) { IFPGA_RAWDEV_PMD_ERR("error to parse %s", IFPGA_ARG_PORT); goto end; + } else { + args->port = port; } } else { IFPGA_RAWDEV_PMD_ERR("arg %s is mandatory for ifpga bus", - IFPGA_ARG_PORT); + IFPGA_ARG_PORT); goto end; } + ret = 0; + +end: + if (kvlist) + rte_kvargs_free(kvlist); + + return ret; +} + +static int +ifpga_cfg_probe(struct rte_vdev_device *vdev) +{ + struct rte_rawdev *rawdev = NULL; + struct ifpga_rawdev *ifpga_dev; + struct ifpga_vdev_args args; + char dev_name[RTE_RAWDEV_NAME_MAX_LEN]; + const char *vdev_name = NULL; + int i, n, ret = 0; + + vdev_name = rte_vdev_device_name(vdev); + if (!vdev_name) + return -EINVAL; + + IFPGA_RAWDEV_PMD_INFO("probe ifpga virtual device %s", vdev_name); + + ret = ifpga_vdev_parse_devargs(vdev->device.devargs, &args); + if (ret) + return ret; + memset(dev_name, 0, sizeof(dev_name)); - snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", name); + snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", args.bdf); rawdev = rte_rawdev_pmd_get_named_dev(dev_name); if (!rawdev) - goto end; + return -ENODEV; ifpga_dev = ifpga_rawdev_get(rawdev); if (!ifpga_dev) - goto end; + return -ENODEV; - memset(dev_name, 0, sizeof(dev_name)); - snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s", - port, name); + for (i = 0; i < IFPGA_MAX_VDEV; i++) { + if (ifpga_dev->vdev_name[i] == NULL) { + n = strlen(vdev_name) + 1; + ifpga_dev->vdev_name[i] = rte_malloc(NULL, n, 0); + if (ifpga_dev->vdev_name[i] == NULL) + return -ENOMEM; + strlcpy(ifpga_dev->vdev_name[i], vdev_name, n); + break; + } + } + if (i >= IFPGA_MAX_VDEV) { + IFPGA_RAWDEV_PMD_ERR("Can't create more virtual device!"); + return -ENOENT; + } + + snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s", + args.port, args.bdf); ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME), - dev_name, devargs->args); -end: - if (kvlist) - rte_kvargs_free(kvlist); - if (name) - free(name); + dev_name, vdev->device.devargs->args); + if (ret) { + rte_free(ifpga_dev->vdev_name[i]); + ifpga_dev->vdev_name[i] = NULL; + } return ret; } @@ -1772,10 +1822,47 @@ end: static int ifpga_cfg_remove(struct rte_vdev_device *vdev) { - IFPGA_RAWDEV_PMD_INFO("Remove ifpga_cfg %p", - vdev); + struct rte_rawdev *rawdev = NULL; + struct ifpga_rawdev *ifpga_dev; + struct ifpga_vdev_args args; + char dev_name[RTE_RAWDEV_NAME_MAX_LEN]; + const char *vdev_name = NULL; + char *tmp_vdev = NULL; + int i, ret = 0; - return 0; + vdev_name = rte_vdev_device_name(vdev); + if (!vdev_name) + return -EINVAL; + + IFPGA_RAWDEV_PMD_INFO("remove ifpga virtual device %s", vdev_name); + + ret = ifpga_vdev_parse_devargs(vdev->device.devargs, &args); + if (ret) + return ret; + + memset(dev_name, 0, sizeof(dev_name)); + snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", args.bdf); + rawdev = rte_rawdev_pmd_get_named_dev(dev_name); + if (!rawdev) + return -ENODEV; + ifpga_dev = ifpga_rawdev_get(rawdev); + if (!ifpga_dev) + return -ENODEV; + + snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s", + args.port, args.bdf); + ret = rte_eal_hotplug_remove(RTE_STR(IFPGA_BUS_NAME), dev_name); + + for (i = 0; i < IFPGA_MAX_VDEV; i++) { + tmp_vdev = ifpga_dev->vdev_name[i]; + if (tmp_vdev && !strcmp(tmp_vdev, vdev_name)) { + free(tmp_vdev); + ifpga_dev->vdev_name[i] = NULL; + break; + } + } + + return ret; } static struct rte_vdev_driver ifpga_cfg_driver = { diff --git a/drivers/raw/ifpga/ifpga_rawdev.h b/drivers/raw/ifpga/ifpga_rawdev.h index b3c7295070..b4aaa15fda 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.h +++ b/drivers/raw/ifpga/ifpga_rawdev.h @@ -50,6 +50,7 @@ ifpga_rawdev_get_priv(const struct rte_rawdev *rawdev) #define IFPGA_RAWDEV_MSIX_IRQ_NUM 7 #define IFPGA_RAWDEV_NUM 32 +#define IFPGA_MAX_VDEV 4 #define IFPGA_MAX_IRQ 12 struct ifpga_rawdev { @@ -64,6 +65,13 @@ struct ifpga_rawdev { void *intr_handle[IFPGA_MAX_IRQ]; /* enable monitor thread poll device's sensors or not */ int poll_enabled; + /* name of virtual devices created on raw device */ + char *vdev_name[IFPGA_MAX_VDEV]; +}; + +struct ifpga_vdev_args { + char bdf[PCI_PRI_STR_SIZE]; + int port; }; struct ifpga_rawdev * -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:54.201821835 +0800 +++ 0112-raw-ifpga-remove-virtual-devices-on-close.patch 2022-06-21 15:37:49.237785294 +0800 @@ -1 +1 @@ -From ae835aba40349ee9631ef6b52e68a2893febe7e0 Mon Sep 17 00:00:00 2001 +From c9a4ddc1e848c4e1fcd6d928d7e8f715c0189f4f Mon Sep 17 00:00:00 2001 @@ -3 +3 @@ -Date: Tue, 7 Jun 2022 05:07:21 -0400 +Date: Thu, 16 Jun 2022 23:38:21 -0400 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit ae835aba40349ee9631ef6b52e68a2893febe7e0 ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -18 +20 @@ - drivers/raw/ifpga/ifpga_rawdev.c | 166 ++++++++++++++++++++++++------- + drivers/raw/ifpga/ifpga_rawdev.c | 169 +++++++++++++++++++++++-------- @@ -20 +22 @@ - 2 files changed, 138 insertions(+), 36 deletions(-) + 2 files changed, 136 insertions(+), 41 deletions(-) @@ -23 +25 @@ -index 6d4117c5e8..fe3fc43abe 100644 +index 2d7f1af51d..ee6589ad01 100644 @@ -26 +28 @@ -@@ -134,6 +134,8 @@ ifpga_rawdev_allocate(struct rte_rawdev *rawdev) +@@ -135,6 +135,8 @@ ifpga_rawdev_allocate(struct rte_rawdev *rawdev) @@ -35,5 +37,2 @@ -@@ -736,10 +738,22 @@ ifpga_rawdev_stop(struct rte_rawdev *dev) - static int - ifpga_rawdev_close(struct rte_rawdev *dev) - { -+ struct ifpga_rawdev *ifpga_rdev = NULL; +@@ -740,12 +742,20 @@ ifpga_rawdev_close(struct rte_rawdev *dev) + struct ifpga_rawdev *ifpga_rdev = NULL; @@ -40,0 +40,2 @@ + struct opae_manager *mgr; +- int ret = 0; @@ -42 +43 @@ -+ int i = 0; ++ int i, ret = 0; @@ -45 +46,2 @@ -- ifpga_monitor_stop_func(ifpga_rawdev_get(dev)); +- ifpga_rdev = ifpga_rawdev_get(dev); +- if (ifpga_rdev) @@ -53 +55 @@ -+ ifpga_monitor_stop_func(ifpga_rdev); + ifpga_monitor_stop_func(ifpga_rdev); @@ -58,5 +60,5 @@ - opae_adapter_destroy(adapter); -@@ -1638,8 +1652,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) - return -EINVAL; - } - dev = ifpga_rawdev_get(rawdev); + mgr = opae_adapter_get_mgr(adapter); +@@ -1637,9 +1647,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) + if (ret) + IFPGA_RAWDEV_PMD_DEBUG("Device cleanup failed"); + @@ -64,0 +67,3 @@ +- + return ret; + } @@ -66,3 +71 @@ - adapter = ifpga_rawdev_get_priv(rawdev); - if (!adapter) -@@ -1714,73 +1726,118 @@ static int ifpga_rawdev_get_string_arg(const char *key __rte_unused, +@@ -1696,75 +1703,118 @@ static int ifpga_rawdev_get_string_arg(const char *key __rte_unused, @@ -207,2 +210,4 @@ -- rte_kvargs_free(kvlist); -- free(name); +- if (kvlist) +- rte_kvargs_free(kvlist); +- if (name) +- free(name); @@ -217 +222 @@ -@@ -1788,10 +1845,47 @@ end: +@@ -1772,10 +1822,47 @@ end: @@ -269 +274 @@ -index 857b73463d..4c191190ca 100644 +index b3c7295070..b4aaa15fda 100644