Netdev List
 help / color / mirror / Atom feed
* [PATCH 0/6] VSOCK for Linux upstreaming
From: George Zhang @ 2012-11-07 18:45 UTC (permalink / raw)
  To: netdev, linux-kernel, georgezhang, virtualization
  Cc: pv-drivers, gregkh, davem


* * *
This series of VSOCK linux upstreaming patches include latest udpate from
VMware.

Summary of changes:
        - Fix some new sparse issues.
        - Remove some unneeded casts for VMCI.
        - add more __user annotations for VMCI.
        - Remove kernel version-specific bits from vSockets.


* * *

In an effort to improve the out-of-the-box experience with Linux
kernels for VMware users, VMware is working on readying the Virtual
Machine Communication Interface (vmw_vmci) and VMCI Sockets (VSOCK)
(vmw_vsock) kernel modules for inclusion in the Linux kernel. The
purpose of this post is to acquire feedback on the vmw_vsock kernel
module. The vmw_vmci kernel module has been presented in an early post.


* * *

VMCI Sockets allows virtual machines to communicate with host kernel
modules and the VMware hypervisors. VMCI Sockets kernel module has
dependency on VMCI kernel module. User level applications both in
a virtual machine and on the host can use vmw_vmci through VMCI
Sockets API which facilitates fast and efficient communication
between guest virtual machines and their host. A socket
address family designed to be compatible with UDP and TCP at the
interface level. Today, VMCI and VMCI Sockets are used by the VMware
shared folders (HGFS) and various VMware Tools components inside the
guest for zero-config, network-less access to VMware host services. In
addition to this, VMware's users are using VMCI Sockets for various
applications, where network access of the virtual machine is
restricted or non-existent. Examples of this are VMs communicating
with device proxies for proprietary hardware running as host
applications and automated testing of applications running within
virtual machines.

The VMware VMCI Sockets are similar to other socket types, like
Berkeley UNIX socket interface. The VMCI sockets module supports
both connection-oriented stream sockets like TCP, and connectionless
datagram sockets like UDP. The VSOCK protocol family is defined as
"AF_VSOCK" and the socket operations split for SOCK_DGRAM and
SOCK_STREAM.

For additional information about the use of VMCI and in particular
VMCI Sockets, please refer to the VMCI Socket Programming Guide
available at https://www.vmware.com/support/developer/vmci-sdk/.



---

George Zhang (6):
      VSOCK: vsock protocol implementation.
      VSOCK: vsock address implementaion.
      VSOCK: notification implementation.
      VSOCK: statistics implementation.
      VSOCK: utility functions.
      VSOCK: header and config files.


 include/linux/socket.h              |    4 
 net/Kconfig                         |    1 
 net/Makefile                        |    1 
 net/vmw_vsock/Kconfig               |   14 
 net/vmw_vsock/Makefile              |    4 
 net/vmw_vsock/af_vsock.c            | 4135 +++++++++++++++++++++++++++++++++++
 net/vmw_vsock/af_vsock.h            |  179 ++
 net/vmw_vsock/notify.c              |  984 ++++++++
 net/vmw_vsock/notify.h              |  130 +
 net/vmw_vsock/notify_qstate.c       |  627 +++++
 net/vmw_vsock/stats.c               |   37 
 net/vmw_vsock/stats.h               |  219 ++
 net/vmw_vsock/util.c                |  626 +++++
 net/vmw_vsock/util.h                |  312 +++
 net/vmw_vsock/vmci_sockets.h        |  517 ++++
 net/vmw_vsock/vmci_sockets_packet.h |  106 +
 net/vmw_vsock/vsock_addr.c          |  264 ++
 net/vmw_vsock/vsock_addr.h          |   40 
 net/vmw_vsock/vsock_common.h        |  130 +
 net/vmw_vsock/vsock_packet.h        |  131 +
 net/vmw_vsock/vsock_version.h       |   29 
 21 files changed, 8489 insertions(+), 1 deletions(-)
 create mode 100644 net/vmw_vsock/Kconfig
 create mode 100644 net/vmw_vsock/Makefile
 create mode 100644 net/vmw_vsock/af_vsock.c
 create mode 100644 net/vmw_vsock/af_vsock.h
 create mode 100644 net/vmw_vsock/notify.c
 create mode 100644 net/vmw_vsock/notify.h
 create mode 100644 net/vmw_vsock/notify_qstate.c
 create mode 100644 net/vmw_vsock/stats.c
 create mode 100644 net/vmw_vsock/stats.h
 create mode 100644 net/vmw_vsock/util.c
 create mode 100644 net/vmw_vsock/util.h
 create mode 100644 net/vmw_vsock/vmci_sockets.h
 create mode 100644 net/vmw_vsock/vmci_sockets_packet.h
 create mode 100644 net/vmw_vsock/vsock_addr.c
 create mode 100644 net/vmw_vsock/vsock_addr.h
 create mode 100644 net/vmw_vsock/vsock_common.h
 create mode 100644 net/vmw_vsock/vsock_packet.h
 create mode 100644 net/vmw_vsock/vsock_version.h

-- 
Signature

^ permalink raw reply

* Re: mmap RX_RING socket issue 32b application running on 64b kernel.
From: Daniel Borkmann @ 2012-11-07 18:26 UTC (permalink / raw)
  To: Ronny Meeus; +Cc: netdev
In-Reply-To: <CAMJ=MEfeMDC3H2bjKz9XA4072Vo7U17108N4bK77q0GvUEF09w@mail.gmail.com>

