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 D5FFCC433F5 for ; Thu, 24 Feb 2022 18:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233116AbiBXSzx (ORCPT ); Thu, 24 Feb 2022 13:55:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232284AbiBXSzw (ORCPT ); Thu, 24 Feb 2022 13:55:52 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA6E324FBA9 for ; Thu, 24 Feb 2022 10:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645728923; x=1677264923; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mo135wmiyBV1MyO7OEFoIfk7OQwDjj5fc99hb7inUI0=; b=cZMPVUoTJZTK8ywWBerPqXMYu1TpJu4mtnDS9RZPc6r/fEd5iJUqhG9F os2xSafQiQdG/fv87B+VCNw46y2krXrg3IpNTIt/KoIY3S/Vq5Zw0Zgae c7/Z4gWN92Kenm9ExI9/s5PbjEboZHIgFc6bG0nuCjhHD09Yy5c3z/nBu l/E2VwQLz4GmIzeILDZh+l13E7dT+nTf4YiBHMSK6yA2YmzhaECAaljOS V4QRZ9JmpSlx26m4kDT62JKIRSDDuiL+DN1dik7UHD8kX+3nTmXfghi+M 5VhT7s8sxUAVfiPg5ndEPPlCKIuultQWTbi7c8fFC9ef55Jmsa1tnt1NI A==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="232295702" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="232295702" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 10:55:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="684383863" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga001.fm.intel.com with ESMTP; 24 Feb 2022 10:55:18 -0800 Received: from rozewie.igk.intel.com (rozewie.igk.intel.com [10.211.8.69]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 21OIt5Z2018029; Thu, 24 Feb 2022 18:55:17 GMT From: Marcin Szycik To: netdev@vger.kernel.org Cc: michal.swiatkowski@linux.intel.com, wojciech.drewek@intel.com, davem@davemloft.net, kuba@kernel.org, pablo@netfilter.org, laforge@gnumonks.org, jiri@resnulli.us, osmocom-net-gprs@lists.osmocom.org, intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next v9 5/7] gtp: Add support for checking GTP device type Date: Thu, 24 Feb 2022 19:54:58 +0100 Message-Id: <20220224185500.18384-6-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220224185500.18384-1-marcin.szycik@linux.intel.com> References: <20220224185500.18384-1-marcin.szycik@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Wojciech Drewek Add a function that checks if a net device type is GTP. Signed-off-by: Wojciech Drewek Reviewed-by: Harald Welte --- include/net/gtp.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/net/gtp.h b/include/net/gtp.h index 23c2aaae8a42..c1d6169df331 100644 --- a/include/net/gtp.h +++ b/include/net/gtp.h @@ -63,6 +63,12 @@ struct gtp_pdu_session_info { /* According to 3GPP TS 38.415. */ u8 qfi; }; +static inline bool netif_is_gtp(const struct net_device *dev) +{ + return dev->rtnl_link_ops && + !strcmp(dev->rtnl_link_ops->kind, "gtp"); +} + #define GTP1_F_NPDU 0x01 #define GTP1_F_SEQ 0x02 #define GTP1_F_EXTHDR 0x04 -- 2.35.1