bman_release(), bman_thread_irq(), qman_clear_irq(), qman_enqueue(),
qman_fq_state() and qman_volatile_dequeue() have no caller.

The dpaa net and crypto drivers enqueue through qman_enqueue_multi()
and the order restoration variant, not the single frame
qman_enqueue(). Remove the functions, their declarations and the
documentation blocks that described them.

qman_query_fq_np() and qman_release_cgrid_range() are only reached
from qman_poll_fq_for_init() and qman_release_cgrid(), two static
inline wrappers in fsl_qman.h that have no caller of their own. The
wrappers go too, along with the BMAN_RELEASE_FLAG_NOW definition
which described the removed bman_release().

Signed-off-by: Stephen Hemminger <[email protected]>
---
 drivers/bus/dpaa/base/qbman/bman.c        |  40 --------
 drivers/bus/dpaa/base/qbman/bman_driver.c |  11 ---
 drivers/bus/dpaa/base/qbman/dpaa_alloc.c  |   5 -
 drivers/bus/dpaa/base/qbman/qman.c        | 110 ---------------------
 drivers/bus/dpaa/include/fsl_bman.h       |   9 +-
 drivers/bus/dpaa/include/fsl_qman.h       | 115 ----------------------
 drivers/bus/dpaa/include/fsl_usd.h        |   2 -
 7 files changed, 1 insertion(+), 291 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/bman.c 
b/drivers/bus/dpaa/base/qbman/bman.c
index 31114b2d57..9f7ace4e26 100644
--- a/drivers/bus/dpaa/base/qbman/bman.c
+++ b/drivers/bus/dpaa/base/qbman/bman.c
@@ -299,46 +299,6 @@ bman_release_fast(struct bman_pool *pool, const uint64_t 
*bufs,
        return 0;
 }
 
-int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num,
-                u32 flags __maybe_unused)
-{
-       struct bman_portal *p;
-       struct bm_rcr_entry *r;
-       u32 i;
-       u8 avail;
-
-#ifdef RTE_LIBRTE_DPAA_HWDEBUG
-       if (!num || (num > FSL_BM_BURST_MAX))
-               return -EINVAL;
-       if (pool->params.flags & BMAN_POOL_FLAG_NO_RELEASE)
-               return -EINVAL;
-#endif
-
-       p = get_affine_portal();
-       avail = bm_rcr_get_avail(&p->p);
-       if (avail < 2)
-               update_rcr_ci(p, avail);
-       r = bm_rcr_start(&p->p);
-       if (unlikely(!r))
-               return -EBUSY;
-
-       /*
-        * we can copy all but the first entry, as this can trigger badness
-        * with the valid-bit
-        */
-       r->bufs[0].opaque =
-               cpu_to_be64(((u64)pool->params.bpid << 48) |
-                           (bufs[0].opaque & MAX_U48));
-       for (i = 1; i < num; i++)
-               r->bufs[i].opaque =
-                       cpu_to_be64(bufs[i].opaque & MAX_U48);
-
-       bm_rcr_pvb_commit(&p->p, BM_RCR_VERB_CMD_BPID_SINGLE |
-                         (num & BM_RCR_VERB_BUFCOUNT_MASK));
-
-       return 0;
-}
-
 static inline uint64_t
 __rte_unused bman_extract_addr(struct bm_buffer *buf)
 {
diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c 
b/drivers/bus/dpaa/base/qbman/bman_driver.c
index 516c057e9d..8289901e60 100644
--- a/drivers/bus/dpaa/base/qbman/bman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/bman_driver.c
@@ -132,17 +132,6 @@ int bman_thread_finish(void)
        return fsl_bman_portal_finish();
 }
 
-void bman_thread_irq(void)
-{
-       qbman_invoke_irq(pcfg.irq);
-       /* Now we need to uninhibit interrupts. This is the only code outside
-        * the regular portal driver that manipulates any portal register, so
-        * rather than breaking that encapsulation I am simply hard-coding the
-        * offset to the inhibit register here.
-        */
-       out_be32(pcfg.addr_virt[DPAA_PORTAL_CI] + 0xe0c, 0);
-}
-
 int bman_init_ccsr(const struct device_node *node)
 {
        int ccsr_map_fd;
diff --git a/drivers/bus/dpaa/base/qbman/dpaa_alloc.c 
b/drivers/bus/dpaa/base/qbman/dpaa_alloc.c
index d3437bab0b..4b2d67bb54 100644
--- a/drivers/bus/dpaa/base/qbman/dpaa_alloc.c
+++ b/drivers/bus/dpaa/base/qbman/dpaa_alloc.c
@@ -60,11 +60,6 @@ int qman_alloc_cgrid_range(u32 *result, u32 count, u32 
align, int partial)
        return process_alloc(dpaa_id_cgrid, result, count, align, partial);
 }
 
