xen/netfront: raise max number of slots in xennet_get_responses()
Subsystems (3)
Juergen Gross
maintainerPATCH 1/1 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).
--- drivers/net/xen-netfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/xen-netfront.c +1 -1
@@ -790,7 +790,7 @@ static int xennet_get_responses(struct netfront_queue *queue,RING_IDX cons = queue->rx.rsp_cons;struct sk_buff *skb =xennet_get_rx_skb (queue, cons);grant_ref_t ref =xennet_get_rx_ref (queue, cons); -int max =MAX_SKB_FRAGS + (rx->status <=RX_COPY_THRESHOLD ); +int max =XEN_NETIF_NR_SLOTS_MIN + (rx->status <=RX_COPY_THRESHOLD );int slots =1 ;int err =0 ;unsigned long ret;
Signature · 1 line
2.13.7
Quoted 8 lines · Juergen Gross
The max number of slots used in
xennet_get_responses()is set toMAX_SKB_FRAGS+ (rx->status<=RX_COPY_THRESHOLD).In old kernel-xen
MAX_SKB_FRAGSwas 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).
Quoted 6 lines
Replacing
MAX_SKB_FRAGSbyXEN_NETIF_NR_SLOTS_MINfor 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).Signed-off-by Juergen Gross <[email protected]>
I wonder also whether netfront_tx_slot_available() is meant to be
return (queue->tx.req_prod_pvt - queue->tx.rsp_cons) < (NET_TX_RING_SIZE - XEN_NETIF_NR_SLOTS_MIN - 1);
which is the same numeric value but provides a more accurate description of what is being tested.
-boris
Quoted 17 lines
--- drivers/net/xen-netfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/xen-netfront.c +1
-1@@ -790,7 +790,7 @@ static int xennet_get_responses(struct netfront_queue *queue,RING_IDX cons = queue->rx.rsp_cons;struct sk_buff *skb =xennet_get_rx_skb (queue, cons);grant_ref_t ref =xennet_get_rx_ref (queue, cons); -int max =MAX_SKB_FRAGS + (rx->status <=RX_COPY_THRESHOLD ); +int max =XEN_NETIF_NR_SLOTS_MIN + (rx->status <=RX_COPY_THRESHOLD );int slots =1 ;int err =0 ;unsigned long ret;
Quoted 8 lines · Juergen Gross
The max number of slots used in
xennet_get_responses()is set toMAX_SKB_FRAGS+ (rx->status<=RX_COPY_THRESHOLD).In old kernel-xen
MAX_SKB_FRAGSwas 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).
Quoted 6 lines
Replacing
MAX_SKB_FRAGSbyXEN_NETIF_NR_SLOTS_MINfor 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).Signed-off-by Juergen Gross <[email protected]>
I wonder also whether netfront_tx_slot_available() is meant to be
return (queue->tx.req_prod_pvt - queue->tx.rsp_cons) < (NET_TX_RING_SIZE - XEN_NETIF_NR_SLOTS_MIN - 1);
which is the same numeric value but provides a more accurate description of what is being tested.
-boris
Quoted 9 lines
--- drivers/net/xen-netfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/xen-netfront.c +0
-0
drivers/net/xen-netfront.c static int xennet_get_responses(struct netfront_queue *queue, · line 796
Quoted 8 lines
drivers/net/xen-netfront.c +1
-1@@ -790,7 +790,7 @@ static int xennet_get_responses(struct netfront_queue *queue,RING_IDX cons = queue->rx.rsp_cons;struct sk_buff *skb =xennet_get_rx_skb (queue, cons);grant_ref_t ref =xennet_get_rx_ref (queue, cons); -int max =MAX_SKB_FRAGS + (rx->status <=RX_COPY_THRESHOLD ); +int max =XEN_NETIF_NR_SLOTS_MIN + (rx->status <=RX_COPY_THRESHOLD );int slots =1 ;int err =0 ;unsigned long ret;
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Juergen Gross
maintainerQuoted 18 lines · Boris Ostrovsky
Quoted 8 lines · Juergen Gross
The max number of slots used in
xennet_get_responses()is set toMAX_SKB_FRAGS+ (rx->status<=RX_COPY_THRESHOLD).In old kernel-xen
MAX_SKB_FRAGSwas 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).Quoted 6 lines
Replacing
MAX_SKB_FRAGSbyXEN_NETIF_NR_SLOTS_MINfor 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).Signed-off-by Juergen Gross <[email protected]>Reviewed-by Boris Ostrovsky <[email protected]>
Quoted 7 lines
I wonder also whether
netfront_tx_slot_available()is meant to bereturn (
queue->tx.req_prod_pvt-queue->tx.rsp_cons) < (NET_TX_RING_SIZE-XEN_NETIF_NR_SLOTS_MIN- 1);which is the same numeric value but provides a more accurate description of what is being tested.
Yes, this is a sensible idea. I'll add that, keeping your R-b.
Juergen
Juergen Gross
maintainerQuoted 18 lines · Boris Ostrovsky
Quoted 8 lines · Juergen Gross
The max number of slots used in
xennet_get_responses()is set toMAX_SKB_FRAGS+ (rx->status<=RX_COPY_THRESHOLD).In old kernel-xen
MAX_SKB_FRAGSwas 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).Quoted 6 lines
Replacing
MAX_SKB_FRAGSbyXEN_NETIF_NR_SLOTS_MINfor 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).Signed-off-by Juergen Gross <[email protected]>Reviewed-by Boris Ostrovsky <[email protected]>
Quoted 7 lines
I wonder also whether
netfront_tx_slot_available()is meant to bereturn (
queue->tx.req_prod_pvt-queue->tx.rsp_cons) < (NET_TX_RING_SIZE-XEN_NETIF_NR_SLOTS_MIN- 1);which is the same numeric value but provides a more accurate description of what is being tested.
Yes, this is a sensible idea. I'll add that, keeping your R-b.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel