Skip to contentSkip to conversation

https://lkml.org/lkml/2013/2/1/531

DISCUSSION Smart Weblications GmbH - Florian Wiessner 7 participants 24 messages May 22, 2013 – Jun 20, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

why is this patch still not backported to 3.4?

I today tried 3.4.46 from kernel.org, but the patch STILL seems _NOT_ included?

WHY IS THAT?

====== 3.4 Series ======
diff -uprN linux-3.4.28/drivers/net/bonding/bond_alb.c linux-3.4.28-patched/drivers/net/bonding/bond_alb.c
--- linux-3.4.28/drivers/net/bonding/bond_alb.c 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/drivers/net/bonding/bond_alb.c 2013-01-30
15:37:25.121708311 -0500
@@ -704,6 +704,12 @@ static struct slave *rlb_arp_xmit(struct

     struct arp_pkt *arp = arp_pkt(skb);
     struct slave *tx_slave = NULL;

+ /* Don't modify or load balance ARPs that do not originate locally
+ * (e.g.,arrive via a bridge).
+ */
+ if (!bond_slave_has_mac(bond, arp->mac_src))
+ return NULL;
+

     if (arp->op_code == htons(ARPOP_REPLY)) {
         /* the arp must be sent on the selected
         * rx channel

diff -uprN linux-3.4.28/drivers/net/bonding/bonding.h linux-3.4.28-patched/drivers/net/bonding/bonding.h
--- linux-3.4.28/drivers/net/bonding/bonding.h 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/drivers/net/bonding/bonding.h 2013-01-30
15:37:25.121708311 -0500
@@ -18,6 +18,7 @@
#include <linux/timer.h>
#include <linux/proc_fs.h>
#include <linux/if_bonding.h>
+#include <linux/etherdevice.h>
#include <linux/cpumask.h>
#include <linux/in6.h>
#include <linux/netpoll.h>
@@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir
}
#endif

+static inline struct slave *bond_slave_has_mac(struct bonding *bond,
+ const u8 *mac)
+{
+ int i = 0;
+ struct slave *tmp;
+
+ bond_for_each_slave(bond, tmp, i)
+ if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
+ return tmp;
+
+ return NULL;
+}

/* exported from bond_main.c */
extern int bond_net_id;
diff -uprN linux-3.4.28/include/linux/etherdevice.h linux-3.4.28-patched/include/linux/etherdevice.h
--- linux-3.4.28/include/linux/etherdevice.h 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/include/linux/etherdevice.h 2013-01-30
15:37:25.121708311 -0500
@@ -277,4 +277,37 @@ static inline unsigned long compare_ethe
#endif
}

+/**
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
+ * @addr1: Pointer to an array of 8 bytes
+ * @addr2: Pointer to an other array of 8 bytes
+ *
+ * Compare two Ethernet addresses, returns true if equal, false otherwise.
+ *
+ * The function doesn't need any conditional branches and possibly uses
+ * word memory accesses on CPU allowing cheap unaligned memory reads.
+ * arrays = { byte1, byte2, byte3, byte4, byte5, byte6, pad1, pad2 }
+ *
+ * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
+ */
+
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+ const u8 addr2[6+2])
+{
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+ unsigned long fold = ((*(unsigned long *)addr1) ^
+ (*(unsigned long *)addr2));
+
+ if (sizeof(fold) == 8)
+ return zap_last_2bytes(fold) == 0;
+
+ fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
+ (*(unsigned long *)(addr2 + 4)));
+ return fold == 0;
+#else
+ return ether_addr_equal(addr1, addr2);
+#endif
+}
+
+
#endif /* _LINUX_ETHERDEVICE_H */

Signature · 18 lines
Mit freundlichen Grᅵᅵen,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Geschᅵftsfᅵhrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
maintainer
#1 lore raw
Quoted 9 lines · Smart Weblications GmbH - Florian Wiessner

Hi,

why is this patch still not backported to 3.4?

I today tried 3.4.46 from kernel.org, but the patch STILL seems _NOT_ included?

WHY IS THAT?

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

</formletter>

#2 lore raw

Hi,

Am 22.05.2013 15:57, schrieb Greg KH:

Quoted 11 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 9 lines

Hi,

why is this patch still not backported to 3.4?

I today tried 3.4.46 from kernel.org, but the patch STILL seems _NOT_ included?

WHY IS THAT?

Quoted 8 lines

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

</formletter>

I don't want to submit a patch - i wanted to know why this patch still is not in the kernel (it is afaics at least 6 months old!)

Signature · 18 lines
Mit freundlichen Grüßen,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Geschäftsführer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
maintainer
#3 lore raw
Quoted 16 lines · Smart Weblications GmbH - Florian Wiessner

Am 22.05.2013 15:57, schrieb Greg KH:

Quoted 15 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 7 lines

Hi,

why is this patch still not backported to 3.4?

I today tried 3.4.46 from kernel.org, but the patch STILL seems _NOT_ included?

WHY IS THAT?

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

Quoted 6 lines
Quoted 2 lines

</formletter>

I don't want to submit a patch - i wanted to know why this patch still is not in the kernel (it is afaics at least 6 months old!)

Perhaps because it was not submitted properly as documented above?

thanks,

greg k-h

#4 lore raw

Hi,

Am 22.05.2013 18:23, schrieb Greg KH:

Quoted 17 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 16 lines

Am 22.05.2013 15:57, schrieb Greg KH:

Quoted 15 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 7 lines

Hi,

why is this patch still not backported to 3.4?

I today tried 3.4.46 from kernel.org, but the patch STILL seems _NOT_ included?

WHY IS THAT?

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

</formletter>

I don't want to submit a patch - i wanted to know why this patch still is not in the kernel (it is afaics at least 6 months old!)

Perhaps because it was not submitted properly as documented above?

Well, i don't know. I have not written that patch, but tested and applied it against 3.4.36 where it worked fine.

But i am unable to apply it to 3.4.46 (there are rejects if i try to apply it, obviously because there were changes in the meanwhile) - It would be cool if someone could tell if that patch is really needed anymore with 3.4.46.

I am no C coder and only have little C experience, but i'd like to use this patch with current 3.4 stable Kernel or at least make sure that this patch is not needed anymore with current stable kernels...

Signature · 18 lines
Mit freundlichen Gr��en,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Gesch�ftsf�hrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
maintainer
#5 lore raw
Quoted 34 lines · Smart Weblications GmbH - Florian Wiessner

Hi,

Am 22.05.2013 18:23, schrieb Greg KH:

Quoted 17 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 16 lines

Am 22.05.2013 15:57, schrieb Greg KH:

Quoted 15 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 7 lines

Hi,

why is this patch still not backported to 3.4?

I today tried 3.4.46 from kernel.org, but the patch STILL seems _NOT_ included?

WHY IS THAT?

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

</formletter>

I don't want to submit a patch - i wanted to know why this patch still is not in the kernel (it is afaics at least 6 months old!)

Perhaps because it was not submitted properly as documented above?

Well, i don't know. I have not written that patch, but tested and applied it against 3.4.36 where it worked fine.

Quoted 7 lines

But i am unable to apply it to 3.4.46 (there are rejects if i try to apply it, obviously because there were changes in the meanwhile) - It would be cool if someone could tell if that patch is really needed anymore with 3.4.46.

I am no C coder and only have little C experience, but i'd like to use this patch with current 3.4 stable Kernel or at least make sure that this patch is not needed anymore with current stable kernels...

Why do you think that it is needed? And does it match up to a specific change that is already in Linus's tree? That is a requirement here.

thanks,

greg k-h

#6 lore raw

Hi Greg,

Quoted 5 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 5 lines

Hi,

Am 22.05.2013 18:23, schrieb Greg KH:

Quoted 1 line

On Wed, May 22, 2013 at 06:16:11PM +0200, Smart Weblications GmbH - Florian

Quoted 2 lines · Wiessner
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Am 22.05.2013 15:57, schrieb Greg KH:

Quoted 1 line

On Wed, May 22, 2013 at 01:36:09PM +0200, Smart Weblications GmbH -

Quoted 5 lines · Florian Wiessner
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Hi,

why is this patch still not backported to 3.4?

I today tried 3.4.46 from kernel.org, but the patch STILL seems _NOT_

included?

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

WHY IS THAT?

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

</formletter>

I don't want to submit a patch - i wanted to know why this patch still is

not in

Quoted 12 lines
Quoted 12 lines
Quoted 4 lines
Quoted 1 line

the kernel (it is afaics at least 6 months old!)

Perhaps because it was not submitted properly as documented above?

Well, i don't know. I have not written that patch, but tested and applied it against 3.4.36 where it worked fine.

But i am unable to apply it to 3.4.46 (there are rejects if i try to apply it, obviously because there were changes in the meanwhile) - It would be cool if someone could tell if that patch is really needed anymore with 3.4.46.

Quoted 7 lines
Quoted 3 lines

I am no C coder and only have little C experience, but i'd like to use this patch with current 3.4 stable Kernel or at least make sure that this patch is not needed anymore with current stable kernels...

Why do you think that it is needed? And does it match up to a specific change that is already in Linus's tree? That is a requirement here.

It is needed, because without it (at least in 3.4.36) virtualized guests (kvm/qemu) are unable to use br0 (bridge) if the bridge uses a bond with mode 6 (balance-alb).

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jkirsher/net-next/+/567b871e503316b0927e54a3d7c86d50b722d955%5E!/

http://lkml.indiana.edu/hypermail/linux/kernel/1302.0/00539.html

Thanks,

Signature · 18 lines
Mit freundlichen Gr��en,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Gesch�ftsf�hrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
maintainer
#7 lore raw
Quoted 54 lines · Smart Weblications GmbH - Florian Wiessner

Hi Greg,

Quoted 5 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 5 lines

Hi,

Am 22.05.2013 18:23, schrieb Greg KH:

Quoted 1 line

On Wed, May 22, 2013 at 06:16:11PM +0200, Smart Weblications GmbH - Florian

Quoted 2 lines · Wiessner
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Am 22.05.2013 15:57, schrieb Greg KH:

Quoted 1 line

On Wed, May 22, 2013 at 01:36:09PM +0200, Smart Weblications GmbH -

Quoted 5 lines · Florian Wiessner
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Hi,

why is this patch still not backported to 3.4?

I today tried 3.4.46 from kernel.org, but the patch STILL seems _NOT_

included?

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

WHY IS THAT?

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

</formletter>

I don't want to submit a patch - i wanted to know why this patch still is

not in

Quoted 12 lines
Quoted 12 lines
Quoted 4 lines
Quoted 1 line

the kernel (it is afaics at least 6 months old!)

Perhaps because it was not submitted properly as documented above?

Well, i don't know. I have not written that patch, but tested and applied it against 3.4.36 where it worked fine.

But i am unable to apply it to 3.4.46 (there are rejects if i try to apply it, obviously because there were changes in the meanwhile) - It would be cool if someone could tell if that patch is really needed anymore with 3.4.46.

Quoted 7 lines
Quoted 3 lines

I am no C coder and only have little C experience, but i'd like to use this patch with current 3.4 stable Kernel or at least make sure that this patch is not needed anymore with current stable kernels...

Why do you think that it is needed? And does it match up to a specific change that is already in Linus's tree? That is a requirement here.

Quoted 5 lines

It is needed, because without it (at least in 3.4.36) virtualized guests (kvm/qemu) are unable to use br0 (bridge) if the bridge uses a bond with mode 6 (balance-alb).

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jkirsher/net-next/+/567b871e503316b0927e54a3d7c86d50b722d955%5E!/

Ok, that's what we need.

Now, please cc: the developers / maintainers of that patch and ask them to have it included in the 3.4-stable kernel series.

Then, if they agree, the network maintainer will pick it up and send it to me for inclusion.

thanks,

greg k-h

#8 lore raw

Hi Greg,

Am 22.05.2013 22:04, schrieb Greg KH:

Quoted 11 lines
Quoted 2 lines

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jkirsher/net-next/+/567b871e503316b0927e54a3d7c86d50b722d955%5E!/

Ok, that's what we need.

Now, please cc: the developers / maintainers of that patch and ask them to have it included in the 3.4-stable kernel series.

Then, if they agree, the network maintainer will pick it up and send it to me for inclusion.

i set committer David S. Miller <[email protected]> in cc already, but do not
know the network maintainer...

this seems to me that "Matthew O'Connor" <[email protected]> sent this to netdev on 2013-02-01:

