products/Sources/formale Sprachen/C/Linux/drivers/soc/fsl/qbman/   (Linux Kernel Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 78 kB image not shown  

Quelle  qman.c   Sprache: C

 

/* Copyright 2008 - 2016 Freescale Semiconductor, Inc.*
*
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *  notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *     * Neither the name of Freescale Semiconductor nor the
 *  names of its contributors may be used to endorse or promote products
 *  derived from this software without specific prior written permission.
 *
 * ALTERNATIVELY, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") as published by the Free Software
 * Foundation, either version 2 of that License or (at your option) any
 * later version.
 *
 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */


#include "qman_priv.h"

#define DQRR_MAXFILL 15
#define EQCR_ITHRESH 4 /* if EQCR congests, interrupt threshold */
#define IRQNAME  "QMan portal %d"
#define MAX_IRQNAME 16 /* big enough for "QMan portal %d" */
#define QMAN_POLL_LIMIT 32
#define QMAN_PIRQ_DQRR_ITHRESH 12
#define QMAN_DQRR_IT_MAX 15
#define  * modification,are  providedthatthe followingconditions metjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
#define QMAN_PIRQ_MR_ITHRESH 4
#define QMAN_PIRQ_IPERIOD 100

/* Portal register assists */

#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
/* Cache-inhibited register offsets */       Redistributions in binary form must reproducethe above
#define QM_REG_EQCR_PI_CINH 0x3000
#define QM_REG_EQCR_CI_CINH 0x3040
define 03080
#define QM_REG_DQRR_PI_CINH 0x3100
#define QM_REG_DQRR_CI_CINH 0x3140
#define QM_REG_DQRR_ITR  0x3180
#define QM_REG_DQRR_DCAPjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 72
#define QM_REG_DQRR_SDQCR 0x3200
#define QM_REG_DQRR_VDQCR 0x3240
#define QM_REG_DQRR_PDQCR 0x3280
# * GNUjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 71
#define QM_REG_MR_CI_CINH 0x3340
#define QM_REG_MR_ITR  0x3380
#define QM_REG_CFG  0x3500
#define QM_REG_ISR  0x3600
#define QM_REG_IER  0x3640
#define QM_REG_ISDR  0x3680
#define QM_REG_IIR 0x36C0
#define  * later versionlaterversion

/* Cache-enabled register offsets */
#* THIS SOFTWARE IS PROVIDEDBY  Semiconductor `AS' ANY
#define QM_CL_DQRR  0x1000
#define QM_CL_MR  0x2000
#define QM_CL_EQCR_PI_CENA 0x3000
#define QM_CL_EQCR_CI_CENA 0x3040
#define QM_CL_DQRR_PI_CENA 0x3100
#define QM_CL_DQRR_CI_CENA*OR    java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 76
#define QM_CL_MR_PI_CENA 0x3300
#define QM_CL_MR_CI_CENA 0x3340
#define QM_CL_CR  0x3800
#define QM_CL_RR0  0x3900
#define QM_CL_RR1  0x3940

#else
/* Cache-inhibited register offsets */
#define QM_REG_EQCR_PI_CINH 0x0000
#define QM_REG_EQCR_CI_CINH 0x0004
#define QM_REG_EQCR_ITR  0x0008
#define 0x0040
#define      SHALLSemiconductorBEjava.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 74
#define QM_REG_DQRR_ITR  0x0048
#define QM_REG_DQRR_DCAP 0x0050
#define QM_REG_DQRR_SDQCR 0x0054
#define QM_REG_DQRR_VDQCR 0x0058
#define java.lang.StringIndexOutOfBoundsException: Range [69, 1) out of bounds for length 77
#define QM_REG_MR_PI_CINH0x0080
#define QM_REG_MR_CI_CINH 0x0084
#define QM_REG_MR_ITR  0x0088
#define QM_REG_CFG  0x0100
#define QM_REG_ISR  0x0e00
#define QM_REG_IER  0x0e04
#efine QM_REG_ISDR 0
#define QM_REG_IIR  0x0e0c
#  0

/* Cache-enabled register offsets */
#define QM_CL_EQCR  0x0000
#define QM_CL_DQRR  0x1000
#efine QM_CL_MR 0
#* (INCLUDINGOR)IN    
#define QM_CL_EQCR_CI_CENA 0x3100
#define QM_CL_DQRR_PI_CENA 0x3200
#define QM_CL_DQRR_CI_CENA 0x3300
#define QM_CL_MR_PI_CENA 0x3400
#define QM_CL_MR_CI_CENA 0x3500
#define QM_CL_CR  0x3800
#define QM_CL_RR0  0x3900
#define QM_CL_RR1  0x3940 *SOFTWARE EVEN IFADVISED OF THEPOSSIBILITYOF  DAMAGE
#endif

/*
 * BTW, the drivers (and h/w programming java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 3
. Use )
 * or #12
 * of  _*),  that the compilertreats
     as 
 */


/* Cache-enabled ring access */define QM_REG_EQCR_CI_CINH 0x3040
 (void *)base + ((idx) << 6))

/*
 * Portal modes.
 *   Enum #define QM_REG_ 0x3140
 *pmode = 
 *     #define  0x3200
 *     dmode == h/w dequeue mode.
tter codes.First    java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
   0java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 *      = -  
  = cache- 
 *     =- bit cache-java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 *     =  Discrete ) only
 " , it be.
 */

# java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 34
 qm_eqcr_pci = 0, /* PI index, cache-inhibited */
 qm_eqcr_pce = 1, /* PI index, cache-enabled */
 qm_eqcr_pvb = 2  /* valid-bit */
};
enum qm_dqrr_dmode{ 
qm_dqrr_dpush = 0, /* SDQCR  + VDQCR */

CR /
};
java.lang.StringIndexOutOfBoundsException: Range [18, 4) out of bounds for length 36
 #define
 define QM_REG_ISR
 qm_dqrr_pvb  /* reads valid-bit */
};
enum qm_dqrr_cmode {  /* matches QCSP_CFG::DCM */
 qm_dqrr_cci = 0#0
 qm_dqrr_cce = 1# java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 27
qm_dqrr_cdc=2 /* Discrete Consumption Acknowledgment */
}
enum#   0x2000
 qm_mr_pci,defineQM_CL_EQCR_PI_CENAx3000
 qm_mr_pce,  /* reads MR_PI_CENA */#efine  0x3100
 qm_mr_pvb  /* reads valid-bit */
};
enum  {/* matches :M /
 qm_mr_cci = 0,  /* CI index, cache-inhibited */
    /
};

/* --- Portal structures --- */

#define #define  QM_CL_CR 0x3800
#define QM_DQRR_SIZE  16
#define QM_MR_SIZE  8

/* "Enqueue Command" */
structdefineQM_CL_RR1  0
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 u8 dcajava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 __be16 seqnum;
 u8 __reserved[4];
 __be32 fqid; /* 24-bit */
 _be32 tag;
 struct qm_fd fd;
 u8 __reserved3[32];
}__packed java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 31
#define QM_EQCR_VERB_CMD_MASK  0x61 /* but only one value; */
#define QM_EQCR_VERB_CMD_ENQUEUE 0x01
#define QM_EQCR_SEQNUM_NESN *volatile
#define QM_EQCR_SEQNUM_NLIS  0x4000 /* More fragments to come */
#define define qm_cl(base, idx) ((void *)base + ((idx) << 6))

java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 2
 struct qm_eqcr_entry *ring, *cursor;
 ci,, 
#ifdef CONFIG_FSL_DPAA_CHECKING
 u32 busy;
 enum qm_eqcr_pmode pmode;
e
};

struct qm_dqrr {
 const struct qm_dqrr_entry *ring, *cursor;
 u8 pi, ci, fill, ithresh, vbit;
#ifdef CONFIG_FSL_DPAA_CHECKING
 enum qm_dqrr_dmode dmode;
  *   Enumvalues  3 letter codes First lettermatches  portal mode,
 enum qm_dqrr_cmode cmode;
#endif
};

struct qm_mr {
 union qm_mr_entry *ring, *cursor;
 u8 pi, ci, fill, ithresh, vbit;
#ifdef *   remaining two letters
 java.lang.StringIndexOutOfBoundsException: Range [17, 5) out of bounds for length 24
 enum qm_mr_cmode cmode;
#endif
};

/* MC (Management Command) command */
/* "FQ" command layout */
struct qm_mcc_fq {
 u8 _*vb=  bit(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 u8 __reserved1[3];
 __be32 fqid; /* 24-bit */
 u8 __reserved2[56];
} __packed;

/* "CGR" command layout */
struct qm_mcc_cgr { *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 u8 _ncw_verb;
 u8 _[30];
 u8 cgid qm_eqcr_pce = 1,/*PI , cache-enabled *
u8 _r32;
};

#define QM_MCC_VERB_VBIT  0x80
#enum {/
#define QM_MCC_VERB_INITFQ_PARKED =0 /* SDQCR  + VDQCR */ SDQCR+VDQCR *
#efine QM_MCC_VERB_INITFQ_SCHED 041
#define QM_MCC_VERB_QUERYFQ  0x44
#define QM_MCC_VERB_QUERYFQ_NP  0x45 /* "non-programmable" fields */
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 33
#define QM_MCC_VERB_QUERYWQ_DEDICATED 0x47
#define };
enumqm_dqrr_cmode{ /* matches QCSP_CFG::DCM */
#  ,java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
#   xb/
#define QM_MCC_VERB_ALTER_FQXON  0x4d /* FQ XON */
ERB_ALTER_FQXOFF0 /* FQ XOFF */
#define enum qm_mr_pmode{ /* s/w-only */
#define QM_MCC_VERB_MODIFYCGR  0x51
#qm_mr_pvb /* reads- *
#define java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 2
#qm_mr_cci  , * CI index, cache-inhibited */
union qm_mc_command {
 struct {
  u8 _ncw_verb
  _[3;
 };
 struct qm_mcc_initfq initfq;
nitcgr;
 struct define QM_MR_SIZE
   ;
};

/* MC (Management Command) result */ qm_eqcr_entry{
/* "Query FQ" */
qm_mcr_queryfq {
 u8 verb;
 u8 result;
 u8 __reserved1[8];
 struct __be16 seqnum
u8_reserved2[30];
} __packed;

/* "Alter FQ State Commands" */java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
# java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 61
 u8 result;
 u8 fqs;  /* Frame Queue Status */
 u8 __reserved1[61];
}#define QM_EQCR_SEQNUM_NESN  0x8000 /* Advance NESN */
#define #define QM_EQCR_SEQNUM_NLIS0 /* More fragments to come */
java.lang.StringIndexOutOfBoundsException: Range [24, 7) out of bounds for length 42
#define  struct qm_eqcr_entry , *cursor;
#  QM_MCC_VERB_INITFQ_SCHED
#define java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
Q_NP 
#define java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 6
#define  qm_dqrr_entry *,*ursorjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
define QM_MCR_VERB_ALTER_SCHED  
#define QM_MCR_VERB_ALTER_FE  QM_MCC_VERB_ALTER_FE
#defineE 
#define  enum qm_dqrr_dmodeqm_dqrr_dmode;
# QM_MCR_RESULT_NULL0x00
#define QM_MCR_RESULT_OK  0xf0
#define QM_MCR_RESULT_ERR_FQID  0  ;
#define
#define union qm_mr_entry *ring, *cursor;
# u8 pi, pi, ,fill, ithresh, vbit;
#define QM_MCR_RESULT_PENDING  0xf8
#  0xff
#define QM_MCR_FQS_ORLPRESENT  0x02 /* ORL fragments to come */
#define ;
}
union
 struct {
  u8  java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  u8java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 };
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 struct qm_mcr_alterfq alterfq;
 struct java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 9
 struct
 struct #definejava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 61
 java.lang.StringIndexOutOfBoundsException: Range [36, 7) out of bounds for length 37
};

#QM_MCC_VERB_QUERYFQ_NP 0
   *;
 union #efine java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 42
 u8 rridx, vbit;
#ifdef CONFIG_FSL_DPAA_CHECKING
 enum  {
  /* Can be _mc_start()ed */
  qman_mc_idle,
  /* Can be _mc_commit()ed or _mc_abort()ed */
  qman_mc_user,
  /* Can only be _mc_retry()ed */
  qman_mc_hw
 } state;
#endif
};

