lkml.org 
[lkml]   [2012]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC v2 1/2] PCI-Express Non-Transparent Bridge Support
From
On Sun, Jul 29, 2012 at 8:26 PM, Jon Mason <jon.mason@intel.com> wrote:

<snip>

> +static void ntb_tx_copy_task(struct ntb_transport_qp *qp,
> + struct ntb_queue_entry *entry,
> + void *offset)
> +{
> + struct ntb_payload_header *hdr = offset;
> +
> + offset += sizeof(struct ntb_payload_header);
> + memcpy_toio(offset, entry->buf, entry->len);
> +
> + hdr->len = entry->len;
> + hdr->ver = qp->tx_pkts;
> +
> + /* Ensure that the data is fully copied out before setting the flag */
> + wmb();
> + hdr->flags = entry->flags | DESC_DONE_FLAG;
> +
> + ntb_ring_sdb(qp->ndev, qp->qp_num);
> +
> + /* The entry length can only be zero if the packet is intended to be a
> + * "link down" or similar. Since no payload is being sent in these
> + * cases, there is nothing to add to the completion queue.
> + */
> + if (entry->len > 0) {
> + qp->tx_bytes += entry->len;
> +
> + /* Add fully transmitted data to completion queue */
> + ntb_list_add_tail(&qp->ntb_tx_comp_q_lock, &entry->entry,
> + &qp->tx_comp_q);
> +
> + if (qp->tx_handler)
> + qp->tx_handler(qp->cb_data, qp);
> + } else
> + ntb_list_add_tail(&qp->ntb_tx_free_q_lock, &entry->entry,
> + &qp->tx_free_q);
> +}

I know you talked about a fixed array. But it's not here yet. So at
all the call-sites, for [r/t]x_free_q , add the 'entry' to the head -
change to ntb_list_add_head here and else where.

Chetan Loke


\
 
 \ /
  Last update: 2012-07-31 19:01    [W:0.168 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site