http://lists.openwall.net/netdev/2013/02/01/86

but i couldn't find a trace of the patch in 3.4.36?!

Instead, i read another try to get it backported fail:

http://permalink.gmane.org/gmane.linux.network/264198

Signature · 18 lines
Mit freundlichen Gr��en,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Gesch�ftsf�hrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
#9 lore raw
Quoted 18 lines · Smart Weblications GmbH - Florian Wiessner

Am 22.05.2013 22:04, schrieb Greg KH:

Quoted 11 lines
Quoted 2 lines

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jkirsher/net-next/+/567b871e503316b0927e54a3d7c86d50b722d955%5E!/

Ok, that's what we need.

Now, please cc: the developers / maintainers of that patch and ask them to have it included in the 3.4-stable kernel series.

Then, if they agree, the network maintainer will pick it up and send it to me for inclusion.

i set committer David S. Miller <[email protected]> in cc already, but do not
know the network maintainer...

Quoted 6 lines

this seems to me that "Matthew O'Connor" <[email protected]> sent this to netdev on 2013-02-01:

http://lists.openwall.net/netdev/2013/02/01/86

but i couldn't find a trace of the patch in 3.4.36?!

The patch in question here is in net-next; the commit is:

commit 567b871e503316b0927e54a3d7c86d50b722d955

Author: zheng.li <[email protected]>
Date:   Tue Nov 27 23:57:04 2012 +0000

bonding: rlb mode of bond should not alter ARP originating via bridge

The additional change in the backport from Matthew O'Connor (to
add ether_addr_equal_64bits) appears to still be necessary for 3.4.46. Alternatively, the patch could utilize ether_addr_equal instead, to minimize the change set. Greg, do you have a preference there?

Submissions for stable from networking normally go through
Davem; I can check the patch and repost it to netdev against 3.4.46 if everybody is ok with that.

	-J

---
-Jay Vosburgh, IBM Linux Technology Center, [email protected]

#10 lore raw

Am 22.05.2013 23:54, schrieb Jay Vosburgh:

Quoted 36 lines
Quoted 18 lines · Smart Weblications GmbH - Florian Wiessner

Am 22.05.2013 22:04, schrieb Greg KH:

Quoted 11 lines
Quoted 2 lines

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jkirsher/net-next/+/567b871e503316b0927e54a3d7c86d50b722d955%5E!/

Ok, that's what we need.

Now, please cc: the developers / maintainers of that patch and ask them to have it included in the 3.4-stable kernel series.

Then, if they agree, the network maintainer will pick it up and send it to me for inclusion.

i set committer David S. Miller <[email protected]> in cc already, but do not
know the network maintainer...

Quoted 6 lines

this seems to me that "Matthew O'Connor" <[email protected]> sent this to netdev on 2013-02-01:

http://lists.openwall.net/netdev/2013/02/01/86

but i couldn't find a trace of the patch in 3.4.36?!

The patch in question here is in net-next; the commit is:

commit 567b871e503316b0927e54a3d7c86d50b722d955

Author: zheng.li <[email protected]>
Date:   Tue Nov 27 23:57:04 2012 +0000

bonding: rlb mode of bond should not alter ARP originating via bridge

Quoted 9 lines

The additional change in the backport from Matthew O'Connor (to
add ether_addr_equal_64bits) appears to still be necessary for 3.4.46. Alternatively, the patch could utilize ether_addr_equal instead, to minimize the change set. Greg, do you have a preference there?

Submissions for stable from networking normally go through
Davem; I can check the patch and repost it to netdev against 3.4.46 if everybody is ok with that.

i would be happy if someone could provide a patch that works against 3.4.46

thank you.

Signature · 18 lines
Mit freundlichen Grᅵᅵen,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Geschᅵftsfᅵhrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
maintainer
#11 lore raw
In reply to Jay Vosburgh
Quoted 33 lines · Jay Vosburgh
Quoted 18 lines · Smart Weblications GmbH - Florian Wiessner

Am 22.05.2013 22:04, schrieb Greg KH:

Quoted 11 lines
Quoted 2 lines

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jkirsher/net-next/+/567b871e503316b0927e54a3d7c86d50b722d955%5E!/

Ok, that's what we need.

Now, please cc: the developers / maintainers of that patch and ask them to have it included in the 3.4-stable kernel series.

Then, if they agree, the network maintainer will pick it up and send it to me for inclusion.

i set committer David S. Miller <[email protected]> in cc already, but do not
know the network maintainer...

Quoted 6 lines

this seems to me that "Matthew O'Connor" <[email protected]> sent this to netdev on 2013-02-01:

http://lists.openwall.net/netdev/2013/02/01/86

but i couldn't find a trace of the patch in 3.4.36?!

The patch in question here is in net-next; the commit is:

commit 567b871e503316b0927e54a3d7c86d50b722d955

Author: zheng.li <[email protected]>
Date:   Tue Nov 27 23:57:04 2012 +0000
Quoted 7 lines

bonding: rlb mode of bond should not alter ARP originating via bridge

The additional change in the backport from Matthew O'Connor (to
add ether_addr_equal_64bits) appears to still be necessary for 3.4.46. Alternatively, the patch could utilize ether_addr_equal instead, to minimize the change set. Greg, do you have a preference there?

What ever matches upstream is best.

Quoted 3 lines

Submissions for stable from networking normally go through
Davem; I can check the patch and repost it to netdev against 3.4.46 if everybody is ok with that.

Yes, I need networking stable patches to come to me from David.

thanks,

greg k-h

#12 lore raw
In reply to Smart Weblications GmbH - Florian Wiessner

This is the backported patch I submitted previously. Hopefully this time around it won't be too messed up, I'm using Thunderbird instead of the web interface. I have applied it successfully and without warnings against 3.4.46. It builds, but is otherwise untested beyond what I did when I originally submitted back in Feb. This patch applies only to the 3.4 series kernel, although with minor changes it will work for 3.0, 3.2, and 3.7. If you're interested, I can submit the other patches shortly. If this submission still does not conform to standards, please let me know where I went wrong. For what it's worth I dropped the patch contents directly into the email, but I can attach it instead if that would work better.

[ Upstream commit 567b871e503316b0927e54a3d7c86d50b722d955 ]

bonding: rlb mode of bond should not alter ARP originating via bridge

