diff mbox

[net-next,2/2] bonding: use the correct ether type for alb

Message ID 1394710918-29540-3-git-send-email-vfalico@redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Veaceslav Falico March 13, 2014, 11:41 a.m. UTC
Currently it's using the wrong ETH_P_LOOP type, which is sometimes treated
as packet length instead of ether type (because it's 0x0060).

Use the new ETH_P_LOOPBACK type.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/net/bonding/bond_alb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 14, 2014, 6:29 p.m. UTC | #1
From: Veaceslav Falico <vfalico@redhat.com>
Date: Thu, 13 Mar 2014 12:41:58 +0100

> @@ -1005,7 +1005,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
>  	memset(&pkt, 0, size);
>  	ether_addr_copy(pkt.mac_dst, mac_addr);
>  	ether_addr_copy(pkt.mac_src, mac_addr);
> -	pkt.type = cpu_to_be16(ETH_P_LOOP);
> +	pkt.type = cpu_to_be16(ETH_P_LOOPBACK);

Had this really never worked properly at all?

It's been this way since the beginning of GIT history, and I imagine
since the learning packet code even existed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Veaceslav Falico March 14, 2014, 6:42 p.m. UTC | #2
On Fri, Mar 14, 2014 at 02:29:35PM -0400, David Miller wrote:
>From: Veaceslav Falico <vfalico@redhat.com>
>Date: Thu, 13 Mar 2014 12:41:58 +0100
>
>> @@ -1005,7 +1005,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
>>  	memset(&pkt, 0, size);
>>  	ether_addr_copy(pkt.mac_dst, mac_addr);
>>  	ether_addr_copy(pkt.mac_src, mac_addr);
>> -	pkt.type = cpu_to_be16(ETH_P_LOOP);
>> +	pkt.type = cpu_to_be16(ETH_P_LOOPBACK);
>
>Had this really never worked properly at all?

Yep, but only in cases where the hw/sw didn't filter out broken packets
*before* arp processing, as far as I can tell.

>
>It's been this way since the beginning of GIT history, and I imagine
>since the learning packet code even existed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 14, 2014, 7:12 p.m. UTC | #3
From: Veaceslav Falico <vfalico@redhat.com>
Date: Fri, 14 Mar 2014 19:42:52 +0100

> On Fri, Mar 14, 2014 at 02:29:35PM -0400, David Miller wrote:
>>From: Veaceslav Falico <vfalico@redhat.com>
>>Date: Thu, 13 Mar 2014 12:41:58 +0100
>>
>>> @@ -1005,7 +1005,7 @@ static void alb_send_lp_vid(struct slave *slave,
>>> u8 mac_addr[],
>>>  	memset(&pkt, 0, size);
>>>  	ether_addr_copy(pkt.mac_dst, mac_addr);
>>>  	ether_addr_copy(pkt.mac_src, mac_addr);
>>> -	pkt.type = cpu_to_be16(ETH_P_LOOP);
>>> +	pkt.type = cpu_to_be16(ETH_P_LOOPBACK);
>>
>>Had this really never worked properly at all?
> 
> Yep, but only in cases where the hw/sw didn't filter out broken
> packets
> *before* arp processing, as far as I can tell.

Hmmm... what I meant was, was anyone able to receive these packets?
I think the answer is no.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jay Vosburgh March 14, 2014, 7:27 p.m. UTC | #4
David Miller <davem@davemloft.net> wrote:

>From: Veaceslav Falico <vfalico@redhat.com>
>Date: Fri, 14 Mar 2014 19:42:52 +0100
>
>> On Fri, Mar 14, 2014 at 02:29:35PM -0400, David Miller wrote:
>>>From: Veaceslav Falico <vfalico@redhat.com>
>>>Date: Thu, 13 Mar 2014 12:41:58 +0100
>>>
>>>> @@ -1005,7 +1005,7 @@ static void alb_send_lp_vid(struct slave *slave,
>>>> u8 mac_addr[],
>>>>  	memset(&pkt, 0, size);
>>>>  	ether_addr_copy(pkt.mac_dst, mac_addr);
>>>>  	ether_addr_copy(pkt.mac_src, mac_addr);
>>>> -	pkt.type = cpu_to_be16(ETH_P_LOOP);
>>>> +	pkt.type = cpu_to_be16(ETH_P_LOOPBACK);
>>>
>>>Had this really never worked properly at all?
>> 
>> Yep, but only in cases where the hw/sw didn't filter out broken
>> packets
>> *before* arp processing, as far as I can tell.
>
>Hmmm... what I meant was, was anyone able to receive these packets?
>I think the answer is no.

	My recollection is that the intended target of the packets was
the switch the system was connected to, and their only function was to
update the MAC table of the switch (via the source MAC of the frame).

	How well they really work today is debateable (meaning that I'm
not even sure they're necessary, at least not as a regular
transmission), but I recall discussing this with somebody at Intel years
ago and these were evidently necessary at one time.

	The ETH_P_LOOP Linux ended up with was (again, as I recall) a
simplification of some kind of active monitoring system on the Intel ANS
product that the alb/tlb code was derived from, wherein some agent would
receive and reply to the frames.  The ANS product used ethertype 0x886d
for its probes, however.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Veaceslav Falico March 14, 2014, 7:47 p.m. UTC | #5
On Fri, Mar 14, 2014 at 03:12:33PM -0400, David Miller wrote:
>From: Veaceslav Falico <vfalico@redhat.com>
>Date: Fri, 14 Mar 2014 19:42:52 +0100
>
>> On Fri, Mar 14, 2014 at 02:29:35PM -0400, David Miller wrote:
>>>From: Veaceslav Falico <vfalico@redhat.com>
>>>Date: Thu, 13 Mar 2014 12:41:58 +0100
>>>
>>>> @@ -1005,7 +1005,7 @@ static void alb_send_lp_vid(struct slave *slave,
>>>> u8 mac_addr[],
>>>>  	memset(&pkt, 0, size);
>>>>  	ether_addr_copy(pkt.mac_dst, mac_addr);
>>>>  	ether_addr_copy(pkt.mac_src, mac_addr);
>>>> -	pkt.type = cpu_to_be16(ETH_P_LOOP);
>>>> +	pkt.type = cpu_to_be16(ETH_P_LOOPBACK);
>>>
>>>Had this really never worked properly at all?
>>
>> Yep, but only in cases where the hw/sw didn't filter out broken
>> packets
>> *before* arp processing, as far as I can tell.
>
>Hmmm... what I meant was, was anyone able to receive these packets?
>I think the answer is no.

Yep, as far as I can tell these packets would be dropped, however their
scope was only to update the CAM table and such on switches, which could
have worked, depending on the 'logic' level of their firmware.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 9cf836b6..060b611 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1005,7 +1005,7 @@  static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
 	memset(&pkt, 0, size);
 	ether_addr_copy(pkt.mac_dst, mac_addr);
 	ether_addr_copy(pkt.mac_src, mac_addr);
-	pkt.type = cpu_to_be16(ETH_P_LOOP);
+	pkt.type = cpu_to_be16(ETH_P_LOOPBACK);
 
 	skb = dev_alloc_skb(size);
 	if (!skb)