On Wed, Nov 7, 2012 at 6:58 PM, Ronny Meeus <ronny.meeus@gmail.com> wrote:
> I have an application using raw Ethernet sockets in combination with
> the mmaped RX_RING.
> The application is running on a Cavium MIPS processor (64bit) and the
> application code is compiled with the N32 ABI.
>
> Since the ring buffer is shared between the Linux kernel and the
> application there is a conflict in the way the data is presented.
> Each buffer in the ring has a header that has following structure:
> (File http://lxr.free-electrons.com/source/include/linux/if_packet.h )
> 103 struct tpacket_hdr {
> 104         unsigned long   tp_status;
> 105         unsigned int    tp_len;
> 106         unsigned int    tp_snaplen;
> 107         unsigned short  tp_mac;
> 108         unsigned short  tp_net;
> 109         unsigned int    tp_sec;
> 110         unsigned int    tp_usec;
> 111 };
>
> The status field indicates that the buffer belongs to the kernel or to
> the user. Note that an unsigned long is used to represent the field.
> In the kernel the long is 64 bit while in application space the long
> is only 32bit, so the bits do not match.
>
> After adapting the code to take this into account my program works well.
> In my test program I have defined a new struct where I change the
> “unsigned long” into an “unsigned long long”:
>
> struct tpacket_hdr_64 {
>   unsigned long long tp_status;
>   unsigned int tp_len;
>   unsigned int tp_snaplen;
>   unsigned short tp_mac;
>   unsigned short tp_net;
>   unsigned int tp_sec;
>   unsigned int tp_usec;
> };
>
> In my opinion this is not a correct solution. It should be solved
> somewhere in the include file I used so that it is transparent for the
> application.
> Please comment.

Have you tried to use packet_mmap with TPACKET version 2  [1]?

In my understanding, it was introduced because of such issues that you
described.

[1] E.g. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=bbd6ef87c544d88c30e4b762b1b61ef267a7d279

^ permalink raw reply

* [PATCH 8/8] net/at91_ether: fix comment and style issues
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352312097-31320-1-git-send-email-manabian@gmail.com>

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 drivers/net/ethernet/cadence/at91_ether.c | 111 ++++++++++++++----------------
 1 file changed, 51 insertions(+), 60 deletions(-)

diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index cf0cf06..e7a476c 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -6,11 +6,6 @@
  * Based on an earlier Atmel EMAC macrocell driver by Atmel and Lineo Inc.
  * Initial version by Rick Bronson 01/11/2003
  *
- * Intel LXT971A PHY support by Christopher Bahns & David Knickerbocker
- *   (Polaroid Corporation)
- *
- * Realtek RTL8201(B)L PHY support by Roman Avramenko <roman@imsystems.ru>
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version
@@ -38,22 +33,17 @@
 
 #include "macb.h"
 
-#define DRV_NAME	"at91_ether"
-#define DRV_VERSION	"1.0"
-
 /* 1518 rounded up */
 #define MAX_RBUFF_SZ	0x600
 /* max number of receive buffers */
 #define MAX_RX_DESCR	9
 
-/*
- * Initialize and start the Receiver and Transmit subsystems
- */
+/* Initialize and start the Receiver and Transmit subsystems */
 static int at91ether_start(struct net_device *dev)
 {
 	struct macb *lp = netdev_priv(dev);
-	unsigned long ctl;
 	dma_addr_t addr;
+	u32 ctl;
 	int i;
 
 	lp->rx_ring = dma_alloc_coherent(&lp->pdev->dev,
@@ -100,13 +90,11 @@ static int at91ether_start(struct net_device *dev)
 	return 0;
 }
 
-/*
- * Open the ethernet interface
- */
+/* Open the ethernet interface */
 static int at91ether_open(struct net_device *dev)
 {
 	struct macb *lp = netdev_priv(dev);
-	unsigned long ctl;
+	u32 ctl;
 	int ret;
 
 	if (!is_valid_ether_addr(dev->dev_addr))
@@ -123,9 +111,13 @@ static int at91ether_open(struct net_device *dev)
 		return ret;
 
 	/* Enable MAC interrupts */
-	macb_writel(lp, IER, MACB_BIT(RCOMP) | MACB_BIT(RXUBR)
-				| MACB_BIT(ISR_TUND) | MACB_BIT(ISR_RLE) | MACB_BIT(TCOMP)
-				| MACB_BIT(ISR_ROVR) | MACB_BIT(HRESP));
+	macb_writel(lp, IER, MACB_BIT(RCOMP)	|
+			     MACB_BIT(RXUBR)	|
+			     MACB_BIT(ISR_TUND)	|
+			     MACB_BIT(ISR_RLE)	|
+			     MACB_BIT(TCOMP)	|
+			     MACB_BIT(ISR_ROVR)	|
+			     MACB_BIT(HRESP));
 
 	/* schedule a link state check */
 	phy_start(lp->phy_dev);
@@ -135,23 +127,24 @@ static int at91ether_open(struct net_device *dev)
 	return 0;
 }
 
-/*
- * Close the interface
- */
+/* Close the interface */
 static int at91ether_close(struct net_device *dev)
 {
 	struct macb *lp = netdev_priv(dev);
-	unsigned long ctl;
+	u32 ctl;
 
 	/* Disable Receiver and Transmitter */
 	ctl = macb_readl(lp, NCR);
 	macb_writel(lp, NCR, ctl & ~(MACB_BIT(TE) | MACB_BIT(RE)));
 
 	/* Disable MAC interrupts */
-	macb_writel(lp, IDR, MACB_BIT(RCOMP) | MACB_BIT(RXUBR)
-				| MACB_BIT(ISR_TUND) | MACB_BIT(ISR_RLE)
-				| MACB_BIT(TCOMP) | MACB_BIT(ISR_ROVR)
-				| MACB_BIT(HRESP));
+	macb_writel(lp, IDR, MACB_BIT(RCOMP)	|
+			     MACB_BIT(RXUBR)	|
+			     MACB_BIT(ISR_TUND)	|
+			     MACB_BIT(ISR_RLE)	|
+			     MACB_BIT(TCOMP)	|
+			     MACB_BIT(ISR_ROVR) |
+			     MACB_BIT(HRESP));
 
 	netif_stop_queue(dev);
 
@@ -168,9 +161,7 @@ static int at91ether_close(struct net_device *dev)
 	return 0;
 }
 
-/*
- * Transmit packet.
- */
+/* Transmit packet */
 static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct macb *lp = netdev_priv(dev);
@@ -181,7 +172,8 @@ static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		/* Store packet information (to free when Tx completed) */
 		lp->skb = skb;
 		lp->skb_length = skb->len;
-		lp->skb_physaddr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE);
+		lp->skb_physaddr = dma_map_single(NULL, skb->data, skb->len,
+							DMA_TO_DEVICE);
 
 		/* Set address of the data in the Transmit Address register */
 		macb_writel(lp, TAR, lp->skb_physaddr);
@@ -190,16 +182,13 @@ static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	} else {
 		netdev_err(dev, "%s called, but device is busy!\n", __func__);
-		return NETDEV_TX_BUSY;	/* if we return anything but zero, dev.c:1055 calls kfree_skb(skb)
-				on this skb, he also reports -ENETDOWN and printk's, so either
-				we free and return(0) or don't free and return 1 */
+		return NETDEV_TX_BUSY;
 	}
 
 	return NETDEV_TX_OK;
 }
 
-/*
- * Extract received frame from buffer descriptors and sent to upper layers.
+/* Extract received frame from buffer descriptors and sent to upper layers.
  * (Called from interrupt context)
  */
 static void at91ether_rx(struct net_device *dev)
@@ -240,24 +229,25 @@ static void at91ether_rx(struct net_device *dev)
 	}
 }
 
-/*
- * MAC interrupt handler
- */
+/* MAC interrupt handler */
 static irqreturn_t at91ether_interrupt(int irq, void *dev_id)
 {
-	struct net_device *dev = (struct net_device *) dev_id;
+	struct net_device *dev = dev_id;
 	struct macb *lp = netdev_priv(dev);
-	unsigned long intstatus, ctl;
+	u32 intstatus, ctl;
 
 	/* MAC Interrupt Status register indicates what interrupts are pending.
-	   It is automatically cleared once read. */
+	 * It is automatically cleared once read.
+	 */
 	intstatus = macb_readl(lp, ISR);
 
-	if (intstatus & MACB_BIT(RCOMP))		/* Receive complete */
+	/* Receive complete */
+	if (intstatus & MACB_BIT(RCOMP))
 		at91ether_rx(dev);
 
-	if (intstatus & MACB_BIT(TCOMP)) {	/* Transmit complete */
-		/* The TCOM bit is set even if the transmission failed. */
+	/* Transmit complete */
+	if (intstatus & MACB_BIT(TCOMP)) {
+		/* The TCOM bit is set even if the transmission failed */
 		if (intstatus & (MACB_BIT(ISR_TUND) | MACB_BIT(ISR_RLE)))
 			lp->stats.tx_errors++;
 
@@ -271,7 +261,7 @@ static irqreturn_t at91ether_interrupt(int irq, void *dev_id)
 		netif_wake_queue(dev);
 	}
 
-	/* Work-around for Errata #11 */
+	/* Work-around for EMAC Errata section 41.3.1 */
 	if (intstatus & MACB_BIT(RXUBR)) {
 		ctl = macb_readl(lp, NCR);
 		macb_writel(lp, NCR, ctl & ~MACB_BIT(RE));
@@ -354,18 +344,17 @@ static int at91ether_get_hwaddr_dt(struct macb *bp)
 }
 #endif
 
-/*
- * Detect MAC & PHY and perform ethernet interface initialization
- */
+/* Detect MAC & PHY and perform ethernet interface initialization */
 static int __init at91ether_probe(struct platform_device *pdev)
 {
 	struct macb_platform_data *board_data = pdev->dev.platform_data;
 	struct resource *regs;
 	struct net_device *dev;
 	struct phy_device *phydev;
+	struct pinctrl *pinctrl;
 	struct macb *lp;
 	int res;
-	struct pinctrl *pinctrl;
+	u32 reg;
 
 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!regs)
@@ -389,7 +378,8 @@ static int __init at91ether_probe(struct platform_device *pdev)
 	lp->dev = dev;
 	spin_lock_init(&lp->lock);
 
-	dev->base_addr = regs->start;		/* physical base address */
+	/* physical base address */
+	dev->base_addr = regs->start;
 	lp->regs = devm_ioremap(&pdev->dev, regs->start, resource_size(regs));
 	if (!lp->regs) {
 		res = -ENOMEM;
@@ -432,10 +422,11 @@ static int __init at91ether_probe(struct platform_device *pdev)
 
 	macb_writel(lp, NCR, 0);
 
+	reg = MACB_BF(CLK, MACB_CLK_DIV32) | MACB_BIT(BIG);
 	if (lp->phy_interface == PHY_INTERFACE_MODE_RMII)
-		macb_writel(lp, NCFGR, MACB_BF(CLK, MACB_CLK_DIV32) | MACB_BIT(BIG) | MACB_BIT(RM9200_RMII));
-	else
-		macb_writel(lp, NCFGR, MACB_BF(CLK, MACB_CLK_DIV32) | MACB_BIT(BIG));
+		reg |= MACB_BIT(RM9200_RMII);
+
+	macb_writel(lp, NCFGR, reg);
 
 	/* Register the network interface */
 	res = register_netdev(dev);
@@ -445,11 +436,13 @@ static int __init at91ether_probe(struct platform_device *pdev)
 	if (macb_mii_init(lp) != 0)
 		goto err_out_unregister_netdev;
 
-	netif_carrier_off(dev);		/* will be enabled in open() */
+	/* will be enabled in open() */
+	netif_carrier_off(dev);
 
 	phydev = lp->phy_dev;
 	netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
-				phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
+				phydev->drv->name, dev_name(&phydev->dev),
+				phydev->irq);
 
 	/* Display ethernet banner */
 	netdev_info(dev, "AT91 ethernet at 0x%08lx int=%d (%pM)\n",
@@ -486,7 +479,6 @@ static int __devexit at91ether_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-
 static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
 	struct net_device *net_dev = platform_get_drvdata(pdev);
@@ -514,7 +506,6 @@ static int at91ether_resume(struct platform_device *pdev)
 	}
 	return 0;
 }
-
 #else
 #define at91ether_suspend	NULL
 #define at91ether_resume	NULL
@@ -525,7 +516,7 @@ static struct platform_driver at91ether_driver = {
 	.suspend	= at91ether_suspend,
 	.resume		= at91ether_resume,
 	.driver		= {
-		.name	= DRV_NAME,
+		.name	= "at91_ether",
 		.owner	= THIS_MODULE,
 		.of_match_table	= of_match_ptr(at91ether_dt_ids),
 	},
@@ -547,4 +538,4 @@ module_exit(at91ether_exit)
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("AT91RM9200 EMAC Ethernet driver");
 MODULE_AUTHOR("Andrew Victor");
-MODULE_ALIAS("platform:" DRV_NAME);
+MODULE_ALIAS("platform:at91_ether");
-- 
1.8.0

^ permalink raw reply related

* [PATCH 7/8] net/at91_ether: clean up print outs
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352312097-31320-1-git-send-email-manabian@gmail.com>

Convert all printk's to netdev_ counterparts and fix up some
printed texts.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 drivers/net/ethernet/cadence/at91_ether.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 67b66c4..cf0cf06 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -60,7 +60,7 @@ static int at91ether_start(struct net_device *dev)
 					MAX_RX_DESCR * sizeof(struct macb_dma_desc),
 					&lp->rx_ring_dma, GFP_KERNEL);
 	if (!lp->rx_ring) {
-		netdev_err(lp->dev, "unable to alloc rx ring DMA buffer\n");
+		netdev_err(dev, "unable to alloc rx ring DMA buffer\n");
 		return -ENOMEM;
 	}
 
@@ -68,7 +68,7 @@ static int at91ether_start(struct net_device *dev)
 					MAX_RX_DESCR * MAX_RBUFF_SZ,
 					&lp->rx_buffers_dma, GFP_KERNEL);
 	if (!lp->rx_buffers) {
-		netdev_err(lp->dev, "unable to alloc rx data DMA buffer\n");
+		netdev_err(dev, "unable to alloc rx data DMA buffer\n");
 
 		dma_free_coherent(&lp->pdev->dev,
 					MAX_RX_DESCR * sizeof(struct macb_dma_desc),
@@ -189,7 +189,7 @@ static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		macb_writel(lp, TCR, skb->len);
 
 	} else {
-		printk(KERN_ERR "at91_ether.c: at91ether_start_xmit() called, but device is busy!\n");
+		netdev_err(dev, "%s called, but device is busy!\n", __func__);
 		return NETDEV_TX_BUSY;	/* if we return anything but zero, dev.c:1055 calls kfree_skb(skb)
 				on this skb, he also reports -ENETDOWN and printk's, so either
 				we free and return(0) or don't free and return 1 */
@@ -279,7 +279,7 @@ static irqreturn_t at91ether_interrupt(int irq, void *dev_id)
 	}
 
 	if (intstatus & MACB_BIT(ISR_ROVR))
-		printk("%s: ROVR error\n", dev->name);
+		netdev_err(dev, "ROVR error\n");
 
 	return IRQ_HANDLED;
 }
