Re: [RFC net-next v2 2/8] net: add netif_is_geneve()
On 10/29/2018 03:06 PM, John Hurley wrote: >>> 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 ofload tunnels >> >> Offload? >> > > offload encap/decap to a hardware device such as a smartNIC. > Sorry, should have made this clearer I was only reacting to your typo. :-) >>> to check the underlying type of the device. >>> >>> A recent patch added a similar helper to vxlan.h >>> >>> Signed-off-by: John Hurley >>> Reviewed-by: Jakub Kicinski >> [...] MBR, Sergei
Re: [RFC net-next v2 2/8] net: add netif_is_geneve()
On Fri, Oct 26, 2018 at 9:52 AM Sergei Shtylyov wrote: > > Hello! > > On 25.10.2018 15:26, John Hurley wrote: > > > 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 ofload tunnels > > Offload? > offload encap/decap to a hardware device such as a smartNIC. Sorry, should have made this clearer > > to check the underlying type of the device. > > > > A recent patch added a similar helper to vxlan.h > > > > Signed-off-by: John Hurley > > Reviewed-by: Jakub Kicinski > [...] > > MBR, Sergei > >
Re: [RFC net-next v2 2/8] net: add netif_is_geneve()
Hello! On 25.10.2018 15:26, John Hurley wrote: 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 ofload tunnels Offload? to check the underlying type of the device. A recent patch added a similar helper to vxlan.h Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski [...] MBR, Sergei
Re: [RFC net-next v2 2/8] net: add netif_is_geneve()
On Thu, Oct 25, 2018 at 2:00 PM Jiri Pirko wrote: > > Thu, Oct 25, 2018 at 02:26:51PM CEST, john.hur...@netronome.com wrote: > >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 ofload tunnels > >to check the underlying type of the device. > > > >A recent patch added a similar helper to vxlan.h > > > >Signed-off-by: John Hurley > >Reviewed-by: Jakub Kicinski > > I don't understand why this and the next patch are part of this > patchset. They don't seem directly related. This is used in later patches that implement the indirect block offload but I suppose it is not directly related. We can probably move it to a separate patchset. Thanks
Re: [RFC net-next v2 2/8] net: add netif_is_geneve()
Thu, Oct 25, 2018 at 02:26:51PM CEST, john.hur...@netronome.com wrote: >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 ofload tunnels >to check the underlying type of the device. > >A recent patch added a similar helper to vxlan.h > >Signed-off-by: John Hurley >Reviewed-by: Jakub Kicinski I don't understand why this and the next patch are part of this patchset. They don't seem directly related.
[RFC net-next v2 2/8] 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 ofload tunnels to check the underlying type of the device. A recent patch added a similar helper to vxlan.h Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski --- include/net/geneve.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/net/geneve.h b/include/net/geneve.h index a7600ed..fc6a7e0 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); -- 2.7.4