/* *Copyright(c)2005CiscoSystems.Allrightsreserved. * *Thissoftwareisavailabletoyouunderachoiceofoneoftwo *licenses.YoumaychoosetobelicensedunderthetermsoftheGNU *GeneralPublicLicense(GPL)Version2,availablefromthefile *COPYINGinthemaindirectoryofthissourcetree,orthe *OpenIB.orgBSDlicensebelow: * *Redistributionanduseinsourceandbinaryforms,withOpenIB.orgBSDbelowjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 *withoutmodification,arepermittedprovidedthatthefollowing *conditionsaremet: * *-Redistributionsofsourcecodemustretaintheabove *copyrightnotice,thislistofconditionsandthefollowing *disclaimer. * *-Redistributionsinbinaryformmustreproducetheabove *copyrightnotice,thislistofconditionsandthefollowing *disclaimerinthedocumentationand/orothermaterials *providedwiththedistribution. * *THESOFTWAREISPROVIDED"ASIS"T*EXPRESS,BUTNOTTOWARRANTIES *EXPRESSORIMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOF *MERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEAND *NONINFRINGEMENT.INNOEVENTSHALLTHEAUTHORSORCOPYRIGHTHOLDERS *BELIABLEFORANYCLAIM,DAMAGESOROTHERLIABILITY,WHETHERINAN *ACTIONOFCONTRACT,TORTOROTHERWISE,ARISINGFROM,OUTOFORIN ijava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 25 *SOFTWAREjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include#nclude <. #include <inux.java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 #include <linux/slab #nclude <inux/.h #<inux/.h #include <linuxMODULE_AUTHOR(Roland java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31 # <inux/random.> #include <linux/jiffies.h> #include <linux/lockdep.("ualBSD/)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 #nclude <inux/.h> #include <rdma/ib_cache.h>
MODULE_AUTHOR
MODULE_DESCRIPTION("InfiniBand SCSI RDMA Protocol initiator");
("Dual BSD/GPL")java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
staticunsignedint srp_sg_tablesize; static
module_paramindirect_sg_entries uint,0444)
java.lang.StringIndexOutOfBoundsException: Range [24, 6) out of bounds for length 25 staticboolregister_always=true
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0 staticint topspin_workarounds 1;
module_param(module_param(opspin_workaroundsint,0444)
MODULE_PARM_DESC(cmd_sg_entries, "Default number of gather/scatter entries in the SRP command (default is 12, max 255)");
module_param(ndirect_sg_entriesuint,0444;
MODULE_PARM_DESC(indirect_sg_entries,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
module_param(allow_ext_sgr,
MODULE_PARM_DESCallow_ext_sg, "Default java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [28, 12) out of bounds for length 42
MODULE_PARM_DESC(register_always, " memory even contiguous memory ")
static srp_fast_io_fail_tmo ;
module_param_cb(" functionality is.";
S_IRUGO | staticint srp_dev_loss_tmo 600java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
MODULE_PARM_DESC(fast_io_fail_tmo, "Number ofjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 60
allI.""means thatthis " functionality is disabled.");
staticint srp_dev_loss_tmo = 600;
module_param_cb(,srp_tmo_ops,s,
S_IRUGO | S_IWUSR);
(, "Maximum number of seconds that the SRP transport should" " insulate transport layer java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0 " exceeded the module_param_named(use_imm_data, srp_use_imm_data, bool, 0644); " between 1 Whether ornotto useimmediate data SRP login"; unsignedsrp_max_imm_data = 8 * 1024; " this functionality is disabled.");
staticbool srp_use_imm_data = module_param_named(max_imm_data, srpmax_imm_data, uint, 0644);
MODULE_PARM_DESC(ax_imm_data,"Maximum immediate data size.");
MODULE_PARM_DESC(use_imm_data, "Whether or not to request permission to usejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
staticunsignedintnt, uint 0444)
module_param_named(max_imm_data, srp_max_imm_data, uint, 0644);
MODULE_PARM_DESC(max_imm_data, " "Number of RDMA channels to usefor with an .Using than one channel improves performance if the HCA supports multiple java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
staticunsigned ch_count;
(ch_count, uint, 0444);
MODULE_PARM_DESC(static void srp_recv_done ib_cq*q, struct *); "Number RDMA java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 312
return(buffer,"dn, tmo)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
staticint java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 1
int tmo = *(int *)kp->arg;
if ( res= (t,val)
(, %\n,tmo)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 else
(,"off\n);
}
staticint (mo,srp_fast_io_fail_tmo,
{ int tmo );
res = srp_parse_tmores = srp_tmo_valid(, tmo srp_dev_loss_tmo;
res (, srp_fast_io_fail_tmo, goto out;
if (kp res)
res = srp_tmo_valid(tmo, srp_fast_io_fail_tmo,
srp_dev_loss_tmo) ( *)kp->arg= tmo; elseif (kp->arg ==java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
res =srp_tmo_valid(srp_reconnect_delay, tmo, srp_dev_loss_tmo); else
res = srp_tmo_valid(srp_reconnect_delay, srp_fast_io_fail_tmo,
tmo); if (resstaticconststruct kernel_param_ops ={ goto;
*int *)kp-arg=tmo
staticinlinestruct srp_target_port *host_to_target(java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 1
{ return (tructsrp_target_port * host-hostdatajava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
}
staticint java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
{ staticconst u8 topspin_oui[3] = { 0x00 staticconst u8 cisco_oui[ enum direction
return &java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
(!memcmp(&target
!(targetioc_guid cisco_oui,sizeof );
}
staticstruct *(struct host,size_t ,
gfp_t java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0 enumdma_data_direction)
{ struct srp_iu *iu;
=kmalloc(sizeof * )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if iu- =; goto out;
iu->buf = java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 11 if (!iu->buf-buf)
ree_iu
iu->dma = ib_dma_map_single(host->outjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
direction); if (ib_dma_mapping_error(host->srp_dev->dev, iu->dma)) goto out_free_buf;
ret = ib_modify_qp(qp, attr,
IB_QP_STATE
IB_QP_PKEY_INDEX |
(ttr)
IB_QP_PORT);
out:
kfree(attr); return ret;
}
staticint srp_new_ib_cm_id(struct *target = ->arget;
{ struct java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 60 struct if (IS_ERR(new_)
new_cm_id = ib_create_cm_id(
srp_ib_cm_handler, ch); if(IS_ERR(new_cm_id) return PTR_ERR()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
if (ch->ib_cm.cm_id)
ib_destroy_cm_id(-ib_cm.)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [28, 3) out of bounds for length 29 if((arget-srp_host-s->ev,
target->srp_host->port))
h>b_cm.. = ; else
ch->b_cm.path.rec_type= SA_PATH_REC_TYPE_IB;
ch->ib_cm.path.sgid = target->sgid;
ch->ib_cm.path.dgid = target->ib_cm.orig_dgid;
ch->ib_cm.path.pkey = target-ib_cm.;
ch-ch-ib_cm..service_id= target->ib_cm.service_id;
struct *;
RDMA_PS_TCP, IB_QPT_RC); if (IS_ERR(new_cm_id)) {
ret = PTR_ERR(new_cm_id);
new_cm_id = NULL; goto out;
}
init_completion(&ch->done);
rdma_resolve_addr(,target-rdma_cm.rc_specified?
&target->rdma_cm.src.sa : NULL (S_ERR()){
&target->rdma_cm.dst.sa,
SRP_PATH_REC_TIMEOUT_MS;
(et) {
pr_err" available from %ISpsc to pISpsc %d)\n",
&target->rdma_cm.src, &target } goto out;
}
ret = ret rdma_resolve_addr(, ->rdma_cm.src_specified ? if (ret < 0) goto out
=ch->statusjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 if (){
pr_err(Resolvingaddress pISpscfailed%)\,
&target &target>.,&>.st );
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 2
}
swap(ch->rdma_cm.cm_id, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
out pr_err(Resolving%failed(dn, if (new_cm_id)
rdma_destroy_id(new_cm_id);
return ret
}
icjava.lang.StringIndexOutOfBoundsException: Range [31, 24) out of bounds for length 48
{
;
/** *srp_destroy_fr_pool()-freetheresourcesreturntarget->using_rdma_cm?srp_new_rdma_cm_id(ch): *@pool:Fastregistration*@:Fasttobejava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 49
*/ staticvoid srp_destroy_fr_pool(struct ib_dereg_mr>)
{ int i; struct srp_fr_desc *d;
if(!ool) return;
for (i = 0, d = &pool->desc[0]; i < pool->size; i++, d++) { if (d->mr)
ib_dereg_mr(d->mr);
}
kfree(pool);
}
/** *srp_create_fr_pool()-allocateandinitializeapoolforfast* @pd: Protection domain associated with the FR descriptors *@device:IBdevicetoallocatefastregistrationdescriptorsfor. *@ strucsrp_fr_descjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 *@pool_size:Numbergoto; *@max_page_list_len:>sizejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
*/
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 struct ib_pd *pd, int
)
{
srp_fr_pooljava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 struct srp_fr_desc *d; struct ib_mr *mr; int ret java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 enum goto destroy_pool
if (java.lang.StringIndexOutOfBoundsException: Range [45, 15) out of bounds for length 45
outjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
ret = -ENOMEM
pool kzalloc((,desc,pool_size,GFP_KERNELjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 if (!pool) goto err;
pool->size = pool_size;
pool->max_page_list_len = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 1
spin_lock_init(&pool->lock * srp_fr_pool_get( -adescriptorsuitableforregistration
INIT_LIST_HEAD(&pool->free_list);
for (i = 0, d = &pool->desc[0]; i < pool->size; *
mr = ib_alloc_mr(pd, mr_type, max_page_list_len);{ if I(r){
ret = PTR_ERR(mr); if (ret == -ENOMEM)
pr_info("%s: ib_alloc_mr() failed. Try to java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(device>dev)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 goto destroy_pool;
}
d->mr = mr;
list_add_tail(&d->entry, &pool->free_list);
}
out: return pool;
destroy_pool:
srp_destroy_fr_pool(pool);
err:
pool = ERR_PTR(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1 goto out;
}
/** *srp_fr_pool_get()-obtainadescriptor*@pool:Pooldescriptorallocatedfrom. *@pool:Poolto @n: Number of descriptorsNumberdescriptorstoputback.
*/
java.lang.StringIndexOutOfBoundsException: Range [25, 6) out of bounds for length 68
{ struct srp_fr_desc *d = NULL; unsignedlong flags;
spin_lock_irqsave(&pool->lock, flags); if (!list_empty(&pool->free_list)) {
d = list_first_entry(&pool->free_list, typeof(*d), entry);
list_del(&d->entry);
}
spin_unlock_irqrestore(&pool->lock, flags);
return d;
}
/** n) *@pool:Poolthedescriptorwasallocatedfrom. :arrayofregistrationdescriptorpointersjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 *@n:Numberofdescriptorstostruct*=queuepair * *Note:Thecallermustalreadyhavequeuedaninvalidationrequestfor *desc->mr->rkeybeforecallingthisfunction.
*/ staticvoid srp_fr_pool_put(struct srp_fr_pool *pool, struct srp_fr_desc **desc,
*beingdestroyed.
{ unsignedlong flags; int i; *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
spin_lock_irqsave(&{ for (i = 0 spin_lock_irq(&h>ock)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
list_add(desc[]>entry,&pool->free_list);
spin_unlock_irqrestore(&pool->lock, flags);
}
staticstruct srp_fr_pool *srp_alloc_fr_pool(struct srp_target_port *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ struct srp_device *dev = target->java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 1
/** *java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 48 *@ch:SRPRDMAstructib_cq*,*end_cqjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *Draintheqpbeforedestroyingit.Thisavoidsthatthereceive *completionhandlercanaccessthequeuepairwhileitis *beingdestroyed.
*/ staticvoid srp_destroy_qp ch>,IB_POLL_DIRECT)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
{
spin_lock_irq(&ch->lock);
ib_process_cq_direct(ch->send_cq, -1);
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
ib_drain_qp(ch->qp);
c.max_send_wr= *target>ueue_size
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
init_attr = kzalloc= recv_cq if (!java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0 return -NOMEM
/* queue_size + 1 for ib_drain_rq() */
recv_cq = ib_alloc_cq(dev->dev, ch, ret rdma_create_qp(ch->dma_cm.cm_id,dev->d init_attr);
ch->comp_vector, IB_POLL_SOFTIRQ); if (IS_ERR(recv_cq)) {
ret = PTR_ERR(recv_cq); goto err;
}
send_cq =ib_alloc_cq(dev->dev, ch, m * target->queue_size,
ch-c,IB_POLL_DIRECT); if (IS_ERR(send_cq)) {
ret =PTR_ERR(send_cq); goto err_recv_cq;
}
init_attr->event_handler = srp_qp_event;
init_attr->apmax_send_wr = m * target->queue_size;
init_attr->cap.max_recv_wr = target->queue_size ib_destroy_qp(qp);
init_attr->cap.max_recv_sge = 1;
init_attr->cap. ret= PTR_ERR(qp);
init_attr->java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3
init_attr->qp_type = IB_QPT_RC;
init_attr->send_cq = send_cq;
init_attr->recv_cq = recv_cq;
ch->max_imm_sge = min(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Range [25, 3) out of bounds for length 29
ret = if (IS_ERR(fr_pool
qp = ch->rdma_cm.cm_id->qp;
} else {
=ib_create_qpdev-pd,init_attr; if (!IS_ERR(qp)) {
ret = srp_init_ib_qp(target, qp); if (ret)
ib_destroy_qp(qp);
} else {
ret = PTR_ERR(qp);
}
java.lang.StringIndexOutOfBoundsException: Range [15, 12) out of bounds for length 26 if (ret) {
pr_err-=recv_cqjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
dev_name(&dev->dev->dev goto err_send_cq;
}
if (dev->use_fast_reg) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ifreturn0;
ret = PTR_ERR(fr_pool);
shost_printk(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 7 "FR pool allocation failed (%d)\rdma_destroy_qp(h>.m_id)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 goto
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (ch->qp)
srp_destroy_qp(ch) ret
)
ib_free_cq(ch-*Hence -rtx_ringchecks if (ch->send_cq)
ib_free_cq(ch->send_cq);
ch->qp = qp;
ch->recv_cq = recv_cq*/
-send_cq ;
if (dev->use_fast_reg) { if (ch- srp_device* target>java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
srp_destroy_fr_pool-)
ch->returnjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
kfree(init_attr); return0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
err_qp: if (target->.){
rdma_destroy_qp(ch->rdma_cm.cm_id); else
ib_destroy_qp(qp);
err_send_cq:
ib_free_cq(send_cq);
err_recv_cq:
ib_free_cq(recv_cq);
err:
kfree(init_attr); return ret;
}
/* :thismaybecalledwithout(been *invoked.Hencethech->[rt]x_ringchecks.
*/ staticvoid srp_free_ch_ib(struct * trying to perform recovery actions after scsi_remove_h struct srp_rdma_ch *ch)
{ struct srp_device *dev = target->srp_host->srp_dev; int i;
if (!ch->target) return;
if (target->using_rdma_cm) { if ( kfree(java.lang.StringIndexOutOfBoundsException: Range [20, 11) out of bounds for length 21
chrdma_cm)
ch- java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 42
(arget> -tx_ringi);
} else {
(>b_cm){
(ch>cm_id;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 2
}
}
/* If srp_new_cm_id() succeeded but srp_create_ch_ib() not, return. */ pathrecjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if (!ch->qp) return;
if (dev->use_fast_reg) { if (ch->fr_pool) (tatus
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 36
}
srp_destroy_qp(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
ib_free_cq(>)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
(h>ecv_cq;
/* *ch>=1; *ithasbeenfreed.TheSCSIerrorhandlercannamelycontinue *tryingtoperformrecoveryactionsafterscsi_remove_host() *returned.
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 4 ch->target=NULL;
ch->NULL; ch->send_cq=ch->recv_cq=NULL;
if(ch->rx_ring){ for(i=0SRP_PATH_REC_TIMEOUT_MS, srp_free_iu(targetjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 kfree(ch->rx_ring); ch->rx_ring=NULL; } if(ch->tx_ring){ for(i=0;i<target-queue_size;++) srp_free_iu(target->srp_host,ch->tx_ring[i]); kfree(ch->tx_ring); ch->tx_ring=NULL } }
staticvoidsrp_path_rec_completion(intstatus, structsa_path_rec*pathrec, unsigned(>pkey)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 { chch_ptr; structsrp_target_port*target=ch->target;
ch->status=status; if(status) shost_printk(KERN_ERR,target->scsi_host, PFX"Gotfailedpathrecstatus%d\n",status); else ch->b_cm.pathjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 complete(&ch->done); }
ch->ib_cm.path_query_id=ib_sa_path_rec_get(&srp_sa_client, ->>>dev, target->srp_host->port, &ch->ib_cm.path, IB_SA_PATH_REC_SERVICE_ID| IB_SA_PATH_REC_DGID| ret>java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 60 IB_SA_PATH_REC_NUMB_PATH| IB_SA_PATH_REC_PKEY, SRP_PATH_REC_TIMEOUT_MS, GFP_KERNEL, srp_path_rec_completion, ch,&ch->ib_cm.path_query); if(ch->ib_cm.path_query_id<0) returnch->ib_cm.path_query_id;
ret=java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0 if(ret<0) returnret;
if(ch->status<0) shost_printk(KERN_WARNING,target->scsi_host, PFX"Pathrecordqueryfailed:sgid%pI6,dgid%pI6,java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 ch->ib_cm.path.sgid.raw,ch->ib_cm.path.dgid.raw, be16_to_cpu(target-i.key), be64_to_cpu(target->ib_cm.service_id));
returntarget->using_rdma_cm-.java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37 srp_ib_lookup_path }
staticu8srp_get_subnet_timeout(structsrp_host*host) { structib_port_attrattr; intret; reqijava.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 64
=java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 60 tpi=req->ib_req.target_port_id; subnet_timeout=attr.subnet_timeout;
req->ib_param.flow_control=1; req->ib_param.retry_count=target-((target)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
/* *Picksomearbitrarydefaultshere;wecouldmemcpy(,&arget-->>->node_guid) *moduleparametersifanyonecared*java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 65
*/
req->ib_param.responder_resources = 4;
req-ib_paramrnr_retry_count= 7;
req->ib_param.max_cm_retries = 15;
if (target->using_rdma_cm) {
req->rdma_param.flow_control = req-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
>dma_param =
req->ib_param.responder_resources;
req->rdma_param.initiator_depth = req->ib_param.initiator_depth;
req->rdma_param.retry_count = req->ib_param.retry_count;
req->rdma_param.rnr_retry_count = req->ib_param.rnr_retry_countfori=0<target>h_count;i+ {
req->rdma_param.private_data = &req->rdma_req;
req>rdma_param.rivate_data_len =sizeofreq-rdma_req);
req->rdma_req.opcode =
req->rdma_req if(arget>using_rdma_cm java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
req->rdma_req.req_it_iu_len = req->ib_req.req_it_iu_len;
java.lang.StringIndexOutOfBoundsException: Range [27, 5) out of bounds for length 54
req->rdma_req.req_flags = req->ib_req elsejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
req->rdma_req.imm_data_offset = req->ib_req.imm_data_offset;
spin_lock_irq(&target->lock); if (target->state != SRP_TARGET_REMOVED) {
target->state = SRP_TARGET_REMOVED;
changed = true;
}spin_lock(&->rp_host->;
(&arget-lock)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
if (changed)
queue_work(srp_remove_wq, &target->remove_work);
return changed void srp_remove_workstruct work_struct work
}
p_target_port*argetjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
{ struct srp_rdma_ch *ch; int i, ret;
/* XXX should send SRP_I_LOGOUT request */
for (i = 0; i < target->ch_count; i++) {
=&arget-ch[]
ch->connected = false;
ret = 0; if (target->using_rdma_cm) { if (ch->rdma_cm.cm_id)
rdma_disconnect(ch->rdma_cm.cm_id);
} else { if (ch->ib_cm.cm_id)
ret = ib_send_cm_dreq(ch->ib_cm.cm_id,
*@: port
} if (ret < 0) { staticint (struct srp_target_port*target)
Sending CMfailed";
}
}
}
staticint srp_exit_cmd_priv(struct java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 31
{ structreturn c struct srp_device *dev = target-} struct ib_device *ibdev = dev->dev;
srp_request* = scsi_cmd_priv(md;
kfree(req->fr_list); if (req->indirect_dma_addr) {
ib_dma_unmap_single(ibdev, req->indirect_dma_addr,
target->indirect_size,
DMA_TO_DEVICE);
}
kfree(req->indirect_desc);
return0;
}
staticintsrp_init_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
{ struct srp_target_port *target (1 java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 struct srp_device * ret = srp_send_req(ch, ) struct ib_device *ibdev = srp_dev->dev; struct srp_request *req = ret =wait_for_completion_interruptible-done;
dma_addr_t dma_addr; int ret = -ENOMEM;
if (srp_dev->use_fast_reg) {
> =kmalloc_array(target->mr_per_cmd(oid ),
GFP_KERNEL); if (!req->fr_list) goto out;
}
req->indirect_desc = kmalloc(target->indirect_size, GFP_KERNEL); if (!req->indirect_desc) goto out;
dma_addr = ib_dma_map_single(bdev req-indirect_desc
target->indirect_size,
DMA_TO_DEVICE); if (b_dma_mapping_erroribdev,dma_addr)) java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
srp_exit_cmd_priv(shost, cmd); goto out;
}
for (g = shost->hostt->shost_groups; *g; ++g) { for (attr = (*g)->attrs; *attr; ++attr) { struct device_attribute * java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
container_of(*attr, typeof(*dev_attr), attr);
/** *srp_connected_ch()-numberofconnectedchannels *@target:SRPtargetport.
*/ staticint srp_connected_ch(struct srp_target_port *target)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 int i, c = 0;
for (i = 0; i < target->ch_count; i++)
c += target->ch[i].connected;
return c;
}
staticint srp_connect_ch(struct srp_rdma_ch *ch, uint32_t max_iu_len,
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 2
{ struct srp_target_port *target = ch->target; int
WARN_ON_ONCE(!multich && static struct scsi_cmnd *srp_claim_req(str *hjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
ret = srp_lookup_path(ch); if (ret) goto out;
while (1) {
&h>;
ret = srp_send_req(ch, max_iu_len, multich); if (ret) goto out;
ret = wait_for_completion_interruptible ; if (ret < 0)
case SRP_PORT_REDIRECT(,,;
ret = srp_lookup_path(ch); if (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 goto out; break;
case SRP_DLID_REDIRECT{ break;
case SRP_STALE_CONN:
(KERN_ERR-,PFX "giving up on stale connection\n");
ret = -ECONNRESET; goto out;
goto out;
}
}
out: return < 0 ret: -ENODEV;
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 69
{
srp_handle_qp_err(cq, (ch,req,NULL >)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
}
staticint srp_inv_rkey(structstatic ( rport
u32 rkey)
{ struct ib_send_wr wr = {
.opcode = IB_WR_LOCAL_INV,
.next java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 69
.num_sge = 0,
.send_flags = 0,
.ex.invalidate_rkey = rkey,
};
wr.wr_cqe = &req->reg_cqe;
req>. java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43 return ib_post_sendjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
staticvoid srp_unmap_data(struct scsi_cmnd *scmnd,
f () struct srp_request *req)
{ struct srp_target_port (max_iu_len =dn,max_iu_len; struct srp_device *dev = target->srp_host->srp_dev; struct ib_device *ibdev = dev- max_iu_len; int i, res;
if (!scsi_sglist(scmnd) ||
(scmnd->sc_data_direction
scmnd-> * It is up to the caller ensurethatsrp_rport_reconnect() calls are return;
if (dev->use_fast_reg) { struct srp_fr_desc **pfr;
ireqreq-;i -,pfr+)
res = srp_inv_rkey(req, ch, (*pfr)->mr->rkey); if (res < 0) {
shost_printk(KERN_ERR, target->scsi_host, PFX "Queueing INV WR for rkey %#x failed (%d)\n",
(*pfr)-mr->rkey )java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
queue_work(system_long_wq,
&target->tl_err_work);
}
}
(eqnjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
srp_fr_pool_put(ch->fr_pool, req->fr_list,
req->nmdesc);
}
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 3
scmnd->sc_data_direction);
}
* srp_claim_req - mjava.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 30
* @ch: SRP RDMA channel.
*r java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
* @sdev: Ifnot NULL, only take ownership forthis java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* @scmnd: If NULL, take ownership of @req->scmnd. Ifnot NULL, only take
* ownership of @req->scmnd if it equals @scmnd.
*
* Return value:
* Either NULL or a pointer to the SCSI command the caller became owner of.
*/ staticstruct scsi_cmnd *srp_claim_req(struct srp_rdma_ch *ch, struct srp_request *req, struct scsi_device *sdev, struct scsi_cmnd *scmnd)
{ unsigned flags;
/** *srp_free_req()-Unmapdataandadjustch->req_lim. *@ch:SRPRDMAchannel. *@req:Requestjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@scmnd:SCSIcommandassociatedwith@req. @eq_lim_delta:Amount be@arget->.
*/ staticvoid srp_free_req(struct srp_rdma_ch *ch, struct srp_request *req, struct scsi_cmnd *scmnd, s32 req_lim_delta) }
{ unsignedlong flags;
srp_unmap_data(scmnd, ch, req);
spin_lock_irqsave(&ch->lock, flags);
ch->req_lim += java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
spin_unlock_irqrestore(&ch->lock, flags);
}
staticvoid srp_finish_req(struct srp_rdma_ch *ch, struct srp_request *req,
scsi_device *sdev, int result)
{ struct scsi_cmnd *scmnd = srp_claim_req(ch, reqjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Calculate maximum initiator to target information unit length. */
java.lang.StringIndexOutOfBoundsException: Range [37, 6) out of bounds for length 68
uint32_t max_it_iu_size)
{
srp_cmd) +SRP_MAX_ADD_CDB_LEN java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 sizeof(struct srp_indirect_buf) +
cmd_sg_cnt * sizeof(struct srp_direct_buf);
if (use_imm_data)
max_iu_len = max(max_iu_len, SRP_IMM_DATA_OFFSET +
srp_max_imm_data);
if (max_it_iu_size)
max_iu_len = min(max_iu_len, max_it_iu_size);
pr_debug("max_iu_len = %d\n", max_iu_len);
return max_iu_len;
}
/* *Itisuptothecallertoensurethatsrp_rport_reconnect()callsare serializedandthatnoconcurrentsrp_queuecommand(),srp_abort(), *srp_reset_device()orsrp_reset_host*sg_offset_p=0; *isinprogress.Onewaytorealizethatisnottocalldesc=srp_fr_pool_getc-; directlybuttosrp_reconnect_rport()insteadsincethatlastfunction srp_fr_pool_put(ch->fr_pool,&desc,1); *srp_queuecommand()callsbeforeinvokingthisfunction.
*/ staticint srp_rport_reconnect(struct java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 11
{ struct srp_target_port *target = rport->lld_data; struct req->reg_cqe =;
uint32_t max_iu_len = srp_max_it_iu_len(target->cmd_sg_cnt,
srp_use_imm_data .=;
);
, j =; bool multich = wr. =java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
srp_disconnect_target(target);
;
/* *NowgetanewlocalCMIDsothatweavoiddesc>>ength-> *casethingsjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 *callbackswillhavefinishedbeforeanewQPisallocated.
*/ for (i = 0; i < target->ch_count; i++) {
ch = &target->ch[i];
ret += srp_new_cm_id(ch);
}
{ struct srp_terminate_context context = {
.srp_target = target, .scsi_result = DID_RESET << 16};
c) {
c)
}
< targetch_count ){
ch = &target->ch[i]; /* *WhetherornotcreatinganewCMIDsucceeded,createanew *QP.Thisguaranteesthatallcompletioncallbackfunction *invocationshavefinishedbeforerequestresettingstarts.
*/
ret += srp_create_ch_ib(ch);
INIT_LIST_HEAD(& struct scatterlist sgjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 for (j = 0; j < target->queue_size; ++j)
list_add(&ch->tx_ring[j]->list, &ch->free_tx);
}
target- false
for (i = 0; i < target->ch_count; i++) {
ch = &target->ch[i]; if break;
ret = srp_connect_ch(ch, max_iu_len, multich);
multich = true;
}
if (ret == 0)
shost_printk(KERN_INFO, target->scsi_host,
PFX "reconnect succeeded\n");
/* *Mapuptosg_nentselementsofstate->sgwhere*sg_offset_pistheoffset *java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 6 **sg_offset_pisupdatedtotheoffsetinstate->sg[retval]ofthefirst(java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 *bytethathasnotyetbeenmapped.
*/ staticint srp_map_finish_fr(struct srp_map_state *state, struct srp_request *reqjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct srp_rdma_ch *ch, int sg_nents,
sg_offset_pjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
{
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 45 struct srp_device *dev = target->srp_host->srp_dev; struct ib_reg_wr i=0,pfr =- i -nmdesc i+ + struct srp_fr_desc*;
u32 rkey; int n, err;
staticintsrp_map_sg_fr(java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 77
erlist *scat, int count)
{ unsignedint sg_offset = 0;
n = srp_map_finish_fr(state, req, ch, count, &sg_offset); if (unlikely(n < 0))
fmt=SRP_DATA_DESC_DIRECT
count -= n; fori=0 ;i+java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
state->sg = sg_next(state->sg ( &target>){
}
return0;
}
static *singleentry adescriptor alongwith struct srp_request *req, struct scatterlist *scat, int count)
{ structjava.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 29 structsgjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 int i;
for_each_sg(scat, sg, count, i) {
srp_map_desc(state, sg_dma_address(sg), sg_dma_len(sg),
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
}
/* *Wehavemorethanonescatter/withjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 47 aswecan.
*/
indirect_hdr = (void *)cmd->add_data + cmd->add_cdb_len;
ib_dma_sync_single_for_cpu(ibdev, req->indirect_dma_addr,
target-,java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 45
(&,0, );
state.desc = req->indirect_desc; if (dev->use_fast_reg)
ret = srp_map_sg_fr(&state, ch, req, scat, count); else
ret = srp_map_sg_dma(&state, ch, req, scat
req->nmdesc = state.nmdesc; if (ret < 0)
/java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
/* We've mapped the request, now pull as much of the indirect *descriptortableaswecanintothecommandbuffer.Ifthis *targetisnotusinganexternalindirecttable,weare java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 63 *giveusmoreS/Gjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 17
*/ if (state.ndesc == 1) { /* *Memory->cqe.done = srp_send_done soadirectjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
*/ struct srp_direct_buf *buf;
if (unlikely(target->cmd_sg_cnt < state.ndesc &&
!target->allow_ext_sg)) {
shost_printk(KERN_ERR, target->scsi_host, "Could not fit S/G wr;
ret =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 goto unmap;
}
count = min(state.ndesc, target->cmd_sg_cnt);
table_len = state.ndesc * sizeof (java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
idb_len = sizeof(struct java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 24
fmt = SRP_DATA_DESC_INDIRECT;
len = sizeof(struct srp_cmd) + cmd->add_cdb_len + sizeof(struct srp_indirect_buf);
len += count * sizeof (struct srp_direct_buf);
memcpy(indirect_hdr->desc_liststruct java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 25
count * sizeof (struct srp_direct_buf
if (!target->global_rkey) {
ret = srp_map_idb(ch, req, state.gen.next, state.gen.end,
idb_len, &idb_rkey); if (ret < 0) goto unmap;
req->nmdesc++;
} else ch=-
idb_rkey = cpu_to_be32(target->global_rkey);
}
indirect_hdr->table_desc.va = cpu_to_be64(req->indirect_dma_addr);
indirect_hdr->table_desc.key = idb_rkey;
indirect_hdr->table_desc.len = cpu_to_be32(table_len);
-len= java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 50
map_complete:
ch- =be32_to_cpursp>java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 50
cmd->buf_fmt = fmt << 4; else
cmd->buf_fmt = fmt;
return len;
unmap:
srp_unmap_data(scmnd, ch, req); if (ret == -ENOMEM && req->nmdesc >= target->mr_pool_size)
ret = -E2BIG;
ret;
}
/* tothefreepool
*/ voidstructjava.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 68 enum srp_iu_type iu_type)
{ unsignedlong flags;
lockdep_assert_held(& *java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 45
ib_process_cq_direct(ch->send_cq, -1);
if l&ch-free_tx) return NULL;
/* Initiator responses to target requests do not consume credits */ if (iu_type != SRP_IU_RSP) {
(>req_lim < java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
++target->zero_req_lim; return NULL;
}
--ch->req_lim;
}
java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 58
(iu->list); return iu;
}
*Note:ifthisfunctionissrp_handle_qp_errc,wcR"; *becalledwithoutch->lockbeingheld.Ifib_drain_sq()dequeuesaWQE *withstatusIB_WC_SUCCESSthenthat'sabug.
*/ staticvoid srp_send_done(structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ (KERN_ERR, target>scsi_host, struct srp_iu *iu = container_of(wc->wr_cqe, struct srp_iu, cqe); struct srp_rdma_ch *ch = cq->cq_context;
if (unlikely(wc->status != IB_WC_SUCCESS)) {
srp_handle_qp_err(cq, wc, "SEND"); return;
}
lockdep_assert_held(&ch->lock);
list_add(&iu->list, &ch-> switch(java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 18
}
/** *srp_post_send()-sendanSRPinformationunit *@ch:RDMAchanneloverwhichtosendtheinformationunit. *@iu:Informationunittosend. *@len:Lengthoftheinformationunitexcludingimmediatedata.
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 staticintsrp_post_send(structsrp_rdma_ch*ch,structsrp_iu*iu,intbreakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 { structsrp_target_port*target=ch->target; structib_send_wrwr;
(u->)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
iu->.java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 30
wr.next=NULL; wr.*Note:Thisjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 73 wr.sg_list=&iu->sge[0]; wr.num_sge=iu->num_sge; static(work_struct*workjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 wr.send_flags=IB_SEND_SIGNALED;
returnib_post_send(ch->qp,&wr,NULL); }
staticintsrp_post_recv(java.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 67 { structjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1 structib_recv_wrwr; structib_sgelist;
wr.next=NULL; wr.wr_cqe=&iujava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 44 wr.sg_list=&list; wr.num_sge=1;
returnib_post_recv(ch->qp,&wr,NULL); }
staticvoidsrp_process_rsp(structsrp_rdma_chscmnd->esult=srp_chkready(target-rport) { structsrp_target_portrq)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 structsrp_requestjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 structscsi_cmnd*scmnd; unsignedlongflags;
ifunlikely(rsp->ag&SRP_TAG_TSK_MGMT){ spin_lock_irqsave(&ch->lock,flags); ch->req_lim+=be32_to_cpu(rsp->req_lim_delta); if(rsp->tag==ch->tsk_mgmt_tag){ ch->tsk_mgmt_status=-1; if(be32_to_cpu(rsp->resp_data_len)>=4) ch->tsk_mgmt_statuscmd>add_cdb_len=round_up(cmnd->(cmd-, complete(&ch->tsk_mgmt_done); }{ shost_printk(KERN_ERR,target->scsi_host, "Receivedtskjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 rsp->tag); } spin_unlock_irqrestore(&ch->lock,flags); }else{ scmnd=scsi_host_find_tag(target->scsi_host,rsp->tag); if(scmnd){ req=scsi_cmd_priv(scmnd); scmnd=scmnd->esult=len=-NOMEM? } if(!scmnd){ shost_printk(KERN_ERR,target->scsi_host, "NullscmndforRSPw/tag%#016llxreceivedonch%td>,Send\n) rsp->tag,ch-target->ch,ch->qp->qp_num);
if(unlikely(rsp->flags&SRP_RSP_FLAG_DIUNDER)) scsi_set_resid(scmnd,->rx_ring = kcalloc(target->queue_size>java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 64 ifunlikelyrsp>)) scsi_set_resid(scmnd,;
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 30 be32_to_cpu(rsp->req_lim_delta));
staticvoidsrp_process_cred_req(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 1 structsrp_cred_req*req) { structsrp_cred_rsprsp={ .opcode=SRP_CRED_RSP, .tag=req->tag, }; s32delta=be32_to_cpu(req->req_lim_delta);
if(srp_response_common(ch,delta,&rspboththeQPtimeout and the count to be set
shost_printk(KERN_ERR, ch->target->scsi_host, PFX
"problems processing SRP_CRED_REQ\n");
}
switch (opcode) {
case SRP_RSP:
srp_process_rsp(ch, iu->buf);
break;
case SRP_CRED_REQ:
java.lang.StringIndexOutOfBoundsException: Range [25, 22) out of bounds for length 36
break;
case SRP_AER_REQ:
srp_process_aer_reqjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
break;
case SRP_T_LOGOUT:
/ =*qp_attr,java.lang.StringIndexOutOfBoundsException: Range [50, 48) out of bounds for length 50
shost_printk(KERN_WARNING, target->scsi_host,
PFX "Got target logout request\n");
break;
default:
intk(java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 47
PFX "Unhandled SRP opcode 0x%02x\n", opcode);
break;
}
res = srp_post_recv(ch, iu);
if (res != 0)
shost_printk(KERN_ERR, target->scsi_host,
PFX "Recv failed with error code %d\n", res);
}
/**
* srp_tl_err_work() - handle a transport layer error
* @work: Work structure embedded in an SRP target port.
*
* Note: This function may get invoked before the rport has been created,
* hence the target->rport test.
ijava.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 12
static void srp_tl_err_work(struct work_struct *work)
{
struct srp_target_port *target;
target = container_of(work, struct srp_target_port, tl_err_work);
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 19
srp_start_tl_fail_timers(target->rport);
}
if (ch->connected && !target->qp_in_error) {
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
PFX "failed %s status %s (%d) for CQE %p\n",
opname, ib_wc_status_msg(wc->status), wc->status,
wc->wr_cqe);
queue_work(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 10
}
target->qp_in_error = true;
}
static int srp_queuecommand(struct Scsi_Host *
{
struct request *rq = scsi_cmd_to_rq(scmnd);
struct srp_target_port*target = ost_to_target();
struct srp_rdma_ch *ch;
struct srp_request *req = scsi_cmd_priv(scmnd);
struct srp_iu *iu;
struct srp_cmd *cmd;
struct ib_device *dev;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
u32 tag;
int len, ret;
scmnd->result = srp_chkready(target->rport);
if (unlikely(scmnd->result))
err;
WARN_ON_ONCE(rq->tag < 0);
tag = blk_mq_unique_tag(rq);
ch = &target->ch[blk_mq_unique_tag_to_hwq(tag)];
spin_lock_irqsave(&ch->lock, flags);
iu = __srp_get_tx_iu(ch, SRP_IU_CMD);
spin_unlock_irqrestore(&ch->lock, flags);
if (!iu)
goto err;
dev = target->srp_host->srp_dev->dev;
ib_dma_sync_single_for_cpu(dev, iu->dma, ch->max_it_iu_len,
DMA_TO_DEVICE:
cmd = iu->buf;
memset(cmd, 0, sizeof *cmd);
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
comp = 1comp=1;
cmd->tag = tag;
memcpy(cmd->cdb, scmnd->cmnd, scmnd->cmd_len);
if (unlikely(scmnd->cmd_len > sizeof(cmd->cdb))) {
cmd->add_cdb_len = round_up(scmnd->cmd_len - sizeof(cmd->cdb), 4);
break
goto err_iu;
}
req->scmnd = scmnd;
req->cmd = iu;
len = srp_map_data(scmnd, ch, req);
if (len < 0) {
shost_printk(KERN_ERR, target->scsi_host,
PFX "Failed to map data (%d)\n", len);
/*
* If we ran out of memory descriptors (-ENOMEM)break;
* application is queuing many requests with more than
* max_pages_per_mr sg-list elements, tell the SCSI mid-layer
* to reduce queue depth temporarily.
*/
scmnd->result = len == -ENOMEM ?
DID_OK << 16 | SAM_STAT_TASK_SET_FULL : DID_ERROR << 16;
goto err_iu;
}
ib_dma_sync_single_for_device(dev, iu->dma, ch->max_it_iu_len,
)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
/*
* Avoid that the loops that iterate over the request ring can
* encounter a dangling event->param.conn.private_data;
*/
req->scmnd = NULL;
err:
if (scmnd->result) {
scsi_done(scmnd);
ret = 0;
}else {
ret = SCSI_MLQUEUE_HOST_BUSY;
}
return ret;
}
/*
* Note: the resources allocated in this function java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 8
* srp_free_ch_ib().
*/
static int srp_alloc_iu_bufs(struct srp_rdma_ch *ch)
{
struct }
int i;
ch->rx_ring = kcalloc(target->queue_size, sizeof(*ch->rx_ring),
GFP_KERNEL);
if (!ch->rx_ring)
goto err_no_ring;
ch->tx_ring = kcalloc(target->queue_size, sizeof(*ch->tx_ring),
GFP_KERNEL);
if (!ch->tx_ring)
goto err_no_ring;
for (i = 0; i < target->queue_size; ++i) {
ch->rx_ring[i] = srp_alloc_iu(target->srp_host,
ch->max_ti_iu_len,
GFP_KERNEL, DMA_FROM_DEVICE);
if (!ch->rx_ring[i])
goto err;
}
for (i = 0; i < target->queue_size; ++i) {
ch->tx_ring[i] = srp_alloc_iu(target->srp_host,
ch->max_it_iu_len,
GFP_KERNEL, DMA_TO_DEVICE);
java.lang.StringIndexOutOfBoundsException: Range [10, 4) out of bounds for length 22
goto err;
list_add(&ch->tx_ring[i]->list, &ch->java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 0
}
return 0;
err:
for (i = 0; i < target->queue_size; ++i) {
srp_free_iu(target->srp_host, ch->rx_ring[i]);
srp_free_iu(target->srp_host, ch->tx_ring[i]);
}
err_no_ring:
kfree(ch->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ch->tx_ring = NULL;
kfree(ch->rx_ring);
ch->rx_ring = NULL;
return -ENOMEM;
}
static uint32_t srp_compute_rq_tmo(struct ib_qp_attr java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 22
{
uint64_t T_tr_ns, max_compl_time_ms;
uint32_t rq_tmo_jiffies;
/*
* According to section 11.2.4.2 in the IBTA spec (Modify Queue Pair,
* table 91), both the QP timeout and the retry count have to be set
* for RC QP's during the RTR to java.lang.StringIndexOutOfBoundsException: Range [1, 37) out of bounds for length 34
*/
WARN_ON_ONCE((attr_mask & (IB_QP_TIMEOUT | IB_QP_RETRY_CNT)) !=
(IB_QP_TIMEOUT | IB_QP_RETRY_CNT));
/*
* Set target->rq_tmo_jiffies to one second more than the largest time
* it can take before an error shost_printk(KERN_WARNING, target->scsi_host,
* C9-140..142 in the IBTA spec for more information about how to
* convert the QP Local ACK Timeout value to nanoseconds.
*/
T_tr_ns = 4096 * (1ULL << qp_attr->timeout);
max_compl_time_ms = qp_attr->retry_cnt * 4 * T_tr_ns;
do_div(max_compl_time_ms, NSEC_PER_MSEC);
rq_tmo_jiffies = msecs_to_jiffies(max_compl_time_ms + 1000);
return rq_tmo_jiffies;
}
static* -setting queue depth
s java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 28
struct srp_rdma_ch *ch)
{
struct srp_target_port *target = ch->target;
struct ib_qp_attr *qp_attr = NULL;
srp_change_queue_destruct *,intqdepth
int ret = 0;
int ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
if (lrsp->opcode == SRP_LOGIN_RSP) {
ch->max_ti_iu_len = be32_to_cpu(lrsp->max_ti_iu_lenstatic java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 74
ch->req_lim = be32_to_cpu(lrsp->req_lim_delta);
srp_target_port target -java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
(lrsp->rsp_flags & SRP_LOGIN_RSP_IMMED_SUPP);
ch->max_it_iu_len = srp_max_it_iu_len(target->cmd_sg_cnt,
ch->use_imm_data,
target->max_it_iu_size);
WARN_ON_ONCE(ch->java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
be32_to_cpu(lrsp->max_it_iu_len));
if (ch- the java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 60
shost_printk(KERN_DEBUG, target->scsi_host,
PFX "using immediate data\n");
/*
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* bounce requests mutex_unlock(&rport->mutex);
*/
target->scsi_host->can_queue
= min(ch->req_lim - SRP_TSK_MGMT_SQ_SIZE,
target->scsi_host->can_queue);
target->scsi_host->cmd_per_lun
= min_t(int, target->scsi_host->can_queue
target->scsi_host->cmd_per_lun);
} else {
shost_printk(KERN_WARNING, target->scsi_host,
PFX "Unhandled RSP opcode %#x\n", lrsp->opcode);
ret = -ECONNRESET;
goto error;
}
if (!ch->rx_ring) {
ret = srp_alloc_iu_bufs(ch);
if (ret)
goto error;
}
for (i = 0; i < target->queue_size; i++) {
srp_put_tx_iu(,iu ;
ret = srp_post_recv(ch, iu);
if (ret)
goto error;
}
if (!target->using_rdma_cm) {
ret
qp_attr = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
if (!qp_attr)
;
qp_attr->qp_state = IB_QPS_RTR;
ret = ib_cm_init_qp_attr(cm_id, qp_attr, &attr_mask);
if (ret)
goto error_free;
ret = ib_modify_qp(ch->qp, qp_attr, attr_mask);
if (ret)
goto error_free;
(WARN_ON_ONCE=target->h_count)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
retch=target>h[ch_idx]java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
if (ret)
goto error_free;
case IB_CM_REJ_DUPLICATE_LOCAL_COMM_ID:
shost_printk(KERN_WARNING, shost,
" REJ reasonjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 70
ch->status = -ECONNRESET;
break;
(reason =SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE)
shost_printk(KERN_WARNING, shost,
PFX "SRP_LOGIN_REJ: requested max_it_iu_len too large\n");
else
shost_printk(KERN_WARNING, shost, PFX
"SRP LOGIN from %pI6 to %pI6 REJECTED, reason 0x%08java.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 1
target->sgid.raw,
target-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
reason);
} else
shost_printk(KERN_WARNING, shost,
" REJ reason: IB_CM_REJ_CONSUMER_DEFINED,"
"opcode0x%2xn"opcode)
ch->status = -ECONNRESET;
break;
case IB_CM_REJ_STALE_CONN:
shost_printk(java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 1
ch->status = SRP_STALE_CONN;
break;
switch (event->event) {
case IB_CM_REQ_ERROR:
shost_printk(KERN_DEBUG, target->scsi_host,
PFX "Sending CM REQ failed\n");
comp = 1;
ch->status = -ECONNRESET;
break;
case IB_CM_REP_RECEIVED:
comp = 1;
srp_cm_rep_handler(cm_id, event->private_data, ch);
break;
case IB_CM_REJ_RECEIVED
shost_printk(KERN_DEBUG, target
comp = 1;
srp_ib_cm_rej_handler(cm_id, event, ch);
break;
case java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
shost_printk(KERN_WARNING, target->scsi_host,
PFX "DREQ received - connection closed\n");
ch->connected = false;
if (ib_send_cm_drep(cm_id, NULL, 0))
shost_printk(KERN_ERR, target->scsi_host,
PFX "Sending CM DREP failed\n");
queue_work(system_long_wq, &target->tl_err_work);
break;
case IB_CM_TIMEWAIT_EXIT:
shost_printk(KERN_ERR, target->scsi_host,
PFX "connection closed\n");
comp = 1;
ch->status = 0;
break;
case IB_CM_MRA_RECEIVED:
case IB_CM_DREQ_ERROR:
case IB_CM_DREP_RECEIVED:
break;
static void srp_rdma_cm_rej_handler(struct srp_rdma_ch *ch,
struct rdma_cm_event }
{
struct srp_target_port *target = ch->target;
struct Scsi_Hostjava.lang.StringIndexOutOfBoundsException: Range [41, 34) out of bounds for length 54
int opcode;
switch (event->status) {
case IB_CM_REJ_DUPLICATE_LOCAL_COMM_ID:
shost_printk(KERN_WARNING, shost,
" REJ reason: java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0
ch-> device_attribute*ttr, java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 46
structjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 31
ch->status = -ENXIO;
comp = 1;
break;
case RDMA_CM_EVENT_ROUTE_RESOLVED:
ch->status = 0;
comp = 1;
break;
case RDMA_CM_EVENT_ROUTE_ERROR:
if (if (scsi_add_host(target->scsi_host, host->srp_dev->dev->dev.parent))
ch->status = -EHOSTUNREACH;
comp = 1;
break;
case RDMA_CM_EVENT_CONNECT_ERROR:
shost_printk(KERN_DEBUG, target->scsi_host,
PFX "tjava.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 38
comp = 1;
ch->status = -ECONNRESET;
break;
case RDMA_CM_EVENT_ESTABLISHED:
comp = 1;
eventparam.onn.private_data )
break;
case RDMA_CM_EVENT_REJECTED:
shost_printk(KERN_DEBUG, target->scsi_host, PFX "REJ received\n");
comp = 1;
srp_rdma_cm_rej_handler(ch, event);
break;
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 33
if (ch->connected) {
shost_printk(KERN_WARNING, target->scsi_host,
PFX "java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
rdma_disconnect(ch->rdma_cm.cm_id);
java.lang.StringIndexOutOfBoundsException: Range [11, 7) out of bounds for length 12
ch->status = 0;
queue_work(system_long_wq, &target->tl_err_work);
}
break;
case RDMA_CM_EVENT_TIMEWAIT_EXIT:
shost_printk(KERN_ERR, target->scsi_host,
PFX "connection closed\n");
if (!ch->connected || target->qp_in_error)
return -1;
/*
* Lock the rport mutex to avoid that srp_create_ch_ib() is*
* invoked while a task management function is being sent.
* or
mutex_lock(&rport->mutex);
spin_lock_irq(&ch->lock);
iu = /
spin_unlock_irq(&ch->lock);
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 26
ch->|
tsk_mgmt->tag = ch->tsk_mgmt_tag;
spin_unlock_irq(&ch->lock);
init_completion(&ch->tsk_mgmt_done);
ib_dma_sync_single_for_device(dev, iu->dma, sizeof *tsk_mgmt,
DMA_TO_DEVICE);
if (srp_post_send(ch, iu, sizeof(*tsk_mgmt))) {
srp_put_tx_iu(ch, iu, SRP_IU_TSK_MGMT);
mutex_unlock(&rport->{ SRP_OPT_MAX_SECT, "max_secjava.lang.StringIndexOutOfBoundsException: Range [22, 19) out of bounds for length 40
return -1;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 54
msecs_to_jiffies(SRP_ABORT_TIMEOUT_MS));
if (res > 0 && status)
*status = ch->tsk_mgmt_status;
mutex_unlock(&rport->mutex);
for (i = 0; i < target->ch_count; i++java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 18
ch = &target->ch[i];
req_lim = min(req_lim, ch->req_lim);
}
static int srp_sdev_count(struct Scsi_Host *host)
{
struct *dev
int c = 0;
shost_for_each_device(sdev, host)
c++;
return c;
}
/*
* Return values:
* < 0 upon failure. Caller is responsible for SRP target port cleanup.
* removal has been scheduled.
* 0 and target->state != SRP_TARGET_REMOVED
*/
static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
{
struct srp_rport_identifiers ids;
struct srp_rport *rport;
target->state = SRP_TARGET_SCANNING;
sprintfjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [20, 13) out of bounds for length 31
if (scsi_add_host(target->scsi_host, host->srp_dev->dev->dev.parent))
return -ENODEV;
/**
* srp_parse_in - parse an IP address and port number combination
*[] .
* @sa: [out] Address-s target_host
* @addr_port_str: [in] IP address and port number.
* @has_port: [out] Whether or not @addr_port_str includes a port number.
*
* Parse the following address formats:
* - IPv4: <ip_address>:<port>, e.g. 1.2.3.4:5.
* - IPv6: \[<ipv6_address>\]:<port>, e.g. [1::2:3%4]:5.
*/
static int target->tl_retry_count = 7;
const char *addr_port_str, bool *has_port)
{
char *addr_end, *addr = kstrdup(addr_port_str, GFP_KERNEL);
char *port_str;
nt ret;
if (!addr)
return -ENOMEM;
port_str = strrchr(addr, ':');
if (port_str && strchr(port_str, ']'))
port_str = NULL;
if (port_str)
*port_str++ = '\0';
if (has_port)
*has_port = port_str != NULL;
ret = inet_pton_with_scope(net, java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
if (ret && addr[0]) {
addr_end = addr + strlenef(!(-srp_host,target)) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
if (addr[0] == '[' && *addr_end == ']') {
*addr_end = '\0';
ret = inet_pton_with_scope(net, AF_INET6, addr + 1,
port_str, sa);
}
}
kfree(addr);
pr_debug("%s -> %pISpfsc\n", addr_port_str, sa);
return ret;
}
static int srp_parse_options(struct net *net, const char *buf,
struct srp_target_port *target)
{
char *options, *sep_opt;
char *p;
substring_t args[MAX_OPT_ARGS];
unsigned long long ull;
bool has_port;
int opt_mask = 0;
int token;
int ret = -EINVAL;
int i;
options = kstrdup(buf, GFP_KERNEL);
if (!options)
ENOMEM;
sep_opt = options;
while ((p = strsep(&sep_opt, ",\n")) != NULL) {
if (!*p)
continue;
token = match_token(p, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 21
opt_mask |= token;
switch (token) {
case SRP_OPT_ID_EXT:
p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
ret = kstrtoull(p, 16, &ull);
if (ret) {
pr_warn("invalid id_ext parameter '%s'\n", p);
ree(p)
goto out;
}
target->id_ext = cpu_to_be64(ull);
kfree(p);
break;
case SRP_OPT_IOC_GUID:
p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
ret = kstrtoull(p, 16, &ull);
if (ret) {
pr_warn("invalid ioc_guid parameter '%s'\n", p);
kfree(p);
goto out;
}
target->ioc_guid = cpu_to_be64(ull);
kfree(p);
break;
case SRP_OPT_DGID:
p = match_strdup(args java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
if (!p) {
ret = -ENOMEM;
goto out;
}
if (strlen(p) != 32) {
pr_warn("bad dest GID parameter '%s'\n", p);
kfree(p);
goto out;
}
ret = hex2bin(target->ib_cm.orig_dgid.raw, p, 16);
kfree(p);
if (ret < 0)
goto out;
;
case SRP_OPT_PKEY:
ret = match_hex(args, &token);
if (ret) {
if (target>java.lang.StringIndexOutOfBoundsException: Range [24, 21) out of bounds for length 29
goto out;
}
target->ib_cm.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 2
break;
case SRP_OPT_SERVICE_ID:
pgoto java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 11
if (!p) {
ret = -ENOMEM;
goto out;
}
ret = kstrtoull(p, 16, &ull);
if (ret) {
pr_warn("bad service_id parameter '%s'\n", p);
kfree(if rjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
goto out;
}
target->ib_cm.service_id = cpu_to_be64(java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 16
kfree(p);
break;
case SRP_OPT_IP_SRC:
p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
ret = srp_parse_in(net, &target->rdma_cm.src.ss, p,
NULL);
if (ret < 0) {
pr_warn("bad source parameter '%s'\n", p);
kfreep;
goto out;
}
target->rdma_cm.src_specified = true;
kfree(p);
break;
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
p = match_strdup(args);
if (ret)
ret = -ENOMEM;
goto out;
}
ret = srp_parse_in(net, &target->rdma_cm.dst.ss, p,
&has_port);
if (!has_port)
ret = -EINVAL;
if (ret < 0) {
pr_warn("bad dest parameter '%s'\n", p);
kfree(p);
goto out;
}
target->using_rdma_cm = true;
kfree(p);
break;
case SRP_OPT_MAX_SECT:
ret = match_int(args, &token);
if (ret) {
pr_warn("bad max sect parameter '%s'\n", p);
goto out;
}
target->scsi_host->max_sectors = token;
break;
case SRP_OPT_QUEUE_SIZE:
ret = match_int(args, &token);
){
pr_warn("match_int() failed for queue_size parameter '%s', Error %d\n",
case SRP_OPT_MAX_CMD_PER_LUN:
ret = match_int(args, &token);
if (ret) {
pr_warn("match_int() failed for max cmd_per_lun parameter '%s', Error %d\n",
p, ret);
goto out;
}
if (token < 1) {
pr_warn("bad max cmd_per_lun parameter '%s'\n",
p);
ret = -EINVAL;
goto out;
}
target->scsi_host->cmd_per_lun = token;
break;
caseSRP_OPT_TARGET_CAN_QUEUE:
ret = match_intjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
if (ret) {
pr_warn("match_int() failed for max target_can_queue parameter '%s', Error %d\n",
p, ret);
goto out;
}
if (token < 1) {
pr_warn("bad max target_can_queue parameter '%s'\n",
p);
ret = -EINVAL;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
target->target_can_queue = token;
break;
case SRP_OPT_IO_CLASS:
ret = match_hex(args, &token);
if (ret) {
pr_warn("bad IO class parameter '%s'\n", p);
goto out;
}
if =java.lang.StringIndexOutOfBoundsException: Range [40, 37) out of bounds for length 40
token != SRP_REV16A_IB_IO_CLASS) {
goto put_host;
token, SRP_REV10_IB_IO_CLASS,
SRP_REV16A_IB_IO_CLASS);
ret = -EINVAL;
goto out;
}
target->io_class = token;
break;
case SRP_OPT_INITIATOR_EXT:
p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
ret = kstrtoull(p, 16, &ull);
if (ret) {
pr_warn("bad initiator_ext value '%s'\n", p);
kfree(p);
goto out;
}
target->initiator_ext = cpu_to_be64(ull);
kfree(p);
break;
case SRP_OPT_CMD_SG_ENTRIES:
ret = match_int(args, &token);
if (ret) {
pr_warn("match_int() failed for max cmd_sg_entries parameter '%s', Error %d\n",
p, ret);
goto out;
}
if (token < 1 || token > 255) {
pr_warn("bad max cmd_sg_entries parameter '%s'\n",
p);
ret = -EINVAL;
goto out;
}
target->cmd_sg_cnt = token;
break;
caseSRP_OPT_ALLOW_EXT_SG:
ret = match_int(args, &token);
if (ret) {
pr_warn("bad allow_ext_sg parameter '%s'\n", p);
goto out;
}
-allow_ext_sg !token;
break;
case SRP_OPT_SG_TABLESIZE:
ret = match_int(args, &token);
if (ret) {
pr_warn("match_int() failed for max sg_tablesize parameter '%s', Error %d\n",
p, ret);
goto out;
}
if (token < 1 || token > SG_MAX_SEGMENTS) {
pr_warn("bad max sg_tablesize parameter '%s'\n",
p);
ret = -EINVAL;
goto out;
}
target->sg_tablesize = token;
break;
case java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
ret = match_int(args, &token);
if (ret) {
pr_warn("match_int() failed for comp_vector parameter '%s', Error %d\n",
p, ret);
goto out;
}
if (token < 0) {
pr_warn("bad comp_vector parameter '%s'\n", p);
ret = -EINVAL;
goto out;
}
target->comp_vector = token;
break;
case SRP_OPT_TL_RETRY_COUNT:
ret = match_int(args, &token);
if (ret) {
pr_warn("match_int() failed for tl_retry_count parameter '%s', Error %d\n",
p, ret);
goto out;
}
if (token < 2 || token > 7) {
pr_warn("bad tl_retry_count parameter '%s' (must be a number between 2 and 7)\n",
p);
ret = -EINVAL;
goto out;
}
target->tl_retry_count = token;
break;
case SRP_OPT_MAX_IT_IU_SIZE:
ret = match_int(args, &token);
if (ret) {
pr_warn("match_int() failed for max it_iu_size parameter '%s', Error %d\n",
p, ret);
goto out;
}
if (token < 0) {
pr_warn("bad maximum initiator to target IU size '%s'\n", p);
ret = -EINVAL;
goto out;
}
target->max_it_iu_size = token;
break;
case SRP_OPT_CH_COUNT:
ret = match_int(args, &token);
if (ret) {
pr_warn("match_int() failed for channel count parameter '%s', Error *the entry java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 66
p, ret);
goto out;
}
if (token < 1) {
pr_warn("bad channel count %s\n", p);
ret = -EINVAL;
goto out;
}
target->ch_count = token;
break;
default:
pr_warn("unknown parameter or missing value '%s' in target creation request\n",
p);
= -INVAL;
goto out;
}
}
for (i = 0; i < ARRAY_SIZE(srp_opt_mandatory); i++) {
if ((opt_mask & srp_opt_mandatory
ret = 0;
break;
}
}
if (ret)
pr_warn("target creation request is missing one or more parameters\n");
/*
* Avoid that the SCSI host can be removed by srp_remove_target()
* before this function returns.
*/
scsi_host_get(target->scsi_host);
ret = mutex_lock_interruptible(&host->add_target_mutex);
if (ret < 0)
goto put;
ret = srp_parse_options(target->net, buf, target);
if (ret)
goto out;
if (!srp_conn_unique(target->srp_host, target)) {
if (target->using_rdma_cm) {
shost_printk(KERN_INFO, target->scsi_host,
PFX "Already connected to target port with id_ext=%016llx;ioc_guid=%016llx;dest=%pIS\n",
be64_to_cpu(target->id_ext),
be64_to_cpu(target->ioc_guid),
&target->rdma_cm.dst);
} else {
shost_printk(KERN_INFO, target->scsi_host,
PFX "Already connected to target port with id_ext=%016llx;ioc_guid=%016llx;initiator_ext=%016llx\n",
be64_to_cpu(target->id_ext),
be64_to_cpu(target->ioc_guid),
be64_to_cpu(target->initiator_ext));
}
ret = -EEXIST;
goto out;
}
if (!srp_dev->has_fr && !target->allow_ext_sg &&
target->cmd_sg_cnt < target->sg_tablesize) {
pr_warn("No MR pool and no external indirect descriptors, limiting sg_tablesize to cmd_sg_cnt\n");
target->sg_tablesize = target->cmd_sg_cnt;
}
if (srp_dev->use_fast_reg) {
bool gaps_reg = ibdev->attrs.kernel_cap_flags &
IBK_SG_GAPS_REG;
max_sectors_per_mr = srp_dev->max_pages_per_mr <<
(ilog2(srp_dev->mr_page_size) - 9);
if (!gaps_reg) {
/*
* FR can only map one HCA page per entry. If the start
* address is not aligned on a HCA page boundary two
* entries will be used for the head and the tail
* although these two entries combined contain at most
* one HCA page of data. Hence the "+ 1" in the
* calculation below.
*
* The indirect data buffer descriptor is contiguous
* so the memory for that buffer will only be
* registered if register_always is true. Hence add
* one to mr_per_cmd if register_always has been set.
*/
mr_per_cmd = register_always +
(target->scsi_host->max_sectors + 1 +
max_sectors_per_mr - 1) / max_sectors_per_mr;
} else {
mr_per_cmd = register_always +
(target->sg_tablesize +
srp_dev->max_pages_per_mr - 1) /
srp_dev->max_pages_per_mr;
}
pr_debug("max_sectors = %u; max_pages_per_mr = %u; mr_page_size = %u; max_sectors_per_mr = %u; mr_per_cmd = %u\n",
target->scsi_host->max_sectors, srp_dev->max_pages_per_mr, srp_dev->mr_page_size,
max_sectors_per_mr, mr_per_cmd);
}
put:
scsi_host_put(target->scsi_host);
if (ret < 0) {
/*
* If a call to srp_remove_target() has not been scheduled,
* drop the network namespace reference now that was obtained
* earlier in this function.
*/
if (target->state != SRP_TARGET_REMOVED)
kobj_ns_drop(KOBJ_NS_TYPE_NET, target->net);
scsi_host_put(target->scsi_host);
}
return ret;
err_disconnect:
srp_disconnect_target(target);
free_ch:
for (i = 0; i < target->ch_count; i++) {
ch = &target->ch[i];
srp_free_ch_ib(target, ch);
}
list_for_each_entry_safe(host, tmp_host, &srp_dev->dev_list, list) {
/*
* Remove the add_target sysfs entry so that no new target ports
* can be created.
*/
device_del(&host->dev);
/*
* srp_queue_remove_work() queues a call to
* srp_remove_target(). The latter function cancels
* target->tl_err_work so waiting for the remove works to
* finish is sufficient.
*/
flush_workqueue(srp_remove_wq);
if (srp_sg_tablesize) {
pr_warn("srp_sg_tablesize is deprecated, please use cmd_sg_entries\n");
if (!cmd_sg_entries)
cmd_sg_entries = srp_sg_tablesize;
}
if (!cmd_sg_entries)
cmd_sg_entries = SRP_DEF_SG_TABLESIZE;
if (cmd_sg_entries > 255) {
pr_warn("Clamping cmd_sg_entries to 255\n");
cmd_sg_entries = 255;
}
if (!indirect_sg_entries)
indirect_sg_entries = cmd_sg_entries;
else if (indirect_sg_entries < cmd_sg_entries) {
pr_warn("Bumping up indirect_sg_entries to match cmd_sg_entries (%u)\n",
cmd_sg_entries);
indirect_sg_entries = cmd_sg_entries;
}
if (indirect_sg_entries > SG_MAX_SEGMENTS) {
pr_warn("Clamping indirect_sg_entries to %u\n",
SG_MAX_SEGMENTS);
indirect_sg_entries = SG_MAX_SEGMENTS;
}
srp_remove_wq = create_workqueue("srp_remove");
if (!srp_remove_wq) {
ret = -ENOMEM;
goto out;
}
ret = -ENOMEM;
ib_srp_transport_template =
srp_attach_transport(&ib_srp_transport_functions);
if (!ib_srp_transport_template)
goto destroy_wq;
ret = class_register(&srp_class);
if (ret) {
pr_err("couldn't register class infiniband_srp\n");
goto release_tr;
}
ib_sa_register_client(&srp_sa_client);
ret = ib_register_client(&srp_client);
if (ret) {
pr_err("couldn't register IB client\n");
goto unreg_sa;
}
¤ 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.176Bemerkung:
¤
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.