From patchwork Mon Dec 22 16:47:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 2130 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 731DD9619; Mon, 22 Dec 2014 17:47:30 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1AD3D960B for ; Mon, 22 Dec 2014 17:47:27 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 22 Dec 2014 08:47:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,624,1413270000"; d="scan'208";a="651713960" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 22 Dec 2014 08:47:25 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id sBMGlOnx003534; Mon, 22 Dec 2014 16:47:24 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id sBMGlOTW004896; Mon, 22 Dec 2014 16:47:24 GMT Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id sBMGlOLk004892; Mon, 22 Dec 2014 16:47:24 GMT From: Bruce Richardson To: dev@dpdk.org Date: Mon, 22 Dec 2014 16:47:22 +0000 Message-Id: <1419266844-4848-2-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> References: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH RFC 1/3] ethdev: rename callbacks field to intr_cbs 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The callbacks member of the rte_eth_dev structure has been renamed to intr_cbs to make it clear that it refers to callbacks from NIC interrupts. This then allows us to add other types of callbacks to the structure without ambiguity. Signed-off-by: Bruce Richardson --- app/test/virtual_pmd.c | 2 +- lib/librte_ether/rte_ethdev.c | 12 ++++++------ lib/librte_ether/rte_ethdev.h | 2 +- lib/librte_pmd_bond/rte_eth_bond_api.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index ade6cb0..8845ba8 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -576,7 +576,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, eth_dev->data->nb_rx_queues = (uint16_t)1; eth_dev->data->nb_tx_queues = (uint16_t)1; - TAILQ_INIT(&(eth_dev->callbacks)); + TAILQ_INIT(&(eth_dev->intr_cbs)); eth_dev->data->dev_link.link_status = 0; eth_dev->data->dev_link.link_speed = ETH_LINK_SPEED_10000; diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 95f2ceb..87a5323 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -265,7 +265,7 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv, eth_dev->data->rx_mbuf_alloc_failed = 0; /* init user callbacks */ - TAILQ_INIT(&(eth_dev->callbacks)); + TAILQ_INIT(&(eth_dev->intr_cbs)); /* * Set the default MTU. @@ -2697,7 +2697,7 @@ rte_eth_dev_callback_register(uint8_t port_id, dev = &rte_eth_devices[port_id]; rte_spinlock_lock(&rte_eth_dev_cb_lock); - TAILQ_FOREACH(user_cb, &(dev->callbacks), next) { + TAILQ_FOREACH(user_cb, &(dev->intr_cbs), next) { if (user_cb->cb_fn == cb_fn && user_cb->cb_arg == cb_arg && user_cb->event == event) { @@ -2711,7 +2711,7 @@ rte_eth_dev_callback_register(uint8_t port_id, user_cb->cb_fn = cb_fn; user_cb->cb_arg = cb_arg; user_cb->event = event; - TAILQ_INSERT_TAIL(&(dev->callbacks), user_cb, next); + TAILQ_INSERT_TAIL(&(dev->intr_cbs), user_cb, next); } rte_spinlock_unlock(&rte_eth_dev_cb_lock); @@ -2738,7 +2738,7 @@ rte_eth_dev_callback_unregister(uint8_t port_id, rte_spinlock_lock(&rte_eth_dev_cb_lock); ret = 0; - for (cb = TAILQ_FIRST(&dev->callbacks); cb != NULL; cb = next) { + for (cb = TAILQ_FIRST(&dev->intr_cbs); cb != NULL; cb = next) { next = TAILQ_NEXT(cb, next); @@ -2752,7 +2752,7 @@ rte_eth_dev_callback_unregister(uint8_t port_id, * then remove it. */ if (cb->active == 0) { - TAILQ_REMOVE(&(dev->callbacks), cb, next); + TAILQ_REMOVE(&(dev->intr_cbs), cb, next); rte_free(cb); } else { ret = -EAGAIN; @@ -2771,7 +2771,7 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, struct rte_eth_dev_callback dev_cb; rte_spinlock_lock(&rte_eth_dev_cb_lock); - TAILQ_FOREACH(cb_lst, &(dev->callbacks), next) { + TAILQ_FOREACH(cb_lst, &(dev->intr_cbs), next) { if (cb_lst->cb_fn == NULL || cb_lst->event != event) continue; dev_cb = *cb_lst; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index f66805d..c76a5d0 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1564,7 +1564,7 @@ struct rte_eth_dev { const struct eth_driver *driver;/**< Driver for this device */ struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */ struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */ - struct rte_eth_dev_cb_list callbacks; /**< User application callbacks */ + struct rte_eth_dev_cb_list intr_cbs; /**< User application callbacks on interrupt*/ }; struct rte_eth_dev_sriov { diff --git a/lib/librte_pmd_bond/rte_eth_bond_api.c b/lib/librte_pmd_bond/rte_eth_bond_api.c index ef5ddf4..01e8f21 100644 --- a/lib/librte_pmd_bond/rte_eth_bond_api.c +++ b/lib/librte_pmd_bond/rte_eth_bond_api.c @@ -247,7 +247,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) eth_dev->data->nb_rx_queues = (uint16_t)1; eth_dev->data->nb_tx_queues = (uint16_t)1; - TAILQ_INIT(&(eth_dev->callbacks)); + TAILQ_INIT(&(eth_dev->intr_cbs)); eth_dev->data->dev_link.link_status = 0;