|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH net-next v2 1/9] xen-netback: Introduce TX grant map definitions
On 13/12/13 15:31, Wei Liu wrote: On Thu, Dec 12, 2013 at 11:48:09PM +0000, Zoltan Kiss wrote:This patch contains the new definitions necessary for grant mapping. v2: - move unmapping to separate thread. The NAPI instance has to be scheduled even from thread context, which can cause huge delays - that causes unfortunately bigger struct xenvif - store grant handle after checking validityIf the size of xenvif really becomes a problem, you can try to make sratch space like struct gnttab_copy per-cpu. The downside is that approach requires much coding and carefully guard against race conditions. You would need to consider cost v.s. benefit. I mentioned this because for the first series I had comments that I should be more vigilant about this. At that time there was a problem with struct xenvif allocation which was solved by now. My quick calculation showed this patch will increase the size with ~15kb I just moved them here because the second patch is already huge, and I couldn't have an idea to splice it up while keeping it bisectable and logically consistent. As I mentioned, I welcome ideas about that.Signed-off-by: Zoltan Kiss <zoltan.kiss@xxxxxxxxxx> ---[...] It will be used in the 5th patch. Anyway, it's in the definition of the zerocopy callback. Here we have the pending_idx, so we get a pointer for the holding struct pending_tx_info, then for the beginning of pending_tx_info (temp - pending_idx), and then to the struct xenvif. It's a bit tricky and not straightforward, I admit :)+ unsigned long flags; + pending_ring_idx_t index; + u16 pending_idx = ubuf->desc; + struct pending_tx_info *temp = + container_of(ubuf, struct pending_tx_info, callback_struct); + struct xenvif *vif = + container_of(temp - pending_idx, struct xenvif, + pending_tx_info[0]); +The third parameter to container_of should be the name of the member within the struct. Oh yes, that's from the classic code, it should be xenvif_zerocopy_callback. I will fix it. The NAPI instance can do it as well if it is a small packet fits into PKT_PROT_LEN. But still this scenario shouldn't really happen, I was just not sure we have to crash immediately. Maybe handle it as a fatal error and destroy the vif? _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |