From patchwork Thu Jul 26 14:40:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshiaki Makita X-Patchwork-Id: 949753 X-Patchwork-Delegate: bpf@iogearbox.net 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WmjKrZDD"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41bvsr1xFdz9ryl for ; Fri, 27 Jul 2018 00:41:04 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730524AbeGZP6M (ORCPT ); Thu, 26 Jul 2018 11:58:12 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:40007 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729385AbeGZP6M (ORCPT ); Thu, 26 Jul 2018 11:58:12 -0400 Received: by mail-pl0-f65.google.com with SMTP id s17-v6so922731plp.7 for ; Thu, 26 Jul 2018 07:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kCvFyIF60tzPmtz4gtKG6yaANHbgdKH1t1woD6Dz7DA=; b=WmjKrZDDwf+XnuuEr1EVemR/dZdos0tcuju879mpU8FDuqjzQ9arqP+FsJkxfTvz3N 3DMqjW81Fn0nN81rdrYP3WCcLE6ks3heWOkihtZZbQHNMkHXWD6/u6OydZEexaKOoSO2 FaH4WM8T9Z0EbdHNCGRwMVMVwHCKZ1RxZoFsfg/CmDFQRLFAoSEhjCWAwTSSvTTQfh2v B+/JvajmyW/Csa0GhVE1W8aPCM/8g5/buU0jbnK0Cp92vg8jaYp+e+zxP8UCTo+bj88Y Gkzc+rrgATBcQOyRN85vtBAL9d7dROFt6KBxYydsBpeycbdFURqVSYmY/P187Jiv987g MO1w== 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=kCvFyIF60tzPmtz4gtKG6yaANHbgdKH1t1woD6Dz7DA=; b=Ef2awQGl9PPM05ebzBdzxM6w8TWWWJlgA+C+taze5JpuXc1GZ/3pOOVOXIv3E+J7wm CeRIXqUpuIn+NolxH8VmzMFMMieQIbezfzIk49wocPgc/yMjogzS30XCWvqg8Yy8r+pn BI0bHQsJ17eyYIyDhqO5N4p3sLV5zzSeqr4IzCQPNb+ViEVHWL9I6VQbV8DKzLlUiQfC Vuxt44socp4si5Rxu8A1dzd2QpQmwAiLnWRC8IN0ZcAjwLAMcX3qd4HaSYwvQwqj9j/y UliS+TC65tbZBvd1upEs+WUIwvoqgU7XFfbjM7DLuGjV7dyLw/u2dA7GhcuuxIX2DEFP 1pkA== X-Gm-Message-State: AOUpUlFlECZArc9qkVSLpmJiHxx8HNa2uhtKamQOW8X7XCYS5CRtaZwo tTm4rcC8hS9wzqaE4aOHFCwhh45n X-Google-Smtp-Source: AAOMgpfUJjSLEFRSZxoGsUgYEU42HPs8Qa96k+7BudFbMMjZvjbcr6hEbqcT+SFgLvqDCuYrdZlXbQ== X-Received: by 2002:a17:902:6bc8:: with SMTP id m8-v6mr2291474plt.162.1532616061940; Thu, 26 Jul 2018 07:41:01 -0700 (PDT) Received: from localhost.localdomain (i153-145-22-9.s42.a013.ap.plala.or.jp. [153.145.22.9]) by smtp.gmail.com with ESMTPSA id p3-v6sm2649982pfo.130.2018.07.26.07.40.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Jul 2018 07:41:01 -0700 (PDT) From: Toshiaki Makita To: netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann Cc: Toshiaki Makita , Jesper Dangaard Brouer , Jakub Kicinski Subject: [PATCH v5 bpf-next 1/9] net: Export skb_headers_offset_update Date: Thu, 26 Jul 2018 23:40:24 +0900 Message-Id: <20180726144032.2116-2-toshiaki.makita1@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180726144032.2116-1-toshiaki.makita1@gmail.com> References: <20180726144032.2116-1-toshiaki.makita1@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Toshiaki Makita This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fd3cb1b247df..f6929688853a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1035,6 +1035,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, } struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); +void skb_headers_offset_update(struct sk_buff *skb, int off); int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority); void skb_copy_header(struct sk_buff *new, const struct sk_buff *old); diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 266b954f763e..f5670e6ab40c 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1291,7 +1291,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) } EXPORT_SYMBOL(skb_clone); -static void skb_headers_offset_update(struct sk_buff *skb, int off) +void skb_headers_offset_update(struct sk_buff *skb, int off) { /* Only adjust this if it actually is csum_start rather than csum */ if (skb->ip_summed == CHECKSUM_PARTIAL) @@ -1305,6 +1305,7 @@ static void skb_headers_offset_update(struct sk_buff *skb, int off) skb->inner_network_header += off; skb->inner_mac_header += off; } +EXPORT_SYMBOL(skb_headers_offset_update); void skb_copy_header(struct sk_buff *new, const struct sk_buff *old) {