[ofa-general] Re: socket buffer accounting with UDP/ipoib
Roland Dreier
rdreier at cisco.com
Wed Jul 18 08:10:47 PDT 2007
> > + ib_dma_sync_single_for_cpu(priv->ca, addr, IPOIB_BUF_SIZE,
> > + DMA_FROM_DEVICE);
> > + skb_copy_from_linear_data_offset(skb, IB_GRH_BYTES, new_skb->data,
> > + wc->byte_len - IB_GRH_BYTES);
> > + ib_dma_sync_single_for_device(priv->ca, addr, IPOIB_BUF_SIZE,
> > + DMA_FROM_DEVICE);
>
> BTW, why is ib_dma_sync_single_for_device necessary here?
Not sure what you're asking exactly. The sync for device is needed to
match the previous sync for the cpu obviously. We need both syncs for
the same reason we need the unmap when we don't copy -- we're copying
data out of the skb we gave to the device earlier, so we need to make
sure the cpu sees the right data.
More information about the general
mailing list