From patchwork Tue Mar 26 20:57:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 1066080 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sysclose.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sysclose.org header.i=fbl@sysclose.org header.b="QcBL/Lrr"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44TNkW5pPFz9sV0 for ; Wed, 27 Mar 2019 07:57:55 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 4E5DBE73; Tue, 26 Mar 2019 20:57:38 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id BE4F8E53 for ; Tue, 26 Mar 2019 20:57:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sender-of-o51.zoho.com (sender-of-o51.zoho.com [135.84.80.216]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5FF1294C for ; Tue, 26 Mar 2019 20:57:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1553633849; cv=none; d=zoho.com; s=zohoarc; b=TuhUDwEcItM13AHjI074bMLc5nmRIwDWBeD9gfSaMa5ENIKm/u2X/yioYiB9zm0ZArK/FGrULiktJMfnJcBd9b/X8Qb2SP/sF67cHLZDpoOy04m16VhXjUApHWoH5oRytu05LlmS43QdV6nudCvKxO9ohErpfe+Wacab6tbkK7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1553633849; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=8oDufr+e7RhX5V+j72NJd59UKhJ5hOfwi0CmHeyJxBo=; b=caiTj/9Yl2jJ92I3gQZ7YBZyn8EZ0qtvUIZ7nGruXvHvxztYAAcL7H/i7GURJDFD7abR3QY37Hb3KmClyLyDm6W1Cp4a4acPxfobvmlQD4CsP2w3iewDqOl267U4y8ZrCMj2RDEJY4N5/qQ6O2tr/adxfTrvogWSIdwVoMcpm3s= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=sysclose.org; spf=pass smtp.mailfrom=fbl@sysclose.org; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1553633849; s=zoho; d=sysclose.org; i=fbl@sysclose.org; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Transfer-Encoding:Content-Type; l=1725; bh=8oDufr+e7RhX5V+j72NJd59UKhJ5hOfwi0CmHeyJxBo=; b=QcBL/LrrhkJbK4Z2JDCOIGZgauJqS7wVMa1Ela9EWb5t4puf7O6YAlxDwakHHfsg TAfiSGWp83m1+rmcgABxajp3muHtr+UIbprgQsSY5vONw2kM4LoofRFFBaE6eJb9S3Q HWHXy3FejDdOUDHrSNVaRtAzQaxMctJCjKiwZpdY= Received: from localhost (177.183.215.126 [177.183.215.126]) by mx.zohomail.com with SMTPS id 1553633847132122.76906785349684; Tue, 26 Mar 2019 13:57:27 -0700 (PDT) From: Flavio Leitner To: netdev@vger.kernel.org Message-ID: <20190326205715.22288-1-fbl@sysclose.org> Date: Tue, 26 Mar 2019 17:57:07 -0300 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: dev@openvswitch.org, netfilter-devel@vger.kernel.org Subject: [ovs-dev] [PATCH net-next 0/8] openvswitch: load and reference the NAT helper. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org The request_module() is quite expensive and triggers the usermode helper in userspace. Instead, load only if the module is not present and keep module references to avoid problems. The first patch standardize the module alias which is already there, but not in a formal way. The second patch adds an API to point to the NAT helper. The following patches will register each NAT helper using the new API. The last patch fixes openvswitch to use the new API to load and reference the NAT helper and also report an error if the operation fails. Flavio Leitner (8): netfilter: use macros to create module aliases. netfilter: add API to manage NAT helpers. netfilter: nf_nat: register amanda NAT helper. netfilter: nf_nat: register ftp NAT helper. netfilter: nf_nat: register irc NAT helper. netfilter: nf_nat: register sip NAT helper. netfilter: nf_nat: register tftp NAT helper. openvswitch: load and reference the NAT helper. include/net/netfilter/nf_conntrack_helper.h | 23 ++++- net/ipv4/netfilter/nf_nat_h323.c | 2 +- net/ipv4/netfilter/nf_nat_pptp.c | 2 +- net/netfilter/nf_conntrack_amanda.c | 2 + net/netfilter/nf_conntrack_ftp.c | 6 +- net/netfilter/nf_conntrack_helper.c | 108 +++++++++++++++++++- net/netfilter/nf_conntrack_irc.c | 3 +- net/netfilter/nf_conntrack_sane.c | 4 +- net/netfilter/nf_conntrack_sip.c | 12 ++- net/netfilter/nf_conntrack_tftp.c | 6 +- net/netfilter/nf_nat_amanda.c | 9 +- net/netfilter/nf_nat_ftp.c | 8 +- net/netfilter/nf_nat_irc.c | 8 +- net/netfilter/nf_nat_sip.c | 8 +- net/netfilter/nf_nat_tftp.c | 8 +- net/openvswitch/conntrack.c | 27 +++-- 16 files changed, 209 insertions(+), 27 deletions(-)