From patchwork Fri Feb 11 17:55:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Szycik X-Patchwork-Id: 12743694 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 85F94C433F5 for ; Fri, 11 Feb 2022 17:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244187AbiBKR63 (ORCPT ); Fri, 11 Feb 2022 12:58:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352416AbiBKR6Z (ORCPT ); Fri, 11 Feb 2022 12:58:25 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B1A0CFF for ; Fri, 11 Feb 2022 09:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644602304; x=1676138304; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9G2ObfWLjRYdHDvEUMonE0x+ze1Oxowg9eesImwu/us=; b=fKMFL0YBFFhiWoBJNpwYgPdGSEBE+WM+gpv6Q1mlekKLJTV+pM+xReEW JPNNBnn/2xHRjrg0LYuZFG0Xhp6GYSD/IZSdbbAwi5XryMQznBTCNwJnM zRjAnQaAxvNkgPcHyQ2ktcd8CXET7IjCMJlbDKFiwqEt4kzm1apvosznu nbgcMiuQfpaZ2cyNdAnFPQ/R5nqPfkcx/AU7/oyl9Ii3hB7g5EPTUs7Tp wIoK22xbRAdQxHRVdg42AqJ3smKuILGRyoneXh1EIX/2N6lAlk1aQVHys /Wc6refoFhSOTYTv0BXV62h7SS2dThEr9Y2PGI2ZfUfXIHPLopvTihbLV A==; X-IronPort-AV: E=McAfee;i="6200,9189,10255"; a="230419874" X-IronPort-AV: E=Sophos;i="5.88,361,1635231600"; d="scan'208";a="230419874" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 09:58:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,361,1635231600"; d="scan'208";a="623284509" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by FMSMGA003.fm.intel.com with ESMTP; 11 Feb 2022 09:58:22 -0800 Received: from switcheroo.igk.intel.com (switcheroo.igk.intel.com [172.22.229.137]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 21BHwL2R017265; Fri, 11 Feb 2022 17:58:21 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, osmocom-net-gprs@lists.osmocom.org Subject: [RFC PATCH net-next v5 4/6] gtp: Add support for checking GTP device type Date: Fri, 11 Feb 2022 18:55:08 +0100 Message-Id: <20220211175508.7952-1-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220211175405.7651-1-marcin.szycik@linux.intel.com> References: <20220211175405.7651-1-marcin.szycik@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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