View | Details | Raw Unified | Return to bug 1213546
Collapse All | Expand All

(-)a/drivers/net/xen-netback/netback.c (-5 / +10 lines)
Lines 396-402 static void xenvif_get_requests(struct xenvif_queue *queue, Link Here
396
	struct gnttab_map_grant_ref *gop = queue->tx_map_ops + *map_ops;
396
	struct gnttab_map_grant_ref *gop = queue->tx_map_ops + *map_ops;
397
	struct xen_netif_tx_request *txp = first;
397
	struct xen_netif_tx_request *txp = first;
398
398
399
	nr_slots = shinfo->nr_frags + 1;
399
	nr_slots = shinfo->nr_frags + frag_overflow + 1;
400
400
401
	copy_count(skb) = 0;
401
	copy_count(skb) = 0;
402
	XENVIF_TX_CB(skb)->split_mask = 0;
402
	XENVIF_TX_CB(skb)->split_mask = 0;
Lines 462-469 static void xenvif_get_requests(struct xenvif_queue *queue, Link Here
462
		}
462
		}
463
	}
463
	}
464
464
465
	for (shinfo->nr_frags = 0; shinfo->nr_frags < nr_slots;
465
	for (shinfo->nr_frags = 0; nr_slots > 0 && shinfo->nr_frags < MAX_SKB_FRAGS;
466
	     shinfo->nr_frags++, gop++) {
466
	     shinfo->nr_frags++, gop++, nr_slots--) {
467
		index = pending_index(queue->pending_cons++);
467
		index = pending_index(queue->pending_cons++);
468
		pending_idx = queue->pending_ring[index];
468
		pending_idx = queue->pending_ring[index];
469
		xenvif_tx_create_map_op(queue, pending_idx, txp,
469
		xenvif_tx_create_map_op(queue, pending_idx, txp,
Lines 476-487 static void xenvif_get_requests(struct xenvif_queue *queue, Link Here
476
			txp++;
476
			txp++;
477
	}
477
	}
478
478
479
	if (frag_overflow) {
479
	if (nr_slots > 0) {
480
480
481
		shinfo = skb_shinfo(nskb);
481
		shinfo = skb_shinfo(nskb);
482
		frags = shinfo->frags;
482
		frags = shinfo->frags;
483
483
484
		for (shinfo->nr_frags = 0; shinfo->nr_frags < frag_overflow;
484
		for (shinfo->nr_frags = 0; shinfo->nr_frags < nr_slots;
485
		     shinfo->nr_frags++, txp++, gop++) {
485
		     shinfo->nr_frags++, txp++, gop++) {
486
			index = pending_index(queue->pending_cons++);
486
			index = pending_index(queue->pending_cons++);
487
			pending_idx = queue->pending_ring[index];
487
			pending_idx = queue->pending_ring[index];
Lines 492-497 static void xenvif_get_requests(struct xenvif_queue *queue, Link Here
492
		}
492
		}
493
493
494
		skb_shinfo(skb)->frag_list = nskb;
494
		skb_shinfo(skb)->frag_list = nskb;
495
	} else if (nskb) {
496
		/* A frag_list skb was allocated but it is no longer needed
497
		 * because enough slots were converted to copy ops above.
498
		 */
499
		kfree_skb(nskb);
495
	}
500
	}
496
501
497
	(*copy_ops) = cop - queue->tx_copy_ops;
502
	(*copy_ops) = cop - queue->tx_copy_ops;

Return to bug 1213546