Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3757339imm; Mon, 11 Jun 2018 00:59:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKyts55SApiiG3SYgcKECjlj/c5YCFgPUpCc6rmSW2ZCrA/VoPAVvtOv0DEhkXEDj1BOjy1 X-Received: by 2002:a63:a356:: with SMTP id v22-v6mr9691551pgn.182.1528703942233; Mon, 11 Jun 2018 00:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528703942; cv=none; d=google.com; s=arc-20160816; b=kia/wjWinpN2oVjWX5bZ/X5A66W+OvS+tv0PunaBhCieygvIAGkXHbVGk7zKn9Dk72 LMgw7MfUXlsMH3Yoktm3U2x6tCduFMOjaVozeIjrDAeYYeQTXzSjA55pgmxkfHuRiaKX Y+i/KlN3JVLCkvYXb5HAbVPum9yp7Ken7LPFJuTmXU3dgkwGCltSFNgTEP0mXKy/Nslm XUwhxaH6AMXlg5W8UY0tHfANoXnZP8bGNkzMRdEzG8/tP0Ogq8+pK44AjCHcL1wA2dPZ yPAYaVhbxCerBzNNGwaOiy/x0+/EPCMpmwWIMjWwMrT0o1ja8kCQyncD4Xehy6NN7mQS 5+kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=q0GiNXWoRA+xNeyjGwLvnvpBAnV/76/o2Zn2MzKANQ0=; b=qUrCBYTMlj4vLrE8RGBet0SqxB8PaZdiv0j+s/QdB7WXbWb2bO6GBs/1Z7G7NrJ/Kf QAhnfgtvxoWgEoMQT72eQB10IXtijsdZZ0FMu9rIXfXVRUvv+oD/R6230cr3bJsy4y2h 46QLLUZTqa01gNJ/+2YmhsGvDKxg34cfw8T+uIxb1dCLblSkFilu8qeeLo2iTRIQerp+ nhy39IPy1YN6tzao+/DLMoYQ8InFRGjbcc1br8F1WYYv7J0kxa1guHJcoSSF8PWisD4/ tbKUnPIFCEG0lgEocbRc96jRtW3hKfP7gAgZeXs/u8+CiuYT+Q01FHDnu9cULZZ4SnXN Oydw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17-v6si4123413pgm.597.2018.06.11.00.58.48; Mon, 11 Jun 2018 00:59:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754129AbeFKH5r (ORCPT + 99 others); Mon, 11 Jun 2018 03:57:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:41290 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754006AbeFKH5q (ORCPT ); Mon, 11 Jun 2018 03:57:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D4A7FAC06; Mon, 11 Jun 2018 07:57:44 +0000 (UTC) From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, netdev@vger.kernel.org Cc: boris.ostrovsky@oracle.com, davem@davemloft.net, Juergen Gross Subject: [PATCH] xen/netfront: raise max number of slots in xennet_get_responses() Date: Mon, 11 Jun 2018 09:57:42 +0200 Message-Id: <20180611075742.1691-1-jgross@suse.com> X-Mailer: git-send-email 2.13.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). Signed-off-by: Juergen Gross --- drivers/net/xen-netfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 679da1abd73c..ba411005d829 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -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; -- 2.13.7