[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1291126568.2904.85.camel@edumazet-laptop>
Date: Tue, 30 Nov 2010 15:16:08 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Changli Gao <xiaosuo@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Jiri Pirko <jpirko@...hat.com>,
Neil Horman <nhorman@...driver.com>, netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] af_packet: replace struct pgv with char **
Le mardi 30 novembre 2010 à 21:57 +0800, Changli Gao a écrit :
> As we can check if an address is vmalloc address with is_vmalloc_addr(),
> we can replace struct pgv with char **. Then we may get more pg_vecs.
>
> Signed-off-by: Changli Gao <xiaosuo@...il.com>
> ---
> net/packet/af_packet.c | 50 ++++++++++++++++---------------------------------
> 1 file changed, 17 insertions(+), 33 deletions(-)
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index 0171b20..a26f981 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -164,14 +164,8 @@ struct packet_mreq_max {
> static int packet_set_ring(struct sock *sk, struct tpacket_req *req,
> int closing, int tx_ring);
>
> -#define PGV_FROM_VMALLOC 1
> -struct pgv {
> - char *buffer;
> - unsigned char flags;
> -};
> -
This patch is premature.
Also, keep the struct pgv, even if it has a single field, since having
types is good to read the sources.
We could have 'void *' or 'char *' everywhere, it is not nice...
- pg_vec = kcalloc(block_nr, sizeof(struct pgv), GFP_KERNEL);
+ pg_vec = kcalloc(block_nr, sizeof(char *), GFP_KERNEL);
I prefer to have :
pg_vec = kcalloc(block_nr, sizeof(struct pgv), GFP_KERNEL);
--
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