From: Alexander Duyck <alexander.h.duyck@intel•com>
To: Florian Fainelli <f.fainelli@gmail•com>, netdev@vger•kernel.org
Cc: davem@davemloft•net, linville@tuxdriver•com, jhs@mojatatu•com,
alexander.duyck@gmail•com
Subject: Re: [PATCH net-next v4 01/13] net: dsa: reduce number of protocol hooks
Date: Wed, 27 Aug 2014 08:25:45 -0700 [thread overview]
Message-ID: <53FDF879.1000504@intel.com> (raw)
In-Reply-To: <1409028581-17399-2-git-send-email-f.fainelli@gmail.com>
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@gmail•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
next prev parent reply other threads:[~2014-08-27 15:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 4:49 [PATCH net-next v4 00/13] dsa: Broadcom Starfighter 2 switch support Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 01/13] net: dsa: reduce number of protocol hooks Florian Fainelli
2014-08-27 15:25 ` Alexander Duyck [this message]
2014-08-27 23:24 ` David Miller
2014-08-27 23:43 ` Florian Fainelli
2014-08-28 1:49 ` Alexander Duyck
2014-08-26 4:49 ` [PATCH net-next v4 02/13] net: phy: add generic UniMAC MDIO bus driver Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 03/13] net: phy: provide stub for fixed_phy_set_link_update Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 04/13] net: dsa: provide a switch device device tree node pointer Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 05/13] net: dsa: retain a per-port device_node pointer Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 06/13] net: dsa: allow for more complex PHY setups Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 07/13] net: dsa: allow switches to work without tagging Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 08/13] net: dsa: allow drivers to do link adjustment Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 09/13] net: dsa: allow updating fixed PHY link information Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 10/13] net: dsa: add Broadcom tag RX/TX handler Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 11/13] net: dsa: add Broadcom SF2 switch driver Florian Fainelli
2014-08-26 4:49 ` [PATCH net-next v4 12/13] Documentation: devicetree: update dsa binding with optional properties Florian Fainelli
2014-08-26 22:40 ` Sergei Shtylyov
2014-08-26 4:49 ` [PATCH net-next v4 13/13] Documentation: devicetree: add Broadcom Starfighter 2 binding Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53FDF879.1000504@intel.com \
--to=alexander.h.duyck@intel$(echo .)com \
--cc=alexander.duyck@gmail$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=f.fainelli@gmail$(echo .)com \
--cc=jhs@mojatatu$(echo .)com \
--cc=linville@tuxdriver$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox