netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcin Szycik <marcin.szycik@linux.intel.com>
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	[thread overview]
Message-ID: <20220222124152.103039-6-marcin.szycik@linux.intel.com> (raw)
In-Reply-To: <20220222124152.103039-1-marcin.szycik@linux.intel.com>

From: Wojciech Drewek <wojciech.drewek@intel.com>

Add a function that checks if a net device type is GTP.

Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Harald Welte <laforge@gnumonks.org>
---
 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


  parent reply	other threads:[~2022-02-22 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 12:41 [PATCH net-next v8 0/7] ice: GTP support in switchdev Marcin Szycik
2022-02-22 12:41 ` [PATCH net-next v8 1/7] gtp: Allow to create GTP device without FDs Marcin Szycik
2022-02-22 12:41 ` [PATCH net-next v8 2/7] gtp: Implement GTP echo response Marcin Szycik
2022-02-22 12:41 ` [PATCH net-next v8 3/7] gtp: Implement GTP echo request Marcin Szycik
2022-02-22 12:41 ` [PATCH net-next v8 4/7] net/sched: Allow flower to match on GTP options Marcin Szycik
2022-02-22 12:41 ` Marcin Szycik [this message]
2022-02-22 12:41 ` [PATCH net-next v8 6/7] ice: Fix FV offset searching Marcin Szycik
2022-02-22 12:41 ` [PATCH net-next v8 7/7] ice: Support GTP-U and GTP-C offload in switchdev Marcin Szycik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220222124152.103039-6-marcin.szycik@linux.intel.com \
    --to=marcin.szycik@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=laforge@gnumonks.org \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=osmocom-net-gprs@lists.osmocom.org \
    --cc=pablo@netfilter.org \
    --cc=wojciech.drewek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).