-void qman_release_cgrid_range(u32 cgrid, u32 count)
-{
-       process_release(dpaa_id_cgrid, cgrid, count);
-}
-
 int qman_reserve_cgrid_range(u32 cgrid, u32 count)
 {
        return process_reserve(dpaa_id_cgrid, cgrid, count);
diff --git a/drivers/bus/dpaa/base/qbman/qman.c 
b/drivers/bus/dpaa/base/qbman/qman.c
index 3c056e4547..75a1b2251b 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -1298,14 +1298,6 @@ qman_portal_poll_rx(uint32_t poll_limit, void **bufs,
        return rx_number;
 }
 
-void qman_clear_irq(void)
-{
-       struct qman_portal *p = get_affine_portal();
-       u32 clear = QM_DQAVAIL_MASK | (p->irq_sources &
-               ~(QM_PIRQ_CSCI | QM_PIRQ_CCSCI));
-       qm_isr_status_clear(&p->p, clear);
-}
-
 u32 qman_portal_dequeue(struct rte_event ev[], unsigned int poll_limit,
                        void **bufs)
 {
@@ -1616,14 +1608,6 @@ u32 qman_fq_fqid(struct qman_fq *fq)
        return fq->fqid;
 }
 
-void qman_fq_state(struct qman_fq *fq, enum qman_fq_state *state, u32 *flags)
-{
-       if (state)
-               *state = fq->state;
-       if (flags)
-               *flags = fq->flags;
-}
-
 int qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts)
 {
        struct qm_mc_command *mcc;
@@ -1986,48 +1970,6 @@ int qman_query_fq_has_pkts(struct qman_fq *fq)
        return ret;
 }
 
-int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np)
-{
-       struct qm_mc_command *mcc;
-       struct qm_mc_result *mcr;
-       struct qman_portal *p = get_affine_portal();
-
-       u8 res;
-
-       mcc = qm_mc_start(&p->p);
-       mcc->queryfq.fqid = cpu_to_be32(fq->fqid);
-       qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP);
-       while (!(mcr = qm_mc_result(&p->p)))
-               cpu_relax();
-       DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_QUERYFQ_NP);
-       res = mcr->result;
-       if (res == QM_MCR_RESULT_OK) {
-               *np = mcr->queryfq_np;
-               np->fqd_link = be24_to_cpu(np->fqd_link);
-               np->odp_seq = be16_to_cpu(np->odp_seq);
-               np->orp_nesn = be16_to_cpu(np->orp_nesn);
-               np->orp_ea_hseq  = be16_to_cpu(np->orp_ea_hseq);
-               np->orp_ea_tseq  = be16_to_cpu(np->orp_ea_tseq);
-               np->orp_ea_hptr = be24_to_cpu(np->orp_ea_hptr);
-               np->orp_ea_tptr = be24_to_cpu(np->orp_ea_tptr);
-               np->pfdr_hptr = be24_to_cpu(np->pfdr_hptr);
-               np->pfdr_tptr = be24_to_cpu(np->pfdr_tptr);
-               np->ics_surp = be16_to_cpu(np->ics_surp);
-               np->byte_cnt = be32_to_cpu(np->byte_cnt);
-               np->frm_cnt = be24_to_cpu(np->frm_cnt);
-               np->ra1_sfdr = be16_to_cpu(np->ra1_sfdr);
-               np->ra2_sfdr = be16_to_cpu(np->ra2_sfdr);
-               np->od1_sfdr = be16_to_cpu(np->od1_sfdr);
-               np->od2_sfdr = be16_to_cpu(np->od2_sfdr);
-               np->od3_sfdr = be16_to_cpu(np->od3_sfdr);
-       }
-       if (res == QM_MCR_RESULT_ERR_FQID)
-               return -ERANGE;
-       else if (res != QM_MCR_RESULT_OK)
-               return -EIO;
-       return 0;
-}
-
 int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt)
 {
        struct qm_mc_command *mcc;
@@ -2209,43 +2151,6 @@ int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t 
vdqcr_flags)
        return ret;
 }
 