Do not modify or load balance ARP packets passing through balance-alb mode (wherein the ARP did not originate locally, and arrived via a bridge).

Modifying pass-through ARP replies causes an incorrect MAC address to be placed into the ARP packet, rendering peers unable to communicate with the actual destination from which the ARP reply originated.

Load balancing pass-through ARP requests causes an entry to be created for the peer in the rlb table, and bond_alb_monitor will occasionally issue ARP updates to all peers in the table instrucing them as to which MAC address they should communicate with; this occurs when some event sets rx_ntt. In the bridged case, however, the MAC address used for the update would be the MAC of the slave, not the actual source MAC of the originating destination. This would render peers unable to communicate with the destinations beyond the bridge.

CC Zheng Li <[email protected]>
Cc Jay Vosburgh <[email protected]>
Cc Andy Gospodarek <[email protected]>
Cc "David S. Miller" <[email protected]>

diff -uprN linux-3.4.28/drivers/net/bonding/bond_alb.c linux-3.4.28-patched/drivers/net/bonding/bond_alb.c
--- linux-3.4.28/drivers/net/bonding/bond_alb.c 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/drivers/net/bonding/bond_alb.c 2013-01-30
15:37:25.121708311 -0500
@@ -704,6 +704,12 @@ static struct slave *rlb_arp_xmit(struct

     struct arp_pkt *arp = arp_pkt(skb);
     struct slave *tx_slave = NULL;

+ /* Don't modify or load balance ARPs that do not originate locally
+ * (e.g.,arrive via a bridge).
+ */
+ if (!bond_slave_has_mac(bond, arp->mac_src))
+ return NULL;
+

     if (arp->op_code == htons(ARPOP_REPLY)) {
         /* the arp must be sent on the selected
         * rx channel

diff -uprN linux-3.4.28/drivers/net/bonding/bonding.h linux-3.4.28-patched/drivers/net/bonding/bonding.h
--- linux-3.4.28/drivers/net/bonding/bonding.h 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/drivers/net/bonding/bonding.h 2013-01-30
15:37:25.121708311 -0500
@@ -18,6 +18,7 @@
#include <linux/timer.h>
#include <linux/proc_fs.h>
#include <linux/if_bonding.h>
+#include <linux/etherdevice.h>
#include <linux/cpumask.h>
#include <linux/in6.h>
#include <linux/netpoll.h>
@@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir
}
#endif

+static inline struct slave *bond_slave_has_mac(struct bonding *bond,
+ const u8 *mac)
+{
+ int i = 0;
+ struct slave *tmp;
+
+ bond_for_each_slave(bond, tmp, i)
+ if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
+ return tmp;
+
+ return NULL;
+}

/* exported from bond_main.c */
extern int bond_net_id;
diff -uprN linux-3.4.28/include/linux/etherdevice.h linux-3.4.28-patched/include/linux/etherdevice.h
--- linux-3.4.28/include/linux/etherdevice.h 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/include/linux/etherdevice.h 2013-01-30
15:37:25.121708311 -0500
@@ -277,4 +277,37 @@ static inline unsigned long compare_ethe
#endif
}

+/**
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
+ * @addr1: Pointer to an array of 8 bytes
+ * @addr2: Pointer to an other array of 8 bytes
+ *
+ * Compare two Ethernet addresses, returns true if equal, false otherwise.
+ *
+ * The function doesn't need any conditional branches and possibly uses
+ * word memory accesses on CPU allowing cheap unaligned memory reads.
+ * arrays = { byte1, byte2, byte3, byte4, byte5, byte6, pad1, pad2 }
+ *
+ * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
+ */
+
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+ const u8 addr2[6+2])
+{
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+ unsigned long fold = ((*(unsigned long *)addr1) ^
+ (*(unsigned long *)addr2));
+
+ if (sizeof(fold) == 8)
+ return zap_last_2bytes(fold) == 0;
+
+ fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
+ (*(unsigned long *)(addr2 + 4)));
+ return fold == 0;
+#else
+ return ether_addr_equal(addr1, addr2);
+#endif
+}
+
+
#endif /* _LINUX_ETHERDEVICE_H */

Quoted 34 lines · Smart Weblications GmbH - Florian Wiessner

Hi Greg,

Am 22.05.2013 22:04, schrieb Greg KH:

Quoted 9 lines
Quoted 1 line

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jkirsher/net-next/+/567b871e503316b0927e54a3d7c86d50b722d955%5E!/

Ok, that's what we need.

Now, please cc: the developers / maintainers of that patch and ask them to have it included in the 3.4-stable kernel series.

Then, if they agree, the network maintainer will pick it up and send it to me for inclusion.

i set committer David S. Miller <[email protected]> in cc already, but do not
know the network maintainer...

this seems to me that "Matthew O'Connor" <[email protected]> sent this to netdev on 2013-02-01:

http://lists.openwall.net/netdev/2013/02/01/86

but i couldn't find a trace of the patch in 3.4.36?!

Instead, i read another try to get it backported fail:

http://permalink.gmane.org/gmane.linux.network/264198

#13 lore raw

Am 23.05.2013 01:17, schrieb Matthew O'Connor:

Quoted 12 lines

This is the backported patch I submitted previously. Hopefully this time around it won't be too messed up, I'm using Thunderbird instead of the web interface. I have applied it successfully and without warnings against 3.4.46. It builds, but is otherwise untested beyond what I did when I originally submitted back in Feb. This patch applies only to the 3.4 series kernel, although with minor changes it will work for 3.0, 3.2, and 3.7. If you're interested, I can submit the other patches shortly. If this submission still does not conform to standards, please let me know where I went wrong. For what it's worth I dropped the patch contents directly into the email, but I can attach it instead if that would work better.

Hm, i tried to apply it to 3.4.46 but it does not work:

node02:/ocfs2/usr/src/linux-3.4.46# patch -p1 <../bridge-patch-3.4.46
patching file drivers/net/bonding/bond_alb.c
Hunk #1 FAILED at 704.
1 out of 1 hunk FAILED -- saving rejects to file drivers/net/bonding/bond_alb.c.rej
patching file drivers/net/bonding/bonding.h
patching file include/linux/etherdevice.h
Hunk #1 FAILED at 277.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/etherdevice.h.rej
node02:/ocfs2/usr/src/linux-3.4.46# cat drivers/net/bonding/bond_alb.c.rej
--- drivers/net/bonding/bond_alb.c 2013-01-27 23:51:45.000000000 -0500
+++ drivers/net/bonding/bond_alb.c 2013-01-30 15:37:25.121708311 -0500
@@ -704,6 +704,12 @@
     struct arp_pkt *arp = arp_pkt(skb);
     struct slave *tx_slave = NULL;

