From: Nikolay Borisov <kernel-6AxghH7DbtA@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Strange dma map/unmap/memcpy dance in ipoib_cm_handle_rx_wc
Date: Wed, 27 Apr 2016 10:48:29 +0300 [thread overview]
Message-ID: <57206ECD.8060007@kyup.com> (raw)
Hello,
I need a bit of help in understanding the logic behind the following
code sequence in ipoib_cm_handle_rx_wc:
newskb = ipoib_cm_alloc_rx_skb(dev, rx_ring, wr_id, frags,
mapping, GFP_ATOMIC);
so Here a new skb is being allocated and pages constituting its
fragments are being dma mapped.
ipoib_cm_dma_unmap_rx(priv, frags, rx_ring[wr_id].mapping);
immediately after that the very same mappings are being unmapped. And
finally the resulting dma addresses from ipoib_cm_alloc_rx_skb are being
copied via this call to memcpy:
memcpy(rx_ring[wr_id].mapping, mapping, (frags + 1) * sizeof *mapping);
Can someone explain what's the logic of doing the memcpy after the
mappings have been destroyed, doesn't that mean the dma addresses stored
in rx_ring[wr_id].mapping are invalid?
Regards,
Nikolay
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2016-04-27 7:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 7:48 Nikolay Borisov [this message]
[not found] ` <57206ECD.8060007-6AxghH7DbtA@public.gmane.org>
2016-04-28 14:22 ` Strange dma map/unmap/memcpy dance in ipoib_cm_handle_rx_wc Doug Ledford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57206ECD.8060007@kyup.com \
--to=kernel-6axghh7dbta@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.