Lines Matching refs:t

129 aoehdr_atainit(struct aoedev *d, struct aoetgt *t, struct aoe_hdr *h)  in aoehdr_atainit()  argument
133 memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src); in aoehdr_atainit()
134 memcpy(h->dst, t->addr, sizeof h->dst); in aoehdr_atainit()
157 ifrotate(struct aoetgt *t) in ifrotate() argument
161 ifp = t->ifp; in ifrotate()
163 if (ifp >= &t->ifs[NAOEIFS] || ifp->nd == NULL) in ifrotate()
164 ifp = t->ifs; in ifrotate()
167 return t->ifp = ifp; in ifrotate()
195 struct aoetgt *t; in aoe_freetframe() local
197 t = f->t; in aoe_freetframe()
202 list_add(&f->head, &t->ffree); in aoe_freetframe()
206 newtframe(struct aoedev *d, struct aoetgt *t) in newtframe() argument
212 if (list_empty(&t->ffree)) { in newtframe()
213 if (t->falloc >= NSKBPOOLMAX*2) in newtframe()
218 t->falloc++; in newtframe()
219 f->t = t; in newtframe()
221 pos = t->ffree.next; in newtframe()
253 struct aoetgt *t, **tt; in newframe() local
267 t = *tt; in newframe()
268 if (!t->taint) { in newframe()
270 totout += t->nout; in newframe()
272 if (t->nout < t->maxout in newframe()
273 && (use_tainted || !t->taint) in newframe()
274 && t->ifp->nd) { in newframe()
275 f = newtframe(d, t); in newframe()
277 ifrotate(t); in newframe()
310 struct aoedev *d = f->t->d; in fhash()
320 struct aoetgt *t; in ata_rw_frameinit() local
335 t = f->t; in ata_rw_frameinit()
336 f->tag = aoehdr_atainit(t->d, t, h); in ata_rw_frameinit()
338 t->nout++; in ata_rw_frameinit()
345 if (t->d->flags & DEVFL_EXT) { in ata_rw_frameinit()
358 t->wpkts++; in ata_rw_frameinit()
360 t->rpkts++; in ata_rw_frameinit()
365 skb->dev = t->ifp->nd; in ata_rw_frameinit()
458 struct aoetgt *t; in resend() local
462 t = f->t; in resend()
465 if (ifrotate(t) == NULL) { in resend()
478 h->src, h->dst, t->nout); in resend()
485 memcpy(h->dst, t->addr, sizeof h->dst); in resend()
486 memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src); in resend()
488 skb->dev = t->ifp->nd; in resend()
544 getif(struct aoetgt *t, struct net_device *nd) in getif() argument
548 p = t->ifs; in getif()
557 ejectif(struct aoetgt *t, struct aoeif *ifp) in ejectif() argument
564 e = t->ifs + NAOEIFS - 1; in ejectif()
577 nf = newframe(f->t->d); in reassign_frame()
580 if (nf->t == f->t) { in reassign_frame()
599 probe(struct aoetgt *t) in probe() argument
608 d = t->d; in probe()
609 f = newtframe(d, t); in probe()
613 t->addr, in probe()
619 ifrotate(t); in probe()
620 f->iter.bi_size = t->d->maxbcnt ? t->d->maxbcnt : DEFAULTBCNT; in probe()
647 long t; in rto() local
649 t = 2 * d->rttavg >> RTTSCALE; in rto()
650 t += 8 * d->rttdev >> RTTDSCALE; in rto()
651 if (t == 0) in rto()
652 t = 1; in rto()
654 return t; in rto()
660 struct aoetgt *t; in rexmit_deferred() local
672 t = f->t; in rexmit_deferred()
673 if (t->taint) { in rexmit_deferred()
677 if (t->nout_probes == 0 in rexmit_deferred()
679 probe(t); in rexmit_deferred()
680 t->nout_probes++; in rexmit_deferred()
686 t = f->t; in rexmit_deferred()
691 } else if (tsince_hr(f) < t->taint * rto(d)) { in rexmit_deferred()
700 f->t->d->flags |= DEVFL_KICKME; in rexmit_deferred()
703 if (t->nout >= t->maxout) in rexmit_deferred()
706 t->nout++; in rexmit_deferred()
708 t->nout_probes++; in rexmit_deferred()
720 scorn(struct aoetgt *t) in scorn() argument
724 n = t->taint++; in scorn()
725 t->taint += t->taint * 2; in scorn()
726 if (n > t->taint) in scorn()
727 t->taint = n; in scorn()
728 if (t->taint > MAX_TAINT) in scorn()
729 t->taint = MAX_TAINT; in scorn()
750 struct aoetgt *t; in rexmit_timer() local
806 t = f->t; in rexmit_timer()
811 scorn(t); /* avoid this target */ in rexmit_timer()
813 if (t->maxout != 1) { in rexmit_timer()
814 t->ssthresh = t->maxout / 2; in rexmit_timer()
815 t->maxout = 1; in rexmit_timer()
819 t->nout_probes--; in rexmit_timer()
821 ifp = getif(t, f->skb->dev); in rexmit_timer()
822 if (ifp && ++ifp->lost > (t->nframes << 1) in rexmit_timer()
823 && (ifp != t->ifs || t->ifs[1].nd)) { in rexmit_timer()
824 ejectif(t, ifp); in rexmit_timer()
829 t->nout--; in rexmit_timer()
991 ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id) in ataid_complete() argument
1033 t->addr, in ataid_complete()
1049 calc_rttavg(struct aoedev *d, struct aoetgt *t, int rtt) in calc_rttavg() argument
1063 if (!t || t->maxout >= t->nframes) in calc_rttavg()
1065 if (t->maxout < t->ssthresh) in calc_rttavg()
1066 t->maxout += 1; in calc_rttavg()
1067 else if (t->nout == t->maxout && t->next_cwnd-- == 0) { in calc_rttavg()
1068 t->maxout += 1; in calc_rttavg()
1069 t->next_cwnd = t->maxout; in calc_rttavg()
1076 struct aoetgt **t, **e; in gettgt() local
1078 t = d->targets; in gettgt()
1079 e = t + d->ntargets; in gettgt()
1080 for (; t < e && *t; t++) in gettgt()
1081 if (memcmp((*t)->addr, addr, sizeof((*t)->addr)) == 0) in gettgt()
1082 return *t; in gettgt()
1145 struct aoetgt *t; in ktiocomplete() local
1154 t = f->t; in ktiocomplete()
1155 d = t->d; in ktiocomplete()
1203 ifp = getif(t, skb->dev); in ktiocomplete()
1219 ataid_complete(d, t, skb->data); in ktiocomplete()
1230 if (t->taint > 0 in ktiocomplete()
1231 && --t->taint > 0 in ktiocomplete()
1232 && t->nout_probes == 0) { in ktiocomplete()
1235 probe(t); in ktiocomplete()
1236 t->nout_probes++; in ktiocomplete()
1273 actual_id = f->t->d->aoeminor % ncpus; in ktio()
1346 id = f->t->d->aoeminor % ncpus; in ktcomplete()
1389 calc_rttavg(d, f->t, tsince_hr(f)); in aoecmd_ata_rsp()
1390 f->t->nout--; in aoecmd_ata_rsp()
1392 f->t->nout_probes--; in aoecmd_ata_rsp()
1444 struct aoetgt *t; in aoecmd_ata_id() local
1450 t = *d->tgt; in aoecmd_ata_id()
1458 f->tag = aoehdr_atainit(d, t, h); in aoecmd_ata_id()
1460 t->nout++; in aoecmd_ata_id()
1469 skb->dev = t->ifp->nd; in aoecmd_ata_id()
1507 struct aoetgt *t, **tt, **te; in addtgt() local
1519 t = kzalloc(sizeof(*t), GFP_ATOMIC); in addtgt()
1520 if (!t) in addtgt()
1522 t->nframes = nframes; in addtgt()
1523 t->d = d; in addtgt()
1524 memcpy(t->addr, addr, sizeof t->addr); in addtgt()
1525 t->ifp = t->ifs; in addtgt()
1526 aoecmd_wreset(t); in addtgt()
1527 t->maxout = t->nframes / 2; in addtgt()
1528 INIT_LIST_HEAD(&t->ffree); in addtgt()
1529 return *tt = t; in addtgt()
1539 struct aoetgt **t, **e; in setdbcnt() local
1542 t = d->targets; in setdbcnt()
1543 e = t + d->ntargets; in setdbcnt()
1544 for (; t < e && *t; t++) in setdbcnt()
1545 if (bcnt == 0 || bcnt > (*t)->minbcnt) in setdbcnt()
1546 bcnt = (*t)->minbcnt; in setdbcnt()
1555 setifbcnt(struct aoetgt *t, struct net_device *nd, int bcnt) in setifbcnt() argument
1561 d = t->d; in setifbcnt()
1563 p = t->ifs; in setifbcnt()
1583 t->minbcnt = minbcnt; in setifbcnt()
1593 struct aoetgt *t; in aoecmd_cfg_rsp() local
1636 t = gettgt(d, h->src); in aoecmd_cfg_rsp()
1637 if (t) { in aoecmd_cfg_rsp()
1638 t->nframes = n; in aoecmd_cfg_rsp()
1639 if (n < t->maxout) in aoecmd_cfg_rsp()
1640 aoecmd_wreset(t); in aoecmd_cfg_rsp()
1642 t = addtgt(d, h->src, n); in aoecmd_cfg_rsp()
1643 if (!t) in aoecmd_cfg_rsp()
1652 setifbcnt(t, skb->dev, n); in aoecmd_cfg_rsp()
1670 aoecmd_wreset(struct aoetgt *t) in aoecmd_wreset() argument
1672 t->maxout = 1; in aoecmd_wreset()
1673 t->ssthresh = t->nframes / 2; in aoecmd_wreset()
1674 t->next_cwnd = t->nframes; in aoecmd_wreset()
1680 struct aoetgt **t, **te; in aoecmd_cleanslate() local
1686 t = d->targets; in aoecmd_cleanslate()
1687 te = t + d->ntargets; in aoecmd_cleanslate()
1688 for (; t < te && *t; t++) in aoecmd_cleanslate()
1689 aoecmd_wreset(*t); in aoecmd_cleanslate()
1731 d = f->t->d; in aoe_flush_iocq_by_index()