mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-14 10:15:13 +00:00
net: add netif_is_geneve()
Add a helper function to determine if the type of a netdev is geneve based on its rtnl_link_ops. This allows drivers that may wish to offload tunnels to check the underlying type of the device. A recent patch added a similar helper to vxlan.h Signed-off-by: John Hurley <john.hurley@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
cea0604d3f
commit
1d10bd1676
1 changed files with 6 additions and 0 deletions
|
|
@ -60,6 +60,12 @@ struct genevehdr {
|
||||||
struct geneve_opt options[];
|
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
|
#ifdef CONFIG_INET
|
||||||
struct net_device *geneve_dev_create_fb(struct net *net, const char *name,
|
struct net_device *geneve_dev_create_fb(struct net *net, const char *name,
|
||||||
u8 name_assign_type, u16 dst_port);
|
u8 name_assign_type, u16 dst_port);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue