From patchwork Tue Feb 22 12:41:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Szycik X-Patchwork-Id: 12754988 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 31DCAC433EF for ; Tue, 22 Feb 2022 12:42:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231990AbiBVMm5 (ORCPT ); Tue, 22 Feb 2022 07:42:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231991AbiBVMm4 (ORCPT ); Tue, 22 Feb 2022 07:42:56 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B224A122F70 for ; Tue, 22 Feb 2022 04:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645533748; x=1677069748; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mo135wmiyBV1MyO7OEFoIfk7OQwDjj5fc99hb7inUI0=; b=OIdvyS3B9Qp9X77NB22mUzXs6rbvqw4F6XjPI+3l79un6quP+8ajGGs+ HqDU/GbYiq7r1o0ElQctcME6nDpDFcfbKO2IYYZ7kzvH66+7M4SNkOa/8 dQVMEVqVw5Wh/QCl1JrHiS7gyyBNBqFQgQCrQgCcWN12PdAiFbEQqe96Z z0dZvpqshhlSRfnYMv1Yhwmv61AQWJwRQMeNg6E0D4OC50fPEqd/Rq1pu ilwnWRcnSXFR0kLWdOklnRhAeNmpToZf8YflFi/fnMiHk06cNwX/FJt4P sEDWzymZPnOvA1vuCPXgz3/IDbABCEX1BQAP9Jve9Qe7MQyPmn4g3MNEz w==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="276292812" X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="276292812" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2022 04:42:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="779121570" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga005.fm.intel.com with ESMTP; 22 Feb 2022 04:42:26 -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 21MCg1xd021783; Tue, 22 Feb 2022 12:42:24 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 v8 5/7] gtp: Add support for checking GTP device type Date: Tue, 22 Feb 2022 13:41:50 +0100 Message-Id: <20220222124152.103039-6-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220222124152.103039-1-marcin.szycik@linux.intel.com> References: <20220222124152.103039-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