From patchwork Wed Apr 17 14:46:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 1087004 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44klRr2GPXz9s3q for ; Thu, 18 Apr 2019 00:46:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732267AbfDQOqa (ORCPT ); Wed, 17 Apr 2019 10:46:30 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:39181 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731996AbfDQOq3 (ORCPT ); Wed, 17 Apr 2019 10:46:29 -0400 Received: by mail-qt1-f193.google.com with SMTP id t28so27641227qte.6 for ; Wed, 17 Apr 2019 07:46:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9qHJbV3TuW3vx0wZSan1t46+kpgP+ZsSQnJpJ9c9MTA=; b=EGO46ZU05Tlv3FwT77IEpznK+BoqBHgDkFfbJjYmFHfkMJqAZP9JLosc1Zy4Xh5Evd c0uit/0M4x/cF96JnY1rdOLNU+qmaxOc+kH6t5ivLLOE9tUfSBgc6j5HCX3OQubCk7xF ikN4n4C3Fsg575Vw3TD+ypU3oCUwIlWmM+WOIIPFTnJwe78BlY6KlWdWlz1AQ0yZRWjC UgFXjZs+qbpAMsGdGGGQTgHeoStRVkPI/U2jNgR/pBArHrjgu1VNtkzybefz9XXbXdKg rNnDmBENtn1rRNWH83igXzWf+7Ui+w7+u9Fd8GfaPss63C1hl/8uxBeYZTXenwZy2drJ A4pw== X-Gm-Message-State: APjAAAVppOmc5rJivus+JXa9j8L8qF+HEe3APUb328BlVueOrZtRnG0B hXKl8EswXBGL8vwTT4u4Hd7KrVpt1i4= X-Google-Smtp-Source: APXvYqziUDSjyvrG0ldtfBW4ENVQUWC0dTgYjI+vT+pfWUqfMjrnVioBsR8VmqeDAfj+yBinSkJw3w== X-Received: by 2002:ac8:1833:: with SMTP id q48mr71252892qtj.133.1555512388465; Wed, 17 Apr 2019 07:46:28 -0700 (PDT) Received: from localhost ([177.183.215.200]) by smtp.gmail.com with ESMTPSA id p6sm39900950qtk.70.2019.04.17.07.46.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Apr 2019 07:46:27 -0700 (PDT) From: Flavio Leitner To: netdev@vger.kernel.org Cc: Joe Stringer , Pravin B Shelar , dev@openvswitch.org, netfilter-devel@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH net-next v3 0/4] openvswitch: load and reference the NAT helper Date: Wed, 17 Apr 2019 11:46:13 -0300 Message-Id: <20190417144617.14922-1-fbl@redhat.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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 third patch 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 (4): netfilter: use macros to create module aliases. netfilter: add API to manage NAT helpers. netfilter: nf_nat: register NAT helpers. openvswitch: load and reference the NAT helper. include/net/netfilter/nf_conntrack_helper.h | 24 ++++++ net/ipv4/netfilter/nf_nat_h323.c | 2 +- net/ipv4/netfilter/nf_nat_pptp.c | 2 +- net/netfilter/nf_conntrack_amanda.c | 8 +- net/netfilter/nf_conntrack_ftp.c | 18 +++-- net/netfilter/nf_conntrack_helper.c | 86 +++++++++++++++++++++ net/netfilter/nf_conntrack_irc.c | 6 +- net/netfilter/nf_conntrack_sane.c | 12 +-- net/netfilter/nf_conntrack_sip.c | 28 +++---- net/netfilter/nf_conntrack_tftp.c | 18 +++-- net/netfilter/nf_nat_amanda.c | 9 ++- net/netfilter/nf_nat_ftp.c | 9 ++- net/netfilter/nf_nat_irc.c | 9 ++- net/netfilter/nf_nat_sip.c | 9 ++- net/netfilter/nf_nat_tftp.c | 9 ++- net/openvswitch/conntrack.c | 26 +++++-- 16 files changed, 225 insertions(+), 50 deletions(-)