From patchwork Sun Sep 18 14:33:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shmulik Ladkani X-Patchwork-Id: 671403 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3scWjw3lngz9t0p for ; Mon, 19 Sep 2016 00:34:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=G4Be/8z8; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935426AbcIROeH (ORCPT ); Sun, 18 Sep 2016 10:34:07 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36335 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932596AbcIROeC (ORCPT ); Sun, 18 Sep 2016 10:34:02 -0400 Received: by mail-wm0-f66.google.com with SMTP id b184so11012375wma.3 for ; Sun, 18 Sep 2016 07:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0Fk8k6KPPmqIO8U4DU6jtDguLTCM4A/evDoDbInb47w=; b=G4Be/8z8W1QBYuuz45g6kbwasPf8hqCW5NsKKCQXC//3KnWh143Qrj2zFEnpi1T4dS knFe1dFN0qESSFrTnPkZ/TlLoQGVxx6kOQJqO/tIlro4Jl4oh4RFMDQ2ytf4mVgshp5M ps6co8YTpfLAmAV8YDlMH4SMTYAaCaATHLNPA7xk91daW13q0braes1OsNBdVkJ45B7f w5T5cBLEAM94PcwK5337uskzB0QQ/hgITFeeT7/emvrdcGlpogqTRw6P3b1UK9eSnDQo Bo1Da/2dTTWy0AWQq/mTZjoT+VsqwI/94L/uk+8ymdSAz9WT7+LDnZH98zKJGDaMloQM Y/fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0Fk8k6KPPmqIO8U4DU6jtDguLTCM4A/evDoDbInb47w=; b=OLALWyuamt0tCIFowpm2feCFDfKvPGi87OwnAmUJx7D4h3y9JOZD6niIHKS9FxJqxS UH3rSF8wMDBNN2ciFPhLxxbGxPILJSOYU7VW1Wybg2q0rgmAbiEe9Q3jTJobo3/T9gBI KvklQWhN9fEs/cyCHAAKPGNIsyKuhGbgMGm/CqkDa+6lIO6OZd1gkd9QwwlWlghHWwlW p56obPIf9WdskZ8xRBVHWh/FXio7aSLD+WeauVclp/P6zQqsHDEKKUfu4tyyajP6OVM7 Uo8WrSPYMe0CDlMzvWbX7KzJmT7gou/CfaaGf/613OufO6JtQ5X0HBd5QSM3P5Jm5VDi BSvg== X-Gm-Message-State: AE9vXwP2J8FEwrXAzxBbHpIDRryq88D1fPguOAoROGcmpQmqMp+X6EB8uUfOdOSRzCOpkg== X-Received: by 10.194.17.6 with SMTP id k6mr23356548wjd.65.1474209241285; Sun, 18 Sep 2016 07:34:01 -0700 (PDT) Received: from halley.ravello.local ([188.120.154.95]) by smtp.gmail.com with ESMTPSA id lj2sm18126783wjc.38.2016.09.18.07.34.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Sep 2016 07:34:00 -0700 (PDT) From: Shmulik Ladkani To: "David S . Miller" Cc: Jiri Pirko , Jamal Hadi Salim , netdev@vger.kernel.org, Shmulik Ladkani Subject: [PATCH net-next 1/2] net: skbuff: Export __skb_vlan_pop Date: Sun, 18 Sep 2016 17:33:44 +0300 Message-Id: <1474209225-23665-2-git-send-email-shmulik.ladkani@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474209225-23665-1-git-send-email-shmulik.ladkani@gmail.com> References: <1474209225-23665-1-git-send-email-shmulik.ladkani@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This exports the functionality of extracting the tag from the payload, without moving next vlan tag into hw accel tag. Signed-off-by: Shmulik Ladkani --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4c5662f05b..000c5301b8 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -3075,6 +3075,7 @@ bool skb_gso_validate_mtu(const struct sk_buff *skb, unsigned int mtu); struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); struct sk_buff *skb_vlan_untag(struct sk_buff *skb); int skb_ensure_writable(struct sk_buff *skb, int write_len); +int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci); int skb_vlan_pop(struct sk_buff *skb); int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy, diff --git a/net/core/skbuff.c b/net/core/skbuff.c index cc2c004838..2937088844 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4493,8 +4493,10 @@ int skb_ensure_writable(struct sk_buff *skb, int write_len) } EXPORT_SYMBOL(skb_ensure_writable); -/* remove VLAN header from packet and update csum accordingly. */ -static int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci) +/* remove VLAN header from packet and update csum accordingly. + * expects a non skb_vlan_tag_present skb with a vlan tag payload + */ +int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci) { struct vlan_hdr *vhdr; unsigned int offset = skb->data - skb_mac_header(skb); @@ -4525,6 +4527,7 @@ pull: return err; } +EXPORT_SYMBOL(__skb_vlan_pop); int skb_vlan_pop(struct sk_buff *skb) {