This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via e468e7041ba526fd8e2814b1158bde2e4917a987 (commit) via c13d8ba9b4a7c0b4adddd637e942bf8d83675a95 (commit) from 48018032f54e6e50f509d073c8735f7a5c0bbcb1 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit e468e7041ba526fd8e2814b1158bde2e4917a987 Author: Petri Savolainen petri.savolainen@linaro.org Date: Mon Oct 29 14:14:46 2018 +0200
linux-gen: pktio: remove sched_cb_pktin_poll_old
The function is not used anymore.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index df875c48..a131b6eb 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -84,7 +84,6 @@ extern const schedule_fn_t *sched_fn; /* Interface for the scheduler */ int sched_cb_pktin_poll(int pktio_index, int pktin_index, odp_buffer_hdr_t *hdr_tbl[], int num); -int sched_cb_pktin_poll_old(int pktio_index, int num_queue, int index[]); int sched_cb_pktin_poll_one(int pktio_index, int rx_queue, odp_event_t evts[]); void sched_cb_pktio_stop_finalize(int pktio_index);
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 92c14cc2..1e0429f5 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -872,54 +872,6 @@ int sched_cb_pktin_poll(int pktio_index, int pktin_index, return pktin_recv_buf(entry, pktin_index, hdr_tbl, num); }
-int sched_cb_pktin_poll_old(int pktio_index, int num_queue, int index[]) -{ - odp_buffer_hdr_t *hdr_tbl[QUEUE_MULTI_MAX]; - int num, idx; - pktio_entry_t *entry = pktio_entry_by_index(pktio_index); - int state = entry->s.state; - - if (odp_unlikely(state != PKTIO_STATE_STARTED)) { - if (state < PKTIO_STATE_ACTIVE || - state == PKTIO_STATE_STOP_PENDING) - return -1; - - ODP_DBG("interface not started\n"); - return 0; - } - - for (idx = 0; idx < num_queue; idx++) { - odp_queue_t queue; - int num_enq; - - num = pktin_recv_buf(entry, index[idx], hdr_tbl, - QUEUE_MULTI_MAX); - - if (num == 0) - continue; - - if (num < 0) { - ODP_ERR("Packet recv error\n"); - return -1; - } - - queue = entry->s.in_queue[index[idx]].queue; - num_enq = odp_queue_enq_multi(queue, - (odp_event_t *)hdr_tbl, num); - - if (odp_unlikely(num_enq < num)) { - if (odp_unlikely(num_enq < 0)) - num_enq = 0; - - ODP_DBG("Interface %s dropped %i packets\n", - entry->s.name, num - num_enq); - buffer_free_multi(&hdr_tbl[num_enq], num - num_enq); - } - } - - return 0; -} - void sched_cb_pktio_stop_finalize(int pktio_index) { int state;
commit c13d8ba9b4a7c0b4adddd637e942bf8d83675a95 Author: Petri Savolainen petri.savolainen@linaro.org Date: Mon Oct 29 13:57:21 2018 +0200
linux-gen: schedule_sp: use sched_cb_pktin_poll
Use sched_cb_pktin_poll instead of sched_cb_pktin_poll_old, so that the old pktin poll function can be removed.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index e63bd061..8dcf9b0e 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -62,6 +62,7 @@ struct sched_cmd_s { int init; int num_pktin; int pktin_idx[NUM_PKTIN]; + odp_queue_t queue[NUM_PKTIN]; };
typedef struct ODP_ALIGNED_CACHE sched_cmd_t { @@ -438,7 +439,7 @@ static int ord_enq_multi(odp_queue_t queue, void *buf_hdr[], int num, static void pktio_start(int pktio_index, int num, int pktin_idx[], - odp_queue_t odpq[] ODP_UNUSED) + odp_queue_t queue[]) { int i; sched_cmd_t *cmd; @@ -452,8 +453,10 @@ static void pktio_start(int pktio_index, ODP_ABORT("Supports only %i pktin queues per interface\n", NUM_PKTIN);
- for (i = 0; i < num; i++) + for (i = 0; i < num; i++) { cmd->s.pktin_idx[i] = pktin_idx[i]; + cmd->s.queue[i] = queue[i]; + }
cmd->s.num_pktin = num;
@@ -507,6 +510,26 @@ static uint64_t schedule_wait_time(uint64_t ns) return ns; }
+static inline void enqueue_packets(odp_queue_t queue, + odp_buffer_hdr_t *hdr_tbl[], int num_pkt) +{ + int num_enq, num_drop; + + num_enq = odp_queue_enq_multi(queue, (odp_event_t *)hdr_tbl, + num_pkt); + + if (num_enq < 0) + num_enq = 0; + + if (num_enq < num_pkt) { + num_drop = num_pkt - num_enq; + + ODP_DBG("Dropped %i packets\n", num_drop); + odp_packet_free_multi((odp_packet_t *)&hdr_tbl[num_enq], + num_drop); + } +} + static int schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t events[], int max_events ODP_UNUSED) { @@ -534,12 +557,33 @@ static int schedule_multi(odp_queue_t *from, uint64_t wait, cmd = sched_cmd();
if (cmd && cmd->s.type == CMD_PKTIO) { - if (sched_cb_pktin_poll_old(cmd->s.index, - cmd->s.num_pktin, - cmd->s.pktin_idx)) { - /* Pktio stopped or closed. */ - sched_cb_pktio_stop_finalize(cmd->s.index); - } else { + odp_buffer_hdr_t *hdr_tbl[CONFIG_BURST_SIZE]; + int i; + int num_pkt = 0; + int max_num = CONFIG_BURST_SIZE; + int pktio_idx = cmd->s.index; + int num_pktin = cmd->s.num_pktin; + int *pktin_idx = cmd->s.pktin_idx; + odp_queue_t *queue = cmd->s.queue; + + for (i = 0; i < num_pktin; i++) { + num_pkt = sched_cb_pktin_poll(pktio_idx, + pktin_idx[i], + hdr_tbl, max_num); + + if (num_pkt < 0) { + /* Pktio stopped or closed. */ + sched_cb_pktio_stop_finalize(pktio_idx); + break; + } + + if (num_pkt == 0) + continue; + + enqueue_packets(queue[i], hdr_tbl, num_pkt); + } + + if (num_pkt >= 0) { /* Continue polling pktio. */ add_tail(cmd); }
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/include/odp_schedule_if.h | 1 - platform/linux-generic/odp_packet_io.c | 48 ------------------- platform/linux-generic/odp_schedule_sp.c | 60 ++++++++++++++++++++---- 3 files changed, 52 insertions(+), 57 deletions(-)
hooks/post-receive