+ /* Don't modify or load balance ARPs that do not originate locally
+ * (e.g.,arrive via a bridge).
+ */
+ if (!bond_slave_has_mac(bond, arp->mac_src))
+ return NULL;
+

     if (arp->op_code == htons(ARPOP_REPLY)) {
         /* the arp must be sent on the selected
         * rx channel
node02:/ocfs2/usr/src/linux-3.4.46# cat include/linux/etherdevice.h.rej
--- include/linux/etherdevice.h 2013-01-27 23:51:45.000000000 -0500
+++ include/linux/etherdevice.h 2013-01-30 15:37:25.121708311 -0500
@@ -277,4 +277,37 @@
 #endif
 }

+/**
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
+ * @addr1: Pointer to an array of 8 bytes
+ * @addr2: Pointer to an other array of 8 bytes
+ *
+ * Compare two Ethernet addresses, returns true if equal, false otherwise.
+ *
+ * The function doesn't need any conditional branches and possibly uses
+ * word memory accesses on CPU allowing cheap unaligned memory reads.
+ * arrays = { byte1, byte2, byte3, byte4, byte5, byte6, pad1, pad2 }
+ *
+ * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
+ */
+
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+ const u8 addr2[6+2])
+{
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+ unsigned long fold = ((*(unsigned long *)addr1) ^
+ (*(unsigned long *)addr2));
+
+ if (sizeof(fold) == 8)
+ return zap_last_2bytes(fold) == 0;
+
+ fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
+ (*(unsigned long *)(addr2 + 4)));
+ return fold == 0;
+#else
+ return ether_addr_equal(addr1, addr2);
+#endif
+}
+
+
#endif /* _LINUX_ETHERDEVICE_H */

Quoted 165 lines

[ Upstream commit 567b871e503316b0927e54a3d7c86d50b722d955 ]

bonding: rlb mode of bond should not alter ARP originating via bridge

Do not modify or load balance ARP packets passing through balance-alb mode (wherein the ARP did not originate locally, and arrived via a bridge).

Modifying pass-through ARP replies causes an incorrect MAC address to be placed into the ARP packet, rendering peers unable to communicate with the actual destination from which the ARP reply originated.

Load balancing pass-through ARP requests causes an entry to be created for the peer in the rlb table, and bond_alb_monitor will occasionally issue ARP updates to all peers in the table instrucing them as to which MAC address they should communicate with; this occurs when some event sets rx_ntt. In the bridged case, however, the MAC address used for the update would be the MAC of the slave, not the actual source MAC of the originating destination. This would render peers unable to communicate with the destinations beyond the bridge.

CC Zheng Li <[email protected]>
Cc Jay Vosburgh <[email protected]>
Cc Andy Gospodarek <[email protected]>
Cc "David S. Miller" <[email protected]>

diff -uprN linux-3.4.28/drivers/net/bonding/bond_alb.c linux-3.4.28-patched/drivers/net/bonding/bond_alb.c
--- linux-3.4.28/drivers/net/bonding/bond_alb.c 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/drivers/net/bonding/bond_alb.c 2013-01-30
15:37:25.121708311 -0500

(quoted diff) +6 -0
@@ -704,6 +704,12 @@ static struct slave *rlb_arp_xmit(struct
     struct arp_pkt *arp = arp_pkt(skb);
     struct slave *tx_slave = NULL;
 
+    /* Don't modify or load balance ARPs that do not originate locally
+     * (e.g.,arrive via a bridge).
+     */
+    if (!bond_slave_has_mac(bond, arp->mac_src))
+        return NULL;
+
     if (arp->op_code == htons(ARPOP_REPLY)) {
         /* the arp must be sent on the selected
         * rx channel

diff -uprN linux-3.4.28/drivers/net/bonding/bonding.h linux-3.4.28-patched/drivers/net/bonding/bonding.h
--- linux-3.4.28/drivers/net/bonding/bonding.h 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/drivers/net/bonding/bonding.h 2013-01-30
15:37:25.121708311 -0500

(quoted diff) +13 -0
@@ -18,6 +18,7 @@
 #include <linux/timer.h>
 #include <linux/proc_fs.h>
 #include <linux/if_bonding.h>
+#include <linux/etherdevice.h>
 #include <linux/cpumask.h>
 #include <linux/in6.h>
 #include <linux/netpoll.h>
@@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir
 }
 #endif
 
+static inline struct slave *bond_slave_has_mac(struct bonding *bond,
+                           const u8 *mac)
+{
+    int i = 0;
+    struct slave *tmp;
+
+    bond_for_each_slave(bond, tmp, i)
+        if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
+            return tmp;
+
+    return NULL;
+}
 
 /* exported from bond_main.c */
 extern int bond_net_id;

diff -uprN linux-3.4.28/include/linux/etherdevice.h linux-3.4.28-patched/include/linux/etherdevice.h
--- linux-3.4.28/include/linux/etherdevice.h 2013-01-27
23:51:45.000000000 -0500
+++ linux-3.4.28-patched/include/linux/etherdevice.h 2013-01-30
15:37:25.121708311 -0500

(quoted diff) +12 -0
@@ -277,4 +277,37 @@ static inline unsigned long compare_ethe
 #endif
 }
 
+/**
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
+ * @addr1: Pointer to an array of 8 bytes
+ * @addr2: Pointer to an other array of 8 bytes
+ *
+ * Compare two Ethernet addresses, returns true if equal, false otherwise.
+ *
+ * The function doesn't need any conditional branches and possibly uses
+ * word memory accesses on CPU allowing cheap unaligned memory reads.
+ * arrays = { byte1, byte2, byte3, byte4, byte5, byte6, pad1, pad2 }
+ *
+ * Please note that alignment of addr1 & addr2 are only guaranteed to

be 16 bits.
+ */

(quoted diff) +20 -0
+
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+                                           const u8 addr2[6+2])
+{
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+        unsigned long fold = ((*(unsigned long *)addr1) ^
+                              (*(unsigned long *)addr2));
+
+        if (sizeof(fold) == 8)
+                return zap_last_2bytes(fold) == 0;
+
+        fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
+                                (*(unsigned long *)(addr2 + 4)));
+        return fold == 0;
+#else
+        return ether_addr_equal(addr1, addr2);
+#endif
+}
+
+
 #endif    /* _LINUX_ETHERDEVICE_H */
