From patchwork Wed Sep 16 15:50:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuznetsov X-Patchwork-Id: 518469 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3DED3140180 for ; Thu, 17 Sep 2015 01:52:18 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753202AbbIPPua (ORCPT ); Wed, 16 Sep 2015 11:50:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46497 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753083AbbIPPu3 (ORCPT ); Wed, 16 Sep 2015 11:50:29 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 5905191DCC; Wed, 16 Sep 2015 15:50:29 +0000 (UTC) Received: from vitty.brq.redhat.com (vitty.brq.redhat.com [10.34.26.3]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8GFoRes011471; Wed, 16 Sep 2015 11:50:27 -0400 From: Vitaly Kuznetsov To: netdev@vger.kernel.org Cc: "David S. Miller" , linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Jason Wang Subject: [PATCH net-next RFC] net: increase LL_MAX_HEADER for Hyper-V Date: Wed, 16 Sep 2015 17:50:25 +0200 Message-Id: <1442418625-11805-1-git-send-email-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit b08cc79155fc26d0d112b1470d1ece5034651a4b ("hv_netvsc: Eliminate memory allocation in the packet send path") introduced skb headroom request for Hyper-V netvsc driver: max_needed_headroom = sizeof(struct hv_netvsc_packet) + sizeof(struct rndis_message) + NDIS_VLAN_PPI_SIZE + NDIS_CSUM_PPI_SIZE + NDIS_LSO_PPI_SIZE + NDIS_HASH_PPI_SIZE; ... net->needed_headroom = max_needed_headroom; max_needed_headroom is 220 bytes, it significantly exceeds the LL_MAX_HEADER setting. This causes each skb to be cloned on send path, e.g. for IPv4 case we fall into the following clause (ip_finish_output2()): if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) { ... skb2 = skb_realloc_headroom(skb, LL_RESERVED_SPACE(dev)); ... } leading to a significant performance regression. Increase LL_MAX_HEADER to make it suitable for netvsc, make it 224 to be 16-aligned. Alternatively we could (partially) revert the commit which introduced skb headroom request restoring manual memory allocation on transmit path. Signed-off-by: Vitaly Kuznetsov --- include/linux/netdevice.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 88a0069..7233790 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -132,7 +132,9 @@ static inline bool dev_xmit_complete(int rc) * used. */ -#if defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25) +#if IS_ENABLED(CONFIG_HYPERV_NET) +# define LL_MAX_HEADER 224 +#elif defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25) # if defined(CONFIG_MAC80211_MESH) # define LL_MAX_HEADER 128 # else