From: John Eaglesham <linux@8192.net>
To: Jay Vosburgh <fubar@us.ibm.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v6] bonding support for IPv6 transmit hashing
Date: Mon, 02 Jul 2012 22:01:20 -0700 [thread overview]
Message-ID: <4FF27CA0.7030708@8192.net> (raw)
In-Reply-To: <18390.1341272010@death.nxdomain>
On 7/2/2012 4:33 PM, Jay Vosburgh wrote:
>> +
>> + (((hash >> 24) XOR (hash >> 16) XOR (hash >> 8) XOR hash)
>> + (source MAC XOR destination MAC))
>> + modulo slave count
>
> This seems to be missing an XOR, between the end of "XOR hash)"
> and the start of "(source MAC".
>
You're correct.
>> if (skb->protocol == htons(ETH_P_IP)) {
>> + iph = ip_hdr(skb);
>> if (!ip_is_fragment(iph) &&
>> - (iph->protocol == IPPROTO_TCP ||
>> - iph->protocol == IPPROTO_UDP)) {
>> + (iph->protocol == IPPROTO_TCP ||
>> + iph->protocol == IPPROTO_UDP)) {
>
> Why did these two lines change?
>
I replaced the mixed tabs and spaces with all tabs when I updated that
function, but in retrospect the tabs and spaces were likely intentional.
I will revert.
>> + layer4hdr = (__be16 *)((u32 *)iph + iph->ihl);
>> + if (iph->ihl * sizeof(u32) + sizeof(__be16) * 2 >
>> + skb_headlen(skb) - skb_network_offset(skb))
>> + goto short_header;
>> layer4_xor = ntohs((*layer4hdr ^ *(layer4hdr + 1)));
>> + } else if (skb_network_header_len(skb) < sizeof(struct iphdr)) {
>> + goto short_header;
>> }
>> - return (layer4_xor ^
>> - ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count;
>> -
>> + return (layer4_xor ^ ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count;
>
> This line runs past 80 columns. There are a few more of these
> further down.
>
I will double-check this.
>> + } else if (skb->protocol == htons(ETH_P_IPV6)) {
>> + ipv6h = ipv6_hdr(skb);
>> + if (ipv6h->nexthdr == IPPROTO_TCP || ipv6h->nexthdr == IPPROTO_UDP) {
>> + layer4hdr = (__be16 *)((u8 *)ipv6h + sizeof(struct ipv6hdr));
>
> Could this be written as
>
> layer4hdr = (__be16 *)(ipv6h + 1);
>
> instead?
>
> -J
>
Yes, I can make that change. Thanks.
John
next prev parent reply other threads:[~2012-07-03 5:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-01 7:01 [PATCH v4 0/2] bonding support for IPv6 transmit hashing John Eaglesham
2012-07-01 7:01 ` [PATCH v4 1/2] Add support for IPv6 and bounds checking to transmit hashing functions John Eaglesham
2012-07-01 7:33 ` David Miller
2012-07-01 7:01 ` [PATCH v4 2/2] Update bonding driver documentation to include IPv6 transmit hashing algorithm John Eaglesham
2012-07-01 7:34 ` David Miller
2012-07-01 7:42 ` John Eaglesham
2012-07-01 8:07 ` [PATCH v5] bonding support for IPv6 transmit hashing John Eaglesham
2012-07-01 10:33 ` David Miller
2012-07-01 19:01 ` John Eaglesham
2012-07-01 19:13 ` [PATCH v6] " John Eaglesham
2012-07-02 23:33 ` Jay Vosburgh
2012-07-03 5:01 ` John Eaglesham [this message]
2012-07-03 5:14 ` David Miller
2012-07-03 5:38 ` John Eaglesham
2012-07-03 5:43 ` David Miller
2012-08-21 18:11 ` Jeremy Brookman
2012-08-21 19:19 ` Jay Vosburgh
2012-08-21 22:21 ` John Eaglesham
2012-08-22 12:06 ` Jeremy Brookman
2012-08-23 10:42 ` Jeremy Brookman
2012-08-22 5:12 ` [PATCH v7] bonding: " John Eaglesham
2012-08-22 5:29 ` David Miller
2012-08-22 6:43 ` [PATCH v8] " John Eaglesham
2012-08-23 5:49 ` David Miller
2012-08-23 12:23 ` Jeremy Brookman
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=4FF27CA0.7030708@8192.net \
--to=linux@8192.net \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.