From: John Hurley <john.hurley@netronome.com>
To: netdev@vger.kernel.org, davem@davemloft.net,
oss-drivers@netronome.com, jakub.kicinski@netronome.com
Cc: John Hurley <john.hurley@netronome.com>
Subject: [PATCH net-next 2/3] nfp: flower: use geneve and vxlan helpers
Date: Wed, 7 Nov 2018 18:32:49 +0000 [thread overview]
Message-ID: <1541615570-523-3-git-send-email-john.hurley@netronome.com> (raw)
In-Reply-To: <1541615570-523-1-git-send-email-john.hurley@netronome.com>
Make use of the recently added VXLAN and geneve helper functions to
determine the type of the netdev from its rtnl_link_ops.
Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
drivers/net/ethernet/netronome/nfp/flower/action.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/flower/action.c b/drivers/net/ethernet/netronome/nfp/flower/action.c
index 244dc26..2f67cd55 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/action.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/action.c
@@ -11,6 +11,7 @@
#include <net/tc_act/tc_pedit.h>
#include <net/tc_act/tc_vlan.h>
#include <net/tc_act/tc_tunnel_key.h>
+#include <net/vxlan.h>
#include "cmsg.h"
#include "main.h"
@@ -94,13 +95,10 @@ nfp_fl_pre_lag(struct nfp_app *app, const struct tc_action *action,
static bool nfp_fl_netdev_is_tunnel_type(struct net_device *out_dev,
enum nfp_flower_tun_type tun_type)
{
- if (!out_dev->rtnl_link_ops)
- return false;
-
- if (!strcmp(out_dev->rtnl_link_ops->kind, "vxlan"))
+ if (netif_is_vxlan(out_dev))
return tun_type == NFP_FL_TUNNEL_VXLAN;
- if (!strcmp(out_dev->rtnl_link_ops->kind, "geneve"))
+ if (netif_is_geneve(out_dev))
return tun_type == NFP_FL_TUNNEL_GENEVE;
return false;
--
2.7.4
next prev parent reply other threads:[~2018-11-08 4:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 18:32 [PATCH net-next 0/3] nfp: add and use tunnel netdev helpers John Hurley
2018-11-07 18:32 ` [PATCH net-next 1/3] net: add netif_is_geneve() John Hurley
2018-11-07 18:32 ` John Hurley [this message]
2018-11-07 18:32 ` [PATCH net-next 3/3] nfp: flower: include geneve as supported offload tunnel type John Hurley
2018-11-08 7:00 ` [PATCH net-next 0/3] nfp: add and use tunnel netdev helpers David Miller
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=1541615570-523-3-git-send-email-john.hurley@netronome.com \
--to=john.hurley@netronome.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.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).