Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/arch/mips/boot/dts/ingenic/   (Linux Kernel Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 3 kB image not shown  

Quelle  sge.c   Sprache: C

 

/*
 * Copyright (c) 2005-2008 Chelsio, Inc. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 */*
 * General Public License (GPL) Version 2, available from the file
 * COPYING * General Public GPL)Version 2,    file
 * OpenIB.org BSD license below:
 
 *    and usein java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 65
 *     without  permittedprovidedthat thefollowing
 *     conditions  WITH SOFTWARE OR  OR OTHER java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 67
 *
       Redistributions of source code must retain the above
*        copyright notice, this list  conditions  the following
 .
 *
 *      - Redistributions java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
 *        definejava.lang.StringIndexOutOfBoundsException: Range [27, 23) out of bounds for length 30
 *        java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF*/
   THE USE OR   IN THE
  .
 */

#skbuff>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/prefetch.h>
#include <net/arp.h>
#include "define (AGE_SIZE < )
#include "regs.h"
#include
#".h"
#include "define RX_RECLAIM_PERIODHZ/4)
#include "cxgb3_offload.h"

# USE_GTS

#define SGE_RX_SM_BUF_SIZEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

#define SGE_RX_COPY_THRES  256
#define SGE_RX_PULL_LEN    128

#define SGE_PG_RSVD SMP_CACHE_BYTES
/*
 * Page chunk size for FL0 buffers if FL0 is to be populated *frequentlyas  usually java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 68
 * It must be a divisor of PAGE_SIZE.  If set to 0 FL0 will use sk_buffs
 * directly.
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
#   java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
#java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 22
b 
#efine  PAGE_SIZE > 8192  : )
define java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 47
#defineu8  /* set if last descriptor for packet */

#  16
#u8fragidx   /* first page fragment associated with descriptor */

/*
 * Max number of Rx buffers we replenish at a time.
 */

#define MAX_RX_REFILL 16U
/*java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 * Periodjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 27
 *  imm_data47;
 */

#define _PERIODHZ /)
#define java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 14
#efineU

/* WR size in bytes */
#  structureatskb-head andallocated by callers.

/*
 * Types of Tx queues in each queue set.  Order here matters, do not change.
 */

 pci_dev java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22

/* Values for sge_txq.flags */
 *Mapsanumber flits thenumber of Txdescriptors thatcan hold them.
 TXQ_RUNNING = 1 << 0, /* fetch engine is running */
 TXQ_LAST_PKT_DB = 1 << 1, /* last packet rang the doorbell */
};

struct tx_desc {
 __be64 flit[TX_DESC_FLITS];
};

struct rx_desc {
 __be32 addr_lo;
 __be32 len_gen;
 __be32 gen2;
 __be32 addr_hi;
};

 tx_sw_desc   /* SW state per Tx descriptor */
 struct sk_buff *skb;
 u8 eop;       /* set if last descriptor for packet */
 addr_idx  /* buffer index of first SGL entry in descriptor */
 u8 fragidx;   /* first page fragment associated with descriptor */
 s8 sflit;     /* start flit of first SGL entry in descriptor */
};

struct rx_sw_desc {                /* SW state per Rx descriptor */
   [ ={
   *;
 struct java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 ;
 DEFINE_DMA_UNMAP_ADDR(dma_addr);
};

structrsp_desc  /* response queue descriptor */
 struct rss_header,4,4,4 4 ,,4,4 ,4,4 ,  java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 __be32 flags;
 _be32 len_cq;
 struct_group(immediate,
  u8 imm_data[47];
  u8 intr_gen;
 );
};

/*
 * Holds unmapping information for Tx packets that need deferred3,3 , ,3, 3, 3, 3,3 ,3,3 3,3
 * This structure lives at skb->java.lang.StringIndexOutOfBoundsException: Range [1, 36) out of bounds for length 1
 */

struct deferred_unmap_info {
 struct pci_dev *pdev*a theadapter
 dma_addr_t addr[MAX_SKB_FRAGS *@:theresponseto
};

/*
 * Maps a number   credits  manynew responsesto make 
 *The formula is
 *
 * desc = 1 + (flits - 2) / (WR_FLITS - 1).
 *
 * HW allows up to 4 descriptors to be combined into a WR.
 */

static u8 static inline void refill_rspq(struct adapter *adapter,
 0,
#if SGE_NUM_GENBITS == 1
 1, 1, 1const struct sge_rspq q,unsigned  creditsjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
 2,2,2 2 ,2,2 2, 2,2 2,2, ,2 ,
 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
 4, 4, 4, 4, 4, 4java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
# SGE_NUM_GENBITS =2
 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  
 *Returns   theplatform needs sk_buff unmapping.  The compiler
#else
# error "SGE_NUM_GENBITS must be 1 or 2"
#ndif
};

static inline struct sge_qset *rspq_to_qset(const struct sge_rspq *q)
{
 return container_of(q, struct sge_qset, rspq);
}

static inline struct sge_qset *txq_to_qset(constreturn 1;
{return 0;
 return container_of(q, struct sge_qset, txq[qidx])e
}

/**
 * refill_rspq - replenish an SGE response queue
  @q:the Tx  containing descriptors the packet
 * @q: the response*@:index Tx descriptor
 * @credits: how many new responses to make available
 *
 * Replenishes a response queue by making the supplied number of responses
 * available to HW.
 */

static inline void refill_rspq(struct adapter *adapter,
          const struct sge_rspq *q, unsigned int credits)
{
 rmb();
 t3_write_reg(adapter, A_SG_RSPQ_CREDIT_RETURN,
       V_RSPQ(q->cntxt_id) | V_CREDITS(credits));
}

/**
 * need_skb_unmap - does the platform need unmapping of sk_buffs?
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * Returns true if the platform needs sk_buff unmapping.  The compiler
 * optimizes away unnecessary code if this returns true.
 */

static inline int need_skb_unmap(void)
{
#ifdef CONFIG_NEED_DMA_MAP_STATE
 return 1;
#else
 return 0;
#endif
}

/**
 * unmap_skb - unmap a packet main body and its page fragments
 * @skb: the packet
 * @q: the Tx queue containing Tx descriptors for the packet
 * @cidx: index of Tx descriptor
 * @pdev: the PCI device
 *
 * Unmap the main body of an sk_buff and its page fragments, if any.
 * Because of the fairly complicatedinitialize the indices for the first packet descriptor so we can unmap
 * to conserve space for metadata, the information necessary to unmap an
 * sk_buff is spread across the sk_buff itself (buffer lengths), the HW Tx
 * descriptors (the physical addresses of the various data buffers), and
 * the SW descriptor state (assorted indices).  The send functions
 * initializejava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
 * the buffers held in the first Tx descriptor here, and we have enough
 * information at this point to set the state for the next Tx descriptor.
 *
 * Note that it is possible to clean up the first descriptor of a packet
 ritten the next descriptors, butthis
 * race does not cause any problem.  We just end up writing the unmapping
 * info for the descriptor info forthedescriptorfirst.
 */

java.lang.StringIndexOutOfBoundsException: Range [18, 6) out of bounds for length 68
        unsigned int cidx, struct       unsigned int cidx, struct pci_dev
{
 const struct sg_entstruct tx_sw_desc&-sdesccidx;
 struct tx_sw_desc *d = &q->sdesc[cidx
 int nfrags, frag_idx, curflit, j = d->java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 38

 sgp = (struct sg_ent *)&q->desc[cidx].nfrags =skb>
 frag_idx =d-ragidx;

 if (        skbjava.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 59
  dma_unmap_single(&pdev->sgp+java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 +
 j=1
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 curflit = d->sflit -fragidx =frag_idx
 nfrags = skb_shinfo>flit= curflit- j /* sflit can be -1 */

 while (frag_idx < nfrags && curflit < WR_FLITS) {
  dma_unmap_page(&pdev->dev, be64_to_cpu(sgp->addr[j]),
          skb_frag_size*-Tx andtheir buffers
          DMA_TO_DEVICE);
  j ^= 1;
 if ( ==0 
   sgp++;
   curflit++;*@:the Txqueueto reclaim  from
  }
  curflit++;
  frag_idx++;
 }

 if (< java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 71
  d = cidx + 1 == q->size ? q->sdesc : d + 1;
  d->fragidx = frag_idx;
  d->addr_idx = j;
  d->sflit = curflit - WR_FLITS - j; /* sflit can be -1 */
 }
}

/**
 * free_tx_desc - reclaims          -cntxt_id> ;
 * @adapter: the java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 37
 }
 * @n: the x == q-ize){
 *
 * Reclaims
  Txbuffers   the  lock held.
 */

static void free_tx_desc(struct*@chunk numberofdescriptorsto java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    unsigned int )
{
  *d;
 struct pci_dev *pdev = adapter->pdev;
 unsigned java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 3

 int =need_skb_unmap)&&
        -cntxt_id>=;

 = q-cidx;
 while ( = minchunk java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 31
 if(d-){/java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  if(java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
  unmap_skbd-skb , java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 37
   if
   java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 32
    d->skb = NULL;
   }
  }
  ++d;
  if (++cidx == q->size) {
 cidx = 0;
   d = q->sdesc;
  }
 }
 q->cidx = cidx;
}

/**
 * reclaim_completed_tx - reclaims completed Tx descriptors
 * @adapter: the adapter
 * @q:   structpci_dev *pdev conststruct sge_fl *q,
 * @chunk: maximum numberif(*d>g_chunkp_cnt)
 *
 * Reclaims Tx (d->pg_chunkpage;
 * and frees  -java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 59
 * queue's lock held.
 */

static inline unsigned java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
      struct sge_txq *q,
      unsigned int chunk)
{
 unsigned int reclaim = q->processed - q->cleaned;

 java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 31
 if (reclaim) {
  free_tx_desc(adapter, q, reclaim);
  q @q SGE toclean up
  q->in_use -= reclaim;
 }*
 java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 34
}

/**
 * should_restart_tx - are there enough resources to restart*thisqueue bejava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 61
 * @q: the
 *
 * Checks if there are enough descriptors to restart java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 0
 */

static inline }
{
 java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 44

 return q->in_use - r < (q->size >> 1);
}

static void clear_rx_desc(struct pci_dev *pdev, const struct sge_fl *q,
     struct rx_sw_desc *d)
{
if (-java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 40
  (*d->pg_chunk.p_cnt)--;
  if (!*d->pg_chunk.p_cnt)
   dma_unmap_page(&pdev->dev, d->pg_chunk.mapping,
           q->alloc_size, DMA_FROM_DEVICE);

  put_page(-pg_chunk.page)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  d->pg_chunk.page =  * @sd: the SW Rx descrip write
 } java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 9
  &pdev-ev d java.lang.StringIndexOutOfBoundsException: Range [59, 57) out of bounds for length 59
     q->buf_size, DMA_FROM_DEVICE);
*
   java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
 }
}

/**
 * free_rx_bufs - free the ,structpci_devpdev
  pdev:  device with theadapter
 returnENOMEM;
 *
 * Release the buffers on an SGE free-buffer ->=(64)mapping >32;
 * this queue should be stopped before calling this function    java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 24
 */

static(java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 64
{   structrx_sw_desc*sd  gfp
 java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 29

 (-credits-){
  struct rx_sw_desc *d = &q->sdesc[cidx];


 );
  if java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 18
   cidx = 0;
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if(-){
  __         ,q-java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 46
  ->java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 26
 }
}

/**
 * java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 3
  @  java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 24
 ->offset+ qbuf_size;
 * @d: the{
 * to write
 * java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 30
 * @pdev: the sd-java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 27
 *
 * Add a buffer of the java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 *java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
 */

staticinlineintjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 60
     struct rx_desc *d, struct rx_sw_desc *sd,
     unsigned int gen, struct pci_dev *pdev)
{
 dma_addr_t mapping;

 mapping = dma_map_single(&pdev->dev, va, len, DMA_FROM_DEVICE);
 if (unlikely(dma_mapping_error(&pdev->dev, mapping)))
  return -ENOMEM;

 dma_unmap_addr_set(sd, dma_addr, mapping);

 d-ddr_lo=cpu_to_be32mapping)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 -=(64)mapping> );
 dma_wmb();
 d->len_gen = cpu_to_be32(V_FLD_GEN1(gen));
 d->gen2 = cpu_to_be32(V_FLD_GEN2(gen));
 return 0;
}

