xen-netback: don't use last request to determine minimum Tx credit
authorDavid Vrabel <david.vrabel@citrix.com>
Fri, 30 Oct 2015 15:16:01 +0000 (15:16 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 18 Dec 2015 15:00:23 +0000 (10:00 -0500)
The last from guest transmitted request gives no indication about the
minimum amount of credit that the guest might need to send a packet
since the last packet might have been a small one.

Instead allow for the worst case 128 KiB packet.

This is part of XSA155.

CC: stable@vger.kernel.org
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/net/xen-netback/netback.c

index e481f3710bd38a330d00501c8bd4afadff9de8ff..b683581c5d641764d289bc0c7147f29ccf9ef13b 100644 (file)
@@ -679,9 +679,7 @@ static void tx_add_credit(struct xenvif_queue *queue)
         * Allow a burst big enough to transmit a jumbo packet of up to 128kB.
         * Otherwise the interface can seize up due to insufficient credit.
         */
-       max_burst = RING_GET_REQUEST(&queue->tx, queue->tx.req_cons)->size;
-       max_burst = min(max_burst, 131072UL);
-       max_burst = max(max_burst, queue->credit_bytes);
+       max_burst = max(131072UL, queue->credit_bytes);
 
        /* Take care that adding a new chunk of credit doesn't wrap to zero. */
        max_credit = queue->remaining_credit + queue->credit_bytes;