• Home
  • Raw
  • Download

Lines Matching refs:tq

246 static inline unsigned int txq_avail(const struct sge_txq *tq)  in txq_avail()  argument
248 return tq->size - 1 - tq->in_use; in txq_avail()
316 const struct ulptx_sgl *sgl, const struct sge_txq *tq) in unmap_sgl() argument
335 if (likely((u8 *)(p + 1) <= (u8 *)tq->stat)) { in unmap_sgl()
342 } else if ((u8 *)p == (u8 *)tq->stat) { in unmap_sgl()
343 p = (const struct ulptx_sge_pair *)tq->desc; in unmap_sgl()
345 } else if ((u8 *)p + 8 == (u8 *)tq->stat) { in unmap_sgl()
346 const __be64 *addr = (const __be64 *)tq->desc; in unmap_sgl()
354 const __be64 *addr = (const __be64 *)tq->desc; in unmap_sgl()
366 if ((u8 *)p == (u8 *)tq->stat) in unmap_sgl()
367 p = (const struct ulptx_sge_pair *)tq->desc; in unmap_sgl()
368 addr = ((u8 *)p + 16 <= (u8 *)tq->stat in unmap_sgl()
370 : *(const __be64 *)tq->desc); in unmap_sgl()
386 static void free_tx_desc(struct adapter *adapter, struct sge_txq *tq, in free_tx_desc() argument
390 unsigned int cidx = tq->cidx; in free_tx_desc()
395 sdesc = &tq->sdesc[cidx]; in free_tx_desc()
403 unmap_sgl(dev, sdesc->skb, sdesc->sgl, tq); in free_tx_desc()
409 if (++cidx == tq->size) { in free_tx_desc()
411 sdesc = tq->sdesc; in free_tx_desc()
414 tq->cidx = cidx; in free_tx_desc()
420 static inline int reclaimable(const struct sge_txq *tq) in reclaimable() argument
422 int hw_cidx = be16_to_cpu(tq->stat->cidx); in reclaimable()
423 int reclaimable = hw_cidx - tq->cidx; in reclaimable()
425 reclaimable += tq->size; in reclaimable()
440 struct sge_txq *tq, in reclaim_completed_tx() argument
443 int avail = reclaimable(tq); in reclaim_completed_tx()
453 free_tx_desc(adapter, tq, avail, unmap); in reclaim_completed_tx()
454 tq->in_use -= avail; in reclaim_completed_tx()
885 static void write_sgl(const struct sk_buff *skb, struct sge_txq *tq, in write_sgl() argument
914 to = (u8 *)end > (u8 *)tq->stat ? buf : sgl->sge; in write_sgl()
927 if (unlikely((u8 *)end > (u8 *)tq->stat)) { in write_sgl()
928 unsigned int part0 = (u8 *)tq->stat - (u8 *)sgl->sge, part1; in write_sgl()
932 part1 = (u8 *)end - (u8 *)tq->stat; in write_sgl()
933 memcpy(tq->desc, (u8 *)buf + part0, part1); in write_sgl()
934 end = (void *)tq->desc + part1; in write_sgl()
948 static inline void ring_tx_db(struct adapter *adapter, struct sge_txq *tq, in ring_tx_db() argument
955 WARN_ON((QID(tq->cntxt_id) | PIDX(n)) & DBPRIO); in ring_tx_db()
958 QID(tq->cntxt_id) | PIDX(n)); in ring_tx_db()
972 static void inline_tx_skb(const struct sk_buff *skb, const struct sge_txq *tq, in inline_tx_skb() argument
976 int left = (void *)tq->stat - pos; in inline_tx_skb()
986 skb_copy_bits(skb, left, tq->desc, skb->len - left); in inline_tx_skb()
987 pos = (void *)tq->desc + (skb->len - left); in inline_tx_skb()
1057 static inline void txq_advance(struct sge_txq *tq, unsigned int n) in txq_advance() argument
1059 tq->in_use += n; in txq_advance()
1060 tq->pidx += n; in txq_advance()
1061 if (tq->pidx >= tq->size) in txq_advance()
1062 tq->pidx -= tq->size; in txq_advance()
1314 struct sge_txq *tq = &txq->q; in t4vf_eth_xmit() local
1324 if (unlikely((void *)sgl == (void *)tq->stat)) { in t4vf_eth_xmit()
1325 sgl = (void *)tq->desc; in t4vf_eth_xmit()
1326 end = (void *)((void *)tq->desc + in t4vf_eth_xmit()
1327 ((void *)end - (void *)tq->stat)); in t4vf_eth_xmit()
1330 write_sgl(skb, tq, sgl, end, 0, addr); in t4vf_eth_xmit()
1333 last_desc = tq->pidx + ndesc - 1; in t4vf_eth_xmit()
1334 if (last_desc >= tq->size) in t4vf_eth_xmit()
1335 last_desc -= tq->size; in t4vf_eth_xmit()
1336 tq->sdesc[last_desc].skb = skb; in t4vf_eth_xmit()
1337 tq->sdesc[last_desc].sgl = sgl; in t4vf_eth_xmit()
2296 static void free_txq(struct adapter *adapter, struct sge_txq *tq) in free_txq() argument
2299 tq->size * sizeof(*tq->desc) + STAT_LEN, in free_txq()
2300 tq->desc, tq->phys_addr); in free_txq()
2301 tq->cntxt_id = 0; in free_txq()
2302 tq->sdesc = NULL; in free_txq()
2303 tq->desc = NULL; in free_txq()