Lines Matching refs:t
128 aoehdr_atainit(struct aoedev *d, struct aoetgt *t, struct aoe_hdr *h) in aoehdr_atainit() argument
132 memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src); in aoehdr_atainit()
133 memcpy(h->dst, t->addr, sizeof h->dst); in aoehdr_atainit()
156 ifrotate(struct aoetgt *t) in ifrotate() argument
160 ifp = t->ifp; in ifrotate()
162 if (ifp >= &t->ifs[NAOEIFS] || ifp->nd == NULL) in ifrotate()
163 ifp = t->ifs; in ifrotate()
166 return t->ifp = ifp; in ifrotate()
194 struct aoetgt *t; in aoe_freetframe() local
196 t = f->t; in aoe_freetframe()
201 list_add(&f->head, &t->ffree); in aoe_freetframe()
205 newtframe(struct aoedev *d, struct aoetgt *t) in newtframe() argument
211 if (list_empty(&t->ffree)) { in newtframe()
212 if (t->falloc >= NSKBPOOLMAX*2) in newtframe()
217 t->falloc++; in newtframe()
218 f->t = t; in newtframe()
220 pos = t->ffree.next; in newtframe()
252 struct aoetgt *t, **tt; in newframe() local
266 t = *tt; in newframe()
267 if (!t->taint) { in newframe()
269 totout += t->nout; in newframe()
271 if (t->nout < t->maxout in newframe()
272 && (use_tainted || !t->taint) in newframe()
273 && t->ifp->nd) { in newframe()
274 f = newtframe(d, t); in newframe()
276 ifrotate(t); in newframe()
309 struct aoedev *d = f->t->d; in fhash()
319 struct aoetgt *t; in ata_rw_frameinit() local
334 t = f->t; in ata_rw_frameinit()
335 f->tag = aoehdr_atainit(t->d, t, h); in ata_rw_frameinit()
337 t->nout++; in ata_rw_frameinit()
344 if (t->d->flags & DEVFL_EXT) { in ata_rw_frameinit()
357 t->wpkts++; in ata_rw_frameinit()
359 t->rpkts++; in ata_rw_frameinit()
364 skb->dev = t->ifp->nd; in ata_rw_frameinit()
456 struct aoetgt *t; in resend() local
460 t = f->t; in resend()
463 if (ifrotate(t) == NULL) { in resend()
476 h->src, h->dst, t->nout); in resend()
483 memcpy(h->dst, t->addr, sizeof h->dst); in resend()
484 memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src); in resend()
486 skb->dev = t->ifp->nd; in resend()
525 getif(struct aoetgt *t, struct net_device *nd) in getif() argument
529 p = t->ifs; in getif()
538 ejectif(struct aoetgt *t, struct aoeif *ifp) in ejectif() argument
545 e = t->ifs + NAOEIFS - 1; in ejectif()
558 nf = newframe(f->t->d); in reassign_frame()
561 if (nf->t == f->t) { in reassign_frame()
579 probe(struct aoetgt *t) in probe() argument
588 d = t->d; in probe()
589 f = newtframe(d, t); in probe()
593 t->addr, in probe()
599 ifrotate(t); in probe()
600 f->iter.bi_size = t->d->maxbcnt ? t->d->maxbcnt : DEFAULTBCNT; in probe()
626 long t; in rto() local
628 t = 2 * d->rttavg >> RTTSCALE; in rto()
629 t += 8 * d->rttdev >> RTTDSCALE; in rto()
630 if (t == 0) in rto()
631 t = 1; in rto()
633 return t; in rto()
639 struct aoetgt *t; in rexmit_deferred() local
651 t = f->t; in rexmit_deferred()
652 if (t->taint) { in rexmit_deferred()
656 if (t->nout_probes == 0 in rexmit_deferred()
658 probe(t); in rexmit_deferred()
659 t->nout_probes++; in rexmit_deferred()
665 t = f->t; in rexmit_deferred()
670 } else if (tsince_hr(f) < t->taint * rto(d)) { in rexmit_deferred()
679 f->t->d->flags |= DEVFL_KICKME; in rexmit_deferred()
682 if (t->nout >= t->maxout) in rexmit_deferred()
685 t->nout++; in rexmit_deferred()
687 t->nout_probes++; in rexmit_deferred()
699 scorn(struct aoetgt *t) in scorn() argument
703 n = t->taint++; in scorn()
704 t->taint += t->taint * 2; in scorn()
705 if (n > t->taint) in scorn()
706 t->taint = n; in scorn()
707 if (t->taint > MAX_TAINT) in scorn()
708 t->taint = MAX_TAINT; in scorn()
729 struct aoetgt *t; in rexmit_timer() local
785 t = f->t; in rexmit_timer()
790 scorn(t); /* avoid this target */ in rexmit_timer()
792 if (t->maxout != 1) { in rexmit_timer()
793 t->ssthresh = t->maxout / 2; in rexmit_timer()
794 t->maxout = 1; in rexmit_timer()
798 t->nout_probes--; in rexmit_timer()
800 ifp = getif(t, f->skb->dev); in rexmit_timer()
801 if (ifp && ++ifp->lost > (t->nframes << 1) in rexmit_timer()
802 && (ifp != t->ifs || t->ifs[1].nd)) { in rexmit_timer()
803 ejectif(t, ifp); in rexmit_timer()
808 t->nout--; in rexmit_timer()
918 ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id) in ataid_complete() argument
960 t->addr, in ataid_complete()
975 calc_rttavg(struct aoedev *d, struct aoetgt *t, int rtt) in calc_rttavg() argument
989 if (!t || t->maxout >= t->nframes) in calc_rttavg()
991 if (t->maxout < t->ssthresh) in calc_rttavg()
992 t->maxout += 1; in calc_rttavg()
993 else if (t->nout == t->maxout && t->next_cwnd-- == 0) { in calc_rttavg()
994 t->maxout += 1; in calc_rttavg()
995 t->next_cwnd = t->maxout; in calc_rttavg()
1002 struct aoetgt **t, **e; in gettgt() local
1004 t = d->targets; in gettgt()
1005 e = t + d->ntargets; in gettgt()
1006 for (; t < e && *t; t++) in gettgt()
1007 if (memcmp((*t)->addr, addr, sizeof((*t)->addr)) == 0) in gettgt()
1008 return *t; in gettgt()
1073 struct aoetgt *t; in ktiocomplete() local
1082 t = f->t; in ktiocomplete()
1083 d = t->d; in ktiocomplete()
1132 ifp = getif(t, skb->dev); in ktiocomplete()
1148 ataid_complete(d, t, skb->data); in ktiocomplete()
1159 if (t->taint > 0 in ktiocomplete()
1160 && --t->taint > 0 in ktiocomplete()
1161 && t->nout_probes == 0) { in ktiocomplete()
1164 probe(t); in ktiocomplete()
1165 t->nout_probes++; in ktiocomplete()
1202 actual_id = f->t->d->aoeminor % ncpus; in ktio()
1275 id = f->t->d->aoeminor % ncpus; in ktcomplete()
1318 calc_rttavg(d, f->t, tsince_hr(f)); in aoecmd_ata_rsp()
1319 f->t->nout--; in aoecmd_ata_rsp()
1321 f->t->nout_probes--; in aoecmd_ata_rsp()
1373 struct aoetgt *t; in aoecmd_ata_id() local
1379 t = *d->tgt; in aoecmd_ata_id()
1387 f->tag = aoehdr_atainit(d, t, h); in aoecmd_ata_id()
1389 t->nout++; in aoecmd_ata_id()
1398 skb->dev = t->ifp->nd; in aoecmd_ata_id()
1434 struct aoetgt *t, **tt, **te; in addtgt() local
1446 t = kzalloc(sizeof(*t), GFP_ATOMIC); in addtgt()
1447 if (!t) in addtgt()
1449 t->nframes = nframes; in addtgt()
1450 t->d = d; in addtgt()
1451 memcpy(t->addr, addr, sizeof t->addr); in addtgt()
1452 t->ifp = t->ifs; in addtgt()
1453 aoecmd_wreset(t); in addtgt()
1454 t->maxout = t->nframes / 2; in addtgt()
1455 INIT_LIST_HEAD(&t->ffree); in addtgt()
1456 return *tt = t; in addtgt()
1466 struct aoetgt **t, **e; in setdbcnt() local
1469 t = d->targets; in setdbcnt()
1470 e = t + d->ntargets; in setdbcnt()
1471 for (; t < e && *t; t++) in setdbcnt()
1472 if (bcnt == 0 || bcnt > (*t)->minbcnt) in setdbcnt()
1473 bcnt = (*t)->minbcnt; in setdbcnt()
1482 setifbcnt(struct aoetgt *t, struct net_device *nd, int bcnt) in setifbcnt() argument
1488 d = t->d; in setifbcnt()
1490 p = t->ifs; in setifbcnt()
1510 t->minbcnt = minbcnt; in setifbcnt()
1520 struct aoetgt *t; in aoecmd_cfg_rsp() local
1563 t = gettgt(d, h->src); in aoecmd_cfg_rsp()
1564 if (t) { in aoecmd_cfg_rsp()
1565 t->nframes = n; in aoecmd_cfg_rsp()
1566 if (n < t->maxout) in aoecmd_cfg_rsp()
1567 aoecmd_wreset(t); in aoecmd_cfg_rsp()
1569 t = addtgt(d, h->src, n); in aoecmd_cfg_rsp()
1570 if (!t) in aoecmd_cfg_rsp()
1579 setifbcnt(t, skb->dev, n); in aoecmd_cfg_rsp()
1597 aoecmd_wreset(struct aoetgt *t) in aoecmd_wreset() argument
1599 t->maxout = 1; in aoecmd_wreset()
1600 t->ssthresh = t->nframes / 2; in aoecmd_wreset()
1601 t->next_cwnd = t->nframes; in aoecmd_wreset()
1607 struct aoetgt **t, **te; in aoecmd_cleanslate() local
1613 t = d->targets; in aoecmd_cleanslate()
1614 te = t + d->ntargets; in aoecmd_cleanslate()
1615 for (; t < te && *t; t++) in aoecmd_cleanslate()
1616 aoecmd_wreset(*t); in aoecmd_cleanslate()
1658 d = f->t->d; in aoe_flush_iocq_by_index()