diff --git a/drivers/net/ethernet/netronome/nfp/flower/action.c b/drivers/net/ethernet/netronome/nfp/flower/action.c index cfea8f790f957c366604758b45254fef1aaa9505..fbc052d5bb47bdce99f683e96e5a192c9c6bc211 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/action.c +++ b/drivers/net/ethernet/netronome/nfp/flower/action.c @@ -11,6 +11,7 @@ #include #include #include +#include #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; diff --git a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c index fb6442d820b56a148985d9f36d30b7a4d745eca8..5d641d7dabff37724ed3d84428827f17a636ad5b 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +++ b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c @@ -190,6 +190,8 @@ static bool nfp_tun_is_netdev_to_offload(struct net_device *netdev) return true; if (netif_is_vxlan(netdev)) return true; + if (netif_is_geneve(netdev)) + return true; return false; } diff --git a/include/net/geneve.h b/include/net/geneve.h index a7600ed55ea31fc680c6ec0952cb7dc86c0dd28f..fc6a7e0a874a9ff9da0f4eb023b1394723311b09 100644 --- a/include/net/geneve.h +++ b/include/net/geneve.h @@ -60,6 +60,12 @@ struct genevehdr { struct geneve_opt options[]; }; +static inline bool netif_is_geneve(const struct net_device *dev) +{ + return dev->rtnl_link_ops && + !strcmp(dev->rtnl_link_ops->kind, "geneve"); +} + #ifdef CONFIG_INET struct net_device *geneve_dev_create_fb(struct net *net, const char *name, u8 name_assign_type, u16 dst_port);