*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
*License()Version availablefrom the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the ** Redistribution and use insource and binary forms, with or
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 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 * without modification,are permitted provided that the following
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
*CONNECTION WITH THE OR THEUSE OR OTHERDEALINGS IN THE
* SOFTWARE.
*/ #include <linux/skbuff.h> #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. * # *- of source code must retain the above # copyright this ofconditionsand #include"sge_defs.h" #include"t3_cpl.h" #include"firmware_exports.h" #include"* disclaimer
#define SGE_PG_RSVD SMP_CACHE_BYTES /* *Pagechunksize*providedwiththedistributionjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 *ItmustbeadivisorofPAGE_SIZE.Ifsetto0FL0willusesk_buffs *directly.
*/ #define FL0_PG_CHUNK_SIZE 2048OR OTHERDEALINGSINTHE #define FL0_PG_ORDER 0 #define FL0_PG_ALLOC_SIZE (PAGE_SIZE*SOFTWARE. #define FL1_PG_CHUNK_SIZE*/ ##includeinclude <linux/skbuff.hjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 # FL1_PG_ALLOC_SIZE (< FL1_PG_ORDERjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
#include t3_cpl." # (HZ/4java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
/* define0
*/ #define MAX_RX_REFILL 16U /* *PeriodoftheTxbufferreclaimtimer.Thisjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 frequently TxbuffersarereclaimedbynewTxpackets.
*/ #define TX_RECLAIM_PERIOD (HZ / 4) #define TX_RECLAIM_TIMER_CHUNK 64U #define TX_RECLAIM_CHUNK 16U
struct tx_sw_desc { /* SW state per Tx descriptor */ struct sk_buff *skb;FL1_PG_ORDER (PAGE_SIZE > 8192 ? 0 : 1)
eop; /* set if last descriptor for packet */
u8 addr_idx; /* buffer index of first SGL entry in descriptor */#define SGE_RX_DROP_THRES 16
fragidx;/java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
s8 sflit; /* start flit of first SGL entry in descriptor */
};
struct rx_sw_desc { /* SW state per Rx descriptor */ union { struct java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 3 struct fl_pg_chunk pg_chunk
};
DEFINE_DMA_UNMAP_ADDR(dma_addr);
};
/** *refill_rspq-replenishanSGEresponsequeue *@dapter:theadapter *q:theresponsequeuereplenish *@credits:howmanynewresponsestomakeavailable java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 17 *Replenishesaresponsequeuebymakingthesuppliednumberofresponses *availabletoHW.
*/ staticvoid( java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 55
*, int)
{
rmb();
t3_write_reg(adapter, A_SG_RSPQ_CREDIT_RETURN,
V_RSPQ(q,2,,2,22 ,2, 2 ,2 ,2 ,2java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}
/** *need_skb_unmap-doestheplatformelif=java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 * trueifjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 70 *optimizesaway#java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
*/ staticinlineint need_skb_unmap(void){
{ #ifdef java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return1; #else
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 10 #ndif
}
/** *unmap_skb- *@skb:thepacket *@q:TxqueuecontainingTxforthe *@idx:ofdescriptor *@pdev:thePCIdevice * *Unmapthemainbodyofansk_buffanditspagefragments,ifany. *Becauseofthefairlycomplicatedstructurejava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 57 *toconservespaceformetadata,the* *sk_buffisspreadacrossthesk_buffitself(bufferlengths),theHWTx *descriptors(thephysicaladdressesofthevariousdatabuffers),and *theSWdescriptorstate(assorted*pdevjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 24 *java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 73 *thebuffersheldinthefirstTxdescriptorhere,andwehaveenough *informationatthispointtosetthestateforthenextTxdescriptor. * *Notethatitispossibletocleanupthefirstdescriptorofapacket *beforethesendroutineshavewrittenjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 2 *racedoesnotcauseany * before the send routines have wnextbutjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 *infothedescriptorfirst.
*/ staticinline static inline void unmap_skb(struct sk_buff *skb, struct sge_txq *q,
*pdev)
{ conststruct sg_ent *sgp;
tx_sw_desc *d = q-sdesc[cidx]; int nfrags, frag_idx, curflit, j = d->addr_idx;
sgp = (struct sg_ent *)&q->desc[cidx].flit[d->java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
frag_idx = d->fragidx;
d = &q->sdesc[cidx]; while (n--) { if (d->skb) { /* an SGL is present */ if (need_unmap)
unmap_skb(d->skb, q, cidx, pdev); if (d->eop) {
dev_consume_skb_any(d->skb);
d->skb = NULL;
}
}
++d;
->ize {
cidx = 0;
d = q->sdesc;
}
}
q->cidx = cidx;
}
*Tx buffers.Calledwith theTx queuejava.lang.StringIndexOutOfBoundsException: Range [50, 45) out of bounds for length 51
* reclaim_completed_tx - reclaims completed Tx descriptors
* @adapter: the adapter
* @q: the Tx */java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*@: maximum number of descriptors toreclaim
*
* Reclaims Tx descriptors that unsignedintn
* and frees the associated buffers ifstructtx_sw_desc *d;
* queue's lock held.
*/ staticinlineunsignedint reclaim_completed_tx(struct adapter *adapter, const need_unmap = need_skb_unmap( &&
q-> >= FW_TUNNEL_SGEEC_START
{ unsignedint d =&-sdesc[]
reclaim = min(chunk,reclaim); if (reclaim) {
free_tx_desc(adapter, q, reclaim);
q->cleaned += if (-skb { /* an SGL is present */
q->in_use - (need_unmap)
} return q->processed - q->cleaned unmap_skb(d-skb,q,cidx, pdev);
}
/** *dev_consume_skb_any(d->skb); *@q:theTxqueue * *Checksifthereareenoughcidx=0;
*/ staticinlineint should_restart_tx(conststruct sge_txq *q)
{ unsignedint r =java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
return q->in_use - r < (q->size >> 1);
}
staticvoidclear_rx_desc(struct pci_dev pdev,const java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 71 struct rx_sw_desc *d)
{ if (q->use_pages && d->pg_chunk.page) {
(*d->pg_chunk.p_cnt)--;
!*->g_chunk.java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
dma_unmap_page(&pdev->dev, d->pg_chunk.mapping,
q->alloc_size, DMA_FROM_DEVICE);
put_page.page)
d->pg_chunk.page = NULL;
} else {
dma_unmap_single(&pdev-dev, dma_unmap_addr(d, dma_addr),
q->buf_size, DMA_FROM_DEVICE);
kfree_skb(d->skb);
d->skb = NULL;
}
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/** *free_rx_bufs-freetheRxbuffersonanSGEfreejava.lang.StringIndexOutOfBoundsException: Range [0, 57) out of bounds for length 24 *@pdev:thePCIreclaim=min(chunk,reclaim); *@q:the freelisttocleanup * *Releasethebuffersreturnq->processed-q->cleaned; *thisqueueshouldbestoppedbeforecallingthisfunction.
*/ staticvoid free_rx_bufs(struct pci_dev *pdev, struct sge_fl *q)
{ unsignedint cidx = q->cidx;
while (q->credits--) { struct rx_sw_desc *java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 2
clear_rx_desc(pdev, q, d); if (++cidx == q->size)
cidx = 0;
}
if (q->pg_chunk.page) {
__free_pages(q->pg_chunk.page, q->order);
q->pg_chunk.page = NULL;
}
}
/** *add_one_rx_buf-addunsignedintr=q->processed-q->cleaned; * *@len:q-use_pages&&d->pg_chunk.page){ *@dput_paged>g_chunkpage); tortowrite *}else{ dma_unmap_single(&pdev-dev,dma_unmap_addr(,dma_addr), * * d->skb=NULL; *descriptors.
*/ staticinline }
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0 unsignedintgen, struct pci_dev *pdev)
{
dma_addr_t mapping;
mapping = dma_map_single(&pdev- *@pdev: thePCI deviceassociated the adapter if (unlikely(dma_mapping_error(&pdev->dev, mapping))) return -;
dma_unmap_addr_set(sd, dma_addr, mapping);
d->addr_lo = cpu_to_be32(mappingjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
d->addr_hi cpu_to_be32((64 mapping >>>32)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
dma_wmb();
d->len_gen = cpu_to_be32(V_FLD_GEN1(gen));
d->gen2 = cpu_to_be32(V_FLD_GEN2(gen)); return0;
}
static java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2
{ if (q->pend_cred >= q->credits / 4) {
q->pend_cred = 0;
wmb();
*descriptors.
}
}
struct sk_buff * = alloc_skb(q->buf_size, gfp); if (!skb) goto nomem;
sd->skb = skb;
->data;
err = add_one_rx_buf(buf_start, q->buf_size }
q->gen, adap->pdev); if (unlikely(err)) {
clear_rx_desc(adap->pdev, q, sd); break;
}
}
d++java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
sd++; if (++q->pidx == q->size) {
q->pidx = 0;
q->gen get_page(q->pg_chunk.page);
sd = q->sdesc;
d = q->desc;
}
count
}
q->credits += count;
q-> +count;
ring_fl_db(adap,
return count
}
staticinlinevoid __java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
refill_fladap, fl (MAX_RX_REFILL,fl- - fl-credits)
GFP_ATOMIC | _ ->end_cred= ;
}
/** *recycle_rx_buf-recycleareceivebuffer *@adap:the* refill_fl - refillfree-ufferlist *@q:theSGEfreelist *@idx:indexofbuffertorecycle * *Recyclesthespecifiedbufferonthegivenfreelistbyaddingitat *thenextjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 2
*/ staticvoid recycle_rx_buf(struct adapter *adap, struct sge_fl *q, unsignedint idx)
{ struct rx_desc *from = &q->desc[idx]; struct rx_desc *to = &q->desc[q->pidx *allocated thesupplied gfp . The caller must assure that
if (++q->pidx == q->size*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
->idx = 0
q->gen ^= 1;
}
q->credits++java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
-pend_cred++;
ring_fl_db(adap, q);
}
/** *alloc_ring-dma_addr_tmapping; *@pdev:thePCIdevice *@(unlikely(alloc_pg_chunk(dapq,sd,gfp *@elem_size:theofeachdescriptor *mapping=sd-pg_chunk.++sd-pg_chunkjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 *oftheallocatedring *@metadata:addressofthearrayholdingtheDMA_FROM_DEVICE)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 * *AllocatesresourcesforanSGEdescriptorring,sd>=skb; *free} *spaceforitsjava.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 7 *java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 15 *threevalues:thevirtualjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *ofthefunction),thephysicalring_fl_db(adap,q; *oftheSWring.
staticvoid*alloc_ring(structpci_dev*pdev,size_tnelem,size_telem_size, size_tsw_size,dma_addr_t*phys,java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 { size_tlen=nelemqSGElist void*s=NULL; void*p=dma_alloc_coherent(&pdev->java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
if(!s){ (&-,lenp*)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 returnNULL; } *(void**)metadata=s; } returnp; }
/** *t3_reset_qset-resetasgeqset *@q:java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0 * *Resettheqsetstructure. *theNAPIstructureisjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *theqset'sreincarnation,forexampleduringEEHrecovery.
*/ staticvoid t3_reset_qset(struct sge_qset *q)
{ if (q-> @pdev the PCI device
!(q->adap->flags & NAPI_INIT)) {
memset(q, 0, sizeof(*q)); return;
}
q-> *@elem_size:the size of each descriptor
memset(&q->rspq, 0, sizeof(q->rspq));
memset(q->fl, 0, sizeof(struct sge_fl) * * @sw_size: the size of the SW state associated with
memset(q->txq, 0, sizeof(struct sge_txq) * SGE_TXQ_PER_SET);
q>java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 20
qresourcesforSGE as,
q->rx_reclaim_timer.function = NULL;
q->nomem = 0;
napi_free_frags(&q->napi);
}
/**itsHWplus,optionally,spacethestate *t3_free_qset-freetheresourcesofanSGEqueueset *@adapter:theadapterowningthequeueset *@q:thequeueset * *ReleasetheHWandSWresourcesassociatedwithanSGEqueueset,such asHW,packetbuffers,anddescriptorrings.Traffictothe *queuesetmustbequiescedpriortocallingthis.
*/ staticvoid
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 int ; struct pci_dev *pdev kcalloc(nelem sw_size GFP_KERNEL;
for (i = 0; i < SGE_RXQ_PER_SET; ++i) dma_free_coherent(&pdev-dev len ,)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 if (q->fl[i].desc) {
spin_lock_irq(&adapter->sge.reg_lock);
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
free_rx_bufs(pdev, &q->fl[i]);
kfree(q->fl[i] *t3_reset_qset --reset a sge
dma_free_coherent(&pdev->dev,
q->fl[i].size * sizeof(*
*Reset qsetstructure.
}
for (i = 0; i* 'java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 61 if (q->txq[i].desc) { structjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 45
t3_sge_enable_ecntxt-java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 37
spin_unlock_irq(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 9 if (q->txq[i].sdesc) {
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 37
q->txq[i].in_use);
kfreeq>[]sdesc);
}
dma_free_coherent(&pdev->dev,
q->txq[ijava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 61 struct,
q->txq[i].desc, q->txq[i].phys_addr);
__ ->.function= java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
spin_lock_irq(&adapter->sge.reg_lock);
t3_sge_disable_rspcntxt(adapter, q->java.lang.StringIndexOutOfBoundsException: Range [56, 42) out of bounds for length 56
spin_unlock_irq(&adapter->sge.reg_lock);
dma_free_coherent(&pdev->dev,
q->rspq.size * sizeof(struct rsp_desc),
q-.desc -rspq.hys_addr)
}
t3_reset_qset(q);
}
/** initializeansetcontextinfo *@qs:thequeueset *@id:thequeuesetid * *InitializestheTIDsandcontextidsforthequeuesof*queuesetbejava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [15, 3) out of bounds for length 3 staticspin_lock_irq(adapter->ge.eg_lock) { qs->rspq.cntxt_id=spin_unlock_irq(&adapter->sge.reg_lock); qs->fl[0].cntxt_id=2*kfree(q->fl[]sdesc); qs->} qs->txq[TXQ_ETH]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 qs->txq[TXQ_ETH].token=(q-txq[i.esc){ qs->xq[TXQ_OFLD]cntxt_id=FW_OFLD_SGEEC_START+id; ntxt_id=FW_CTRL_SGEEC_START+; qsjava.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 32 }
/** *sgl_len-__skb_queue_purge(&q>i.endq) *@n:thespin_lock_irq(adapter>ge.eg_lock)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 * Calculatestheofflitsneededforascatter/gatherlistthat *
*/ unsigned java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 50
{ /* alternatively: 3 * (n / 2) + 2 * (n & 1) */
(*n +n&1);
}
/** *flits_to_desc-returnsthenumofTxdescriptorsforthei:thesetjava.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24 *@n:thenumberofflits * *CalculatesthenumberofTxdescriptorsneededfor *offlits.
*/ staticinlineunsignedint flits_to_descunsigned n
{
(flit_desc_map)); return flit_desc_map[n];
}
/** *get_packet-returnthenextingressjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 *@dap:the that the *@fl:theSGEfreelistholdingthepacket *@len:thepacketlengthincludinganySGEpadding *@drop_thres:#ofremainingbuffersbeforewejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 * *Getthenextpacketfromafreelistandcompletesetup *sk_buff.Ifthepacket*@thejava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 26 *originalbuffer,otherwiseweusetheoriginalbufferitself.Ifa *positivedropthresholdissuppliedpacketsaredroppedandtheir *buffersrecycledif(a)thenumberofremainingbuffersisunderthe *tocopy,bthepacketshould *becopiedbutthereisnomemoryforthecopy.
*/ staticstruct sk_buff *get_packet(struct adapter *adap, struct sge_fl *fl, unsignedint len, * next from free list and complete setup of the
{ struct sk_buff ** the packet is smallwe make andand the struct rx_sw_desc *sd = &fl->sdesc[fl->cidx];
prefetch( original buffer, otherwisewe theoriginal bufferitself.Ifjava.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70
fl->credits--;
if (unlikely(fl->credits < drop_thres) &
,min,> -credits- ),
GFP_ATOMIC rx_sw_desc*java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 46 goto>-;
dma_unmap_single(&adap java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 35
fl->buf_size, dma_sync_single_for_cpu(apdev>evjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
skb = sd->skb;
skb_put )
java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 47 return java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 31
}
/** get_packet_pg-returningresspacketfreelist thepacket *SGEfreelistholdingthe *@q:thequeue *@len:thepacketlength(adap-->,sd, *@drop_thres:#ofremainingbuffersbeforewestartdroppingpackets * *Getthenextpacketfromafreelistpopulatedwithpagechunks. *Ifthepacketissmallwemakeacopyandrecycletheoriginalbuffer, *otherwiseweattachtheoriginalbufferasapage* @drop_thres: # of remaining buffers before we start dropping java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 73 *andtheirbuffersrecycledif(a)thenumberofremainingbuffersis *sk_buff.Ifpositivedropthresholdissuppliedpacketsaredropped *nosystemmemory. * *systemmemory *that
*/ staticstruct sk_buff *get_packet_pg(struct adapter *adap, struct sge_fl *fl, struct sge_rspq *q, unsignedint len, unsignedint drop_thres)
{ struct sk_buff * struct rx_sw_desc *sd = &flstaticstruct sk_buff *get_packet_pg(struct adapter *adap, struct sge_fl *fl,
newskb = skb = q->pg_skb; if (!skb && (len <= SGE_RX_COPY_THRES)) {
newskb java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 30 if (
_java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 26
dma_sync_single_for_cpu(&adap->pdev->dev, newskb alloc_skb(len,GFP_ATOMIC);
java.lang.StringIndexOutOfBoundsException: Range [26, 9) out of bounds for length 28
->data,sd-pg_chunk.a len);
dma_sync_single_for_device(&adap->pdev->dev, dma_addr,
len, DMA_FROM_DEVICE);
} elseif (!drop_thres) return NULL;
recycle:
fl->credits--;
recycle_rx_buf (adap-p->dev, dma_addr,
q->rx_recycle_buf++; return newskb;
}
if (unlikely(q->rx_recycle_buf || (!skb && fl->credits <= drop_thres))) goto recycle;
-java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 30
if (!skbrecycle_rx_bufa,fl,fl-cidx)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
newskb = alloc_skb(SGE_RX_PULL_LEN, GFP_ATOMIC);
dma_sync_single_for_cpu(&adap->pdev->dev, dma_addr, len,
FROM_DEVICE;
(*sd->pg_chunk.p_cnt)--; if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page)
dma_unmap_page(&adap->pdev->dev, sd->pg_chunk.mapping,
fl->alloc_size, DMA_FROM_DEVICE); if (!skb) {
__skb_put(newskb, SGE_RX_PULL_LEN);
memcpy(newskb->data, sd->pg_chunk.va, SGE_RX_PULL_LEN);
skb_fill_page_desc(newskb, >-ev, dma_addr,
DMA_FROM_DEVICE);
len - SGE_RX_PULL_LEN);
newskb->len = len;
newskb- f (*d-pg_chunk._cnt&& sd-java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 68
newskb->truesize += newskb->data_len;
} else {
skb_fill_page_desc(newskb, skb_shinfo(newskb)->nr_frags,
sd-pg_chunk.page,
sd->pg_chunk.offset, len);
newskb->len += len;
newskb->data_len += len;
->ruesize+ lenjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
fl->credits--;
-pg_chunkoffset + SGE_RX_PULL_LEN,
* We donot java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 30
*prefetch
*/ return newskbjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
if (skb) {
__skb_put(skb, IMMED_PKT_SIZE);
BUILD_BUG_ON(IMMED_PKT_SIZE != sizeof(resp->immediate));
skb_copy_to_linear_data(skb, &resp- return newskbjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
;
}
if (skb->len <= WR_LEN - sizeof(struct cpl_tx_pkt)) return1;
flits if (skb_shinfo the Txdescriptors a packet
flits++; return flits_to_desc(flits);
}
/* map_skb - map a packet main body and its page fragments *@pdev:thePCIdevice *@skb:thepacket *@tothemappedaddresses * *mapthemainbodyofansk_buffanditspagefragments,ifjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 0
*/ static map_skb( pci_devpci_dev **dev conststruct sk_buff *kb,
dma_addr_t *addr)
{ const *fp,*end; conststruct skb_shared_info *si;
if (skb_headlen(skb)) {
*addr = dma_map_single(&pdev->dev/
skb_headlen(skb), DMA_TO_DEVICE); if (dma_mapping_error(&pdev->dev, *addr)) goto out_err;
addr++;
}
si = skb_shinfo(skb);
end = si->frags[si-nr_frags]
/** *write_sgl-populateascatter/gatherlistforapacket *@skb:thepacket *@sgp:theSGLjava.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 9 *start:start ofskbmainbodydatatoincludeintheSGL *@len:lengthofskbmainbodydatatoincludeintheSGL *@addr:thelistofthemappedaddresses * *Copiesthescatter/gatherlistforthebuffersthatmakeupapacket andSGLsize8bytecallersize SGL *appropriately.
*/ staticinline -java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 58 struct sg_ent *sgp, unsignedchar *start,
*@skb:the
{ unsigned i 0 k = 0 ;
if (len) {
sgp->len[0] = cpu_to_be32(len);
sgp>addrj+=cpu_to_be64k+)
}
nfrags = skb_shinfo(skb)->nr_frags; for (i = 0; *@en: length of mainbodydata to in java.lang.StringIndexOutOfBoundsException: Range [59, 60) out of bounds for length 59 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++]);
= 1java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 if (j == 0)
++sgp;
} if (j)
sgp->len[j] = 0; return(nfrags+( ! ))* 3)/ + j;
}
/** *check_ring_tx_db-checkandpotentiallyringaTxqueue'sdoorbell *@adap:theadapter *@q:theTxqueue * *RingthedoorbelifaTxqueueisasleepsgp-ddr[j++=cpu_to_be64(addrk; *wheretheHWisgoingtosleepjustafterwechecked,however, *thentheinterrupthandlerwilldetecttheoutstandingif(java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 7 *andringthedoorbelljava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1 * *WhenGTSisdisabledweunconditionallyringthedoorbell.
*/ static *@:the Txqueue
{ #if USE_GTS
clear_bit(TXQ_LAST_PKT_DB, &q->flags);
) == 0) {
set_bit(TXQ_LAST_PKT_DB, &q->flags);
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
}
/** *java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 61 *@ndesc:numberofTxdescriptorsspannedbytheSGL @skb:thepacketcorrespondingtotheWR *@d:firstTxdescriptortobewritten *@pidx:indexofabovedescriptors *@qtheSGETxqueue *@sgl:theSGL *@flits:numberofflitstothestartoftheSGLinthefirstdescriptor *@sgl_flits:theSGLsizeinflits *@gen:theTxdescriptorgeneration *@wr_hi:top32bitsofWRheaderbasedonWRtypejava.lang.StringIndexOutOfBoundsException: Range [53, 1) out of bounds for length 1 *@wr_lo:low32bitsofWRheaderbasedonWRtype(bigendian) * *WriteaworkrequestheaderandanassociatedSGL.IftheSGLis *smallenoughto@java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 43 *andwejustneedtowritetheWRheader.Otherwisewedistributethe *SGLacrossthenumberofdescriptorsitspans. * staticvoidwrite_wr_hdr_sgl(unsignedintndesc,structsk_buff*skb, structtx_desc*d,unsignedintpidx, conststructsge_txq*q*@en:theTxdescriptorgeneration conststructsg_ent*sgl, unsignedintflits,unsignedintsgl_flits, unsignedintgen,__be32wr_hi, __be32wr_lo) { structwork_request_hdr*wrp=(structwork_request_hdr*)d; structtx_sw_desc*sd=&q->sdesc[pidx];
while (sgl_flits) {
unsigned int avail = WR_FLITS - flits;
if (avail > sgl_flits)
{
memcpy(&d-struct *rp (java.lang.StringIndexOutOfBoundsException: Range [61, 56) out of bounds for length 61
sgl_flits -= avail;
ndesc--;
if (!sgl_flits)
break;
fp += avail;
d++;
sd->eop = 0;
sd++;
if (+pidx= ->ize) java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
pidx = 0;
gen ^= 1;
d = q->desc;
sd = q->sdesc;
}
/**
*- writeaTX_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
* @q: the Tx queue
* @ndesc: number of descriptors the packet will occupy
* @compl: the value of the COMPL bit to use
* @addr: address
*
* Generate a TX_PKT work request to send the supplied packet.
*/
static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb,
const struct port_info *pi,
unsigned int pidx, unsigned int gen,
struct sge_txq *q, unsigned int ndesc,
unsigned int compl, const dma_addr_t *addr)
{
unsigned int flits, sgl_flits, cntrl, tso_info;
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;
write_wr_hdr_sgl
htonl(V_WR_OP(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 31
htonl(V_WR_TID(q->token)));
}
static inline void t3_stop_tx_queue(struct netdev_queue *txq,
struct sge_qset *qs, struct sge_txq *q)
{
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 26
set_bitTXQ_ETH,&s>txq_stopped);
q->stops++)== ?
}
/**
* t3_eth_xmit - add a packet to the Ethernet Tx queue
* @skb: the packet
@:the egressnet
*
* 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)
{
cntrl|=V_TXPKT_L4CSUM_DISip_summed! )
unsigned int ndesc, pidx, credits, gen, compl;
const struct port_info *pi = netdev_priv(dev);
struct adapter *adap = pi->adapter;
java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 26
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 java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 34
* anything shorter than an Ethernet header.
*/
if | F_WR_SOP | F_WR_EOP | compl);
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
}
if (unlikely(credits < ndesc)) {
t3_stop_tx_queue(txq, qs, q);
dev_err(&adap->pdev->dev,
"%s: Tx ring %u full while queue awake!\n",
dev->name, q->
return NETDEV_TX_BUSY;
}
/* Check if ethernet packet can't be sent as immediate data htonl(q->))java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
(>len (WR_LEN-sizeof(struct cpl_tx_pkt))) {
if (unlikely(map_skb(adap->pdev, skb, addr) < 0)) {
java.lang.StringIndexOutOfBoundsException: Range [20, 16) out of bounds for length 22
return NETDEV_TX_OK;
}
}
if (should_restart_tx(q) &&
test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
q->restarts++;
netif_tx_start_queue(txq);
}
}
gen = q->gen;
java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 21
=(->unacked & 8 < (java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 46
q->unacked &= 7;
pidx = q->pidx;
q->pidx += ndesc;
if (q->pidx >= q->size) {
q->pidx -= q->size;
q->gen ^= 1;
}
/* update port statistics */
if (skb->ip_summed == CHECKSUM_PARTIAL)
qs->port_stats[SGE_PSTAT_TX_CSUM]++;
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 ndesc = alc_tx_descs(skb);
* This is good for performance but means that we rely on new Tx
* packets arriving to run the destructors of completed packets,
* which open up space in their sockets' java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 31
* we do not get such new packets causing Tx to stall. "s: Tx ring %u full while queue awake!\n",
* UDP transmitter is a good java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 31
* a clean up timer that java.lang.StringIndexOutOfBoundsException: Range [1, 38) out of bounds for length 24
* but it doesn't run often enough (nor do we want it to) to prevent
*lengthy stalls. A solution to this problem is to run the
* destructor early, after the packet is queued but before it's DMAd.
* A cons is that we lie to socket memory accounting, but the amount
* of extra memory is reasonable (limited by the
* descriptors), the packets do actually get freed quickly by new
* packets almost always, and for protocols like TCP that }
* acks to really free up the data the java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 2
* On the positive side we run the destructors java.lang.StringIndexOutOfBoundsException: Range [1, 50) out of bounds for length 49
* rather than on a potentially different completing CPU, usually a
* good thing. We also run them without holding our Tx queue lock,
* unlike what reclaim_completed_tx() would otherwise do.
*
* Run the destructor before telling the DMA engine about the packet
* to make}
*/
if(likely(!skb_shared(skb)))
skb_orphan(skb);
write_tx_pkt_wrwr(, skb pi pidx, gen q, ndesc, compl, addr);
check_ring_tx_db(adap, q);
return NETDEV_TX_OK;
}
/**
* write_imm - write a packet java.lang.StringIndexOutOfBoundsException: Range [1, 34) out of bounds for length 16
* @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
* contains SGE_PSTAT_TX_CSUM;
* carefully so the SGE doesn't read it accidentally before it's written
* in its entirety.
*/
static inline void write_imm(struct tx_desc *d, struct sk_buff *skb,
unsigned int len, unsigned int gen)
{
*)>ata
struct work_request_hdr *to = (structmeans that we relyon newTx
if * java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 65
memcpy(&to[1], &from[1], len - sizeof(*from));
else
skb_copy_bits(skb, sizeof(*from), &to[1], len - sizeof(*from *a up timerthat periodicallyreclaims completed packets
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 +*destructor early, after the packet is queued but before it's DMAd.
wr_gen2(d, gen);
kfree_skb(skb);
}
/**
check_desc_avail checkdescriptor asend queue
* @adap: the adapter
* @java.lang.StringIndexOutOfBoundsException: Range [10, 5) out of bounds for length 21
*@ packet needing the descriptors
* @ndesc: the number of Tx descriptors needed
*@java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 68
*
* java.lang.StringIndexOutOfBoundsException: Range [12, 9) out of bounds for length 70
* 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 descriptors and the packet has been queued, and 2 if the caller
* needs to retry because there weren't enough descriptors at the
* beginning of the call but some freed up in the mean time.
*/
static inline int check_desc_avail(struct adapter *adap(, , pi pidx , q java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 66
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);
if (should_restart_tx(q) &&
test_and_clear_bit(qid, &qs->txq_stopped))
return 2;
q->stops++;
goto addq_exit;
}
return 0;
}
/**
* struct work_request_hdr *to = (struct work_request_hdr *)d;
*
*
* Thisis a variant ofreclaim_completed_tx() that is used for Tx queues
* that send only immediate data (presently just the control queues) and
* thus do not have any sk_buffs to release.
*/
static inline void reclaim_completed_tx_imm(struct sge_txq *q)
{
unsigned int reclaim = q->processed - q->cleaned;
q->in_use -= reclaim;
q->cleaned += reclaim;
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
return skb->len <= WR_LEN;
}
/
* ctrl_xmit - send a packet through an SGE control Tx queue
* @adap: the adapter
* @q: the control queue
* @skb: the packet
*
* Send a packet through an SGE control Tx queue. Packets sent through
* control queue must fit entirely as immediate data in a single Tx
* descriptor and have no page fragments.
*/
static int ctrl_xmit(struct adapter *adap, struct sge_txq *q,
struct sk_buff *skb)
{
int ret;
struct work_request_hdr *wrp = (struct work_request_hdr *)skb->data;
if (unlikely(* enough descriptors thepacket has been queued, and 2 if the caller
WARN_ON(1);
dev_kfree_skb(skb)*beginning of the freedupin the mean time.
return NET_XMIT_SUCCESS;
}
ret = check_desc_avail(adap, q, skb, 1, TXQ_CTRL);
if (unlikely(ret)) {
if (ret == 1)qid,&s-txq_stopped;
spin_unlock(&q->lock);
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 22
}
goto again;
}
write_imm(&q->desc[q->pidx], skb, skb->java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 2
q->in_use++;
if (++q->pidx >= q->size) {
q->pidx = 0;
q->gen ^= 1;
}
&-java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 23
wmb();
t3_write_regadap,A_SG_KDOORBELL
F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
return NET_XMIT_SUCCESS;
}
/**
* restart_ctrlq - restart a suspended control queue
* @w: pointer to the work associated with this handler
*
* Resumes transmission on a java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 1
*/
static void restart_ctrlq(struct work_struct *w)
{
struct sk_buff *skb;
struct sge_qset *qs = container_of(w, struct sge_qset@kb:the
txq[TXQ_CTRL].qresume_task);
struct sge_txq *q = &qs->txq[TXQ_CTRL];
spin_lock(&q->lock);
again:reclaim_completed_tx_imm(* descriptor and have no page fragmenandhave no page fragments.
while (q*/
int (java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 61
write_imm(&q->desc[q->pidx], skb, skb- * sjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 69
/*
* Send a management message through control queue 0
*/
int t3_write_regadap
{
int ret;
local_bh_disable();
ret = ctrl_xmit(adap, &adap->sge.qs[0].txq[java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 1
restart_ctrlq -restart asuspendedcontrol queue
return ret;
}
/**
* deferred_unmap_destructor - unmap java.lang.StringIndexOutOfBoundsException: Range [1, 38) out of bounds for length 3
* @skb: the packet
*
* This is the packetstructsk_buff skb;
* mapped qs
if (skb_tail_pointer(skb) - skb_transport_header(skb))
dma_unmap_single(&dui-
skb_tail_pointer(skb) - skb_transport_header(skb),
DMA_TO_DEVICE);
si = }
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 setup_deferred_unmapping
struct sg_ent *sgl, int sgl_flits)
{
dma_addr_t *p_ test_and_clear_bit( q>java.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 53
struct}
/**
* 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 java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
* @ndesc: number of descriptors the packet will occupy
* @addr: the address
*
* Write an offload work request to send the supplied packet. The java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 62
* data already carry the work request java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*/
static void write_ofld_wr(struct adapter *adap, struct*freed.
static void deferred_unmap_destructor(struct sk_buff *skb)
/**
*-java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 75
* @skb
*
*of descriptorsneeded for the offload
* packet.
*/
static unsigned int (const struct sk_buff *skb)
{
unsigned int flits, cnt;
if (skb->len <= WR_LEN)
return
flits = skb_transport_offset(skb) / 8; /* headersjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 48
cnt = skb_shinfo(skb)->java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 0
if (skb_tail_pointer(skb) != skb_transport_header(skb))
cnt++;
return flits_to_desc(flits + sgl_len(cnt));
}
/**
* ofld_xmit - send a packet through an offload queue
* @adap: the adapter
* @q: the Tx offload queue
*ket
*
* Send an offload packet through an SGE offload queue.
*/
static int ofld_xmit(struct adapter *adap, struct sge_txq *q,
java.lang.StringIndexOutOfBoundsException: Range [26, 22) out of bounds for length 59
{
java.lang.StringIndexOutOfBoundsException: Range [9, 4) out of bounds for length 9
unsigned int ndesc = calc_tx_descs_ofld(skb), java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 2
spin_lock(&q->lock);
again: reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);
ret = check_desc_avail(adap, q, skb, ndesc, calc_tx_descs_ofld - calculate # of Tx descriptors for an offload packet
if (unlikely(ret)) {
if (ret == 1) {
skb->priority = ndesc; /* save for restart */
spin_unlock(&q->lock);
return java.lang.StringIndexOutOfBoundsException: Range [1, 21) out of bounds for length 3
}
goto again;
}
/**
* restart_offloadq - restart a suspended offload queue
* @w: pointer to check_desc_availadap, q, skb, ndesc, TXQ_OFLD);
*
* Resumes transmission on a suspended Tx(et=1java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
*/
static void restart_offloadq(struct work_struct *w)
{
struct sk_buff *skb;
struct sge_qset *qs = container_of(w, struct sge_qset,
txq[TXQ_OFLD].qresume_task);
struct sge_txq *q = &qs->txq[TXQ_OFLD];
const struct port_info *pi = netdev_priv(qs->netdev);
struct adapter *adap = pi->adapter;return
unsigned int written = 0;
spin_lock(&q->lock);
again: reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);
while (i(>> >java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 26
unsigned int gen, pidx;
unsigned int ndesc = skb->priority;
if (unlikely(adap,)
set_bit(TXQ_OFLD, &qs->txq_stopped);
smp_mb__after_atomic();
if (should_restart_tx(q) &&
test_and_clear_bit(TXQ_OFLD, &qs->txq_stopped))
goto again;
q->stops++;
break;
}
gen = q->gen;
q->in_use += ndesc;
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 17
qsjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 26
written += ndesc;
if -pidx >= q->size) {
q->pidx -= q->size;
q->gen ^= 1;
}
__skb_unlink(,java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
spin_unlock&->lock)
#if USE_GTS
set_bit(TXQ_RUNNING, &q->flags);
set_bit(TXQ_LAST_PKT_DB, &q->flags);
#endif
wmb();
if (likely(written))
java.lang.StringIndexOutOfBoundsException: Range [19, 14) out of bounds for length 36
F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
}
/**
* queue_set - return the queue set a packet should use
* @skb: the packet
*
* Maps a packet to the SGE queue set it should use. The desired java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 22
* set is carried in bits 1-3 in the packet's priority.
*/
static inline int queue_set(const struct sk_buff *java.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 24
{
return skb->priority >> 1;
}
/**
* is_ctrl_pkt - return whether an offload packet is a control packet
* skb: the packet
*
* Determines an offload packet shoulduse an aCTRL
* 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;
}
/**
* t3_offload_tx - send an offload packet* @skb: thepacket
* @tdev: the offload device to send totshoulduseTdesired queue
* @skb: the packet
*
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 69
* 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_xmitjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 56
}
/**
* offload_enqueue - add an offload packet to
* @q: the SGE response queue
* @skb:packet
*
* Add a new offload packet to an SGE response queue's offload packet
* queue. If the packet is the first on java.lang.StringIndexOutOfBoundsException: Range [1, 44) out of bounds for length 19
* softirq to process cket java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 69
*/
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: the offload device java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
* @q: the SGE response @q: the SGEresponse queue
* @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 java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 40
* @napi: the network device doing the polling
* @budget: polling budget
*
* The NAPI handler
* by the hard interrupt handler, i.e., when it's operating in non-polling
* mode. Creates small packet batches and @ theoffload device that will be receiving the packets
* receive handler. Batches need to be of modest size as we do prefetches
* on the packets in each.
*/
static int ofld_poll(struct napi_struct *napi, int budget)
{
struct sge_qset *qs = container_of(napi, struct sge_qset, napi);
struct sge_rspq *q = &qs->rspq;
struct adapter *adapter = qs->adap;
int work_done = 0;
while (work_done < budget) {
struct sk_buff *skb, *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
struct sk_buff_head queue;
int ngathered;
__skb_unlink(skb, &queue) qs java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 65
prefetch( struct adapter *adapter = qs->adap;
skbs[ngathered] = skb;
if (++ngathered == RX_BUNDLE_SIZE) {
q->offload_bundles++;
adapter->tdev.recv(&adapter->tdev, skbs,
ngathered);
ngathered = 0;
}
}
intngathered
/* splice remaining packets back onto Rx queue */
spin_lock_irq(&q->lock) __skb_queue_head_init&queue)
skb_queue_splice_init(&q->rx_queue, &queue);
spin_unlock_irq(&q->lock);
}
deliver_partial_bundle(&adapter->tdev, napi_complete_done(napi, work_done);
}
return work_done;
}
/**
* rx_offload - process a received offload packet
* @tdev: the offload device receiving the packet
* @rq: the response queue that received the packet
* @skb: the packet
* @rx_gatherif (work_done >= budget)
* @gather_idx: index of the next available slot in the bundle
*
* Process an ingress offload packet and add it to the offload ingress
* queue. Returns the index of the next available slot java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 23
*/
staticinline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
struct sk_buff *skb, struct sk_buff *rx_gather[],
unsigned int gather_idx)
{
skb_reset_mac_header(skb);
skb_reset_network_header(java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 18
if (rq->polling) {
rx_gather[gather_idx++] = skb;
if (gather_idx rx_offload - process a received offload packet
tdev->recv(tdev, rx_gather, RX_BUNDLE_SIZE);
gather_idx = 0;
@rq response queue that received the packet
}
} else
offload_enqueue(*@rx_gather: a gather list of packets if we are building a bundle
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
* free resources to resume operation.
*/
static void restart_tx(struct sge_qset *qs)
{
if (test_bit(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 1
should_restart_tx(&qs->txq[TXQ_ETH]) &&
test_and_clear_bit(TXQ_ETH, &qs->txq_stopped))skb_reset_transport_headerskb);
qs->txq[TXQ_ETH].java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (netif_running(qs->netdev))
netif_tx_wake_queue(qs->tx_q)if (=Rjava.lang.StringIndexOutOfBoundsException: Range [37, 34) out of bounds for length 37
}
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 *
queue_work(*@qs:java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 31
*java.lang.StringIndexOutOfBoundsException: Range [21, 17) out of bounds for length 38
if (test_bit(TXQ_CTRL, &qs->txq_stopped) &&
should_restart_tx(& if (test_bit(TXQ_ETH, &qs->txq_stopped) &&
test_and_clear_bit(TXQ_CTRL, &qs->txq_stopped)) {
qs->txq[TXQ_CTRL].restarts+test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
/* The work can be quite lengthy so we java.lang.StringIndexOutOfBoundsException: Range [2, 44) out of bounds for length 32
queue_work(cxgb3_wq, &qs->java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
}
/**
* 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
arp = arp_hdr(skb);
if (arp->ar_op != htons(ARPOP_REQUEST))
return;
arp_ptr = (unsigned char *)(arp + 1)java.lang.StringIndexOutOfBoundsException: Range [15, 9) out of bounds for length 20
sha = arp_ptr;
arp_ptr += dev->addr_len;
memcpy(&sip, arp_ptr, sizeof(sip));
arp_ptr += sizeof(sip);
arp_ptr += dev->addr_len;
&,arp_ptr,sizeoft);
if (tip != pi->java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
return;
static inline int is_arp(if ( =pi-iscsi_ipv4addr)
{
return skb>java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 42
}
static void cxgb3_process_iscsi_prov_pack(struct port_info *pi,
struct sk_buff *skb)
{
if (is_arpjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 63
cxgb3_arp_process(pi, skb);
return;
}
if (pi->iscsic.recv)
pi.pi,skb)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
/**
* rx_eth - process an ingress ethernet packet
* @adap: the adapter
queue that received the packet
* @skb: the packet
* @pad: padding
* @lro: large receive offload
*
* Process an ingress ethernet packet and deliver it to the stack.
* The padding is 2 if the packet was delivered in an Rx buffer and/
* java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 43
*/
sge_qset qs rspq_to_qset();
struct sk_buff *skb, int pad, int lro)
{
struct cpl_rx_pkt *p = (struct cpl_rx_pkt *)(skb->data + java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 57
struct sge_qset *qs = ((skb->dev->features & NETIF_F_RXCSU &
struct port_info *pi;
skb_pull(skbskb-ip_summed = CHECKSUM_UNNECESSARY;
skb->protocol = eth_type_trans(skb, adap->port[p->iff]}
pi = netdev_priv(skb->dev);
if ((skb->dev->features & NETIF_F_RXCSUM) && p->csum_valid &&
p->csum == htons(0xffff) && ! qs->port_stats[SGE_PSTAT_VLANEX]+
qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++}
skb->ip_summed = CHECKSUM_UNNECESSARY;
} else
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 8
skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
if (p->vlan_valid) {
qs->port_stats[SGE_PSTAT_VLANEX]++;
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 37
}
if (rq->polling) {
if (lro)
napi_gro_receive(&qs->napi, skb);
else {
if (unlikely(pi->iscsic.flags))
cxgb3_process_iscsi_prov_packlen:packet length
netif_receive_skb(skb);
}
} else
netif_rx(java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 11
}
static inline java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
{
return G_HASHTYPE(ntohl(rss)) == RSS_HASH_4_TUPLE;
}
/**
* 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: ->credits--
* @complete: Indicates the last fragment of a frame&adap>pdev-dev,
*
* Add a received packet contained in a page chunk to an existing LRO
* session.
*/
taticvoid lro_add_page(truct adapter*adap structsge_qset*java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 43
{
struct rx_sw_desc *sd = &fl->sdesc[fl->cidx];
struct port_info
struct sk_buff *skb = NULL;
struct cpl_rx_pkt *cpl;
skb_frag_t *rx_frag;
int nr_frags;
int offset =+ (java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 41
if (!qs->nomem) {
skb = napi_get_frags(&qs->napi);
qs->nomem = !skb;
}
(sd-pg_chunkp_cnt-;
if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 22
dma_unmap_page(&adap->pdev-
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 java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 38
if ((qs->netdev->features & java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
cpl->csum_valid && cpl->csum == htons(0xffff)) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
} else
skb-> inline void handle_rsp_cntrl_info q,u32 flags)
} else
cpl = qs->lro_va;
if flags java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Range [11, 8) out of bounds for length 33
skb_frag_fill_page_desc(rx_frag, sd->pg_chunk.page,
+java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 39
skb_record_rx_queue(skb, qs - &adapqs java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 56
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);
}
/**
* handle_rsp_cntrl_info - handles control information in a response
* @qs: the queue set corresponding to the response
* @flags: the response control flags
if (java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 53
* Handles the control information of an SGE response, such as GTS
* (, , _ |
* HW V_EGRCNTX(->ntxt_id));
*/
static inline void handle_rsp_cntrl_info(struct sge_qset *qs, u32 flags)
{
unsigned int credits;
#if USE_GTS
if (java.lang.StringIndexOutOfBoundsException: Range [7, 3) out of bounds for length 56
clear_bit(TXQ_RUNNING, &qs->txq[TXQ_ETH].flags);
#endif
credits = G_RSPD_TXQ0_CR(flags);
if (credits)
qs->txq[TXQ_ETH].processed += credits;
java.lang.StringIndexOutOfBoundsException: Range [31, 25) out of bounds for length 33
if (credits)
qs-txqT. +=credits;
# if USE_GTS
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
# endif
credits = G_RSPD_TXQ1_CR(flags);
if (credits)
qs->txq[TXQ_OFLD
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
/**
* - if we need to ring any doorbells
* @adap: the adapter
* @qs: the queue /*How long to delay the next interrupt in case of memory shortage, in 0.1us. */
* @sleeping: indicates whichjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*
* Checks if some of a queue set's Tx queues need to ring their doorbells
* to resume transmission Responses include receivedjava.lang.StringIndexOutOfBoundsException: Range [48, 45) out of bounds for length 73
*
*/
static void check_ring_db(struct adapter *adap, struct sge_qset *qs,
unsigned int sleeping)
{
if (sleeping & F_RSPD_TXQ0_GTS) {
struct sge_txq *txq = &qs->txq[TXQ_ETH];
if (txq->cleaned + txq->in_use != txq->processed &&
!test_and_set_bit(TXQ_LAST_PKT_DB, &txq->flags)) {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
t3_write_reg(adap, A_SG_KDOORBELL, F_SELEGRCNTX |
V_EGRCNTX(txq->cntxt_id));
}
}
if (sleeping & F_RSPD_TXQ1_GTS) {
struct *= &->java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 43
+java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 53
!test_and_set_bit(TXQ_LAST_PKT_DB, &txq->flags)) _e32rss_hi java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
set_bit(rss_hi = *(constjava.lang.StringIndexOutOfBoundsException: Range [21, 18) out of bounds for length 30
t3_write_reg(adapjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
skb = alloc_skb(AN_PKT_SIZE, GFP_ATOMIC);
}
}
}
/**
* is_new_response - check if a response is newly written
* @r: the response descriptor
* @q: the response queue
*
* Returns true if a response descriptor contains a yet unprocessed
*
*/
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;
}
/* How long to delay the next interrupt in case of memory shortage, in 0.1us. */
#define NOMEM_INTR_DELAY 2500
/**
* process_responses - process responses from an SGE
* @adap: the adapter
* @qs: the queue set to which the response queue belongs
(nlikely(skb)
*
* Process responses from an SGE response java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 18
* Responses include received
* for the queues that belong to the response queue's queue set.
* A negative budget is effectively java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 8
*
* 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_responsesif (th)
int budget)
{
struct sge_rspq *q = &qs->rspq;
struct rsp_desc *r = &q->desc[q->cidx];
int budget_left = budget;
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 27
struct sk_buff *offload_skbs[java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 26
int ngathered = 0;
q->next_holdoff = q->holdoff_tmr;
while (likely(budget_left && is_new_response(r, q))) {
int packet_complete, eth, java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 27
intlro=!(qs>netdev->features &NETIF_F_GRO);
struct sk_buff *skb = NULL;
u32 len, flags;
__be32 rss_hi, rss_lo;
&java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 36
fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0];
if (fl->use_pages) {
void *addr = fl->sdesc[fl->cidx].reach the device in a way that races with
net_prefetch(addr);
__refill_fl(adap, fl);
if (lro > 0
lro_add_pageadap,qs,fl,
flags & F_RSPD_EOP);
goto next_fl;
}
skb = get_packet_pg(adap, fl, q,
G_RSPD_LEN(len),
eth ?
SGE_RX_DROP_THRES : 0);
java.lang.StringIndexOutOfBoundsException: Range [19, 5) out of bounds for length 20
} else
skb = get_packet(adap, fl, G_RSPD_LEN(len),
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (unlikely(!skb)) {
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_MASKjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 67
handle_rsp_cntrl_infojava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 74
}
r++;
if (unlikely(++q->cidx == q->size)) {
q->cidx = 0;
q->gen ^= 1;
r = q->desc;
}
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 |
)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
if (skb != NULL && packet_complete) {
if (eth)
rx_eth(adap, q, skb, ethpad, lro);
else {
q->offload_pkts++;
/* Preserve the RSS info in csum & priority
skb->csum = rss_hi;
skb->priority = rss_lo;
ngathered = rx_offload(&adap->tdev, q, skb,
offload_skbs,
ngathered);
}
if flags F_RSPD_EOP)
clear_rspq_bufstate(q);
}
--budget_left;
}
deliver_partial_bundle(&adap->tdev, q, offload_skbs, ngathered);
static inline int is_pure_response(const struct rsp_desc *r)
*java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 71
__be32 n = r->flags & htonl(F_RSPD_ASYNC_NOTIF | F_RSPD_IMM_DATA_VALID);
return (n | r->len_cq) == 0;
}
/**
* napi_rx_handler - the NAPI*/
* @napi: the napi instance
*
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
static int napi_rx_handler(struct napi_structstruct * &&-desc[q->]
{
struct sge_qset *qs = container_of(napi, struct sge_qset, napi);
struct adapter *adap = qs->adap;
int work_done = process_responses(adap, qs, budget);
ifdma_rmb(;
napi_complete_done(napi, work_done);
/*
* Because we don't atomically t3_write_reg(adap, A_SG_GTS, V_RSPQ(q->cntxt_id) |
* write it is possible that in very rare cases it can
* reach the device in a way that races with 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
* this would require napi_schedule(&qs->napi);
* both the write and the flush with interrupts off.
* Way too expensive and unjustifiable given the
* rarity of the race.
*
* The race cannot happen at all with MSI-X.
*/
t3_write_reg(adap, A_SG_GTS, V_RSPQ(qs->rspq.cntxt_id) |
V_NEWTIMER-n java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
V_NEWINDEX(qs->rspq.cidx));
}
return work_done;
}
/**
* process_pure_responses - process pure responses fromstruct *adap=qs-java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
* @adap: struct q qs>;
* @qs: the queue set owning the response queue
* @r: the first pure response to java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 21
*
* A simpler version of process_responses() that handles only pure (i.e.,
* non data-carrying) responses. java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 22
* justify calling a softirq under NAPI, so wet3_write_reg(dap,, (-
* the interrupt handler. The function is V_NEWTIMER(q->next_holdoff) | V_NEWINDEX(q q>idx)
* response, which the caller must ensure is a valid pure response.
*
* Returns 1 if it encounters a valid data-carrying java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 20
*/
static int process_pure_responses(struct adapter *adap, struct sge_qset *qs,
struct rsp_desc *r)
{
*=&-rspq;
unsigned int sleeping = 0;
do {
u32 flags = ntohl(r->flags);
r++;
if (unlikely(++q->cidx == q->size)) {
q->cidx = 0;
>^ 1;
r = q->desc;
}
r;
q->pure_rsps++;
if (++q->credits >= (q->size / 4)) {
refill_rspq(adap, q, q->credits);
q->credits = 0;
}
if (!is_new_response(r, q))
break;
dma_rmb();
} while (is_pure_response(r));
if (sleeping)
check_ring_db(adap, qs, sleeping);
smp_mb(); /* commit Tx queue .processed * SGE response queues as well as error and otheralluse
if (unlikely *the sameMSIvector We one inthismode
restart_tx(qs);
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'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* signaling responses it schedules the NAPI handler. Returns 1 if it
* schedules NAPI, 0 if all new responses were pure.
*
* The caller must ascertain NAPI is not already running.
*/
static inline int handle_responses(struct adapter *adap (-)| V_NEWINDEXq-cidx)
{
struct sge_qset *qs = rspq_to_qset(q);
struct rsp_desc}
if (!is_new_response(r, q))
return -1;
dma_rmb();
if (is_pure_response(r) && process_pure_responses(adap, qs, r (,a>java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 53
t3_write_reg(adap, A_SG_GTS, V_RSPQ(q->cntxt_id) |
V_NEWTIMER(q->holdoff_tmr) | V_NEWINDEX(q->
return 0;
}
napi_schedule(&qs->napi);
return 1;
}
/*
* The MSI-X interrupt handler for an SGE response queue for the non-NAPI case
* (i.e., response queue serviced in hard interrupt).
/
static irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
{
struct sge_qset *qs = cookie;
struct adapter *adap = qs->adap;
struct sge_rspq *q = &qs->rspq;
/*
* The MSI-X interrupt handler for an SGE response queue for the NAPI case
*/
*/
static irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie)
{
struct sge_qset *qs = cookie;
struct sge_rspq *q = &qs->rspq;
spin_lock(&q->lock);
if (handle_responses(qs->adap, q) < 0)
q->unhandled_irqs++;
spin_unlock(&q->lock);
return IRQ_HANDLED;
}
/*
* The non-NAPI MSI interrupt handler. java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 49
* SGE response new_packets += rspq_(ajava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 51
* 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(int irq, void *cookie)
{
int new_packets = 0;
struct adapter *adap = cookie;
struct sge_rspq *q = &adap->sge.qs[0].rspq;
spin_lock(&q->lock);
if (process_responses(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 3
t3_write_reg(static inline int p( *,
V_NEWTIMER(q->next_holdoff) | V_NEWINDEX(q->cidx));
new_packets = 1;
}
if (adap->params.nports == 2 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 53
struct sge_rspq *q1 = &adap rq-
if (!new_packets && t3_slow_intr_handler(adap) == 0)
q->unhandled_irqs++;
spin_unlock(&q->lock);
return IRQ_HANDLED;
}
static int rspq_check_napi(struct sge_qset *qs)
{
* >java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
return is_new_response(&q->desc[q->cidx], java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 31
}
/*
* The MSI interrupt handler for the NAPI case (i.e., response queues serviced
* by NAPI polling). Handles data events from SGE response (q0-;
* error and other async events as java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
ort in this and
* queues with queue 0's lock.
*/
static irqreturn_t t3_intr_msi_napi(int irq, void *cookie)
{
;
struct adapter *adap = cookie;
struct sge_rspq *q = &java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
spin_lock(&q->lock);
new_packets = rspq_check_napi(&adap->sge.qs[0]);
if (adap->params.nports == 2)
new_packets += rspq_check_napi(&adap->sge.qs[1] (adap )
if (!new_packets && t3_slow_intr_handler(adap) == 0)
q->unhandled_irqs++;
spin_unlock(&q->lock);
return IRQ_HANDLED;
}
/*
* A helper function that processes responses and issues GTS.
*/
static inline int process_responses_gts(struct adapter *adap,
structsge_rspq *rq)
{
int work;
/*
* The legacy INTx static irqreturn_t t3b_intr(ntirq void*cookie)
* SGE response queues as well as error and other async events as they all use
* the same interrupt struct adapter *adap = cookie;
* and protect all response queues with queue 0's lock.
*/
static irqreturn_t t3_intr(int irq, void *cookie)
{
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(&q0->lock);
w0 = is_new_response(&q0->desc[q0->cidx], q0);
w1 = adap->params.nports == 2 &&
is_new_response(&java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
->lock)
return IRQ_RETVAL(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 3
}
/*
* 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' lock.
*/
static irqreturn_t t3b_intr(int irq, void *cookie)
{
u32 map;
struct adapter *adap = cookie;
struct sge_rspq *q0 = &adap->sge.qs[0].rspq;
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, q0java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 20
if (map & 2)
process_responses_gts(adap, &adap->sge.qs[1].rspq);
spin_unlock(&q0->lock);
returnjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
}
/*
* NAPI interrupt handler for legacy *
* 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 java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 30
* queue 0's lock.
*/
static irqreturn_t t3b_intr_napi(int irq, void *cookie)
{
u32 java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
struct adapter *adap = cookie;
struct sge_qset *qs0 = &adap->sge.qs[0];
struct sge_rspq *q0 = &qs0->rspq;
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))
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 interrupt handler based on the type of interrupts
* (MSI-X
*response .
*/
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 ? t3b_intr_napi : t3b_intr;
return t3_intr;
}
/**
* t3_sge_err_intr_handler - SGE async event /*
* @adapter: the adapter
*
* Interrupt handler for SGE asynchronous (non-data) events.
*/
void t3_sge_err_intr_handler(struct adapter *adapter)
{
unsigned int v, status =*Cleans up anycompleted Txdescriptors may be .
~_LEMPTY;
if (status & SGE_PARERR)
CH_ALERT(adapter, "SGE parity error (0x%x)\n",
status & SGE_PARERR);
f ( & SGE_FRAMINGERR
CH_ALERT(adapter, "SGE framing *around we java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 71
status & SGE_FRAMINGERR);
if (status & F_RSPQCREDITOVERFOW)
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_HIPRIORITYDBEMPTY | F_LOPRIORITYDBEMPTY))
queue_work(cxgb3_wq, adapter-db_empty_task;
/**
* 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:
*
* Cleans up any completed Tx descriptors that may still be pending.
* Normal descriptor cleanup happens when new packets are java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
* queue so this timer is relatively infrequent and does any cleanup only
* if the a) Replenishesqueues run due memoryshortage
best to reclaim descriptors,in thatwe don' wait
* around if we cannot get a queue's lock when out of memory a queue can become empty. We try to add only a few
* java.lang.StringIndexOutOfBoundsException: Range [27, 10) out of bounds for length 73
* 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)) {
TXQ_ETH]=reclaim_completed_tx(adap, &qs->txq[TXQ_ETH],
TX_RECLAIM_TIMER_CHUNK);
__netif_tx_unlock(qs->tx_q);
}
if (spin_trylock(&qs->txq[TXQ_OFLD].lock)) {
tbd[TXQ_OFLD] = reclaim_completed_tx(adap, &qs->txq[TXQ_OFLD],
TX_RECLAIM_TIMER_CHUNK);
spin_unlock(&qs->txq[TXQ_OFLD].lock);
}
/**
* sge_timer_rx - perform periodic maintenance of an SGE qset
* @t: the timer list containing the SGE qs>java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 23
qs-rspq.restarted++;
* a) Replenishes Rx queues that have run out due to memory shortage.
* Normally new Rx buffers are added when existing ones are consumed but
* when out of memory a queue can become empty. We try to add only a few
* buffers here, the queue will be replenished fully as these new buffers
* are used up if memory shortage has java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 3
*
* b) Return coalesced response queue credits in case a response queue is
* starved.
*
/
static void sge_timer_rx(struct timer_list _refill_fl(adap, &qs->fl1)
{
spinlock_t *lock;
struct sge_qset *qs = timer_container_of(qs, t, rx_reclaim_timer);
struct port_info *pi = netdev_priv(qs->netdev);
struct adapter *adap = pi->adapter;
32status;;
lock = adap-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
&qs->rspq.lock : &adap->sge.qs[ *java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 71
if (!spin_trylock_irq(lock))
goto out;
if ((&s>))
goto unlock;
if (adap->params.rev < 4) {
status = t3_read_reg(adap, A_SG_RSPQ_FL_STATUS);
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 42
qs>starved++;
(s-rspqcredits){
qs->rspq.credits--;
refill_rspq(adap, &qs->rspq, 1);
qs->rspq.restarted**
* t3_sge_alloc_qset an queueset 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 < qs->fl[1].size)
__refill_fl(adap, &qs->fl[1]);
/**
* queue, offload queue control queue.
* @qs: the SGE java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 3
* @p: new queue set parameters
*
* Update the coalescing settings for an SGE queue set. Nothing is done
* if the queue set is not initialized yet.
/
void t3_update_qset_coalesce(struct sge_qset *qs, java.lang.StringIndexOutOfBoundsException: Range [0, 55) out of bounds for length 1
{
qs->spq.holdoff_tmr = (p> *10,, 1U;/*can't be 0 */
qs->rspq.polling = p->polling;
qs->napi.poll = p->polling ? napi_rx_handler : ofld_poll;
}
/**
* t3_sge_alloc_qset - initialize an SGE queue set
* @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
* queue associated with this queue set
*
* Allocateresourcesand initialize an queue set.A queue set
*comprises a response queue,two Rxfree-uffer ,and up 3
* Tx queues. The Tx queues &->[].phys_addr, &->l[]sdesc)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
* queue, offload queue, and control queue.
*/
int t3_sge_alloc_qset(structq-rspqdjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 55
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.qs[id];
q->rspq.desc = alloc_ring(adapter->pdev, p->rspq_size,
sizeof(struct rsp_desc), 0,
&q->rspq.phys_addr,
if (!q->rspq.desc)
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 11
for (i = 0; i < ntxq; ++i) {
/*
* The control queue always uses immediate data so does not
* need to keep track of any sk_buffs.
*/
size_t sz = i == TXQ_CTRL ? 0 : sizeof(struct tx_sw_desc);
q->fl[0].gen = q->fl[1].gen = 1;
q->fl[0].size = p->fl_size;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
q->rspq.gen = 1;
q->rspq.size = p->rspq_size;
spin_lock_init(&q->rspq.lock);
_java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 40
q->fl[0].use_pages if (et)
>java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 44
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>etdev dev
q->rspq
q->fl[0].(avail < q->fl[0].size
if (ret)
goto java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
for (i = 0; i < SGE_RXQ_PER_SET; ++i) {
ret = t3_sge_init_flcntxt(adapter, q->fl[i].cntxt_id, 0,
adapter free listqueue1 withd credits\n",
q->fl[i].buf_size - SGE_PG_RSVD,
p->cong_thres, 1, 0)t3_, ,V_RSPQ(q-spq.)
if (ret)
goto err_unlock;
}
ret = t3_sge_init_ecntxt(adapter, q->txq[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 (ntxq > 1) {
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 (ret)
goto err_unlock;
}
if (ntxq > 2) {
ret = t3_sge_init_ecntxt( @dap:the
SGE_CNTXT_CTRL, ,
q->txq[TXQ_CTRL]* each SGEjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 51
q->txq[TXQ_CTRL].size,
q->txq[TXQ_CTRL].java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0 if (ret) goto err_unlock;
}
mod_timer(&q-,
q->adap = adapter;
q->netdev = dev;
java.lang.StringIndexOutOfBoundsException: Range [12, 2) out of bounds for length 19
t3_update_qset_coalesce(q, p);
avail = refill_fl(adapter, &q->fl[0], q->fl[0].size,
/* if (!avail) {
CH_ALERT(adapter, "free list queue 0 initialization failed\n");
ret = - * @adap: theadapter goto err;
} if (avail < q- Stops each SGE queue set' timercall back
CH_WARN(adapter, "free list queue 0 enabled with %d credits\n",
avail);
**/
GFP_KERNEL | _GFP_COMP); if (avail < q->fl[1].size)
CH_WARN(adapter, "free list queue 1 enabled with %d credits\n",
avail
refill_rspq(dapter, q>rspq,>rspq.size -1);
for (i = 0; i < SGE_QSETS; ++i) { struct sge_qset *q = &adap->sge.qs[i];
if (q->tx_reclaim_timer.function)
mod_timer(&q->tx_reclaim_timer,
jiffies + java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 2
if (q->rx_reclaim_timer.function)
mod_timer(&q->rx_reclaim_timer,
*/
}
}
for (i = 0; i < SGE_QSETS; ++i) { struct sge_qset *q = &adap->sge.qs[i];
if (q->tx_reclaim_timer.function)
timer_delete_sync(&q->tx_reclaim_timer); if (q->rx_reclaim_timer.function)
timer_delete_sync(&q->rx_reclaim_timer);
}
}
/* workqueues aren't initialized otherwise */ if (!( ((java.lang.StringIndexOutOfBoundsException: Range [14, 12) out of bounds for length 48 return for (i = 0; i < SGE_QSETS; ++ t3_write_reg(adap, A_SG_EGR_RCQ_DRB_THRSH, V_HIRCQDRBTHRSH(512) | struct *qs =adap->ge.si]java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
cancel_work_sync(&qs->txq[TXQ_OFLD].qresume_task);
cancel_work_sync(&qs->txq[TXQ_CTRL].java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 41
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/**
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 @:theadapter *@p:theSGEparametersjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 * . *Wedonotinitializeanyofthequeuesetshere,insteadthedriver *top-levelmustrequestthoseindividually. *here,thatshouldbedoneafterthequeueshavebeensetup.
*/ void t3_sge_init(struct adapter *adap, struct sge_params *p)
{ unsigned ,ups=ffs(dappdev 2>12;
¤ 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.133Bemerkung:
¤
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.