From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id C72137F30 for ; Tue, 4 Nov 2014 04:37:07 +0100 (CET) Received: by mail-pd0-f182.google.com with SMTP id fp1so12884677pdb.27 for ; Mon, 03 Nov 2014 19:46:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GUQnbP7MJFvG9pOeHzaPfBYWD1Suza5NtmLhFyebhKY=; b=kZeybNnHJC9NtIsmCcgCQ4dq0X9zbXUHRf0Olt3dcY45F0gM/CvzX5SPfA3lg9u5qi WH7r+UVGBXXnK35DUDxCTS9EKVjKgEUDmuaTf9jvVwaDNl57AZTI4PUXS95Gbf9ObAtI mgKLMZJeXVh4HFcFfHgCOq0x+vLJAe9oac/BDLP5fWugTRh6BVDoExylTo/rutHoxlPi Jxmx4a1hLEexEbpiPtJDTfStbjKo8/YE9u+cxuqR9P9BHC/HJLRbkaeNX2us4VOV95La 3yA6Kq5FTSx/q2z7TS9KmaphNBfDdGy+bhFjf+F6P2tMcWHzRD7ohRtDOV7RPqAbyFek hSPw== X-Gm-Message-State: ALoCoQks+fsgwrTXx7NYdh3CJ5K4Ar4BnrbYT94k2cpYEl8GSSS+dbSPVJqS6FqdG8Lew+BBcsFE X-Received: by 10.66.161.3 with SMTP id xo3mr5531368pab.131.1415072783947; Mon, 03 Nov 2014 19:46:23 -0800 (PST) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id jc3sm18430580pbb.49.2014.11.03.19.46.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Nov 2014 19:46:23 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Tue, 4 Nov 2014 12:45:25 +0900 Message-Id: <1415072748-31937-6-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415072748-31937-1-git-send-email-mukawa@igel.co.jp> References: <1414572576-21371-1-git-send-email-mukawa@igel.co.jp> <1415072748-31937-1-git-send-email-mukawa@igel.co.jp> Cc: nakajima.yoshihiro@lab.ntt.co.jp, masutani.hitoshi@lab.ntt.co.jp Subject: [dpdk-dev] [RFC PATCH v2 05/28] eal, ethdev: Add function pointer for closing a device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 03:37:09 -0000 The patch adds function pointer to rte_pci_driver and eth_driver structure. These function pointers are used when ports are detached. Signed-off-by: Tetsuya Mukawa --- lib/librte_eal/common/include/rte_pci.h | 7 +++++++ lib/librte_ether/rte_ethdev.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index fe374a8..74720d1 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -181,12 +181,19 @@ struct rte_pci_driver; typedef int (pci_devinit_t)(struct rte_pci_driver *, struct rte_pci_device *); /** + * Shutdown function for the driver called during hotplugging. + */ +typedef int (pci_devshutdown_t)( + struct rte_pci_driver *, struct rte_pci_device *); + +/** * A structure describing a PCI driver. */ struct rte_pci_driver { TAILQ_ENTRY(rte_pci_driver) next; /**< Next in list. */ const char *name; /**< Driver name. */ pci_devinit_t *devinit; /**< Device init. function. */ + pci_devshutdown_t *devshutdown; /**< Device shutdown function. */ struct rte_pci_id *id_table; /**< ID table, NULL terminated. */ uint32_t drv_flags; /**< Flags contolling handling of device. */ }; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index dfaeaee..99cc8ce 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1676,6 +1676,9 @@ struct eth_driver; typedef int (*eth_dev_init_t)(struct eth_driver *eth_drv, struct rte_eth_dev *eth_dev); +typedef int (*eth_dev_shutdown_t)(struct eth_driver *eth_drv, + struct rte_eth_dev *eth_dev); + /** * @internal * The structure associated with a PMD Ethernet driver. @@ -1692,6 +1695,7 @@ typedef int (*eth_dev_init_t)(struct eth_driver *eth_drv, struct eth_driver { struct rte_pci_driver pci_drv; /**< The PMD is also a PCI driver. */ eth_dev_init_t eth_dev_init; /**< Device init function. */ + eth_dev_shutdown_t eth_dev_shutdown;/**< Device shutdown function. */ unsigned int dev_private_size; /**< Size of device private data. */ }; -- 1.9.1