Re: [PATCH 2/2] net: make net and forcedeth to use kmalloc_node

2007-07-04 Thread Christoph Hellwig
On Tue, Jul 03, 2007 at 11:58:40AM -0700, Andrew Morton wrote:
   
  while (np-put_rx.orig != less_rx) {
  -   struct sk_buff *skb = dev_alloc_skb(np-rx_buf_sz + 
  NV_RX_ALLOC_PAD);
  +   struct sk_buff *skb = dev_alloc_skb_node(np-rx_buf_sz + 
  NV_RX_ALLOC_PAD, dev_to_node(dev-dev));
 
 If we're going to do this then it would probably make sense to change
 dev_alloc_skb_node() so that it takes a `struct net_device *' rather than a
 bare node-id.  That's a call which the net guys will need to make, which is
 why we cc them on our emails.

That thing is called netdev_alloc_skb and already exists.  And it's indeed
what they should be using in the rx path.

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] net: make net and forcedeth to use kmalloc_node

2007-07-04 Thread Yinghai Lu

On 7/4/07, Christoph Hellwig [EMAIL PROTECTED] wrote:

On Tue, Jul 03, 2007 at 11:58:40AM -0700, Andrew Morton wrote:
 
  while (np-put_rx.orig != less_rx) {
  -   struct sk_buff *skb = dev_alloc_skb(np-rx_buf_sz + 
NV_RX_ALLOC_PAD);
  +   struct sk_buff *skb = dev_alloc_skb_node(np-rx_buf_sz + 
NV_RX_ALLOC_PAD, dev_to_node(dev-dev));

 If we're going to do this then it would probably make sense to change
 dev_alloc_skb_node() so that it takes a `struct net_device *' rather than a
 bare node-id.  That's a call which the net guys will need to make, which is
 why we cc them on our emails.

That thing is called netdev_alloc_skb and already exists.  And it's indeed
what they should be using in the rx path.

-

please check
http://lkml.org/lkml/2007/7/3/418

[PATCH 3/4] net: make forcedeth to use kmalloc_node and
__netdev_alloc_skb for skb allocation

but need to replace __netdev_alloc_skb to netdev_alloc_skb.

YH
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] net: make net and forcedeth to use kmalloc_node

2007-07-03 Thread Yinghai Lu

Andrew Morton wrote:

On Fri, 29 Jun 2007 13:30:36 -0700
Yinghai Lu [EMAIL PROTECTED] wrote:


[PATCH 2/2] net: make net and forcedeth to use kmalloc_node


Please copy netdev@vger.kernel.org on net patches.

It might help to edit code in an 80-col xterm.

Please run scritps/checkpatch.pl across all your diffs.  Its suggestions
are by no means compulsory, but they do provide things for you to check up
and and have a think about, thanks.


I see. later.

Thanks

Yinghai Lu
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] net: make net and forcedeth to use kmalloc_node

2007-07-03 Thread Stephen Hemminger
On Tue, 03 Jul 2007 14:28:50 -0700
Yinghai Lu [EMAIL PROTECTED] wrote:

 Stephen Hemminger wrote:
  On Tue, 3 Jul 2007 11:58:40 -0700
  Andrew Morton [EMAIL PROTECTED] wrote:
  
  On Fri, 29 Jun 2007 13:30:36 -0700
  Yinghai Lu [EMAIL PROTECTED] wrote:
 
  [PATCH 2/2] net: make net and forcedeth to use kmalloc_node
  Please copy netdev@vger.kernel.org on net patches.
 
  This patch modifies a net driver as well as the networking core.  These
  subsytems have different maintainers who run different development trees. 
  Consequently I must split your patch into two and change their titles and
  changelogs appropriately.
 
  Please do this for us in future, thanks.
 
 
  diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
  index 42ba1c0..6d53b52 100644
  --- a/drivers/net/forcedeth.c
  +++ b/drivers/net/forcedeth.c
  @@ -1383,7 +1383,7 @@ static int nv_alloc_rx(struct net_device *dev)
less_rx = np-last_rx.orig;
   
while (np-put_rx.orig != less_rx) {
  - struct sk_buff *skb = dev_alloc_skb(np-rx_buf_sz + 
  NV_RX_ALLOC_PAD);
  + struct sk_buff *skb = dev_alloc_skb_node(np-rx_buf_sz + 
  NV_RX_ALLOC_PAD, dev_to_node(dev-dev));
  If we're going to do this then it would probably make sense to change
  dev_alloc_skb_node() so that it takes a `struct net_device *' rather than a
  bare node-id.  That's a call which the net guys will need to make, which is
  why we cc them on our emails.
  
  The driver should use netdev_alloc_skb. That routine is supposed to be 
  overriden
  on architecture's that need per node changes.
 
 do you mean:
 use dev_alloc_skb_node for numa arch.

Look at __netdev_alloc_skb() source. It does all the necessary dev_to_node()
stuff.

dev_alloc_skb is the old routine and kept around only because not all
usage has been converted yet. It should probably be deprecated at some point.


-- 
Stephen Hemminger [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] net: make net and forcedeth to use kmalloc_node

2007-07-03 Thread Yinghai Lu

Stephen Hemminger wrote:

On Tue, 3 Jul 2007 11:58:40 -0700
Andrew Morton [EMAIL PROTECTED] wrote:


On Fri, 29 Jun 2007 13:30:36 -0700
Yinghai Lu [EMAIL PROTECTED] wrote:


[PATCH 2/2] net: make net and forcedeth to use kmalloc_node

Please copy netdev@vger.kernel.org on net patches.

This patch modifies a net driver as well as the networking core.  These
subsytems have different maintainers who run different development trees. 
Consequently I must split your patch into two and change their titles and

changelogs appropriately.

Please do this for us in future, thanks.



diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 42ba1c0..6d53b52 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -1383,7 +1383,7 @@ static int nv_alloc_rx(struct net_device *dev)
less_rx = np-last_rx.orig;
 
 	while (np-put_rx.orig != less_rx) {

-   struct sk_buff *skb = dev_alloc_skb(np-rx_buf_sz + 
NV_RX_ALLOC_PAD);
+   struct sk_buff *skb = dev_alloc_skb_node(np-rx_buf_sz + 
NV_RX_ALLOC_PAD, dev_to_node(dev-dev));

If we're going to do this then it would probably make sense to change
dev_alloc_skb_node() so that it takes a `struct net_device *' rather than a
bare node-id.  That's a call which the net guys will need to make, which is
why we cc them on our emails.


The driver should use netdev_alloc_skb. That routine is supposed to be overriden
on architecture's that need per node changes.


do you mean:
use dev_alloc_skb_node for numa arch.
and other non numa will use macro or static inline to dev_alloc_skb

YH
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html