From: Patrick McHardy <kaber@trash.net>
To: Jan-Bernd Themann <ossthema@de.ibm.com>
Cc: Thomas Klein <tklein@de.ibm.com>, Jeff Garzik <jeff@garzik.org>,
Jan-Bernd Themann <themann@de.ibm.com>,
netdev <netdev@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-ppc <linuxppc-dev@ozlabs.org>,
Christoph Raisch <raisch@de.ibm.com>,
Marcus Eder <meder@de.ibm.com>,
Stefan Roscher <stefan.roscher@de.ibm.com>
Subject: Re: [PATCH 2/2] ehea: NAPI multi queue TX/RX path for SMP
Date: Tue, 27 Feb 2007 17:53:28 +0100 [thread overview]
Message-ID: <45E46208.3000003@trash.net> (raw)
In-Reply-To: <200702271732.51829.ossthema@de.ibm.com>
Jan-Bernd Themann wrote:
> This patch provides a functionality that allows parallel
> RX processing on multiple RX queues by using dummy netdevices.
>
>
> +static inline int ehea_hash_skb(struct sk_buff *skb, int num_qps)
> +{
> + u32 tmp;
> + if ((skb->nh.iph->protocol == IPPROTO_TCP)
> + && skb->protocol == ETH_P_IP) {
skb->protocol has network byte order. The ETH_P_IP test should also
logically come before checking the IP protocol.
> + tmp = (skb->h.th->source + (skb->h.th->dest << 16)) % 31;
Only locally generated packets have a valid h.th pointer.
> + tmp += skb->nh.iph->daddr % 31;
> + return tmp % num_qps;
> + }
> + else
> + return 0;
> +}
> +
> static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
> {
> struct ehea_port *port = netdev_priv(dev);
> @@ -1796,9 +1818,18 @@ static int ehea_start_xmit(struct sk_buf
> unsigned long flags;
> u32 lkey;
> int swqe_index;
> - struct ehea_port_res *pr = &port->port_res[0];
> + struct ehea_port_res *pr;
> +
> + pr = &port->port_res[ehea_hash_skb(skb, port->num_tx_qps)];
> +
next prev parent reply other threads:[~2007-02-27 17:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-27 16:32 [PATCH 2/2] ehea: NAPI multi queue TX/RX path for SMP Jan-Bernd Themann
2007-02-27 16:53 ` Patrick McHardy [this message]
2007-02-28 9:23 ` Jan-Bernd Themann
-- strict thread matches above, loose matches on Subject: below --
2007-02-28 17:34 Jan-Bernd Themann
2007-05-02 4:59 ` Michael Ellerman
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=45E46208.3000003@trash.net \
--to=kaber@trash.net \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=meder@de.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=ossthema@de.ibm.com \
--cc=raisch@de.ibm.com \
--cc=stefan.roscher@de.ibm.com \
--cc=themann@de.ibm.com \
--cc=tklein@de.ibm.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;
as well as URLs for NNTP newsgroup(s).