-int qman_volatile_dequeue(struct qman_fq *fq, u32 flags __maybe_unused,
-                         u32 vdqcr)
-{
-       struct qman_portal *p;
-       int ret = -EBUSY;
-
-       if ((fq->state != qman_fq_state_parked) &&
-           (fq->state != qman_fq_state_retired))
-               return -EINVAL;
-       if (vdqcr & QM_VDQCR_FQID_MASK)
-               return -EINVAL;
-       if (fq_isset(fq, QMAN_FQ_STATE_VDQCR))
-               return -EBUSY;
-       vdqcr = (vdqcr & ~QM_VDQCR_FQID_MASK) | fq->fqid;
-
-       p = get_affine_portal();
-
-       if (!p->vdqcr_owned) {
-               FQLOCK(fq);
-               if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) {
-                       FQUNLOCK(fq);
-                       goto escape;
-               }
-               fq_set(fq, QMAN_FQ_STATE_VDQCR);
-               FQUNLOCK(fq);
-               p->vdqcr_owned = fq;
-               ret = 0;
-       }
-escape:
-       if (ret)
-               return ret;
-
-       /* VDQCR is set */
-       qm_dqrr_vdqcr_set(&p->p, vdqcr);
-       return 0;
-}
-
 static noinline void update_eqcr_ci(struct qman_portal *p, u8 avail)
 {
        if (avail)
@@ -2318,21 +2223,6 @@ static inline struct qm_eqcr_entry 
*try_p_eq_start(struct qman_portal *p,
        return eq;
 }
 
-int qman_enqueue(struct qman_fq *fq, const struct qm_fd *fd, u32 flags)
-{
-       struct qman_portal *p = get_affine_portal();
-       struct qm_eqcr_entry *eq;
-
-       eq = try_p_eq_start(p, fq, fd, flags);
-       if (!eq)
-               return -EBUSY;
-       /* Note: QM_EQCR_VERB_INTERRUPT == QMAN_ENQUEUE_FLAG_WAIT_SYNC */
-       qm_eqcr_pvb_commit(&p->p, QM_EQCR_VERB_CMD_ENQUEUE |
-               (flags & (QM_EQCR_VERB_COLOUR_MASK | QM_EQCR_VERB_INTERRUPT)));
-       /* Factor the below out, it's used from qman_enqueue_orp() too */
-       return 0;
-}
-
 int qman_enqueue_multi(struct qman_fq *fq,
                       const struct qm_fd *fd, u32 *flags,
                int frames_to_send)
diff --git a/drivers/bus/dpaa/include/fsl_bman.h 
b/drivers/bus/dpaa/include/fsl_bman.h
index 8d4ef4a245..a0ae993727 100644
--- a/drivers/bus/dpaa/include/fsl_bman.h
+++ b/drivers/bus/dpaa/include/fsl_bman.h
@@ -238,9 +238,6 @@ struct bman_pool_params {
 #define BMAN_POOL_FLAG_DYNAMIC_BPID  0x00000008 /* (de)allocate bpid */
 #define BMAN_POOL_FLAG_THRESH        0x00000010 /* set depletion thresholds */
 
-/* Flags to bman_release() */
-#define BMAN_RELEASE_FLAG_NOW        0x00000008 /* issue immediate release */
-
 
 /**
  * bman_get_portal_index - get portal configuration index
@@ -338,15 +335,11 @@ __rte_internal
 const struct bman_pool_params *bman_get_params(const struct bman_pool *pool);
 
 /**
- * bman_release - Release buffer(s) to the buffer pool
+ * bman_release_fast - Release buffer(s) to the buffer pool
  * @pool: the buffer pool object to release to
  * @bufs: an array of buffers to release
  * @num: the number of buffers in @bufs (1-8)
- * @flags: bit-mask of BMAN_RELEASE_FLAG_*** options
- *
  */
-int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num,
-                u32 flags);
 __rte_internal
 int bman_release_fast(struct bman_pool *pool, const uint64_t *bufs,
        uint8_t num);
diff --git a/drivers/bus/dpaa/include/fsl_qman.h 
b/drivers/bus/dpaa/include/fsl_qman.h
index 12af1d8029..9a6d9e1edd 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -1593,18 +1593,6 @@ void qman_destroy_fq(struct qman_fq *fq, u32 flags);
 __rte_internal
 u32 qman_fq_fqid(struct qman_fq *fq);
 
-/**
- * qman_fq_state - Queries the state of a FQ object
- * @fq: the frame queue object to query
- * @state: pointer to state enum to return the FQ scheduling state
- * @flags: pointer to state flags to receive QMAN_FQ_STATE_*** bitmask
- *
- * Queries the state of the FQ object, without performing any h/w commands.
- * This captures the state, as seen by the driver, at the time the function
- * executes.
- */
-void qman_fq_state(struct qman_fq *fq, enum qman_fq_state *state, u32 *flags);
-
 /**
  * qman_init_fq - Initialises FQ fields, leaves the FQ "parked" or "scheduled"
  * @fq: the frame queue object to modify, must be 'parked' or new.
@@ -1708,13 +1696,6 @@ int qman_query_fq(struct qman_fq *fq, struct qm_fqd 
*fqd);
  */
 int qman_query_fq_has_pkts(struct qman_fq *fq);
 
-/**
- * qman_query_fq_np - Queries non-programmable FQD fields
- * @fq: the frame queue object to be queried
- * @np: storage for the queried FQD fields
- */
-int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np);
-
 /**
  * qman_query_fq_frmcnt - Queries fq frame count
  * @fq: the frame queue object to be queried
@@ -1733,61 +1714,6 @@ int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 
*frm_cnt);
  */
 int qman_query_wq(u8 query_dedicated, struct qm_mcr_querywq *wq);
 
