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: <20150827080110.GN2228@nanopsycho.orion>
Date:	Thu, 27 Aug 2015 10:01:10 +0200
From:	Jiri Pirko <jiri@...nulli.us>
To:	Scott Feldman <sfeldma@...il.com>
Cc:	Netdev <netdev@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Ido Schimmel <idosch@...lanox.com>, eladr@...lanox.com,
	"simon.horman@...ronome.com" <simon.horman@...ronome.com>,
	Jiri Pirko <jiri@...lanox.com>
Subject: Re: [patch net-next 3/6] net: add netif_is_ovs_master helper with
 IFF_OPENVSWITCH private flag

Thu, Aug 27, 2015 at 09:51:52AM CEST, sfeldma@...il.com wrote:
>On Wed, Aug 26, 2015 at 11:30 PM, Jiri Pirko <jiri@...nulli.us> wrote:
>> Thu, Aug 27, 2015 at 08:23:13AM CEST, sfeldma@...il.com wrote:
>>>On Wed, Aug 26, 2015 at 10:43 PM, Jiri Pirko <jiri@...nulli.us> wrote:
>>>> Wed, Aug 26, 2015 at 07:43:18PM CEST, sfeldma@...il.com wrote:
>>>>>On Wed, Aug 26, 2015 at 9:36 AM, Jiri Pirko <jiri@...nulli.us> wrote:
>>>>>> From: Jiri Pirko <jiri@...lanox.com>
>
>>>>>We're going to run out of priv_flags bits.  This flag doesn't seem
>>>>>like something that will be checked lots of places.  How about using
>>>>>rtnl_link_ops->kind to save a bit in priv_flags?
>>>>>
>>>>>static inline bool netif_is_ovs_master(const struct net_device *dev)
>>>>>{
>>>>>    return !strcmp(dev->rtnl_link_ops->kind, "openvswitch"));
>>>>>}
>>>>
>>>> There are lot of helpers like this for other soft-devices. I think that
>>>> is okay to have it this way. The thing is that sometimes you need to use
>>>> thi helper in fast path and in that case, you do not want to strcmp.
>>>>
>>>> There is plenty of priv_flags bits for now when I killed the bonding
>>>> stuff.
>>>
>>>Ya, but think about the bit: you (and others) used a bit in priv_flags
>>>to indicate the netdev type.  Can you add an enum field to
>>>rtnl_link_ops->type to indicate link type?  Then it's not a strcmp.
>>>You can write your helper using strcmp first, and then later migrate
>>>to using rtnl_link_ops->type.
>>
>>
>> Also, dev can be multiple things, it can be bridge port and vlan dev at
>> the same time. Flags are good for this.
>
>priv_flags bits are three types:
>
>1) dev attribute (IFF_XMIT_DST_RELEASE, IFF_DISABLE_NETPOLL, etc)
>2) dev type (IFF_802_1Q_VLAN, IFF_EBRIDGE, etc)
>3) and dev membership (IFF_BRIDGE_PORT, IFF_TEAM_PORT, etc)
>
>Are there types 2 or 3 in any fast paths?  Type 2 can move to enum;
>they're mutually exclusive.  Type 3 is the dev's master's type 2, and
>since dev can have only one master, no flag is needed: just look up
>master type to know if dev is bridged or ovs'ed.

3 is certainly used in fast-path.

This priv_flags stuff could certainly get better somehow. I don't think
that using rtnl_link_ops is the answer here. It is certainly out of scope
of this patchset.
--
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