@@ -449,14 +449,11 @@ static int __init at91ether_probe(struct platform_device *pdev)
 
 	phydev = lp->phy_dev;
 	netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
-		phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
+				phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
 
 	/* Display ethernet banner */
-	printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%pM)\n",
-	       dev->name, (uint) dev->base_addr, dev->irq,
-	       macb_readl(lp, NCFGR) & MACB_BIT(SPD) ? "100-" : "10-",
-	       macb_readl(lp, NCFGR) & MACB_BIT(FD) ? "FullDuplex" : "HalfDuplex",
-	       dev->dev_addr);
+	netdev_info(dev, "AT91 ethernet at 0x%08lx int=%d (%pM)\n",
+				dev->base_addr, dev->irq, dev->dev_addr);
 
 	return 0;
 
-- 
1.8.0

^ permalink raw reply related

* [PATCH 6/8] net/at91_ether: drop board_data private struct member
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352312097-31320-1-git-send-email-manabian@gmail.com>

No longer used after gpio phy interrupt support was
removed from at91_ether.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 drivers/net/ethernet/cadence/at91_ether.c | 2 --
 drivers/net/ethernet/cadence/macb.h       | 7 +------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 65a9afa..67b66c4 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -387,8 +387,6 @@ static int __init at91ether_probe(struct platform_device *pdev)
 	lp = netdev_priv(dev);
 	lp->pdev = pdev;
 	lp->dev = dev;
-	if (board_data)
-		lp->board_data = *board_data;
 	spin_lock_init(&lp->lock);
 
 	dev->base_addr = regs->start;		/* physical base address */
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 97f74dd..864e380 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -557,12 +557,7 @@ struct macb {
 
 	phy_interface_t		phy_interface;
 
-	/* at91_private */
-	struct macb_platform_data board_data;	/* board-specific
-						 * configuration (shared with
-						 * macb for common data */
-
-	/* Transmit */
+	/* AT91RM9200 transmit */
 	struct sk_buff *skb;			/* holds skb until xmit interrupt completes */
 	dma_addr_t skb_physaddr;		/* phys addr from pci_map_single */
 	int skb_length;				/* saved skb length for pci_unmap_single */
-- 
1.8.0

^ permalink raw reply related

* [PATCH 5/8] net/at91_ether: use stat function from macb
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352312097-31320-1-git-send-email-manabian@gmail.com>

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 drivers/net/ethernet/cadence/at91_ether.c | 49 +++++--------------------------
 drivers/net/ethernet/cadence/macb.c       |  3 +-
 drivers/net/ethernet/cadence/macb.h       |  1 +
 3 files changed, 11 insertions(+), 42 deletions(-)

diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 2f89e64..65a9afa 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -182,7 +182,6 @@ static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		lp->skb = skb;
 		lp->skb_length = skb->len;
 		lp->skb_physaddr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE);
-		dev->stats.tx_bytes += skb->len;
 
 		/* Set address of the data in the Transmit Address register */
 		macb_writel(lp, TAR, lp->skb_physaddr);
@@ -200,41 +199,6 @@ static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
 }
 
 /*
- * Update the current statistics from the internal statistics registers.
- */
-static struct net_device_stats *at91ether_stats(struct net_device *dev)
-{
-	struct macb *lp = netdev_priv(dev);
-	int ale, lenerr, seqe, lcol, ecol;
-
-	if (netif_running(dev)) {
-		dev->stats.rx_packets += macb_readl(lp, FRO);	/* Good frames received */
-		ale = macb_readl(lp, ALE);
-		dev->stats.rx_frame_errors += ale;				/* Alignment errors */
-		lenerr = macb_readl(lp, ELE) + macb_readl(lp, USF);
-		dev->stats.rx_length_errors += lenerr;				/* Excessive Length or Undersize Frame error */
-		seqe = macb_readl(lp, FCSE);
-		dev->stats.rx_crc_errors += seqe;				/* CRC error */
-		dev->stats.rx_fifo_errors += macb_readl(lp, RRE);/* Receive buffer not available */
-		dev->stats.rx_errors += (ale + lenerr + seqe
-			+ macb_readl(lp, RSE) + macb_readl(lp, RJA));
-
-		dev->stats.tx_packets += macb_readl(lp, FTO);	/* Frames successfully transmitted */
-		dev->stats.tx_fifo_errors += macb_readl(lp, TUND);	/* Transmit FIFO underruns */
-		dev->stats.tx_carrier_errors += macb_readl(lp, CSE);	/* Carrier Sense errors */
-		dev->stats.tx_heartbeat_errors += macb_readl(lp, STE);/* Heartbeat error */
-
-		lcol = macb_readl(lp, LCOL);
-		ecol = macb_readl(lp, EXCOL);
-		dev->stats.tx_window_errors += lcol;			/* Late collisions */
-		dev->stats.tx_aborted_errors += ecol;			/* 16 collisions */
-
-		dev->stats.collisions += (macb_readl(lp, SCF) + macb_readl(lp, MCF) + lcol + ecol);
-	}
-	return &dev->stats;
-}
-
-/*
  * Extract received frame from buffer descriptors and sent to upper layers.
  * (Called from interrupt context)
  */