-/**
- * qman_volatile_dequeue - Issue a volatile dequeue command
- * @fq: the frame queue object to dequeue from
- * @flags: a bit-mask of QMAN_VOLATILE_FLAG_*** options
- * @vdqcr: bit mask of QM_VDQCR_*** options, as per qm_dqrr_vdqcr_set()
- *
- * Attempts to lock access to the portal's VDQCR volatile dequeue 
functionality.
- * The function will block and sleep if QMAN_VOLATILE_FLAG_WAIT is specified 
and
- * the VDQCR is already in use, otherwise returns non-zero for failure. If
- * QMAN_VOLATILE_FLAG_FINISH is specified, the function will only return once
- * the VDQCR command has finished executing (ie. once the callback for the last
- * DQRR entry resulting from the VDQCR command has been called). If not using
- * the FINISH flag, completion can be determined either by detecting the
- * presence of the QM_DQRR_STAT_UNSCHEDULED and QM_DQRR_STAT_DQCR_EXPIRED bits
- * in the "stat" field of the "struct qm_dqrr_entry" passed to the FQ's dequeue
- * callback, or by waiting for the QMAN_FQ_STATE_VDQCR bit to disappear from 
the
- * "flags" retrieved from qman_fq_state().
- */
-int qman_volatile_dequeue(struct qman_fq *fq, u32 flags, u32 vdqcr);
-
-/**
- * qman_enqueue - Enqueue a frame to a frame queue
- * @fq: the frame queue object to enqueue to
- * @fd: a descriptor of the frame to be enqueued
- * @flags: bit-mask of QMAN_ENQUEUE_FLAG_*** options
- *
- * Fills an entry in the EQCR of portal @qm to enqueue the frame described by
- * @fd. The descriptor details are copied from @fd to the EQCR entry, the 'pid'
- * field is ignored. The return value is non-zero on error, such as ring full
- * (and FLAG_WAIT not specified), congestion avoidance (FLAG_WATCH_CGR
- * specified), etc. If the ring is full and FLAG_WAIT is specified, this
- * function will block. If FLAG_INTERRUPT is set, the EQCI bit of the portal
- * interrupt will assert when Qman consumes the EQCR entry (subject to "status
- * disable", "enable", and "inhibit" registers). If FLAG_DCA is set, Qman will
- * perform an implied "discrete consumption acknowledgment" on the dequeue
- * ring's (DQRR) entry, at the ring index specified by the FLAG_DCA_IDX(x)
- * macro. (As an alternative to issuing explicit DCA actions on DQRR entries,
- * this implicit DCA can delay the release of a "held active" frame queue
- * corresponding to a DQRR entry until Qman consumes the EQCR entry - providing
- * order-preservation semantics in packet-forwarding scenarios.) If FLAG_DCA is
- * set, then FLAG_DCA_PARK can also be set to imply that the DQRR consumption
- * acknowledgment should "park request" the "held active" frame queue. Ie.
- * when the portal eventually releases that frame queue, it will be left in the
- * Parked state rather than Tentatively Scheduled or Truly Scheduled. If the
- * portal is watching congestion groups, the QMAN_ENQUEUE_FLAG_WATCH_CGR flag
- * is requested, and the FQ is a member of a congestion group, then this
- * function returns -EAGAIN if the congestion group is currently congested.
- * Note, this does not eliminate ERNs, as the async interface means we can be
- * sending enqueue commands to an un-congested FQ that becomes congested before
- * the enqueue commands are processed, but it does minimise needless thrashing
- * of an already busy hardware resource by throttling many of the to-be-dropped
- * enqueues "at the source".
- */
-int qman_enqueue(struct qman_fq *fq, const struct qm_fd *fd, u32 flags);
-
 __rte_internal
 int qman_enqueue_multi(struct qman_fq *fq, const struct qm_fd *fd, u32 *flags,
                       int frames_to_send);