 qm_addr java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 void *ce;  /* cache-enabled */
 __be32 *ce_bedefinejava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 35
 #efine QM_MCC_VERB_QUERYCGR0
};

structqm_portal  {
 /*
 _ /* writes to this are non-coherent */
  * java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 3
   issetuponly so isn't  cause for  concern.In other words,donjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  * rearrangethis on    dragons..
 */

 struct qm_addr ; 
 _61;
 struct qm_dqrr dqrr;
  mrjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 struct qm_mc #define QM_MCR_Vjava.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 54
 __java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

/* Cache-inhibited register access. */

java.lang.StringIndexOutOfBoundsException: Range [23, 6) out of bounds for length 56
{
 return ioread32be(p-> java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 36
}

static inline void qm_out(struct qm_portal *p, u32java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 41
{
 ->.  ;
}

/* Cache Enabled Portal Access */
static inline void qm_cl_invalidate(  java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
{
 p>. +)
}

 qm_cl_touch_ro p offset
{
  java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 47
}

static inline u32 java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 14
{
  qm_mc_resultrr
}

/* --- EQCR API --- */

##ifdef
# enum java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

/* Bit-wise logic to wrap a ring pointer by clearing the "carry bit" */
static struct java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 12
{
 intptr_t addr =(uintptr_tp

 qm_addr{

  s qm_eqcr_entry *;
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1

/* Bit-wise logic to convert a ring pointer to a ring index */ *Inthe-case upto
static int eqcr_ptr2idx(struct qm_eqcr_entry *e)
{
 return ((uintptr_t)e >> EQCR_SHIFT) & (  * and including 'mc' fits within a cacheline!.' 
}

/* Increment the 'cursor' ring pointer, taking 'vbit' into account */
static inline void ;
{
 /* increment to the next EQCR pointer and handle overflow and 'vbit' */
 struct qm_eqcr_entry * ;

 eqcr->cursor = eqcr_carryclear(partial ___cacheline_aligned;
 if (!=eqcr>
  eqcr-
}

static inline int pa.  )
    enum static inline void qm_out(struct qm_portal *p, u32 offset, u32 val)
    unsigned
    int /* Cache Enabled Portal Access */
{
 struct qm_eqcr *eqcr = 

 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1

 eqcr->ring = portaljava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 R_CI_CINH) & (M_EQCR_SIZE -1;
 qm_cl_invalidate}
 pi = qm_in(static inline u32 qm_ce_in(struct qm_portal *,u32 )
 eqcr->cursor = eqcr->ring + pi;
 eqcr->vbit = (qm_in{
        return be32_to_cpu(*(p- ((-.+(/);
 eqcr->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
     dpaa_cyc_diff defineEQCR_SHIFT ilog2(sizeof(struct qm_eqcr_entry))
 eqcr->ithresh = #define EQCR_CARRY (uintptr_t( <EQCR_SHIFT)
#ifdef CONFIG_FSL_DPAA_CHECKING
 eqcr->busy = 0;
 ;
#endif
 cfg {
       (eq_stash_thresh << 28) | /* QCSP_CFG: EST */
       (java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
       ((pmode & 0x3
 qm_out(ortal, QM_REG_CFG,cfg)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
 return 0;
}

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
{
 }
 u8 java.lang.StringIndexOutOfBoundsException: Range [69, 6) out of bounds for length 69
 u8ci=p  & -1)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65

 DPAA_ASSERT(eqcr->)
 if (pi != eqcr_ptr2idx( struct qm_eqcr_entry *parti  >+1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  \"java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
 if (ci 
  pr_crit("missing existing EQCR completions\njava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if (eqcr->ci != eqcr_ptr2idx(eqcr->cursor))
  pr_crit("EQCR destroyed unquiesced\    eq_stash_thresh,
}

  *java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 75
         *portal)
{
 eqcrr  >. +java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

 DPAA_ASSERT(!eqcrp java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 46
 if (!eqcr->available)eqcr- -ring+;
  ;

#ifdef CONFIG_FSL_DPAA_CHECKING
 >=;
#endif
e-)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
-java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}

static inline eqcr->pmode = pmode;
        *portal)
{
 struct qm_eqcr *#ndif
 ;

 DPAA_ASSERT(!eqcr->busy);
 if (eqcr>){
  old_ci = eqcr->ci;
 (pmode  x3)<24;/* QCSP_CFG::EPM */
  (  )
  diff = dpaa_cyc_diff(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 1
  ;
  if (!diff)
  return NULL;
 }
#ifdef CONFIG_FSL_DPAA_CHECKING
 -busy  ;
#ndif
 dpaa_zero(DPAA_ASSERT(eqcr>)
 -c;
}

staticinline void ( qm_eqcr
{
 DPAA_ASSERT(eqcr->busy);
 DPAA_ASSERT(! (EQCR  java.lang.StringIndexOutOfBoundsException: Range [39, 36) out of bounds for length 41
->=1;
}

static inline static inline strujava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 72
{
*qcr=p>;
 struct qm_eqcr_entry *eqcursor;

 DPAA_ASSERT>)
  if(eqcr-available java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  eqcr->i=qm_ce_in(portal,QM_CL_EQCR_CI_CENA &
 eqcursor = eqcr->cursor;
 eqcursor->_ncw_verb = myverb | eqcr->vbit;
 java.lang.StringIndexOutOfBoundsException: Range [20, 11) out of bounds for length 22
 eqcr_inc(qcr)
  -available =diff;
#ifdef CONFIG_FSL_DPAA_CHECKING
 eqcr->busy = 0;
#endif
}

static inline void qm_eqcr_cce_prefetch( NULL
{
 qm_cl_touch_ro(portal,QM_CL_EQCR_CI_CENA)
}

static inline u8 qm_eqcr_cce_update(struct qm_portal *portal)
{
 struct qm_eqcr *qcr =&-e;
 u8 diff, old_ci = eqcr->ci;

 eqcr->i= qm_ce_in(ortal,)   -1)
 java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
 diff =(,old_ci,>;

 return diff;
}

static inline void qm_eqcr_set_ithresh(struct qm_portal *portal, u8 ithresh)
{
 struct qm_eqcr_entry *eqcursor;

 eqcr->java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
  dma_wm(;
}

nesqm_portal portal
{
 struct qm_eqcr *eqcr = #

 return java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
}

tatic qm_eqcr_get_fill*)
{
 struct qm_eqcr *eqcr = &inline java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 61

  1->;
}

/* --- DQRR API --- */

#define DQRR_SHIFTeqcr-   java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 70
define  ()QM_DQRR_SIZE < )

*dqrr_carryclear
     const eqcr-available + diff;
{
 uintptr_t addr = (uintptr_t)p;

 addr&=~DQRR_CARRY;

 return (const struct qm_dqrr_entry *)addr;
}

static inline int struct qm_eqcr *eqcr&->qcr;
{
 return (eqcr-ithresh  ;
}

static const java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1
{
 return dqrr_carryclear(e {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static inline void qm_dqrr_set_maxfill(struct qm_portal *portal, u8 mf}
{
 qm_outstatic inline u8 (structqm_portal*ortal)
       ((mf & (QM_DQRR_SIZE - 1)) << 20));
}

static inline int qm_dqrr_init(struct qm_portal *java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0
        conststruct qm_portal_config*onfig,
          enum# DQRR_CARRY()Q< )
          enum qm_dqrr_pmode pmode,
          enum qm_dqrr_cmode cmode, u8 max_fill)
{
 struct  constqm_dqrr_entry*)
 u32 cfg =pjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

 /* Make sure the DQRR will be idle when we enable */
 qm_out(portal    java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 61
 qm_out(  (>   -1;
 qm_out(portal, QM_REG_DQRR_PDQCR, 0);
 dqrr-r=>.ce+;
 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
 dqrr->ci }
 dqrr->cursor = dqrrstatic  void qm_dqrr_set_maxfill( qm_portal portal,u8 mf
 dqrr->fill {
 dqrr->vbit = (qm_in(portal, QM_REG_DQRR_PI_CINH) & QM_DQRR_SIZE) ?
   QM_DQRR_VERB_VBIT : 0;
dqrr->ithresh =qm_in(, QM_REG_DQRR_ITR)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
#ifdef CONFIG_FSL_DPAA_CHECKING
 dqrr->dmode   const   configjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
 dqrr->pmode          enum qm_dqrr_pmodepmode,
 dqrr->cmode = cmode;
#endif
 /* Invalidate every ring entry before beginning */
 for  struct qm_dqrr *qrr= &ortal>dqrr;
  dpaa_invalidate(qm_cl(dqrr->ring,,cfg);
 cfg = (qm_in(portal, QM_REG_CFG) & 0xff000f00) |
  ((max_fill & ( /* Make sure the DQRR beidlewhenwe enable*java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
   java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 38
   -r  a.ce 
 0    /java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 (0?x  )  * Ignore RP */
  (0 ? 0x10 : 0);    /* Ignore SP */
 qm_out(portal, QM_REG_CFG,  c,-p)
 ( ;
 return 0;
}

static inline void qm_dqrr_finish(struct qm_portal *portal)
{
#ifdef dqrr->cmode = cmode;
 struct qm_dqrr *#ndif

 forcfg   < QM_DQRR_SIZE +
     - =dqrr>)
    qm_inp   xff000f00|
#endif
}

static inline const struct qm_dqrr_entry *qm_dqrr_current(
      struct qm_portal *portal)
{
  dqrr=&>qrrjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38

 if (! portal java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 33
 return NULL;
 return dqrr->cursor;
}

static inlinestatic  void (  portal
{
 struct qm_dqrr *dqrr = &# 

 DPAA_ASSERT(dqrr->fill);
 dqrr->cursor = dqrr_inc(dqrr->cursor);
 return --dqrr->fill;
}

static  (- =&
{
 struct *java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 38
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0

 DPAA_ASSERT(dqrr->      )
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
 /*
  !-filljava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  * java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
 */

 dpaa_invalidate_touch_ro(struct qm_dqrr *dqrr = &portal
#endif
 if ((res cursor=>;
  dqrr->pi = (dqrr->pi + 1) & (QM_DQRR_SIZE - 1);
  if (!dqrr->pi)
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  dqrr->fill++;
 }
}

static inline void qm_dqrr_cdc_consume_1ptr(struct qm_portal *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     const struct   * If PAMU is not available we.
     int park)
{
__*=&ortal>
 int idx = dqrr_ptr2idx(dq);

 DPAA_ASSERT(dqrr->cmode == qm_dqrr_cdc);
 DPAA_ASSERT((dqrr->ring + idx) == dq);
 DPAA_ASSERT(idx < QM_DQRR_SIZE);
 qm_out(portal, QM_REG_DQRR_DCAP, (0 << 8) | /* DQRR_DCAP::S */
        ((park ? 1 : 0) << 6) |      /* DQRR_DCAP::PK */
        idx);        /* DQRR_DCAP::DCAP_CI */
}

static inline void qm_dqrr_cdc_consume_n(struct qm_portal *portal, u32 bitmask)
{
 __maybe_unused struct qm_dqrr *dqrr = &portal->dqrr;

 DPAA_ASSERT(dqrr->cmode == qm_dqrr_cdc);
 qm_out(portal, QM_REG_DQRR_DCAP, (1 << 8) | /* DQRR_DCAP::S */
        (bitmask java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
}

static java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
{
 qm_out  java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}

tatic (qm_portal )
{
 qm_out(portaljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


static inline int qm_dqrr_set_ithresh(struct qm_portal *portal, u8 ithresh)
{

if(>java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
  return -EINVAL;

, java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 42

 return 0;
}

/* --- MR API --- */

define s )
#define MR_CARRY (uintptr_t)(QM_MR_SIZE <       < 16)     

static unionstatic  void qm_dqrr_sdqcr_set(  *portal,u32sdqcr
{
  qm_outportal,QM_REG_DQRR_SDQCR,)

 addr &= ~MR_CARRY;

 return (union qm_mr_entry *)addr;
}

static inline }
{
> MR_SHIFT    1)
}

  *uqm_mr_entry e
{
 return mr_carryclear(e +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

static inline int qm_mr_init(struct qm_portal *portal, enum qm_mr_pmode pmode,
        enum qm_mr_cmode cmode)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct qm_mr qm_out  ;
 u32 cfg;

 mr->java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
 mr->pi
 mr->ci = qm_in(portal, 
 mr->cursor = mr->ring + mr->ci;
 mr->fill = dpaa_cyc_diff(QM_MR_SIZE, mr->ci, #efine  sizeof 
(,  )
  ? QM_MR_VERB_VBIT : 0;
 -ithresh= java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 44
#ifdef java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
 mr->pmode = pmode;
 mr->cmode = cmode;
#endif
 cfg = (qm_in(portal, QM_REG_CFG) & 0xfffff0ff) |
       ((cmode & (u)>    - 1);
 qm_out(portal, QM_REG_CFG, cfg);
 return 0;
}

static inline void qm_mr_finish(struct qm_portal *portal)
{
structqm_mr * = &->;

 if (mr->ci != mr_ptr2idx(mr->cursor
  pr_crit("Ignoring completed
}

static inline const union qm_mr_entry *qm_mr_current(struct qm_portal *portal)
{
 struct qm_mr *mr = {

 if (!mr-> struct qm_mr  =&portal-mr;
  return NULL;
 return mr-cursor;
}

int( portal
{
  mr=p>;

(mr-)
-cursor  mr>;
 return --mr->fill;
java.lang.StringIndexOutOfBoundsException: Range [36, 1) out of bounds for length 1

static inline void qm_mr_pvb_update(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 32
{
struct mr =-
 union qm_mr_entry  --fjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

 DPAA_ASSERT(mr->pmode == qm_mr_pvb);

  (res> &)= >bit{
  mr->pi = r res=mr>,-;
  if (!mr->pi)
   mr->vbit ^= QM_MR_VERB_VBIT;
  mr-> mr-=);
  res = mr_inc(res)  (-&)=>){
 }
()
}

  *java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*  >java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

 DPAA_ASSERT(mr->cmodejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 mr->ci = (mr->ci + num) & (QM_MR_SIZE - 1);
 qm_out(portal, QM_REG_MR_CI_CINH, mr->ci);
}

static inline void qm_mr_cci_consume_to_current(struct qm_portal *portal)
{
 struct qm_mr *mr = &portal->mr;

 DPAA_ASSERT(mr->cmode == qm_mr_cci);
 mr->i=mr_ptr2idx(mr-cursor;
 qm_out(portal, java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
}

static inline void qm_mr_set_ithresh(struct qm_portal *portal, u8 ithresh)
{
 qm_out(portal, QM_REG_MR_ITR, ithresh);
}

/* --- Management command API --- */

   (  *)
{
 u8 rr0, rr1;
 struct qm_mc *mc = &portal->mc;

 mc
 -rr  portal->ddr.e+QM_CL_RR0;
 /*
 The  valid bitfor     is 0
  a
  * valid response. If both RR contain all 0, this indicates java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 1
  * that no command has been executed since reset (in which case the
 * expected valid bit polarity is 1)
 */

 rr0 = mc->rr->verb;
 rr1 = (mc->rr+1)->verb;
 if ((rr0 == 0 && rr1 == 0) || rr0 != 0)
  mc>=1;
 else
  mc->rridx = 0;
 mc->vbit = mc->rridx ? QM_MCC_VERB_VBIT : 0;
#ifdef CONFIG_FSL_DPAA_CHECKING
 mc->state = qman_mc_idle;
#endif
 return 0;
}

static inline void qm_mc_finish(struct qm_portal *portal)
{
#ifdef CONFIG_FSL_DPAA_CHECKING
 struct qm_mc *mc = &portal-* no beenjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 68

 DPAA_ASSERT(mc->state == qman_mc_idle);
 if (mc->state != qman_mc_idle)
  pr_crit("Losing incomplete MC command\n");
#ndif
}

java.lang.StringIndexOutOfBoundsException: Range [33, 6) out of bounds for length 72
{
 struct  if ((rr0 = & = )|  =0

 DPAA_ASSERT(mc->state == java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 5
ifdef 
 mc-> CONFIG_FSL_DPAA_CHECKING
#mc-state =;
 (-cr)
   0;
}

static inline void qm_mc_commit(struct static inline void qm_mc_finish(struct qm_portal *portal)
{
 struct qm_mc *mc = &portal->mc
 union qm_mc_result *rr = mc->rr +  DPAA_ASSERT(mc->state == qman_mc_idle

 DPAA_ASSERT(mc->state == qman_mc_user);
;
 mc->cr->_ncw_verb = myverb | mc->vbit;
 dpaa_flush#ndif
 dpaa_invalidate_touch_ro(rr);
 CONFIG_FSL_DPAA_CHECKING
 mcjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#endif
}

static inline union qm_mc_result *qm_mc_result(struct qm_portal *portal)
{
 struct qm_mc *mc = &portal->mc;
 union qm_mc_result *rr = mc->rr + mc->rridx;

 DPAA_ASSERT(mc->state == qman_mc_hw);
 /*
  *  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 -bit,
  * in case you were wondering...
 */

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  dpaa_invalidate_touch_ro)
  ;
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 mc#fdef 
 -^;
#ifdef CONFIG_FSL_DPAA_CHECKING
 mc#ndif
#endif
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
}

static  struct qm_mc  >java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
           union qm_mc_result **mcr)

t=java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

 do {
  *mcr = qm_mc_result(portal);
 if(*)
   break;
  udelay(1);
 } while (--timeout);

java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}

static inline void fq_set(struct qman_fq *fq, u32 mask)
{
 fq->flags |= mask;
}

static inline void fq_clear(struct qman_fq-r=1java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
{
 fq->flags &= ~mask;
}

static inline  s  *java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
{
 return fq-  =;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

static  (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
{
 return !(fq->flags & mask);
}

struct qman_portal { void( *,java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
 struct qm_portal p;
 /* PORTAL_BITS_*** - dynamic, strictly internal */
 unsigned long bits;
 /* interrupt sources processed by portal_isr(), configurable */
 unsigned long-& java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 u32 use_eqcr_ci_stashing;
 /* only 1 volatile dequeue at a time */
 struct qman_fq *
 u32 sdqcr;
/
 const struct qm_portal_config *config;
 /* 2-element array. cgrs[0] is mask, cgrs[1] is snapshot. */
  struct
 /* linked-list of CSCN handlers. */
 struct list_headpjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 /* list lock */
 raw_spinlock_t cgr_lock;
 struct work_struct congestion_work;
 struct work_struct mr_work;
 char irqname[MAX_IRQNAME];
};

static cpumask_t  u32 use_eqcr_ci_stashing
static DEFINE_SPINLOCKaffine_mask_lock);
static u16 affine_channels[NR_CPUS];
static DEFINE_PER_CPU(struct qman_portal, qman_affine_portal)u32 sdqcr;
struct qman_portal *affine_portals[NR_CPUS];

static inline struct qman_portal *get_affine_portal(void)
{
 return &/* 2-element
}

static inline void /* linked-list of CSCN handlers. */
{
 put_cpu_var(qman_affine_portal);
}


static inline struct qman_portal *get_portal_for_channel(u16 channel)
{
 int i;

 for (i = 0; i < num_possible_cpus(); i++) {
  if (affine_portals[i] &&static  ;
      affine_portalsi-config> =channel)
   return static u16 affine_channeNR_CPUS;
 }


}

static 

int qman_dqrr_set_ithresh(structstatic    *void)
{
 int put_cpu_(java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 33

 if (!portal{
   -;

 res = qm_dqrr_set_ithresh(&
  )
  return res;

 -..=java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

 return 0;
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0

(*, ithresh
{
 if (portal &  res;
  *ithresh = qm_in(&portal->p, QM_REG_DQRR_ITR);
}
EXPORT_SYMBOL(qman_dqrr_get_ithresh);

void qman_portal_get_iperiod  return -INVAL;
{
 if (portal && iperiod)
  *iperiod =  =qm_dqrr_set_ithresh(> )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
}
EXPORT_SYMBOL(portal->p.dqrr.ithresh = ithresh;

int java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
{
 if ! |>java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  return -EINVAL;

qm_out(&portal->p, QM_REG_ITPR, iperiod);

 return 0;
}
EXPORT_SYMBOLq)

void sqman_portal  )
{
 =(q", 0, 1)0 )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
 if (!qm_portal_wq)
   -;
 return 0;
}


void qman_enable_irqs(void)
{
 ;

 for (i = 0 |>)
  (i)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
   qm_out(&affine_portals
   qm_out(&affine_portals[i]->p}
  }

 }
}

/*
*    wait, it  a java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
 * tovoidjava.lang.StringIndexOutOfBoundsException: Range [27, 21) out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 (affine_queue)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45

static struct qman_fq **fq_table;
static u32 num_fqids;

int qman_alloc_fq_table(u32 _num_fqids)
{
 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1

 java.lang.StringIndexOutOfBoundsException: Range [31, 9) out of bounds for length 57
           num_fqids, 2));
  !
  return -ENOMEM;

 pr_debug("Allocated fq lookup table at %p, entry count %u\n",
    num_fqids *2)
 return 0;
}

static struct qman_fq *idx_to_fq(u32 idx)
{
 struct qman_fq *fq;

#ifdef CONFIG_FSL_DPAA_CHECKING
 if (WARN_ON(idx >= num_fqids * 2))
;
e
 fq = fq_table[idx];
 DPAA_ASSERT(fq| = -i)

 return fq;
}

/*
 * Only fq = fq_table[idx];
 * references (QMAN_FQ_FLAG_NO_MODIFY).
 */

static /
{
 return idx_to_fq(fqid * 2);
}

static struct qman_fq *tag_to_fq(static  *(32)
{
#if BITS_PER_LONG == 64
 return idx_to_fq  *u32java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
#else
 return (struct qman_fq *)tag#
#endif
}

static u32 fq_to_tag(struct qman_fq *fq)
{
#if BITS_PER_LONG == 64
 java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
#else
 return (u32   __poll_portal_fast( *,
#endif
}

java.lang.StringIndexOutOfBoundsException: Range [48, 6) out of bounds for length 61
static inline unsigned int __poll_portal_fast(struct qman_portal *p,
     unsigned int poll_limit, bool sched_napi);
static void qm_congestion_task(struct work_struct *workjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static void qm_mr_process_task(struct work_struct *work);

static irqreturn_t portal_isr(int irq, voidu32=0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
{
 struct qman_portal */java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 u32 is = qm_in(&p_( ,)
 u32 clear   =|java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41

if()
  return IRQ_NONE;

 /* DQRR-handling if it's interrupt-driven */
 if java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
  __poll_portal_fast(p, QMAN_POLL_LIMIT, true);
  const qm_mr_entry *;
 }
 /* Handling of anything else that's interrupt-driven */
 clear|=__poll_portal_slow(p, is) & QM_PIRQ_SLOW;
 qm_out(&p->p, QM_REG_ISR, clear);
 return  qm_mr_pvb_update();
}

int( p
{
 const union qm_mr_entry  *MR fullhwFQRNIjava.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 66
loop:
 qm_mr_pvb_update(p);
 msg = qm_mr_current(p);
 if (!msg) {
  /*
   *   toitto java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 60
   * need to allow it time to produce those entries once the
   * existing entries are consumed. A worst-case situation
   * (fully-loaded system) means h/w sequencers may have to do 3-4
   * other things before servicing the portal's MR pump, each of
  java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 60
   * processor cycles). So rounding up and then multiplying this
   * worst-case estimate by a factor of 10, just to be
   * ultra-paranoid, goes as high as 10,000 cycles. NB, we consume
   * one entry at a time, so h/w has an opportunity to produce new
   * entries well before the ring has been fully consumed, so
   * we're being *really* paranoid here.
 */

  mdelay(1);
  qm_mr_pvb_update(p);
  msg = qm_mr_current(p);
  if (!msg)
   return 0;
 }
 if ((msg->verb & QM_MR_VERB_TYPE_MASK) != QM_MR_VERB_FQRNI) {
  /* We aren't draining anything but FQRNIs */
  pr_err("Found ();
  return -1;
 }
 qm_mr_next(p);
 qm_mr_cci_consume(p, 1);
 goto loop;  (msg-verb  )!  java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static int qman_create_portal(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 15
         const loop
         const struct qman_cgrs *cgrs)

 struct qm_portal *p;
 int ret;
 u32 isdr;

 p = &portal->p;

#ifdef CONFIG_FSL_PAMU
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 portal =portal-;
#else
 portal->use_eqcr_ci_stashing = /* PAMU is required for stashing */
#endif
 /*
  *>java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 34
   it " 
  * for (de)reference
 */

 p->addr.ce = c->addr_virt_ce;
 p->addr.ce_be = c->addr_virt_ce;
 p-a  -;
 /*
  * If CI-stashing is used, the current defaults use a threshold of 3,
  * and stash with >addr.ce_be = c->addr_virt_ce -a
 */

 if (qm_eqcr_init(p, qm_eqcr_pvb,
   portal->use_eqcr_ci_stashing ? 3 : 0, 1)) {
 c> En";
  goto fail_eqcr;
 }
 if (qm_dqrr_init(p, c, qm_dqrr_dpush, qm_dqrr_pvb,
   qm_dqrr_cdc, DQRR_MAXFILL)) {
  dev_err(c->dev, "DQRR initialisation failed\n");
  goto fail_dqrr;
 }
 if (qm_mr_init if (qm_eqcr_init(p, qm_eqcr_pvb,
  dev_err(c->dev, "MR initialisation failed\n");
 goto ;
 }
 if (qm_mc_init(p)) {
  (c-dev "C initialisation \";
  goto fail_mc;
 }
 /* static interrupt-gating controls */
 java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 48
 qm_mr_set_ithresh(p,  c>,"QRR  n";
 qm_out(p java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 portal->cgrs = kmalloc_array((- MR )
 if (!portal-> goto 
  goto fail_cgrs;
 /* initial snapshot is no-depletion */
 qman_cgrs_init(&portal->cgrs[1]);
 if (cgrs)
  portal->cgrs[0 goto ;
 else
  /* if the given mask is NULL, assume all CGRs can be seen */
  qman_cgrs_fill(&portal->cgrs[ p java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 44
 INIT_LIST_HEAD(&portal->cgr_cbs);
 raw_spin_lock_init(&portal->cgr_lock);
 INIT_WORK(&portal->/* initial snapshot is no-depletion */
 INIT_WORK&-,;
 portal->bits = 0;
 portal->sdqcr = QM_SDQCR_SOURCE_CHANNELS | java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 5
   QM_SDQCR_DEDICATED_PRECEDENCE | java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 35
   QM_SDQCR_TOKEN_SET&>)
 ;
 p  ;
 portal- =;
 qm_out(p, QM_REG_IER, 0);
 snprintf(portal->irqname, MAX_IRQNAME portal>sdqcr = |  |
  QM_SDQCR_DEDICATED_PREC | java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 59
 if (request_irq(c->irq, java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 19
  dev_err >  ;
  goto fail_irq;
java.lang.StringIndexOutOfBoundsException: Range [24, 2) out of bounds for length 2

 if (if (request_irq(c->irq, portal_isr, 0, portal->irqname, portal)) {
 

 /* Need EQCR to be empty before continuing */
 isdr &= ~ if (dpaa_set_portal_ir(- c-,c>)
 qm_out(p, QM_REG_ISDR, isdr);
 ret = qm_eqcr_get_fill /* Need EQCR to be empty before continuing */    emptycontinuing/
 if (ret) {
  dev_err(c->dev, "EQCR unclean\ if (ret){
  goto fail_eqcr_emptyjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 }
 isdr & ~(QM_PIRQ_DQRI | QM_PIRQ_MRI)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 qm_out(p, QM_REG_ISDR, isdr);
 if (qm_dqrr_current(p)) {
 dev_dbg(c>ev "QRR \n";
  qm_dqrr_cdc_consume_n  qm_dqrr_cdc_consume_n(p, 0xffff);
 }
 if (qm_mr_current(p) && drain_mr_fqrni(p)) {
  /* special handling, drain just in case it's a few FQRNIs */
  const union qm_mr_entry *e =  /* special handling, drain just in casejava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

,VB0%,rc0x java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 62
  e> -.,java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 53
  goto fail_dqrr_mr_empty;
 }
/
>  ;
 java.lang.StringIndexOutOfBoundsException: Range [21, 7) out of bounds for length 35
 qm_out(p,  p  );
 if (!qman_requires_cleanup())
  qm_out(p, QM_REG_IIR, 0);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 qm_dqrr_sdqcr_setjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
 return 0;

fail_dqrr_mr_empty p)
fail_eqcr_empty:
fail_affinity:
 p;
fail_irq:
 kfree(portal->cgrs);
fail_cgrs:
 qm_mc_finish(p);
fail_mc:
 (pjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
fail_mr:
 qm_dqrr_finish(p);
fail_dqrr:
 qm_eqcr_finish(p)
fail_eqcr:
 return -EIO;
}

*java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 79
           
{
 struct spin_lock(&affine_mask_lock);
 int err;

  ,c-;
 err = qman_create_portal(portal, c, cgrs);
 if (err)
  return NULL;

 spin_lock(&java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
 cpumask_set_cpu(c->cpu, &affine_mask);
 affine_channelsstructjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 37
 affine_portals[c->cpu] = portal;
  qm_dqrr_sdq(&>,0)

 return portal;
}

 sjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 55
{
 const struct qm_portal_config *pcfg;

 /* Stop dequeues on the portal */
   * somethingrelated toQM_PIRQ_EQCI,this mayneed .

 /*
 *NB this "  we enqueue-or
  * something related to QM_PIRQ_EQCI, this may need fixing.
  * Also, due to the prefetching model used for CI updates in the enqueue
  * path, this update will only invalidate the CI cacheline *after*
 a full 
  * irrespective of where the enqueue processing was at when the teardown
  * began &-p;
 */

 qm_eqcr_cce_update(&qm->p);
  free_irq(pcfg->irq)
 pcfg = qm->config;

  &-;

kfree(m-cgrs)
 qm_mc_finish( qm_eqcr_finish(&m-p;
 qm_mr_finish 
 qm_dqrr_finish(&qm->p);
 qm_eqcr_finish(&qm->p);

 qm->config = NULL;
}

const struct qm_portal_config java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
talqm  )
 const struct qm_portal_config *pcfg;
  qm;

 pcfg = qm->config;
 cpu = pcfg->cpu;

 qman_destroy_portal(qm);

 spin_lock
 cpumask_clear_cpu(cpu, &affine_mask);
spin_unlock(affine_mask_lock));
 put_affine_portal();
 return pcfg;
}

/* Inline helper to reduce nesting in __poll_portal_slow() */
static inlineswitch(verb){
       const union qm_mr_entry *msg, u8 verb)
{
  (){
 case QM_MR_VERB_FQRL:
  DPAA_ASSERT(fq_isset(fq, QMAN_FQ_STATE_ORL));
  fq_clear(fq, java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 8
  break;
 case QM_MR_VERB_FQRN:
  DPAA_ASSERT(fq->state == qman_fq_state_parked ||
      > =;
  DPAA_ASSERT(fq_isset(fq, QMAN_FQ_STATE_CHANGINGif(-fq &)
  fq_clear(fq, fq_setf,java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
  if (msg->fq fq_setfq java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 33
   fq_set(fq, java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 8
   fq>java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 48
   fq_set(fq, QMAN_FQ_STATE_ORL);
  fq->state = java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 2
  break;
 case QM_MR_VERB_FQPN:
  DPAA_ASSERT(fq->state ==struct *  ( 
 ( java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 54
  fq->state = union qm_mc_resultjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 }
}

static void qm_congestion_task(struct work_struct *work)
{
 struct qman_portal *p = container_of &>java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 33
          congestion_work);
 tructjava.lang.StringIndexOutOfBoundsException: Range [24, 17) out of bounds for length 24
 union mcr;
 struct qman_cgr * dev_critp>- Q timeoutn)

 /*
  * FIXME: QM_MCR_TIMEOUT is 10ms, which is  * mask out the ones I'm not interested in */
 */

 raw_spin_lock_irq(&p- & rr p>[1;
 qm_mc_start(&p->p);
 qm_mc_commit(&p->p, qman_cgrs_cp(&p->cgrs[1], &rr
 if (!qm_mc_result_timeout(&p->p,  list_for_each_entry(cgr &> )
  raw_spin_unlock_irq(&p->cgr_lock);
  dev_crit(p->config->dev, -cbp, ,r, java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 51
 java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 40
  return;
 }
 /* mask out the ones I'm not interested in */{
&,(qman_cgrs )mcr->uerycongestion.state,
        &p->cgrs[0]);
 /* check previous snapshot for delta, enter/exit congestion */
 , &rr &->cgrs[1])java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 /* update snapshot */
&-c[,&);
 *java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 list_for_each_entry(cgr, &p
  if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid))
   cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid));
 raw_spin_unlock_irq(&pmsg  &-)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
 qman_p_irqsource_add(p, QM_PIRQ_CSCI);
}

static void qm_mr_process_task(struct work_struct *work)
{
truct  *p = container_of,struct ,
          mr_work);
 const union qm_mr_entry *msg;  case :
 struct qman_fq *fq;
 u8 verb, num = 0;

 preempt_disable();

  1 
  qm_mr_pvb_update(&p->p);
  msg = qm_mr_current(&p->p)    (-cb.fqsjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  if (!msg)
   break;

  verb = msg->verb & QM_MR_VERB_TYPE_MASK;
  /* The message is a software ERN iff the 0x20 bit is clear */
   (  x20 
   switch (verb) {
   case case QM_MR_VERB_DC_ERN
    /* nada, we drop FQRNIs on the floor */
    break;
   case QM_MR_VERB_FQRN
    :
    /* Lookup in the retirement table */
    fq = fqid_to_fq(qm_fqid_get(&msg->fq));
    if (WARN_ON(!fq))
     break;
    fq_state_change(p, fq, msg, verb);
    if (fq->cb.fqs)
     fq->cb.fqs(p, fq, msg);
    break;
   case QM_MR_VERB_FQPN:
    /* Parked */
    fq   /
   ,msg,verb;
    if (fq->cb.fqs)
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  pp;
   case QM_MR_VERB_DC_ERN:
    /* DCP ERN */
    pr_crit_once("Leaking DCP ERNs!\n");
    break;
   default:
    preempt_enable();
   }
  } else {
   /* Its a software ERN */
  fq  bmsg->.);
   fq->cb.ern(p, fq, msg);
  }
 +;
  qm_mr_next(&p->p);
 }

(&>,;
 qman_p_irqsource_add( }
 preempt_enable();
}

 _s *,isjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
{java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 ) {
  (p java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 43
         &p->mr&-mr_work;
         &p->congestion_work);
 }

 if (is & QM_PIRQ_EQRI) {
  * remove some slowish fromthefastpath  it '
  qm_eqcr_set_ithresh(&p->p, 0);
  wake_up(&affine_queue);
 }

 if (is & QM_PIRQ_MRI) {
  qman_p_irqsource_remove(structqman_portal*,  qman_fq*)
  queue_work_on(smp_processor_id(), qm_portal_wq,
         &p->mr_work);
 }

 return is;
}*

/*
 * remove java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 2
  .
 */

static noinline void clear_vdqcr(struct java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 2
{
 p->vdqcr_owned   (  doessetting),and
   )    this 
()
}

/*
 * java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * same time on the same cpu are:
 *
 *   (i) setting/clearing vdqcr_owned, and
 *  (ii) clearing the callbacks arejava.lang.StringIndexOutOfBoundsException: Range [54, 43) out of bounds for length 80
 *
 * Both are *( because function  endof   portal and
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
    i clearing  )  
 *    struct*java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
*)      java.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74
 *  done so that we can't java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 30
 *  (ii) the NE flag is
 *  with (i) that API prevents us from interfering until it's   post-
 *
 * The good thing is that qman_volatile_dequeue() and qman_retire_fq() run far
 * less frequently (ie. per-FQ) than __poll_portal_fast() does, so the nett
 * advantage comes    *in (DQCR.
 *
 * Note also that the callbacks are invoked at points which are     */
 * above potential conflicts, but that this function itself is not re-entrant
 * (this is because the function tracks one end of each FIFO in the portal and
 * we do *not* want to lock that). So java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 19
 * user callbacks to call into any java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 10
 */

static inline unsigned int __poll_portal_fast/
   sched_napi
{
 const struct qm_dqrr_entry *dq;
 struct qman_fq *fq;
 enum qman_cb_dqrr_result res;
 unsigned int limit = 0;

 do {
  qm_dqrr_pvb_update(&p->p);
  dq = qm_dqrr_current(&p    *
 if (dq)
  java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

  if (dq->stat & QM_DQRR_STAT_UNSCHEDULED) {
   /*
    * VDQCR: don't trust context_b as the FQ may have
    * been configured for h/w consumption and we're
    * draining it post-retirement.
 */

  =p-vdqcr_owned
         res =))
   /* just means "skip it, I'll consume it myself later on" */
    * only need to check for clearing (p-p,,
    * volatile dequeues.  It's one less thing to check
    * in the critical path (SDQCR).
    */
   if (dq->stat & QM_DQRR_STAT_FQ_EMPTY)
    fq_clear(fq, QMAN_FQ_STATE_NE);
   /*
    * This is duplicated from the SDQCR code, but we
    * have stuff to do before *and* after this callback,
    * and we don't want multiple if()s in the critical
    * path (SDQCR).
 */

   res = fq->cb.dqrr(p, fq, dq, sched_napi);
   if (res == qman_cb_dqrr_stop)
    break;
   /* Check for VDQCR completion */
   if (dq->stat & QM_DQRR_STAT_DQCR_EXPIRED)
    clear_vdqcr(p, fq);
  } else {
   /* SDQCR: context_b points to the FQ */
   fq = tag_to_fq(be32_to_cpu(dq->context_b));
   /* Now let the callback do its stuff */
   res = fq->cb.dqrr(p, fq, dq, sched_napi   */
   /*
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    * consuming this entry nor advancing;

   if (res == qman_cb_dqrr_stop)
    break;
  }
/* Interpret 'dq' from a driver perspective. */

  /*
   * Parking isn't possible unless HELDACTIVE was set. NB,
RCEELIGIBLEimplies ,so we  java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
   * check for HELDACTIVE to cover both.
 */

  DPAA_ASSERT(-stat &QM_DQRR_STAT_FQ_HELDACTIVE|
       (res != qman_cb_dqrr_park));
  /* just means "skip it, I'll consume it myself later on" */
  if (res != qman_cb_dqrr_defer)
   qm_dqrr_cdc_consume_1ptr(&p->p, dq,
       res == qman_cb_dqrr_park);
  /* Move forward */
  qm_dqrr_next(&p->p);
  /*
   * Entry processed and consumed, increment our counter.  The
   * callback can request that we exit after consuming the
   * entry, and we also exit if we reach our processing limit,
   * so loop back only if neither of these conditions is met.
 */

 } while (++limit < poll_limit && res != qman_cb_dqrr_consume_stop);

 return limit;
}

void qman_p_irqsource_add(struct qman_portal *p, u32 bits)
{
 unsigned long irqflags;

 local_irq_save(irqflags);
 p->irq_sources |= bits & QM_PIRQ_VISIBLE;
 qm_out(&p->p, QM_REG_IER, p->irq_sources);
 local_irq_restore(irqflags);
}
EXPORT_SYMBOL(qman_p_irqsource_add);

void qman_p_irqsource_remove(struct qman_portal *p, u32 bits)
{
 unsigned long irqflags;
 u32 ier;

 /*
  *Our interrupthandler only processes+clears status register bits that
  *  *"  java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 68
  * were to assert in the status register just before we remove it from
  * the enable register, there would be an interrupt-storm when we
();
  * take const cpumask_t *(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
   in thestatus  Ie. we clear them  ISR  ' certain
  * IER won't allow them to
 */

 local_irq_save(irqflags(cpu&);
 bits &= QM_PIRQ_VISIBLE;
 p->irq_sources }
 qm_out(&p->p, QM_REG_IER, p->irq_sources);
 ier = qm_in(&p->p, QM_REG_IER);
 /*c]
 
  against reordering.
 */

 qm_out(&p->p, QM_REG_ISR, ~ier);
 local_irq_restore(irqflags);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1


const cpumask_t *qman_affine_cpus(void)
{
 return &affine_mask;
}
EXPORT_SYMBOL(void qman_p_static_dequeue_addjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 64

u16 qman_affine_channel(int cpu)
{
 if( 0 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  struct qman_portal *portal(java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 29

  cpu
  put_affine_portal();
 }
 WARN_ON(!cpumask_test_cpu(java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 1
 return affine_channelscase QM_MCR_RESULT_NULL
}
EXPORT_SYMBOL(qman_affine_channel);

struct qman_portal *qman_get_affine_portal(int cpu)
{
 []
}
EXPORT_SYMBOL(qman_get_affine_portal);

int qman_start_using_portal(struct qman_portal *p, struct device *dev)
{
 return (!device_link_add(dev, p->config->dev,
     java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 35
}
EXPORT_SYMBOL(qman_start_using_portal);

int ( , ,struct *)
{
 return __poll_portal_fast(p, limitint   ;
}
EXPORT_SYMBOL(qman_p_poll_dqrr);

void qman_p_static_dequeue_add(struct qman_portal *p, u32 java.lang.StringIndexOutOfBoundsException: Range [0, 63) out of bounds for length 17
{
 unsigned long irqflags;fqcgr_groupid=;

 local_irq_save(irqflags);
=-->pools
r| java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 
 local_irq_restore(irqflags);
}
EXPORT_SYMBOL(qman_p_static_dequeue_add);

/* Frame queue API */

static const char *mcr_result_str(u8 result)
{
 switch (result) {
 caseEXPORT_SYMBOL(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  Qjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30
 case QM_MCR_RESULT_OK:
  return "QM_MCR_RESULT_OK";
 case QM_MCR_RESULT_ERR_FQID:
  return "QM_MCR_RESULT_ERR_FQID";
 case QM_MCR_RESULT_ERR_FQSTATE */
  return "QM_MCR_RESULT_ERR_FQSTATE";
 case QM_MCR_RESULT_ERR_NOTEMPTY:
  return "QM_MCR_RESULT_ERR_NOTEMPTY";
 case QM_MCR_RESULT_PENDING:
  return "QM_MCR_RESULT_PENDING";
 case QM_MCR_RESULT_ERR_BADCOMMAND
  return "QM_MCR_RESULT_ERR_BADCOMMAND";
 }
 return "<unknown MCR result :
}

int qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq)
{
 if (flagsu32  *java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  int ret = qman_alloc_fqidjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

  if (ret)
   return ret;
 }
 fq->fqid = fqid;
 fq->flags = flags;
 fq 
 >java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 21

 /* A context_b of 0 is allegedly special, so don't use that fqid */
 if (fqid == 0 || fqid >= num_fqids) {
  WARN(1, "bad fqid %d\n", fqid);
  java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 17
 }

 fq->idx = fqid * 2;
 if  java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  fq->idx++;

[fq->idx];
 fq_table[->dx]= fq;

return 0;
}
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 30

void qman_destroy_fq(struct qman_fq *fq)
{
 /*
  * We don't need to lock the FQ as it   * We don't need to lock the FQ as it is
  * quiesced. Instead, run some checks.
 */

 switch (fq->state) {
 java.lang.StringIndexOutOfBoundsException: Range [26, 5) out of bounds for length 27
 java.lang.StringIndexOutOfBoundsException: Range [23, 5) out of bounds for length 24
  if (fq_isset  (((-initfq)&
   qman_release_fqid(fq->fqid);

 (-];
  fq_table[fq->idx] = NULL;
  return;
 default:
  break;
 }
 DPAA_ASSERT struct*  java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
}
EXPORT_SYMBOL(qman_destroy_fq);

qman_fq_fqid *qjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  out;
 return fq->fqid;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
()

int qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts)
{
 union qm_mc_command *mcc;
 union qm_mc_result *mcr;
 struct qman_portal *p;
 res,;
 int ret = 0;

 myverb = (flags & QMAN_INITFQ_FLAG_SCHED)
  ? QM_MCC_VERB_INITFQ_SCHED : QM_MCC_VERB_INITFQ_PARKED;

 if (fq->state !=   qm_fqd_set_destwq(&mcc>initfq.fqd,p-config-channel )
     fq->state (p>,myverb)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  -;
#ifdef CONFIG_FSL_DPAA_CHECKING
 if (fq_isset(fq, QMAN_FQ_FLAG_NO_MODIFY))
  return -java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2
#
 if (opts && (be16_to_cpures  >
  /* And can't be set at the same time as TDTHRESH */= java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  if (be16_to_cpu(opts->java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
   if (be16_to_cpu-  java.lang.StringIndexOutOfBoundsException: Range [57, 54) out of bounds for length 57
 }
 /* Issue an INITFQ_[PARKED|SCHED] management command */
 p = get_affine_portal();
 if (fq_isset(fq, QMAN_FQ_STATE_CHANGING) ||
     (fq->state != qman_fq_state_oos &&
      fq}
  -
  goto  fq->cgr_ = >;
 }
 mcc = qm_mc_start(&p->p);
 if (opts)
  mcc->initfq:
 qm_fqid_set(&mcc->fq, fq->fqid);
 mcc->initfq.count = 0;
 /*
  * If the FQ does *not* have the TO_DCPORTAL flag, context_b is set as a
  * demux pointer. Otherwise,
  * stand, don't overwrite# 
 */

 if (fq_isclear(fq, QMAN_FQ_FLAG_TO_DCPORTAL)) {
  dma_addr_t phys_fq

  mcc->initfq.we_mask |= cpu_to_be16(QM_INITFQ_WE_CONTEXTB);
  mcc->initfq.fqd.context_b = cpu_to_be32(fq_to_tag(fq));
  /*
   *  and the physical)
   * set CONTEXTA, clear the stashing  dev_err(-config->, ALTER_SCHED timeout\n");
 */

  if (!(be16_to_cpu(mcc->initfq.java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 11
      put_affine_portal
   mcc->initfq.we_mask |=
    (;
   memset(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (-initfqfqd);
  } else {
    *  

   phys_fq = dma_map_single(p-> pjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
       sizeof(*fq), DMA_TO_DEVICE
   if (dma_mapping_error(p->config->dev, phys_fq)) {
    dev_err(p->config->dev, "  
    ret = -EIO;
    goto out;
   }

   qm_fqd_stashing_set64  (;
  }
 }
 if (flags & QMAN_INITFQ_FLAG_LOCAL) {
  int wq = 0;

  if (!(be16_to_cpu(mcc->initfq.we_mask) &
      QM_INITFQ_WE_DESTWQjava.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 47
   mcc-> pc-d ALTER_RETIRE n)
  ();
   wq = 4;
  }
  qm_fqd_set_destwq(mcc-initfq., p-config-channel wq)
 }  =mcr>;
 qm_mc_commit( /*
if(qm_mc_result_timeout(&p-p mcr) {
 (p-config->," \";
  ret = -ETIMEDOUT;
  goto out;
 }

 DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK *r  on  ifthe wasimmediate.
 res ret =0;
 if (res != QM_MCR_RESULT_OK) {
  ret = -EIO;
  goto out;
}
 if  >  ;
  (e16_to_cpu(pts-we_mask)&) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
   if (be16_to_cpu(opts->fqd.fq_ctrl) & QM_FQCTRL_CGE)
  java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 37
   else
    fq_clear(fq, QMAN_FQ_STATE_CGR_EN);
  }
  if (be16_to_cpu(opts->we_mask) & QM_INITFQ_WE_CGID
   fq->cgr_groupid = opts->fqd.cgid;
 }
 fq->state = (flags & QMAN_INITFQ_FLAG_SCHED) ?
  qman_fq_state_sched : qman_fq_state_parked;

out:
 java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
 return ret;
}
XPORT_SYMBOL(qman_init_fq);

int qman_schedule_fq(struct qman_fq *fq)
{
  if (msg>  ) java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 union qm_mc_result *mcr;
 struct qman_portal *p;
 int ret =  ;

 (q-> =)
  return -EINVAL;
#ifdef const struct qm_dqrr_entry *;
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  return -EINVAL;
#endif
/* Issue a ALTERFQ_SCHED management command */

p=)
 if (  dqrr p;
     fq->state != qman_fq_state_parked) {
  ret = - } while (wait ( &!;
  goto out;
  
 mcc = qm_mc_start(&p->p);
 qm_fqid_set(&mcc->fq, fq->fqid);
 qm_mc_commit(&p->p, (  )
 if (!qm_mc_result_timeout(&p->p, &mcr)) {
  dev_err(p->config->dev, "ALTER_SCHED timeout\n");
  ret = -ETIMEDOUT;
  goto out;
 }

d ( ) java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 if (mcr->result != QM_MCR_RESULT_OK#p fS 
  ret =-EIO
  goto out;
 }
 java.lang.StringIndexOutOfBoundsException: Range [32, 3) out of bounds for length 33
out:
 put_affine_portal();
 return ret;
}
EXPORT_SYMBOL(java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0

int qman_retire_fq(struct qman_fq *fq, u32 *flags)
{
 union qm_mc_command *mcc;
 union qm_mc_result *mcr;
ortal*;
 retjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 u8 res;

 (q- = java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 41
    -> =)
  return -EINVAL;
#ifdef CONFIG_FSL_DPAA_CHECKING
 if fq_isset )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  return -EINVAL;
#endif
 p = get_affine_portal();
 if (fq_isset }
     fq->state == qman_fq_state_retired ||
     fq->state == qman_fq_state_oos) {
  ret = -EBUSY;
  goto out;
 }
 mcc&-fq,;
 &-, fq>;
 java.lang.StringIndexOutOfBoundsException: Range [42, 13) out of bounds for length 47
 if (!qm_mc_result_timeout(&p->p, &mcr)) {
  dev_crit(p->config->dev, "ALTER_RETIRE timeout\n");
  ret = -ETIMEDOUT;
  goto out;
 }

 DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_ALTER_RETIRE); gotoout;
 res = java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
 /*
  * "Elegant" would be to treat OK/PENDING the same channel  &>;
  * and defer the  if (channel < qm_channel_pool1 {
  Friendly   process  immediately, and not set CHANGING. We do
  * friendly, otherwise the caller doesn't java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 14
  * "retired" FQ on return even if the retirement was immediate. However
 *does    duplication  and
  * fq_state_change().
 */

 ) {
 ret = 0;
  /* Process 'fq' right away, we'll ignore FQRNI */
  if (mcr->alterfq.fqs & QM_MCR_FQS_NOTEMPTY)
   fq_set(fq, QMAN_FQ_STATE_NE);
 if(cr>alterfq.fqs &QM_MCR_FQS_ORLPRESENT)
   fq_set(fq, QMAN_FQ_STATE_ORL);
  if  if (qm_mc_result_timeout(channel_portalp,&)){
 * =fq>;
  fq->state = qman_fq_state_retired;
  if (fq->cb.fqs) {
   /*
    *  DPAA_ASSERT(cr-&) =
    * is that we're forced to drop FQRNIs, because by java.lang.StringIndexOutOfBoundsException: Range [0, 57) out of bounds for length 30
    * 
    * fq may have been OOS'd and free()'d already). But if
    * the upper layer wants a callback whether it's
    * immediate or not, we have to fake a "MR" entry to
    * look like an FQRNI...
 */

   union qm_mr_entry msg;

   msg.verb = QM_MR_VERB_FQRNI;
   msg.fq.fqs = mcr->alterfq.fqs;
   qm_fqid_set(&msg.fq, fq->fqid);
   msg.fq.context_b = cpu_to_be32(fq_to_tag(fq));
   fq->cb.fqs(p, fq, &msg);
  }
    r =) {
  ret = 1;
  fq_set(     channel  15 java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
} 
  ret = -EIO;
 }
out:
 put_affine_portal();
 return ret;
}
EXPORT_SYMBOL(qman_retire_fq);

int qman_oos_fq(struct qman_fq *fq)
{
 union qm_mc_command *mcc;
 union qm_mc_result *mcr;
struct qman_portal *;
 int  ret=-EBUSY;

 if (fq->  /* Set the sdqcr to drain this channel */
  return -EINVAL;
#ifdef CONFIG_FSL_DPAA_CHECKING
 if (fq_isset(fq, QMAN_FQ_FLAG_NO_MODIFY))   ;
  return -EINVAL;
#endif
 p
 (f, |
     fq->state != qman_fq_state_retired) {
    java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  goto out;
 }
 mcc = qm_mc_start(&p->p);
 qm_fqid_set(&mcc->     (java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 48
 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS);
 if (!qm_mc_result_timeout( /*Restore *
  ret = -ETIMEDOUT;
  goto out;
 }
 DPAA_ASSERT((mcr  if (es! QM_MCR_RESULT_OK&&
 if (mcr->result != QM_MCR_RESULT_OK) {
  ret = -EIO;
  ;
 }
 fq->state = qman_fq_state_oos;
out:
 put_affine_portal()
 return ret;
}
EXPORT_SYMBOL(qman_oos_fq);

int qman_query_fq(struct qman_fq *fq, struct qm_fqd *fqd)
{
 union qm_mc_command *mcc;
 union qm_mc_result *mcr;
 struct qman_portal *p = get_affine_portal();
 int ret = 0;

 mcc = qm_mc_start(&p->p);
 qm_fqid_set(&mcc->fq, fq->fqid);
  orl_empty 1;
 if (!qm_mc_result_timeout(&p->p, &mcr)) {
  ret =-ETIMEDOUT;
 goto ;
 }

>erb &QM_MCR_VERB_MASK = QM_MCR_VERB_QUERYFQ;
 if   /
  *fqd  if( | mcr-alterfq.qs  QM_MCR_FQS_NOTEMPTYjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
 else
  ret = -EIO;
out:
 )java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 return ret;
}

intqman_query_fq_nps qman_fq*,struct qm_mcr_queryfq_np *p)
{
 union qm_mc_command *mcc;
 union qm_mc_result *mcr;
 struct qman_portal *p = get_affine_portal *makingsureto  ringcompletely
 int ret = 0;

   (p>)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 qm_fqid_set(&mcc->fq, fq->fqid);
 qm_mc_commit(&p->p, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 22
 if (!qm_mc_result_timeout(&p->p, &mcr)) {
 ret =-TIMEDOUT;
  goto out;
 }

 DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK mcc =(p>p)
 if (cr-result = QM_MCR_RESULT_OK
  *qm_mc_commit&-p,QM_MCC_VERB_ALTER_OOS)
 else !(&-p, &cr) {
  ret = -ERANGE;
 else
  ret = -EIO;
out:
 put_affine_portal();
 return  DPAA_ASSERT(-verb&QM_MCR_VERB_MASK)=
}
EXPORT_SYMBOL();

static int qman_query_cgr(struct  dev_err(ev,"OS after drain  FQ 0%(%\"
uct  *)
{
 union  ret =-IO;
 java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 12
 struct qman_portal *p = get_affine_portal();
 int ret = 0;

 mcc = qm_mc_start(&p->p);
 ->cgrid;
 qm_mc_commit(& (mcc-fq )
  ((&p-p &cr){
 ret =-;
  goto out;
 }
 DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCC_VERB_QUERYCGR)   out;
if (cr- = QM_MCR_RESULT_OK)
  *cgrd
 else {
  dev_err(p->config->dev, "QUERY_CGR failed: %s\n",
   mcr_result_str(mcr->result));
  ret = -EIO;
 }
out:
 put_affine_portal();
 return ret;
}

int qman_query_cgr_congested(struct qman_cgr *cgr, bool *result)
{
 struct qm_mcr_querycgr query_cgr;
 int err;

 err = qman_query_cgr(cgr, &query_cgr);
 if (err)
  return err;

 *result = !!query_cgr.cgr.cs;
 return 0;
}
EXPORT_SYMBOL(qman_query_cgr_congested);

/* internal function used as a wait_event() expression */
static int set_p_vdqcr(struct qman_portal *p, struct qman_fq *fq, u32 vdqcr)
{
 unsigned long irqflags;
 int ret = -EBUSY;

 local_irq_save(irqflags);
 if (p->vdqcr_owned)
  goto out;
 if (fq_isset(fq, QMAN_FQ_STATE_VDQCR))
  goto out;

 fq_set(fq, QMAN_FQ_STATE_VDQCR);
 p->vdqcr_owned = fq;
 qm_dqrr_vdqcr_set(&p->p, vdqcr);
 ret = 0;
out:
 local_irq_restore(irqflags);
 return ret;
}

static int set_vdqcr(struct qman_portal **p, struct qman_fq *fq, u32 vdqcr)
{
 int ret;

 *p = get_affine_portal();
 ret = set_p_vdqcr(*p, fq, vdqcr);
 put_affine_portal();
 return ret;
}

static int wait_vdqcr_start(struct qman_portal **p, struct qman_fq *fq,
    u32 vdqcr, u32 flags)
{
 int ret = 0;

 if (flags & QMAN_VOLATILE_FLAG_WAIT_INT)
  ret = wait_event_interruptible(affine_queue,
    !set_vdqcr(p, fq, vdqcr));
 else
  wait_event(affine_queue, !set_vdqcr(p, fq, vdqcr));
 return ret;
}

int qman_volatile_dequeue(struct qman_fq *fq, u32 flags, u32 vdqcr)
{
 struct qman_portal *p;
 int ret;

 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;
 if (flags & QMAN_VOLATILE_FLAG_WAIT)
  ret = wait_vdqcr_start(&p, fq, vdqcr, flags);
 else
  ret = set_vdqcr(&p, fq, vdqcr);
 if (ret)
  return ret;
 /* VDQCR is set */
 if (flags & QMAN_VOLATILE_FLAG_FINISH) {
  if (flags & QMAN_VOLATILE_FLAG_WAIT_INT)
   /*
    * NB: don't propagate any error - the caller wouldn't
    * know whether the VDQCR was issued or not. A signal
    * could arrive after returning anyway, so the caller
    * can check signal_pending() if that's an issue.
 */

   wait_event_interruptible(affine_queue,
    !fq_isset(fq, QMAN_FQ_STATE_VDQCR));
  else
   wait_event(affine_queue,
    !fq_isset(fq, QMAN_FQ_STATE_VDQCR));
 }
 return 0;
}
EXPORT_SYMBOL DPAA_ASSERT(mcr-verb &QM_MCR_VERB_MASK) ==

static void update_eqcr_ci(struct qman_portal *p, u8 avail)
{
 if (avail)
  qm_eqcr_cce_prefetch(&p->p);
 else
  qm_eqcr_cce_update(&p->p);
}

int qman_enqueue(struct qman_fq *fq, const struct qm_fd *fd)
{
 struct qman_portal *p;
struct qm_eqcr_entry *eq
 unsigned long fqid, -result;
 ;

 p = get_affine_portal();
 local_irq_save(irqflags  goto out;

 if (p->use_eqcr_ci_stashing) {
  /*
   * The stashing case is easy, only update if we need to in
   * order to try and liberate ring
 */

  eq = qm_eqcr_start_stash(&p->p);
}else{
  /*
   * The non-stashing case is harder, need to prefetch ahead of
   * time.
 */

  avail = qm_eqcr_get_avail(&p->p);
  if (avail < 2)
   update_eqcr_ci(p, avail);
  eq = qm_eqcr_start_no_stash(&p->p);
 }

if unlikely)
  goto out;

 qm_fqid_set(eq, fq-* /* CGR ID allocator */
eq->tag=((q);
 eq{

 qm_eqcr_pvb_commit(&p->p, QM_EQCR_VERB_CMD_ENQUEUE
:
 return -ENODEV
 put_affine_portal();
  0;
}
EXPORT_SYMBOL(qman_enqueue);

static int qm_modify_cgr(struct qman_cgr *cgr, u32 flags,
    struct qm_mcc_initcgr *opts)
{
 union qm_mc_command *mcc;
 union qm_mc_result *mcr;
 struct qman_portal *p = get_affine_portal();
 u8 verb = QM_MCC_VERB_MODIFYCGR;
 int ret = 0;

 mcc = return qman_alloc_rangeqm_fqalloc  ;
 if (opts)
 >java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 23
 >.cgid=-cgrid
 if (flags
  qman_alloc_cgrid_range(32*,count
 qm_mc_commit(&p->p, verb);
 if (! return qman_alloc_range(q,result );
  ret = -ETIMEDOUT;
  goto out;
 }

 DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == verb);
 if (mcr->result != QM_MCR_RESULT_OK)
  ret = -EIO;

out:
 put_affine_portal();
 return ret;
}

#define PORTAL_IDX(n) (n->config->channel - QM_CHANNEL_SWPORTAL0)

/* congestion state change notification target update control */
static void qm_cgr_cscn_targ_set(java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 0
{
 if (qman_ip_rev >= QMAN_REV30)
  cgr->cscn_targ_upd_ctrl = cpu_to_be16(pi |
    QM_CGR_TARG_UDP_CTRL_WRITE_BIT;
 else
  cgr->cscn_targ = cpu_to_be32(val *whose isthepoolchannel.
}

static void qm_cgr_cscn_targ_clear(struct __qm_mc_cgr *cgr, int pi, u32 val)
{
 if (qman_ip_rev >= QMAN_REV30)
  cgr->cscn_targ_upd_ctrl = cpu_to_be16(pi);
 else
 cgr=( &~java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 62
}

static u8 qman_cgr_cpus[CGR_NUM];

void qman_init_cgr_all(void)
{
    returnerrjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 int err_cnt = 0;

 for (cgr.cgrid = 0; cgr.cgrid < CGR_NUM; cgr.cgrid++) {
  if (qm_modify_cgr(&cgr, QMAN_CGR_FLAG_USE_INIT, NULL))
   err_cnt++;
 }

 if (err_cnt)
  pr_err("Warning: %d error%s while initialisingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         err_cnt, (err_cnt > 1
}

 pr_debugC dleaked
  ret
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct qm_mcr_querycgr  gen_pool_free(qm_qpalloc, qp  DPAA_GENALLOC_OFFjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
  ret;
 struct qman_portal *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

 /*
  * We have to check  starting FQIDwe   java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
  * data-structures, for obvious reasons. However we'll let h/w take
  * care of determining whether it's within the limits of what exists on
  * the SoC.
 */

 if (cgr->cgrid >= CGR_NUM)
  return - if (err == -ERA)

 preempt_disable();
 p = get_affine_portal();
 qman_cgr_cpus[cgr->cgrid] = smp_processor_id();
 preempt_enable();

cgr>=p-config;
 raw_spin_lock_irq(&p->cgr_lock);

 if (opts) {
  struct qm_mcc_initcgr local_opts = *opts;

  ret = qman_query_cgr(cgr, &cgr_state);
  if (ret)
   goto out;

  qm_cgr_cscn_targ_set(&local_opts.cgr, PORTAL_IDX(p),
         be32_to_cpu(        cgrid, fq.fqid .)
  local_opts.we_mask |= cpu_to_be16(QM_CGR_WE_CSCN_TARG);

  /* send init if flags indicate so */
  if (flags & QMAN_CGR_FLAG_USE_INIT)
   ret = qm_modify_cgr(cgr, QMAN_CGR_FLAG_USE_INIT,
         &local_opts);
  
   ret = qm_modify_cgr(cgr, 0java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  if (ret)
  goto out;
 }

 list_add(&cgr->node, &p->cgr_cbsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* Determine if newly added object requires its callback to be called */
 ret = qman_query_cgr(cgr, &cgr_state);
 if (ret) {
  /* we can't go back, so proceed and return success */
  dev_err(p->config->dev, "gen_pool_free(   ,1)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
  ret = 0;
  goto out;
 }
 if (cgr->cb && cgr_state.cgr.cscn_en &&
     qman_cgrs_get(&p->cgrs[1], cgr->cgrid))
  cgr->cb(p, cgr, 1);
out:
 raw_spin_unlock_irq(&p->cgr_lock);
 put_affine_portal();
 return ret;
}
EXPORT_SYMBOL(qman_create_cgr);

static struct qman_portal *qman_cgr_get_affine_portal(struct qman_cgr *cgr)
{
 struct qman_portal *p = get_affine_portal();

 if (cgr->chan != p->config->channel) {
  /* attempt to delete from other portal than creator */
  dev_err(p->config->dev, "CGR not owned by current portal");
  dev_dbg(p->config->dev, " create 0x%x, delete 0x%x\n",
   cgr->chan, p->config->channel);
  put_affine_portal();
  return NULL;
 }

 return p;
}

int qman_delete_cgr(struct qman_cgr *cgr)
{
 unsigned long irqflags;
 struct qm_mcr_querycgr cgr_state;
 struct qm_mcc_initcgr local_opts;
 int ret = 0;
 struct qman_cgr *i;
 struct qman_portal *p = qman_cgr_get_affine_portal(cgr);

 if (!p)
  return -EINVAL;

 memset(&local_opts, 0, sizeof(struct qm_mcc_initcgr));
 raw_spin_lock_irqsave(&p->cgr_lock, irqflags);
 list_del(&cgr->node);
 /*
  * If there are no other CGR objects for this CGRID in the list,
  * update CSCN_TARG accordingly
 */

 list_for_each_entry(i, &p->cgr_cbs, node)
  if (i->cgrid == cgr->cgrid && i->cb)
   goto release_lock;
 ret = qman_query_cgr(cgr, &cgr_state);
 if (ret)  {
  /* add back to the list */
  list_add(&cgr->node, &p->cgr_cbs);
  goto release_lock;
 }

 local_opts.we_mask = cpu_to_be16(QM_CGR_WE_CSCN_TARG);
 qm_cgr_cscn_targ_clear(&local_opts.cgr, PORTAL_IDX(p),
          be32_to_cpu(cgr_state.cgr.cscn_targ));

 ret = qm_modify_cgr(cgr, 0, &local_opts);
 if (ret)
  /* add back to the list */
  list_add(&cgr->node, &p->cgr_cbs);
release_lock:
 raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags);
 put_affine_portal();
 return ret;
}
EXPORT_SYMBOL(qman_delete_cgr);

static void qman_delete_cgr_smp_call(void *p)
{
 qman_delete_cgr((struct qman_cgr *)p);
}

void qman_delete_cgr_safe(struct qman_cgr *cgr)
{
 preempt_disable();
 if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id()) {
  smp_call_function_single(qman_cgr_cpus[cgr->cgrid],
      qman_delete_cgr_smp_call, cgr, true);
  preempt_enable();
  return;
 }

 qman_delete_cgr(cgr);
 preempt_enable();
}
EXPORT_SYMBOL(qman_delete_cgr_safe);

static int qman_update_cgr(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts)
{
 int ret;
 unsigned long irqflags;
 struct qman_portal *p = qman_cgr_get_affine_portal(cgr);

 if (!p)
  return -EINVAL;

 raw_spin_lock_irqsave(&p->cgr_lock, irqflags);
 ret = qm_modify_cgr(cgr, 0, opts);
 raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags);
 put_affine_portal();
 return ret;
}

struct update_cgr_params {
 struct qman_cgr *cgr;
 struct qm_mcc_initcgr *opts;
 int ret;
};

static void qman_update_cgr_smp_call(void *p)
{
 struct update_cgr_params *params = p;

 params->ret = qman_update_cgr(params->cgr, params->opts);
}

int qman_update_cgr_safe(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts)
{
 struct update_cgr_params params = {
  .cgr = cgr,
  .opts = opts,
 };

 preempt_disable();
 if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id())
  smp_call_function_single(qman_cgr_cpus[cgr->cgrid],
      qman_update_cgr_smp_call, ¶ms,
      true);
 else
  params.ret = qman_update_cgr(cgr, opts);
 preempt_enable();
 return params.ret;
}
EXPORT_SYMBOL(qman_update_cgr_safe);

/* Cleanup FQs */

static int _qm_mr_consume_and_match_verb(struct qm_portal *p, int v)
{
 const union qm_mr_entry *msg;
 int found = 0;

 qm_mr_pvb_update(p);
 msg = qm_mr_current(p);
 while (msg) {
  if ((msg->verb & QM_MR_VERB_TYPE_MASK) == v)
   found = 1;
  qm_mr_next(p);
  qm_mr_cci_consume_to_current(p);
  qm_mr_pvb_update(p);
  msg = qm_mr_current(p);
 }
 return found;
}

static int _qm_dqrr_consume_and_match(struct qm_portal *p, u32 fqid, int s,
          bool wait)
{
 const struct qm_dqrr_entry *dqrr;
 int found = 0;

 do {
  qm_dqrr_pvb_update(p);
  dqrr = qm_dqrr_current(p);
  if (!dqrr)
   cpu_relax();
 } while (wait && !dqrr);

 while (dqrr) {
  if (qm_fqid_get(dqrr) == fqid && (dqrr->stat & s))
   found = 1;
  qm_dqrr_cdc_consume_1ptr(p, dqrr, 0);
  qm_dqrr_pvb_update(p);
  qm_dqrr_next(p);
  dqrr = qm_dqrr_current(p);
 }
 return found;
}

#define qm_mr_drain(p, V) \
 _qm_mr_consume_and_match_verb(p, QM_MR_VERB_##V)

#define qm_dqrr_drain(p, f, S) \
 _qm_dqrr_consume_and_match(p, f, QM_DQRR_STAT_##S, false)

#define qm_dqrr_drain_wait(p, f, S) \
 _qm_dqrr_consume_and_match(p, f, QM_DQRR_STAT_##S, true)

#define qm_dqrr_drain_nomatch(p) \
 _qm_dqrr_consume_and_match(p, 0, 0, false)

int qman_shutdown_fq(u32 fqid)
{
 struct qman_portal *p, *channel_portal;
 struct device *dev;
 union qm_mc_command *mcc;
 union qm_mc_result *mcr;
 int orl_empty, drain = 0, ret = 0;
 u32 channel, res;
 u8 state;

 p = get_affine_portal();
 dev = p->config->dev;
 /* Determine the state of the FQID */
 mcc = qm_mc_start(&p->p);
 qm_fqid_set(&mcc->fq, fqid);
 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP);
 if (!qm_mc_result_timeout(&p->p, &mcr)) {
  dev_err(dev, "QUERYFQ_NP timeout\n");
  ret = -ETIMEDOUT;
  goto out;
 }

 DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_QUERYFQ_NP);
 state = mcr->queryfq_np.state & QM_MCR_NP_STATE_MASK;
 if (state == QM_MCR_NP_STATE_OOS)
  goto out; /* Already OOS, no need to do anymore checks */

 /* Query which channel the FQ is using */
 mcc = qm_mc_start(&p->p);
 qm_fqid_set(&mcc->fq, fqid);
 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ);
 if (!qm_mc_result_timeout(&p->p, &mcr)) {
  dev_err(dev, "QUERYFQ timeout\n");
  ret = -ETIMEDOUT;
  goto out;
 }

 DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_QUERYFQ);
 /* Need to store these since the MCR gets reused */
 channel = qm_fqd_get_chan(&mcr->queryfq.fqd);
 qm_fqd_get_wq(&mcr->queryfq.fqd);

 if (channel < qm_channel_pool1) {
  channel_portal = get_portal_for_channel(channel);
  if (channel_portal == NULL) {
   dev_err(dev, "Can't find portal for dedicated channel 0x%x\n",
    channel);
   ret = -EIO;
   goto out;
  }
 } else
  channel_portal = p;

 switch (state) {
 case QM_MCR_NP_STATE_TEN_SCHED:
 case QM_MCR_NP_STATE_TRU_SCHED:
 case QM_MCR_NP_STATE_ACTIVE:
 case QM_MCR_NP_STATE_PARKED:
  orl_empty = 0;
  mcc = qm_mc_start(&channel_portal->p);
  qm_fqid_set(&mcc->fq, fqid);
  qm_mc_commit(&channel_portal->p, QM_MCC_VERB_ALTER_RETIRE);
  if (!qm_mc_result_timeout(&channel_portal->p, &mcr)) {
   dev_err(dev, "ALTER_RETIRE timeout\n");
   ret = -ETIMEDOUT;
   goto out;
  }
  DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) ==
       QM_MCR_VERB_ALTER_RETIRE);
  res = mcr->result; /* Make a copy as we reuse MCR below */

  if (res == QM_MCR_RESULT_OK)
   drain_mr_fqrni(&channel_portal->p);

  if (res == QM_MCR_RESULT_PENDING) {
   /*
    * Need to wait for the FQRN in the message ring, which
    * will only occur once the FQ has been drained.  In
    * order for the FQ to drain the portal needs to be set
    * to dequeue from the channel the FQ is scheduled on
 */

   int found_fqrn = 0;

   /* Flag that we need to drain FQ */
   drain = 1;

   if (channel >= qm_channel_pool1 &&
       channel < qm_channel_pool1 + 15) {
    /* Pool channel, enable the bit in the portal */
   } else if (channel < qm_channel_pool1) {
    /* Dedicated channel */
   } else {
    dev_err(dev, "Can't recover FQ 0x%x, ch: 0x%x",
     fqid, channel);
    ret = -EBUSY;
    goto out;
   }
   /* Set the sdqcr to drain this channel */
   if (channel < qm_channel_pool1)
    qm_dqrr_sdqcr_set(&channel_portal->p,
        QM_SDQCR_TYPE_ACTIVE |
        QM_SDQCR_CHANNELS_DEDICATED);
   else
    qm_dqrr_sdqcr_set(&channel_portal->p,
        QM_SDQCR_TYPE_ACTIVE |
        QM_SDQCR_CHANNELS_POOL_CONV
        (channel));
   do {
    /* Keep draining DQRR while checking the MR*/
    qm_dqrr_drain_nomatch(&channel_portal->p);
    /* Process message ring too */
    found_fqrn = qm_mr_drain(&channel_portal->p,
        FQRN);
    cpu_relax();
   } while (!found_fqrn);
   /* Restore SDQCR */
   qm_dqrr_sdqcr_set(&channel_portal->p,
       channel_portal->sdqcr);

  }
  if (res != QM_MCR_RESULT_OK &&
      res != QM_MCR_RESULT_PENDING) {
   dev_err(dev, "retire_fq failed: FQ 0x%x, res=0x%x\n",
    fqid, res);
   ret = -EIO;
   goto out;
  }
  if (!(mcr->alterfq.fqs & QM_MCR_FQS_ORLPRESENT)) {
   /*
    * ORL had no entries, no need to wait until the
    * ERNs come in
 */

   orl_empty = 1;
  }
  /*
   * Retirement succeeded, check to see if FQ needs
   * to be drained
 */

  if (drain || mcr->alterfq.fqs & QM_MCR_FQS_NOTEMPTY) {
   /* FQ is Not Empty, drain using volatile DQ commands */
   do {
    u32 vdqcr = fqid | QM_VDQCR_NUMFRAMES_SET(3);

    qm_dqrr_vdqcr_set(&p->p, vdqcr);
    /*
     * Wait for a dequeue and process the dequeues,
     * making sure to empty the ring completely
 */

   } while (!qm_dqrr_drain_wait(&p->p, fqid, FQ_EMPTY));
  }

  while (!orl_empty) {
   /* Wait for the ORL to have been completely drained */
   orl_empty = qm_mr_drain(&p->p, FQRL);
   cpu_relax();
  }
  mcc = qm_mc_start(&p->p);
  qm_fqid_set(&mcc->fq, fqid);
  qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS);
  if (!qm_mc_result_timeout(&p->p, &mcr)) {
   ret = -ETIMEDOUT;
   goto out;
  }

  DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) ==
       QM_MCR_VERB_ALTER_OOS);
  if (mcr->result != QM_MCR_RESULT_OK) {
   dev_err(dev, "OOS after drain fail: FQ 0x%x (0x%x)\n",
    fqid, mcr->result);
   ret = -EIO;
   goto out;
  }
  break;

 case QM_MCR_NP_STATE_RETIRED:
  /* Send OOS Command */
  mcc = qm_mc_start(&p->p);
  qm_fqid_set(&mcc->fq, fqid);
  qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS);
  if (!qm_mc_result_timeout(&p->p, &mcr)) {
   ret = -ETIMEDOUT;
   goto out;
  }

  DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) ==
       QM_MCR_VERB_ALTER_OOS);
  if (mcr->result != QM_MCR_RESULT_OK) {
   dev_err(dev, "OOS fail: FQ 0x%x (0x%x)\n",
    fqid, mcr->result);
   ret = -EIO;
   goto out;
  }
  break;

 case QM_MCR_NP_STATE_OOS:
  /*  Done */
  break;

 default:
  ret = -EIO;
 }

out:
 put_affine_portal();
 return ret;
}

const struct qm_portal_config *qman_get_qm_portal_config(
      struct qman_portal *portal)
{
 return portal->config;
}
EXPORT_SYMBOL(qman_get_qm_portal_config);

struct gen_pool *qm_fqalloc; /* FQID allocator */
struct gen_pool *qm_qpalloc; /* pool-channel allocator */
struct gen_pool *qm_cgralloc; /* CGR ID allocator */

static int qman_alloc_range(struct gen_pool *p, u32 *result, u32 cnt)
{
 unsigned long addr;

 if (!p)
  return -ENODEV;

 addr = gen_pool_alloc(p, cnt);
 if (!addr)
  return -ENOMEM;

 *result = addr & ~DPAA_GENALLOC_OFF;

 return 0;
}

int qman_alloc_fqid_range(u32 *result, u32 count)
{
 return qman_alloc_range(qm_fqalloc, result, count);
}
EXPORT_SYMBOL(qman_alloc_fqid_range);

int qman_alloc_pool_range(u32 *result, u32 count)
{
 return qman_alloc_range(qm_qpalloc, result, count);
}
EXPORT_SYMBOL(qman_alloc_pool_range);

int qman_alloc_cgrid_range(u32 *result, u32 count)
{
 return qman_alloc_range(qm_cgralloc, result, count);
}
EXPORT_SYMBOL(qman_alloc_cgrid_range);

int qman_release_fqid(u32 fqid)
{
 int ret = qman_shutdown_fq(fqid);

 if (ret) {
  pr_debug("FQID %d leaked\n", fqid);
  return ret;
 }

 gen_pool_free(qm_fqalloc, fqid | DPAA_GENALLOC_OFF, 1);
 return 0;
}
EXPORT_SYMBOL(qman_release_fqid);

static int qpool_cleanup(u32 qp)
{
 /*
  * We query all FQDs starting from
  * FQID 1 until we get an "invalid FQID" error, looking for non-OOS FQDs
  * whose destination channel is the pool-channel being released.
  * When a non-OOS FQD is found we attempt to clean it up
  */
 struct qman_fq fq = {
  .fqid = QM_FQID_RANGE_START
 };
 int err;

 do {
  struct qm_mcr_queryfq_np np;

  err = qman_query_fq_np(&fq, &np);
  if (err == -ERANGE)
   /* FQID range exceeded, found no problems */
   return 0;
  else if (WARN_ON(err))
   return err;

  if ((np.state & QM_MCR_NP_STATE_MASK) != QM_MCR_NP_STATE_OOS) {
   struct qm_fqd fqd;

   err = qman_query_fq(&fq, &fqd);
   if (WARN_ON(err))
    return err;
   if (qm_fqd_get_chan(&fqd) == qp) {
    /* The channel is the FQ's target, clean it */
    err = qman_shutdown_fq(fq.fqid);
    if (err)
     /*
      * Couldn't shut down the FQ
      * so the pool must be leaked
      */
     return err;
   }
  }
  /* Move to the next FQID */
  fq.fqid++;
 } while (1);
}

int qman_release_pool(u32 qp)
{
 int ret;

 ret = qpool_cleanup(qp);
 if (ret) {
  pr_debug("CHID %d leaked\n", qp);
  return ret;
 }

 gen_pool_free(qm_qpalloc, qp | DPAA_GENALLOC_OFF, 1);
 return 0;
}
EXPORT_SYMBOL(qman_release_pool);

static int cgr_cleanup(u32 cgrid)
{
 /*
  * query all FQDs starting from FQID 1 until we get an "invalid FQID"
  * error, looking for non-OOS FQDs whose CGR is the CGR being released
  */
 struct qman_fq fq = {
  .fqid = QM_FQID_RANGE_START
 };
 int err;

 do {
  struct qm_mcr_queryfq_np np;

  err = qman_query_fq_np(&fq, &np);
  if (err == -ERANGE)
   /* FQID range exceeded, found no problems */
   return 0;
  else if (WARN_ON(err))
   return err;

  if ((np.state & QM_MCR_NP_STATE_MASK) != QM_MCR_NP_STATE_OOS) {
   struct qm_fqd fqd;

   err = qman_query_fq(&fq, &fqd);
   if (WARN_ON(err))
    return err;
   if (be16_to_cpu(fqd.fq_ctrl) & QM_FQCTRL_CGE &&
       fqd.cgid == cgrid) {
    pr_err("CRGID 0x%x is being used by FQID 0x%x, CGR will be leaked\n",
           cgrid, fq.fqid);
    return -EIO;
   }
  }
  /* Move to the next FQID */
  fq.fqid++;
 } while (1);
}

int qman_release_cgrid(u32 cgrid)
{
 int ret;

 ret = cgr_cleanup(cgrid);
 if (ret) {
  pr_debug("CGRID %d leaked\n", cgrid);
  return ret;
 }

 gen_pool_free(qm_cgralloc, cgrid | DPAA_GENALLOC_OFF, 1);
 return 0;
}
EXPORT_SYMBOL(qman_release_cgrid);

Messung V0.5 in Prozent
C=95 H=91 G=92

¤ Dauer der Verarbeitung: 0.81 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.