From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] ip6_gre: fix device features for ioctl setup Date: Tue, 26 Dec 2017 12:21:53 -0500 (EST) Message-ID: <20171226.122153.606492364036628199.davem@davemloft.net> References: <1513787763-5384-1-git-send-email-alexey.kodanev@oracle.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, alexander.h.duyck@intel.com To: alexey.kodanev@oracle.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:55396 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbdLZRVy (ORCPT ); Tue, 26 Dec 2017 12:21:54 -0500 In-Reply-To: <1513787763-5384-1-git-send-email-alexey.kodanev@oracle.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Alexey Kodanev Date: Wed, 20 Dec 2017 19:36:03 +0300 > When ip6gre is created using ioctl, its features, such as > scatter-gather, GSO and tx-checksumming will be turned off: > > # ip -f inet6 tunnel add gre6 mode ip6gre remote fd00::1 > # ethtool -k gre6 (truncated output) > tx-checksumming: off > scatter-gather: off > tcp-segmentation-offload: off > generic-segmentation-offload: off [requested on] > > But when netlink is used, they will be enabled: > # ip link add gre6 type ip6gre remote fd00::1 > # ethtool -k gre6 (truncated output) > tx-checksumming: on > scatter-gather: on > tcp-segmentation-offload: on > generic-segmentation-offload: on > > This results in a loss of performance when gre6 is created via ioctl. > The issue was found with LTP/gre tests. > > Fix it by moving the setup of device features to a separate function > and invoke it with ndo_init callback because both netlink and ioctl > will eventually call it via register_netdevice(): > > register_netdevice() > - ndo_init() callback -> ip6gre_tunnel_init() or ip6gre_tap_init() > - ip6gre_tunnel_init_common() > - ip6gre_tnl_init_features() > > The moved code also contains two minor style fixes: > * removed needless tab from GRE6_FEATURES on NETIF_F_HIGHDMA line. > * fixed the issue reported by checkpatch: "Unnecessary parentheses around > 'nt->encap.type == TUNNEL_ENCAP_NONE'" > > Fixes: ac4eb009e477 ("ip6gre: Add support for basic offloads offloads excluding GSO") > Signed-off-by: Alexey Kodanev Looks good, applied and queued up for -stable.