From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86113C43217 for ; Fri, 6 May 2022 18:13:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389298AbiEFSRA (ORCPT ); Fri, 6 May 2022 14:17:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349128AbiEFSQ7 (ORCPT ); Fri, 6 May 2022 14:16:59 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0009F6E8C9; Fri, 6 May 2022 11:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651860795; x=1683396795; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5tRyRBUhQ8XrZIZGVjzyOPxxqUoRekfMAqGRXkpYPL4=; b=J3GLD6Rwl4dnFPeiXYS70nYSqRa8RklKWgw6CURSPT6VHKPswUxv6ifj +RmoYTddBEkVnDZj7poNVI/h54wk4kla9F64Z5GzTgnyaJcZOCSWmWF2e tDhcB8e2JTEGzXUj2RUI3gCPwU7l+A9sbd2cmeM3syBcQIQvB5mGdNp4N aj3bvxR+wyrXv2Q+Lebq64nfVASxCo3O9p1k/vfUWvoWQjKlmvcdQTRor 9f+H0Kf0MqkDkAh8t0dneMskm164DL3t4fPIMHsVwEOhwixdhO/ZNvJrL 9pKamRGxSoMQQwJpkOduK/lFHJADqoMQtBHZbHkuXw28lbf7MYTl0gDS+ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267379026" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267379026" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 11:13:15 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="621931054" Received: from jpankrat-mobl.amr.corp.intel.com (HELO rmarti10-nuc3.hsd1.or.comcast.net) ([10.209.104.156]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 11:13:14 -0700 From: Ricardo Martinez To: netdev@vger.kernel.org, linux-wireless@vger.kernel.org Cc: kuba@kernel.org, davem@davemloft.net, johannes@sipsolutions.net, ryazanov.s.a@gmail.com, loic.poulain@linaro.org, m.chetan.kumar@intel.com, chandrashekar.devegowda@intel.com, linuxwwan@intel.com, chiranjeevi.rapolu@linux.intel.com, haijun.liu@mediatek.com, amir.hanania@intel.com, andriy.shevchenko@linux.intel.com, dinesh.sharma@intel.com, eliot.lee@intel.com, ilpo.johannes.jarvinen@intel.com, moises.veleta@intel.com, pierre-louis.bossart@intel.com, muralidharan.sethuraman@intel.com, Soumya.Prakash.Mishra@intel.com, sreehari.kancharla@intel.com, madhusmita.sahu@intel.com, Ricardo Martinez Subject: [PATCH net-next v8 02/14] net: skb: introduce skb_data_area_size() Date: Fri, 6 May 2022 11:12:58 -0700 Message-Id: <20220506181310.2183829-3-ricardo.martinez@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220506181310.2183829-1-ricardo.martinez@linux.intel.com> References: <20220506181310.2183829-1-ricardo.martinez@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Helper to calculate the linear data space in the skb. Signed-off-by: Ricardo Martinez Reviewed-by: Sergey Ryazanov --- include/linux/skbuff.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 5c2599e3fe7d..d58669d6cb91 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1665,6 +1665,11 @@ static inline void skb_set_end_offset(struct sk_buff *skb, unsigned int offset) } #endif +static inline unsigned int skb_data_area_size(struct sk_buff *skb) +{ + return skb_end_pointer(skb) - skb->data; +} + struct ubuf_info *msg_zerocopy_realloc(struct sock *sk, size_t size, struct ubuf_info *uarg); -- 2.25.1