On Sun, 21 Aug 2005 16:19:26 -0700 (PDT)
"David S. Miller" <[EMAIL PROTECTED]> wrote:

> From: Andi Kleen <[EMAIL PROTECTED]>
> Date: Mon, 22 Aug 2005 01:13:21 +0200
> 
> > > Basically, you'll have skb->free_callback(skb, ARG), and
> > > skb->free_callback_ARG.  And when the SKB and it's memory
> > > is about to get liberated, we'll call the callback instead
> > > of doing the free if the callback is non-NULL.
> > 
> > One issue is that the NIC focus shouldn't be reprogrammed for every 
> > packet because that would be too expensive.
> 
> The NIC is going to track this state internally in a cache, completely
> transparently from the OS (besides the callback), and use MSI vectors
> to target specific cpus based upon that information.

Yes it does. But you need to update that information when the receiving
CPU changes. So you need to figure out when the CPU has changed
by storing the last received CPU. You cannot rely on the information inside the 
NIC here because accessing that over the PCI would be too expensive.
Updating on every packet would be also too expensive.  So it has
to be stored in RAM somewhere.

In theory the NIC could store it in a separate data structure, but that would 
be wasteful IMHO because it would duplicate what a socket does. 
So it's best to add a last_rcv_cpu field to the struct sock and make sure 
the free callback can access it safely.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to