Skip to contentSkip to conversation

NET: Multiqueue network device support.

PATCH David Miller 3 participants 6 messages Apr 9, 2007 – Apr 11, 2007 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#2 lore raw
In reply to a message not in the archive

From: Peter P.Waskiewicz Jr. <[email protected]>
Date: Mon, 09 Apr 2007 13:50:52 -0700

Quoted 10 lines

From: Peter P. Waskiewicz Jr. <[email protected]>

Added an API and associated supporting routines for multiqueue network devices. This allows network devices supporting multiple TX queues to configure each queue within the netdevice and manage each queue independantly. Changes to the PRIO Qdisc also allow a user to map multiple flows to individual TX queues, taking advantage of each queue on the device.

This looks definitely better than the previous implementation, myself and others will review this in more depth though.

Review

Quoted 9 lines
(quoted diff) +9 -0
+ 	alloc_size = (sizeof(struct net_device_subqueue) * queue_count);
+ 
+ 	p = kzalloc(alloc_size, GFP_KERNEL);
+ 	if (!p) {
+ 		printk(KERN_ERR "alloc_netdev: Unable to allocate queues.\n");
+ 		return NULL;
+ 	}
+ 
+ 	dev->egress_subqueue = (struct net_device_subqueue *)p;

No need for a cast, 'p' is "void *".

#3 lore raw
Quoted 36 lines

-----Original Message-----
From: David Miller [mailto:[email protected]]
Sent: Monday, April 09, 2007 1:38 PM
To: Waskiewicz Jr, Peter P
Cc: [email protected]; [email protected]; [email protected]; cramerj; Kok, Auke-jan H; Leech, Christopher
Subject: Re: [PATCH 2/2] NET: Multiqueue network device support.

From: Peter P.Waskiewicz Jr. <[email protected]>
Date: Mon, 09 Apr 2007 13:50:52 -0700

Quoted 3 lines

From: Peter P. Waskiewicz Jr. <[email protected]>

Added an API and associated supporting routines for

multiqueue network devices.

Quoted 1 line

This allows network devices supporting multiple TX queues

to configure

Quoted 1 line

each queue within the netdevice and manage each queue

independantly.

Quoted 1 line

Changes to the PRIO Qdisc also allow a user to map multiple

flows to

Quoted 5 lines

individual TX queues, taking advantage of each queue on the device.

Signed-off-by: Peter P. Waskiewicz Jr
<[email protected]>

This looks definitely better than the previous implementation, myself and others will review this in more depth though.

Review

Quoted 5 lines
(quoted diff) +5 -0
+ 	alloc_size = (sizeof(struct net_device_subqueue) * queue_count);
+ 
+ 	p = kzalloc(alloc_size, GFP_KERNEL);
+ 	if (!p) {
+ 		printk(KERN_ERR "alloc_netdev: Unable to 
Quoted 7 lines

allocate queues.\n");

Review

Quoted 4 lines
(quoted diff) +4 -0
+ 		return NULL;
+ 	}
+ 
+ 	dev->egress_subqueue = (struct net_device_subqueue *)p;

No need for a cast, 'p' is "void *".

True, but the assignment for "dev" above also casts this void * to struct net_device *:

        dev = (struct net_device *)
                (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
        dev->padded = (char *)dev - (char *)p;

Shall I remove my cast?

Thanks for the feedback,

-PJ Waskiewicz

author maintainer
#4 lore raw

From: "Waskiewicz Jr, Peter P" <[email protected]>
Date: Mon, 9 Apr 2007 13:43:11 -0700

Quoted 8 lines

True, but the assignment for "dev" above also casts this void * to struct net_device *:

        dev = (struct net_device *)
                (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
        dev->padded = (char *)dev - (char *)p;

Shall I remove my cast?

I think so. Casts tend to be red flags during patch review, so don't add them when not necessary and let's remove the unnecessary ones too.

#5 lore raw
Quoted 16 lines

-----Original Message-----
From: David Miller [mailto:[email protected]]
Sent: Monday, April 09, 2007 1:47 PM
To: Waskiewicz Jr, Peter P
Cc: [email protected]; [email protected]; [email protected]; cramerj; Kok, Auke-jan H; Leech, Christopher
Subject: Re: [PATCH 2/2] NET: Multiqueue network device support.

From: "Waskiewicz Jr, Peter P" <[email protected]>
Date: Mon, 9 Apr 2007 13:43:11 -0700

Quoted 5 lines

True, but the assignment for "dev" above also casts this void * to struct net_device *:

dev = (struct net_device *)
(((long)p + NETDEV_ALIGN_CONST) &

Quoted 8 lines

~NETDEV_ALIGN_CONST);

Quoted 3 lines
        dev->padded = (char *)dev - (char *)p;

Shall I remove my cast?

I think so. Casts tend to be red flags during patch review, so don't add them when not necessary and let's remove the unnecessary ones too.

Will do. On a side note, I don't see my patches landing on vger again. Did they get munched, or is majordomo lagging a bit?

Thanks,

-PJ Waskiewicz

author maintainer
#6 lore raw

From: "Waskiewicz Jr, Peter P" <[email protected]>
Date: Mon, 9 Apr 2007 13:47:58 -0700

Quoted 2 lines

Will do. On a side note, I don't see my patches landing on vger again. Did they get munched, or is majordomo lagging a bit?

I forwarded you one of the bounces.

#7 lore raw
In reply to Waskiewicz Jr, Peter P
Quoted 9 lines · Peter P

True, but the assignment for "dev" above also casts this void * to struct net_device *:

       dev = (struct net_device *)
               (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
       dev->padded = (char *)dev - (char *)p;

Shall I remove my cast?

This is totally different as it's casting a "long", not a "void *".

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt