bus/fslmc: add function to prefetch next DQRR entry
[dpdk.git] / drivers / bus / fslmc / qbman / qbman_portal.c
index b02dfa2..e221733 100644 (file)
@@ -496,6 +496,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
 int qbman_swp_enqueue_multiple(struct qbman_swp *s,
                               const struct qbman_eq_desc *d,
                               const struct qbman_fd *fd,
+                              uint32_t *flags,
                               int num_frames)
 {
        uint32_t *p;
@@ -538,6 +539,12 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s,
                p = qbman_cena_write_start_wo_shadow(&s->sys,
                                        QBMAN_CENA_SWP_EQCR(eqcr_pi & 7));
                p[0] = cl[0] | s->eqcr.pi_vb;
+               if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) {
+                       struct qbman_eq_desc *d = (struct qbman_eq_desc *)p;
+
+                       d->eq.dca = (1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT) |
+                               ((flags[i]) & QBMAN_EQCR_DCA_IDXMASK);
+               }
                eqcr_pi++;
                eqcr_pi &= 0xF;
                if (!(eqcr_pi & 7))
@@ -772,6 +779,17 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d)
 #define QBMAN_RESULT_BPSCN     0x29
 #define QBMAN_RESULT_CSCN_WQ   0x2a
 
+#include <rte_prefetch.h>
+
+void qbman_swp_prefetch_dqrr_next(struct qbman_swp *s)
+{
+       const struct qbman_result *p;
+
+       p = qbman_cena_read_wo_shadow(&s->sys,
+               QBMAN_CENA_SWP_DQRR(s->dqrr.next_idx));
+       rte_prefetch0(p);
+}
+
 /* NULL return if there are no unconsumed DQRR entries. Returns a DQRR entry
  * only once, so repeated calls can return a sequence of DQRR entries, without
  * requiring they be consumed immediately or in any particular order.