Wed, Sep 30, 2015 at 08:00:40PM CEST, vivien.dide...@savoirfairelinux.com wrote:
<snip> >> diff --git a/include/net/switchdev.h b/include/net/switchdev.h >> index e11425e..a79a7f0 100644 >> --- a/include/net/switchdev.h >> +++ b/include/net/switchdev.h >> @@ -64,15 +64,23 @@ enum switchdev_obj_id { >> SWITCHDEV_OBJ_PORT_FDB, >> }; >> >> +struct switchdev_obj { >> +}; >> + >> /* SWITCHDEV_OBJ_PORT_VLAN */ >> struct switchdev_obj_vlan { >> + struct switchdev_obj obj; >> u16 flags; >> u16 vid_begin; >> u16 vid_end; >> }; >> >> +#define SWITCHDEV_OBJ_VLAN(obj) \ >> + container_of(obj, struct switchdev_obj_vlan, obj) >> + >> /* SWITCHDEV_OBJ_IPV4_FIB */ >> struct switchdev_obj_ipv4_fib { >> + struct switchdev_obj obj; >> u32 dst; >> int dst_len; >> struct fib_info *fi; >> @@ -82,18 +90,27 @@ struct switchdev_obj_ipv4_fib { >> u32 tb_id; >> }; >> >> +#define SWITCHDEV_OBJ_IPV4_FIB(obj) \ >> + container_of(obj, struct switchdev_obj_ipv4_fib, obj) > >Isn't there a collision to have a SWITCHDEV_OBJ_IPV4_FIB enum and a >SWITCHDEV_OBJ_IPV4_FIB macro? > >Maybe switchdev will support not only port-objects, but also switch chip >objects, so would it be good to make the distinction between them? e.g.: > > * struct switchdev_obj_port_vlan > * SWITCHDEV_OBJ_ID_PORT_VLAN > * SWITCHDEV_OBJ_PORT_VLAN(obj) > * ... > >What do you think? Sounds good. Will make adjustments. Thanks -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html