DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Cc: jingjing.wu@intel.com, beilei.xing@intel.com,
	chenbo.xia@intel.com, xiuchun.lu@intel.com
Subject: [dpdk-dev] [PATCH v2 5/6] net/iavf_be: extend backend to support iavf rxq_irq
Date: Thu,  7 Jan 2021 15:15:02 +0800	[thread overview]
Message-ID: <20210107071503.14720-6-jingjing.wu@intel.com> (raw)
In-Reply-To: <20210107071503.14720-1-jingjing.wu@intel.com>

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/iavf_be/iavf_be_ethdev.c | 3 ++-
 drivers/net/iavf_be/iavf_be_rxtx.c   | 5 +++++
 drivers/net/iavf_be/iavf_be_vchnl.c  | 8 ++++++--
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/net/iavf_be/iavf_be_ethdev.c b/drivers/net/iavf_be/iavf_be_ethdev.c
index 4bf936f21b..76d6103c2f 100644
--- a/drivers/net/iavf_be/iavf_be_ethdev.c
+++ b/drivers/net/iavf_be/iavf_be_ethdev.c
@@ -382,7 +382,6 @@ iavfbe_new_device(struct rte_emudev *dev)
 	adapter->reset = (uint8_t *)(uintptr_t)addr;
 	IAVFBE_WRITE_32(adapter->reset, RTE_IAVF_EMU_RESET_COMPLETED);
 	adapter->started = 1;
-	printf("NEW DEVICE: memtable, %p\n", adapter->mem_table);
 
 	return 0;
 }
@@ -465,6 +464,7 @@ iavfbe_update_device(struct rte_emudev *dev)
 				"Can not get irq info of rxq %d\n", i);
 			return -1;
 		}
+		rxq->kickfd = irq_info.eventfd;
 		rte_atomic32_set(&rxq->irq_enable, irq_info.enable);
 	}
 
@@ -479,6 +479,7 @@ iavfbe_update_device(struct rte_emudev *dev)
 				"Can not get irq info of txq %d\n", i);
 			return -1;
 		}
+		txq->callfd = irq_info.eventfd;
 		rte_atomic32_set(&txq->irq_enable, irq_info.enable);
 	}
 
diff --git a/drivers/net/iavf_be/iavf_be_rxtx.c b/drivers/net/iavf_be/iavf_be_rxtx.c
index 66f30cc0a8..9da70976e1 100644
--- a/drivers/net/iavf_be/iavf_be_rxtx.c
+++ b/drivers/net/iavf_be/iavf_be_rxtx.c
@@ -5,6 +5,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 #include <sys/queue.h>
+#include <sys/eventfd.h>
 
 #include <rte_string_fns.h>
 #include <rte_mbuf.h>
@@ -461,6 +462,10 @@ iavfbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 end_of_xmit:
 	txq->rx_head = head;
 	txq->stats.sent_miss_num += nb_pkts - nb_tx;
+
+	if (rte_atomic32_read(&txq->irq_enable) == true)
+		eventfd_write(txq->callfd, (eventfd_t)1);
+
 end_unlock:
 	rte_spinlock_unlock(&txq->access_lock);
 
diff --git a/drivers/net/iavf_be/iavf_be_vchnl.c b/drivers/net/iavf_be/iavf_be_vchnl.c
index 2195047280..243ad638f8 100644
--- a/drivers/net/iavf_be/iavf_be_vchnl.c
+++ b/drivers/net/iavf_be/iavf_be_vchnl.c
@@ -95,12 +95,15 @@ apply_tx_irq(struct iavfbe_tx_queue *txq, uint16_t vector)
 {
 	struct rte_emudev_irq_info info;
 
+	rte_spinlock_lock(&txq->access_lock);
 	txq->vector = vector;
 	if (rte_emudev_get_irq_info(txq->adapter->edev_id, vector, &info)) {
 		IAVF_BE_LOG(ERR, "Can not get irq info\n");
 		return IAVF_ERR_DEVICE_NOT_SUPPORTED;
 	}
 	txq->callfd = info.eventfd;
+	rte_atomic32_set(&txq->irq_enable, info.enable);
+	rte_spinlock_unlock(&txq->access_lock);
 
 	return 0;
 }
@@ -110,12 +113,15 @@ apply_rx_irq(struct iavfbe_rx_queue *rxq, uint16_t vector)
 {
 	struct rte_emudev_irq_info info;
 
+	rte_spinlock_lock(&rxq->access_lock);
 	rxq->vector = vector;
 	if (rte_emudev_get_irq_info(rxq->adapter->edev_id, vector, &info)) {
 		IAVF_BE_LOG(ERR, "Can not get irq info\n");
 		return IAVF_ERR_DEVICE_NOT_SUPPORTED;
 	}
 	rxq->kickfd = info.eventfd;
+	rte_atomic32_set(&rxq->irq_enable, info.enable);
+	rte_spinlock_unlock(&rxq->access_lock);
 
 	return 0;
 }
@@ -557,13 +563,11 @@ iavfbe_process_cmd_config_irq_map(struct iavfbe_adapter *adapter,
 			txq = dev->data->tx_queues[j];
 
 			if ((1 << j) & map->rxq_map) {
-				txq->vector = vector_id;
 				ret = apply_tx_irq(txq, vector_id);
 				if (ret)
 					goto send_msg;
 			}
 			if ((1 << j) & map->txq_map) {
-				rxq->vector = vector_id;
 				ret = apply_rx_irq(rxq, vector_id);
 				if (ret)
 					goto send_msg;
-- 
2.21.1


  parent reply	other threads:[~2021-01-07  7:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-19  7:54 [dpdk-dev] [PATCH v1 0/5] introduce iavf backend driver Jingjing Wu
2020-12-19  7:54 ` [dpdk-dev] [PATCH v1 1/5] net/iavf_be: " Jingjing Wu
2020-12-19  7:54 ` [dpdk-dev] [PATCH v1 2/5] net/iavf_be: control queue enabling Jingjing Wu
2020-12-19  7:54 ` [dpdk-dev] [PATCH v1 3/5] net/iavf_be: virtchnl messages process Jingjing Wu
2020-12-19  7:54 ` [dpdk-dev] [PATCH v1 4/5] net/iavf_be: add Rx Tx burst support Jingjing Wu
2020-12-19  7:54 ` [dpdk-dev] [PATCH v1 5/5] doc: new net PMD iavf_be Jingjing Wu
2021-01-07  7:14 ` [dpdk-dev] [PATCH v2 0/6] introduce iavf backend driver Jingjing Wu
2021-01-07  7:14   ` [dpdk-dev] [PATCH v2 1/6] net/iavf_be: " Jingjing Wu
2021-01-07  7:14   ` [dpdk-dev] [PATCH v2 2/6] net/iavf_be: control queue enabling Jingjing Wu
2021-01-07  7:15   ` [dpdk-dev] [PATCH v2 3/6] net/iavf_be: virtchnl messages process Jingjing Wu
2021-01-07  7:15   ` [dpdk-dev] [PATCH v2 4/6] net/iavf_be: add Rx Tx burst support Jingjing Wu
2021-01-07  7:15   ` Jingjing Wu [this message]
2021-01-07  7:15   ` [dpdk-dev] [PATCH v2 6/6] doc: new net PMD iavf_be Jingjing Wu

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=20210107071503.14720-6-jingjing.wu@intel.com \
    --to=jingjing.wu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=xiuchun.lu@intel.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).