[linux-sunxi] A20 GMAC rx_coe and bugged_jumbo in dwmac-sunxi.c

2015-09-15 Thread db260179
Hi All,

A quick background of what I’m trying to achieve and if possible?

So, having messed about with the TX and RX delay in the U-boot for a Lamobo R1 
board, there appears to be some form of effect going on with the network speed 
measurements.

It has been recorded that this board uses the GMAC to talk to the Broadcom 
BCM53125 PHY - A TX Delay is needed to compensate for differing PCB lengths.

My query from looking at the stmmac source code, is what can be the possible 
causes for a 50% reduction of speed in gigabit mode compared to its little 
brother of BananaPi A20 (using a realtek PHY)?

Is the DMA being used in the stmmac driver for GMAC?

Why isnt the rx_coe of bugged_jumbo not being used? (sunxi 3.4 show's it be 
initiated?)

I've noticed on the /proc/softirqs that the RX has large values and TX having 
small increments?

What area should I be looking at to diagnose or debug further?

Thanks for any assistance.
David Bentham

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: Help with AX88179 usb ethernet driver - kswapd0: page allocation failure: order:3, mode:0x4020

2014-04-10 Thread db260179
Specifically a memory alignment issue, the other part of the patch is to add 
more debugging.

So as you hit high load, the memory starts to get out of whack - ka boom tcp 
starts to complain.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Help with AX88179 usb ethernet driver - kswapd0: page allocation failure: order:3, mode:0x4020

2014-04-09 Thread db260179
This is due to a bug in the driver affecting kernel versions from <3.4.

In case anyone wants a working driver here is the patch for version 1.6.0 of 
ax88179_178a - 
https://launchpad.net/~qji/+archive/ax88179/+files/ax88179_1.9.0-0.tar.gz has 
the 1.6.0 driver

--- 
ax88179_178a1.9/ax88179-1.9.0-0/content/usr/share/ax88179/src/AX88179_178A_LINUX_DRIVER_v1.6.0_SOURCE/ax88179_178a.c
2013-09-10 00:33:30.0 +0100
+++ ax88179_178a/ax88179_178a.c 2014-04-08 15:01:53.0 +0100
@@ -20,7 +20,8 @@
  */
 
 /* debug messages, extra info */
-/* #define DEBUG */
+#defineDEBUG
+#define VERBOSE
 
 #include 
 /*#include */
@@ -74,6 +75,8 @@
  u16 size, void *data, int in_pm)
 {
int ret;
+   void *buf = kmalloc(size, GFP_ATOMIC);
+   
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
 
@@ -85,7 +88,7 @@
fn = usbnet_read_cmd_nopm;
 
ret = fn(dev, cmd, USB_DIR_IN | USB_TYPE_VENDOR |
-USB_RECIP_DEVICE, value, index, data, size);
+USB_RECIP_DEVICE, value, index, buf, size);
 
if (unlikely(ret < 0))
netdev_warn(dev->net, "Failed to read reg index 0x%04x: %d\n",
@@ -98,17 +101,27 @@
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value,
index,
-   data,
+   buf,
size,
USB_CTRL_GET_TIMEOUT);
 #endif
+   
+   memcpy(data, buf, size);
+   
+   kfree(buf);
+
return ret;
 }
 
 static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 
index,
   u16 size, void *data, int in_pm)
 {
+   //printk(KERN_DEBUG "Here I am: %s:%i\n", __FILE__, __LINE__);
+   //printk(KERN_DEBUG "&data : %p, misalignment: %x, size: %x \n", data, 
((uintptr_t)data & 3), size);
+
int ret;
+   void *buf = kmemdup(data, size, GFP_ATOMIC);
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
 
@@ -120,7 +133,7 @@
fn = usbnet_write_cmd_nopm;
 
ret = fn(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR |
-USB_RECIP_DEVICE, value, index, data, size);
+USB_RECIP_DEVICE, value, index, buf, size);
 
if (unlikely(ret < 0))
netdev_warn(dev->net, "Failed to write reg index 0x%04x: %d\n",
@@ -133,17 +146,20 @@
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value,
index,
-   data,
+   buf,
size,
USB_CTRL_SET_TIMEOUT);
 
 #endif
+   kfree(buf);
return ret;
 }
 
 static int ax88179_read_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
 u16 index, u16 size, void *data, int eflag)
 {
+   //printk(KERN_DEBUG "Here I am: %s:%i\n", __FILE__, __LINE__);
+
int ret;
 
if (eflag && (2 == size)) {
@@ -166,17 +182,17 @@
 static int ax88179_write_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
  u16 index, u16 size, void *data)
 {
+   //printk(KERN_DEBUG "Here I am: %s:%i\n", __FILE__, __LINE__);
+
int ret;
 
if (2 == size) {
u16 buf;
buf = *((u16 *)data);
cpu_to_le16s(&buf);
-   ret = __ax88179_write_cmd(dev, cmd, value, index,
- size, &buf, 1);
+   ret = __ax88179_write_cmd(dev, cmd, value, index, size, &buf, 
1);
} else {
-   ret = __ax88179_write_cmd(dev, cmd, value, index,
- size, data, 1);
+   ret = __ax88179_write_cmd(dev, cmd, value, index, size, data, 
1);
}
 
return ret;
@@ -185,19 +201,21 @@
 static int ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
u16 size, void *data, int eflag)
 {
+   //printk(KERN_DEBUG "Here I am: %s:%i\n", __FILE__, __LINE__);
+
 
int ret;
 
if (eflag && (2 == size)) {
-   u16 buf;
-   ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
-   le16_to_cpus(&buf);
-   *((u16 *)data) = buf;
+   u16 buf_le;
+   ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf_le, 
0);
+   le16_to_cpus(&buf_le);
+   *((u16 *)data) = buf_le;
} else if (eflag && (4 == size)) {
-   u32 buf;
-   ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
-   le32_to_cpus(&buf);
-   *((u32 *)data) = buf;
+   u32 buf_le;
+   ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf_le, 
0);
+   le32_to_cpus(&buf_le);
+   *((u3