[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 15 Jan 2010 14:39:13 +0800
From: Changli Gao <xiaosuo@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Tom Herbert <therbert@...gle.com>, davem@...emloft.net,
netdev@...r.kernel.org,
Netfilter Developer Mailing List
<netfilter-devel@...r.kernel.org>
Subject: Re: [PATCH v5] rps: Receive Packet Steering
On Fri, Jan 15, 2010 at 2:19 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> Le 15/01/2010 03:22, Changli Gao a écrit :
>> On Fri, Jan 15, 2010 at 5:56 AM, Tom Herbert <therbert@...gle.com> wrote:
>>> +
>>> + if (skb->rxhash)
>>> + goto got_hash; /* Skip hash computation on packet header */
>>> +
>>> + switch (skb->protocol) {
>>> + case __constant_htons(ETH_P_IP):
>>> + if (!pskb_may_pull(skb, sizeof(*ip)))
>>> + goto done;
>>> +
>>> + ip = (struct iphdr *) skb->data;
>>> + ip_proto = ip->protocol;
>>> + addr1 = ip->saddr;
>>> + addr2 = ip->daddr;
>>> + ihl = ip->ihl;
>>> + break;
>>> + case __constant_htons(ETH_P_IPV6):
>>> + if (!pskb_may_pull(skb, sizeof(*ip6)))
>>> + goto done;
>>> +
>>> + ip6 = (struct ipv6hdr *) skb->data;
>>> + ip_proto = ip6->nexthdr;
>> This code can't work, when there are extra headers. ipv6_skip_exthdr()
>> can be used to get the l4 header.
>
> Could you give exact code please ?
>
The code bellow is from my ifb-mq.patch
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case __constant_htons(ETH_P_IPV6):
process_ipv6:
if (unlikely(!pskb_may_pull(skb, sizeof(struct ipv6hdr))))
goto process_other;
addr1 = ipv6_hdr(skb)->saddr.s6_addr32[3];
addr2 = ipv6_hdr(skb)->daddr.s6_addr32[3];
ihl = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &ip_proto);
if (unlikely(ihl < 0))
goto process_other_trans;
break;
#endif
--
Regards,
Changli Gao(xiaosuo@...il.com)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists