* Re: [PATCH 2/2] NET: Multiqueue network device support.
[not found] ` <20070409205052.31370.97137.stgit@gitlost.site>
@ 2007-04-09 20:37 ` David Miller
2007-04-09 20:43 ` Waskiewicz Jr, Peter P
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2007-04-09 20:37 UTC (permalink / raw)
To: peter.p.waskiewicz.jr
Cc: netdev, linux-kernel, jgarzik, cramerj, auke-jan.h.kok,
christopher.leech
From: Peter P.Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com>
Date: Mon, 09 Apr 2007 13:50:52 -0700
> From: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com>
>
> 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.
>
> Signed-off-by: Peter P. Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
This looks definitely better than the previous implementation,
myself and others will review this in more depth though.
> + 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 *".
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 2/2] NET: Multiqueue network device support.
2007-04-09 20:37 ` [PATCH 2/2] NET: Multiqueue network device support David Miller
@ 2007-04-09 20:43 ` Waskiewicz Jr, Peter P
2007-04-09 20:46 ` David Miller
2007-04-11 10:49 ` Herbert Xu
0 siblings, 2 replies; 6+ messages in thread
From: Waskiewicz Jr, Peter P @ 2007-04-09 20:43 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-kernel, jgarzik, cramerj, Kok, Auke-jan H,
Leech, Christopher
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Monday, April 09, 2007 1:38 PM
> To: Waskiewicz Jr, Peter P
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> jgarzik@pobox.com; cramerj; Kok, Auke-jan H; Leech, Christopher
> Subject: Re: [PATCH 2/2] NET: Multiqueue network device support.
>
> From: Peter P.Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com>
> Date: Mon, 09 Apr 2007 13:50:52 -0700
>
> > From: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com>
> >
> > 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.
> >
> > Signed-off-by: Peter P. Waskiewicz Jr
> > <peter.p.waskiewicz.jr@intel.com>
> > Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
>
> This looks definitely better than the previous
> implementation, myself and others will review this in more
> depth though.
>
> > + 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 *".
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] NET: Multiqueue network device support.
2007-04-09 20:43 ` Waskiewicz Jr, Peter P
@ 2007-04-09 20:46 ` David Miller
2007-04-09 20:47 ` Waskiewicz Jr, Peter P
2007-04-11 10:49 ` Herbert Xu
1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2007-04-09 20:46 UTC (permalink / raw)
To: peter.p.waskiewicz.jr
Cc: netdev, linux-kernel, jgarzik, cramerj, auke-jan.h.kok,
christopher.leech
From: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Date: Mon, 9 Apr 2007 13:43:11 -0700
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 2/2] NET: Multiqueue network device support.
2007-04-09 20:46 ` David Miller
@ 2007-04-09 20:47 ` Waskiewicz Jr, Peter P
2007-04-09 21:04 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Waskiewicz Jr, Peter P @ 2007-04-09 20:47 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-kernel, jgarzik, cramerj, Kok, Auke-jan H,
Leech, Christopher
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Monday, April 09, 2007 1:47 PM
> To: Waskiewicz Jr, Peter P
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> jgarzik@pobox.com; cramerj; Kok, Auke-jan H; Leech, Christopher
> Subject: Re: [PATCH 2/2] NET: Multiqueue network device support.
>
> From: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
> Date: Mon, 9 Apr 2007 13:43:11 -0700
>
> > 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.
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] NET: Multiqueue network device support.
2007-04-09 20:47 ` Waskiewicz Jr, Peter P
@ 2007-04-09 21:04 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2007-04-09 21:04 UTC (permalink / raw)
To: peter.p.waskiewicz.jr
Cc: netdev, linux-kernel, jgarzik, cramerj, auke-jan.h.kok,
christopher.leech
From: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Date: Mon, 9 Apr 2007 13:47:58 -0700
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] NET: Multiqueue network device support.
2007-04-09 20:43 ` Waskiewicz Jr, Peter P
2007-04-09 20:46 ` David Miller
@ 2007-04-11 10:49 ` Herbert Xu
1 sibling, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2007-04-11 10:49 UTC (permalink / raw)
To: Waskiewicz Jr, Peter P
Cc: davem, netdev, linux-kernel, jgarzik, cramerj, auke-jan.h.kok,
christopher.leech
Waskiewicz Jr, Peter P <peter.p.waskiewicz.jr@intel.com> wrote:
>
> 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,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-04-11 10:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20070409204908.31370.9954.stgit@gitlost.site>
[not found] ` <20070409205052.31370.97137.stgit@gitlost.site>
2007-04-09 20:37 ` [PATCH 2/2] NET: Multiqueue network device support David Miller
2007-04-09 20:43 ` Waskiewicz Jr, Peter P
2007-04-09 20:46 ` David Miller
2007-04-09 20:47 ` Waskiewicz Jr, Peter P
2007-04-09 21:04 ` David Miller
2007-04-11 10:49 ` Herbert Xu
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).