linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] r8152: reduce the number of Tx
@ 2014-08-28  2:17 Hayes Wang
  2014-08-28  2:24 ` [PATCH net-next v2] " Hayes Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Hayes Wang @ 2014-08-28  2:17 UTC (permalink / raw)
  To: netdev; +Cc: nic_swsd, linux-kernel, linux-usb, Hayes Wang

Because the Tx has the features of stopping queue and aggregation,
We don't need many tx buffers. Change the tx number from 10 to 4
to reduce the usage of the memory. This could save 16K * 10 bytes
memory.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 33dcc97..cc64dc0 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -424,7 +424,7 @@ enum rtl_register_content {
 	FULL_DUP	= 0x01,
 };
 
-#define RTL8152_MAX_TX		10
+#define RTL8152_MAX_TX		4
 #define RTL8152_MAX_RX		10
 #define INTBUFSIZE		2
 #define CRC_SIZE		4
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next v2] r8152: reduce the number of Tx
  2014-08-28  2:17 [PATCH net-next] r8152: reduce the number of Tx Hayes Wang
@ 2014-08-28  2:24 ` Hayes Wang
  2014-08-30  3:25   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Hayes Wang @ 2014-08-28  2:24 UTC (permalink / raw)
  To: netdev; +Cc: nic_swsd, linux-kernel, linux-usb

Because the Tx has the features of stopping queue and aggregation,
We don't need many tx buffers. Change the tx number from 10 to 4
to reduce the usage of the memory. This could save 16K * 6 bytes
memory.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 33dcc97..cc64dc0 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -424,7 +424,7 @@ enum rtl_register_content {
 	FULL_DUP	= 0x01,
 };
 
-#define RTL8152_MAX_TX		10
+#define RTL8152_MAX_TX		4
 #define RTL8152_MAX_RX		10
 #define INTBUFSIZE		2
 #define CRC_SIZE		4
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] r8152: reduce the number of Tx
  2014-08-28  2:24 ` [PATCH net-next v2] " Hayes Wang
@ 2014-08-30  3:25   ` David Miller
  2014-09-01  2:46     ` Hayes Wang
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2014-08-30  3:25 UTC (permalink / raw)
  To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb

From: Hayes Wang <hayeswang@realtek.com>
Date: Thu, 28 Aug 2014 10:24:18 +0800

> Because the Tx has the features of stopping queue and aggregation,
> We don't need many tx buffers. Change the tx number from 10 to 4
> to reduce the usage of the memory. This could save 16K * 6 bytes
> memory.
> 
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
>  drivers/net/usb/r8152.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 33dcc97..cc64dc0 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -424,7 +424,7 @@ enum rtl_register_content {
>  	FULL_DUP	= 0x01,
>  };
>  
> -#define RTL8152_MAX_TX		10
> +#define RTL8152_MAX_TX		4
>  #define RTL8152_MAX_RX		10

This driver has a loop that iterates MAX_TX times to initialize both
the RX and TX buffers.

So if they are not equal, it can't possibly work.

Sorry, I'm not applying this.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH net-next v2] r8152: reduce the number of Tx
  2014-08-30  3:25   ` David Miller
@ 2014-09-01  2:46     ` Hayes Wang
  2014-09-01  4:38       ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Hayes Wang @ 2014-09-01  2:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, nic_swsd, linux-kernel, linux-usb

 From: David Miller [mailto:davem@davemloft.net] 
[...]
> This driver has a loop that iterates MAX_TX times to initialize both
> the RX and TX buffers.
> 
> So if they are not equal, it can't possibly work.

Excuse me. I don't find that the "RTL8152_MAX_TX" is used by
rx buffer. The rx buffer only use "RTL8152_MAX_RX". Although 
the tx buffer size is determined by "rx_buf_sz", the tx buffers
are independent of rx buffers.

Best Regards,
Hayes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] r8152: reduce the number of Tx
  2014-09-01  2:46     ` Hayes Wang
@ 2014-09-01  4:38       ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2014-09-01  4:38 UTC (permalink / raw)
  To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb

From: Hayes Wang <hayeswang@realtek.com>
Date: Mon, 1 Sep 2014 02:46:38 +0000

>  From: David Miller [mailto:davem@davemloft.net] 
> [...]
>> This driver has a loop that iterates MAX_TX times to initialize both
>> the RX and TX buffers.
>> 
>> So if they are not equal, it can't possibly work.
> 
> Excuse me. I don't find that the "RTL8152_MAX_TX" is used by
> rx buffer. The rx buffer only use "RTL8152_MAX_RX". Although 
> the tx buffer size is determined by "rx_buf_sz", the tx buffers
> are independent of rx buffers.

Ok, but that is really confusing code.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-01  4:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-28  2:17 [PATCH net-next] r8152: reduce the number of Tx Hayes Wang
2014-08-28  2:24 ` [PATCH net-next v2] " Hayes Wang
2014-08-30  3:25   ` David Miller
2014-09-01  2:46     ` Hayes Wang
2014-09-01  4:38       ` David Miller

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).