From patchwork Fri May 6 01:16:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martinez X-Patchwork-Id: 12840391 X-Patchwork-Delegate: kuba@kernel.org 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 9DAEEC433F5 for ; Fri, 6 May 2022 01:16:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387840AbiEFBUZ (ORCPT ); Thu, 5 May 2022 21:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387832AbiEFBUY (ORCPT ); Thu, 5 May 2022 21:20:24 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5961947AE8; Thu, 5 May 2022 18:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651799803; x=1683335803; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sNZqGjmuN50IzZBHHILw9e8gR/Dm5bu9RYfBrH+MqL0=; b=kl40wPkvRj08TOLZM61ZAtJfUKezJ6DYpEQgNuKicI/YoFM5r9Y6AD71 fktsYJa/97ue5Xrof2++oBb4tQH2Z5RKI1y/X0qA4+lcJvI8U+q5Kw1Bk wDz+x5SCnIs9xTMaLP4ROr+BAPLxXTbi9iMVolqaWgbla6DjIeGAmCj5a 9QJ5lAw7OjMJrEEX+kTJt5/mvNXJaLfjCRtFWSagtuQj+/ImsbKSgyWsN rpqWZQn2IL54wBlzTUi81aOKwphFv+wuC6k2kMA1EkhQ5MVLlxOOGLjTY uk+ADRvgoVNEHlEa9VrA7VYU8nE8biUv9LKlfNBOjJ9ROfHwsPVLcwF7B w==; X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="265902439" X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="265902439" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 18:16:43 -0700 X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="654482425" Received: from kdjohns3-mobl1.amr.corp.intel.com (HELO rmarti10-nuc3.hsd1.or.comcast.net) ([10.212.250.65]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 18:16:42 -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 v7 02/14] net: skb: introduce skb_data_area_size() Date: Thu, 5 May 2022 18:16:04 -0700 Message-Id: <20220506011616.1774805-3-ricardo.martinez@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220506011616.1774805-1-ricardo.martinez@linux.intel.com> References: <20220506011616.1774805-1-ricardo.martinez@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 3270cb72e4d8..bd667c0129ad 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_alloc(struct sock *sk, size_t size); struct ubuf_info *msg_zerocopy_realloc(struct sock *sk, size_t size, struct ubuf_info *uarg);