Skip to content

Commit 57f230a

Browse files
jgross1davem330
authored andcommitted
xen/netfront: raise max number of slots in xennet_get_responses()
The max number of slots used in xennet_get_responses() is set to MAX_SKB_FRAGS + (rx->status <= RX_COPY_THRESHOLD). In old kernel-xen MAX_SKB_FRAGS was 18, while nowadays it is 17. This difference is resulting in frequent messages "too many slots" and a reduced network throughput for some workloads (factor 10 below that of a kernel-xen based guest). Replacing MAX_SKB_FRAGS by XEN_NETIF_NR_SLOTS_MIN for calculation of the max number of slots to use solves that problem (tests showed no more messages "too many slots" and throughput was as high as with the kernel-xen based guest system). Replace MAX_SKB_FRAGS-2 by XEN_NETIF_NR_SLOTS_MIN-1 in netfront_tx_slot_available() for making it clearer what is really being tested without actually modifying the tested value. Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c0129a0 commit 57f230a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/xen-netfront.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static void rx_refill_timeout(struct timer_list *t)
239239
static int netfront_tx_slot_available(struct netfront_queue *queue)
240240
{
241241
return (queue->tx.req_prod_pvt - queue->tx.rsp_cons) <
242-
(NET_TX_RING_SIZE - MAX_SKB_FRAGS - 2);
242+
(NET_TX_RING_SIZE - XEN_NETIF_NR_SLOTS_MIN - 1);
243243
}
244244

245245
static void xennet_maybe_wake_tx(struct netfront_queue *queue)
@@ -790,7 +790,7 @@ static int xennet_get_responses(struct netfront_queue *queue,
790790
RING_IDX cons = queue->rx.rsp_cons;
791791
struct sk_buff *skb = xennet_get_rx_skb(queue, cons);
792792
grant_ref_t ref = xennet_get_rx_ref(queue, cons);
793-
int max = MAX_SKB_FRAGS + (rx->status <= RX_COPY_THRESHOLD);
793+
int max = XEN_NETIF_NR_SLOTS_MIN + (rx->status <= RX_COPY_THRESHOLD);
794794
int slots = 1;
795795
int err = 0;
796796
unsigned long ret;

0 commit comments

Comments
 (0)