All of lore.kernel.org
 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, osmocom-net-gprs@lists.osmocom.org
Subject: [RFC PATCH net-next v4 2/6] gtp: Add support for checking GTP device type
Date: Fri,  4 Feb 2022 17:50:56 +0100	[thread overview]
Message-ID: <20220204165056.10572-1-marcin.szycik@linux.intel.com> (raw)
In-Reply-To: <20220204164929.10356-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>
---
 include/net/gtp.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/net/gtp.h b/include/net/gtp.h
index 0e16ebb2a82d..ae915dd33d20 100644
--- a/include/net/gtp.h
+++ b/include/net/gtp.h
@@ -27,6 +27,12 @@ struct gtp1_header {	/* According to 3GPP TS 29.060. */
 	__be32	tid;
 } __attribute__ ((packed));
 
+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.31.1


  parent reply	other threads:[~2022-02-04 16:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 16:49 [RFC PATCH net-next v4 0/6] ice: GTP support in switchdev Marcin Szycik
2022-02-04 16:50 ` [RFC PATCH net-next v4 1/6] gtp: Allow to create GTP device without FDs Marcin Szycik
2022-02-09  0:01   ` kernel test robot
2022-02-09  9:42   ` kernel test robot
2022-02-04 16:50 ` Marcin Szycik [this message]
2022-02-04 16:50 ` [RFC PATCH net-next v4 3/6] net/sched: Allow flower to match on GTP options Marcin Szycik
2022-02-04 16:51 ` [RFC PATCH net-next v4 4/6] gtp: Implement GTP echo response Marcin Szycik
2022-02-05 16:51   ` Harald Welte
2022-02-08 14:12     ` Drewek, Wojciech
2022-02-11  9:16       ` Harald Welte
2022-02-11 10:27         ` Drewek, Wojciech
2022-02-11 12:48           ` Drewek, Wojciech
2022-02-12 11:05             ` Harald Welte
2022-02-04 16:51 ` [RFC PATCH net-next v4 5/6] ice: Fix FV offset searching Marcin Szycik
2022-02-04 16:51   ` [Intel-wired-lan] " Marcin Szycik
2022-02-04 16:51 ` [RFC PATCH net-next v4 6/6] ice: Support GTP-U and GTP-C offload in switchdev Marcin Szycik
2022-02-04 16:51   ` [Intel-wired-lan] " 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=20220204165056.10572-1-marcin.szycik@linux.intel.com \
    --to=marcin.szycik@linux.intel.com \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.