All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] r8169: Permit users to change transmit and receive max pachet size
       [not found] <ctml34x6j21mkn1wutfemkq7.1438638110313@email.android.com>
@ 2015-08-03 21:56 ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-08-03 21:56 UTC (permalink / raw)
  To: corcodel.marian; +Cc: netdev

From: "Corcodel.marian" <corcodel.marian@gmail.com>
Date: Tue, 04 Aug 2015 00:41:50 +0300

> A this moment these param is only for test and not for large utilization.

Then you can patch your local driver for "testing".

You change doesn't belong upstream.  We're not going to litter drivers
with debugging hack options.

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

* Re: [PATCH] r8169: Permit users to change transmit and receive max pachet size
       [not found] <yqromneucjufgmy89t6y59jf.1438635988401@email.android.com>
@ 2015-08-03 21:12 ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-08-03 21:12 UTC (permalink / raw)
  To: corcodel.marian; +Cc: netdev

From: "Corcodel.marian" <corcodel.marian@gmail.com>
Date: Tue, 04 Aug 2015 00:06:28 +0300

> Sorry bu these parameters is not covered by ethtool.

Then simply add such a generic facility, so other drivers can benefit
from it as well.

I'll be completely honest, and say that I don't anticipate that you
will implement the ethtool option properly, and that it will probably
take 5 or 6 iterations of review of such a patch before we'll be
willing to accept it.  But this is really what you will have to do.

Then you will need to submit a patch to 'ethtool' itself to support
the new options.

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

* Re: [PATCH] r8169: Permit users to change transmit and receive max pachet size
  2015-08-03  7:28 Corcodel Marian
@ 2015-08-03  7:45 ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-08-03  7:45 UTC (permalink / raw)
  To: corcodel.marian; +Cc: netdev

From: Corcodel Marian <corcodel.marian@gmail.com>
Date: Mon,  3 Aug 2015 10:28:38 +0300

>  Realtek nic its very versatile and have more registers for
>  optimise  and solve different issues.  I added 2 parameters rx_buf_sz and
>  txpacketmax  1.Parameter rx_buf_sz represent Receive Packet Maximum size and
>  on   this program is 16383 bytes, eg RTL 8101E use 16000 and user may use  
>  alls values up to maximum but value great from zero.   If a received packet
>  of packet length larger than the value set here, then it will set  both RWT
>  and RES bits in the corresponding Rx Status Descriptor. If the packet,  which
>  is larger than the RMS value, is received without CRC error, it is still a
>  good  packet, although both RWT and RES bits are set in the corresponding Rx
>  Status  Descriptor.  2. Parameter txpacketmax represent Max Transmit Packet
>  Size value must be on  range 1-63.Do not put zero on any situation.Every
>  field from range 1-63 have  128 bytes.  For regular LAN applications, i.e.,
>  the max packet size is either 1518 or 1522 (VLAN) bytes, this field must be
>  larger than the max packet size. E.g., 0x0C. On mee working good with
>  txpacketmax=60 and rx_buf_sz=1600
> 
> Signed-off-by: Corcodel Marian <corcodel.marian@gmail.com>

Sorry, such module parameters are completely inappropriate.

Control the values, at run time, using a standard, generic facility
such as ethtool.

Please stop sending patches that add new module parameters, they are
almost certainly guaranteed to be unacceptable.

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

* [PATCH] r8169: Permit users to change transmit and receive max pachet size
@ 2015-08-03  7:28 Corcodel Marian
  2015-08-03  7:45 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Corcodel Marian @ 2015-08-03  7:28 UTC (permalink / raw)
  To: netdev; +Cc: Corcodel Marian

 Realtek nic its very versatile and have more registers for
 optimise  and solve different issues.  I added 2 parameters rx_buf_sz and
 txpacketmax  1.Parameter rx_buf_sz represent Receive Packet Maximum size and
 on   this program is 16383 bytes, eg RTL 8101E use 16000 and user may use  
 alls values up to maximum but value great from zero.   If a received packet
 of packet length larger than the value set here, then it will set  both RWT
 and RES bits in the corresponding Rx Status Descriptor. If the packet,  which
 is larger than the RMS value, is received without CRC error, it is still a
 good  packet, although both RWT and RES bits are set in the corresponding Rx
 Status  Descriptor.  2. Parameter txpacketmax represent Max Transmit Packet
 Size value must be on  range 1-63.Do not put zero on any situation.Every
 field from range 1-63 have  128 bytes.  For regular LAN applications, i.e.,
 the max packet size is either 1518 or 1522 (VLAN) bytes, this field must be
 larger than the max packet size. E.g., 0x0C. On mee working good with
 txpacketmax=60 and rx_buf_sz=1600

Signed-off-by: Corcodel Marian <corcodel.marian@gmail.com>
---
 drivers/net/ethernet/realtek/r8169.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 3df51fa..5a942c5 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -345,6 +345,7 @@ static const struct pci_device_id rtl8169_pci_tbl[] = {
 MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);
 
 static int rx_buf_sz = 16383;
