On Tue, Jul 11, 2006 at 03:39:25PM +1000, Kelly Daly ([EMAIL PROTECTED]) wrote:
> Implement finding of correct netchannel for buffer, default netchannel and 
> attach a netchannel to a socket
> 
> Signed-off-by:  Kelly Daly <[EMAIL PROTECTED]>

Hi Kelly.

You have a typo in the code commented below.
I have a question regarsing your netchannel design - as far as I can
see, you steal data in interrupts and then convert it into skb and run
through usual netif_receive_skb(). Thus you dedicate one thread (one
CPU) to do the whole processing for all sockets which do not have
netchannels bound to them. Did you benchmarked such approach both with
and without netchannel bound to the socket?

> +/* Find the channel for a packet, or return default channel. */
> +struct netchannel *find_netchannel(const struct netchannel_buftrailer *bp)
> +{
> +     struct sock *sk = NULL;
> +     int datalen = netchan_data_len(bp);
> +
> +     switch (bp->netchan_buf_proto) {
> +     case __constant_htons(ETH_P_IP): {
> +             struct iphdr *ip = (void *)bp - datalen;
> +             int iphl = ip->ihl * 4;
> +
> +             /* FIXME: Do sanity checks, parse packet. */
> +
> +             if (datalen >+ (iphl + 4) && iphl == sizeof(struct iphdr)) {

A typo ">+" instead of ">=".

-- 
        Evgeniy Polyakov
-
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