Quoted 34 lines · Smart Weblications GmbH - Florian Wiessner

Hi Greg,

Am 22.05.2013 22:04, schrieb Greg KH:

Quoted 9 lines
Quoted 1 line

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jkirsher/net-next/+/567b871e503316b0927e54a3d7c86d50b722d955%5E!/

Ok, that's what we need.

Now, please cc: the developers / maintainers of that patch and ask them to have it included in the 3.4-stable kernel series.

Then, if they agree, the network maintainer will pick it up and send it to me for inclusion.

i set committer David S. Miller <[email protected]> in cc already, but do not
know the network maintainer...

this seems to me that "Matthew O'Connor" <[email protected]> sent this to netdev on 2013-02-01:

http://lists.openwall.net/netdev/2013/02/01/86

but i couldn't find a trace of the patch in 3.4.36?!

Instead, i read another try to get it backported fail:

http://permalink.gmane.org/gmane.linux.network/264198

Signature · 18 lines
Mit freundlichen Gr��en,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Gesch�ftsf�hrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz

diff -uprN linux-3.4.28/drivers/net/bonding/bond_alb.c linux-3.4.28-patched/drivers/net/bonding/bond_alb.c

drivers/net/bonding/bond_alb.c 2013-01-30 15:37:25.121708311 -0500 renamed from drivers/net/bonding/bond_alb.c 2013-01-27 23:51:45.000000000 -0500 +6 -0
@@ -704,6 +704,12 @@ static struct slave *rlb_arp_xmit(struct
     struct arp_pkt *arp = arp_pkt(skb);
     struct slave *tx_slave = NULL;
 
+    /* Don't modify or load balance ARPs that do not originate locally
+     * (e.g.,arrive via a bridge).
+     */
+    if (!bond_slave_has_mac(bond, arp->mac_src))
+        return NULL;
+
     if (arp->op_code == htons(ARPOP_REPLY)) {
         /* the arp must be sent on the selected
         * rx channel

diff -uprN linux-3.4.28/drivers/net/bonding/bonding.h linux-3.4.28-patched/drivers/net/bonding/bonding.h

drivers/net/bonding/bonding.h 2013-01-30 15:37:25.121708311 -0500 renamed from drivers/net/bonding/bonding.h 2013-01-27 23:51:45.000000000 -0500 +13 -0
@@ -18,6 +18,7 @@
 #include <linux/timer.h>
 #include <linux/proc_fs.h>
 #include <linux/if_bonding.h>
+#include <linux/etherdevice.h>
 #include <linux/cpumask.h>
 #include <linux/in6.h>
 #include <linux/netpoll.h>
@@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir
 }
 #endif
 
+static inline struct slave *bond_slave_has_mac(struct bonding *bond,
+                           const u8 *mac)
+{
+    int i = 0;
+    struct slave *tmp;
+
+    bond_for_each_slave(bond, tmp, i)
+        if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
+            return tmp;
+
+    return NULL;
+}
 
 /* exported from bond_main.c */
 extern int bond_net_id;

diff -uprN linux-3.4.28/include/linux/etherdevice.h linux-3.4.28-patched/include/linux/etherdevice.h

include/linux/etherdevice.h 2013-01-30 15:37:25.121708311 -0500 renamed from include/linux/etherdevice.h 2013-01-27 23:51:45.000000000 -0500 +33 -0
@@ -277,4 +277,37 @@ static inline unsigned long compare_ethe
 #endif
 }
 
+/**
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
+ * @addr1: Pointer to an array of 8 bytes
+ * @addr2: Pointer to an other array of 8 bytes
+ *
+ * Compare two Ethernet addresses, returns true if equal, false otherwise.
+ *
+ * The function doesn't need any conditional branches and possibly uses
+ * word memory accesses on CPU allowing cheap unaligned memory reads.
+ * arrays = { byte1, byte2, byte3, byte4, byte5, byte6, pad1, pad2 }
+ *
+ * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
+ */
+
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+                                           const u8 addr2[6+2])
+{
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+        unsigned long fold = ((*(unsigned long *)addr1) ^
+                              (*(unsigned long *)addr2));
+
+        if (sizeof(fold) == 8)
+                return zap_last_2bytes(fold) == 0;
+
+        fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
+                                (*(unsigned long *)(addr2 + 4)));
+        return fold == 0;
+#else
+        return ether_addr_equal(addr1, addr2);
+#endif
+}
+
+
 #endif    /* _LINUX_ETHERDEVICE_H */
#14 lore raw
Quoted 10 lines · Smart Weblications GmbH - Florian Wiessner

Hm, i tried to apply it to 3.4.46 but it does not work:

node02:/ocfs2/usr/src/linux-3.4.46# patch -p1 <../bridge-patch-3.4.46
patching file drivers/net/bonding/bond_alb.c
Hunk #1 FAILED at 704.
1 out of 1 hunk FAILED -- saving rejects to file drivers/net/bonding/bond_alb.c.rej
patching file drivers/net/bonding/bonding.h
patching file include/linux/etherdevice.h
Hunk #1 FAILED at 277.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/etherdevice.h.rej

That is extremely odd, considering I applied this to a freshly downloaded kernel source directly from kernel.org before resubmitting it:

hv11:~/kernel/linux-3.4.46$ patch -p1 <
../balance-alb-patches/balance-alb-3.4.patch
patching file drivers/net/bonding/bond_alb.c
patching file drivers/net/bonding/bonding.h
patching file include/linux/etherdevice.h

Here's the patch as an attachment instead; I suspect it keeps getting damaged by my method of inclusion.