+static int txpacketmax = 63;
 static int use_dac;
 static struct {
 	u32 msg_enable;
@@ -406,7 +407,7 @@ enum rtl_registers {
 
 	MaxTxPacketSize	= 0xec,	/* 8101/8168. Unit of 128 bytes. */
 
-#define TxPacketMax	(8064 >> 7)
+//#define TxPacketMax	(8064 >> 7)
 #define EarlySize	0x27
 
 	FuncEvent	= 0xf0,
@@ -850,6 +851,10 @@ module_param(use_dac, int, 0);
 MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
 module_param_named(debug, debug.msg_enable, int, 0);
 MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");
+module_param(rx_buf_sz, int, 0);
+MODULE_PARM_DESC(rx_buf_sz, "Receive Packet Maximum Size. ");
+module_param(txpacketmax, int, 0);
+MODULE_PARM_DESC(txpacketmax, "Max Transmit Packet Size. ");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(RTL8169_VERSION);
 MODULE_FIRMWARE(FIRMWARE_8168D_1);
@@ -5593,7 +5598,7 @@ static void rtl_hw_start_8168bef(struct rtl8169_private *tp)
 
 	rtl_hw_start_8168bb(tp);
 
-	RTL_W8(MaxTxPacketSize, TxPacketMax);
+	RTL_W8(MaxTxPacketSize, txpacketmax);
 
 	RTL_W8(Config4, RTL_R8(Config4) & ~(1 << 0));
 }
@@ -5659,7 +5664,7 @@ static void rtl_hw_start_8168cp_3(struct rtl8169_private *tp)
 	/* Magic. */
 	RTL_W8(DBG_REG, 0x20);
 
-	RTL_W8(MaxTxPacketSize, TxPacketMax);
+	RTL_W8(MaxTxPacketSize, txpacketmax);
 
 	if (tp->dev->mtu <= ETH_DATA_LEN)
 		rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
@@ -5720,7 +5725,7 @@ static void rtl_hw_start_8168d(struct rtl8169_private *tp)
 
 	rtl_disable_clock_request(pdev);
 
-	RTL_W8(MaxTxPacketSize, TxPacketMax);
+	RTL_W8(MaxTxPacketSize, txpacketmax);
 
 	if (tp->dev->mtu <= ETH_DATA_LEN)
 		rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
@@ -5738,7 +5743,7 @@ static void rtl_hw_start_8168dp(struct rtl8169_private *tp)
 	if (tp->dev->mtu <= ETH_DATA_LEN)
 		rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
 
-	RTL_W8(MaxTxPacketSize, TxPacketMax);
+	RTL_W8(MaxTxPacketSize, txpacketmax);
 
 	rtl_disable_clock_request(pdev);
 }
@@ -5758,7 +5763,7 @@ static void rtl_hw_start_8168d_4(struct rtl8169_private *tp)
 
 	rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
 
-	RTL_W8(MaxTxPacketSize, TxPacketMax);
+	RTL_W8(MaxTxPacketSize, txpacketmax);
 
 	for (i = 0; i < ARRAY_SIZE(e_info_8168d_4); i++) {
 		const struct ephy_info *e = e_info_8168d_4 + i;
@@ -5798,7 +5803,7 @@ static void rtl_hw_start_8168e_1(struct rtl8169_private *tp)
 	if (tp->dev->mtu <= ETH_DATA_LEN)
 		rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
 
-	RTL_W8(MaxTxPacketSize, TxPacketMax);
+	RTL_W8(MaxTxPacketSize, txpacketmax);
 
 	rtl_disable_clock_request(pdev);
 
@@ -6227,7 +6232,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
 
-	RTL_W8(MaxTxPacketSize, TxPacketMax);
+	RTL_W8(MaxTxPacketSize, txpacketmax);
 
 	rtl_set_rx_max_size(ioaddr, rx_buf_sz);
 
@@ -6521,7 +6526,7 @@ static void rtl_hw_start_8101(struct net_device *dev)
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
 
-	RTL_W8(MaxTxPacketSize, TxPacketMax);
+	RTL_W8(MaxTxPacketSize, txpacketmax);
 
 	rtl_set_rx_max_size(ioaddr, rx_buf_sz);
 
-- 
2.1.4

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

end of thread, other threads:[~2015-08-03 21:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ctml34x6j21mkn1wutfemkq7.1438638110313@email.android.com>
2015-08-03 21:56 ` [PATCH] r8169: Permit users to change transmit and receive max pachet size David Miller
     [not found] <yqromneucjufgmy89t6y59jf.1438635988401@email.android.com>
2015-08-03 21:12 ` David Miller
2015-08-03  7:28 Corcodel Marian
2015-08-03  7:45 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.