DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kamil Rytarowski <krytarowski@caviumnetworks.com>
To: <dev@dpdk.org>
Cc: <maciej.czekaj@caviumnetworks.com>, <zyta.szpak@semihalf.com>,
	<slawomir.rosek@semihalf.com>, <rad@semihalf.com>,
	<jerin.jacob@caviumnetworks.com>, <ferruh.yigit@intel.com>,
	<john.mcnamara@intel.com>,
	Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH v2 06/15] net/thunderx: add secondary queue set in interrupt functions
Date: Fri, 30 Sep 2016 14:05:45 +0200	[thread overview]
Message-ID: <1475237154-25388-7-git-send-email-krytarowski@caviumnetworks.com> (raw)
In-Reply-To: <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com>

From: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 drivers/net/thunderx/nicvf_ethdev.c | 41 ++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 3cf32bf..72e6667 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -101,31 +101,40 @@ nicvf_set_eth_link_status(struct nicvf *nic, struct rte_eth_link *link)
 static void
 nicvf_interrupt(void *arg)
 {
-	struct nicvf *nic = arg;
+	struct rte_eth_dev *dev = arg;
+	struct nicvf *nic = nicvf_pmd_priv(dev);
 
 	if (nicvf_reg_poll_interrupts(nic) == NIC_MBOX_MSG_BGX_LINK_CHANGE) {
-		if (nic->eth_dev->data->dev_conf.intr_conf.lsc)
-			nicvf_set_eth_link_status(nic,
-					&nic->eth_dev->data->dev_link);
-		_rte_eth_dev_callback_process(nic->eth_dev,
-				RTE_ETH_EVENT_INTR_LSC);
+		if (dev->data->dev_conf.intr_conf.lsc)
+			nicvf_set_eth_link_status(nic, &dev->data->dev_link);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
 	}
 
 	rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000,
-				nicvf_interrupt, nic);
+				nicvf_interrupt, dev);
+}
+
+static void __rte_unused
+nicvf_vf_interrupt(void *arg)
+{
+	struct nicvf *nic = arg;
+
+	nicvf_reg_poll_interrupts(nic);
+
+	rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000,
+				nicvf_vf_interrupt, nic);
 }
 
 static int
-nicvf_periodic_alarm_start(struct nicvf *nic)
+nicvf_periodic_alarm_start(void (fn)(void *), void *arg)
 {
-	return rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000,
-					nicvf_interrupt, nic);
+	return rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000, fn, arg);
 }
 
 static int
-nicvf_periodic_alarm_stop(struct nicvf *nic)
+nicvf_periodic_alarm_stop(void (fn)(void *), void *arg)
 {
-	return rte_eal_alarm_cancel(nicvf_interrupt, nic);
+	return rte_eal_alarm_cancel(fn, arg);
 }
 
 /*
@@ -1519,12 +1528,10 @@ nicvf_dev_stop(struct rte_eth_dev *dev)
 static void
 nicvf_dev_close(struct rte_eth_dev *dev)
 {
-	struct nicvf *nic = nicvf_pmd_priv(dev);
-
 	PMD_INIT_FUNC_TRACE();
 
 	nicvf_dev_stop(dev);
-	nicvf_periodic_alarm_stop(nic);
+	nicvf_periodic_alarm_stop(nicvf_interrupt, dev);
 }
 
 static int
@@ -1675,7 +1682,7 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
 
 	nicvf_disable_all_interrupts(nic);
 
-	ret = nicvf_periodic_alarm_start(nic);
+	ret = nicvf_periodic_alarm_start(nicvf_interrupt, eth_dev);
 	if (ret) {
 		PMD_INIT_LOG(ERR, "Failed to start period alarm");
 		goto fail;
@@ -1736,7 +1743,7 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
 malloc_fail:
 	rte_free(eth_dev->data->mac_addrs);
 alarm_fail:
-	nicvf_periodic_alarm_stop(nic);
+	nicvf_periodic_alarm_stop(nicvf_interrupt, eth_dev);
 fail:
 	return ret;
 }
-- 
1.9.1

  parent reply	other threads:[~2016-09-30 12:06 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 16:53 [dpdk-dev] [PATCH 00/13] Add support for secondary queue set in nicvf thunderx driver Kamil Rytarowski
2016-08-26 16:53 ` [dpdk-dev] [PATCH 01/13] net/thunderx: cleanup the driver before adding new features Kamil Rytarowski
2016-09-20 13:48   ` Ferruh Yigit
2016-09-29 14:21     ` Maciej Czekaj
2016-08-26 16:53 ` [dpdk-dev] [PATCH 02/13] net/thunderx: correct transmit checksum handling Kamil Rytarowski
2016-08-26 16:53 ` [dpdk-dev] [PATCH 03/13] net/thunderx/base: add family of functions to store qsets Kamil Rytarowski
2016-08-26 16:53 ` [dpdk-dev] [PATCH 04/13] net/thunderx/base: add secondary queue set support Kamil Rytarowski
2016-09-20 13:48   ` Ferruh Yigit
2016-09-29 14:22     ` Maciej Czekaj
2016-08-26 16:54 ` [dpdk-dev] [PATCH 05/13] net/thunderx: add family of functions to store DPDK qsets Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 06/13] net/thunderx: add secondary queue set in interrupt functions Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 07/13] net/thunderx: fix multiprocess support in stats Kamil Rytarowski
2016-09-20 13:48   ` Ferruh Yigit
2016-09-29 14:35     ` Maciej Czekaj
2016-08-26 16:54 ` [dpdk-dev] [PATCH 08/13] net/thunderx: add helper utils for secondary qset support Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 09/13] net/thunderx: add secondary qset support in dev stop/close Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 10/13] net/thunderx: add secondary qset support in device start Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 11/13] net/thunderx: add secondary qset support in device configure Kamil Rytarowski
2016-08-26 16:54 ` [dpdk-dev] [PATCH 12/13] net/thunderx: add final bits for secondary queue support Kamil Rytarowski
2016-09-20 13:49   ` Ferruh Yigit
2016-09-29 14:37     ` Maciej Czekaj
2016-08-26 16:54 ` [dpdk-dev] [PATCH 13/13] net/thunderx: document secondary queue set support Kamil Rytarowski
2016-09-26 20:17   ` Mcnamara, John
2016-09-29 14:38     ` Maciej Czekaj
2016-09-12 10:59 ` [dpdk-dev] [PATCH 00/13] Add support for secondary queue set in nicvf thunderx driver Kamil Rytarowski
2016-09-19 12:23   ` Kamil Rytarowski
2016-09-30 12:05 ` [dpdk-dev] [PATCH v2 00/15] " Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 01/15] net/thunderx: cleanup the driver before adding new features Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 02/15] net/thunderx: correct transmit checksum handling Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 03/15] net/thunderx/base: add family of functions to store qsets Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 04/15] net/thunderx/base: add secondary queue set support Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 05/15] net/thunderx: add family of functions to store DPDK qsets Kamil Rytarowski
2016-09-30 12:05   ` Kamil Rytarowski [this message]
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 07/15] net/thunderx: remove problematic private_data->eth_dev link Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 08/15] net/thunderx: add helper utils for secondary qset support Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 09/15] net/thunderx: add secondary qset support in dev stop/close Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 10/15] net/thunderx: add secondary qset support in device start Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 11/15] net/thunderx: add secondary qset support in device configure Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 12/15] net/thunderx: add final bits for secondary queue support Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 13/15] net/thunderx: document secondary queue set support Kamil Rytarowski
2016-09-30 15:12     ` Mcnamara, John
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 14/15] ethdev: Support VFs on the different PCI domains Kamil Rytarowski
2016-10-10 10:19     ` Ferruh Yigit
2016-10-10 13:01       ` Kamil Rytarowski
2016-10-10 13:27         ` Ferruh Yigit
2016-10-11 13:52           ` Kamil Rytarowski
2016-09-30 12:05   ` [dpdk-dev] [PATCH v2 15/15] net/thunderx: Bump driver version to 2.0 Kamil Rytarowski
2016-10-12 15:59   ` [dpdk-dev] [PATCH v2 00/15] Add support for secondary queue set in nicvf thunderx driver Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1475237154-25388-7-git-send-email-krytarowski@caviumnetworks.com \
    --to=krytarowski@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=john.mcnamara@intel.com \
    --cc=kamil.rytarowski@caviumnetworks.com \
    --cc=maciej.czekaj@caviumnetworks.com \
    --cc=rad@semihalf.com \
    --cc=slawomir.rosek@semihalf.com \
    --cc=zyta.szpak@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).