drivers/net/bonding/bond_alb.c +6 -0
diff -uprN linux-3.4.28/drivers/net/bonding/bond_alb.c linux-3.4.28-patched/drivers/net/bonding/bond_alb.c
@@ -704,6 +704,12 @@ static struct slave *rlb_arp_xmit(struct
 	struct arp_pkt *arp = arp_pkt(skb);
 	struct slave *tx_slave = NULL;
 
+	/* Don't modify or load balance ARPs that do not originate locally
+	 * (e.g.,arrive via a bridge).
+	 */
+	if (!bond_slave_has_mac(bond, arp->mac_src))
+		return NULL;
+
 	if (arp->op_code == htons(ARPOP_REPLY)) {
 		/* the arp must be sent on the selected
 		* rx channel
drivers/net/bonding/bonding.h +13 -0
diff -uprN linux-3.4.28/drivers/net/bonding/bonding.h linux-3.4.28-patched/drivers/net/bonding/bonding.h
@@ -18,6 +18,7 @@
 #include <linux/timer.h>
 #include <linux/proc_fs.h>
 #include <linux/if_bonding.h>
+#include <linux/etherdevice.h>
 #include <linux/cpumask.h>
 #include <linux/in6.h>
 #include <linux/netpoll.h>
@@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir
 }
 #endif
 
+static inline struct slave *bond_slave_has_mac(struct bonding *bond,
+					       const u8 *mac)
+{
+	int i = 0;
+	struct slave *tmp;
+
+	bond_for_each_slave(bond, tmp, i)
+		if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
+			return tmp;
+
+	return NULL;
+}
 
 /* exported from bond_main.c */
 extern int bond_net_id;
include/linux/etherdevice.h +33 -0
diff -uprN linux-3.4.28/include/linux/etherdevice.h linux-3.4.28-patched/include/linux/etherdevice.h
@@ -277,4 +277,37 @@ static inline unsigned long compare_ethe
 #endif
 }
 
+/**
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
+ * @addr1: Pointer to an array of 8 bytes
+ * @addr2: Pointer to an other array of 8 bytes
+ *
+ * Compare two Ethernet addresses, returns true if equal, false otherwise.
+ *
+ * The function doesn't need any conditional branches and possibly uses
+ * word memory accesses on CPU allowing cheap unaligned memory reads.
+ * arrays = { byte1, byte2, byte3, byte4, byte5, byte6, pad1, pad2 }
+ *
+ * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
+ */
+
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+                                           const u8 addr2[6+2])
+{
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+        unsigned long fold = ((*(unsigned long *)addr1) ^
+                              (*(unsigned long *)addr2));
+
+        if (sizeof(fold) == 8)
+                return zap_last_2bytes(fold) == 0;
+
+        fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
+                                (*(unsigned long *)(addr2 + 4)));
+        return fold == 0;
+#else
+        return ether_addr_equal(addr1, addr2);
+#endif
+}
+
+
 #endif	/* _LINUX_ETHERDEVICE_H */
#15 lore raw

Am 23.05.2013 14:35, schrieb Matthew O'Connor:

Quoted 21 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 10 lines

Hm, i tried to apply it to 3.4.46 but it does not work:

node02:/ocfs2/usr/src/linux-3.4.46# patch -p1 <../bridge-patch-3.4.46
patching file drivers/net/bonding/bond_alb.c
Hunk #1 FAILED at 704.
1 out of 1 hunk FAILED -- saving rejects to file drivers/net/bonding/bond_alb.c.rej
patching file drivers/net/bonding/bonding.h
patching file include/linux/etherdevice.h
Hunk #1 FAILED at 277.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/etherdevice.h.rej

That is extremely odd, considering I applied this to a freshly downloaded kernel source directly from kernel.org before resubmitting it:

hv11:~/kernel/linux-3.4.46$ patch -p1 <
../balance-alb-patches/balance-alb-3.4.patch
patching file drivers/net/bonding/bond_alb.c
patching file drivers/net/bonding/bonding.h
patching file include/linux/etherdevice.h
Quoted 2 lines

Here's the patch as an attachment instead; I suspect it keeps getting damaged by my method of inclusion.

Thank you, this now worked for me!

Signature · 18 lines
Mit freundlichen Gr��en,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Gesch�ftsf�hrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
#16 lore raw
In reply to Smart Weblications GmbH - Florian Wiessner
Quoted 1 line · Smart Weblications GmbH - Florian Wiessner
node02:/ocfs2/usr/src/linux-3.4.46# cat drivers/net/bonding/bond_alb.c.rej

My most sincere apologies - one more time, from a different mail server that hopefully won't go around changing my attachments. If this doesn't work I guess sendmail will be the next alternative.

-- Matthew

drivers/net/bonding/bond_alb.c +6 -0
diff -uprN linux-3.4.28/drivers/net/bonding/bond_alb.c linux-3.4.28-patched/drivers/net/bonding/bond_alb.c
@@ -704,6 +704,12 @@ static struct slave *rlb_arp_xmit(struct
 	struct arp_pkt *arp = arp_pkt(skb);
 	struct slave *tx_slave = NULL;
 
+	/* Don't modify or load balance ARPs that do not originate locally
+	 * (e.g.,arrive via a bridge).
+	 */
+	if (!bond_slave_has_mac(bond, arp->mac_src))
+		return NULL;
+
 	if (arp->op_code == htons(ARPOP_REPLY)) {
 		/* the arp must be sent on the selected
 		* rx channel
drivers/net/bonding/bonding.h +13 -0
diff -uprN linux-3.4.28/drivers/net/bonding/bonding.h linux-3.4.28-patched/drivers/net/bonding/bonding.h
@@ -18,6 +18,7 @@
 #include <linux/timer.h>
 #include <linux/proc_fs.h>
 #include <linux/if_bonding.h>
+#include <linux/etherdevice.h>
 #include <linux/cpumask.h>
 #include <linux/in6.h>
 #include <linux/netpoll.h>
@@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir
 }
 #endif
 
+static inline struct slave *bond_slave_has_mac(struct bonding *bond,
+					       const u8 *mac)
+{
+	int i = 0;
+	struct slave *tmp;
+
+	bond_for_each_slave(bond, tmp, i)
+		if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
+			return tmp;
+
+	return NULL;
+}
 
 /* exported from bond_main.c */
 extern int bond_net_id;
include/linux/etherdevice.h +33 -0
diff -uprN linux-3.4.28/include/linux/etherdevice.h linux-3.4.28-patched/include/linux/etherdevice.h
@@ -277,4 +277,37 @@ static inline unsigned long compare_ethe
 #endif
 }
 
+/**
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
+ * @addr1: Pointer to an array of 8 bytes
+ * @addr2: Pointer to an other array of 8 bytes
+ *
+ * Compare two Ethernet addresses, returns true if equal, false otherwise.
+ *
+ * The function doesn't need any conditional branches and possibly uses
+ * word memory accesses on CPU allowing cheap unaligned memory reads.
+ * arrays = { byte1, byte2, byte3, byte4, byte5, byte6, pad1, pad2 }
+ *
+ * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
+ */
+
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+                                           const u8 addr2[6+2])
+{
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+        unsigned long fold = ((*(unsigned long *)addr1) ^
+                              (*(unsigned long *)addr2));
+
+        if (sizeof(fold) == 8)
+                return zap_last_2bytes(fold) == 0;
+
+        fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
+                                (*(unsigned long *)(addr2 + 4)));
+        return fold == 0;
+#else
+        return ether_addr_equal(addr1, addr2);
+#endif
+}
+
+
 #endif	/* _LINUX_ETHERDEVICE_H */
