From patchwork Tue Sep 26 09:22:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amine Kherbouche X-Patchwork-Id: 818500 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@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; dkim=pass (2048-bit key; unprotected) header.d=6wind-com.20150623.gappssmtp.com header.i=@6wind-com.20150623.gappssmtp.com header.b="p0Rb8a1a"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y1b91470Hz9t3B for ; Tue, 26 Sep 2017 19:23:17 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968438AbdIZJXP (ORCPT ); Tue, 26 Sep 2017 05:23:15 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:44222 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968432AbdIZJXK (ORCPT ); Tue, 26 Sep 2017 05:23:10 -0400 Received: by mail-wr0-f178.google.com with SMTP id v109so12327681wrc.1 for ; Tue, 26 Sep 2017 02:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uY3YSnUVHdqVFAr8UtvNM/be5p4SO1tGLV0HToFzrD4=; b=p0Rb8a1aPTO5/ZD+wZ1nFVPSnPQ7rXTX6eyLiwayP1L9+bDzv2Equ8vK/DBDYVVgF0 Hl4dz7zsmDDBX2uIRjgcyOqk2Q1khYHWDmSd9mb/GMUWR5BIW+0raENbxeFw/11j/D1N LiLYGo5rSGEMm7j7TAB776FRU4f9gO7jjJk/8uq1dwp/MyamZuUTFd46PgD/AMkck+QD 2o+OterMjM/dGQ4eRul3fLaMwTaf2QISg/x1sone4bX6rnhaAW3nPAZYIsjD6idbk2T9 sinKp6ZY8ZGkKipP329bCWlQtbmuE/Lf7iOl/wwUgbSQhAzuRwzK3G33ObR8QriZFlM6 4axQ== 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:in-reply-to :references; bh=uY3YSnUVHdqVFAr8UtvNM/be5p4SO1tGLV0HToFzrD4=; b=d48oa8Hv3Y0wYkxn3a8HiFHtpXPeDfPvOKHP3JG3jMFHXTW7+fmhsX921tHa8jLilq lihwCCUnKOyitP9TX2C6i0lovE7D3dRkyNbIXmyh6SIXA2NCRlAb/LUksC5rodG2Sn5E CQkogAMCaYYNR2CPpWM1bKgNuC+jImF1deAk15XplfcSxy6ANQRfZv+kp5pbkrM9I0+s ntNyTb76hKXEZy+ygFahK9P23uHcLyl+J2rGaTOywZjdZbQWjTodhID+ufIQqN3z4HZB 0tG3JuQAzE4PQfw/J134SRuxLPugZpYo9LAG08pBMbbwObbohar0wMIEpJhIdof3tZS6 ELhQ== X-Gm-Message-State: AHPjjUibLx6kQn77Y4UNItrLBG8aSPfcMfkyncN77sDv8Yg9FAgoKyA5 m1P621KQv2Hoy1mYNGZ5HKKPMQWd X-Google-Smtp-Source: AOwi7QD4VbAj2aRITCJ7ljzROVwlvcHERanDh89VDXij+dkq20mCqigIw9rR2lvt0mskyWKjWD7XbA== X-Received: by 10.223.173.98 with SMTP id p89mr8318388wrc.194.1506417789283; Tue, 26 Sep 2017 02:23:09 -0700 (PDT) Received: from griffon.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id b66sm754235wmh.25.2017.09.26.02.23.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Sep 2017 02:23:08 -0700 (PDT) From: Amine Kherbouche To: netdev@vger.kernel.org, xeb@mail.ru, roopa@cumulusnetworks.com Cc: amine.kherbouche@6wind.com, equinox@diac24.net Subject: [PATCH v2 1/2] mpls: expose stack entry function Date: Tue, 26 Sep 2017 11:22:50 +0200 Message-Id: <14a3fe55b712ae24a927fd864c90d475916849b3.1506416988.git.amine.kherbouche@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Exporting mpls_forward() function to be able to be called from elsewhere such as MPLS over GRE in the next commit. Signed-off-by: Amine Kherbouche --- include/linux/mpls.h | 3 +++ net/mpls/af_mpls.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/mpls.h b/include/linux/mpls.h index 384fb22..d5c7599 100644 --- a/include/linux/mpls.h +++ b/include/linux/mpls.h @@ -2,10 +2,13 @@ #define _LINUX_MPLS_H #include +#include #define MPLS_TTL_MASK (MPLS_LS_TTL_MASK >> MPLS_LS_TTL_SHIFT) #define MPLS_BOS_MASK (MPLS_LS_S_MASK >> MPLS_LS_S_SHIFT) #define MPLS_TC_MASK (MPLS_LS_TC_MASK >> MPLS_LS_TC_SHIFT) #define MPLS_LABEL_MASK (MPLS_LS_LABEL_MASK >> MPLS_LS_LABEL_SHIFT) +int mpls_forward(struct sk_buff *skb, struct net_device *dev, + struct packet_type *pt, struct net_device *orig_dev); #endif /* _LINUX_MPLS_H */ diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index c5b9ce4..36ea2ad 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -307,8 +307,8 @@ static bool mpls_egress(struct net *net, struct mpls_route *rt, return success; } -static int mpls_forward(struct sk_buff *skb, struct net_device *dev, - struct packet_type *pt, struct net_device *orig_dev) +int mpls_forward(struct sk_buff *skb, struct net_device *dev, + struct packet_type *pt, struct net_device *orig_dev) { struct net *net = dev_net(dev); struct mpls_shim_hdr *hdr; @@ -442,6 +442,7 @@ static int mpls_forward(struct sk_buff *skb, struct net_device *dev, kfree_skb(skb); return NET_RX_DROP; } +EXPORT_SYMBOL(mpls_forward); static struct packet_type mpls_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_MPLS_UC),