From: David Miller <davem@davemloft.net>
To: jarod@redhat.com
Cc: linux-kernel@vger.kernel.org, j.vosburgh@gmail.com,
vfalico@gmail.com, andy@greyhouse.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bonding: attempt to better support longer hw addresses
Date: Wed, 05 Apr 2017 18:45:54 -0700 (PDT) [thread overview]
Message-ID: <20170405.184554.1608171595937690317.davem@davemloft.net> (raw)
In-Reply-To: <20170404213242.50079-1-jarod@redhat.com>
From: Jarod Wilson <jarod@redhat.com>
Date: Tue, 4 Apr 2017 17:32:42 -0400
> People are using bonding over Infiniband IPoIB connections, and who knows
> what else. Infiniband has a hardware address length of 20 octets
> (INFINIBAND_ALEN), and the network core defines a MAX_ADDR_LEN of 32.
> Various places in the bonding code are currently hard-wired to 6 octets
> (ETH_ALEN), such as the 3ad code, which I've left untouched here. Besides,
> only alb is currently possible on Infiniband links right now anyway, due
> to commit 1533e7731522, so the alb code is where most of the changes are.
>
> One major component of this change is the addition of a bond_hw_addr_copy
> function that takes a length argument, instead of using ether_addr_copy
> everywhere that hardware addresses need to be copied about. The other
> major component of this change is converting the bonding code from using
> struct sockaddr for address storage to struct sockaddr_storage, as the
> former has an address storage space of only 14, while the latter is 128
> minus a few, which is necessary to support bonding over device with up to
> MAX_ADDR_LEN octet hardware addresses. Additionally, this probably fixes
> up some memory corruption issues with the current code, where it's
> possible to write an infiniband hardware address into a sockaddr declared
> on the stack.
>
> Lightly tested on a dual mlx4 IPoIB setup, which properly shows a 20-octet
> hardware address now:
...
> CC: Jay Vosburgh <j.vosburgh@gmail.com>
> CC: Veaceslav Falico <vfalico@gmail.com>
> CC: Andy Gospodarek <andy@greyhouse.net>
> CC: netdev@vger.kernel.org
> Signed-off-by: Jarod Wilson <jarod@redhat.com>
Applied, but:
> +static inline void bond_hw_addr_copy(u8 *dst, const u8 *src, unsigned int len)
> +{
> + if (len == ETH_ALEN) {
> + ether_addr_copy(dst, src);
> + return;
> + }
> +
> + memcpy(dst, src, len);
> +}
I wonder how much value there is in trying to conditionally use
ether_addr_copy(). Unless some of these calls are in the data
plane, just a straight memcpy() all the time is fine and much
simpler.
Thanks.
next prev parent reply other threads:[~2017-04-06 1:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 21:32 Jarod Wilson
2017-04-06 1:45 ` David Miller [this message]
2017-04-06 18:01 ` Jarod Wilson
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=20170405.184554.1608171595937690317.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=andy@greyhouse.net \
--cc=j.vosburgh@gmail.com \
--cc=jarod@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®