#17 lore raw

Am 23.05.2013 14:46, schrieb Matthew O'Connor:

Quoted 6 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 1 line
node02:/ocfs2/usr/src/linux-3.4.46# cat drivers/net/bonding/bond_alb.c.rej

My most sincere apologies - one more time, from a different mail server that hopefully won't go around changing my attachments. If this doesn't work I guess sendmail will be the next alternative.

3.4.47 got released without that included :-/?!

https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.4.47

Signature · 18 lines
Mit freundlichen Gr��en,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Gesch�ftsf�hrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
maintainer
#18 lore raw

From: Smart Weblications GmbH - Florian Wiessner <[email protected]>
Date: Wed, 29 May 2013 03:01:53 +0200

Quoted 11 lines

Am 23.05.2013 14:46, schrieb Matthew O'Connor:

Quoted 6 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 1 line
node02:/ocfs2/usr/src/linux-3.4.46# cat drivers/net/bonding/bond_alb.c.rej

My most sincere apologies - one more time, from a different mail server that hopefully won't go around changing my attachments. If this doesn't work I guess sendmail will be the next alternative.

3.4.47 got released without that included :-/?!

https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.4.47

Things take time, I haven't worked on a networking -stable submission in a while, I'll get to it by the end of the wake.

Be patient.

maintainer
#19 lore raw
In reply to Smart Weblications GmbH - Florian Wiessner
Quoted 11 lines · Smart Weblications GmbH - Florian Wiessner

Am 23.05.2013 14:46, schrieb Matthew O'Connor:

Quoted 6 lines · Smart Weblications GmbH - Florian Wiessner
Quoted 1 line
node02:/ocfs2/usr/src/linux-3.4.46# cat drivers/net/bonding/bond_alb.c.rej

My most sincere apologies - one more time, from a different mail server that hopefully won't go around changing my attachments. If this doesn't work I guess sendmail will be the next alternative.

3.4.47 got released without that included :-/?!

https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.4.47

Yes, it missed that last release, I'll get a new one out when I get back from Japan next week.

thanks,

greg k-h

#20 lore raw
In reply to Matthew O'Connor
Quoted 3 lines · Matthew O'Connor

This is the backported patch I submitted previously. Hopefully this time around it won't be too messed up, I'm using Thunderbird instead of the web interface.

[...]

This was whitespace-damaged; please read Documentation/email-clients.txt

Also put the description in the subject line, like this:

Subject: [PATCH 3.4.y] bonding: rlb mode of bond should not alter ARP originating via bridge

Ben.

Signature · 2 lines
Ben Hutchings
friends: People who know you well, but like you anyway.
#21 lore raw

Am 13.06.2013 03:15, schrieb Ben Hutchings:

Quoted 6 lines · Matthew O'Connor
Quoted 3 lines

This is the backported patch I submitted previously. Hopefully this time around it won't be too messed up, I'm using Thunderbird instead of the web interface.

[...]

Quoted 9 lines

This was whitespace-damaged; please read Documentation/email-clients.txt

Also put the description in the subject line, like this:

Subject: [PATCH 3.4.y] bonding: rlb mode of bond should not alter ARP originating via bridge

Ben.

Now we have 3.4.49, still this patch is not included? WHY?

Signature · 18 lines
Mit freundlichen Grüßen,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Geschäftsführer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz
#22 lore raw

Because all of my submissions are damaged and I haven't had the time to correct them or my badly configured email clients. Trust me this affects me in the exact same way it does you; I'll try to redo the patches and send them upstream soon, for all our sake's.

Quoted 40 lines · Smart Weblications GmbH - Florian Wiessner

Am 13.06.2013 03:15, schrieb Ben Hutchings:

Quoted 6 lines · Matthew O'Connor
Quoted 3 lines

This is the backported patch I submitted previously. Hopefully this time around it won't be too messed up, I'm using Thunderbird instead of the web interface.

[...]

Quoted 9 lines

This was whitespace-damaged; please read Documentation/email-clients.txt

Also put the description in the subject line, like this:

Subject: [PATCH 3.4.y] bonding: rlb mode of bond should not alter ARP originating via bridge

Ben.

Now we have 3.4.49, still this patch is not included? WHY?

--

Mit freundlichen Gr��en,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Gesch�ftsf�hrer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz

#23 lore raw

Hi Matthew,

Am 18.06.2013 19:23, schrieb Matthew O'Connor:

Quoted 5 lines

Because all of my submissions are damaged and I haven't had the time to correct them or my badly configured email clients. Trust me this affects me in the exact same way it does you; I'll try to redo the patches and send them upstream soon, for all our sake's.

Strange - your last patch worked without any flaws?!

Signature · 18 lines
Mit freundlichen Grüßen,

Florian Wiessner

Smart Weblications GmbH
Martinsberger Str. 1
D-95119 Naila

fon.: +49 9282 9638 200
fax.: +49 9282 9638 205
24/7: +49 900 144 000 00 - 0,99 EUR/Min*
http://www.smart-weblications.de

--
Sitz der Gesellschaft: Naila
Geschäftsführer: Florian Wiessner
HRB-Nr.: HRB 3840 Amtsgericht Hof
*aus dem dt. Festnetz, ggf. abweichende Preise aus dem Mobilfunknetz