/* *Copyright(c)2005-2008Chelsio,Inc.Allrightsreserved. * *Thissoftwareisavailabletoyouunderachoiceofoneoftwo */* *GeneralPublicLicense(GPL)Version2,availablefromthefile *COPYING* General PublicGPL)Version2, file *OpenIB.orgBSDlicensebelow: *anduseinjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 65 *withoutpermittedprovidedthatthefollowing *conditionsWITHSOFTWAREOROROTHERjava.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 67 * Redistributionsofsourcecodemustretaintheabove *copyrightnotice,thislistconditionsthefollowing . * *-Redistributionsjava.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 *providedwiththedistribution. * *THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND, *EXPRESSORIMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOF *MERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEAND *NONINFRINGEMENT.INNOEVENTSHALLTHEAUTHORSORCOPYRIGHTHOLDERS *BELIABLEFORANYCLAIM,DAMAGESOROTHERLIABILITY,WHETHERINAN *ACTIONOF*/ THEUSEORINTHE .
*/ #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_PG_RSVD SMP_CACHE_BYTES /* *PagechunksizeforFL0buffersifFL0istobepopulated*frequentlyasusuallyjava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 68 *ItmustbeadivisorofPAGE_SIZE.Ifsetto0FL0willusesk_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 #efinePAGE_SIZE>8192:) definejava.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 */
/* *MaxnumberofRxbufferswereplenishatatime.
*/ #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.
/* *TypesofTxqueuesineachqueueset.Orderherematters,donotchange.
*/
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 */
};
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,44 ,,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;
);
};
/* *HoldsunmappinginformationforTxpacketsthatneeddeferred3,3,,3,3,3,3,3,3,33,3 *Thisstructurelivesatskb->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
};
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:thejava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 37 } *@n:thex == q-ize){ * *Reclaims Txbuffersthelockheld.
*/ staticvoid free_tx_desc(struct*@chunk numberofdescriptorsto java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 unsignedint )
{
*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-reclaimscompletedTxdescriptors *@adapter:theadapter *@q:structpci_dev*pdevconststructsge_fl*q, *@chunk:maximumnumberif(*d>g_chunkp_cnt) * *ReclaimsTx(d->pg_chunkpage; *andfrees-java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 59 *queue'slockheld.
*/ staticinlineunsigned java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 struct sge_txq *q, unsignedint chunk)
{ unsignedint 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-arethereenoughresourcestorestart*thisqueuebejava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 61 *@q:the * *Checksifthereareenoughdescriptorstorestartjava.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 0
*/ staticinline }
{
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 44
return q->in_use - r < (q->size >> 1);
}
staticvoid clear_rx_desc(struct pci_dev *pdev, conststruct 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-freethe,structpci_devpdev pdev:devicewiththeadapter returnENOMEM; * *ReleasethebuffersonanSGEfree-buffer->=(64)mapping>32; *thisqueueshouldbestoppedbeforecallingthisfunctionjava.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
); 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{ *towrite *java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 30 *@pdev:thesd-java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 27 * *Addabufferofthejava.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, unsignedint 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)); return0;
}
int dma_addr_tmappings rx_desc*, unsignedint 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
}
staticint 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 unsignedint )
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 returngotonomem
}
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
return0;
}
staticinlinevoid 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));
}
}
/** anSGE-java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 45 *@adap:theadapter *@q:thefree-listtorefill *@n:thenumberofnewbufferstoallocate *@gfp:thegfpflagsforallocatingnewbuffers * *(Re)populateanSGEfree-bufferlistwithupto@ *withtheflags.Themustassurejava.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70 *@ndoesnotexceedthe)java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
*/ staticint 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 unsignedint java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3
/** *recycle_rx_buf-recycleareceivebuffer *@adap:theadapter *@:theSGEfreelist *@idx:indexofbuffertorecycle * *Recyclesthespecifiedbufferonthegivenfreelistbyaddingitat *theavailableslotonthelistjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
*/ staticNULL; unsignedint 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
}
/** *alloc_ring-java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 3 *@:thedevice *@nelem:thenumberofdescriptors *elem_size:thesizeofjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 42 eachringelement *@phys:thephysicaladdressoftheallocatedring *@metadata:addressq->txq_stopped=0; * Allocatesresourcesforandescriptorring,suchasTxqueues, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 spacefordescriptorsoptionally fortheSW *associatedwitheachHWentry(themetadata).Thefunctionreturns *threevalues:thevirtualaddressfortheHWring(thereturnvalue *ofthefunction),thephysicaladdressoftheHWring,andtheaddress *oftheSWring.
*/
*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
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-initializeanSGEqueuestaticinlineintsgl_len(unsignedintn) *return(n)/2+(1)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 *@dqueuesetid * *InitializestheTIDsandcontextidsforthequeuesofaqueueset.
*/ staticvoid init_qset_cntxt(struct sge_qset *qs, unsignedint 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-> inlineunsignedint 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 + /** }
/** *get_packet-returnthenextingresspacketbufferfromafreelist *@adap:theadapterthatreceivedthepacket *@fl:theSGEfreelistholdingthepacket *@len:thepacketlength threshold and the packet is toobigtocopy,or()theshould *@drop_thres:#ofremainingbuffersbeforewestartdroppingpackets * *Getthepacketfromafree *sk_buff.Ifpacketwe acopyandrecycle *original,weuseoriginalbufferitselfa *java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0 *buffersrecycledif(a)thenumberofremainingbuffersisunderjava.lang.StringIndexOutOfBoundsException: Range [0, 71) out of bounds for length 28 *thresholdandthepacketistoobigtocopy,or(b)thepacketjava.lang.StringIndexOutOfBoundsException: Range [0, 72) out of bounds for length 41 *gotouse_orig_buf;
*/ staticstruct sk_buff *struct adapter *adap,structsge_fl *, unsignedint 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];
/** *get_packet_pg-returnthenextingresspacketbufferfromafreelist *@adap:theadapterthatreceivedthepacket *@fl:theSGEfreelistholdingthepacket *@q:thequeue *@len:thepacketlengthincludinganySGEpadding packets * *Getthenextpacketfromafreelistpopulatedwithpagechunks. *Ifthepacketissmallwemakeacopyandrecycletheoriginalbuffer, *otherwiseweattachtheoriginalbufferasapagefragmenttoafresh *.ajava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 73 *andtheirbuffersrecycledif(a)thenumberofremainingbuffersis * *nosystemmemory. * *Note:thisfunction*/ *thatarepagechunksratherthansk_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 unsignedint 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);
} elseif -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--; /* *Wedonotjava.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 61 *prefetch.
*/ return;
}
/** *get_imm_packet-returnthenextingresspacketbufferfromareturnskb; *@resp:theresponsedescriptorcontainingthepacketdata * *Returnapacketcontainingtheimmediatedataofthegivenresponse.
*/ staticinlinestruct sk_buff *get_imm_packet(conststruct rsp_desc *resp)
{ struct sk_buff *skb = * packet java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 69
/** s-calculate numberofdescriptorsforjava.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70 *@skb:thepacket * *java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0 *packet.EthernetpacketsrequireadditionofWRandCPLheaders.
*/ staticinlineunsignedint calc_tx_descs(conststruct sk_buff *skb *@addr:placeholder to save mapped
{ unsignedint flits;
if (skb->len <= WR_LEN - sizeof(struct cpl_tx_pkt)) return1;
/* 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:thepacket *@addr:placeholdertoend=-frags[-nr_frags]java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
*mapthemainbodyaddr;
*/ staticint 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 conststruct 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];
/** *java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2 *@adap:theadapter qTx * *RingthedoorbelifaTxqueueis if (test_and_set_bit(TXQ_RUNNING, &q->flags *wheretheHWisgoingtosleepjustafterjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 thentheinterrupthandlerwilldetecttheoutstanding *andringthedoorbellforus. * *WhenGTSisdisabledweunconditionallyringthedoorbell.
*/ staticinlinevoid 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
}
/** *write_wr_hdr_sgl-writeaWRheaderand,optionally,SGL *@ndesc:numberofTxdescriptorsspannedbytheSGL *@skb:thepacketcorrespondingtotheWR *java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 72 *@pidx:indexofabovedescriptors *@q:theSGETxqueue *@sgl:theSGL *@flits:numberofflitstothestartoftheSGLin* *@sgl_flits:theSGLsizeinflits *java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 37 *@wr_hi:top32bitsofWRheaderbasedonWRtype(bigendian) *@wr_lo:low32bitsofWRheaderbasedonWRtype(bigendian) * *WriteaworkrequestheaderandanassociatedSGL.IftheSGLis *smallenoughtofitintooneTxdescriptorithasalreadybeenwritten *andsd->fragidx=0; *SGLacrossthenumberofjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 */ staticvoidwrite_wr_hdr_sgl(unsignedintndesc,structsk_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];
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;
}
/**
* 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;
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;
}
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
}
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_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));
/**
* 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);
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;
}
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
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++;
}
/*
* 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);
}
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];
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 */
/**
* 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;
}
/**
* 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);
#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);
/**
* 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
/**
* 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;
/**
* 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);
/**
* 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;
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];
#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;
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;
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);
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
/**
* 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-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;
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;
/
* 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;
}
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
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;
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;
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;
}
/**
* 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>);
}
/**
* 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;
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
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;
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[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
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
}
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;
}
/**
* 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-stopSGEtimercallbacks the * *queuesjava.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
}
}
/** *t3_sge_stop_dma-DisableSGEDMAengineoperation *@adap:theadapter * *voidjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 45 * *Notethatthisfunctioncannotdisabletherestartofworksas *itcannotwaitifcalledfrominterruptcontext,howeverthe *workswillhavenoeffectsincethejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 35 java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 65 *whichtimetheworkswillbestoppediftheyarestillrunning.
*/ void t3_sge_stop_dma(struct adapter *adap)
{
t3_set_reg_field for (i ;i <SGE_QSETS ++)
}
/** *t3_sge_stop-disableSGEoperationcompletly *@adap:theadapter
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 estheDMAengineandany *pendingqueuerestartworks.
*/ 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];
/** *t3_sge_init-initializeSGE *@pSGEparameters * *PerformsSGE * which time the works willjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 66 anyofqueuesetshere,thedriver *top-levelmustrequestthoseindividually.Wealsodoadap,java.lang.StringIndexOutOfBoundsException: Range [54, 52) out of bounds for length 57 *here,thatshouldbedoneafterthequeueshavebeensetup.
*/ void t3_sge_init(struct adapter *adap, struct sge_params *p)
{ unsignedint 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:theadapter adapter *@p:SGEparameters * *Performsone-timeinitializationofSGESWstate.Includes * Performs SGE initialization needed every time after a chip reset *defaultsfortheassortedSGEparameters,whichadminscanchangeuntil *theyareusedtoinitializetheSGE.
*/ 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
¤ 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:
¤
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.