From patchwork Fri Mar 4 16:40:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Szycik X-Patchwork-Id: 1601264 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=fatEM2Hh; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K9DC03jf6z9s2R for ; Sat, 5 Mar 2022 03:41:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DDE6B404A5; Fri, 4 Mar 2022 16:41:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f07Un6kGcTbx; Fri, 4 Mar 2022 16:41:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 12CCE416BE; Fri, 4 Mar 2022 16:41:30 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0DD621BF275 for ; Fri, 4 Mar 2022 16:41:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id EE8EA40335 for ; Fri, 4 Mar 2022 16:41:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hfY6Dr-iKtOY for ; Fri, 4 Mar 2022 16:41:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by smtp4.osuosl.org (Postfix) with ESMTPS id 677AB40422 for ; Fri, 4 Mar 2022 16:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646412072; x=1677948072; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mo135wmiyBV1MyO7OEFoIfk7OQwDjj5fc99hb7inUI0=; b=fatEM2Hh5pHSXtmS5cpr04Jv+K8pjiEDiChfwi3u8bNSimoQjeXjWTMW gm7a81Y45TVpj3OmG0nriVi2kS6Ijy00K++eHex8ro07DUUXybFpwquTM L4idO1xbb/tp3zTvzp2R6Q2dS0+PIvJFWjVPilLWxtTYpKyOP8lFBH9iH 3uEOUQ5yGxgRbmMynxnOPe5Cu3I96EZlBJunkJpNXy7dZ8ZV7lWY0ByjV dDjWNNL271agah0a3OrKddmdccS576GKps/kThQYHfyzuwNTh/MwQpLAj csHLaK5FThhRXQb7u5Cf0CbRehmPY3Wg8FkB77VzuzTEp7mOcBlDrA2vV w==; X-IronPort-AV: E=McAfee;i="6200,9189,10276"; a="254203716" X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="254203716" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 08:41:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="642560949" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by orsmga004.jf.intel.com with ESMTP; 04 Mar 2022 08:41:07 -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 224Gf12L020994; Fri, 4 Mar 2022 16:41:06 GMT From: Marcin Szycik To: netdev@vger.kernel.org Date: Fri, 4 Mar 2022 17:40:46 +0100 Message-Id: <20220304164048.476900-6-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220304164048.476900-1-marcin.szycik@linux.intel.com> References: <20220304164048.476900-1-marcin.szycik@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH net-next v10 5/7] gtp: Add support for checking GTP device type X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jiri@resnulli.us, xiyou.wangcong@gmail.com, osmocom-net-gprs@lists.osmocom.org, jhs@mojatatu.com, laforge@gnumonks.org, intel-wired-lan@lists.osuosl.org, kuba@kernel.org, davem@davemloft.net, pablo@netfilter.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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