Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1916423imm; Tue, 22 May 2018 11:24:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqYaRprYoj4iDKsQiBxvP/7ObcFbux1LJgdO0HXELNY3NXTXOrb4egKrwqjLrXiDyOUMzFV X-Received: by 2002:a63:83c3:: with SMTP id h186-v6mr2637341pge.298.1527013464907; Tue, 22 May 2018 11:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527013464; cv=none; d=google.com; s=arc-20160816; b=Ka3qMfs+oLv8eLGoPqxrSbdPRn2Szz1Cph3FzZG/ONQY3KBA2gOc7d9/wiTNIvDDsY zHnz5coEUmH9niTX2Al5E1Crr5A3JP3Vk9KDz4RHtCKKY5Zb94CKgH/unHWDREREhS7i AkSqcKXy7kl/QcCvJpnHGWh6M3eQBMM7OD1zQi2UKh4lUxZNbg0mZwM587v0vDLv/uvA g+YyxD+Ofgmd5oUyUkfCu5qqxyVzPsy/VFeM2ajhiX44Q3T82hhSbxnDG2a9DLEITQY4 5F6c1m7iXk8VchXMS0FolAXJIky8XjqkYYeTmQtHt6CqCcynnwUQ2S8Pxj4nJp7ClEST QCWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=UXC3vLb4dn8qsZlNiYiI6f/zUUQLqcCqYe5K8BGuXZo=; b=vTwqHbWobqNT3K0aIhA6hhCRButGJeYNgJcMcJMauwgyLAJEGdBnoaIVmyvlD999Yi uR9hxxr5YkFGLkCPrxJCvU97M7KusXh91QsFRDPAr0xAgz1bUrtRzL0lATLZBIqePXeD dcTmlqyDtAx/swS+oWCTV7nsqY/M/9wfuTJinINb1cRPxR4Z1Z+3IgoBDy+zoP5snTUD L/NMiEe9Ox7J7CDncgNgyZha7YQhSyA+wZ8jqoI3+eLHXxX4ludc1h5086huZ47MjFr2 7M0jcZuYZu8qXhPFp6QgLeVSf+JMwZMGeEY9GXP1TywEc3mZMpcg6s/tlSYWjqzQg73N 2IMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pOWLyXLj; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l139-v6si17176274pfd.51.2018.05.22.11.24.10; Tue, 22 May 2018 11:24:24 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pOWLyXLj; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbeEVSYB (ORCPT + 99 others); Tue, 22 May 2018 14:24:01 -0400 Received: from mail-ot0-f170.google.com ([74.125.82.170]:34476 "EHLO mail-ot0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbeEVSYA (ORCPT ); Tue, 22 May 2018 14:24:00 -0400 Received: by mail-ot0-f170.google.com with SMTP id i5-v6so22144890otf.1; Tue, 22 May 2018 11:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UXC3vLb4dn8qsZlNiYiI6f/zUUQLqcCqYe5K8BGuXZo=; b=pOWLyXLj0oGzW+7fIL0z2S7bMPPZzqkoKTGS7twM4YUpeY2phh51sORSACnm5pX0SC vRrVp3dj11gzkDOfcwMREOE8LFFsfaxXFuhRycqllrMa6NfI4mUryJxfuuND0MB9+5hB 5+/6zrbtv2S3AxrikoDHY29X+i5J24//BULn4hTlifUbLlSpJ/uQE8UI8APbL0/ntGB1 RH8a9Kn2060WZnoQUTzdPJ1L9yfLBgEUeWRaqvi5fOobIGXBEIAmY7ho5WXkfAa99JwX VBe52q9oIDABpMrpkAPmc2PBz42mMaU6r7XTM8zGPNHs6xdDWLgxThZB9Wj3oSWTc8OD 6kSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UXC3vLb4dn8qsZlNiYiI6f/zUUQLqcCqYe5K8BGuXZo=; b=DbUkBjwc8R/bUxQ6048wrx6WdYLqzga7exe2/bYHaKbh47CHyAPpQDxgMxcJ7PRztW FpNrAuYchEVq4IddmpwRwZ7LI/NTcU80pAnkcfX7ljv7kALZNMr8e6ETdd/GTV0dUJ4C Bw0gEJH8yoOpr7TlLJjalRfuJLkAOS5zkI++2msWPABB/xk10CQFCmjar950elK6905+ hVKazTdU9OFaA/SoDy8Q+F+rGnJFj9sfPN41mzn8o3EtJNNseVN/TiivMiNSnJW2dyE/ DkLAeEbmGlyWslSFBCh61Nfn57Es8VCEuG63EMU4Vo46fEpsQOs0coxSgsP7nt/tVRKE H3Lg== X-Gm-Message-State: ALKqPwe+bBOYZfhwuVumzp8MsmP6+5qLK/rGEIDrgOKbCF1+C0tbxLPS g15pkWazzDkEkZgXsYQfQTYugvBQdtkoBN4TvhViqC2Q X-Received: by 2002:a9d:72b:: with SMTP id 40-v6mr17859851ote.145.1527013439414; Tue, 22 May 2018 11:23:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:ad1:0:0:0:0:0 with HTTP; Tue, 22 May 2018 11:23:58 -0700 (PDT) In-Reply-To: References: From: Alexander Duyck Date: Tue, 22 May 2018 11:23:58 -0700 Message-ID: Subject: Re: Regression: Approximate 34% performance hit in receive throughput over ixgbe seen due to build_skb patch To: William Kucharski Cc: LKML , Netdev , intel-wired-lan , Jeff Kirsher , "Duyck, Alexander H" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 22, 2018 at 11:00 AM, William Kucharski wrote: > A performance hit of approximately 34% in receive numbers for some packet sizes is > seen when testing traffic over ixgbe links using the network test netperf. > > Starting with the top of tree commit 7addb3e4ad3db6a95a953c59884921b5883dcdec, > a git bisect narrowed the issue down to: > > commit 6f429223b31c550b835b4f066ac034d0cf0cc71e > > ixgbe: Add support for build_skb > > This patch adds build_skb support to the Rx path. There are several > advantages to this change. > > 1. It avoids the memcpy and skb->head allocation for small packets which > improves performance by about 5% in my tests. > 2. It avoids the memcpy, skb->head allocation, and eth_get_headlen > for larger packets improving performance by about 10% in my tests. > 3. For VXLAN packets it allows the full header to be in skb->data which > improves the performance by as much as 30% in some of my tests. > > Netperf was sourced from: > > https://hewlettpackard.github.io/netperf/ > > Two machines were directly connected via ixgbe links. > > The process "netserver" was started on 10.196.11.8, and running this test: > > # netperf -l 60 -H 10.196.11.8 -i 10,2 -I 99,10 -t UDP_STREAM -- -m 64 -s 32768 -S 32768 Okay, so I can already see what the most likely issue is. The build_skb code is more CPU efficient, but it will consume more memory in the process since it is avoiding the memcpy and is instead using a full 2K block of memory for a small frame. I'm suspecting any performance issue you are seeing may be due to a slow interrupt rate causing us to either exhaust available Tx memory, or overrun the available Rx memory. There end up being multiple ways to address this. 1. Use a larger value for your "-s/-S" values to allow for more memory to be handled in the queues. 2. Update the interrupt moderation code for the driver. You can either manually decrease the per-interrupt delay via "ethtool -C" or just update the adaptive ITR code, see commit b4ded8327fea ("ixgbe: Update adaptive ITR algorithm"). 3. There should be a private flag that can be updated via "ethtool --set-priv-flags" called "legacy-rx" that you can enable that will roll back to the original that did the copy-break type approach for small packets and the headers of the frame. Thanks. - Alex