From patchwork Fri Feb 18 14:53:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Szycik X-Patchwork-Id: 12751509 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 D43C4C433EF for ; Fri, 18 Feb 2022 14:59:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236509AbiBRO7R (ORCPT ); Fri, 18 Feb 2022 09:59:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236673AbiBRO6u (ORCPT ); Fri, 18 Feb 2022 09:58:50 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C69DEF3C for ; Fri, 18 Feb 2022 06:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645196237; x=1676732237; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HHQuBo/A8J+8leMFfb9Sfl3/Hr7HRhKWYzmIhrCEGVs=; b=VblPHLL6DNmbnfppyhbacz/aCei3HWJc1DvmEJ72P5LCkc8YW5esL/OZ kxsFQ5CXACi8yWkn+NOk+4nIvKwT96SFq0ZFOr7LSGZqMJGLQWEPH5pU0 V4HgYAZxmDH8dK5yW1c9b5pAWvh/uHDTFDdxxBEIMU5u2XIGPdLE3p+mt oU4M7m9mtEi9YFdrxNxNuqrcIg+z4frdiLslgg0kSKavKyGL8BXdvHbku fsk393/TIIt+oZ0Et9mIw+b8f/bmkXJ4E8UC6paqD7RXcOwTvfNVXbCi/ vNi4nB6LhvLX7CVLZ/uFeEo1sf/NmUxdRtXWRx/nYKbnrIEctGZ4Z8ecv w==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="314402494" X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="314402494" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2022 06:57:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="637761161" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by orsmga004.jf.intel.com with ESMTP; 18 Feb 2022 06:56:59 -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 21IEuw9P010575; Fri, 18 Feb 2022 14:56:58 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: [PATCH net-next v6 5/7] gtp: Add support for checking GTP device type Date: Fri, 18 Feb 2022 15:53:36 +0100 Message-Id: <20220218145336.7274-1-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220218145048.6718-1-marcin.szycik@linux.intel.com> References: <20220218145048.6718-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 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