From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D43AC43381 for ; Wed, 27 Mar 2019 17:30:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA3FE2082F for ; Wed, 27 Mar 2019 17:30:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728879AbfC0RaW (ORCPT ); Wed, 27 Mar 2019 13:30:22 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:41786 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726803AbfC0RaV (ORCPT ); Wed, 27 Mar 2019 13:30:21 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1h9CNX-0006Ev-42; Wed, 27 Mar 2019 18:30:19 +0100 From: Florian Westphal To: Cc: steffen.klassert@secunet.com Subject: [PATCH ipsec-next 00/11] xfrm: remove xfrm_mode indirections Date: Wed, 27 Mar 2019 18:31:29 +0100 Message-Id: <20190327173140.16891-1-fw@strlen.de> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This series removes all function pointers from the xfrm_mode struct. They are either replaced by direct calls or a static helper. This also reduces code size: even merging all xfrm{4,6}_,mode* modules into the core reduces total size, as the infrastructure to maintain dynamic (un)register can be removed. There are more opportunities for indirection avoidance, e.g. in xfrm_type. I plan to follow up once/if this series is accepted. This is quite some code churn, but I think its worth doing. Tested with xfrm tunnel mode via netns with esp/aead. Florian Westphal (11): xfrm: place af number into xfrm_mode struct xfrm: prefer family stored in xfrm_mode struct xfrm: remove input indirection from xfrm_mode xfrm: remove output indirection from xfrm_mode xfrm: remove xmit indirection from xfrm_mode xfrm: remove gso_segment indirection from xfrm_mode xfrm: remove input2 indirection from xfrm_mode xfrm: remove output2 indirection from xfrm_mode xfrm: remove afinfo pointer from xfrm_mode xfrm: make xfrm modes builtin xfrm: store xfrm_mode directly, not its address include/net/xfrm.h | 105 ++-------- net/core/pktgen.c | 2 net/ipv4/Kconfig | 29 -- net/ipv4/Makefile | 3 net/ipv4/esp4_offload.c | 40 +++ net/ipv4/ip_vti.c | 6 net/ipv4/xfrm4_output.c | 26 -- net/ipv6/Kconfig | 35 --- net/ipv6/Makefile | 4 net/ipv6/esp6_offload.c | 40 +++ net/ipv6/ip6_vti.c | 6 net/ipv6/xfrm6_output.c | 36 +-- net/xfrm/xfrm_device.c | 58 +++++ net/xfrm/xfrm_inout.h | 38 +++ net/xfrm/xfrm_input.c | 283 ++++++++++++++++++++++++++- net/xfrm/xfrm_interface.c | 6 net/xfrm/xfrm_output.c | 359 ++++++++++++++++++++++++++++++++++- net/xfrm/xfrm_policy.c | 11 - net/xfrm/xfrm_state.c | 181 ++++++----------- tools/testing/selftests/net/config | 2 net/ipv4/xfrm4_mode_beet.c | 155 --------------- net/ipv4/xfrm4_mode_transport.c | 114 ----------- net/ipv4/xfrm4_mode_tunnel.c | 152 -------------- net/ipv6/xfrm6_mode_beet.c | 131 ------------ net/ipv6/xfrm6_mode_ro.c | 85 -------- net/ipv6/xfrm6_mode_transport.c | 121 ----------- net/ipv6/xfrm6_mode_tunnel.c | 151 -------------- 27 files changed, 937 insertions(+), 1242 deletions(-)