aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/event
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-03-07 11:22:30 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2018-03-07 11:23:17 +0000
commitc3f15def2ebe9cc255cf0e5cf32aa171f5b4326d (patch)
tree8c8fc77df57bca8c0bfe4d0e8797879e12c6d6f9 /drivers/event
parent169a9de21e263aa6599cdc2d87a45ae158d9f509 (diff)
New upstream version 17.11.1upstream/17.11.1
Change-Id: Ida1700b5dac8649fc563670a37278e636bea051c Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/event')
-rw-r--r--drivers/event/octeontx/Makefile2
-rw-r--r--drivers/event/octeontx/ssovf_worker.h6
-rw-r--r--drivers/event/sw/sw_evdev.c46
-rw-r--r--drivers/event/sw/sw_evdev.h2
4 files changed, 35 insertions, 21 deletions
diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile
index fdf1b738..26044128 100644
--- a/drivers/event/octeontx/Makefile
+++ b/drivers/event/octeontx/Makefile
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/
CFLAGS += -I$(RTE_SDK)/drivers/net/octeontx/
-LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx
+LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx -lrte_pmd_octeontx
LDLIBS += -lrte_bus_pci
LDLIBS += -lrte_bus_vdev
diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h
index bf76ac88..4c9a4c47 100644
--- a/drivers/event/octeontx/ssovf_worker.h
+++ b/drivers/event/octeontx/ssovf_worker.h
@@ -53,7 +53,7 @@ enum {
/* SSO Operations */
static __rte_always_inline struct rte_mbuf *
-ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_id)
+ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info)
{
struct rte_mbuf *mbuf;
octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work;
@@ -69,7 +69,7 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_id)
mbuf->data_len = mbuf->pkt_len;
mbuf->nb_segs = 1;
mbuf->ol_flags = 0;
- mbuf->port = port_id;
+ mbuf->port = rte_octeontx_pchan_map[port_info >> 4][port_info & 0xF];
rte_mbuf_refcnt_set(mbuf, 1);
return mbuf;
}
@@ -89,7 +89,7 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev)
ev->event = sched_type_queue | (get_work0 & 0xffffffff);
if (get_work1 && ev->event_type == RTE_EVENT_TYPE_ETHDEV) {
ev->mbuf = ssovf_octeontx_wqe_to_pkt(get_work1,
- (ev->event >> 20) & 0xF);
+ (ev->event >> 20) & 0x7F);
} else {
ev->u64 = get_work1;
}
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index fd110797..d989346b 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -62,6 +62,7 @@ sw_port_link(struct rte_eventdev *dev, void *port, const uint8_t queues[],
RTE_SET_USED(priorities);
for (i = 0; i < num; i++) {
struct sw_qid *q = &sw->qids[queues[i]];
+ unsigned int j;
/* check for qid map overflow */
if (q->cq_num_mapped_cqs >= RTE_DIM(q->cq_map)) {
@@ -74,6 +75,15 @@ sw_port_link(struct rte_eventdev *dev, void *port, const uint8_t queues[],
break;
}
+ for (j = 0; j < q->cq_num_mapped_cqs; j++) {
+ if (q->cq_map[j] == p->id)
+ break;
+ }
+
+ /* check if port is already linked */
+ if (j < q->cq_num_mapped_cqs)
+ continue;
+
if (q->type == SW_SCHED_TYPE_DIRECT) {
/* check directed qids only map to one port */
if (p->num_qids_mapped > 0) {
@@ -338,6 +348,23 @@ cleanup:
return -EINVAL;
}
+static void
+sw_queue_release(struct rte_eventdev *dev, uint8_t id)
+{
+ struct sw_evdev *sw = sw_pmd_priv(dev);
+ struct sw_qid *qid = &sw->qids[id];
+ uint32_t i;
+
+ for (i = 0; i < SW_IQS_MAX; i++)
+ iq_ring_destroy(qid->iq[i]);
+
+ if (qid->type == RTE_SCHED_TYPE_ORDERED) {
+ rte_free(qid->reorder_buffer);
+ rte_ring_free(qid->reorder_buffer_freelist);
+ }
+ memset(qid, 0, sizeof(*qid));
+}
+
static int
sw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id,
const struct rte_event_queue_conf *conf)
@@ -355,24 +382,11 @@ sw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id,
}
struct sw_evdev *sw = sw_pmd_priv(dev);
- return qid_init(sw, queue_id, type, conf);
-}
-
-static void
-sw_queue_release(struct rte_eventdev *dev, uint8_t id)
-{
- struct sw_evdev *sw = sw_pmd_priv(dev);
- struct sw_qid *qid = &sw->qids[id];
- uint32_t i;
- for (i = 0; i < SW_IQS_MAX; i++)
- iq_ring_destroy(qid->iq[i]);
+ if (sw->qids[queue_id].initialized)
+ sw_queue_release(dev, queue_id);
- if (qid->type == RTE_SCHED_TYPE_ORDERED) {
- rte_free(qid->reorder_buffer);
- rte_ring_free(qid->reorder_buffer_freelist);
- }
- memset(qid, 0, sizeof(*qid));
+ return qid_init(sw, queue_id, type, conf);
}
static void
diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h
index e0dec910..ee0edb32 100644
--- a/drivers/event/sw/sw_evdev.h
+++ b/drivers/event/sw/sw_evdev.h
@@ -88,7 +88,7 @@ static const uint8_t sw_qe_flag_map[] = {
QE_FLAG_VALID | QE_FLAG_COMPLETE | QE_FLAG_NOT_EOP,
};
-#ifdef RTE_LIBRTE_PMD_EVDEV_SW_DEBUG
+#ifdef RTE_LIBRTE_PMD_SW_EVENTDEV_DEBUG
#define SW_LOG_INFO(fmt, args...) \
RTE_LOG(INFO, EVENTDEV, "[%s] %s() line %u: " fmt "\n", \
SW_PMD_NAME, \