diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-10-12 10:56:41 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-10-12 10:56:41 +0100 |
commit | 5358257c6f83c789add2d7b13e49f09b02f50e29 (patch) | |
tree | 6c2e0e0e8dd5c191c5b29c88ac1f18477b253ea8 | |
parent | 503bcd598c2b4f520f5a58eac07c3d57912ac519 (diff) | |
download | xen-5358257c6f83c789add2d7b13e49f09b02f50e29.tar.gz xen-5358257c6f83c789add2d7b13e49f09b02f50e29.tar.bz2 xen-5358257c6f83c789add2d7b13e49f09b02f50e29.zip |
[NET] back: Fix inter-domain networking when using rx-copy path.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/netback/netback.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c index f50577eb35..40b9ee8bac 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c @@ -78,7 +78,7 @@ static inline unsigned long idx_to_kaddr(unsigned int idx) #define PKT_PROT_LEN 64 -static struct { +static struct pending_tx_info { netif_tx_request_t req; netif_t *netif; } pending_tx_info[MAX_PENDING_REQS]; @@ -374,14 +374,22 @@ static u16 netbk_gop_frag(netif_t *netif, struct netbk_rx_meta *meta, flipped. */ meta->copy = 1; copy_gop = npo->copy + npo->copy_prod++; - copy_gop->source.domid = DOMID_SELF; + copy_gop->flags = GNTCOPY_dest_gref; + if (PageForeign(page)) { + struct pending_tx_info *src_pend = + &pending_tx_info[page->index]; + copy_gop->source.domid = src_pend->netif->domid; + copy_gop->source.u.ref = src_pend->req.gref; + copy_gop->flags |= GNTCOPY_source_gref; + } else { + copy_gop->source.domid = DOMID_SELF; + copy_gop->source.u.gmfn = old_mfn; + } copy_gop->source.offset = offset; - copy_gop->source.u.gmfn = old_mfn; copy_gop->dest.domid = netif->domid; copy_gop->dest.offset = 0; copy_gop->dest.u.ref = req->gref; copy_gop->len = size; - copy_gop->flags = GNTCOPY_dest_gref; } else { meta->copy = 0; if (!xen_feature(XENFEAT_auto_translated_physmap)) { |