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] [thread-next>] [day] [month] [year] [list]
Message-ID: <53FDF879.1000504@intel.com>
Date:	Wed, 27 Aug 2014 08:25:45 -0700
From:	Alexander Duyck <alexander.h.duyck@...el.com>
To:	Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org
CC:	davem@...emloft.net, linville@...driver.com, jhs@...atatu.com,
	alexander.duyck@...il.com
Subject: Re: [PATCH net-next v4 01/13] net: dsa: reduce number of protocol
 hooks

On 08/25/2014 09:49 PM, Florian Fainelli wrote:
> DSA is currently registering one packet_type function per EtherType it
> needs to intercept in the receive path of a DSA-enabled Ethernet device.
> Right now we have three of them: trailer, DSA and eDSA, and there might
> be more in the future, this will not scale to the addition of new
> protocols.
> 
> This patch proceeds with adding a new layer of abstraction and two new
> functions:
> 
> dsa_switch_rcv() which will dispatch into the tag-protocol specific
> receive function implemented by net/dsa/tag_*.c
> 
> dsa_slave_xmit() which will dispatch into the tag-protocol specific
> transmit function implemented by net/dsa/tag_*.c
> 
> When we do create the per-port slave network devices, we iterate over
> the switch protocol to assign the DSA-specific receive and transmit
> operations.
> 
> This allows us to greatly simplify the check in eth_type_trans() and
> always override the skb->protocol with ETH_P_DSA for Ethernet switches
> tagged protocol, while also reducing the number repetitive slave
> netdevice_ops assignments.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
> Changes in v4:
> - introduce a level of indirection and dsa_device_ops to limit the
>   number of packet_type functions to just one and do the dispatching
>   in the core dsa code.
> 
> New patch in v3
> 

Just a thought, you might want to consider using a protocol value other
than ETH_P_DSA.  Maybe we should add a new value named ETH_P_XDSA for
this approach since what we are doing is a multiplexed DSA protocol now.

This would allow for much easier back-porting of this if needed and also
prevents us from possibly triggering any issues if there are any
user-space APIs that might be trying to capture packets based on the
protocol value.

Thanks,

Alex

--
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