lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20151001062449.GA2153@nanopsycho.orion>
Date:	Thu, 1 Oct 2015 08:24:50 +0200
From:	Jiri Pirko <jiri@...nulli.us>
To:	Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Cc:	netdev@...r.kernel.org, davem@...emloft.net, idosch@...lanox.com,
	eladr@...lanox.com, sfeldma@...il.com, f.fainelli@...il.com,
	linux@...ck-us.net, andrew@...n.ch, Jiri Pirko <jiri@...lanox.com>
Subject: Re: [patch net-next] switchdev: bring back switchdev_obj and use it
 as a generic object param

Wed, Sep 30, 2015 at 08:00:40PM CEST, vivien.didelot@...oirfairelinux.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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