Subject: Re: [PATCH net-next v3 09/12] net: dsa: add Broadcom tag RX/TX handler

From: Alexander Duyck <[email-masked]>
Date: Mon, 25 Aug 2014 07:51:20 -0700

On 08/24/2014 07:37 PM, Florian Fainelli wrote:
> Le 24/08/2014 15:51, Alexander Duyck a écrit :
>> On 08/24/2014 11:44 AM, Florian Fainelli wrote:
>>> +
>>> +static int brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
>>> +            struct packet_type *pt, struct net_device *orig_dev)
>>> +{
>>> +    struct dsa_switch_tree *dst = dev->dsa_ptr;
>>> +    struct dsa_switch *ds;
>>> +    int source_port;
>>> +    u8 *brcm_tag;
>>> +
>>> +    if (unlikely(dst == NULL))
>>> +        goto out_drop;
>>> +
>>> +    ds = dst->ds[0];
>>> +
>>> +    skb = skb_unshare(skb, GFP_ATOMIC);
>>> +    if (skb == NULL)
>>> +        goto out;
>>
>> At this point here we already have the dsa pointers and could just pull
>> up a function pointer so all of the code below could potentially be
>> moved into a separate function allowing us to drop the need to have
>> multiple Ethertypes and so we could just use ETH_P_DSA for all DSA
>> tagging type.
> 
> I see, or rather maybe just use ETH_P_EDSA which is a real assigned
> ethertype?
> -- 
> Florian

I suppose we could probably do that.  Although I would probably say we
should just rename it to ETH_P_DSA since we can just go through and drop
all of the other defined Ethertypes for DSA.  In addition since the EDSA
isn't actually a registered type we probably don't need to bother with
conserving the name anyway.

Thanks,

Alex