From: Sujith Sankar <ssujith@cisco.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] enic: corrected the usage of VFIO_PRESENT
Date: Fri, 12 Dec 2014 13:48:23 +0530 [thread overview]
Message-ID: <1418372303-31565-1-git-send-email-ssujith@cisco.com> (raw)
This patch corrects the usage of the flag VFIO_PRESENT in enic driver.
This has uncovered a few warnings, and this patch corrects those too.
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
---
lib/librte_pmd_enic/Makefile | 1 +
lib/librte_pmd_enic/enic.h | 1 +
lib/librte_pmd_enic/enic_main.c | 12 ++++++++----
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index a2a623f..3271960 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -39,6 +39,7 @@ LIB = librte_pmd_enic.a
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/
+CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal/
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS) -Wno-strict-aliasing
diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h
index c43417c..c692bab 100644
--- a/lib/librte_pmd_enic/enic.h
+++ b/lib/librte_pmd_enic/enic.h
@@ -182,6 +182,7 @@ extern void enic_dev_stats_get(struct enic *enic,
struct rte_eth_stats *r_stats);
extern void enic_dev_stats_clear(struct enic *enic);
extern void enic_add_packet_filter(struct enic *enic);
+extern void *enic_err_intr_handler(void *arg);
extern void enic_set_mac_address(struct enic *enic, uint8_t *mac_addr);
extern void enic_del_mac_address(struct enic *enic);
extern unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq);
diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c
index e4f43c5..469cb6c 100644
--- a/lib/librte_pmd_enic/enic_main.c
+++ b/lib/librte_pmd_enic/enic_main.c
@@ -39,6 +39,7 @@
#include <sys/mman.h>
#include <fcntl.h>
#include <libgen.h>
+#include <sys/ioctl.h>
#include <rte_pci.h>
#include <rte_memzone.h>
@@ -46,6 +47,7 @@
#include <rte_mbuf.h>
#include <rte_string_fns.h>
#include <rte_ethdev.h>
+#include <eal_vfio.h>
#include "enic_compat.h"
#include "enic.h"
@@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct rte_pci_device *hwdev,
/* Nothing to be done */
}
+#ifndef VFIO_PRESENT
static void
enic_intr_handler(__rte_unused struct rte_intr_handle *handle,
void *arg)
@@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct rte_intr_handle *handle,
enic_log_q_error(enic);
}
+#endif
int enic_enable(struct enic *enic)
{
@@ -978,12 +982,13 @@ static void enic_eventfd_init(struct enic *enic)
void *enic_err_intr_handler(void *arg)
{
struct enic *enic = (struct enic *)arg;
- unsigned int intr = enic_msix_err_intr(enic);
- ssize_t size;
uint64_t data;
while (1) {
- size = read(enic->eventfd, &data, sizeof(data));
+ if (-1 == read(enic->eventfd, &data, sizeof(data))) {
+ dev_err(enic, "eventfd read failed with error %d\n", errno);
+ continue;
+ }
dev_err(enic, "Err intr.\n");
vnic_intr_return_all_credits(&enic->intr);
@@ -1035,7 +1040,6 @@ static int enic_set_intr_mode(struct enic *enic)
int *fds;
int size;
int ret = -1;
- int index;
if (enic->intr_count < 1) {
dev_err(enic, "Unsupported resource conf.\n");
--
1.9.1
next reply other threads:[~2014-12-12 8:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-12 8:18 Sujith Sankar [this message]
2014-12-15 23:24 ` Thomas Monjalon
2014-12-16 4:12 ` Sujith Sankar (ssujith)
2014-12-16 7:51 ` Qiu, Michael
2014-12-16 10:00 ` Sujith Sankar (ssujith)
2014-12-16 10:16 ` Thomas Monjalon
2014-12-16 10:22 ` Burakov, Anatoly
2014-12-16 10:34 ` Sujith Sankar (ssujith)
2014-12-16 10:36 ` Burakov, Anatoly
2014-12-16 10:40 ` Sujith Sankar (ssujith)
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=1418372303-31565-1-git-send-email-ssujith@cisco.com \
--to=ssujith@cisco.com \
--cc=dev@dpdk.org \
/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).