@@ -2061,17 +1987,6 @@ static inline int qman_alloc_cgrid(u32 *result)
        return (ret > 0) ? 0 : ret;
 }
 
-/**
- * qman_release_cgrid_range - Release the specified range of CGR IDs
- * @id: the base CGR ID of the range to deallocate
- * @count: the number of CGR IDs in the range
- */
-void qman_release_cgrid_range(u32 id, unsigned int count);
-static inline void qman_release_cgrid(u32 id)
-{
-       qman_release_cgrid_range(id, 1);
-}
-
 /**
  * qman_reserve_cgrid_range - Reserve the specified range of CGR ID
  * @id: the base CGR ID of the range to reserve
@@ -2087,36 +2002,6 @@ void qman_seed_cgrid_range(u32 id, unsigned int count);
 
        /* Helpers */
        /* ------- */
-/**
- * qman_poll_fq_for_init - Check if an FQ has been initialised from OOS
- * @fqid: the FQID that will be initialised by other s/w
- *
- * In many situations, a FQID is provided for communication between s/w
- * entities, and whilst the consumer is responsible for initialising and
- * scheduling the FQ, the producer(s) generally create a wrapper FQ object 
using
- * and only call qman_enqueue() (no FQ initialisation, scheduling, etc). Ie;
- *     qman_create_fq(..., QMAN_FQ_FLAG_NO_MODIFY, ...);
- * However, data can not be enqueued to the FQ until it is initialised out of
- * the OOS state - this function polls for that condition. It is particularly
- * useful for users of IPC functions - each endpoint's Rx FQ is the other
- * endpoint's Tx FQ, so each side can initialise and schedule their Rx FQ 
object
- * and then use this API on the (NO_MODIFY) Tx FQ object in order to
- * synchronise. The function returns zero for success, +1 if the FQ is still in
- * the OOS state, or negative if there was an error.
- */
-static inline int qman_poll_fq_for_init(struct qman_fq *fq)
-{
-       struct qm_mcr_queryfq_np np;
-       int err;
-
-       err = qman_query_fq_np(fq, &np);
-       if (err)
-               return err;
-       if ((np.state & QM_MCR_NP_STATE_MASK) == QM_MCR_NP_STATE_OOS)
-               return 1;
-       return 0;
-}
-
 #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 #define cpu_to_hw_sg(x)
 #define hw_sg_to_cpu(x)
diff --git a/drivers/bus/dpaa/include/fsl_usd.h 
b/drivers/bus/dpaa/include/fsl_usd.h
index d4e2ea139d..d9363e830a 100644
--- a/drivers/bus/dpaa/include/fsl_usd.h
+++ b/drivers/bus/dpaa/include/fsl_usd.h
@@ -72,10 +72,8 @@ int bman_thread_fd(void);
 __rte_internal
 void qman_thread_irq(void);
 
-void bman_thread_irq(void);
 __rte_internal
 void qman_fq_portal_thread_irq(struct qman_portal *qp);
-void qman_clear_irq(void);
 
 /* Global setup */
 int qman_global_init(void);
-- 
2.53.0

Reply via email to