[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AD84188.7030804@gmail.com>
Date: Fri, 16 Oct 2009 11:48:56 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Krishna Kumar <krkumar2@...ibm.com>
CC: davem@...emloft.net, netdev@...r.kernel.org,
herbert@...dor.apana.org.au
Subject: Re: [PATCH 2/4 v2] net: Use sk_tx_queue_mapping for connected sockets
Krishna Kumar a écrit :
> From: Krishna Kumar <krkumar2@...ibm.com>
>
> For connected sockets, the first run of dev_pick_tx saves the
> calculated txq in sk_tx_queue_mapping. This is not saved if
> either skb rx was recorded, or if the device has a queue select
> handler. Next iterations of dev_pick_tx uses the cached value of
> sk_tx_queue_mapping.
Are we sure that for selection done by skb_tx_hash(dev, skb),
rx packets will use the same queue/cpu ?
Probably not, since it uses sk->sk_hash (tcp/udp port) :
u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb)
{
u32 hash;
if (skb_rx_queue_recorded(skb)) {
hash = skb_get_rx_queue(skb);
while (unlikely(hash >= dev->real_num_tx_queues))
hash -= dev->real_num_tx_queues;
return hash;
}
if (skb->sk && skb->sk->sk_hash)
hash = skb->sk->sk_hash;
else
hash = skb->protocol;
hash = jhash_1word(hash, skb_tx_hashrnd);
return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);
}
If NIC has some proprietary hash, and selects rx queue 3 for feeding us
packets, it would be nice to also use tx queue 3 for transmit.
We would have to record in sk the rx queue chosen by the device
when processing SYN / SYN-ACK packet for example for tcp flows.
--
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