@@ -254,15 +218,16 @@ static void at91ether_rx(struct net_device *dev)
 			memcpy(skb_put(skb, pktlen), p_recv, pktlen);
 
 			skb->protocol = eth_type_trans(skb, dev);
-			dev->stats.rx_bytes += pktlen;
+			lp->stats.rx_packets++;
+			lp->stats.rx_bytes += pktlen;
 			netif_rx(skb);
 		} else {
-			dev->stats.rx_dropped += 1;
+			lp->stats.rx_dropped++;
 			netdev_notice(dev, "Memory squeeze, dropping packet.\n");
 		}
 
 		if (lp->rx_ring[lp->rx_tail].ctrl & MACB_BIT(RX_MHASH_MATCH))
-			dev->stats.multicast++;
+			lp->stats.multicast++;
 
 		/* reset ownership bit */
 		lp->rx_ring[lp->rx_tail].addr &= ~MACB_BIT(RX_USED);
@@ -294,12 +259,14 @@ static irqreturn_t at91ether_interrupt(int irq, void *dev_id)
 	if (intstatus & MACB_BIT(TCOMP)) {	/* Transmit complete */
 		/* The TCOM bit is set even if the transmission failed. */
 		if (intstatus & (MACB_BIT(ISR_TUND) | MACB_BIT(ISR_RLE)))
-			dev->stats.tx_errors += 1;
+			lp->stats.tx_errors++;
 
 		if (lp->skb) {
 			dev_kfree_skb_irq(lp->skb);
 			lp->skb = NULL;
 			dma_unmap_single(NULL, lp->skb_physaddr, lp->skb_length, DMA_TO_DEVICE);
+			lp->stats.tx_packets++;
+			lp->stats.tx_bytes += lp->skb_length;
 		}
 		netif_wake_queue(dev);
 	}
@@ -332,7 +299,7 @@ static const struct net_device_ops at91ether_netdev_ops = {
 	.ndo_open		= at91ether_open,
 	.ndo_stop		= at91ether_close,
 	.ndo_start_xmit		= at91ether_start_xmit,
-	.ndo_get_stats		= at91ether_stats,
+	.ndo_get_stats		= macb_get_stats,
 	.ndo_set_rx_mode	= macb_set_rx_mode,
 	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_do_ioctl		= macb_ioctl,
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 6be5a26..1fac769 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1292,7 +1292,7 @@ static struct net_device_stats *gem_get_stats(struct macb *bp)
 	return nstat;
 }
 
-static struct net_device_stats *macb_get_stats(struct net_device *dev)
+struct net_device_stats *macb_get_stats(struct net_device *dev)
 {
 	struct macb *bp = netdev_priv(dev);
 	struct net_device_stats *nstat = &bp->stats;
@@ -1338,6 +1338,7 @@ static struct net_device_stats *macb_get_stats(struct net_device *dev)
 
 	return nstat;
 }
+EXPORT_SYMBOL_GPL(macb_get_stats);
 
 static int macb_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index d723494..97f74dd 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -572,6 +572,7 @@ extern const struct ethtool_ops macb_ethtool_ops;
 
 int macb_mii_init(struct macb *bp);
 int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
+struct net_device_stats *macb_get_stats(struct net_device *dev);
 void macb_set_rx_mode(struct net_device *dev);
 void macb_set_hwaddr(struct macb *bp);
 void macb_get_hwaddr(struct macb *bp);
-- 
1.8.0

^ permalink raw reply related

* [PATCH 4/8] net/at91_ether: use macb functions for get/set hwaddr
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352312097-31320-1-git-send-email-manabian@gmail.com>

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 drivers/net/ethernet/cadence/at91_ether.c | 112 +-----------------------------
 1 file changed, 3 insertions(+), 109 deletions(-)

diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 6eb928e..2f89e64 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -46,109 +46,6 @@
 /* max number of receive buffers */
 #define MAX_RX_DESCR	9
 
-/* ......................... ADDRESS MANAGEMENT ........................ */
-
-/*
- * NOTE: Your bootloader must always set the MAC address correctly before
- * booting into Linux.
- *
- * - It must always set the MAC address after reset, even if it doesn't
- *   happen to access the Ethernet while it's booting.  Some versions of
- *   U-Boot on the AT91RM9200-DK do not do this.
- *
- * - Likewise it must store the addresses in the correct byte order.
- *   MicroMonitor (uMon) on the CSB337 does this incorrectly (and
- *   continues to do so, for bug-compatibility).
- */
-
-static short __init unpack_mac_address(struct net_device *dev, unsigned int hi, unsigned int lo)
-{
-	struct macb *lp = netdev_priv(dev);
-	char addr[6];
-
-	if (lp->board_data.rev_eth_addr) {
-		addr[5] = (lo & 0xff);			/* The CSB337 bootloader stores the MAC the wrong-way around */
-		addr[4] = (lo & 0xff00) >> 8;
-		addr[3] = (lo & 0xff0000) >> 16;
-		addr[2] = (lo & 0xff000000) >> 24;
-		addr[1] = (hi & 0xff);
-		addr[0] = (hi & 0xff00) >> 8;
-	}
-	else {
-		addr[0] = (lo & 0xff);
-		addr[1] = (lo & 0xff00) >> 8;
-		addr[2] = (lo & 0xff0000) >> 16;
-		addr[3] = (lo & 0xff000000) >> 24;
-		addr[4] = (hi & 0xff);
-		addr[5] = (hi & 0xff00) >> 8;
-	}
-
-	if (is_valid_ether_addr(addr)) {
-		memcpy(dev->dev_addr, &addr, 6);
-		return 1;
-	}
-	return 0;
-}
-
-/*
- * Set the ethernet MAC address in dev->dev_addr
- */
-static void __init get_mac_address(struct net_device *dev)
-{
-	struct macb *lp = netdev_priv(dev);
-
-	/* Check Specific-Address 1 */
-	if (unpack_mac_address(dev, macb_readl(lp, SA1T), macb_readl(lp, SA1B)))
-		return;
-	/* Check Specific-Address 2 */
-	if (unpack_mac_address(dev, macb_readl(lp, SA2T), macb_readl(lp, SA2B)))
-		return;
-	/* Check Specific-Address 3 */
-	if (unpack_mac_address(dev, macb_readl(lp, SA3T), macb_readl(lp, SA3B)))
-		return;
-	/* Check Specific-Address 4 */
-	if (unpack_mac_address(dev, macb_readl(lp, SA4T), macb_readl(lp, SA4B)))
-		return;
-
-	printk(KERN_ERR "at91_ether: Your bootloader did not configure a MAC address.\n");
-}
-
-/*
- * Program the hardware MAC address from dev->dev_addr.
- */
-static void update_mac_address(struct net_device *dev)
-{
-	struct macb *lp = netdev_priv(dev);
-
-	macb_writel(lp, SA1B, (dev->dev_addr[3] << 24) | (dev->dev_addr[2] << 16)
-					| (dev->dev_addr[1] << 8) | (dev->dev_addr[0]));
-	macb_writel(lp, SA1T, (dev->dev_addr[5] << 8) | (dev->dev_addr[4]));
-
-	macb_writel(lp, SA2B, 0);
-	macb_writel(lp, SA2T, 0);
-}
-
-/*
- * Store the new hardware address in dev->dev_addr, and update the MAC.
- */
-static int set_mac_address(struct net_device *dev, void* addr)
-{
-	struct sockaddr *address = addr;
-
-	if (!is_valid_ether_addr(address->sa_data))
-		return -EADDRNOTAVAIL;
-
-	memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
-	update_mac_address(dev);
-
-	printk("%s: Setting MAC address to %pM\n", dev->name,
-	       dev->dev_addr);
-
-	return 0;
-}
-
-/* ................................ MAC ................................ */
-
 /*
  * Initialize and start the Receiver and Transmit subsystems
  */
@@ -219,8 +116,7 @@ static int at91ether_open(struct net_device *dev)
 	ctl = macb_readl(lp, NCR);
 	macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
 
-	/* Update the MAC address (incase user has changed it) */
-	update_mac_address(dev);
+	macb_set_hwaddr(lp);
 
 	ret = at91ether_start(dev);
 	if (ret)
@@ -438,7 +334,7 @@ static const struct net_device_ops at91ether_netdev_ops = {
 	.ndo_start_xmit		= at91ether_start_xmit,
 	.ndo_get_stats		= at91ether_stats,
 	.ndo_set_rx_mode	= macb_set_rx_mode,
-	.ndo_set_mac_address	= set_mac_address,
+	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_do_ioctl		= macb_ioctl,
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_change_mtu		= eth_change_mtu,
@@ -557,9 +453,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
 
 	res = at91ether_get_hwaddr_dt(lp);
 	if (res < 0)
-		get_mac_address(dev);		/* Get ethernet address and store it in dev->dev_addr */
-
-	update_mac_address(dev);	/* Program ethernet address into MAC */
+		macb_get_hwaddr(lp);
 
 	res = at91ether_get_phy_mode_dt(pdev);
 	if (res < 0) {
-- 
1.8.0

^ permalink raw reply related

* [PATCH 2/8] net/macb: support reversed hw addr
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352312097-31320-1-git-send-email-manabian@gmail.com>

This is used on one AT91RM9200 board where a bootloader stores
the Ethernet address in the wrong order.

Support this on macb so address setting functions can be shared
with the at91_ether driver.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 drivers/net/ethernet/cadence/macb.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 3b609be..a9e5a50 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -111,22 +111,34 @@ static void __macb_set_hwaddr(struct macb *bp)
 
 static void __init macb_get_hwaddr(struct macb *bp)
 {
+	struct macb_platform_data *pdata;
 	u32 bottom;
 	u16 top;
 	u8 addr[6];
 	int i;
 
+	pdata = bp->pdev->dev.platform_data;
+
 	/* Check all 4 address register for vaild address */
 	for (i = 0; i < 4; i++) {
 		bottom = macb_or_gem_readl(bp, SA1B + i * 8);
 		top = macb_or_gem_readl(bp, SA1T + i * 8);
 
-		addr[0] = bottom & 0xff;
-		addr[1] = (bottom >> 8) & 0xff;
-		addr[2] = (bottom >> 16) & 0xff;
-		addr[3] = (bottom >> 24) & 0xff;
-		addr[4] = top & 0xff;
-		addr[5] = (top >> 8) & 0xff;
+		if (pdata && pdata->rev_eth_addr) {
+			addr[5] = bottom & 0xff;
+			addr[4] = (bottom >> 8) & 0xff;
+			addr[3] = (bottom >> 16) & 0xff;
+			addr[2] = (bottom >> 24) & 0xff;
+			addr[1] = top & 0xff;
+			addr[0] = (top & 0xff00) >> 8;
+		} else {
+			addr[0] = bottom & 0xff;
+			addr[1] = (bottom >> 8) & 0xff;
+			addr[2] = (bottom >> 16) & 0xff;
+			addr[3] = (bottom >> 24) & 0xff;
+			addr[4] = top & 0xff;
+			addr[5] = (top >> 8) & 0xff;
+		}
 
 		if (is_valid_ether_addr(addr)) {
 			memcpy(bp->dev->dev_addr, addr, sizeof(addr));
-- 
1.8.0

^ permalink raw reply related

* [PATCH 3/8] net/macb: export macb_set_hwaddr and macb_get_hwaddr
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352312097-31320-1-git-send-email-manabian@gmail.com>

for usage in at91_ether driver.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 drivers/net/ethernet/cadence/macb.c | 8 +++++---
 drivers/net/ethernet/cadence/macb.h | 2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index a9e5a50..6be5a26 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -98,7 +98,7 @@ static void *macb_rx_buffer(struct macb *bp, unsigned int index)
 	return bp->rx_buffers + RX_BUFFER_SIZE * macb_rx_ring_wrap(index);
 }
 
-static void __macb_set_hwaddr(struct macb *bp)
+void macb_set_hwaddr(struct macb *bp)
 {
 	u32 bottom;
 	u16 top;
@@ -108,8 +108,9 @@ static void __macb_set_hwaddr(struct macb *bp)
 	top = cpu_to_le16(*((u16 *)(bp->dev->dev_addr + 4)));
 	macb_or_gem_writel(bp, SA1T, top);
 }
+EXPORT_SYMBOL_GPL(macb_set_hwaddr);
 
-static void __init macb_get_hwaddr(struct macb *bp)
+void macb_get_hwaddr(struct macb *bp)
 {
 	struct macb_platform_data *pdata;
 	u32 bottom;
@@ -149,6 +150,7 @@ static void __init macb_get_hwaddr(struct macb *bp)
 	netdev_info(bp->dev, "invalid hw address, using random\n");
 	eth_hw_addr_random(bp->dev);
 }
+EXPORT_SYMBOL_GPL(macb_get_hwaddr);
 
 static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
 {
@@ -1035,7 +1037,7 @@ static void macb_init_hw(struct macb *bp)
 	u32 config;
 
 	macb_reset_hw(bp);
-	__macb_set_hwaddr(bp);
+	macb_set_hwaddr(bp);
 
 	config = macb_mdc_clk_div(bp);
 	config |= MACB_BF(RBOF, NET_IP_ALIGN);	/* Make eth data aligned */
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 4235ab8..d723494 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -573,6 +573,8 @@ extern const struct ethtool_ops macb_ethtool_ops;
 int macb_mii_init(struct macb *bp);
 int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 void macb_set_rx_mode(struct net_device *dev);
+void macb_set_hwaddr(struct macb *bp);
+void macb_get_hwaddr(struct macb *bp);
 
 static inline bool macb_is_gem(struct macb *bp)
 {
-- 
1.8.0

^ permalink raw reply related

* [PATCH 1/8] net/macb: check all address registers sets
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352312097-31320-1-git-send-email-manabian@gmail.com>

The macb driver in u-boot uses the first register set while
the at91_ether driver in u-boot uses the second register set.

By checking all register set, like at91_ether does, this code
can be shared between the drivers.

This only changes behavior on macb if no vaild address
is found in the first register set.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 drivers/net/ethernet/cadence/macb.c | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 13c3c33..3b609be 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -114,23 +114,28 @@ static void __init macb_get_hwaddr(struct macb *bp)
 	u32 bottom;
 	u16 top;
 	u8 addr[6];
+	int i;
 
-	bottom = macb_or_gem_readl(bp, SA1B);
-	top = macb_or_gem_readl(bp, SA1T);
-
-	addr[0] = bottom & 0xff;
-	addr[1] = (bottom >> 8) & 0xff;
-	addr[2] = (bottom >> 16) & 0xff;
-	addr[3] = (bottom >> 24) & 0xff;
-	addr[4] = top & 0xff;
-	addr[5] = (top >> 8) & 0xff;
-
-	if (is_valid_ether_addr(addr)) {
-		memcpy(bp->dev->dev_addr, addr, sizeof(addr));
-	} else {
-		netdev_info(bp->dev, "invalid hw address, using random\n");
-		eth_hw_addr_random(bp->dev);
+	/* Check all 4 address register for vaild address */
+	for (i = 0; i < 4; i++) {
+		bottom = macb_or_gem_readl(bp, SA1B + i * 8);
+		top = macb_or_gem_readl(bp, SA1T + i * 8);
+
+		addr[0] = bottom & 0xff;
+		addr[1] = (bottom >> 8) & 0xff;
+		addr[2] = (bottom >> 16) & 0xff;
+		addr[3] = (bottom >> 24) & 0xff;
+		addr[4] = top & 0xff;
+		addr[5] = (top >> 8) & 0xff;
+
+		if (is_valid_ether_addr(addr)) {
+			memcpy(bp->dev->dev_addr, addr, sizeof(addr));
+			return;
+		}
 	}
+
+	netdev_info(bp->dev, "invalid hw address, using random\n");
+	eth_hw_addr_random(bp->dev);
 }
 
 static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
-- 
1.8.0

^ permalink raw reply related

* [PATCH 0/8] at91_ether share stats/address setting with macb
From: Joachim Eastwood @ 2012-11-07 18:14 UTC (permalink / raw)
  To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood

Patch 1-2 add support for some special at91_ether features to macb address setting code. This will allow us to have one address setting function that can be shared.

Patch 4 removes the at91_ether address set/get code and make use of the exported functions for macb.

Patch 5 remove the at91_ether statistics functions and replace them with equivalent function from macb.

Patch 6 removes an unused member from the at91_ether/macb private struct.

Patch 7 is a clean up of the print outs from at91_ether.

Patch 8 is a misc clean up patch which fixes some comment and style issues.


Most of the code left in at91_ether now deal with configuration and DMA rx/tx which is hard to share with macb since this is specific for the IP block in AT91RM9200.

Next I'll work on adding PHY GPIO interrupt to the macb driver. at91_ether had this functionality before it began using mdio functions from macb.


Joachim Eastwood (8):
  net/macb: check all address registers sets
  net/macb: support reversed hw addr
  net/macb: export macb_set_hwaddr and macb_get_hwaddr
  net/at91_ether: use macb functions for get/set hwaddr
  net/at91_ether: use stat function from macb
  net/at91_ether: drop board_data private struct member
  net/at91_ether: clean up print outs
  net/at91_ether: fix comment and style issues

 drivers/net/ethernet/cadence/at91_ether.c | 289 +++++++-----------------------
 drivers/net/ethernet/cadence/macb.c       |  54 ++++--
 drivers/net/ethernet/cadence/macb.h       |  10 +-
 3 files changed, 109 insertions(+), 244 deletions(-)

-- 
1.8.0

^ permalink raw reply

* mmap RX_RING socket issue 32b application running on 64b kernel.
From: Ronny Meeus @ 2012-11-07 17:58 UTC (permalink / raw)
  To: netdev

I have an application using raw Ethernet sockets in combination with
the mmaped RX_RING.
The application is running on a Cavium MIPS processor (64bit) and the
application code is compiled with the N32 ABI.

Since the ring buffer is shared between the Linux kernel and the
application there is a conflict in the way the data is presented.
Each buffer in the ring has a header that has following structure:
(File http://lxr.free-electrons.com/source/include/linux/if_packet.h )
103 struct tpacket_hdr {
104         unsigned long   tp_status;
105         unsigned int    tp_len;
106         unsigned int    tp_snaplen;
107         unsigned short  tp_mac;
108         unsigned short  tp_net;
109         unsigned int    tp_sec;
110         unsigned int    tp_usec;
111 };

The status field indicates that the buffer belongs to the kernel or to
the user. Note that an unsigned long is used to represent the field.
In the kernel the long is 64 bit while in application space the long
is only 32bit, so the bits do not match.

After adapting the code to take this into account my program works well.
In my test program I have defined a new struct where I change the
“unsigned long” into an “unsigned long long”:

struct tpacket_hdr_64 {
  unsigned long long tp_status;
  unsigned int tp_len;
  unsigned int tp_snaplen;
  unsigned short tp_mac;
  unsigned short tp_net;
  unsigned int tp_sec;
  unsigned int tp_usec;
};

In my opinion this is not a correct solution. It should be solved
somewhere in the include file I used so that it is transparent for the
application.
Please comment.

---
Ronny

^ permalink raw reply

* Re: [PATCH] tcp: Replace infinite loop on recvmsg bug with proper crashusers
From: Dave Jones @ 2012-11-07 17:15 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Julius Werner, linux-kernel, netdev, Patrick McHardy,
	Hideaki YOSHIFUJI, James Morris, Alexey Kuznetsov,
	David S. Miller, Sameer Nanda, Mandeep Singh Baines, Eric Dumazet
In-Reply-To: <1352307902.3140.4588.camel@edumazet-glaptop>

On Wed, Nov 07, 2012 at 09:05:02AM -0800, Eric Dumazet wrote:
 > On Wed, 2012-11-07 at 11:43 -0500, Dave Jones wrote:
 > 
 > > dude, look at the bug reports I just pointed you at.
 > > People _are_ aware there are bugs there.
 > > 
 > If I remember well, I helped to fix some of them.

indeed, and I commend you for it. I want to help you fix more ;)

 > >  > I understand a distro maintainer has its own choices, but for upstream
 > >  > kernel we want to have early reports.
 > > 
 > > I'm running out of ways to word this, but I'll try again.
 > > You won't get those early reports if you turn this into a BUG().
 > > 
 > >  > This bug is fatal and a security issue. BUG() is appropriate.
 > > 
 > > turning a bug into a remote DoS is also a security issue.
 > 
 > Apparently in some cases we can loop and fill the syslog, or
 > else Julius wouldnt have sent a patch.
 > 
 > So the proper fix is to emit this message only once, and to find
 > a way to alert the user security is compromised.
 > 
 > So if BUG() isnt good, just use WARN_ON_ONCE()
 > 
 > I feel that WARN_ON_ONCE() wont be clear enough to the user, especially
 > if we recover from this by closing the tcp session, exactly as if we
 > received a proper FIN.

Judging by the mangled traces we've seen, further reports after the initial
one aren't too useful anyway.  Automated detectors like abrt should be
able to pick up these traces from the logs on the next reboot.
(Which would probably be better than it trying to file them immediately over
 the network when the tcp layer is so confused)

sidenote: If the integrity of the tcp layer is in question, maybe some kind of
localised version of BUG() that just shuts down that subsystem might
be something worth persueing.

 > Really if you object a BUG() here, I cant understand you didnt shout to
 > other BUG() uses in the kernel.

When I see them, I call them. But I am just one person, and usage of that
macro is like a disease.

	Dave

^ permalink raw reply

* Re: [PATCH] tcp: Replace infinite loop on recvmsg bug with proper crashusers
From: Eric Dumazet @ 2012-11-07 17:05 UTC (permalink / raw)
  To: Dave Jones
  Cc: Julius Werner, linux-kernel, netdev, Patrick McHardy,
	Hideaki YOSHIFUJI, James Morris, Alexey Kuznetsov,
	David S. Miller, Sameer Nanda, Mandeep Singh Baines, Eric Dumazet
In-Reply-To: <20121107164358.GA20495@redhat.com>

On Wed, 2012-11-07 at 11:43 -0500, Dave Jones wrote:

> dude, look at the bug reports I just pointed you at.
> People _are_ aware there are bugs there.
> 

If I remember well, I helped to fix some of them.

> If you turn that into a BUG() those reports would never have been filed.
> How is that increasing awareness ?  People are going to see wedged computers,
> and hit the reset button. If we're lucky, we'll get photos of someone lucky
> enough to have hit it while at the console, not in X. But this is a huge
> step backwards for debugability.
> 
>  > I understand a distro maintainer has its own choices, but for upstream
>  > kernel we want to have early reports.
> 
> I'm running out of ways to word this, but I'll try again.
> You won't get those early reports if you turn this into a BUG().
> 
>  > This bug is fatal and a security issue. BUG() is appropriate.
> 
> turning a bug into a remote DoS is also a security issue.
> 

Apparently in some cases we can loop and fill the syslog, or
else Julius wouldnt have sent a patch.

So the proper fix is to emit this message only once, and to find
a way to alert the user security is compromised.

So if BUG() isnt good, just use WARN_ON_ONCE()

I feel that WARN_ON_ONCE() wont be clear enough to the user, especially
if we recover from this by closing the tcp session, exactly as if we
received a proper FIN.

Really if you object a BUG() here, I cant understand you didnt shout to
other BUG() uses in the kernel.

^ permalink raw reply

* Re: [PATCH] tcp: Replace infinite loop on recvmsg bug with proper crashusers
From: Dave Jones @ 2012-11-07 16:43 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Julius Werner, linux-kernel, netdev, Patrick McHardy,
	Hideaki YOSHIFUJI, James Morris, Alexey Kuznetsov,
	David S. Miller, Sameer Nanda, Mandeep Singh Baines, Eric Dumazet
In-Reply-To: <1352305752.3140.4449.camel@edumazet-glaptop>

On Wed, Nov 07, 2012 at 08:29:12AM -0800, Eric Dumazet wrote:
 > On Wed, 2012-11-07 at 10:54 -0500, Dave Jones wrote:
 > 
 > > It sounds more appropriate to me, instead of silently wedging the box.
 > > At least with that approach we have a chance of finding out what happened.
 > 
 > Its quite the opposite.
 > 
 > If bug is still there 6 months after the commits that broke the drivers,
 > (making an old bug visible) that means that people never realized the
 > bug was there.

dude, look at the bug reports I just pointed you at.
People _are_ aware there are bugs there.

If you turn that into a BUG() those reports would never have been filed.
How is that increasing awareness ?  People are going to see wedged computers,
and hit the reset button. If we're lucky, we'll get photos of someone lucky
enough to have hit it while at the console, not in X. But this is a huge
step backwards for debugability.

 > I understand a distro maintainer has its own choices, but for upstream
 > kernel we want to have early reports.

I'm running out of ways to word this, but I'll try again.
You won't get those early reports if you turn this into a BUG().

 > This bug is fatal and a security issue. BUG() is appropriate.

turning a bug into a remote DoS is also a security issue.

	Dave

^ permalink raw reply

* Re: [PATCH] tcp: Replace infinite loop on recvmsg bug with proper crashusers
From: Eric Dumazet @ 2012-11-07 16:29 UTC (permalink / raw)
  To: Dave Jones
  Cc: Julius Werner, linux-kernel, netdev, Patrick McHardy,
	Hideaki YOSHIFUJI, James Morris, Alexey Kuznetsov,
	David S. Miller, Sameer Nanda, Mandeep Singh Baines, Eric Dumazet
In-Reply-To: <20121107155434.GA17677@redhat.com>

On Wed, 2012-11-07 at 10:54 -0500, Dave Jones wrote:

> It sounds more appropriate to me, instead of silently wedging the box.
> At least with that approach we have a chance of finding out what happened.

Its quite the opposite.

If bug is still there 6 months after the commits that broke the drivers,
(making an old bug visible) that means that people never realized the
bug was there.

I understand a distro maintainer has its own choices, but for upstream
kernel we want to have early reports.

This bug is fatal and a security issue. BUG() is appropriate.

If the driver cant be fixed, it should be marked broken.

So I personally NACKed patch to hide the bug, trying to be friendly to
the user.

^ permalink raw reply

* [PATCH net-next] phylib: mdio: Add sysfs attribute for PHY identifiers.
From: Nick Bowler @ 2012-11-07 16:20 UTC (permalink / raw)
  To: netdev

This adds a phy_id sysfs attribute to MDIO devices, containing the
32-bit PHY identifier reported by the device.  This attribute can
be useful when debugging problems related to phy drivers.  Other
enumerable buses already have similar attributes.

Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
---
 Documentation/ABI/testing/sysfs-bus-mdio |    9 +++++++++
 drivers/net/phy/mdio_bus.c               |   14 ++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-mdio

diff --git a/Documentation/ABI/testing/sysfs-bus-mdio b/Documentation/ABI/testing/sysfs-bus-mdio
new file mode 100644
index 000000000000..6349749ebc29
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-mdio
@@ -0,0 +1,9 @@
+What:		/sys/bus/mdio_bus/devices/.../phy_id
+Date:		November 2012
+KernelVersion:	3.8
+Contact:	netdev@vger.kernel.org
+Description:
+		This attribute contains the 32-bit PHY Identifier as reported
+		by the device during bus enumeration, encoded in hexadecimal.
+		This ID is used to match the device with the appropriate
+		driver.
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index c1ef3000ea60..044b5326459f 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -431,10 +431,24 @@ static struct dev_pm_ops mdio_bus_pm_ops = {
 
 #endif /* CONFIG_PM */
 
+static ssize_t
+phy_id_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct phy_device *phydev = to_phy_device(dev);
+
+	return sprintf(buf, "0x%.8lx\n", (unsigned long)phydev->phy_id);
+}
+
+static struct device_attribute mdio_dev_attrs[] = {
+	__ATTR_RO(phy_id),
+	__ATTR_NULL
+};
+
 struct bus_type mdio_bus_type = {
 	.name		= "mdio_bus",
 	.match		= mdio_bus_match,
 	.pm		= MDIO_BUS_PM_OPS,
+	.dev_attrs	= mdio_dev_attrs,
 };
 EXPORT_SYMBOL(mdio_bus_type);
 
-- 
1.7.8.6

^ permalink raw reply related

* Re: [PATCH net-next] mlx4: change TX coalescing defaults
From: Eric Dumazet @ 2012-11-07 16:05 UTC (permalink / raw)
  To: Amir Vadai; +Cc: David Miller, netdev, Yevgeny Petrilin, Or Gerlitz, Vimalkumar
In-Reply-To: <CAPcc5Pj0ffeb8O8YW3SAS21=+ub8ypc34=YaAxTB-qh9DGeawQ@mail.gmail.com>

On Wed, 2012-11-07 at 17:30 +0200, Amir Vadai wrote:
> Acked.
> 
> BTW, a mail will be sent - I'm replacing Yevgeny Petrilin as mlx4_en maintainer.
> 

OK, thanks.

BTW proper way to Ack a patch so that its automatically taken into
account by tools is to use :

Acked-by: Amir Vadai <amirv@mellanox.com>

^ permalink raw reply

* Re: [PATCH] tcp: Replace infinite loop on recvmsg bug with proper crash
From: Dave Jones @ 2012-11-07 15:54 UTC (permalink / raw)
  To: Julius Werner
  Cc: linux-kernel, netdev, Patrick McHardy, Hideaki YOSHIFUJI,
	James Morris, Alexey Kuznetsov, David S. Miller, Sameer Nanda,
	Mandeep Singh Baines, Eric Dumazet
In-Reply-To: <CAODwPW-636Sn3B4CYajvrgccXxresZwPLg2UFz6xDDk9-FfTYQ@mail.gmail.com>

On Tue, Nov 06, 2012 at 05:51:19PM -0800, Julius Werner wrote:
 > > We've had reports of this WARN against the Fedora kernel for a while.
 > > Had this been immediately followed by a BUG(), we'd have never seen those traces at all,
 > > and just got "my machine just locked up" reports instead.
 > >
 > > The proper fix here is to find out why we're getting into this state.
 > 
 > Are you sure you don't mean the WARN below that ("recvmsg bug 2")
 > instead? I don't think this one can happen without eventually running
 > into the syslog overflow issue I described.

bug2 is more common (And usually is accompanied by mangled traces),
but we have reports of the first WARN too..

https://bugzilla.redhat.com/show_bug.cgi?id=841769
https://bugzilla.redhat.com/show_bug.cgi?id=845853
https://bugzilla.redhat.com/show_bug.cgi?id=846991
https://bugzilla.redhat.com/show_bug.cgi?id=860039

(I note that none of these reports mention "also, my hard disk is now full")

 > I agree that the underlying cause must be fixed too, but as we will
 > always have bugs in the kernel I think proper handling when it does
 > happen is also important (and filling the hard disk with junk is
 > obviously not the best approach). If you think a full panic is too
 > extreme, I have an alternative version of this patch that logs the
 > WARN once, closes the socket, and returns EBADFD from the syscall...
 > would you think that is more appropriate?

It sounds more appropriate to me, instead of silently wedging the box.
At least with that approach we have a chance of finding out what happened.

	Dave

^ permalink raw reply

* Re: [PATCH V4 0/7] ARM: AM33XX: net: Add DT support to CPGMAC and MDIO driver
From: Benoit Cousson @ 2012-11-07 15:45 UTC (permalink / raw)
  To: Mugunthan V N
  Cc: davem, Paul Walmsley, netdev, devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel, linux-omap
In-Reply-To: <509A7D39.8050506@ti.com>

Hi Mugunthan,

On 11/07/2012 04:24 PM, Mugunthan V N wrote:
> On 11/6/2012 11:02 PM, Mugunthan V N wrote:
>> This patch-series adds support for,
>>
>> [1/7]: Typo mistake in CPSW driver while invoking runtime_pm api's
>>
>> [2/7]: Adds parent<->child relation between CPSW & MDIO module inside
>> cpsw
>>         driver, as in case of AM33XX, the resources are shared and common
>>         register bit-field is provided to control module/clock
>> enable/disable,
>>         makes it difficult to handle common resource.
>>
>>         So the solution here is, to create parent<->child relation
>> between them.
>>
>> [3/7]: Add hwmod entry for MDIO module, required for MDIO driver.
>>
>> [4/7]: cpsw: simplify the setup of the register pointers
>>
>> [5/7]: Add DT device nodes for both CPSW and MDIO modules in am33xx.dtsi,
>>         am335x-evm.dts and am335x-bone.dts file
>>
>> [6/7]: Enable CPSW support to omap2plus_defconfig
>>
>> [7/7]: cpsw: Kernel warn fix during suspend
>>
>> This patch series has been created on top of net-next/master and tested
>> on BeagleBone platform for NFS boot and basic ping test cases.
>>
>> Changes from V3:
>> * Removed unnecessary flags in Davinci MDIO Hwmod entry.
>>
>> Mugunthan V N (4):
>>    ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module
>>    arm/dts: am33xx: Add CPSW and MDIO module nodes for AM33XX
>>    ARM: OMAP2+: omap2plus_defconfig: Enable CPSW support
>>    net: cpsw: halt network stack before halting the device during
>>      suspend
>>
>> Richard Cochran (1):
>>    cpsw: simplify the setup of the register pointers
>>
>> Vaibhav Hiremath (2):
>>    net: davinci_mdio: Fix typo mistake in calling runtime-pm api
>>    net: cpsw: Add parent<->child relation support between cpsw and mdio
>>
>>   Documentation/devicetree/bindings/net/cpsw.txt |   34 ----
>>   arch/arm/boot/dts/am335x-bone.dts              |    8 +
>>   arch/arm/boot/dts/am335x-evm.dts               |    8 +
>>   arch/arm/boot/dts/am33xx.dtsi                  |   42 +++++
>>   arch/arm/configs/omap2plus_defconfig           |    3 +
>>   arch/arm/mach-omap2/omap_hwmod_33xx_data.c     |   31 ++++
>>   drivers/net/ethernet/ti/cpsw.c                 |  231
>> ++++++++++--------------
>>   drivers/net/ethernet/ti/davinci_mdio.c         |    2 +-
>>   include/linux/platform_data/cpsw.h             |   19 --
>>   9 files changed, 192 insertions(+), 186 deletions(-)
>>
> Paul/Benoit
> 
> Do you any comments

The DTS looks better thanks to Richard cleanup.
But you did not take into account the minor cosmetic comments I did last
time.

Could you just clean the DTS based on last time comments and change the
subject to be compliant with the other ones and I will take it in my
for_3.8/dts_part2 branch.

Thanks,
Benoit


^ permalink raw reply

* Re: [PATCH net-next] mlx4: change TX coalescing defaults
From: Amir Vadai @ 2012-11-07 15:30 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Miller, netdev, Yevgeny Petrilin, Or Gerlitz, Vimalkumar
In-Reply-To: <1352168442.3140.32.camel@edumazet-glaptop>

Acked.

BTW, a mail will be sent - I'm replacing Yevgeny Petrilin as mlx4_en maintainer.

(sorry for the previous non plain text mail)

Amir

On Tue, Nov 6, 2012 at 4:20 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> From: Eric Dumazet <edumazet@google.com>
>
> mlx4 currently uses a too high tx coalescing setting, deferring
> TX completion interrupts by up to 128 us.
>
> With the recent skb_orphan() removal in commit 8112ec3b872,
> performance of a single TCP flow is capped to ~4 Gbps, unless
> we increase tcp_limit_output_bytes.
>
> I suggest using 16 us instead of 128 us, allowing a finer control.
>
> Performance of a single TCP flow is restored to previous levels,
> while keeping TCP small queues fully enabled with default sysctl.
>
> This patch is also a BQL prereq.
>
> Reported-by: Vimalkumar <j.vimal@gmail.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Yevgeny Petrilin <yevgenyp@mellanox.com>
> Cc: Or Gerlitz <ogerlitz@mellanox.com>
> ---
> By the way, is BQL addition planned for this driver ?
>
>  drivers/net/ethernet/mellanox/mlx4/en_netdev.c |    2 +-
>  drivers/net/ethernet/mellanox/mlx4/mlx4_en.h   |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index edd9cb8..2b23ca2 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -870,7 +870,7 @@ static void mlx4_en_set_default_moderation(struct
> mlx4_en_priv *priv)
>         /* If we haven't received a specific coalescing setting
>          * (module param), we set the moderation parameters as follows:
>          * - moder_cnt is set to the number of mtu sized packets to
> -        *   satisfy our coelsing target.
> +        *   satisfy our coalescing target.
>          * - moder_time is set to a fixed value.
>          */
>         priv->rx_frames = MLX4_EN_RX_COAL_TARGET;
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> index 9d27e42..8a5e70d 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> @@ -126,7 +126,7 @@ enum {
>  #define MLX4_EN_RX_COAL_TIME   0x10
>
>  #define MLX4_EN_TX_COAL_PKTS   16
> -#define MLX4_EN_TX_COAL_TIME   0x80
> +#define MLX4_EN_TX_COAL_TIME   0x10
>
>  #define MLX4_EN_RX_RATE_LOW            400000
>  #define MLX4_EN_RX_COAL_TIME_LOW       0
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH V4 0/7] ARM: AM33XX: net: Add DT support to CPGMAC and MDIO driver
From: Mugunthan V N @ 2012-11-07 15:24 UTC (permalink / raw)
  To: b-cousson, davem, Paul Walmsley
  Cc: netdev, devicetree-discuss@lists.ozlabs.org, linux-arm-kernel,
	linux-omap
In-Reply-To: <1352223159-27504-1-git-send-email-mugunthanvnm@ti.com>

On 11/6/2012 11:02 PM, Mugunthan V N wrote:
> This patch-series adds support for,
>
> [1/7]: Typo mistake in CPSW driver while invoking runtime_pm api's
>
> [2/7]: Adds parent<->child relation between CPSW & MDIO module inside cpsw
>         driver, as in case of AM33XX, the resources are shared and common
>         register bit-field is provided to control module/clock enable/disable,
>         makes it difficult to handle common resource.
>
>         So the solution here is, to create parent<->child relation between them.
>
> [3/7]: Add hwmod entry for MDIO module, required for MDIO driver.
>
> [4/7]: cpsw: simplify the setup of the register pointers
>
> [5/7]: Add DT device nodes for both CPSW and MDIO modules in am33xx.dtsi,
>         am335x-evm.dts and am335x-bone.dts file
>
> [6/7]: Enable CPSW support to omap2plus_defconfig
>
> [7/7]: cpsw: Kernel warn fix during suspend
>
> This patch series has been created on top of net-next/master and tested
> on BeagleBone platform for NFS boot and basic ping test cases.
>
> Changes from V3:
> * Removed unnecessary flags in Davinci MDIO Hwmod entry.
>
> Mugunthan V N (4):
>    ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module
>    arm/dts: am33xx: Add CPSW and MDIO module nodes for AM33XX
>    ARM: OMAP2+: omap2plus_defconfig: Enable CPSW support
>    net: cpsw: halt network stack before halting the device during
>      suspend
>
> Richard Cochran (1):
>    cpsw: simplify the setup of the register pointers
>
> Vaibhav Hiremath (2):
>    net: davinci_mdio: Fix typo mistake in calling runtime-pm api
>    net: cpsw: Add parent<->child relation support between cpsw and mdio
>
>   Documentation/devicetree/bindings/net/cpsw.txt |   34 ----
>   arch/arm/boot/dts/am335x-bone.dts              |    8 +
>   arch/arm/boot/dts/am335x-evm.dts               |    8 +
>   arch/arm/boot/dts/am33xx.dtsi                  |   42 +++++
>   arch/arm/configs/omap2plus_defconfig           |    3 +
>   arch/arm/mach-omap2/omap_hwmod_33xx_data.c     |   31 ++++
>   drivers/net/ethernet/ti/cpsw.c                 |  231 ++++++++++--------------
>   drivers/net/ethernet/ti/davinci_mdio.c         |    2 +-
>   include/linux/platform_data/cpsw.h             |   19 --
>   9 files changed, 192 insertions(+), 186 deletions(-)
>
Paul/Benoit

Do you any comments

Regards
Mugunthan V N

^ permalink raw reply

* Re: [PATCH 1/1] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES
From: Alan Cox @ 2012-11-07 15:04 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, davem, Karsten Keil, netdev
In-Reply-To: <1352282103-13665-1-git-send-email-lee.jones@linaro.org>

On Wed,  7 Nov 2012 10:55:03 +0100
Lee Jones <lee.jones@linaro.org> wrote:

> It doesn't make much sense to enable ISDN services if you don't
> intend to connect to a network. 

I would disagree. However what I don't understand and you've not
explained is why the current code is a bug or a problem ?

This seems to be a make-work inconvenience causing patch that serves no
useful purpose ?

Alan

^ permalink raw reply

* [PATCH trivial] ndisc: fix a typo in a comment in ndisc_recv_na()
From: Nicolas Dichtel @ 2012-11-07 15:05 UTC (permalink / raw)
  To: netdev; +Cc: davem, Nicolas Dichtel

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/ndisc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index ae0cf81..a2e50dc 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -906,7 +906,7 @@ static void ndisc_recv_na(struct sk_buff *skb)
 		if (lladdr && !memcmp(lladdr, dev->dev_addr, dev->addr_len) &&
 		    net->ipv6.devconf_all->forwarding && net->ipv6.devconf_all->proxy_ndp &&
 		    pneigh_lookup(&nd_tbl, net, &msg->target, dev, 0)) {
-			/* XXX: idev->cnf.prixy_ndp */
+			/* XXX: idev->cnf.proxy_ndp */
 			goto out;
 		}
 
-- 
1.7.12

^ permalink raw reply related

* [PATCH net] cxgb4: Fix initialization of SGE_CONTROL register
From: Vipul Pandya @ 2012-11-07 13:45 UTC (permalink / raw)
  To: netdev; +Cc: davem, divy, dm, Vipul Pandya, Jay Hernandez

INGPADBOUNDARY_MASK is already shifted. No need to shift it again. On reloading
a driver it was resulting in a bad SGE FL MTU sizes [1536, 9088] error. This
only causes an issue on systems that have L1 cache size of 32B, 128B, 512B,
2048B or 4096B.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 01fa5b7..730ae2c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -2831,7 +2831,7 @@ int t4_fixup_host_params(struct adapter *adap, unsigned int page_size,
 		     HOSTPAGESIZEPF7(sge_hps));
 
 	t4_set_reg_field(adap, SGE_CONTROL,
-			 INGPADBOUNDARY(INGPADBOUNDARY_MASK) |
+			 INGPADBOUNDARY_MASK |
 			 EGRSTATUSPAGESIZE_MASK,
 			 INGPADBOUNDARY(fl_align_log - 5) |
 			 EGRSTATUSPAGESIZE(stat_len != 64));
-- 
1.7.1

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox