Skip to contentSkip to conversation

skb processing in SMP kernel

DISCUSSION Marek Kierdelewicz 2 participants 2 messages Nov 14, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi there,

I'm looking at file /usr/src/linux/net/core/dev.c
function "int netif_rx(struct sk_buff *skb)"
and following line:

queue = &__get_cpu_var(softnet_data);

Is it possible to put skb into the queue of another CPU then the one servicing the interrupt? (Disclaimer: Yeah, I know it's probably not the smartest thing to do because of locks and cache line bounces). How could it be accomplished? Any lead, comment, link appreciated.

pozdrawiam

Signature · 5 lines
Marek Kierdelewicz
Kierownik Działu Systemów Sieciowych, KoBa
Manager of Network Systems Department, KoBa
tel. (85) 7406466; fax. (85) 7406467
e-mail: [email protected]
#1 lore raw
Quoted 8 lines · On Wed, 14 Nov 2007 21:14:37 +0100 Marek Kierdelewicz <[email protected]> wrote:

Hi there,

I'm looking at file /usr/src/linux/net/core/dev.c
function "int netif_rx(struct sk_buff *skb)"
and following line:

queue = &__get_cpu_var(softnet_data);

Quoted 7 lines

Is it possible to put skb into the queue of another CPU then the one servicing the interrupt? (Disclaimer: Yeah, I know it's probably not the smartest thing to do because of locks and cache line bounces). How could it be accomplished? Any lead, comment, link appreciated.

pozdrawiam

You could but then you would need locking on the queue, and that would defeat the whole purpose of per-cpu queue's. You would also need to do an IPI to notify the other processor.

If you are trying to do packet distribution, look at the newest drivers that use MSI-X and napi to do packet distribution.

Signature · 1 line
Stephen Hemminger <[email protected]>