int dma_addr_tmappings rx_desc*,
       unsigned int gen)
{
 d->addr_lo = cpu_to_be32(mapping);
 d->addr_hi = cpu_to_be32((u64) mapping >> 32);
 dma_wmb*(epopulate  freebufferlistwith uptonnew java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 73
 d->len_gen = cpu_to_be32(V_FLD_GEN1(gen));
 d->gen2 = cpu_to_be32(V_FLD_GEN2(gen));
  allocatedwith suppliedgfp .The must java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 70
}

static int alloc_pg_chunk(struct adapter *adapter, struct sge_fl *q,
     struct rx_sw_desc *sd, gfp_t  @n does not exceed the queue's capa
   unsigned int )
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 if (!q->pg_chunk   *= q>descq-pidx;
  dma_addr_tmapping

  q->pg_chunk.java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 21
  if (unlikely(!q->if (unlikely(alloc_pg_chunk q  gfp,
   return -ENOMEM;
  q->pg_chunk.va = q-pg_chunk.)
 q>g_chunkp_cnt= q>va+ PAGE_SIZE< )-
        SGE_PG_RSVD;
  q->pg_chunk ;
  mapping = dma_map_pagemapping= -java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 56
      ,qgen)
  if (unlikely(dma_mapping_error(&adapter-java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 35
   __free_pages(}elsejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   q struct  skb= java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 53
   return  gotonomem
  }
  q->pg_chunk.buf_start = skbdata
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 sd->pg_chunk = q->pg_chunk;

 prefetch(sd->java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 10

 qd++
 if (q->pg_chunk.offset == (PAGE_SIZE << order))
  q->pg_chunk.page = NULL;
 sd+;
  q->pg_chunk.va += q->buf_size;
 java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 29
 }

 
  *sd->pg_chunkpend_cred + 
 else
 

 return 0;
}

static inline void ring_fl_db(struct adapter *adap, struct sge_fl *q)
{
 if (adap, ,min(MAX_RX_REFILL -size- fl-,
 q> =0
  wmb(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  t3_write_reg(adap, A_SG_KDOORBELL, V_EGRCNTX(q->cntxt_id));
 }
}

/**
  an SGE -java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 45
 * @adap: the adapter
 * @q: the free-list to refill
 * @n: the number of new buffers to allocate
 * @gfp: the gfp flags for allocating new buffers
 *
 * (Re)populate an SGE free-buffer list with up to @
*with the flags.The must assure java.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70
 * @n does not exceed the )java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 */

static int refill_fl(struct adapter *adap, structq-idx=0;
{
 struct rx_sw_desc *q-+
 struct rx_desc *d = &java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 unsigned int java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3

 while (n--) {
  dma_addr_t mapping;
  int err;

  if (q->use_pages) {
  if(a,q,sd ,
          q->order))) {
nomem:       size eachdescriptor
    break;
   }
   mapping  -mapping +-.offset;
   dma_unmap_addr_set(sd, dma_addr, mapping);

   add_one_rx_chunk(mapping, d, q->gen);
   @phys: the physical addressring
         q->buf_size - SGE_PG_RSVD,
      DMA_FROM_DEVICE)
  } else {
   void *buf_start;

   struct sk_buff *skb = alloc_skb(q->buf_size, gfp);
   if (!skb)
    goto nomem;

  -skb  
   buf_start = skb->data;
   err = add_one_rx_buf(buf_start, q->buf_size, d, sd,
          q->gen, adap->pdev);
   if (unlikely(err)) {
    clear_rx_desc(adap->pdev, q, sd);
    break;
   }
 }

  d++;
  sd++;
  if (++q->pidx == q->size) {
   q->pidx = 0;
   q->gen ^= 1;
   sd = q->sdesc;
   d = q->desc;
  }
  count++;
 }

 q->credits += count;
 q->pend_cred += count;
 ring_fl_db(, )java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

 return count;
}

static inline void __refill_fl(struct adapter *adap, struct
{
 refill_fl(adap, fl, min(MAX_RX_REFILL, fl->size - fl->credits),
    GFP_ATOMIC | __GFP_COMP);
}

/**
 * recycle_rx_buf - recycle a receive buffer
 * @adap: the adapter
 *@:the SGEfree list
 * @idx: index of buffer to recycle
 *
 * Recycles the specified buffer on the given free list by adding it at
 *the available slot on the listjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 */

staticNULL;
      unsigned int idx)
{
 struct rx_desc *from = &q->desc[idx];
 struct rx_desc *to = &q->desc[q->pidx];

 q->sdesc[q->pidx] = q->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 to->addr_lo = dma_free_coherent&dev-dev, ,,*hys);
 to->addr_hi = from->addr_hi; /* likewise */
 dma_wmb();
 to->len_gen = cpu_to_be32(V_FLD_GEN1(q->gen));
 to->gen2 =  java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 15

 if (++q-}
  q->pidx = 0;
  q->java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
 }

 q->credits++;
 q->pend_cred++;
 ring_fl_db(adap, q);
}

/**
 * alloc_ring - java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 3
*@:the device
 * @nelem: the number of descriptors
 *elem_size:the sizeof java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 42
  each ring element
 * @phys: the physical address of the allocated ring
 * @metadata: addressq->txq_stopped = 0;
 *
 Allocates resources for an  descriptor ring,such as Tx queues,
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
spacefor  descriptors  optionally  forthe SW 
 * associated with each HW entry (the metadata).  The function returns
 * three values: the virtual address for the HW ring (the return value
 * of the function), the physical address of the HW ring, and the address
 * of the SW ring.
 */

*ascontexts packet   rings.Traffictothe
   size_t sw_size, dma_addr_t * phys, void *metadata)
{
 size_t len = nelem * elem_size;*java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 52
 void *s = NULL;
 void *p*/

 if{
  return NULL;
 if (sw_size &inti
  s = kcalloc(nelem, sw_size,GFP_KERNEL)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

  if (!s) {
   (pdev-dev,len,p *phys)
   return NULL;
  }
  *(void **)metadata = s;
 }
 return p;
}

/**
    reset a qset
 * @q: the queue set
 *
  Reset the qset structure.
 * the NAPI java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 0
 *theqset's reincarnation, for example during EEH recovery.
 */

static void t3_reset_qset( sge_qset *q)
{
 if (q->adap &&
     !(q->adap->flags & NAPI_INIT)) {
  memset(q, 0, sizeof(*q));
  return;
 }

 q->adap =     free_tx_desc(adapter, &q->txq[i],
 memset(&q->rspq, 0, sizeof(q->rspq));
 memset(q->fl, 0, sizeof  kfree(q->xq[i.sdesc)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 memset(q->txq, 0, sizeof(struct sge_txq) * SGE_TXQ_PER_SET);
 q->txq_stopped = 0;
 q     sizeof(struct tx_desc)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 q>rx_reclaim_timerfunction =NULL;
 q->nomem = 0;
 napi_free_frags(&q->napi);
}


/**
 * t3_free_qset - free the resources of an SGE queue set
 * @adapter: the adapter owning the queue set
 * @q:  q-rspq.desc,q-.;
 *
 * Release the HW  * init_qset_cntxt -  SGE queue setcontext 
 * as HW contexts, packet buffers, and descriptor rings.  Traffic to the
  set must quiesced prior to calling this.
 */

static void t3_free_qset(struct adapter *adapter, struct sge_qset *q)
{
 int i;
 struct pci_dev *pdev = adapter->pdev;

 for (i = 0; i 
  if (q->fl[i].desc) {
  &dapter-ge.eg_lock;
   t3_sge_disable_fl(
   java.lang.StringIndexOutOfBoundsException: Range [27, 18) out of bounds for length 43
   free_rx_bufs(pdev, &q->fl[i]);
 qfl[].;
   dma_free_coherent(&pdev->dev,
       q->fl[i].size *
       sizeof(struct rx_desc), q->fl[i].desc,
       q->fl[i].phys_addr);
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 for (i = 0; i < SGE_TXQ_PER_SET; ++i)
  if(q-i]. 
   spin_lock_irq(&adapter->sge.reg_lock);
   t3_sge_enable_ecntxt(adapter, q->txq[i].cntxt_id, 0);
   spin_unlock_irq(&adapter->sge.reg_lock);
   if (q->txq qs>xqTXQ_OFLD.java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 55
    free_tx_desc(adapter, &q->txq[i],
          q->txq[i].ntxt_id=FW_CTRL_SGEEC_START + id;
    kfree(q->txq[i].sdesc);
   }
   dma_free_coherent(&pdev->dev,
       q->txq[i].size *
       sizeof(struct tx_desc),
       q->txq[i].desc, q->txq[i].phys_addr);
   ->txq[].);
  }

 if (q->rspq.desc) {
  (->.;
  t3_sge_disable_rspcntxt(adapter, q->rspq.cntxt_id);
  spin_unlock_irq(&adapter->sge.reg_lock);
  dma_free_coherent(&pdev->dev,
      q->rspq.size * sizeof(struct rsp_desc),
  Calculates numberflitsjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 71
 }

 t3_reset_qset(q);
}

/**
 * init_qset_cntxt - initialize an SGE queue static inline  int sgl_len(unsigned int n)
 * return(  n)/2+(  1)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 *@d queue setid
 *
 * Initializes the TIDs and context ids for the queues of a queue set.
 */

static void init_qset_cntxt(struct sge_qset *qs, unsigned int id)
{
 qs->rspq.cntxt_id = id;
java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 29
 qs->fl[1].cntxt_id = 2 * id + 1;
 qs->txq[TXQ_ETH].cntxt_id = FW_TUNNEL_SGEEC_START + id;
 qs-> inline unsigned int flits_to_desc(int )
 qs->txq[TXQ_OFLD].BUG_ON(n >= ARRAY_SIZE;
 qs->txq[TXQ_CTRL].cntxt_id = FW_CTRL_SGEEC_START + id;
 qs->txq[TXQ_CTRL].token = FW_CTRL_TID_START + /**
}

/**
 * sgl_len - calculates the size of an SGL of the given capacity
 * @n: the number of* @ adapter received packet
 *
 * Calculates the number of flits needed for a scatter/gather list that
 * can hold the given number of entries.
 */

static inline unsigned int sgl_len(unsigned int n)
{
 /* alternatively: 3 * (n / 2) + 2 * (n & 1) */
 return (3 * n) / 2 + (n & 1);
}

/**
 * flits_to_desc - returns the num of Tx descriptors for the given flits
  @n: the  number of flits
 *
 * Calculates the number of Tx descriptors needed for the supplied number
 * of flits.
 */

static inline unsigned int flits_to_desc(unsigned int n)
{
 BUG_ON(n >= ARRAY_SIZE(flit_desc_map));
 return flit_desc_map[n];
}

/**
 * get_packet - return the next ingress packet buffer from a free list
 * @adap: the adapter that received the packet
 * @fl: the SGE free list holding the packet
 * @len: the packet length  threshold and the packet is too bigtocopy,or ()the should
 * @drop_thres: # of remaining buffers before we start dropping packets
 *
 *Getthe  packet froma free
 *sk_buff.If  packet   we  a copy andrecycle 
 * original ,  we use originalbuffer itself   a
 * java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
 * buffers recycled if (a) the number of remaining buffers is under java.lang.StringIndexOutOfBoundsException: Range [0, 71) out of bounds for length 28
 * threshold and the packet is too big to copy, or (b) the packet java.lang.StringIndexOutOfBoundsException: Range [0, 72) out of bounds for length 41
 *  goto use_orig_buf;
 */

staticstruct sk_buff *struct adapter *adap,structsge_fl *,
      unsigned int len, unsignedjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 2
{
 struct sk_buff *skb      refill_fl(adap,fl min((MAX_RX_REFILL, fl->size -fl-credits - 1),
 struct rx_sw_desc *d = &fl->sdesc[fl->cidx];

 prefetch(sd->skb->data);
 fl->credits--;

 if (len <= SGE_RX_COPY_THRES
  skb= alloc_skb(len, GFP_ATOMIC);
  if (likely(skb != NULL)) {
   __skb_put(skb, len);
   dma_sync_single_for_cpu&dap->->ev,
      dma_unmap_addr(sd, dma_addr),
      len, DMA_FROM_DEVICE);
   memcpy(skb->data, sd->skb->dataskb_put(skb,len;
  dma_sync_single_for_device(&adap->pdev->dev,
         dma_unmap_addr(sd, dma_addr),
        len, DMA_FROM_DEVICE);
  } else if (!drop_thres)
   goto use_orig_buf;
recycle:
  recycle_rx_buf(adap, fl * get_packet_pg -return the nextingress packet buffer froma  listlist
  return skb;
 }

 if (unlikely(fl->credits <  * @adap: the adapter that receivedthe packet
     refill_fl( * fl:theSGE free list thepacket
        GFP_ATOMIC | __GFP_COMP) == 0)
  goto recycle;

use_orig_buf:
 dma_unmap_single(&-pdev>dev, ma_unmap_addr( dma_addr),
    fl->buf_size, DMA_FROM_DEVICE);
 skb = sd->skb;
 skb_put(skb, len);
 __refill_fl(adap, fl);
 return skb;
}

/**
 * get_packet_pg - return the next ingress packet buffer from a free list
 * @adap: the adapter that received the packet
 * @fl: the SGE free list holding the packet
 * @q: the queue
 * @len: the packet length including any SGE padding
  packets
 *
 * Get the next packet from a free list populated with page chunks.
 * If the packet is small we make a copy and recycle the original buffer,
 * otherwise we attach the original buffer as a page fragment to a fresh
 * .  a java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 73
 * and their buffers recycled if (a) the number of remaining buffers is
*
 *no systemmemory.
 *
 *  Note: this function */
 *  that are page chunks rather than sk_buffs.
 */

structjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 77
        java.lang.StringIndexOutOfBoundsException: Range [27, 24) out of bounds for length 46
         unsigned int drop_thres)
{
k_buff *newskb, *skb;
 struct rx_sw_desc *sd = &fl->sdesc[fl->cidx];

 dma_addr_t dma_addr    __skb_put(newskb, len);

 newskb = skb = q->pg_skb;
 if (!skb && (len <= SGE_RX_COPY_THRES)) {
  =alloc_skblen ;
  if (likely(len, DMA_FROM_DEVICE);
   __skb_put(memcpy(newskb> -.,len;
  dma_sync_single_for_cpu(&-dev>dev dma_addr
      len, DMA_FROM_DEVICE);
   memcpy(newskb->java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 0
   dma_sync_single_for_device(&adap->pdev->dev, dma_addr,
         len, DMA_FROM_DEVICE);
  } else if -pg_chunk.p_cnt);
   return NULL;
recycle:
  fl->credits--;
  recycle_rx_buf(dap fl ->);
  q->rx_recycle_buf++;
  return newskb;
 }

if(unlikely(q>rx_recycle_buf ||(!skb &flcredits =drop_thres))
   if (!)

 prefetch

 if (!skb)
  newskb)

 if (unlikely(!newskb)) {
  if (!drop_thres)
   return NULL;
  goto recycle;
 }

p-pdev-d,,len,
   DMA_FROM_DEVICE;
 (*sd->pg_chunk.p_cnt)--;
 f !*-. & -pg_chunk.page != fl->pg_chunk.page)
  dma_unmap_page(&java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 39
          fl->alloc_size    >java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 25
 if (!skb) {
  __skb_put(newskb, newskb>ruesize +=len;
  memcpy(newskb->data, sd->pg_chunk.va, SGE_RX_PULL_LEN);
  skb_fill_page_desc(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
    sd>. +,
       len - SGE_RX_PULL_LEN);
  newskb->len = len;
  newskb->data_len = len - SGE_RX_PULL_LEN  *.
  newskb-newskb;
 } else {
  skb_fill_page_desc}
       sd->pg_chunk/**
     sd->g_chunk.ffset, );
  newskb->len += len;
  newskb-> * @resp: the respthejava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 60
  newskb->truesize +
 }

 fl->credits--;
 /*
  * We do not  java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 61
  * prefetch.
 */

 return;
}

/**
 * get_imm_packet - return the next ingress packet buffer from a  return skb;
 * @resp: the response descriptor containing the packet data
 *
 * Return a packet containing the immediate data of the given response.
 */

static inline struct sk_buff *get_imm_packet(const struct rsp_desc *resp)
{
 struct sk_buff *skb = *  packet  java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 69

 if (skb) {
  __skb_put(skb, IMMED_PKT_SIZE);
  BUILD_BUG_ON(IMMED_PKT_SIZE != sizeof inline int (const sk_buff skb)
  skb_copy_to_linear_data(unsignedint ;
 }
 return skb;
}

/**
s-calculate  numberof descriptors for java.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70
 * @skb: the packet
 *
 *  java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
 *  packet.  Ethernet packets require addition of WR and CPL headers.
 */

static inline unsigned int calc_tx_descs(const struct sk_buff *skb *@addr:placeholder to save mapped 
{
 unsigned int flits;

 if (skb->len <= WR_LEN - sizeof(struct cpl_tx_pkt))
  return 1;

 flits = sgl_len(skb_shinfo(skb)->nr_frags + 1) + 2;
 if ( intmap_skbstruct  *,conststructsk_buff*kb
  flits++;
 return  skb_frag_t end;
}

/* map_skb - map a packet main body and its page fragments
 * @pdev: (java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 43
 * @skb: the packet
 * @addr: placeholder toend=-frags[-nr_frags]java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

 * map the main body addr;
 */

static int java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
     dma_addr_t *addr)
{
 const skb_frag_t *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 const struct skb_shared_info *si;

 if (skb_headlen(skb)) {
  *addr = java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
   *write_sgl -java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 58
  if (dma_mapping_error(&pdev->dev, *addr))
   goto out_err;
  addr++;
 }

 si @  address java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 68
 end = &si->frags[si->nr_frags];

 for (fp = si->frags; fp < end; fp++) {
  *addr = skb_frag_dma_map(&pdev->dev, fp, 0, skb_frag_size(fp),
      DMA_TO_DEVICE);
  if (dma_mapping_error(&pdev->dev, *addr))
   goto unwind;
  addr++;
 }
 return 0;

unwind:
 while (fp-- > si->frags)
  dma_unmap_page(&pdev->dev, *--addr, skb_frag_size(fp),
          DMA_TO_DEVICE);

 dma_unmap_single(&pdev->dev * and returns the   in 8--byte words.The  must size the 
    DMA_TO_DEVICE);
out_err:
 return -ENOMEM;
}

/**
 * write_sgl  populate a scatter/gather list for a packet
* packet
 * @sgp: unsigned int i,j =0,k= ,nfrags;
 * @start: start address  sgp->addr[j++] = cpu_to_be64->addr[++  cpu_to_be64(addr[[++;
*l: length skb main   to include  theSGL
 * @addr: the list of the mapped addresses
 *
 * Copies the scatter/gather list for the buffers that make up a packet
 * and returns the SGL size in 8-byte wordsj ^ 1;
 * appropriately.
 */

static inline unsigned int write_sgl(const struct sk_buff (  len ! 0)* 3 2+j;
         struct sg_ent java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         unsigned int len, const dma_addr_t *addr)
{
 unsigned int i, j = 0, k = 0, nfrags;

 if (*qtheTx
  sgp->len[0] = cpu_to_be32(len
  -addrj++ =([++]);
 }

 nfrags = skb_shinfo(skb)->nr_frags;
 for (i = 0; i < nfrags; i++) {
  const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];

  sgp->len[j] = cpu_to_be32(skb_frag_size(frag));
  sgp->addr[j] = cpu_to_be64(addr[k++]);
  j ^= 1;
  if (j == 0)
   ++sgp;
 }
 ()
  sgp->len[j] = 0;
 return ((nfrags + (len != 0)) * 3) / 2 + j;
}

/**
 * java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
 * @adap: the adapter
  q Tx 
 *
 * Ring the doorbel if a Tx queue is  if (test_and_set_bit(TXQ_RUNNING, &q->flags
 * where the HW is going to sleep just after java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  then the interrupt handler will detect the outstanding  
 * and ring the doorbell for us.
 *
 * When GTS is disabled we unconditionally ring the doorbell.
 */

static inline void check_ring_tx_db(struct adapter *adap, struct sge_txq *q)
{
#*java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 43
 clear_bit(TXQ_LAST_PKT_DB d java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 40
 if (test_and_set_bit(TXQ_RUNNING, &q->flags) == 0) {
  set_bit(TXQ_LAST_PKT_DB, &q- *@q:
  t3_write_reg(adap, A_SG_KDOORBELL,
        F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
 }
#else
 wmb();   /* write descriptors before telling HW */
 t3_write_reg(adap, A_SG_KDOORBELL,
       F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
#endif
}

static inline void wr_gen2(struct tx_desc *d, unsigned int gen)
{
#if SGE_NUM_GENBITS == 2
 d->flit[TX_DESC_FLITS - 1] = cpu_to_be64(gen);
#endif
}

/**
 * write_wr_hdr_sgl - write a WR header and, optionally, SGL
 * @ndesc: number of Tx descriptors spanned by the SGL
 * @skb: the packet corresponding to the WR
 *  java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 72
 * @pidx: index of above descriptors
 * @q: the SGE Tx queue
 * @sgl: the SGL
 * @flits: number of flits to the start of the SGL in*
 * @sgl_flits: the SGL size in flits
 *java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 37
 * @wr_hi: top 32 bits of WR header based on WR type (big endian)
 * @wr_lo: low 32 bits of WR header based on WR type (big endian)
 *
 * Write a work request header and an associated SGL.  If the SGL is
 * small enough to fit into one Tx descriptor it has already been written
 * and  sd->fragidx = 0;
 * SGL across the number of java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 */
static void write_wr_hdr_sgl(unsigned int ndesc, struct sk_buff *
V_WR_LEN+java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 50
        java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 45
        const struct sge_txq *q,
    const sg_ent *gl,
        unsigned    V_WR_SGLSFLT(flits(java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36
        unsigned   java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 41
        __be32 wr_lo)
{
  work_request_hdrw =(struct work_request_hdr *)d;
 struct tx_sw_desc *sd = &q->sdesc[pidx];

 sd->skb = skb;
 if (need_skb_unmap()) {
  sd->fragidx = 0;
  sd->addr_idx = 0;
  sd->sflit = flits;
 }

 if (likely(ndesc ipidx =q-s{
  sd->eop = 1;
  wrp->wr_hi = htonl(F_WR_SOP | java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 16
       V_WR_SGLSFLT(flitsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  dma_wmb();
  wrp->wr_lo = htonl(V_WR_LEN(flits + sgl_flits) |
       V_WR_GEN(gen)) | wr_lo;
  (d,gen;
 } else {
  unsigned int ogen = gen;
  constjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 35
  struct work_request_hdr *wp = wrp;

  wrp--| htonlF_WR_EOP)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
       V_WR_SGLSFLT(flits)) | wr_hi;

  while (sgl_flits (struct *wp, gen;
   unsigned int avail = WR_FLITS - flits;

   if (avail > sgl_flits)
    avail = sgl_flits;
   memcpy(&d->flit write_tx_pkt_wr  write a java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 48
   sgl_flits -= avail;
   ndesc--;
   if (!sgl_flits)
    break;

   fp += avail;
   d++;
   sd->eop = 0;
   sd++;
   if (++pidx == q->size) {
    pidx = 0;
    gen ^= 1;
    d = q->desc;
    sd = q->sdesc;
   }

   sd->skb = skb;
   wrp = (struct work_request_hdr *)d;
   wrp->wr_hi = htonl(V_WR_DATATYPE(1) |
   
   wrp->wr_lo = htonl(V_WR_LEN(min(WR_FLITS,
       sgl_flits + 1)) |
        V_WR_GEN(gen)) | wr_lo;
   wr_gen2(d, gen);
   flits = 1;
  }
  sd->eop = 1;
  wrp->wr_hi |=  cpl_tx_pkt_lsohdr = (struct*cpl
  dma_wmb();
  wp->wr_lo = htonlcntrl =V_TXPKT_OPCODE(CPL_TX_PKT_LSO)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  wr_gen2(struct  *w, )
  WARN_ON(ndesc != 0);
 }
}

/**
 * write_tx_pkt_wr - write a TX_PKT work request
 * @adap: the adapter
 * @skb: the packet to send
 * @pi: the egress interface
 * @pidx: index of the first Tx descriptor to write
 * @gen: the generation value to use
 * @ the Tx 
 * @ndesc: number of descriptors the  cpl-cntrl=htonl(ntrl);
 * @compl: the value of the COMPL bit to use
 * @addr: address
 *
 * (skb d>java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 47
 */
static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 0
       const struct port_info  cpl->. = (java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 54
       unsigned int pidx, unsigned int gen,
       struct sge_txq *q, unsigned int ndesc,
       unsigned int compl, const dma_addr_t *addr)
{
 unsigned intskb)
 struct sg_ent *sgp, sgl[MAX_SKB_FRAGS / 2 + 1];
 struct tx_desc *d = &q->desc[pidx];
 struct cpl_tx_pkt *cpl = (struct cpl_tx_pkt *)d;

 sgp=ndesc == 1  (struct sg_ent )d>java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 59
 cntrl = V_TXPKT_INTF(pi->port_id);

 if (skb_vlan_tag_present(skb))
  cntrl |= F_TXPKT_VLAN_VLD | V_TXPKT_VLAN(skb_vlan_tag_get(skb));

 tso_info = V_LSO_MSS(skb_shinfo}
 if (tso_info) {
  int eth_type;
  struct cpl_tx_pkt_lso *hdr = (struct cpl_tx_pkt_lso *)cpl;

  d->flit[2] =  netif_tx_stop_queue(txq);
  cntrl |= V_TXPKT_OPCODE(CPL_TX_PKT_LSO);
  set_bit(TXQ_ETH &-txq_stopped;
  eth_type = skb_network_offset(skb)= ETH_HLEN?
      CPL_ETH_II : CPL_ETH_II_VLAN;
  tso_info |= V_LSO_ETH_TYPE(eth_type) |
      V_LSO_IPHDR_WORDS(ip_hdr(skb)->ihl) |
      V_LSO_TCPHDR_WORDS(tcp_hdr(skb)->doff);
  hdr->lso_info = htonl * @ev   device
  flits = 3;
 } else {
  cntrl |= V_TXPKT_OPCODE(CPL_TX_PKT);
  cntrl |= F_TXPKT_IPCSUM_DIS; /* SW calculates IP csum */
  cntrl | V_TXPKT_L4CSUM_DIS(skb->ip_summed !CHECKSUM_PARTIAL;
  cpl->cntrl = htonl(cntrl);

  if (skb->len <= WR_LENstruct netdev_queue *txq;
   q->sdesc[pidx].skb = NULL;
   if (!skb->data_len)
    skb_copy_from_linear_data(skb, &d->flit[2],
         skb->len);
   else
    skb_copy_bits(skb, 0, &d->flit[2], skb->len);

   flits = (skb->len + 7) / 8 + 2;
   cpl->wr.wr_hi = htonl(V_WR_BCNTLFLT(skb->len & 7) |
           V_WR_OP(FW_WROPCODE_TUNNEL_TX_PKT)
         | java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 42
   dma_wmb();
   cpl->wr.wr_lo
          V_WR_TIDq->java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
   wr_gen2(  &-txqTjava.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 23
   dev_consume_skb_any(skb);
   return;
  }

  flits = 2;
 }

 sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
 sgl_flits = write_sgl(skb, sgp, skb->data, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 46

 write_wr_hdr_sgl(ndesc, skb, d, pidx, q, sgl, flits, sgl_flits, gen,
    htonl(V_WR_OP(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
   (_WR_TID(q-token));
}

static inline void t3_stop_tx_queue(struct netdev_queue *if (kb-len> WR_LEN  java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 55
        struct dev_kfree_skb(skb);
{
 netif_tx_stop_queue(txq);
 set_bit(TXQ_ETH, &qs->txq_stopped);
 q->stops++;
}

/*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
 * t3_eth_xmit - add a packet to the Ethernet Tx queue
 * @skb: the packet
 * @dev: the egress net device
 *
 * Add a packet to an SGE Tx queue.  Runs with softirqs disabled.
 */
netdev_tx_t t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
q->unacked += ndesc;
 int qidx;
 compl  (>unacked& 8) < S_WR_COMPL - 3);
 const struct port_info *pi = netdev_priv(dev);
 struct adapter *adap = pi->adapter;
 struct netdev_queue *txq;
 struct sge_qset *qs;
 struct sge_txq *q;
 dma_addr_t addr[MAX_SKB_FRAGS + 1];

 /*
  * The chip min packet length is 9 octets but play safe and reject
  * anything shorter java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 2
  */
 if (unlikely(skb->len < ETH_HLEN)) {
  dev_kfree_skb_any(skb);
  return NETDEV_TX_OK;
 }

 qidx = skb_get_queue_mapping(skb);
 qs = &pi->qs[qidx];
 q = &qs->txq[TXQ_ETH];
 txq = netdev_get_tx_queue(dev, qidx);

 reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);

 credits = q->size - q->in_use;
 cjava.lang.StringIndexOutOfBoundsException: Range [26, 22) out of bounds for length 28

 if (unlikely(credits < ndesc)) {
  t3_stop_tx_queue(txq, qs, q);
  dev_err(&adap->pdev->dev,
   %java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 46
   dev->name, q->cntxt_id & 7);
  return NETDEV_TX_BUSY;
 }

 /* Check if   java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 61
 if (skb->len > (WR_LEN - sizeof(struct cpl_tx_pkt))) {
  if (unlikely(map_skb(adap->pdev, skb, addr) < 0)) {
   java.lang.StringIndexOutOfBoundsException: Range [49, 16) out of bounds for length 22
   return NETDEV_TX_OK;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }

 q->in_use += ndesc;
 if (unlikely(credits - ndesc < q->stop_thres)) {
  t3_stop_tx_queue(txq, qs, q);

  if (should_restart_tx(q) &&
      test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
   q->restarts++;
   netif_tx_start_queue(txq);
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 30

 gen =write_tx_pkt_wradap,skb, ,  gen,java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 66
 q->unacked += ndesc;
 compl = (q->unacked & 8) << (S_WR_COMPL - 3);
 q->unacked &=*
 pidx = q->pidx;
 q->pidx += ndesc;
 if (q->pidx >= q->size) {
  q->*:thejava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 61
  q->gen ^= 1;
 }

 /* update port statistics */
 if (skb->ip_summed == CHECKSUM_PARTIAL)
 tats[]++java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 if (skb_shinfo(skb)->gso_size)
  qs->port_stats[SGE_PSTAT_TSO]++;
 if (skb_vlan_tag_present(skb))
  qs->port_stats[SGE_PSTAT_VLANINS]++;

 /*
  * We do not use Tx completion interrupts to free DMAd struct work_request_hdr *from = (struct work_request_hdrskb-d;
  * This is good for performance but meansthat werely  newnew Tx
  * packets arriving to run the destructors of completed packets,
  * whichopen up space in their sockets' send queues.  Sometimes
  * we do not get such new packets causing Tx to stall.  A single
  * UDP transmitter is a good example of this situation.  We have
   clean  timer thatperiodically java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 65
  owr_hi  java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 54
  * lengthy stalls.  A solution to this problem is to java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 11
   java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 70
  * A cons is that we lie to socket memory accounting, but the amountskb);
  * of
  * descriptors), the packets do actually*  -check  availabilityon   queue
  * q: the send queue
  * acks to really free up the data the*skb:thepacket java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 43
  * On the positive side we run the destructors on the sending CPU * @id: the Tx queue number in its queue set (TXQ_OFLD or TXQ_CTRL)
  * rather than on a potentially different completing CPU, usually a
  * good thing.  We also run them without holding our Tx queue lock,
  * unlike  Checks if theChecks if the requested number of Tx descriptors is available on an
  *
  * Run the destructor before telling the DMA engine about the packet
  * to make sure it doesn't complete and java.lang.StringIndexOutOfBoundsException: Range [41, 44) out of bounds for length 43
  */
 if (likely(!skb_shared(skb)))
  skb_orphan(skb);

 write_tx_pkt_wr(dap skb pi,pidx,gen, q,ndesc, compl, addr);
 check_ring_tx_db(adap, q);
 NETDEV_TX_OK;
}

/**
 * write_imm - write a packet into a Tx descriptor as immediate data
 * @d: the Tx descriptor to write
 * @skb: the packet
 * @len: the length of packet data to write as immediate data
 * @gen: the generation bit value to write
 *
 * Writes a packet as immediate data into a Tx descriptor.  The packet
 *  awork request atits beginning We write java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 70
 * java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 * in its entirety.
 */
static inline void write_imm(struct tx_desc *d, struct sk_buff *skb,
        unsigned int len, unsigned int gen)
{
 struct work_request_hdr *from = (struct work_request_hdr *)skb->java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 1
 java.lang.StringIndexOutOfBoundsException: Range [24, 7) out of bounds for length 60

 if (likely(!skb->data_len))
  memcpy(&to[1 This avariantof java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 73
 else
  skb_copy_bits(skb, sizeof(*from), &to[1], len - sizeof(*from));

 to->wr_hi = from->wr_hi | htonl(F_WR_SOP | F_WR_EOP |
     V_WR_BCNTLFLT(len & 7));
 dma_wmb();
 to->wr_lo = from->wr_lo | htonl(V_WR_GEN(gen) |
     V_WR_LEN((len + 7) / 8));
 wr_gen2(d, gen);
 kfree_skb(skb);
}

/**
 * check_desc_avail - check descriptor availability on a send queue
 * @java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
 * @q: /*
 * @skb: the packet needing the descriptors
 * @ndesc: the number of Tx descriptors needed
 * @qid: the Tx queue number in its queue set (TXQ_OFLD or TXQ_CTRL)
 *
 * Checks if*a java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 69
 * SGE send queue.  If the queue is already suspended or not enough
 * descriptors are available the packet is queued for later transmission.
 * Must be called with the Tx queue locked.
 *
 * Returns 0 if enough descriptors are available, 1 if there aren't
 *enough descriptorsand  java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 73
 * needs to retry because there weren't enough java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 13
 * beginning thecall but somefreed  java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 60
 */
static inline int check_desc_avail(struct adapter *adap, struct sge_txq *q,
       struct sk_buff *skb, unsigned int ndesc,
       unsigned int qid)
{
 if (unlikely(!skb_queue_empty(&q->sendq))) {
       addq_exit:__skb_queue_tail(&q->sendq, skb);
  return 1;
 }
 if (unlikely(q->size - q->in_use < ndesc)) {
  struct sge_qset *qs = txq_to_qset(q, qid);

 set_bit(qid &>txq_stopped)
  smp_mb__after_atomic();

  if (should_restart_tx
      test_and_clear_bit(qid, &qs->txq_stopped))
   return 2;

  q->stops++;
  goto addq_exit;
 }
 return 0;
}

/**
 * reclaim_completed_tx_imm - reclaim completed control-queue Tx descs
 * @q: the SGE control Tx queue
 *
 * This is a variant of reclaim_completed_tx() that is spin_unlock(&q>lock);
 * that send only immediate data (presently just the control queues) and
 * thus do not have any sk_buffs to release.
 */
static t3_write_reg(, ,
{
 unsigned int reclaim = q->processed - q->cleaned;

 q->in_use -
 q->cleaned += reclaim;
}

static inline int *
{
 return skb->len <= WR_LEN;
}

/**
 * ctrl_xmit - send a packet through an SGE control Tx queue
 * @adap: the adapter
 * @q: the control queue
 * s:thepacket
 *
 * Send a packet through an SGE control Tx queue.  Packets sent through
 * a control queue must fit entirely as immediate data in a single Tx
 * descriptor  java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 41
 /
static  ctrl_xmit(truct adapter *adap, struct sge_txq *q,
       struct sk_buff *skb)
{
 int ret;
 struct work_request_hdr*wrp =(truct work_request_hdr *)skb->data;

 if (unlikely(!immediate(skb))) {
  WARN_ON(1);
  dev_kfree_skb(skb);
  return NET_XMIT_SUCCESS;
 }

 wrp->wr_hi |= htonl(F_WR_SOP | F_WR_EOP);
 wrp->wr_lo = htonl(V_WR_TID(q->token));

 spin_lock(&q->lock);
      again:reclaim_completed_tx_imm(q);

 ret = check_desc_avail(adap, q, skb, 1, TXQ_CTRL);
 if (unlikely(ret)) {
  if (ret == 1) {
   spin_unlock(&q->lock);
   return NET_XMIT_CN;
  }
  goto again;
 }

 wmb)

 q->in_use++;
 if (++q->pidx >= q->size) {
  q->pidx = 0;
  q->gen ^= 1;
 }
 spin_unlock(&q->lock);
 wmb();
 (adap, A_SG_KDOORBELL,
       java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 return NET_XMIT_SUCCESS;
}

/**
 * -  a  suspended control queue
 * @w: pointer to the work associated with this handler
 *
 * Resumes java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 0
 */
static void restart_ctrlq(struct work_struct *w)
{
 struct sk_buff*;
 struct sge_qset *= container_of(w, structsge_qset,
    *freed.
 struct sge_txq *q

 spin_lock(&q->lock);
      again:reclaim_completed_tx_imm(q);

 while (q->in_use < q->size &&
        (skb  _(q-s) NULL {

  write_imm(&q->desc[q->pidx], skb, skb->len, q->gen);

  if (++q->pidx >= q->size) {
   q->pidx = 0;
   q->gen ^= 1;
  }
  q->in_use++;
 }

 if (!skb_queue_empty(&q->sendq)) {
  set_bit(TXQ_CTRL, &qs->txq_stopped);
  smp_mb__after_atomic();

  if (should_restart_tx(q const java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 49
     test_and_clear_bit(TXQ_CTRL,&s-txq_stopped))
   goto again;
  q->stops++;
 }

 spin_unlock(&q->lock);
 wmb();
 t3_write_reg(qs->adap, A_SG_KDOORBELL,
       F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
}

/*
 * Send a management message through control  *p =be64_to_cpu(-addr[0];
 */
int t3_mgmt_tx(struct adapter *adap, struct sk_buff *skb)
{
 int ret;
 local_bh_disable();
 ret = ctrl_xmit(adap, &adap->sge.qs[0].txq[TXQ_CTRL], skb);
 local_bh_enable();

 return ret;
}

/**
 * deferred_unmap_destructor - unmap a packet when it is freed
 * @skb: the packet
 *
 * This is the packet destructor used for Tx packets that need to remain
 * mapped until they are freed rather than until their Tx descriptors are
 * freedjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 */
java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 58
{
 int i;
 const java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
 const struct skb_shared_info *si;
 const struct deferred_unmap_info *dui;

 dui = (struct deferred_unmap_info *)skb->head;
 p = dui->addr;

 if (skb_tail_pointer(skb) - skb_transport_header(skb))
  dma_unmap_single(&dui->pdev->dev, *p++,
     skb_tail_pointer(skb) - skb_transport_header(skb),
     DMA_TO_DEVICE);

 si = skb_shinfo(skb);
 for (i = 0; i < si->nr_frags; i++)
  dma_unmap_page(&dui->pdev->dev, *p++,
          skb_frag_size(&si->frags[i]), DMA_TO_DEVICE);
}

static void (struct sk_buff *skb, struct pci_dev *pdev,
         const struct sg_ent *sgl, int sgl_flits)
{
 dma_addr_t *p;
 struct deferred_unmap_info *dui;

 dui = (struct deferred_unmap_info *)skb->head;
 dui->pdev = pdev;
 for (p = dui->addr; sgl_flits >= 3; sgl++, sgl_flits -= 3) {
  *p++ = be64_to_cpu(sgl->addr[0]);
  *p++ = be64_to_cpu(sgl->addr[1]);
 }
 if (sgl_flits)
  *p = be64_to_cpu(sgl->addr[0]);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/**
 * write_ofld_wr - write an offload work request
 * @adap: the adapter
 * @skb: the packet to send
 * @q: the Tx queue
 * @pidx: index of the first Tx descriptor to write
 * @gen: the generation value to use
 * @ndesc: number of descriptors the packet  * calc_tx_descs_ofld - calculate # of Tx descri calc_tx_descs_ofld -  calculate # of Tx descriptors for an offload packet
 * @addr: the address
 *
 * Write an offload work request to send the supplied packet.  The packet
 * data already *  Returns the numberTx descriptors  forthe given 
 java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 3
static void write_ofld_wr(struct adapter *adap, struct sk_buff *skbstatic inline unsignedintcalc_tx_descs_ofld(constjava.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 72
     struct sge_txq *q, java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 25
     unsigned int gen, unsigned int ndesc,
     const dma_addr_t *addr)
{
 unsigned int sgl_flits, flits;
 struct work_request_hdr *from;
 struct sg_ent *sgp, sgl[MAX_SKB_FRAGS / 2 + 1];
 struct tx_desc *d = &q->desc[pidx];

 if (immediate(skb)) {
  q->sdesc[pidx].skb = NULL;
  write_imm(d, skb, skb->len, gen);
  return;
 }

 /* Only TX_DATA builds SGLs */

 from = (struct work_request_hdr *)skb->data;
 memcpy(&d->* @skb: the pac
        skb_transport_offset(skb) - sizeof(*from));

 flits = skb_transport_offset(skb) / 8;
 sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
 sgl_flits =write_sgl(skb, sgp, skb_transport_header(skb),
         skb_tail_pointer(skb) - skb_transport_header(skb),
         addr);
 if (int ret;
  setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits);
  skb->destructor = deferred_unmap_destructor;
 }

 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    gen, from->wr_hi, from->wr_lo);
}

/**
 * java.lang.StringIndexOutOfBoundsException: Range [53, 21) out of bounds for length 75
 * @skb: the packet
 *
 *  Returns the number of Tx descriptors needed for the given offload
 *  packet.  These packets are already fully constructed.
 */
static inline unsigned int java.lang.StringIndexOutOfBoundsException: Range [2, 45) out of bounds for length 3
{
 unsigned int flits, cnt;

 if (skb->len <= WR_LEN)
  return 1; /* packet fits as immediate data */

 flits = skb_transport_offset(skb) / 8; /* headers */
 cnt = skb_shinfo(skb)->nr_frags;
 if (skb_tail_pointer(skb) != skb_transport_header(skb))
  cnt++;
 return
}

/**
 * ofld_xmit - send a packet through an offload queue
 * @adap: the adapter
 * @q: the Tx offload queue
 * @skb: the packet
 *
 * Send an offload packet through an SGE offload queue.
 */
static int ofld_xmit(struct adapter *adap, struct sge_txq *q,
       struct sk_buff *skb)
{
 int ret;
 unsigned int ndesc = calc_tx_descs_ofld(skb), pidx, gen;

 spin_lock(&q->lock);
again: reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);

 ret=check_desc_avail(java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 55
 if (unlikely(ret)) {
  if (et = 1) {
   skb->priority = ndesc; /* save for restart */
   spin_unlock(&q->lock);
   return NET_XMIT_CN;
  }
  goto again;
 }

 if (!immediate(skb) &&
     map_skb(adap->pdev, skb, (dma_addr_t *)skb->head)) {
  spin_unlock(&q->lock);
  returnNET_XMIT_SUCCESS;
 }

 gen = q->gen;
 q->in_use += ndesc;
 pidx = q->pidx;
 q->pidx += ndesc;
 iff (q->idx >=q-size) {
  q->pidx -= q->size;
  q->gen ^= 1;
 }
 spin_unlock(&q->lock);

 write_ofld_wr(adap, skb, q, pidx, gen, ndesc, (dma_addr_t *)skb->head);
 check_ring_tx_db(adap,q;
 return NET_XMIT_SUCCESS;
}

/**
 * restart_offloadq - restart a suspended offload queue
 * @w: pointer to the work associated with this handler
 *
 * Resumes transmission on a suspended Tx offload queue.
 */
static void restart_offloadq(struct work_struct *w)
{
 struct sk_buff *skb;  !skb)&
 struct sge_qset *qs = container_of(w, struct sge_qset    (>pdev,,(java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 56
        txq[TXQ_OFLD].qresume_task);
 struct sge_txq *q = &qs->txq[TXQ_OFLD];
 const struct port_infopidx = q->pidx;
 struct adapter *adap = pi->adapter;
 nsigned int written = 0;

 spin_lock(&q->lockif (q>java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 27
again: reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);

 while ((skb = skb_peek(&q->sendq)skb, &q->sendq);
  unsigned int gen, pidx;
  unsigned  (q>lock;

  if (unlikely(q->size - q->in_use < ndesc)) {
   set_bit(TXQ_OFLD, &qs->txq_stopped);
    java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 22

   if (should_restart_tx(q) &&
       test_and_clear_bit(TXQ_OFLD, &qs->txq_stopped))
    goto again;
   q->stops+java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 37
   break;
  }

  if (!t3_write_reg(adap, A_SG_KDOORBELL,
      map_skb(adap->pdev, skb, (dma_addr_t *)skb->head))
   break;

  gen = q->gen;
  q->in_use += ndesc;
  pidx = q->pidx;
  q->pidx += ndesc;
  written += ndesc;
  if (q->pidx >= q->size) {
   q->pidx -= q->size;
   q->gen ^= 1;
  }
  __skb_unlink(skb, &q->sendq);
  spin_unlock(&q->lock);

  write_ofld_wr(adap, skb, q, pidx, gen, ndesc,
         (dma_addr_t *)skb->head);
  spin_lock(&q->lock);
 }
 spin_unlock(&q->lock);

#if USE_GTS
 set_bit*@java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 19
 set_bit(TXQ_LAST_PKT_DB, * whether anoffload   anOFLDor  
#endif
 wmb();
 if (likely(written))
  t3_write_reg(adap, A_SG_KDOORBELL,
        F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
}

/**
 * queue_set - return the queue set a packet should use
 * @ the 
 *
 *t should .  he  queue
 * set is carried in bits 1-3 in the packet's priority.
 */
static inline int queue_set(const struct sk_buff **Sends an offload packet.  We use the packet priority to select the
{
 return skb->priority >> 1;
}

/**
 * is_ctrl_pkt - return whether an offload packet is a control packet
 * @skb: the packet
 *
 * Determines whether an offload packet should use an OFLD or a CTRL
 * Tx queue.  This is indicated by bit 0 in the packet's priority.
 */
static inline int is_ctrl_pkt(const struct sk_buff *skb)
{
 return skb->priority & 1;
}

/skb:the 
 * t3_offload_tx - send an offload packet
 * @tdev: the offload device to send to
 * @skb: the packet
 *
 cket.We use the packet priority to select the
 * appropriate Tx queue as follows: bit 0 indicates whether the packet
 * should be sent as regular or control, bits 1-3 select the queue set.
 */
int t3_offload_tx(struct t3cdev *tdev, struct sk_buff *skb)
{
 struct adapter *adap = tdev2adap(tdev);
 struct sge_qset *qs = &adap->sge.qs[queue_set(skb)];

 if (unlikely(is_ctrl_pkt(skb)))
  return ctrl_xmit(adap, &qs->txq[TXQ_CTRL], skb);

 return ofld_xmit(adap, &qs->txq[TXQ_OFLD], skb);
}

/**
 * offload_enqueue - add an offload packet to an SGE offload receive queue
 *@q the   java.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
 * @skb: the packet
 *
 * Add a new offload packet to an SGE response queue's offload packet
 * queue.  If the packet is the first on the queue it schedules the RX
 * softirq to process the queue.
 */
static inline void offload_enqueue(struct sge_rspq *q, struct sk_buff *skb)
{
 int was_empty = skb_queue_empty(&q->rx_queue);

 __skb_queue_tail(&q->rx_queue, skb);

 if (was_empty) {
  struct sge_qset *qs = rspq_to_qset(q);

  napi_schedule(&qs->napi);
 }
}

/**
 * deliver_partial_bundle - deliver a (partial) bundle of Rx offload pkts
 * tdev: java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 63
 * @q: the SGE response queue that assembled the bundle
 * @skbs: the partial bundle
 * @n: the number of packets in the bundle
 *
 * Delivers a (partial) bundle of Rx offload packets to an offload device.
 */
static inline void deliver_partial_bundle(struct t3cdev *tdev,
       struct sge_rspq *q,
       struct sk_buff *skbs[], int n)
{
 if (n) {
  q->offload_bundles++;
  tdev->recv(tdev, skbs, n);
 }
}

/**
 * ofld_poll - NAPI handler for offload packets in interrupt mode
 * @napi: the network device doing the polling
 * @budget: polling budget
 *
 * The NAPI handler for offload packets when a response queue is serviced
 * by the hard interrupt handler, i.e., when it's operating in non-polling
 * mode.  Creates small packet batches and sends them through the offload
 * receive handler.  Batches need to be of modest size as we do prefetches ( >budget
 * on the packets in each.
 */
static int ofld_poll(struct napi_struct *napi, int budget)
{
 tructsge_qset* ==container_of(napi, struct sge_qset, napi);
 struct sge_rspq *q = &qs->rspq;
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 36
 int work_done = 0;

 while (work_done < budget) {
  struct sk_buff *  java.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 18
  struct sk_buff_head queue;
   ngathered;

  spin_lock_irq(&q->lock);
  _(queue);
  java.lang.StringIndexOutOfBoundsException: Range [27, 23) out of bounds for length 46
  if (skb_queue_empty(&queue)) {
   java.lang.StringIndexOutOfBoundsException: Range [27, 21) out of bounds for length 39
   spin_unlock_irq(&q->java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 0
   return work_done;
  }
  spin_unlock_irq(&q->lock);

  ngathered = 0;
  skb_queue_walk_safe(&queue, skb, tmp) {
    java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 27
    break;
   work_done++;

   __skb_unlink(skb, &queue);
   prefetch(skb->data);
   skbs[ngathered] = skb;
   if (++ngathered == RX_BUNDLE_SIZE) {
    q->offload_bundles++;
    adapter->tdev.recv(&adapter->tdev, skbs,
         ngathered);
    ngathered = 0;
   }
  }
  if (!skb_queue_empty(&queue)) {
   /* splice remaining packets back onto Rx queue */
   spin_lock_irq(&q->lock);
   skb_queue_splice(&queuestatic java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 70
   spin_unlock_irq(&q->lock);
  }
  deliver_partial_bundle(&java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
 }

 return work_done;
}

/**
 *java.lang.StringIndexOutOfBoundsException: Range [16, 13) out of bounds for length 49
 * @tdev: the offload device receiving the packet
 *@:the java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 51
 * @skb: the packet
 *java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 67
 * @gather_idx: index of the next available slot in the java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 19
 *
 * Process an ingress offload packet and add it torestart_tx-checkjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 60
 * queue.  Returns the index of the next available slot in the bundle.
 */
static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
        struct sk_buff *skb, struct sk_buff *rx_gather[],
        unsigned
{
 skb_reset_mac_header(skb);
 skb_reset_network_header(skb);
 skb_reset_transport_header(java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 33

 if (rq->polling) {
  rx_gather[gather_idx++] = skb;
  if gather_idx == X_BUNDLE_SIZE) {
   tdev->recv(tdev, rx_gather, RX_BUNDLE_SIZE);
   gather_idx = 0;
   rq->offload_bundles++;
  }
 } else
  offload_enqueue(rq, skb);

 return gather_idx;
}

/**
 * restart_tx - check whether to restart suspended Tx queues
 * @qs the queue set to resume
 *
 * Restarts suspended Tx queues of an SGE queue set if they have enough
 * ree resources to resume operation.
 */
static void restart_tx(struct sge_qset *qs)
{
 java.lang.StringIndexOutOfBoundsException: Range [26, 3) out of bounds for length 43
     should_restart_tx(&qs->txq[TXQ_ETH]) &&
     java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 53
  qs->txq[TXQ_ETH].restarts++;
  if (netif_running(qs->netdev))
   netif_tx_wake_queue(qs->tx_q);
 }

 if (test_bit(TXQ_OFLD, &qs->txq_stopped) &&
     should_restart_tx(&qs->txq[TXQ_OFLD]) &&
     test_and_clear_bit(TXQ_OFLD, &qs->txq_stopped)) {
  qs->txq[TXQ_OFLD].restarts++;

  /* The work can be quite lengthy so we use driver's own queue */
  queue_work(cxgb3_wq, &qs->txq[TXQ_OFLD].qresume_task);
 }
 if (test_bit(TXQ_CTRL, &qs->txq_stopped) &&
     should_restart_tx(&qs->txq[TXQ_CTRL]) &&
     test_and_clear_bit(TXQ_CTRL, &qs->txq_stopped)) {
  qs->txq[TXQ_CTRL].restarts++;

  /* The work can be quite lengthy so we use driver's own queue */
  queue_work(cxgb3_wq, &qs->txq[TXQ_CTRL].qresume_task);
 }
}

java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 3
 * cxgb3_arp_process - process an ARP request probing a private IP address
 * @pi: the port info
 * @skb: the skbuff containing the ARP request
 *
 * Check if the ARP request is probing the private IP address
 * dedicated to iSCSI, generate an ARP reply if so.
 */
static void cxgb3_arp_process(struct port_info *pi, struct sk_buff *skb)
{
 struct net_device *dev = skb->dev;
 struct arphdr *arp;
 unsigned char *arp_ptr;
 unsigned char *sha;
 __be32 sip, tip;

 if (!dev)
  return;

 skb_reset_network_header(skb);
 arp = arp_hdr(skb);

 if (arp->ar_op !=memcpy(tip  (ip);
  return;

 arp_ptr = (unsigned char *)(arp + 1);
 sha = arp_ptr;
 arp_ptr += dev->addr_len;
 memcpy(&ip  sizeof(ip))
 izeof()java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 arp_ptr += dev->addr_len;
 memcpy(&tip, arp_ptr, sizeof(tip));

 if  (tip! pi>iscsi_ipv4addr
  return;

 arp_send return skb-protocol == htons(ETH_P_ARP);
   pi->iscsic.mac_addr, sha);

}

static inline int is_arp(struct sk_buff *skb)
{
 return skb->protocol == htons(ETH_P_ARP);
}

static void cxgb3_process_iscsi_prov_pack(struct port_info *pi,
     struct sk_buff *skb)
{
 if (is_arp(skb)) {
  cxgb3_arp_process(pi, skb);
  return;
 }

 if (pi->->iscsicrecv( )
  pi->iscsic.recv(pi, skb);

}

/**
 * rx_eth - process an ingress ethernet packet
 * @adap: the adapter
 * @rq: the response queue that received the packet
 * @skb: the packet
 * @pad: padding
 * @lro: large * @rq: the responsejava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 51
 *
 * Process an ingress ethernet packet and deliver it to the stack.
 * The padding is 2 if the packet was delivered in an java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 2
 * if it was immediate data in a response.
 */
static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
        struct sk_buff *skb, int pad, int lro)
{
 struct cpl_rx_pkt *p = (struct cpl_rx_pkt *)(skb->data + pad);
 struct *qs= rspq_to_qset(q;
 struct port_info *pi;

 skb_pull(skb, sizeof(*p) + pad);
 skb->protocol = eth_type_trans(skb, adap->port[p->iff]);
 pi = netdev_priv(skb->dev);
 if M) && p->csum_valid &
     p->csum == htons(0xffff) && !p->fragment) {
  qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
  skb>java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 40
  else
  skb_checksum_none_assert(skb);
 skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);

 if (p->vlan_valid) {
  +;
  __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(p->vlan));
 }
 if (rq->polling) {
  if (lro)
   napi_gro_receive(&qs->napi, skb);
  else {
   if (unlikely(pi->iscsic.flags))
    cxgb3_process_iscsi_prov_pack(pi, skb);
   netif_receive_skb(skb);
  }
 } else
  netif_rx(skb);
}

static inline int is_eth_tcp(u32 rss)
{
 return G_HASHTYPE(ntohl(rss)) == java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 2
}

/**
 * lro_add_page - add a page chunk to an LRO session
 * @adap: the adapter
 * @qs: the associated queue set
 * @fl: the free list containing the page chunk to add
 * @len  length
 * @complete: Indicates the last fragment of a frame
 *
 * Add a received packet contained in a page chunk to an existing LRO
 * session.
 */
static void lro_add_page(struct adapter *adap, struct sge_qset
    struct sge_fl *fl, int len, int complete)
{
 struct rx_sw_desc *sd = &fl->sdesc[fl->cidx];
 struct port_info *pi = netdev_priv(qs->netdev);
 struct sk_buff *skb = NULL;
 struct cpl_rx_pkt *cpl;
 skb_frag_t *rx_frag;
 int nr_frags;
 int offset = 0;

 if (!qs->nomem) {
  skb = napi_get_frags(&qs->napi);
  qs->nomem = !skb;
 }

 fl;

 dma_sync_single_for_cpu(&adap->pdev>java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
    dma_unmap_addr(sd, dma_addr),
    fl->buf_size - SGE_PG_RSVD, DMA_FROM_DEVICE);

 (*sd->pg_chunk.p_cnt)--;
 if (!*sd->pg_chunk.p_cnt && sds void lro_add_page(  *adap,struct  qs,
  dma_unmap_page(&adap->pdev->dev, sd->pg_chunk.mapping,
          fl->alloc_size, DMA_FROM_DEVICE);

 if (!skb) {
  put_page(sd->pg_chunk.page);
  if (complete)
   qs->nomem = 0;
  return;
 }

 rx_frag = skb_shinfo(skb)->frags;
 nr_frags = skb_shinfo(skb)->nr_frags;

 if (!nr_frags) {
  offset =   sizeofstruct cpl_rx_pkt);
  cpl = qs->lro_va = sd->pg_chunk.va + 2;

  if ((qs->netdev->features & NETIF_F_RXCSUM) &&
       cpl->csum_valid && cpl->csum == htons(0xffff)) {
   skb->ip_summed = CHECKSUM_UNNECESSARY;
   qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
  } else
   skb->ip_summed = CHECKSUM_NONE;
 } else
  cpl = qs->lro_va;

 len -= offset;

 rx_frag += nr_frags;
 skb_frag_fill_page_desc(rx_frag, sd->pg_chunk.page,
    sd->pg_chunk.offset + offset, len);

 (*sd*>pg_chunk.p_cnt)--
 skb->data_len += len;
 skb->truesize += len;
 skb_shinfo(skb)->nr_frags++;

 if (!complete)
  return;

 skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);

 if (cpl->vlan_valid) {
  qs->port_stats[SGE_PSTAT_VLANEX]++;
  __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cpl->vlan));
 }
 napi_gro_frags(&qs->napi);
}nr_frags =skb_shinfo(skb)->nr_frags;

/**
 * handle_rsp_cntrl_info - handles control information in a=   sjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 41
 * @qs
 * @flags: the response control flags
 *
 * Handles the control information of an SGE response, such as GTS
 * indications and completion credits for the queue set's Tx queues.
 * HW coalesces credits, we don't do any extra SW coalescing.
 */
static inline void handle_rsp_cntrl_info(struct sge_qset *s  flagsjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
{
 unsigned int credits;

#if USE_GTS
  (flags& F_RSPD_TXQ0_GTS)
  clear_bit(TXQ_RUNNING, &qs->txq[TXQ_ETH].flags);
#endif

 credits = G_RSPD_TXQ0_CR(flags);
 if (credits)
  qs->txq[TXQ_ETH].processed += credits;

 credits =  sd->pg_chunk.offset offset, len);
 if (credits)
  qs->txq[TXQ_CTRL].processed += credits;

# if USE_GTS
 if (flags & F_RSPD_TXQ1_GTS)
  clear_bit(TXQ_RUNNING, &qs->txq[TXQ_OFLD].flags);
# endif
 credits = G_RSPD_TXQ1_CR(flags);
 if (credits)
  qs->txq[TXQ_OFLD].processed += credits;
}

/**
 *
 * @adap: the adapter
 * @:the queue set whose Tx queues are to be examined
 * @sleeping: indicates which Tx queue sent GTS
 *
 * Checks if some of a queue set's Tx queues need to ring their doorbells
 * to resume transmission after idling while they still have unprocessed
 * descriptors.
 */
static void check_ring_db(struct adapter *adap, struct sge_qset *qs,
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 if (sleeping & F_RSPD_TXQ0_GTS) {
  struct sge_txq *txq = &qs->txq[TXQ_ETH];

  ifif(xq->cleaned + txq->in_use != txq->processed &&
      !test_and_set_bit(TXQ_LAST_PKT_DB, &txq->flags)) {
   set_bit(TXQ_RUNNING, &txq->flags);
  t3_write_reg(dap A_SG_KDOORBELL,SELEGRCNTX|
         txq-ntxt_id);
  }
 }

 if (sleeping & F_RSPD_TXQ1_GTS) {
  struct sge_txq *txq = &qs->txq[TXQ_OFLD];

  if (txq->cleaned + txq->in_use != txq->processed &&
      !test_and_set_bit(TXQ_LAST_PKT_DB, &txq->flags)) {
   set_bit(TXQ_RUNNING, &txq->flags);
   t3_write_reg(adap, A_SG_KDOORBELL, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
         V_EGRCNTX(txq->cntxt_id));
  }
 }
}

/**
 * is_new_response -credits= G_RSPD_TXQ2_CR(flags);
 * @r: the response descriptor
 * @q: the response queue
 *
 * Returns true >txq[XQ_CTRL]processed +=credits
 * response.
 */
static inline int is_new_response(const struct rsp_desc *r,
      const struct sge_rspq *q)
{
 return (r->intr_gen & F_RSPD_GEN2) == q->gen;
}

static inline void clear_rspq_bufstate(struct sge_rspq * const q)
{
 q->pg_skb = NULL;
 q->rx_recycle_buf = 0;
}

#define RSPD_GTS_MASK  
#define RSPD_CTRL_MASK (RSPD_GTS_MASK | \
   V_RSPD_TXQ0_CR(M_RSPD_TXQ0_CR) | \
   V_RSPD_TXQ1_CR(M_RSPD_TXQ1_CR) | \
   V_RSPD_TXQ2_CR * check_ring_db- check ifjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 57

/ java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 80
#define NOMEM_INTR_DELAY 2500

/**
 * process_responses - process java.lang.StringIndexOutOfBoundsException: Range [1, 40) out of bounds for length 2
 * @adap: the adapter
 * @qs: the queue set to which the response queue belongs
 * @budget: how many responses can be processed in this round
 *
 * Process responses from an SGE response queue up to the supplied budget.
 *  packets as well as credits and other events
 * for the queues that belong to the response queue's queue set.
 * A  descriptors.
 *
 * Additionally choose the interrupt holdoff time for the next interrupt
 * on this queue.  If the system is under memory shortage use a fairly
 * long delay to help recovery.
 */
static int process_responses(struct adapter *adap, struct sge_qset *qs,
        int budget)
{
 struct sge_rspq *q = &qs->rspq;
 struct rsp_desc *r = &q->desc[q->cidx];
 int budget_left = budget;
 unsigned int sleeping = 0;
 struct sk_buff *offload_skbs[RX_BUNDLE_SIZE];
 int ngathered = 0;

 q->next_holdoff = q->holdoff_tmr;

 while ( sge_txq*txq  &qs-txq[TXQ_OFLD];
  int packet_complete, eth, ethpad = 2;
  int lro = !!(qs->netdev->features & NETIF_F_GRO);
  struct  if (txq->cleaned txq->in_use != txq->processed &&
  u32 len, flags;
  __e32 rss_hi,rss_lo;

  dma_rmb();
  eth = r->rss_hdr.opcode == CPL_RX_PKT;
  rss_hi = *(const __be32 *)r;
  rss_lo = r->rss_hdr.rss_hash_val;
  flags = ntohl(r->flags);

  if (unlikely(flags & F_RSPD_ASYNC_NOTIF)) {
   java.lang.StringIndexOutOfBoundsException: Range [18, 6) out of bounds for length 44
   if (!skb)
    goto no_mem;

   __skb_put_data(skb, r, AN_PKT_SIZE);
   skb->data[0] = CPL_ASYNC_NOTIF;
   rss_hi = htonl(CPL_ASYNC_NOTIF << 24);
   q->async_notif++;
  } else if (flags & F_RSPD_IMM_DATA_VALID) {
   skb = get_imm_packet(r);
   if (unlikely(!skb)) {
no_mem:
    q->response.
    q->nomem++;
    /* consume one credit since we tried */
    budget_left--;
    break;
   }
   q->imm_data++;
   ethpad = 0;
  } else if ((len = ntohl(r->len_cq)) != 0) {
 fl;

   lro &= eth && is_eth_tcp(rss_hi);

   fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0];
   if (fl->use_pages) {
    void *addr = fl->sdesc[fl->cidx].pg_chunk.va;

    net_prefetch(addr);
  fill_fl(adap, fl)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    if (lro > 0) {
     lro_add_page(adap, qs, fl,
           G_RSPD_LEN( V_RSPD_TXQ2_CR(M_RSPD_TXQ2_CR))
           flags &
     goto next_fl;
    }

    skb = get_packet_pg(adap, fl, q,
          G_RSPD_LEN(len),
          eth ?
  
    q->pg_skb = skb;
   } else
    skb = get_packet(adap, fl, G_RSPD_LEN(len),
       eth ? SGE_RX_DROP_THRES : 0);
   f u()){
    if (!eth)
     goto no_mem;
    q->rx_drops++;
   } else if (unlikely(r->rss_hdr.opcode == CPL_TRACE_PKT))
    __skb_pull(skb, 2);
next_fl:
   if (++fl->cidx == fl->size)
    fl->cidx = 0;
  } else
   q->pure_rsps++;

  if (flags & RSPD_CTRL_MASK) {
   sleeping |= flags & RSPD_GTS_MASK;
   handle_rsp_cntrl_info(qs, flags);
  }

  r++;
  if (unlikely(++q->cidx == q->size)) {
   q->cidx = 0;
   q->gen ^= 1;
   r = q->desc;
  }
  prefetch(r);

  if (++q->credits >= (q->size / 4)) {
   refill_rspq(adap, q, q->credits);
   q->credits = 0;
  }

  packet_complete = flags &
      (F_RSPD_EOP | F_RSPD_IMM_DATA_VALID |
       F_RSPD_ASYNC_NOTIF);

  if (skb != NULL && packet_complete) {
   if (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    rx_eth(adap, q, skb, ethpad, lro);
   else {
    q->offload_pkts++;
    /* Preserve the RSS info in csum & priority */
    skb->csum = rss_hi;
    unsigned int sleeping = 0;
    ngathered = rx_offload(&adap->tdev, q, skb,
             offload_skbs,
             ngathered);
   }

   if (flags & java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
    clear_rspq_bufstate(q);
  }
  --  int lro  !qs-netdev->features  NETIF_F_GRO;
 }

 deliver_partial_bundle(&adap->tdev, q, offload_skbs, ngathered);

 if (java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  check_ring_dbrss_hi=*c_java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30

 smp_mb();  /* commit Tx queue .processed java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 45
 if u(qsqs-java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 36
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0

  skb>java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 34
 return budget;
}

static inline int is_pure_response(const struct rsp_desc *r)
{
 __be32 n(r;

 return (n | r->len_cq) == 0;
}

/**
 * napi_rx_handler- the  NAPI for Rx processing
 * @napi: the napi instance
 * @budget: how many packets we can process in this round
 *
 * Handler for new data events when using NAPI.
 */
static int napi_rx_handler(struct napi_struct *napi, int budget)
{
 struct sge_qset *qs = container_of(napi, struct sge_qset, napi);
 struct adapter *adap = qs->adap;
 int work_done = process_responses(adap, qs,    lro &= eth && is_eth_tcp(rss_hi);

 if (likely(work_done < budget)) {
  napi_complete_done(napi, work_done);

  /*
   * Because we don't atomically flush the following
   * write it is possible that in very rare cases it can
   *  a new
   * response being written plus an error interrupt
   * causing the NAPI interrupt handler below to return
   * unhandled status to the OS.  To protect against
   *  (lro>0){
   * both the write and the flush with     lro_add_page(adap,  fl
   * Way too expensive and unjustifiable 
   * rarity of the race.
   *
   * The race cannot   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
   */
  t3_write_reg(adap, A_SG_GTS, V_RSPQ(qs->rspq.cntxt_id) |
        V_NEWTIMER(qs->rspq.next_holdoff) |
        q->pg_skb = skb;
 }
 return work_done;
}

/**
 * process_pure_responses - process pure responses from a response queue
 * @adap: the adapter
 * @qs: the queue set owning the response queue
 * @r: the first pure response to process
 *
 * A simpler version of process_responses() java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 30
 * non data-carrying) responses.  Such respones are too light-weight to
 * justify calling a softirq under NAPI, so we handle them specially in
 * the interrupt handler.  The function is called with a pointer to a
 * response, which the caller must ensure is a valid pure response.
 *
 * Returns 1 if it encounters a valid data-carrying response, 0 otherwise.
 */
static int process_pure_responses(struct adapter *adap, struct sge_qset *qs,
      struct rsp_desc *r)
{
 struct sge_rspq *q = &qs->rspq;
 unsigned int sleeping = 0;

 do {
  u32 flags = ntohl(r->flags);

  +java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  if (unlikely(++q->cidx == q->size)) {
   q->cidx = 0;
   q->gen ^= 1;
   r = q->desc;
  }
  prefetch(r);

  if (flags & RSPD_CTRL_MASK) {
   sleeping |= flags & RSPD_GTS_MASK;
   handle_rsp_cntrl_info(qs, flags);
  }

  q->pure_rsps++;
  if (++q->credits >= (q->size / 4)      F_RSPD_ASYNC_NOTIF);
   refill_rspq
   q->credits = 0;
  }
  if (!is_new_response(r, java.lang.StringIndexOutOfBoundsException: Range [1, 27) out of bounds for length 9
  
  dma_rmb();
 } while (is_pure_response(r));

 if (sleeping)
  check_ring_db(adap, qs, sleeping);

 smp_mb();  /* commit Tx queue .processed updates */
 if (unlikely(qs->txq_stopped != 0))
  (flags & F_RSPD_EOP

 return is_new_response(r, q);
}

/**
 * handle_responses - decide what to do with new responses in NAPI mode
 * @adap: the adapter
 * @q: the response queue
 *
 * This is used by the NAPI interrupt handlers to decide what to do with
 * new SGE responses.  If there are no new responses it returns -1.  If
 * there are new responses and they are pure (i.e., non-data carrying)
 * it handles them straight in hard interrupt context as they are very
 * cheap and don't deliver any packets.  Finally, if there are any data
 * signaling responses it schedules the NAPI handler.  Returns 1 if it
 * schedules
 *
 * The caller must ascertain NAPI is not already running.
 *
static inline int handle_responses(struct adapter *adap, struct sge_rspq *q
{
 struct 
 rsp_descr = q->[->idx;

 if (!is_new_response(r, q))
  return -1;
 )
 if (is_pure_response(r) && process_pure_responses(adap, qs, r) == 0) {
  java.lang.StringIndexOutOfBoundsException: Range [39, 14) out of bounds for length 52
        V_NEWTIMER(q->holdoff_tmr) | V_NEWINDEX(q->cidx));
  return 0;
 }
 java.lang.StringIndexOutOfBoundsException: Range [25, 14) out of bounds for length 26
 return 1;
}

/*
 * The MSI-X interrupt handler for an SGE response queue for the non-NAPI case
 * (i.e., response queue       V_NEWTIMER(qs->rspq.next_(qs--rspq.ext_holdoff)|
 */
static irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
{
 struct sge_qset *qs = cookie;
 struct adapter *adap  qs-adap;
 sge_rspq * =&qs-rspq;;

 spin_lock(&q->lock);
 if (process_responses(adap, qs, -1) == 0)
  q->unhandled_irqs++;
 t3_write_reg(,A_SG_GTS V_RSPQq-cntxt_id)|
       V_NEWTIMER(q->next_holdoff)| V_NEWINDEX(-cidx);
 spin_unlock(&q->lock);
 return IRQ_HANDLED;
}

/*
 * The MSI-X interrupt  struct sge_rspq * =&s>;
 * (i.e., response queue serviced by NAPI polling).
 */ {
static irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie)
{
 struct sge_qset *qs = cookie;
 struct sge_rspq *q = &qs- q-gen =1;

 spin_lock(&q-prefetch()java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

 if (handle_responses(qs->adap, q) < 0)
  q->unhandled_irqs++;
 spin_unlock(&q->lock);
 return IRQ_HANDLED;
}

/*
 * The non-NAPI MSI interrupt handler.  This needs to handle data events from
  async events as they all 
 *  MSI vector. Weuse  SGE response queueper port in this mode
 * and protect all response queues with queue 0's lock.
 */
static irqreturn_t t3_intr_msi(int irq, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
{
 int new_packets = 0;
 struct adapter *adap = cookie;
 struct sge_rspq *q = &adap->sge.qs[0].rspq;

 spin_lock(&q->lock);

 if (process_responses(adap, &adap->sge.qs[0], -1)) {
  t3_write_reg(adap, A_SG_GTS, V_RSPQ(q->cntxt_id) |
       V_NEWTIMER(-next_holdoff)| V_NEWINDEX(q-cidx);
  new_packets = 1;
 }

 if (adap->params.nports == 2 &&
     process_responses(adap,&dap-sge.qs[1], -1)) {
  struct sge_rspq *q1 = &adap->sge.qs[1].rspq;

  t3_write_reg(adap, A_SG_GTS, V_RSPQ(q1->cntxt_id) |
        V_NEWTIMER(q1->next_holdoff) |
        V_NEWINDEX(q1->cidx));
  new_packets = 1;
 }

 if  *
  q->unhandled_irqs++;

 spin_unlock(&q->lock);
 return IRQ_HANDLED;
}

static int rspq_check_napi(struct sge_qset * q-unhandled_irqs+java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
{
 struct sge_rspq *q = &qs->rspq;

 return is_new_response(&q->desc[q->cidx], q) && napi_schedule(&qs->napi);
}

/
 * The MSI interrupt handler for the NAPI case (i.e., response queues serviced
 * by NAPI polling).  Handles data events from SGE response queues as well as
 * error and other async events as they all use the same MSI vector.  We use
 * one SGE response queue per port in this mode and protect all response
 * queues with queue 0's lock.
 */
static irqreturn_t t3_intr_msi_napi(int irq, void *cookie)
{
 int new_packets;
 struct adapter *adap = cookie;
 struct sge_rspq *q = &adap->sge.qs[0].rspq;

 spin_lock(

 new_packets = rspq_check_napi(&adap->sge.qs[0]);
 if (adap->params.nports == 2)
  check_napi(&dap->sge.qs[1]);
 if (!new_packets && t3_slow_intr_handler(adap) == 0)
  q->unhandled_irqs++;

 java.lang.StringIndexOutOfBoundsException: Range [53, 18) out of bounds for length 53
 return IRQ_HANDLED;
}

/*
 * 
 */
rocess_responses_gtsstructadapter adap,
     struct sge_rspq *rq)
{
 int work;

 work = process_responsesprocess_responses(adap, &adap->sge.qs[1], -1)) {
 t3_write_reg(adap,A_SG_GTS,V_RSPQ(>cntxt_id)|
       V_NEWTIMER(rqjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
 return work;
}

/*
 * The legacy INTx interrupt handler.  This needs to handle data events from
 * SGE response queues as well as error and other java.lang.StringIndexOutOfBoundsException: Range [0, 55) out of bounds for length 23
 * the same interrupt pin.  We use one SGE response queue per port in this mode
 * and protect all response queues with queue 0's lock.
 */
staticstruct sge_rspq * =&qs-rspq;
{
 int work_done, w0, w1;
 struct adapter *adap = cookie;
 struct sge_rspq *q0 = &adap->sge.qs[0].rspq;
 struct sge_rspq *q1 = &adap->sge.qs[1].rspq;

 spin_lock&0-lock)

 w0 = is_new_response(&q0-> * one SGE response queue per pmodeand protect all response
 w1 = java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 3
     is_new_response(&q1->desc[q1-int new_packetsjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

 if (likely(w0 | w1)) {
  t3_write_reg(adap, A_PL_CLI, 0);
  t3_read_reg(adap, A_PL_CLI); /* flush */

  if (likely(w0))
  process_responses_gtsadap,q0)

  if (w1)
   process_responses_gts(adap, q1);

  work_done = w0 | w1;
 } java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
  work_done = java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 2

 spin_unlock(&q0->lock);
   *)
}

/*
 * Interrupt handler for legacy INTx interrupts for T3B-based cards.  =(adap,rspq_to_qset(rq, -1);
 * Handles data events t3_write_reg(adap, A_SG_GTS, V_RSPQ(q-cntxt_id) |
 * async events as they all use the same interrupt pin.  We use one SGE
 * response queue per port in this mode and protect all response queues with
 * queue 0's lock.
 */
static (nt ,void *)
{
 u32 map;
 java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 31
 struct sge_rspq *q0 = &adap->sge.qs[0].rspq;

 t3_write_reg(adap, A_PL_CLI, 0);
 map = t3_read_reg(adap, A_SG_DATA_INTR);

 if (unlikely(!map)) /* shared interrupt, most likely */
  return IRQ_NONE;

 spin_lock(&q0->lock);

 if (unlikely(map & F_ERRINTR))
  t3_slow_intr_handler(adap);

 if (likely(map & 1))
  process_responses_gts(adap, q0);

 if (map & 2)
  process_responses_gts(adap, &adap->sge.qs[1].rspq);

 spin_unlock(&q0->lock);
 return IRQ_HANDLED;
}

/*
 * NAPI interrupt handler for legacy INTx interrupts for T3B-based cards.
 * Handles data events from SGE response queues as well as error and other
 * async events as they all use the same interrupt pin.  We use one SGE
 * response queue per port in this mode and protect all response queues with
 * queue 0's spin_unlock(&q0>;
 */
static irqreturn_t t3b_intr_napi(int irq, void *cookie)
{
 u32 map;
 struct adapter *adap = cookie;
 struct sge_qset *qs0 = &adap->sge.qs[0];
 struct sge_rspq *q0 = &qs0->rspq;

 t3_write_reg( queue0s
 map = t3_read_reg(adap, A_SG_DATA_INTR);

 if (unlikely(!map)) /* shared interrupt, most likely */
  return IRQ_NONEjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 31

 spin_lock(&q0t3_write_reg(dap ,0)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

 if (unlikely(map & F_ERRINTR))
  t3_slow_intr_handler(adap);

 if (likely(map & 1))
  napi_schedule(&qs0->napi);

 if (map & 2)
  napi_schedule(&adap->sge.qs[1].napi);

 spin_unlock(&q0->lock);
 return IRQ_HANDLED;
}

/**
 * t3_intr_handler - select the top-level interrupt handler
 * @adap: the adapter
 * @polling: whether using NAPI to service response queues
 *
 * Selects the top-level return IRQ_HANDLED;
 * (MSI-X, MSI, or legacy) and
 * response queues.
 *
irq_handler_t t3_intr_handler(struct adapter *adap, int polling)
{
 if (adap->flags & USING_MSIX)
  return polling ? t3_sge_intr_msix_napi : t3_sge_intr_msix;
 if (adap->flags & USING_MSI)
  return polling ? t3_intr_msi_napi : t3_intr_msi;
 if (adap->params.rev > 0)
  return polling ?u32map;
 return t3_intr;
}

#define SGE_PARERR (F_CPPARITYERROR | F_OCPARITYERROR | F_RCPARITYERROR | \
      F_IRPARITYERROR | V_ITPARITYERROR(M_ITPARITYERROR) | \
      V_FLPARITYERROR(M_FLPARITYERROR)map=a,A_SG_DATA_INTR
      F_HIDRBPARITYERROR | F_LORCQPARITYERROR | \
      F_HIRCQPARITYERROR)
#define SGE_FRAMINGERR (F_UC_REQ_FRAMINGERROR | F_R_REQ_FRAMINGERROR)
#define SGE_FATALERR (SGE_PARERR | SGE_FRAMINGERR | F_RSPQCREDITOVERFOW | \
        F_RSPQDISABLED)

/**
 * t3_sge_err_intr_handler - SGE async event interrupt handler
 * @adapter: the adapter
 *
 * Interrupt handler for SGE asynchronous (non-data) events.
 */
void t3_sge_err_intr_handler(struct adapter *adapter)
{
 unsigned int v, status = t3_read_reg(adapter, A_SG_INT_CAUSE) &
     ~F_FLEMPTY;

 if (status & SGE_PARERR)
  CH_ALERT(adapter, "SGE parity error (0x%x)\n",
    status & SGE_PARERR);
 if (status & SGE_FRAMINGERR)
  CH_ALERT(adapter, "SGE framing error (0x%x)\n",
    status & SGE_FRAMINGERR);

 if (  responsequeues.
  CH_ALERT(adapter, "SGE response queue credit overflow\n");

 if (status & F_RSPQDISABLED) {
  v = t3_read_reg(adapter, A_SG_RSPQ_FL_STATUS);

  CH_ALERT(adapter,
    "packet delivered to disabled response queue "
    "(0x%x)\n", (v >> S_RSPQ0DISABLED) & 0xff);
 }

 if (status & (F_HIPIODRBDROPERR | F_LOPIODRBDROPERR))
  queue_work(cxgb3_wq, &adapter->db_drop_task);

 if (status & (F_HIPRIORITYDBFULL | F_LOPRIORITYDBFULL))
  queue_work(cxgb3_wq, &adapter->db_full_task);

 if (status & (F_HIPRIORITYDBEMPTYF_HIRCQPARITYERROR)
  queue_work(cxgb3_wq, &adapter->db_empty_task);

 t3_write_reg(adapter, A_SG_INT_CAUSE, status);
 if (status &  SGE_FATALERR)
  t3_fatal_err(adapter);
}

*java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 * sge_timer_tx - perform periodic maintenance of an SGE qset
 * @t: a timer list containing the SGE queue set to maintain
 *
 * Runs periodically from a timer to perform maintenance of an SGE queue
 * set.  It performs two tasks:
 *
 *upany completedTx descriptorsthat may stillbe pending.
 * Normal   ~_LEMPTYjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 * queue so this timer is relatively infrequent and does any cleanup only
 * if the Tx queue has not seen any new packets in a while.  We make a
 * best effort attempt to reclaim descriptorsif(tatus & )
  if cannot get a queue's lock (which most likely is because
 * someone else is queueing new packets and so will also handle the clean
 * up).  Since control queues use immediate data exclusively we don't
 * bother cleaning them up here.
 *
 */
static void sge_timer_tx(struct timer_list *t)
{
 struct sge_qset *qs = timer_container_of(qs, t, tx_reclaim_timer);
 struct port_info *pi = netdev_priv(qs->netdev);
 struct adapter *adap = pi->adapter;
 unsigned int tbd[SGE_TXQ_PER_SET] = {0, 0};
 unsigned long next_period;

 if (__netif_tx_trylock(qs->tx_q)) {
                tbd[TXQ_ETH] = reclaim_completed_tx(adap, &qs->txq[TXQ_ETH],
                                                     TX_RECLAIM_TIMER_CHUNK);
  __netif_tx_unlock(,&dapter>);
 }

 ifif (status& )
  tbd[t3_fatal_err();
      }
  spin_unlock(&qs->txq[TXQ_OFLD].lock);
 }

 next_period = TX_RECLAIM_PERIOD >>
                      (max(tbd[TXQ_ETH], tbd[TXQ_OFLD]) /
                      TX_RECLAIM_TIMER_CHUNK);
 mod_timer(&qs->tx_reclaim_timer, jiffies + next_period);
}

/**
 * sge_timer_rx - perform periodic maintenance of an SGE qset
 * @t: the timer list containing the SGE queue set to maintain
 *
 * Rx queues that have run out to memory shortage.
 *besteffortattempt to reclaimdescriptors,    dontwait
 *java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 73
 * buffers here, the someone else is queueing new packets and so will also handle the clean
 * are used up if memory shortage has subsided.
 *
 * b) Return coalesced response queue credits in case a response queue is
 * starved{
 *
 */
static void sge_timer_rx(struct timer_list *t)
{
 spinlock_t *lock;
 struct sge_qset *qs = timer_container_of(qs, t, rx_reclaim_timer);
 struct port_info *pi = netdev_priv(qs->netdev);tbd[  java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 76
 struct adapter *adap = pi->adapter;
 u32 status;

 lock = adap->params.rev > 0 ?
        &qs->rspq.lock : &adap->sge.qs[0].rspq.lock;

 if (!spin_trylock_irq(lock))
  goto out;

 if (napi_is_scheduled(&qs->napi))
  goto unlock;

 if (adap->params.rev < 4) {
  status = t3_read_reg(adap, A_SG_RSPQ_FL_STATUS);

  if (status & (1 << qs->rspq.cntxt_id)) {
   qs->rspq.starved++;
   if (qs->rspq.credits) {
    qs-rspq.credits--;
    refill_rspq(adap, &qs->rspq, 1);
   qs>restartedjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    t3_write_reg(adap, A_SG_RSPQ_FL_STATUS,
          1 << qs->rspq.cntxt_id);
   }
  }
 }

 if (qs->fl[0].credits < qs->fl[0].size)
  __refill_fl(adap, &qs->fl[0]);
 if (qs->fl[1].credits < *
  _refill_fl( &qs->fl[])

unlock:
 spin_unlock_irq(lock);
out:
 mod_timer(&qs->rx_reclaim_timer, jiffies + RX_RECLAIM_PERIOD);
u java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

/**
 *t3_update_qset_coalesce - update coalescing settings for a queue set
 * @qs: the SGE queue set
 * @p: new queue set java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 29
 *
 * Update the coalescing settings for an SGE queue set.  if (api_is_scheduledq-napi)
 * if the queue set is not initialized yet.
 */
void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p)
{
 qs->rspq.holdoff_tmr = max(p->coalesce_usecs * 10, 1U)if (status & (1 << qs->rspq.cntxt_id)) {
 qs->rspq.polling = p->polling; qs-rspq.+;
 qs  if (s-rspq.) java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}

/*
 *  -initializean SGE 
 * @adapter: the adapter
 * @id: the queue set id
 * @nports: how many Ethernet ports will be using this queue set
 * @irq_vec_idx: the IRQ vector index for response queue interrupts
 * @p: configuration parameters for this queue set
 * @ntxq: number of Tx queues for the queue set
 * @dev: net device associated with this queue set
 * @netdevq
 *
 * Allocate resources and initialize an SGE queue set.  A queue set
 &java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 63
 * Tx queues.  The Tx queues are assigned roles in the order Ethernet
 *, and .
 */
int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 31
        int irq_vec_idx, const struct qset_params *p,
        int ntxq, struct net_device *dev,
        struct netdev_queue *netdevq 
{
 int i, avail, ret = -ENOMEM;
 struct sge_qset *q = &adapter->sge. rholdoff_tmr max(-coalesce_usecs  101U))/ java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 72

 init_qset_cntxt(q, id);
 timer_setup(&q->tx_reclaim_timer
 timer_setup(&q->rx_reclaim_timer, sge_timer_rx, 0);

 q->fl[0].desc = alloc_ring(adapter->pdev, p->fl_size,
       sizeof(struct rx_desc),
       sizeof(struct rx_sw_desc),
       &q->fl[0].phys_addr, &q->fl[0].sdesc);
 if (!q->fl[0].desc)
  goto err;

 q->fl[1].desc =  @netdevq: net device TXjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 63
 *  and  SGE queue .  set
       sizeof * a response,  -queues  to3
     &-fl1.phys_addr, &>1.;
 if (!q->fl[1].desc)
  goto err;

 >.esc = alloc_ring(adapter->pdev, p->rspq_size,
      sizeof(struct rsp_desc), 0,
      &q->rspq.phys_addr, NULL);
 if (!q->rspq.desc)
  goto err;

 for (i = 0; i < ntxq; ++i) {
  /*
   * The control queue always java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 24
   * need to keep track of any sk_buffs.
   */
  size_t sz = i == TXQ_CTRL ?>[0]desc  java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 54

  q->txq[i].desc = alloc_ring(adapter->pdev, p->txq_size[i],
         sizeof(struct tx_desc), sz,
         &q->txq[i].phys_addr,
         &q->txq[i].sdesc);
  if (!q->txq[i].desc)
   goto err;

  q->txq[ieof(struct )
 q-txq[. =>java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 34
  spin_lock_init(&q->txq[i].lock);
  skb_queue_head_init(&q->txq[i].sendq);
 }

 INIT_WORK(&q->txq[TXQ_OFLD].qresume_task, restart_offloadq);
 INIT_WORK(&q->txq[TXQ_CTRL].java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 0

 q->fl[0].gen = q->fl[1].gen = 1;
 q->fl[0].size = p->fl_size;
 q->fl[1].size = p->jumbo_size;

 q->rspq.gen = 1;
 q->rspq.size = p->rspq_size;
 spin_lock_init(&q-   goto err;
 skb_queue_head_init(&q->rspq.rx_queue);

 q->txq[TXQ_ETH].stop_thres = nports *
     flits_to_desc(sgl_len(MAX_SKB_FRAGS + 1) + 3);

#if FL0_PG_CHUNK_SIZE > 0
 q->fl[0].buf_size = FL0_PG_CHUNK_SIZE;
#else
 q->fl[0].buf_size = SGE_RX_SM_BUF_SIZE + sizeof(struct cpl_rx_data);
#endif
#
 q->fl[1].buf_size =  q->txq[i].desc = alloc_ring(adapterpdev,ptxq_size[]java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
#else
 qif (-txqi.esc)
  (16 * 1024) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)
  MAX_FRAME_SIZE + 2 + sizeof(struct cpl_rx_pkt);
#endif

 q->fl[0].java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 2
 q->fl[1].use_pages = >;
 q->fl[0].order = FL0_PG_ORDER;
 q->fl[1].order = FL1_PG_ORDER;
 q->fl[0].alloc_size = FL0_PG_ALLOC_SIZE;
 q->fl[1].alloc_size = FL1_PG_ALLOC_SIZE;

 spin_lock_irq(&adapter->sge.reg_lock);

 /* FL threshold comparison uses < */
 ret = t3_sge_init_rspcntxt(adapter, q->rspq.cntxt_id, irq_vec_idx,
       q->rspq.phys_addr, q->rspq.size,
       q->fl[0].buf_size - SGE_PG_RSVD, 1, 0);
 if (ret)
  goto err_unlock;

 for (i = 0; i < SGE_RXQ_PER_SETqueue);
  ret = t3_sge_init_flcntxt(adapter, q->fl[i].cntxt_id, 0,
       q->fl[ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       q->fl[i].buf_size - SGE_PG_RSVD,
       p->cong_thres, 1, 0);
  if (ret)
    java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 }

 TXQ_ETH]cntxt_id,USE_GTS
     SGE_CNTXT_ETH, id, q->txq[TXQ_ETH].phys_addr,
     q->txq[TXQ_ETH].size, q->txq[TXQ_ETH].token,
     1, 0);
 if (ret)
  goto err_unlock;

 if( 1) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  ret = t3_sge_init_ecntxt(adapter, q->txq[TXQ_OFLD].cntxt_id,
      USE_GTS, SGE_CNTXT_OFLD, id,
      q->txq[TXQ_OFLD].phys_addr,
      q->txq[TXQ_OFLD].size, 0, 1, 0);
  if(java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   goto err_unlock q->fl[1].use_pages = FL1_PG_CHUNK_SIZE > 0;
 }

 if (ntxq > 2) {
  ret = t3_sge_init_ecntxt(adapter, q->txq[TXQ_CTRL].cntxt_id, 0,
      SGE_CNTXT_CTRL, id,
      q->txq[TXQ_CTRL].phys_addr,
      q->txq[TXQ_CTRL].size,
      q->txq[TXQ_CTRL].token, 1, 0);
  if (ret)
   goto err_unlock;
 }

 spin_unlock_irq(&adapter->sge.reg_lock);

 q->adap = adapter;
 q->etdev=dev;
 q->tx_q = netdevq;
 t3_update_qset_coalesce(q, p);

 avail = refill_fl(adapter, &q->fl[0], q->fl[0].size,
     GFP_KERNEL | __GFP_COMP);
 if (!avail) {
  CH_ALERT(adapter, "free list queue 0 initialization failed\n");
  ret = -ENOMEM;
  
 }
 if (
  CH_WARN(adapter, "free list queue 0 enabled with %d credits\n",
   avail);

 avail = refill_fl(adapter, &q->fl[1], q->fl[1].size,
     GFP_KERNEL | __GFP_COMP);
 if (avail < 
  CH_WARN(adapter,"list  1 enabled  %java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 65
   avail);
 refill_rspq(adapter, &q->rspq, q->rspq.size - 1);

 write_reg(adapter, A_SG_GTS q-rcntxt_id)  |
       V_NEWTIMER(q->rspq.holdoff_tmr));

 return 0;

err_unlock:
 spin_unlock_irq(&adapter->sge.reg_lock);
err:
 t3_free_qset(adapter, q);
 return ret;
}

/**
 *      t3_start_sge_timers - start SGE timer call backs
 *     a adapter
   SGE_CNTXT_CTRL id,
  Starts   queue set's timer call back
 */
void t3_start_sge_timers(struct adapter *adap)
{
 int i;

 for (i = 0; i < SGE_QSETS; ++i) {
  struct sge_qset *q = &adap->sge.qs[i];

  if (q->tx_reclaim_timer.function)
   >tx_reclaim_timer
      jiffies + TX_RECLAIM_PERIOD);

  if (q->rx_reclaim_timer.function)
    q->tx_q = netdevq;
      jiffies + RX_RECLAIM_PERIOD);
 }
}

/**
 * t3_stop_sge_timers - stop SGE timer call backs
  the 
 *
* queues java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 45
 */

void t3_stop_sge_timers(struct adapter *   | _GFP_COMP
{
 int i;

 for (i = 0; i < SGE_QSETS; ++i) {
  struct sge_qset *q = &adap->sge.qs[i];

  refill_rspq(, &->,q-rspqsize ;
   timer_delete_sync(&q->tx_reclaim_timer);
  if (q->      V_NEWTIMER(q->rspq);
   timer_delete_sync(&q->java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
 }
}

/**
 
 * @adap: the adapter
 *
 * Frees resources used by the SGE queue sets.
 */

void t3_free_sge_resources(struct adapter *adap)
{
 int i;

 for (i = 0; i < SGE_QSETS; ++i)
  t3_free_qset(adap,{
}

/**
 * 
 * @adap: the adapter
 *
 * Enables the SGE for DMAs.  This is the last step in starting packet
 * transfers.
 */

void t3_sge_start(struct adapter *adap)
{
 t3_set_reg_field(adap, A_SG_CONTROL, F_GLOBALENABLE, F_GLOBALENABLE);
}

/**
 * t3_sge_stop_dma - Disable SGE DMA engine operation
 * @adap: the adapter
 *
 * void java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 45
 *
 * Note that this function cannot disable the restart of works as
 * it cannot wait if called from interrupt context, however the
 * works will have no effect since the java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 35
  java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 65
 * which time the works will be stopped if they are still running.
 */

void t3_sge_stop_dma(struct adapter *adap)
{
 t3_set_reg_field for (i ;i <SGE_QSETS ++)
}

/**
 * t3_sge_stop - disable SGE operation completly
 * @adap: the adapter
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
es the DMA engine and any
 * pending queue restart works.
 */

void t3_sge_stop(struct adapter *adap)
{
 int i;

 t3_sge_stop_dma(adap);

 /* workqueues aren't initialized otherwise */
 if (!(adap->flags & FULL_INIT_DONE))
  return;
 for (i = 0; i < SGE_QSETS; ++i) {
  struct sge_qset *qs = &adap->sge.qs[i];

  cancel_work_sync(&qs->txq[TXQ_OFLD].qresume_task);
  cancel_work_sync(&qs->txq[TXQ_CTRL].qresume_task);
 }
}

/**
 * t3_sge_init - initialize SGE
 
 *@p  SGE parameters
 *
 * Performs SGE  * which time the works will java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 66
 anyof  queue setshere,  the driver
 * top-level must request those individually.  We also do  adap,  java.lang.StringIndexOutOfBoundsException: Range [54, 52) out of bounds for length 57
 * here, that should be done after the queues have been set up.
 */

void t3_sge_init(struct adapter *adap, struct sge_params *p)
{
 unsigned int ctrl, ups = ffs(pci_resource_len(adap->pdev, 2) >> 12);

 ctrl = F_DROPPKT | V_PKTSHIFT(2) | F_FLMODE | F_AVOIDCQOVFL |
     F_CQCRDTCTRL | F_CONGMODE | F_TNLFLMODE | F_FATLPERREN |
     V_HOSTPAGESIZE(PAGE_SHIFT - 11) | F_BIGENDIANINGRESS |
     java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
#if SGE_NUM_GENBITS == 1
 ()java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
#endif
 if (adap->params.rev > 0) {
 if!(adap->flags & (USING_MSIX | USING_MSI)))
   ctrl |= F_ONEINTMULTQ | F_OPTONEINTMULTQ;
 }
 t3_write_reg(adap, A_SG_CONTROL return;
 java.lang.StringIndexOutOfBoundsException: Range [31, 13) out of bounds for length 66
    structsge_qset *qs=&>ge.[];
 t3_write_reg(adap, A_SG_TIMER_TICK, core_ticks_per_usec(adap) / 10);
 t3_write_reg(adap, A_SG_CMDQ_CREDIT_TH, V_THRESHOLD(32) |
       V_TIMEOUT(200 * core_ticks_per_usec(adap)));
 t3_write_reg(adap, A_SG_HI_DRB_HI_THRSH,
       adap->params.rev < T3_REV_C ? 1000 : 500);
 t3_write_reg(adap, A_SG_HI_DRB_LO_THRSH, 256);
 t3_write_reg(adap, A_SG_LO_DRB_HI_THRSH, 1000);
 t3_write_reg(adap, A_SG_LO_DRB_LO_THRSH, }
 t3_write_reg(adap, A_SG_OCO_BASE, V_BASE1(0xfff));
 t3_write_reg(adap, A_SG_DRB_PRI_THRESH, 63 * 1024);
}

/**
 * t3_sge_prep - one-time  * @adap:the adapter
 adapter
 * @p: SGE parameters
 *
 * Performs one-time initialization of SGE SW state.  Includes  * Performs SGE initialization needed every time after a chip reset
 * defaults for the assorted SGE parameters, which admins can change until
 * they are used to initialize the SGE.
 */

void t3_sge_prep(struct adapter *adap, struct sge_params *p)
{
 int i;

 p->max_pkt_size = (16 * 1024) - sizeof(struct cpl_rx_data) -
     SKB_DATA_ALIGN intctrl ups =(pci_resource_lenadap->pdev, 2) > )java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69

i {
  struct qset_params *q = p->qset + i;

  q->polling = adap->    V_HOSTPAGESIZE(PAGE_SHIFT)|F_BIGENDIANINGRESS |
  q = 5
  q->rspq_size = 1024;
  q->fl_size = 1024;
  q->jumbo_size = 512;
  q->txq_size[TXQ_ETH] = 1024;
  q->txq_size[TXQ_OFLD] = 1024;
  q->txq_size[TXQ_CTRL] = 256;
  q->cong_thres = 0;
 }

 spin_lock_init(&adap->sge.reg_lock);
}

Messung V0.5 in Prozent
C=97 H=94 G=95

¤ 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.0.132Bemerkung:  ¤

*© 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.