netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Krishna Kumar <krkumar2@in.ibm.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, herbert@gondor.apana.org.au
Subject: Re: [PATCH 1/4 v2] net: Introduce sk_tx_queue_mapping
Date: Fri, 16 Oct 2009 11:57:09 +0200	[thread overview]
Message-ID: <4AD84375.9020400@gmail.com> (raw)
In-Reply-To: <20091016072120.24384.54449.sendpatchset@localhost.localdomain>

Krishna Kumar a écrit :
> From: Krishna Kumar <krkumar2@in.ibm.com>
> 
> Introduce sk_tx_queue_mapping; and functions that set, test and get
> this value. Reset sk_tx_queue_mapping to -1 whenever the dst cache
> is set/reset, and in socket alloc & free (free probably doesn't need
> it).
> 

Could you please use an u16 instead, and take the convention of 0
being the 'unitialized value' ?

And define sk_tx_queue_clear(sk) instead of sk_record_tx_queue(sk, -1);

I also suggest using following names :

static inline void sk_tx_queue_set(struct sock *sk, u16 tx_queue)
{
	sk->sk_tx_queue_mapping = tx_queue + 1;
}

static inline u16 sk_tx_queue_get(const struct sock *sk)
{
	return sk->sk_tx_queue_mapping - 1;
}

static inline u16 sk_tx_queue_clear(struct sock *sk) // or _reset
{
	sk->sk_tx_queue_mapping = 0;
}

static inline bool sk_tx_queue_recorded(const struct sock *sk)
{
	return (sk && sk->sk_tx_queue_mapping > 0);
}


> @@ -1016,6 +1019,8 @@ static void sk_prot_free(struct proto *p
>  	struct kmem_cache *slab;
>  	struct module *owner;
>  
> +	sk_record_tx_queue(sk, -1);
> +
>  	owner = prot->owner;
>  	slab = prot->slab;
>  

This is not necessary, we are going to kfree(sk) anyway !

  reply	other threads:[~2009-10-16  9:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-16  7:21 [PATCH 0/4 v2] net: Implement fast TX queue selection Krishna Kumar
2009-10-16  7:21 ` [PATCH 1/4 v2] net: Introduce sk_tx_queue_mapping Krishna Kumar
2009-10-16  9:57   ` Eric Dumazet [this message]
2009-10-16 12:58     ` Krishna Kumar2
2009-10-16  7:21 ` [PATCH 2/4 v2] net: Use sk_tx_queue_mapping for connected sockets Krishna Kumar
2009-10-16  9:48   ` Eric Dumazet
2009-10-16 12:56     ` Krishna Kumar2
2009-10-16 14:07       ` Eric Dumazet
2009-10-16 15:47         ` Krishna Kumar2
2009-10-16  7:21 ` [PATCH 3/4 v2] net: IPv6 changes Krishna Kumar
2009-10-16  7:22 ` [PATCH 4/4 v2] net: Fix for dst_negative_advice Krishna Kumar

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=4AD84375.9020400@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=krkumar2@in.ibm.com \
    --cc=netdev@vger.kernel.org \
    /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).