[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTi=e=XN7vZKepDoKz8FUavmj4p3pjE05GzDy8is0@mail.gmail.com>
Date: Tue, 30 Nov 2010 22:30:32 +0800
From: Changli Gao <xiaosuo@...il.com>
To: Eric Dumazet <eric.dumazet@...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 **
On Tue, Nov 30, 2010 at 10:16 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> 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);
>
OK. I'll respin it and the previous one in the same serial to address
the issues mentioned by you. Thanks.
--
Regards,
Changli Gao(xiaosuo@...il.com)
--
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