summaryrefslogtreecommitdiffstats
path: root/lib/librte_pdump
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-12-08 14:07:29 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-12-08 14:10:05 +0100
commit6b3e017e5d25f15da73f7700f7f2ac553ef1a2e9 (patch)
tree1b1fb3f903b2282e261ade69e3c17952b3fd3464 /lib/librte_pdump
parent32e04ea00cd159613e04acef75e52bfca6eeff2f (diff)
Imported Upstream version 16.11
Change-Id: I1944c65ddc88a9ad70f8c0eb6731552b84fbcb77 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_pdump')
-rw-r--r--lib/librte_pdump/rte_pdump.c41
-rw-r--r--lib/librte_pdump/rte_pdump.h4
2 files changed, 8 insertions, 37 deletions
diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index ea5ccd98..59686837 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -226,29 +226,6 @@ pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
}
static int
-pdump_get_dombdf(char *device_id, char *domBDF, size_t len)
-{
- int ret;
- struct rte_pci_addr dev_addr = {0};
-
- /* identify if device_id is pci address or name */
- ret = eal_parse_pci_DomBDF(device_id, &dev_addr);
- if (ret < 0)
- return -1;
-
- if (dev_addr.domain)
- ret = snprintf(domBDF, len, "%u:%u:%u.%u", dev_addr.domain,
- dev_addr.bus, dev_addr.devid,
- dev_addr.function);
- else
- ret = snprintf(domBDF, len, "%u:%u.%u", dev_addr.bus,
- dev_addr.devid,
- dev_addr.function);
-
- return ret;
-}
-
-static int
pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue,
struct rte_ring *ring, struct rte_mempool *mp,
uint16_t operation)
@@ -292,7 +269,7 @@ pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue,
if (ret < 0) {
RTE_LOG(ERR, PDUMP,
"failed to remove rx callback, errno=%d\n",
- rte_errno);
+ -ret);
return ret;
}
cbs->cb = NULL;
@@ -347,7 +324,7 @@ pdump_regitser_tx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue,
if (ret < 0) {
RTE_LOG(ERR, PDUMP,
"failed to remove tx callback, errno=%d\n",
- rte_errno);
+ -ret);
return ret;
}
cbs->cb = NULL;
@@ -885,7 +862,6 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
void *filter)
{
int ret = 0;
- char domBDF[DEVICE_ID_SIZE];
ret = pdump_validate_ring_mp(ring, mp);
if (ret < 0)
@@ -894,11 +870,7 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
if (ret < 0)
return ret;
- if (pdump_get_dombdf(device_id, domBDF, sizeof(domBDF)) > 0)
- ret = pdump_prepare_client_request(domBDF, queue, flags,
- ENABLE, ring, mp, filter);
- else
- ret = pdump_prepare_client_request(device_id, queue, flags,
+ ret = pdump_prepare_client_request(device_id, queue, flags,
ENABLE, ring, mp, filter);
return ret;
@@ -928,17 +900,12 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
uint32_t flags)
{
int ret = 0;
- char domBDF[DEVICE_ID_SIZE];
ret = pdump_validate_flags(flags);
if (ret < 0)
return ret;
- if (pdump_get_dombdf(device_id, domBDF, sizeof(domBDF)) > 0)
- ret = pdump_prepare_client_request(domBDF, queue, flags,
- DISABLE, NULL, NULL, NULL);
- else
- ret = pdump_prepare_client_request(device_id, queue, flags,
+ ret = pdump_prepare_client_request(device_id, queue, flags,
DISABLE, NULL, NULL, NULL);
return ret;
diff --git a/lib/librte_pdump/rte_pdump.h b/lib/librte_pdump/rte_pdump.h
index b5f4e2f3..924b8043 100644
--- a/lib/librte_pdump/rte_pdump.h
+++ b/lib/librte_pdump/rte_pdump.h
@@ -41,6 +41,10 @@
* packet dump library to provide packet capturing support on dpdk.
*/
+#include <stdint.h>
+#include <rte_mempool.h>
+#include <rte_ring.h>
+
#ifdef __cplusplus
extern "C" {
#endif