Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH -next] vhost-blk: remove unused variable
From: Michael S. Tsirkin @ 2013-03-11 14:44 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: yongjun_wei, kvm, virtualization, netdev
In-Reply-To: <CAPgLHd-eRBB2xCP7-ZswjfEKXPY29G1Nv71DzGo_-=TVym8MNQ@mail.gmail.com>

On Mon, Mar 11, 2013 at 10:39:27PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> The variable vq is initialized but never used
> otherwise, so remove the unused variable.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Which branch does this target?

> ---
>  drivers/vhost/blk.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/vhost/blk.c b/drivers/vhost/blk.c
> index 658c5f9..d9b245b 100644
> --- a/drivers/vhost/blk.c
> +++ b/drivers/vhost/blk.c
> @@ -419,8 +419,6 @@ static void vhost_blk_handle_guest_kick(struct vhost_work *work)
>  /* Host kick us for I/O completion */
>  static void vhost_blk_handle_host_kick(struct vhost_work *work)
>  {
> -
> -	struct vhost_virtqueue *vq;
>  	struct vhost_blk_req *req;
>  	struct llist_node *llnode;
>  	struct vhost_blk *blk;
> @@ -429,7 +427,6 @@ static void vhost_blk_handle_host_kick(struct vhost_work *work)
>  	int ret;
>  
>  	blk = container_of(work, struct vhost_blk, work);
> -	vq = &blk->vq;
>  
>  	llnode = llist_del_all(&blk->llhead);
>  	added = false;

^ permalink raw reply

* RE: [PATCH] bnx2x: update fw to 7.8.17
From: Dmitry Kravkov @ 2013-03-11 14:43 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: netdev@vger.kernel.org, Ariel Elior, Eilon Greenstein,
	David Woodhouse
In-Reply-To: <1362845900.3768.496.camel@deadeye.wl.decadent.org.uk>

Hi Ben,

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Ben Hutchings
> Sent: Saturday, March 09, 2013 6:18 PM
> To: Dmitry Kravkov
> Cc: netdev@vger.kernel.org; Ariel Elior; Eilon Greenstein; David Woodhouse
> Subject: Re: [PATCH] bnx2x: update fw to 7.8.17
> 
> On Wed, 2013-02-27 at 21:24 +0200, Dmitry Kravkov wrote:
> > This new firmware includes the following changes:
> >
> > 1. Several corner case bugs in iSCSI code.
> > 2. Fixes for FCoE including support for 3PAR targets.
> > 3. Fixes for SR-IOV behaviour including:
> > 	a. Remove FW assert erroneously triggered during FLR.
> > 	b. Several fixes in FLR flow.
> > 	c. Prevent VF crash when packet bigger than MTU arrives.
> > 	d. Improve security against malicious VF.
> > 4. Added CSUM and TSO support for encapsulation protocols.
> > 5. Added RSS capability for GRE traffic based on inner headers.
> > 6. Added FCoE support for 4-port 57840 devices.
> >
> > Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> > Signed-off-by: Ariel Elior <ariele@broadcom.com>
> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> > ---
> > Please consider adding to linux-firmware tree.
> [...]
> 
> Applied, thanks.
> 
I'm looking for the FW at
git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
but the latest commit there is:
commit c11f374afdd2a3ff0665c1cb0aab4ad0c6573ec7
    cx231xx/cx23885: Remove incorrect Conexant CX23885 firmware 

Am I looking at the right location?

Thanks
Dmitry
> --
> Ben Hutchings
> Always try to do things in chronological order;
> it's less confusing that way.

^ permalink raw reply

* [PATCH -next] bnx2x: use list_move instead of list_del/list_add
From: Wei Yongjun @ 2013-03-11 14:40 UTC (permalink / raw)
  To: eilong; +Cc: yongjun_wei, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Using list_move() instead of list_del() + list_add().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 71fcef0..c32a066 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -556,8 +556,7 @@ static int bnx2x_vfop_config_list(struct bnx2x *bp,
 		rc = bnx2x_config_vlan_mac(bp, vlan_mac);
 		if (rc >= 0) {
 			cnt += pos->add ? 1 : -1;
-			list_del(&pos->link);
-			list_add(&pos->link, &rollback_list);
+			list_move(&pos->link, &rollback_list);
 			rc = 0;
 		} else if (rc == -EEXIST) {
 			rc = 0;

^ permalink raw reply related

* [PATCH -next] vhost-blk: remove unused variable
From: Wei Yongjun @ 2013-03-11 14:39 UTC (permalink / raw)
  To: mst; +Cc: yongjun_wei, kvm, virtualization, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

The variable vq is initialized but never used
otherwise, so remove the unused variable.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/vhost/blk.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/vhost/blk.c b/drivers/vhost/blk.c
index 658c5f9..d9b245b 100644
--- a/drivers/vhost/blk.c
+++ b/drivers/vhost/blk.c
@@ -419,8 +419,6 @@ static void vhost_blk_handle_guest_kick(struct vhost_work *work)
 /* Host kick us for I/O completion */
 static void vhost_blk_handle_host_kick(struct vhost_work *work)
 {
-
-	struct vhost_virtqueue *vq;
 	struct vhost_blk_req *req;
 	struct llist_node *llnode;
 	struct vhost_blk *blk;
@@ -429,7 +427,6 @@ static void vhost_blk_handle_host_kick(struct vhost_work *work)
 	int ret;
 
 	blk = container_of(work, struct vhost_blk, work);
-	vq = &blk->vq;
 
 	llnode = llist_del_all(&blk->llhead);
 	added = false;

^ permalink raw reply related

* [PATCH -next] qlcnic: remove duplicated include from qlcnic_sysfs.c
From: Wei Yongjun @ 2013-03-11 14:29 UTC (permalink / raw)
  To: jitendra.kalsaria, sony.chacko; +Cc: yongjun_wei, linux-driver, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
index 987fb6f..4e464dc 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
@@ -21,8 +21,6 @@
 #include <linux/aer.h>
 #include <linux/log2.h>
 
-#include <linux/sysfs.h>
-
 #define QLC_STATUS_UNSUPPORTED_CMD	-2
 
 int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable)

^ permalink raw reply related

* Re: [PATCH] sctp: don't break the loop while meeting the active_path so as to find the matched transport
From: Neil Horman @ 2013-03-11 13:31 UTC (permalink / raw)
  To: Xufeng Zhang
  Cc: Xufeng Zhang, vyasevich, davem, linux-sctp, netdev, linux-kernel
In-Reply-To: <CA+=dFzjyd4av9D1TmrvguRXv-V7JnGWYJcN=ZEDu8Qhz2s+U7Q@mail.gmail.com>

On Mon, Mar 11, 2013 at 10:14:50AM +0800, Xufeng Zhang wrote:
> On 3/8/13, Neil Horman <nhorman@tuxdriver.com> wrote:
> > On Fri, Mar 08, 2013 at 03:39:37PM +0800, Xufeng Zhang wrote:
> >> sctp_assoc_lookup_tsn() function searchs which transport a certain TSN
> >> was sent on, if not found in the active_path transport, then go search
> >> all the other transports in the peer's transport_addr_list, however, we
> >> should continue to the next entry rather than break the loop when meet
> >> the active_path transport.
> >>
> >> Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
> >> ---
> >>  net/sctp/associola.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/net/sctp/associola.c b/net/sctp/associola.c
> >> index 43cd0dd..d2709e2 100644
> >> --- a/net/sctp/associola.c
> >> +++ b/net/sctp/associola.c
> >> @@ -1079,7 +1079,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct
> >> sctp_association *asoc,
> >>  			transports) {
> >>
> >>  		if (transport == active)
> >> -			break;
> >> +			continue;
> >>  		list_for_each_entry(chunk, &transport->transmitted,
> >>  				transmitted_list) {
> >>  			if (key == chunk->subh.data_hdr->tsn) {
> >> --
> >> 1.7.0.2
> >>
> >>
> >
> > This works, but what might be better would be if we did a move to front
> > heuristic in sctp_assoc_set_primary.  E.g. when we set the active_path, move
> > the
> > requisite transport to the front of the transport_addr_list.  If we did
> > that,
> > then we could just do one for loop in sctp_assoc_lookup_tsn and wind up
> > implicitly check the active path first without having to check it seprately
> > and
> > skip it in the second for loop.
> 
> Thanks for your review, Neil!
> 
> I know what you mean, yes, it's most probably that the searched TSN was
> transmitted in the currently active_path, but what should we do if not.
> 
> Check the comment in sctp_assoc_lookup_tsn() function:
> /* Let's be hopeful and check the active_path first. */
> /* If not found, go search all the other transports. */
> 
> It has checked the active_path first and then traverse all the other
> transports in
> the transport_addr_list except the active_path.
> 
> So what I want to fix here is the inconsistency between the function
> should do and
> the code actually does.
> 
I understand what you're doing, and I agree that the fix is functional (Hence
my "This works" statement in my last note).  What I'm suggesting is that, since
you're messing about in that code anyway that you clean it up while your at it,
so that we don't need to have the if (transport == active) check at all.  We
trade in some extra work in a non-critical path (sctp_assoc_set_primary), for
the removal of an extra for loop operation and a conditional check in a much
hotter path.  Something like this (completely untested), is what I was thinking


diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 43cd0dd..8ae873c 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -505,6 +505,9 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
 
 	asoc->peer.primary_path = transport;
 
+	list_del_rcu(&transport->transports);
+	list_add_rcu(&transport->transports, &asoc->peer.transport_addr_list);
+
 	/* Set a default msg_name for events. */
 	memcpy(&asoc->peer.primary_addr, &transport->ipaddr,
 	       sizeof(union sctp_addr));
@@ -1040,7 +1043,6 @@ struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc)
 struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc,
 					     __u32 tsn)
 {
-	struct sctp_transport *active;
 	struct sctp_transport *match;
 	struct sctp_transport *transport;
 	struct sctp_chunk *chunk;
@@ -1057,29 +1059,16 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc,
 	 * The general strategy is to search each transport's transmitted
 	 * list.   Return which transport this TSN lives on.
 	 *
-	 * Let's be hopeful and check the active_path first.
-	 * Another optimization would be to know if there is only one
-	 * outbound path and not have to look for the TSN at all.
+	 * Note, that sctp_assoc_set_primary does a move to front operation
+	 * on the active_path transport, so this code implicitly checks
+	 * the active_path first, as we most commonly expect to find our TSN
+	 * there.
 	 *
 	 */
 
-	active = asoc->peer.active_path;
-
-	list_for_each_entry(chunk, &active->transmitted,
-			transmitted_list) {
-
-		if (key == chunk->subh.data_hdr->tsn) {
-			match = active;
-			goto out;
-		}
-	}
-
-	/* If not found, go search all the other transports. */
 	list_for_each_entry(transport, &asoc->peer.transport_addr_list,
 			transports) {
 
-		if (transport == active)
-			break;
 		list_for_each_entry(chunk, &transport->transmitted,
 				transmitted_list) {
 			if (key == chunk->subh.data_hdr->tsn) {

^ permalink raw reply related

* [PATCHv2] caif: remove caif_shm
From: Erwan Yvin @ 2013-03-11 13:13 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Linus Walleij, Sjur Brendeland, Erwan Yvin

caif_shm is an old implementation
caif_shm will be replaced by caif_virtio

Signed-off-by: Erwan Yvin <erwan.yvin@stericsson.com>
Acked-by: Sjur Brendeland <sjur.brandeland@stericsson.com>
---
 drivers/net/caif/Kconfig          |    7 -
 drivers/net/caif/Makefile         |    4 -
 drivers/net/caif/caif_shm_u5500.c |  128 -------
 drivers/net/caif/caif_shmcore.c   |  744 -------------------------------------
 include/net/caif/caif_shm.h       |   26 --
 5 files changed, 909 deletions(-)
 delete mode 100644 drivers/net/caif/caif_shm_u5500.c
 delete mode 100644 drivers/net/caif/caif_shmcore.c
 delete mode 100644 include/net/caif/caif_shm.h

 rebase of the 1st version

diff --git a/drivers/net/caif/Kconfig b/drivers/net/caif/Kconfig
index 60c2142..a966128 100644
--- a/drivers/net/caif/Kconfig
+++ b/drivers/net/caif/Kconfig
@@ -32,13 +32,6 @@ config CAIF_SPI_SYNC
 	help to synchronize to the next transfer in case of over or under-runs.
 	This option also needs to be enabled on the modem.
 
-config CAIF_SHM
-	tristate "CAIF shared memory protocol driver"
-	depends on CAIF && U5500_MBOX
-	default n
-	---help---
-	The CAIF shared memory protocol driver for the STE UX5500 platform.
-
 config CAIF_HSI
        tristate "CAIF HSI transport driver"
        depends on CAIF
diff --git a/drivers/net/caif/Makefile b/drivers/net/caif/Makefile
index 91dff86..15a9d2f 100644
--- a/drivers/net/caif/Makefile
+++ b/drivers/net/caif/Makefile
@@ -7,9 +7,5 @@ obj-$(CONFIG_CAIF_TTY) += caif_serial.o
 cfspi_slave-objs := caif_spi.o caif_spi_slave.o
 obj-$(CONFIG_CAIF_SPI_SLAVE) += cfspi_slave.o
 
-# Shared memory
-caif_shm-objs := caif_shmcore.o caif_shm_u5500.o
-obj-$(CONFIG_CAIF_SHM) += caif_shm.o
-
 # HSI interface
 obj-$(CONFIG_CAIF_HSI) += caif_hsi.o
diff --git a/drivers/net/caif/caif_shm_u5500.c b/drivers/net/caif/caif_shm_u5500.c
deleted file mode 100644
index 89d76b7..0000000
--- a/drivers/net/caif/caif_shm_u5500.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) ST-Ericsson AB 2010
- * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
- * Author:  Amarnath Revanna / amarnath.bangalore.revanna@stericsson.com
- * License terms: GNU General Public License (GPL) version 2
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ":" fmt
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/netdevice.h>
-#include <mach/mbox-db5500.h>
-#include <net/caif/caif_shm.h>
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("CAIF Shared Memory protocol driver");
-
-#define MAX_SHM_INSTANCES	1
-
-enum {
-	MBX_ACC0,
-	MBX_ACC1,
-	MBX_DSP
-};
-
-static struct shmdev_layer shmdev_lyr[MAX_SHM_INSTANCES];
-
-static unsigned int shm_start;
-static unsigned int shm_size;
-
-module_param(shm_size, uint  , 0440);
-MODULE_PARM_DESC(shm_total_size, "Start of SHM shared memory");
-
-module_param(shm_start, uint  , 0440);
-MODULE_PARM_DESC(shm_total_start, "Total Size of SHM shared memory");
-
-static int shmdev_send_msg(u32 dev_id, u32 mbx_msg)
-{
-	/* Always block until msg is written successfully */
-	mbox_send(shmdev_lyr[dev_id].hmbx, mbx_msg, true);
-	return 0;
-}
-
-static int shmdev_mbx_setup(void *pshmdrv_cb, struct shmdev_layer *pshm_dev,
-							 void *pshm_drv)
-{
-	/*
-	 * For UX5500, we have only 1 SHM instance which uses MBX0
-	 * for communication with the peer modem
-	 */
-	pshm_dev->hmbx = mbox_setup(MBX_ACC0, pshmdrv_cb, pshm_drv);
-
-	if (!pshm_dev->hmbx)
-		return -ENODEV;
-	else
-		return 0;
-}
-
-static int __init caif_shmdev_init(void)
-{
-	int i, result;
-
-	/* Loop is currently overkill, there is only one instance */
-	for (i = 0; i < MAX_SHM_INSTANCES; i++) {
-
-		shmdev_lyr[i].shm_base_addr = shm_start;
-		shmdev_lyr[i].shm_total_sz = shm_size;
-
-		if (((char *)shmdev_lyr[i].shm_base_addr == NULL)
-			       || (shmdev_lyr[i].shm_total_sz <= 0))	{
-			pr_warn("ERROR,"
-				"Shared memory Address and/or Size incorrect"
-				", Bailing out ...\n");
-			result = -EINVAL;
-			goto clean;
-		}
-
-		pr_info("SHM AREA (instance %d) STARTS"
-			" AT %p\n", i, (char *)shmdev_lyr[i].shm_base_addr);
-
-		shmdev_lyr[i].shm_id = i;
-		shmdev_lyr[i].pshmdev_mbxsend = shmdev_send_msg;
-		shmdev_lyr[i].pshmdev_mbxsetup = shmdev_mbx_setup;
-
-		/*
-		 * Finally, CAIF core module is called with details in place:
-		 * 1. SHM base address
-		 * 2. SHM size
-		 * 3. MBX handle
-		 */
-		result = caif_shmcore_probe(&shmdev_lyr[i]);
-		if (result) {
-			pr_warn("ERROR[%d],"
-				"Could not probe SHM core (instance %d)"
-				" Bailing out ...\n", result, i);
-			goto clean;
-		}
-	}
-
-	return 0;
-
-clean:
-	/*
-	 * For now, we assume that even if one instance of SHM fails, we bail
-	 * out of the driver support completely. For this, we need to release
-	 * any memory allocated and unregister any instance of SHM net device.
-	 */
-	for (i = 0; i < MAX_SHM_INSTANCES; i++) {
-		if (shmdev_lyr[i].pshm_netdev)
-			unregister_netdev(shmdev_lyr[i].pshm_netdev);
-	}
-	return result;
-}
-
-static void __exit caif_shmdev_exit(void)
-{
-	int i;
-
-	for (i = 0; i < MAX_SHM_INSTANCES; i++) {
-		caif_shmcore_remove(shmdev_lyr[i].pshm_netdev);
-		kfree((void *)shmdev_lyr[i].shm_base_addr);
-	}
-
-}
-
-module_init(caif_shmdev_init);
-module_exit(caif_shmdev_exit);
diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c
deleted file mode 100644
index cca2afc..0000000
--- a/drivers/net/caif/caif_shmcore.c
+++ /dev/null
@@ -1,744 +0,0 @@
-/*
- * Copyright (C) ST-Ericsson AB 2010
- * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
- * Authors:  Amarnath Revanna / amarnath.bangalore.revanna@stericsson.com,
- *           Daniel Martensson / daniel.martensson@stericsson.com
- * License terms: GNU General Public License (GPL) version 2
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ":" fmt
-
-#include <linux/spinlock.h>
-#include <linux/sched.h>
-#include <linux/list.h>
-#include <linux/netdevice.h>
-#include <linux/if_arp.h>
-#include <linux/io.h>
-
-#include <net/caif/caif_device.h>
-#include <net/caif/caif_shm.h>
-
-#define NR_TX_BUF		6
-#define NR_RX_BUF		6
-#define TX_BUF_SZ		0x2000
-#define RX_BUF_SZ		0x2000
-
-#define CAIF_NEEDED_HEADROOM	32
-
-#define CAIF_FLOW_ON		1
-#define CAIF_FLOW_OFF		0
-
-#define LOW_WATERMARK		3
-#define HIGH_WATERMARK		4
-
-/* Maximum number of CAIF buffers per shared memory buffer. */
-#define SHM_MAX_FRMS_PER_BUF	10
-
-/*
- * Size in bytes of the descriptor area
- * (With end of descriptor signalling)
- */
-#define SHM_CAIF_DESC_SIZE	((SHM_MAX_FRMS_PER_BUF + 1) * \
-					sizeof(struct shm_pck_desc))
-
-/*
- * Offset to the first CAIF frame within a shared memory buffer.
- * Aligned on 32 bytes.
- */
-#define SHM_CAIF_FRM_OFS	(SHM_CAIF_DESC_SIZE + (SHM_CAIF_DESC_SIZE % 32))
-
-/* Number of bytes for CAIF shared memory header. */
-#define SHM_HDR_LEN		1
-
-/* Number of padding bytes for the complete CAIF frame. */
-#define SHM_FRM_PAD_LEN		4
-
-#define CAIF_MAX_MTU		4096
-
-#define SHM_SET_FULL(x)	(((x+1) & 0x0F) << 0)
-#define SHM_GET_FULL(x)	(((x >> 0) & 0x0F) - 1)
-
-#define SHM_SET_EMPTY(x)	(((x+1) & 0x0F) << 4)
-#define SHM_GET_EMPTY(x)	(((x >> 4) & 0x0F) - 1)
-
-#define SHM_FULL_MASK		(0x0F << 0)
-#define SHM_EMPTY_MASK		(0x0F << 4)
-
-struct shm_pck_desc {
-	/*
-	 * Offset from start of shared memory area to start of
-	 * shared memory CAIF frame.
-	 */
-	u32 frm_ofs;
-	u32 frm_len;
-};
-
-struct buf_list {
-	unsigned char *desc_vptr;
-	u32 phy_addr;
-	u32 index;
-	u32 len;
-	u32 frames;
-	u32 frm_ofs;
-	struct list_head list;
-};
-
-struct shm_caif_frm {
-	/* Number of bytes of padding before the CAIF frame. */
-	u8 hdr_ofs;
-};
-
-struct shmdrv_layer {
-	/* caif_dev_common must always be first in the structure*/
-	struct caif_dev_common cfdev;
-
-	u32 shm_tx_addr;
-	u32 shm_rx_addr;
-	u32 shm_base_addr;
-	u32 tx_empty_available;
-	spinlock_t lock;
-
-	struct list_head tx_empty_list;
-	struct list_head tx_pend_list;
-	struct list_head tx_full_list;
-	struct list_head rx_empty_list;
-	struct list_head rx_pend_list;
-	struct list_head rx_full_list;
-
-	struct workqueue_struct *pshm_tx_workqueue;
-	struct workqueue_struct *pshm_rx_workqueue;
-
-	struct work_struct shm_tx_work;
-	struct work_struct shm_rx_work;
-
-	struct sk_buff_head sk_qhead;
-	struct shmdev_layer *pshm_dev;
-};
-
-static int shm_netdev_open(struct net_device *shm_netdev)
-{
-	netif_wake_queue(shm_netdev);
-	return 0;
-}
-
-static int shm_netdev_close(struct net_device *shm_netdev)
-{
-	netif_stop_queue(shm_netdev);
-	return 0;
-}
-
-int caif_shmdrv_rx_cb(u32 mbx_msg, void *priv)
-{
-	struct buf_list *pbuf;
-	struct shmdrv_layer *pshm_drv;
-	struct list_head *pos;
-	u32 avail_emptybuff = 0;
-	unsigned long flags = 0;
-
-	pshm_drv = priv;
-
-	/* Check for received buffers. */
-	if (mbx_msg & SHM_FULL_MASK) {
-		int idx;
-
-		spin_lock_irqsave(&pshm_drv->lock, flags);
-
-		/* Check whether we have any outstanding buffers. */
-		if (list_empty(&pshm_drv->rx_empty_list)) {
-
-			/* Release spin lock. */
-			spin_unlock_irqrestore(&pshm_drv->lock, flags);
-
-			/* We print even in IRQ context... */
-			pr_warn("No empty Rx buffers to fill: "
-					"mbx_msg:%x\n", mbx_msg);
-
-			/* Bail out. */
-			goto err_sync;
-		}
-
-		pbuf =
-			list_entry(pshm_drv->rx_empty_list.next,
-					struct buf_list, list);
-		idx = pbuf->index;
-
-		/* Check buffer synchronization. */
-		if (idx != SHM_GET_FULL(mbx_msg)) {
-
-			/* We print even in IRQ context... */
-			pr_warn(
-			"phyif_shm_mbx_msg_cb: RX full out of sync:"
-			" idx:%d, msg:%x SHM_GET_FULL(mbx_msg):%x\n",
-				idx, mbx_msg, SHM_GET_FULL(mbx_msg));
-
-			spin_unlock_irqrestore(&pshm_drv->lock, flags);
-
-			/* Bail out. */
-			goto err_sync;
-		}
-
-		list_del_init(&pbuf->list);
-		list_add_tail(&pbuf->list, &pshm_drv->rx_full_list);
-
-		spin_unlock_irqrestore(&pshm_drv->lock, flags);
-
-		/* Schedule RX work queue. */
-		if (!work_pending(&pshm_drv->shm_rx_work))
-			queue_work(pshm_drv->pshm_rx_workqueue,
-						&pshm_drv->shm_rx_work);
-	}
-
-	/* Check for emptied buffers. */
-	if (mbx_msg & SHM_EMPTY_MASK) {
-		int idx;
-
-		spin_lock_irqsave(&pshm_drv->lock, flags);
-
-		/* Check whether we have any outstanding buffers. */
-		if (list_empty(&pshm_drv->tx_full_list)) {
-
-			/* We print even in IRQ context... */
-			pr_warn("No TX to empty: msg:%x\n", mbx_msg);
-
-			spin_unlock_irqrestore(&pshm_drv->lock, flags);
-
-			/* Bail out. */
-			goto err_sync;
-		}
-
-		pbuf =
-			list_entry(pshm_drv->tx_full_list.next,
-					struct buf_list, list);
-		idx = pbuf->index;
-
-		/* Check buffer synchronization. */
-		if (idx != SHM_GET_EMPTY(mbx_msg)) {
-
-			spin_unlock_irqrestore(&pshm_drv->lock, flags);
-
-			/* We print even in IRQ context... */
-			pr_warn("TX empty "
-				"out of sync:idx:%d, msg:%x\n", idx, mbx_msg);
-
-			/* Bail out. */
-			goto err_sync;
-		}
-		list_del_init(&pbuf->list);
-
-		/* Reset buffer parameters. */
-		pbuf->frames = 0;
-		pbuf->frm_ofs = SHM_CAIF_FRM_OFS;
-
-		list_add_tail(&pbuf->list, &pshm_drv->tx_empty_list);
-
-		/* Check the available no. of buffers in the empty list */
-		list_for_each(pos, &pshm_drv->tx_empty_list)
-			avail_emptybuff++;
-
-		/* Check whether we have to wake up the transmitter. */
-		if ((avail_emptybuff > HIGH_WATERMARK) &&
-					(!pshm_drv->tx_empty_available)) {
-			pshm_drv->tx_empty_available = 1;
-			spin_unlock_irqrestore(&pshm_drv->lock, flags);
-			pshm_drv->cfdev.flowctrl
-					(pshm_drv->pshm_dev->pshm_netdev,
-								CAIF_FLOW_ON);
-
-
-			/* Schedule the work queue. if required */
-			if (!work_pending(&pshm_drv->shm_tx_work))
-				queue_work(pshm_drv->pshm_tx_workqueue,
-							&pshm_drv->shm_tx_work);
-		} else
-			spin_unlock_irqrestore(&pshm_drv->lock, flags);
-	}
-
-	return 0;
-
-err_sync:
-	return -EIO;
-}
-
-static void shm_rx_work_func(struct work_struct *rx_work)
-{
-	struct shmdrv_layer *pshm_drv;
-	struct buf_list *pbuf;
-	unsigned long flags = 0;
-	struct sk_buff *skb;
-	char *p;
-	int ret;
-
-	pshm_drv = container_of(rx_work, struct shmdrv_layer, shm_rx_work);
-
-	while (1) {
-
-		struct shm_pck_desc *pck_desc;
-
-		spin_lock_irqsave(&pshm_drv->lock, flags);
-
-		/* Check for received buffers. */
-		if (list_empty(&pshm_drv->rx_full_list)) {
-			spin_unlock_irqrestore(&pshm_drv->lock, flags);
-			break;
-		}
-
-		pbuf =
-			list_entry(pshm_drv->rx_full_list.next, struct buf_list,
-					list);
-		list_del_init(&pbuf->list);
-		spin_unlock_irqrestore(&pshm_drv->lock, flags);
-
-		/* Retrieve pointer to start of the packet descriptor area. */
-		pck_desc = (struct shm_pck_desc *) pbuf->desc_vptr;
-
-		/*
-		 * Check whether descriptor contains a CAIF shared memory
-		 * frame.
-		 */
-		while (pck_desc->frm_ofs) {
-			unsigned int frm_buf_ofs;
-			unsigned int frm_pck_ofs;
-			unsigned int frm_pck_len;
-			/*
-			 * Check whether offset is within buffer limits
-			 * (lower).
-			 */
-			if (pck_desc->frm_ofs <
-				(pbuf->phy_addr - pshm_drv->shm_base_addr))
-				break;
-			/*
-			 * Check whether offset is within buffer limits
-			 * (higher).
-			 */
-			if (pck_desc->frm_ofs >
-				((pbuf->phy_addr - pshm_drv->shm_base_addr) +
-					pbuf->len))
-				break;
-
-			/* Calculate offset from start of buffer. */
-			frm_buf_ofs =
-				pck_desc->frm_ofs - (pbuf->phy_addr -
-						pshm_drv->shm_base_addr);
-
-			/*
-			 * Calculate offset and length of CAIF packet while
-			 * taking care of the shared memory header.
-			 */
-			frm_pck_ofs =
-				frm_buf_ofs + SHM_HDR_LEN +
-				(*(pbuf->desc_vptr + frm_buf_ofs));
-			frm_pck_len =
-				(pck_desc->frm_len - SHM_HDR_LEN -
-				(*(pbuf->desc_vptr + frm_buf_ofs)));
-
-			/* Check whether CAIF packet is within buffer limits */
-			if ((frm_pck_ofs + pck_desc->frm_len) > pbuf->len)
-				break;
-
-			/* Get a suitable CAIF packet and copy in data. */
-			skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev,
-							frm_pck_len + 1);
-			if (skb == NULL)
-				break;
-
-			p = skb_put(skb, frm_pck_len);
-			memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len);
-
-			skb->protocol = htons(ETH_P_CAIF);
-			skb_reset_mac_header(skb);
-			skb->dev = pshm_drv->pshm_dev->pshm_netdev;
-
-			/* Push received packet up the stack. */
-			ret = netif_rx_ni(skb);
-
-			if (!ret) {
-				pshm_drv->pshm_dev->pshm_netdev->stats.
-								rx_packets++;
-				pshm_drv->pshm_dev->pshm_netdev->stats.
-						rx_bytes += pck_desc->frm_len;
-			} else
-				++pshm_drv->pshm_dev->pshm_netdev->stats.
-								rx_dropped;
-			/* Move to next packet descriptor. */
-			pck_desc++;
-		}
-
-		spin_lock_irqsave(&pshm_drv->lock, flags);
-		list_add_tail(&pbuf->list, &pshm_drv->rx_pend_list);
-
-		spin_unlock_irqrestore(&pshm_drv->lock, flags);
-
-	}
-
-	/* Schedule the work queue. if required */
-	if (!work_pending(&pshm_drv->shm_tx_work))
-		queue_work(pshm_drv->pshm_tx_workqueue, &pshm_drv->shm_tx_work);
-
-}
-
-static void shm_tx_work_func(struct work_struct *tx_work)
-{
-	u32 mbox_msg;
-	unsigned int frmlen, avail_emptybuff, append = 0;
-	unsigned long flags = 0;
-	struct buf_list *pbuf = NULL;
-	struct shmdrv_layer *pshm_drv;
-	struct shm_caif_frm *frm;
-	struct sk_buff *skb;
-	struct shm_pck_desc *pck_desc;
-	struct list_head *pos;
-
-	pshm_drv = container_of(tx_work, struct shmdrv_layer, shm_tx_work);
-
-	do {
-		/* Initialize mailbox message. */
-		mbox_msg = 0x00;
-		avail_emptybuff = 0;
-
-		spin_lock_irqsave(&pshm_drv->lock, flags);
-
-		/* Check for pending receive buffers. */
-		if (!list_empty(&pshm_drv->rx_pend_list)) {
-
-			pbuf = list_entry(pshm_drv->rx_pend_list.next,
-						struct buf_list, list);
-
-			list_del_init(&pbuf->list);
-			list_add_tail(&pbuf->list, &pshm_drv->rx_empty_list);
-			/*
-			 * Value index is never changed,
-			 * so read access should be safe.
-			 */
-			mbox_msg |= SHM_SET_EMPTY(pbuf->index);
-		}
-
-		skb = skb_peek(&pshm_drv->sk_qhead);
-
-		if (skb == NULL)
-			goto send_msg;
-		/* Check the available no. of buffers in the empty list */
-		list_for_each(pos, &pshm_drv->tx_empty_list)
-			avail_emptybuff++;
-
-		if ((avail_emptybuff < LOW_WATERMARK) &&
-					pshm_drv->tx_empty_available) {
-			/* Update blocking condition. */
-			pshm_drv->tx_empty_available = 0;
-			spin_unlock_irqrestore(&pshm_drv->lock, flags);
-			pshm_drv->cfdev.flowctrl
-					(pshm_drv->pshm_dev->pshm_netdev,
-					CAIF_FLOW_OFF);
-			spin_lock_irqsave(&pshm_drv->lock, flags);
-		}
-		/*
-		 * We simply return back to the caller if we do not have space
-		 * either in Tx pending list or Tx empty list. In this case,
-		 * we hold the received skb in the skb list, waiting to
-		 * be transmitted once Tx buffers become available
-		 */
-		if (list_empty(&pshm_drv->tx_empty_list))
-			goto send_msg;
-
-		/* Get the first free Tx buffer. */
-		pbuf = list_entry(pshm_drv->tx_empty_list.next,
-						struct buf_list, list);
-		do {
-			if (append) {
-				skb = skb_peek(&pshm_drv->sk_qhead);
-				if (skb == NULL)
-					break;
-			}
-
-			frm = (struct shm_caif_frm *)
-					(pbuf->desc_vptr + pbuf->frm_ofs);
-
-			frm->hdr_ofs = 0;
-			frmlen = 0;
-			frmlen += SHM_HDR_LEN + frm->hdr_ofs + skb->len;
-
-			/* Add tail padding if needed. */
-			if (frmlen % SHM_FRM_PAD_LEN)
-				frmlen += SHM_FRM_PAD_LEN -
-						(frmlen % SHM_FRM_PAD_LEN);
-
-			/*
-			 * Verify that packet, header and additional padding
-			 * can fit within the buffer frame area.
-			 */
-			if (frmlen >= (pbuf->len - pbuf->frm_ofs))
-				break;
-
-			if (!append) {
-				list_del_init(&pbuf->list);
-				append = 1;
-			}
-
-			skb = skb_dequeue(&pshm_drv->sk_qhead);
-			if (skb == NULL)
-				break;
-			/* Copy in CAIF frame. */
-			skb_copy_bits(skb, 0, pbuf->desc_vptr +
-					pbuf->frm_ofs + SHM_HDR_LEN +
-						frm->hdr_ofs, skb->len);
-
-			pshm_drv->pshm_dev->pshm_netdev->stats.tx_packets++;
-			pshm_drv->pshm_dev->pshm_netdev->stats.tx_bytes +=
-									frmlen;
-			dev_kfree_skb_irq(skb);
-
-			/* Fill in the shared memory packet descriptor area. */
-			pck_desc = (struct shm_pck_desc *) (pbuf->desc_vptr);
-			/* Forward to current frame. */
-			pck_desc += pbuf->frames;
-			pck_desc->frm_ofs = (pbuf->phy_addr -
-						pshm_drv->shm_base_addr) +
-								pbuf->frm_ofs;
-			pck_desc->frm_len = frmlen;
-			/* Terminate packet descriptor area. */
-			pck_desc++;
-			pck_desc->frm_ofs = 0;
-			/* Update buffer parameters. */
-			pbuf->frames++;
-			pbuf->frm_ofs += frmlen + (frmlen % 32);
-
-		} while (pbuf->frames < SHM_MAX_FRMS_PER_BUF);
-
-		/* Assign buffer as full. */
-		list_add_tail(&pbuf->list, &pshm_drv->tx_full_list);
-		append = 0;
-		mbox_msg |= SHM_SET_FULL(pbuf->index);
-send_msg:
-		spin_unlock_irqrestore(&pshm_drv->lock, flags);
-
-		if (mbox_msg)
-			pshm_drv->pshm_dev->pshmdev_mbxsend
-					(pshm_drv->pshm_dev->shm_id, mbox_msg);
-	} while (mbox_msg);
-}
-
-static int shm_netdev_tx(struct sk_buff *skb, struct net_device *shm_netdev)
-{
-	struct shmdrv_layer *pshm_drv;
-
-	pshm_drv = netdev_priv(shm_netdev);
-
-	skb_queue_tail(&pshm_drv->sk_qhead, skb);
-
-	/* Schedule Tx work queue. for deferred processing of skbs*/
-	if (!work_pending(&pshm_drv->shm_tx_work))
-		queue_work(pshm_drv->pshm_tx_workqueue, &pshm_drv->shm_tx_work);
-
-	return 0;
-}
-
-static const struct net_device_ops netdev_ops = {
-	.ndo_open = shm_netdev_open,
-	.ndo_stop = shm_netdev_close,
-	.ndo_start_xmit = shm_netdev_tx,
-};
-
-static void shm_netdev_setup(struct net_device *pshm_netdev)
-{
-	struct shmdrv_layer *pshm_drv;
-	pshm_netdev->netdev_ops = &netdev_ops;
-
-	pshm_netdev->mtu = CAIF_MAX_MTU;
-	pshm_netdev->type = ARPHRD_CAIF;
-	pshm_netdev->hard_header_len = CAIF_NEEDED_HEADROOM;
-	pshm_netdev->tx_queue_len = 0;
-	pshm_netdev->destructor = free_netdev;
-
-	pshm_drv = netdev_priv(pshm_netdev);
-
-	/* Initialize structures in a clean state. */
-	memset(pshm_drv, 0, sizeof(struct shmdrv_layer));
-
-	pshm_drv->cfdev.link_select = CAIF_LINK_LOW_LATENCY;
-}
-
-int caif_shmcore_probe(struct shmdev_layer *pshm_dev)
-{
-	int result, j;
-	struct shmdrv_layer *pshm_drv = NULL;
-
-	pshm_dev->pshm_netdev = alloc_netdev(sizeof(struct shmdrv_layer),
-						"cfshm%d", shm_netdev_setup);
-	if (!pshm_dev->pshm_netdev)
-		return -ENOMEM;
-
-	pshm_drv = netdev_priv(pshm_dev->pshm_netdev);
-	pshm_drv->pshm_dev = pshm_dev;
-
-	/*
-	 * Initialization starts with the verification of the
-	 * availability of MBX driver by calling its setup function.
-	 * MBX driver must be available by this time for proper
-	 * functioning of SHM driver.
-	 */
-	if ((pshm_dev->pshmdev_mbxsetup
-				(caif_shmdrv_rx_cb, pshm_dev, pshm_drv)) != 0) {
-		pr_warn("Could not config. SHM Mailbox,"
-				" Bailing out.....\n");
-		free_netdev(pshm_dev->pshm_netdev);
-		return -ENODEV;
-	}
-
-	skb_queue_head_init(&pshm_drv->sk_qhead);
-
-	pr_info("SHM DEVICE[%d] PROBED BY DRIVER, NEW SHM DRIVER"
-			" INSTANCE AT pshm_drv =0x%p\n",
-			pshm_drv->pshm_dev->shm_id, pshm_drv);
-
-	if (pshm_dev->shm_total_sz <
-			(NR_TX_BUF * TX_BUF_SZ + NR_RX_BUF * RX_BUF_SZ)) {
-
-		pr_warn("ERROR, Amount of available"
-				" Phys. SHM cannot accommodate current SHM "
-				"driver configuration, Bailing out ...\n");
-		free_netdev(pshm_dev->pshm_netdev);
-		return -ENOMEM;
-	}
-
-	pshm_drv->shm_base_addr = pshm_dev->shm_base_addr;
-	pshm_drv->shm_tx_addr = pshm_drv->shm_base_addr;
-
-	if (pshm_dev->shm_loopback)
-		pshm_drv->shm_rx_addr = pshm_drv->shm_tx_addr;
-	else
-		pshm_drv->shm_rx_addr = pshm_dev->shm_base_addr +
-						(NR_TX_BUF * TX_BUF_SZ);
-
-	spin_lock_init(&pshm_drv->lock);
-	INIT_LIST_HEAD(&pshm_drv->tx_empty_list);
-	INIT_LIST_HEAD(&pshm_drv->tx_pend_list);
-	INIT_LIST_HEAD(&pshm_drv->tx_full_list);
-
-	INIT_LIST_HEAD(&pshm_drv->rx_empty_list);
-	INIT_LIST_HEAD(&pshm_drv->rx_pend_list);
-	INIT_LIST_HEAD(&pshm_drv->rx_full_list);
-
-	INIT_WORK(&pshm_drv->shm_tx_work, shm_tx_work_func);
-	INIT_WORK(&pshm_drv->shm_rx_work, shm_rx_work_func);
-
-	pshm_drv->pshm_tx_workqueue =
-				create_singlethread_workqueue("shm_tx_work");
-	pshm_drv->pshm_rx_workqueue =
-				create_singlethread_workqueue("shm_rx_work");
-
-	for (j = 0; j < NR_TX_BUF; j++) {
-		struct buf_list *tx_buf =
-				kmalloc(sizeof(struct buf_list), GFP_KERNEL);
-
-		if (tx_buf == NULL) {
-			free_netdev(pshm_dev->pshm_netdev);
-			return -ENOMEM;
-		}
-		tx_buf->index = j;
-		tx_buf->phy_addr = pshm_drv->shm_tx_addr + (TX_BUF_SZ * j);
-		tx_buf->len = TX_BUF_SZ;
-		tx_buf->frames = 0;
-		tx_buf->frm_ofs = SHM_CAIF_FRM_OFS;
-
-		if (pshm_dev->shm_loopback)
-			tx_buf->desc_vptr = (unsigned char *)tx_buf->phy_addr;
-		else
-			/*
-			 * FIXME: the result of ioremap is not a pointer - arnd
-			 */
-			tx_buf->desc_vptr =
-					ioremap(tx_buf->phy_addr, TX_BUF_SZ);
-
-		list_add_tail(&tx_buf->list, &pshm_drv->tx_empty_list);
-	}
-
-	for (j = 0; j < NR_RX_BUF; j++) {
-		struct buf_list *rx_buf =
-				kmalloc(sizeof(struct buf_list), GFP_KERNEL);
-
-		if (rx_buf == NULL) {
-			free_netdev(pshm_dev->pshm_netdev);
-			return -ENOMEM;
-		}
-		rx_buf->index = j;
-		rx_buf->phy_addr = pshm_drv->shm_rx_addr + (RX_BUF_SZ * j);
-		rx_buf->len = RX_BUF_SZ;
-
-		if (pshm_dev->shm_loopback)
-			rx_buf->desc_vptr = (unsigned char *)rx_buf->phy_addr;
-		else
-			rx_buf->desc_vptr =
-					ioremap(rx_buf->phy_addr, RX_BUF_SZ);
-		list_add_tail(&rx_buf->list, &pshm_drv->rx_empty_list);
-	}
-
-	pshm_drv->tx_empty_available = 1;
-	result = register_netdev(pshm_dev->pshm_netdev);
-	if (result)
-		pr_warn("ERROR[%d], SHM could not, "
-			"register with NW FRMWK Bailing out ...\n", result);
-
-	return result;
-}
-
-void caif_shmcore_remove(struct net_device *pshm_netdev)
-{
-	struct buf_list *pbuf;
-	struct shmdrv_layer *pshm_drv = NULL;
-
-	pshm_drv = netdev_priv(pshm_netdev);
-
-	while (!(list_empty(&pshm_drv->tx_pend_list))) {
-		pbuf =
-			list_entry(pshm_drv->tx_pend_list.next,
-					struct buf_list, list);
-
-		list_del(&pbuf->list);
-		kfree(pbuf);
-	}
-
-	while (!(list_empty(&pshm_drv->tx_full_list))) {
-		pbuf =
-			list_entry(pshm_drv->tx_full_list.next,
-					struct buf_list, list);
-		list_del(&pbuf->list);
-		kfree(pbuf);
-	}
-
-	while (!(list_empty(&pshm_drv->tx_empty_list))) {
-		pbuf =
-			list_entry(pshm_drv->tx_empty_list.next,
-					struct buf_list, list);
-		list_del(&pbuf->list);
-		kfree(pbuf);
-	}
-
-	while (!(list_empty(&pshm_drv->rx_full_list))) {
-		pbuf =
-			list_entry(pshm_drv->tx_full_list.next,
-				struct buf_list, list);
-		list_del(&pbuf->list);
-		kfree(pbuf);
-	}
-
-	while (!(list_empty(&pshm_drv->rx_pend_list))) {
-		pbuf =
-			list_entry(pshm_drv->tx_pend_list.next,
-				struct buf_list, list);
-		list_del(&pbuf->list);
-		kfree(pbuf);
-	}
-
-	while (!(list_empty(&pshm_drv->rx_empty_list))) {
-		pbuf =
-			list_entry(pshm_drv->rx_empty_list.next,
-				struct buf_list, list);
-		list_del(&pbuf->list);
-		kfree(pbuf);
-	}
-
-	/* Destroy work queues. */
-	destroy_workqueue(pshm_drv->pshm_tx_workqueue);
-	destroy_workqueue(pshm_drv->pshm_rx_workqueue);
-
-	unregister_netdev(pshm_netdev);
-}
diff --git a/include/net/caif/caif_shm.h b/include/net/caif/caif_shm.h
deleted file mode 100644
index 5bcce55..0000000
--- a/include/net/caif/caif_shm.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) ST-Ericsson AB 2010
- * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
- * Author: Amarnath Revanna / amarnath.bangalore.revanna@stericsson.com
- * License terms: GNU General Public License (GPL) version 2
- */
-
-#ifndef CAIF_SHM_H_
-#define CAIF_SHM_H_
-
-struct shmdev_layer {
-	u32 shm_base_addr;
-	u32 shm_total_sz;
-	u32 shm_id;
-	u32 shm_loopback;
-	void *hmbx;
-	int (*pshmdev_mbxsend) (u32 shm_id, u32 mbx_msg);
-	int (*pshmdev_mbxsetup) (void *pshmdrv_cb,
-				struct shmdev_layer *pshm_dev, void *pshm_drv);
-	struct net_device *pshm_netdev;
-};
-
-extern int caif_shmcore_probe(struct shmdev_layer *pshm_dev);
-extern void caif_shmcore_remove(struct net_device *pshm_netdev);
-
-#endif
-- 
1.7.9.2

^ permalink raw reply related

* Re: [PATCH 1/2] phy/micrel: Add support for KSZ8031
From: Marek Vasut @ 2013-03-11 12:39 UTC (permalink / raw)
  To: Hector Palacios; +Cc: netdev, linux-kernel, davem
In-Reply-To: <1362991803-4610-1-git-send-email-hector.palacios@digi.com>

Dear Hector Palacios,

> Micrel PHY KSZ8031 is similar to KSZ8021 and also requires the special
> initialization of "Operation Mode Strap Override" in reg 0x16
> introduced in 212ea99 (phy/micrel: Implement support for KSZ8021).
> 
> Signed-off-by: Hector Palacios <hector.palacios@digi.com>

I dont have any board with this one, yet I think this change is correct, so:

Reviewed-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

^ permalink raw reply

* [PATCH] sh: remove references to CPU_SUBTYPE_SH7764
From: Paul Bolle @ 2013-03-11 11:55 UTC (permalink / raw)
  To: Paul Mundt; +Cc: linux-sh, netdev, linux-kernel

Since release v2.6.29 the tree has a few references to the Kconfig
symbol CPU_SUBTYPE_SH7764 and the Kconfig macro
CONFIG_CPU_SUBTYPE_SH7764. But the actual symbol CPU_SUBTYPE_SH7764 was
never added to the tree. Perhaps no one noticed because these references
were never used alone. Anyhow, these references serve no purpose and
can be removed.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
Untested: I don't have the hardware. Neither do I have the compiler for
this architecture at hand.

 arch/sh/drivers/dma/Kconfig                | 2 +-
 arch/sh/include/cpu-sh4/cpu/dma-register.h | 1 -
 arch/sh/include/cpu-sh4a/cpu/dma.h         | 3 +--
 drivers/net/ethernet/renesas/sh_eth.c      | 1 -
 4 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig
index cfd5b90..504afb4 100644
--- a/arch/sh/drivers/dma/Kconfig
+++ b/arch/sh/drivers/dma/Kconfig
@@ -12,7 +12,7 @@ config SH_DMA_IRQ_MULTI
 	default y if CPU_SUBTYPE_SH7750  || CPU_SUBTYPE_SH7751  || \
 		     CPU_SUBTYPE_SH7750S || CPU_SUBTYPE_SH7750R || \
 		     CPU_SUBTYPE_SH7751R || CPU_SUBTYPE_SH7091  || \
-		     CPU_SUBTYPE_SH7763  || CPU_SUBTYPE_SH7764  || \
+		     CPU_SUBTYPE_SH7763  || \
 		     CPU_SUBTYPE_SH7780  || CPU_SUBTYPE_SH7785  || \
 		     CPU_SUBTYPE_SH7760
 
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-register.h b/arch/sh/include/cpu-sh4/cpu/dma-register.h
index 02788b6..9cd81e5 100644
--- a/arch/sh/include/cpu-sh4/cpu/dma-register.h
+++ b/arch/sh/include/cpu-sh4/cpu/dma-register.h
@@ -32,7 +32,6 @@
 #define CHCR_TS_HIGH_SHIFT	(20 - 2)	/* 2 bits for shifted low TS */
 #elif defined(CONFIG_CPU_SUBTYPE_SH7757) || \
 	defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-	defined(CONFIG_CPU_SUBTYPE_SH7764) || \
 	defined(CONFIG_CPU_SUBTYPE_SH7780) || \
 	defined(CONFIG_CPU_SUBTYPE_SH7785)
 #define CHCR_TS_LOW_MASK	0x00000018
diff --git a/arch/sh/include/cpu-sh4a/cpu/dma.h b/arch/sh/include/cpu-sh4a/cpu/dma.h
index 89afb65..8ceccce 100644
--- a/arch/sh/include/cpu-sh4a/cpu/dma.h
+++ b/arch/sh/include/cpu-sh4a/cpu/dma.h
@@ -14,8 +14,7 @@
 #define DMTE4_IRQ	evt2irq(0xb80)
 #define DMAE0_IRQ	evt2irq(0xbc0)	/* DMA Error IRQ*/
 #define SH_DMAC_BASE0	0xFE008020
-#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-	defined(CONFIG_CPU_SUBTYPE_SH7764)
+#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
 #define DMTE0_IRQ	evt2irq(0x640)
 #define DMTE4_IRQ	evt2irq(0x780)
 #define DMAE0_IRQ	evt2irq(0x6c0)
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 33e9617..44a3d7b 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1653,7 +1653,6 @@ static int sh_eth_open(struct net_device *ndev)
 
 	ret = request_irq(ndev->irq, sh_eth_interrupt,
 #if defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-	defined(CONFIG_CPU_SUBTYPE_SH7764) || \
 	defined(CONFIG_CPU_SUBTYPE_SH7757)
 				IRQF_SHARED,
 #else
-- 
1.7.11.7

^ permalink raw reply related

* Re: [PATCH net-next] cxgb4: Allow for backward compatibility with new VPD scheme.
From: Vipul Pandya @ 2013-03-11 11:49 UTC (permalink / raw)
  To: David Miller
  Cc: netdev@vger.kernel.org, Divy Le Ray, Dimitrios Michailidis,
	Abhishek Agrawal, Santosh Rastapur
In-Reply-To: <20130311.074136.1262065455365949917.davem@davemloft.net>



On 11-03-2013 17:11, David Miller wrote:
> From: Vipul Pandya <vipul@chelsio.com>
> Date: Mon, 11 Mar 2013 12:23:12 +0530
> 
>>
>>
>> On 11-03-2013 12:00, David Miller wrote:
>>> From: Vipul Pandya <vipul@chelsio.com>
>>> Date: Mon, 11 Mar 2013 11:21:51 +0530
>>>
>>>>
>>>>
>>>> On 08-03-2013 23:14, David Miller wrote:
>>>>> From: Vipul Pandya <vipul@chelsio.com>
>>>>> Date: Fri,  8 Mar 2013 19:05:29 +0530
>>>>>
>>>>>> From: Santosh Rastapur <santosh@chelsio.com>
>>>>>>
>>>>>> New scheme calls for 3rd party VPD at offset 0x0 and Chelsio VPD at offset
>>>>>> 0x400 of the function.  If no 3rd party VPD is present, then a copy of
>>>>>> Chelsio's VPD will be at offset 0x0 to keep in line with PCI spec which
>>>>>> requires the VPD to be present at offset 0x0.
>>>>>>
>>>>>> Signed-off-by: Santosh Rastapur <santosh@chelsio.com>
>>>>>> Signed-off-by: Vipul Pandya <vipul@chelsio.com>
>>>>>
>>>>> Isn't this a fix which is better targetted at 'net' than 'net-next'?
>>>>>
>>>>
>>>> We have very soon new patch series coming up for net-next. This patch
>>>> requires for that patch series to work correctly. So, we would like to
>>>> get this merge in net-next tree.
>>>
>>> But you can achieve that by asking me to apply this to 'net' and then
>>> when the patch series that depends upon it is posted, you tell me about
>>> this dependency.
>>>
>> Ok. I was not aware of this. However there can be a merge conflict at
>> the time of merging 'net' and 'net-next' tree if this patch gets applied
>> in 'net' tree and our new patch series gets applied in 'net-next'. To
>> avoid it we recommended the same. The merge conflict wont be a major and
>> if it is alright to resolve it we can apply this patch to 'net' tree.
> 
> That's why you tell me to first pull net into net-next, and you send
> me a patch set for net-next which assumes the fix from 'net' is
> already applied.
> 

Ok, I will inform you about the patch dependency on 'net' tree when I
post the patch series targeted for 'net-next'. Please consider applying
this patch to net tree.

Thanks,
Vipul

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2013-03-11 11:43 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) Missing cancel of work items in mac80211 MLME, from
   Ben Greear.

2) Fix DMA mapping handling in iwlwifi by using coherent DMA for
   command headers, from Johannes Berg.

3) Decrease the amount of pressure on the page allocator by
   using order 1 pages less in iwlwifi, from Emmanuel Grumbach.

4) Fix mesh PS broadcast OOPS in mac80211, from Marco Porsch.

5) Don't forget to recalculate idle state in mac80211 monitor
   interface, from Felix Fietkau.

6) Fix varargs in netfilter conntrack handler, from Joe Perches.

7) Need to reset entire chip when command queue fills up in
   iwlwifi, from Emmanuel Grumbach.

8) The TX antenna value must be valid when calibrations are
   performmed in iwlwifi, fix from Dor Shaish.

9) Don't generate netfilter audit log entries when audit is disabled,
   from Gao Feng.

10) Deal with DMA unit hang on e1000e during power state transitions,
    from Bruce Allan.

11) Remove BUILD_BUG_ON check from igb driver, from Alexander
    Duyck.

12) Fix lockdep warning on i2c handling of igb driver, from Carolyn
    Wyborny.

13) Fix several TTY handling issues in IRDA ircomm tty driver, from
    Peter Hurley.

14) Several QFQ packet scheduler fixes from Paolo Valente.

15) When VXLAN encapsulates on transmit, we have to reset the
    netfilter state.  From Zang MingJie.

16) Fix jiffie check in net_rx_action() so that we really cap the
    processing at 2HZ.  From Eric Dumazet.

17) Fix erroneous trigger of IP option space exhaustion, when
    routers are pre-specified and we are looking to see if we
    can insert a timestamp, we will have the space.  From David
    Ward.

18) Fix various issues in benet driver wrt. waiting for firmware to
    finish POST after resets or errors.  From Gavin Shan and Sathya
    Perla.

19) Fix TX locking in SFC driver, from Ben Hutchings.

20) Like the VXLAN fix above, when we encap in a TUN device we have
    to reset the netfilter state.  This should fix several strange
    crashes reported by Dave Jones and others.  From Eric Dumazet.

21) Don't forget to clean up MAC address resources when shutting down
    a port in mlx4 driver, from Yan Burman.

22) Fix divide by zero in vmxnet3 driver, from Bhavesh Davda.

23) Fix device statistic regression in tg3 when the driver is
    using phylib, from Nithin Sujir.

24) Fix info leak in several netlink handlers, from Mathias
    Krause.

Please pull, thanks a lot!

The following changes since commit 9f225788cc047fb7c2ef2326eb4f86dee890e2ef:

  Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc (2013-03-05 18:56:22 -0800)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master

for you to fetch changes up to 9026c4927254f5bea695cc3ef2e255280e6a3011:

  6lowpan: Fix endianness issue in is_addr_link_local(). (2013-03-10 16:49:35 -0400)

----------------------------------------------------------------
Alexander Duyck (1):
      igb: Drop BUILD_BUG_ON check from igb_build_rx_buffer

Amir Vadai (1):
      net/mlx4_en: Disable RFS when running in SRIOV mode

Ben Greear (2):
      mac80211: stop timers before canceling work items
      mac80211: Fix crash due to un-canceled work-items

Ben Hutchings (2):
      sfc: Disable soft interrupt handling during efx_device_detach_sync()
      sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0

Bhavesh Davda (1):
      vmxnet3: prevent div-by-zero panic when ring resizing uninitialized dev

Bruce Allan (1):
      e1000e: workaround DMA unit hang on I218

Carolyn Wyborny (2):
      igb: Fix link setup for I210 devices
      igb: Fix for lockdep issue in igb_get_i2c_client

Chen Gang (2):
      net/rds: zero last byte for strncpy
      drivers/isdn: checkng length to be sure not memory overflow

Christoph Paasch (1):
      Fix: sparse warning in inet_csk_prepare_forced_close

Cong Wang (1):
      bridge: add missing vid to br_mdb_get()

Cristian Bercaru (1):
      bridging: fix rx_handlers return code

David Oostdyk (1):
      rrunner.c: fix possible memory leak in rr_init_one()

David S. Miller (6):
      Merge branch 'master' of git://git.kernel.org/.../jkirsher/net into intel
      Merge branch 'sfc-3.9' of git://git.kernel.org/.../bwh/sfc
      Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless
      Merge branch 'intel'
      Merge branch 'master' of git://1984.lsi.us.es/nf
      Merge branch 'mlx4'

David Ward (1):
      net/ipv4: Timestamp option cannot overflow with prespecified addresses

Dor Shaish (3):
      iwlwifi: mvm: Set valid TX antennas value before calib request
      iwlwifi: mvm: Take the phy_cfg from the TLV value
      iwlwifi: mvm: Remove overriding calibrations for the 7000 family

Emmanuel Grumbach (5):
      iwlwifi: disable 8K A-MSDU by default
      iwlwifi: mvm: restart the NIC of the cmd queue gets full
      iwlwifi: mvm: ignore STOP_AGG when restarting
      iwlwifi: mvm: update the rssi calculation
      iwlwifi: mvm: don't warn on normal BAR sending

Eric Dumazet (2):
      net: reduce net_rx_action() latency to 2 HZ
      tun: add a missing nf_reset() in tun_net_xmit()

Felix Fietkau (1):
      mac80211: another fix for idle handling in monitor mode

Gao feng (1):
      netfilter: xt_AUDIT: only generate audit log when audit enabled

Gavin Shan (1):
      benet: Wait f/w POST until timeout

Hannes Frederic Sowa (1):
      ipv6: stop multicast forwarding to process interface scoped addresses

Jack Morgenstein (3):
      net/mlx4_core: Disable mlx4_QP_ATTACH calls from guests if the host uses flow steering
      net/mlx4_core: Turn off device-managed FS bit in dev-cap wrapper if DMFS is not enabled
      net/mlx4_core: Fix endianness bug in set_param_l

Jason Wang (1):
      net: docs: document multiqueue tuntap API

Joe Perches (1):
      netfilter: nf_ct_helper: Fix logging for dropped packets

Johannes Berg (7):
      nl80211: remove channel width and extended capa advertising
      mac80211: really fix monitor mode channel reporting
      iwlwifi: don't map complete commands bidirectionally
      iwlwifi: rename IWL_MAX_CMD_TFDS to IWL_MAX_CMD_TBS_PER_TFD
      iwlwifi: use coherent DMA memory for command header
      nl80211: increase wiphy dump size dynamically
      mac80211: fix VHT MCS calculation

John W. Linville (3):
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem

Junwei Zhang (1):
      afkey: fix a typo

Konstantin Khlebnikov (3):
      e1000e: fix pci-device enable-counter balance
      e1000e: fix runtime power management transitions
      e1000e: fix accessing to suspended device

Marco Porsch (1):
      mac80211: fix oops on mesh PS broadcast forwarding

Mathias Krause (3):
      bridge: fix mdb info leaks
      rtnl: fix info leak on RTM_GETLINK request for VF devices
      dcbnl: fix various netlink info leaks

Nithin Sujir (1):
      tg3: Update link_up flag for phylib devices

Paolo Valente (6):
      pkt_sched: sch_qfq: properly cap timestamps in charge_actual_service
      pkt_sched: sch_qfq: fix the update of eligible-group sets
      pkt_sched: sch_qfq: serve activated aggregates immediately if the scheduler is empty
      pkt_sched: sch_qfq: prevent budget from wrapping around after a dequeue
      pkt_sched: sch_qfq: do not allow virtual time to jump if an aggregate is in service
      pkt_sched: sch_qfq: remove a useless invocation of qfq_update_eligible

Paul Bolle (1):
      netfilter: nfnetlink: silence warning if CONFIG_PROVE_RCU isn't set

Paul Moore (2):
      netlabel: correctly list all the static label mappings
      netlabel: fix build problems when CONFIG_IPV6=n

Peter Hurley (4):
      net/irda: Fix port open counts
      net/irda: Hold port lock while bumping blocked_open
      net/irda: Use barrier to set task state
      net/irda: Raise dtr in non-blocking open

Phil Sutter (1):
      mv643xx_eth: fix for disabled autoneg

Randy Dunlap (1):
      net: fix new kernel-doc warnings in net core

Sathya Perla (1):
      be2net: use CSR-BAR SEMAPHORE reg for BE2/BE3

Sony Chacko (1):
      MAINTAINERS: Update qlcnic maintainers list

Veaceslav Falico (1):
      bonding: fire NETDEV_RELEASE event only on 0 slaves

Vlad Yasevich (2):
      team: unsyc the devices addresses when port is removed
      macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode.

YOSHIFUJI Hideaki / 吉藤英明 (1):
      6lowpan: Fix endianness issue in is_addr_link_local().

Yan Burman (2):
      net/mlx4_en: Fix race when setting the device MAC address
      net/mlx4_en: Cleanup MAC resources on module unload or port stop

Yaniv Rosner (2):
      bnx2x: Fix intermittent long KR2 link up time
      bnx2x: Fix SFP+ misconfiguration in iSCSI boot scenario

Zang MingJie (2):
      reset nf before xmit vxlan encapsulated packet
      vxlan: fix oops when delete netns containing vxlan

 Documentation/networking/tuntap.txt                   |   77 +++++++++
 MAINTAINERS                                           |    2 +
 drivers/isdn/i4l/isdn_tty.c                           |    4 +-
 drivers/net/bonding/bond_main.c                       |    5 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c      |   17 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h      |    4 +-
 drivers/net/ethernet/broadcom/tg3.c                   |   14 +-
 drivers/net/ethernet/emulex/benet/be.h                |    1 +
 drivers/net/ethernet/emulex/benet/be_cmds.c           |   36 ++--
 drivers/net/ethernet/emulex/benet/be_hw.h             |    4 +-
 drivers/net/ethernet/emulex/benet/be_main.c           |   10 ++
 drivers/net/ethernet/intel/e1000e/ethtool.c           |   13 ++
 drivers/net/ethernet/intel/e1000e/ich8lan.c           |   71 +++++++-
 drivers/net/ethernet/intel/e1000e/ich8lan.h           |    2 +
 drivers/net/ethernet/intel/e1000e/netdev.c            |   82 +++------
 drivers/net/ethernet/intel/e1000e/regs.h              |    1 +
 drivers/net/ethernet/intel/igb/e1000_82575.c          |   11 +-
 drivers/net/ethernet/intel/igb/igb.h                  |    2 +-
 drivers/net/ethernet/intel/igb/igb_hwmon.c            |   14 ++
 drivers/net/ethernet/intel/igb/igb_main.c             |   76 +--------
 drivers/net/ethernet/marvell/mv643xx_eth.c            |   55 +++++-
 drivers/net/ethernet/mellanox/mlx4/cq.c               |    2 +-
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c        |   86 +++++-----
 drivers/net/ethernet/mellanox/mlx4/fw.c               |    8 +
 drivers/net/ethernet/mellanox/mlx4/main.c             |    2 +-
 drivers/net/ethernet/mellanox/mlx4/mlx4.h             |    2 +-
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h          |    1 -
 drivers/net/ethernet/mellanox/mlx4/mr.c               |   10 +-
 drivers/net/ethernet/mellanox/mlx4/pd.c               |    2 +-
 drivers/net/ethernet/mellanox/mlx4/port.c             |    8 +-
 drivers/net/ethernet/mellanox/mlx4/qp.c               |    8 +-
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c |    3 +
 drivers/net/ethernet/mellanox/mlx4/srq.c              |    2 +-
 drivers/net/ethernet/sfc/efx.h                        |    4 +-
 drivers/net/ethernet/sfc/rx.c                         |    2 +-
 drivers/net/hippi/rrunner.c                           |    3 +
 drivers/net/macvlan.c                                 |    1 +
 drivers/net/team/team.c                               |    2 +
 drivers/net/tun.c                                     |    2 +
 drivers/net/vmxnet3/vmxnet3_drv.c                     |    1 +
 drivers/net/vmxnet3/vmxnet3_ethtool.c                 |    6 +
 drivers/net/vmxnet3/vmxnet3_int.h                     |    4 +-
 drivers/net/vxlan.c                                   |   10 ++
 drivers/net/wireless/iwlwifi/dvm/sta.c                |    2 +-
 drivers/net/wireless/iwlwifi/iwl-devtrace.h           |    2 +-
 drivers/net/wireless/iwlwifi/iwl-drv.c                |    3 +-
 drivers/net/wireless/iwlwifi/iwl-modparams.h          |    2 +-
 drivers/net/wireless/iwlwifi/iwl-trans.h              |   20 +--
 drivers/net/wireless/iwlwifi/mvm/fw-api.h             |   18 +-
 drivers/net/wireless/iwlwifi/mvm/fw.c                 |  133 +--------------
 drivers/net/wireless/iwlwifi/mvm/mvm.h                |    3 +-
 drivers/net/wireless/iwlwifi/mvm/ops.c                |   18 +-
 drivers/net/wireless/iwlwifi/mvm/rx.c                 |   37 +++--
 drivers/net/wireless/iwlwifi/mvm/sta.c                |   10 ++
 drivers/net/wireless/iwlwifi/mvm/tx.c                 |    6 +-
 drivers/net/wireless/iwlwifi/pcie/internal.h          |   34 +++-
 drivers/net/wireless/iwlwifi/pcie/rx.c                |   14 +-
 drivers/net/wireless/iwlwifi/pcie/tx.c                |  266 ++++++++++++++----------------
 net/bridge/br_device.c                                |    2 +-
 net/bridge/br_input.c                                 |    2 +-
 net/bridge/br_mdb.c                                   |    4 +
 net/bridge/br_multicast.c                             |    3 +-
 net/bridge/br_private.h                               |    4 +-
 net/core/dev.c                                        |    5 +-
 net/core/rtnetlink.c                                  |    1 +
 net/dcb/dcbnl.c                                       |    8 +
 net/ieee802154/6lowpan.h                              |    2 +-
 net/ipv4/inet_connection_sock.c                       |    1 +
 net/ipv4/ip_options.c                                 |    2 +-
 net/ipv6/ip6_input.c                                  |    3 +-
 net/irda/ircomm/ircomm_tty.c                          |   29 ++--
 net/key/af_key.c                                      |    8 +-
 net/mac80211/cfg.c                                    |   21 ++-
 net/mac80211/iface.c                                  |    6 +
 net/mac80211/mlme.c                                   |   28 +++-
 net/mac80211/tx.c                                     |    3 +-
 net/netfilter/nf_conntrack_helper.c                   |   11 +-
 net/netfilter/nfnetlink.c                             |    7 +-
 net/netfilter/xt_AUDIT.c                              |    3 +
 net/netlabel/netlabel_unlabeled.c                     |   27 ++-
 net/rds/stats.c                                       |    1 +
 net/sched/sch_qfq.c                                   |   66 +++++---
 net/wireless/core.c                                   |    3 +-
 net/wireless/nl80211.c                                |   51 +++---
 84 files changed, 843 insertions(+), 696 deletions(-)

^ permalink raw reply

* Re: [PATCH net-next] cxgb4: Allow for backward compatibility with new VPD scheme.
From: David Miller @ 2013-03-11 11:41 UTC (permalink / raw)
  To: vipul; +Cc: netdev, divy, dm, abhishek, santosh
In-Reply-To: <513D7F58.1080807@chelsio.com>

From: Vipul Pandya <vipul@chelsio.com>
Date: Mon, 11 Mar 2013 12:23:12 +0530

> 
> 
> On 11-03-2013 12:00, David Miller wrote:
>> From: Vipul Pandya <vipul@chelsio.com>
>> Date: Mon, 11 Mar 2013 11:21:51 +0530
>> 
>>>
>>>
>>> On 08-03-2013 23:14, David Miller wrote:
>>>> From: Vipul Pandya <vipul@chelsio.com>
>>>> Date: Fri,  8 Mar 2013 19:05:29 +0530
>>>>
>>>>> From: Santosh Rastapur <santosh@chelsio.com>
>>>>>
>>>>> New scheme calls for 3rd party VPD at offset 0x0 and Chelsio VPD at offset
>>>>> 0x400 of the function.  If no 3rd party VPD is present, then a copy of
>>>>> Chelsio's VPD will be at offset 0x0 to keep in line with PCI spec which
>>>>> requires the VPD to be present at offset 0x0.
>>>>>
>>>>> Signed-off-by: Santosh Rastapur <santosh@chelsio.com>
>>>>> Signed-off-by: Vipul Pandya <vipul@chelsio.com>
>>>>
>>>> Isn't this a fix which is better targetted at 'net' than 'net-next'?
>>>>
>>>
>>> We have very soon new patch series coming up for net-next. This patch
>>> requires for that patch series to work correctly. So, we would like to
>>> get this merge in net-next tree.
>> 
>> But you can achieve that by asking me to apply this to 'net' and then
>> when the patch series that depends upon it is posted, you tell me about
>> this dependency.
>> 
> Ok. I was not aware of this. However there can be a merge conflict at
> the time of merging 'net' and 'net-next' tree if this patch gets applied
> in 'net' tree and our new patch series gets applied in 'net-next'. To
> avoid it we recommended the same. The merge conflict wont be a major and
> if it is alright to resolve it we can apply this patch to 'net' tree.

That's why you tell me to first pull net into net-next, and you send
me a patch set for net-next which assumes the fix from 'net' is
already applied.

^ permalink raw reply

* Re: [PATCHv2] net: can: af_can.c: Fix checkpatch warnings
From: David Miller @ 2013-03-11 11:40 UTC (permalink / raw)
  To: socketcan; +Cc: valentin.ilie, linux-can, netdev, linux-kernel
In-Reply-To: <513D8193.3080405@hartkopp.net>

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Mon, 11 Mar 2013 08:02:43 +0100

> On 10.03.2013 22:15, Valentin Ilie wrote:
> 
>> Replace printk(KERN_ERR with pr_err
>> Add space before {
>> Removed OOM messages
>> 
>> Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>
> 
> 
> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] netconsole: release the spinlock before __netpoll_cleanup()
From: Veaceslav Falico @ 2013-03-11 11:39 UTC (permalink / raw)
  To: Neil Horman; +Cc: Veaceslav Falico, David Miller, netdev, amwang
In-Reply-To: <20130311113024.GB12682@hmsreliant.think-freely.org>

On Mon, Mar 11, 2013 at 07:30:24AM -0400, Neil Horman wrote:
>On Mon, Mar 11, 2013 at 11:08:02AM +0100, Veaceslav Falico wrote:
>> On Sun, Mar 10, 2013 at 4:25 PM, Veaceslav Falico <vfalico@redhat.com> wrote:
>> > On Thu, Mar 07, 2013 at 04:14:38PM -0500, David Miller wrote:
>> >>
>> ...snip...
>> >> Quite a bit of email corruption of this patch.
>> >
>> >
>> > Sorry, somehow messed it.
>> >
>> >
>> >>
>> >> Also, this code block is probably too deeply indented to be sane,
>> >> consider creating a small helper function to call instead.
>> >
>> >
>> > It gets quite ugly if I try to move it to another function. However, maybe
>> > something like that will work - it's effectively the same code, just that
>> > I've moved the long part out of the if () { } block. Looks a lot more
>> > readable, though one line still breaks 80chars limit. I've reworked the
>> > subject/commit message too.
>> >
>> > Subject: [PATCH] netconsole: don't call __netpoll_cleanup() while atomic
>> >
>> > __netpoll_cleanup() is called in netconsole_netdev_event() while holding a
>> > spinlock. Release/acquire the spinlock before/after it and restart the
>> >
>> > loop.
>> >
>> > Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
>> > ---
>> >    drivers/net/netconsole.c |   22 +++++++++++++++-------
>> >    1 files changed, 15 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
>> > index 37add21..38eaa8c 100644
>> >
>> > --- a/drivers/net/netconsole.c
>> > +++ b/drivers/net/netconsole.c
>> > @@ -666,6 +666,7 @@ static int netconsole_netdev_event(struct notifier_block
>> > *this,
>> >                 goto done;
>> >         spin_lock_irqsave(&target_list_lock, flags);
>> > +restart:
>> >         list_for_each_entry(nt, &target_list, list) {
>> >                 netconsole_target_get(nt);
>> >                 if (nt->np.dev == dev) {
>> > @@ -679,14 +680,21 @@ static int netconsole_netdev_event(struct
>> > notifier_block *this,
>> >                                 /*
>> >
>> >                                  * rtnl_lock already held
>> >                                  */
>> > -                               if (nt->np.dev) {
>> > -                                       __netpoll_cleanup(&nt->np);
>> > -                                       dev_put(nt->np.dev);
>> > -                                       nt->np.dev = NULL;
>> > +                               if (!nt->np.dev) {
>> > +                                       nt->enabled = 0;
>> > +                                       stopped = true;
>> > +                                       break;
>> >                                 }
>> > -                               nt->enabled = 0;
>> > -                               stopped = true;
>> > -                               break;
>> > +                               /*
>> > +                                * we might sleep in __netpoll_cleanup()
>> > +                                */
>> > +                               spin_unlock_irqrestore(&target_list_lock,
>> > flags);
>> > +                               __netpoll_cleanup(&nt->np);
>> > +                               spin_lock_irqsave(&target_list_lock, flags);
>> > +                               dev_put(nt->np.dev);
>> > +                               nt->np.dev = NULL;
>> >
>> > +                               netconsole_target_put(nt);
>> > +                               goto restart;
>> >                         }
>> >                 }
>> >                 netconsole_target_put(nt);
>> > --
>> > 1.7.1
>>
>> Self-NAK this patch, I've triggered another kernel panic with it. Will
>> send another one shortly. Basicly, the whole if (!nt->np.dev) is not
>> needed and nt->enabled=0 should always be set, otherwise we
>> end up with nt->np.dev == NULL and nt->enabled == 1, thus
>> triggering panics in places like write_msg(), where it verifies only
>> if the nt->enabled is true.
>>
>Yup, I think you want to make the nt->enabled and stopped statements
>unconditional, and precedede the whole block with a if(!nt->np.dev) { continue;}
>statement.

I don't see why the statement is needed at all, if we verify it beforehand:

669         list_for_each_entry(nt, &target_list, list) {
670                 netconsole_target_get(nt);
671                 if (nt->np.dev == dev) {

so that effectively it can be null only in case the dev, delivered via
netconsole_netdev_event() is null, which is a bug by itself. Or am I
missing something?

>Neil
>
>> --
>> Best regards,
>> Veaceslav Falico
>>

^ permalink raw reply

* Re: [PATCH] netconsole: don't call __netpoll_cleanup() while atomic
From: Neil Horman @ 2013-03-11 11:38 UTC (permalink / raw)
  To: Veaceslav Falico; +Cc: netdev, amwang, davem
In-Reply-To: <1362997308-5834-1-git-send-email-vfalico@redhat.com>

On Mon, Mar 11, 2013 at 11:21:48AM +0100, Veaceslav Falico wrote:
> __netpoll_cleanup() is called in netconsole_netdev_event() while holding a
> spinlock. Release/acquire the spinlock before/after it and restart the
> loop. Also, disable the netconsole completely, because we won't have chance
> after the restart of the loop, and might end up in a situation where
> nt->enabled == 1 and nt->np.dev == NULL.
> 
> Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
> ---
>  drivers/net/netconsole.c |   15 +++++++++------
>  1 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> index 37add21..59ac143 100644
> --- a/drivers/net/netconsole.c
> +++ b/drivers/net/netconsole.c
> @@ -666,6 +666,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
>  		goto done;
>  
>  	spin_lock_irqsave(&target_list_lock, flags);
> +restart:
>  	list_for_each_entry(nt, &target_list, list) {
>  		netconsole_target_get(nt);
>  		if (nt->np.dev == dev) {
> @@ -678,15 +679,17 @@ static int netconsole_netdev_event(struct notifier_block *this,
>  			case NETDEV_UNREGISTER:
>  				/*
>  				 * rtnl_lock already held
> +				 * we might sleep in __netpoll_cleanup()
>  				 */
> -				if (nt->np.dev) {
> -					__netpoll_cleanup(&nt->np);
> -					dev_put(nt->np.dev);
> -					nt->np.dev = NULL;
> -				}
> +				spin_unlock_irqrestore(&target_list_lock, flags);
> +				__netpoll_cleanup(&nt->np);
> +				spin_lock_irqsave(&target_list_lock, flags);
> +				dev_put(nt->np.dev);
> +				nt->np.dev = NULL;
>  				nt->enabled = 0;
>  				stopped = true;
> -				break;
> +				netconsole_target_put(nt);
> +				goto restart;
>  			}
>  		}
>  		netconsole_target_put(nt);
> -- 
> 1.7.1
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

^ permalink raw reply

* Re: [PATCH] netconsole: release the spinlock before __netpoll_cleanup()
From: Neil Horman @ 2013-03-11 11:30 UTC (permalink / raw)
  To: Veaceslav Falico; +Cc: Veaceslav Falico, David Miller, netdev, amwang
In-Reply-To: <CAE3RKN=ix96skUHw3j5snbue-r8SOnSovw4_zh4RX4t-uDW2Cw@mail.gmail.com>

On Mon, Mar 11, 2013 at 11:08:02AM +0100, Veaceslav Falico wrote:
> On Sun, Mar 10, 2013 at 4:25 PM, Veaceslav Falico <vfalico@redhat.com> wrote:
> > On Thu, Mar 07, 2013 at 04:14:38PM -0500, David Miller wrote:
> >>
> ...snip...
> >> Quite a bit of email corruption of this patch.
> >
> >
> > Sorry, somehow messed it.
> >
> >
> >>
> >> Also, this code block is probably too deeply indented to be sane,
> >> consider creating a small helper function to call instead.
> >
> >
> > It gets quite ugly if I try to move it to another function. However, maybe
> > something like that will work - it's effectively the same code, just that
> > I've moved the long part out of the if () { } block. Looks a lot more
> > readable, though one line still breaks 80chars limit. I've reworked the
> > subject/commit message too.
> >
> > Subject: [PATCH] netconsole: don't call __netpoll_cleanup() while atomic
> >
> > __netpoll_cleanup() is called in netconsole_netdev_event() while holding a
> > spinlock. Release/acquire the spinlock before/after it and restart the
> >
> > loop.
> >
> > Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
> > ---
> >    drivers/net/netconsole.c |   22 +++++++++++++++-------
> >    1 files changed, 15 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> > index 37add21..38eaa8c 100644
> >
> > --- a/drivers/net/netconsole.c
> > +++ b/drivers/net/netconsole.c
> > @@ -666,6 +666,7 @@ static int netconsole_netdev_event(struct notifier_block
> > *this,
> >                 goto done;
> >         spin_lock_irqsave(&target_list_lock, flags);
> > +restart:
> >         list_for_each_entry(nt, &target_list, list) {
> >                 netconsole_target_get(nt);
> >                 if (nt->np.dev == dev) {
> > @@ -679,14 +680,21 @@ static int netconsole_netdev_event(struct
> > notifier_block *this,
> >                                 /*
> >
> >                                  * rtnl_lock already held
> >                                  */
> > -                               if (nt->np.dev) {
> > -                                       __netpoll_cleanup(&nt->np);
> > -                                       dev_put(nt->np.dev);
> > -                                       nt->np.dev = NULL;
> > +                               if (!nt->np.dev) {
> > +                                       nt->enabled = 0;
> > +                                       stopped = true;
> > +                                       break;
> >                                 }
> > -                               nt->enabled = 0;
> > -                               stopped = true;
> > -                               break;
> > +                               /*
> > +                                * we might sleep in __netpoll_cleanup()
> > +                                */
> > +                               spin_unlock_irqrestore(&target_list_lock,
> > flags);
> > +                               __netpoll_cleanup(&nt->np);
> > +                               spin_lock_irqsave(&target_list_lock, flags);
> > +                               dev_put(nt->np.dev);
> > +                               nt->np.dev = NULL;
> >
> > +                               netconsole_target_put(nt);
> > +                               goto restart;
> >                         }
> >                 }
> >                 netconsole_target_put(nt);
> > --
> > 1.7.1
> 
> Self-NAK this patch, I've triggered another kernel panic with it. Will
> send another one shortly. Basicly, the whole if (!nt->np.dev) is not
> needed and nt->enabled=0 should always be set, otherwise we
> end up with nt->np.dev == NULL and nt->enabled == 1, thus
> triggering panics in places like write_msg(), where it verifies only
> if the nt->enabled is true.
> 
Yup, I think you want to make the nt->enabled and stopped statements
unconditional, and precedede the whole block with a if(!nt->np.dev) { continue;}
statement.
Neil

> -- 
> Best regards,
> Veaceslav Falico
> 

^ permalink raw reply

* Re: TCP small packets throughput and multiqueue virtio-net
From: Michael S. Tsirkin @ 2013-03-11 11:29 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Jason Wang, netdev, KVM, David Miller, Stephen Hemminger, jpirko
In-Reply-To: <1362755115.15793.236.camel@edumazet-glaptop>

On Fri, Mar 08, 2013 at 07:05:15AM -0800, Eric Dumazet wrote:
> On Fri, 2013-03-08 at 14:24 +0800, Jason Wang wrote:
> > Hello all:
> > 
> > I meet an issue when testing multiqueue virtio-net. When I testing guest
> > small packets stream sending performance with netperf. I find an
> > regression of multiqueue. When I run 2 sessions of TCP_STREAM test with
> > 1024 byte from guest to local host, I get following result:
> > 
> > 1q result: 3457.64
> > 2q result: 7781.45
> > 
> > Statistics shows that: compared with one queue, multiqueue tends to send
> > much more but smaller packets. Tcpdump shows single queue has a much
> > higher possibility to produce a 64K gso packet compared to multiqueue.
> > More but smaller packets will cause more vmexits and interrupts which
> > lead a degradation on throughput.
> > 
> > Then problem only exist for small packets sending. When I test with
> > larger size, multiqueue will gradually outperfrom single queue. And
> > multiqueue also outperfrom in both TCP_RR and pktgen test (even with
> > small packets). The problem disappear when I turn off both gso and tso.
> > 
> 
> This makes little sense to me : TCP_RR workload (assuming one byte
> payload) cannot use GSO or TSO anyway. Same for pktgen as it uses UDP.
> 
> > I'm not sure whether it's a bug or expected since anyway we get
> > improvement on latency. And if it's a bug, I suspect it was related to
> > TCP GSO batching algorithm who tends to batch less in this situation. (
> > Jiri Pirko suspect it was the defect of virtio-net driver, but I didn't
> > find any obvious clue on this). After some experiments, I find the it
> > maybe related to tcp_tso_should_defer(), after
> > 1) change the tcp_tso_win_divisor to 1
> > 2) the following changes
> > the throughput were almost the same (but still a little worse) as single
> > queue:
> > 
> > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> > index fd0cea1..dedd2a6 100644
> > --- a/net/ipv4/tcp_output.c
> > +++ b/net/ipv4/tcp_output.c
> > @@ -1777,10 +1777,12 @@ static bool tcp_tso_should_defer(struct sock
> > *sk, struct sk_buff *skb)
> >  
> >         limit = min(send_win, cong_win);
> >  
> > +#if 0
> >         /* If a full-sized TSO skb can be sent, do it. */
> >         if (limit >= min_t(unsigned int, sk->sk_gso_max_size,
> >                            sk->sk_gso_max_segs * tp->mss_cache))
> >                 goto send_now;
> > +#endif
> >  
> >         /* Middle in queue won't get any more data, full sendable
> > already? */
> >         if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len))
> > 
> > Git history shows this check were added for both westwood and fasttcp,

Hmm yes,
http://www.mail-archive.com/netdev@vger.kernel.org/msg08738.html
How about we disable it for cubic,reno then?

> > I'm not familiar with tcp but looks like we can easily hit this check
> > under when multiqueue is enabled for virtio-net. Maybe I was wrong but I
> > wonder whether we can still do some batching here.
> > 
> > Any comments, thoughts are welcomed.
> > 
> 
> Well, the point is : if your app does write(1024) bytes, thats probably
> because it wants small packets from the very beginning. (See the TCP
> PUSH flag ?)

In that case the application typically won't have packets
in flight (e.g. like TCP_RR) so TSO won't trigger at all, no?

It would seem that packets in flight might rather indicate
that the application is trying to keep the socket buffer full
by giving the kernel data as fast as it becomes available.
At least, this is exactly what benchmark tools seem to be doing, right?

> If the transport is slow, TCP stack will automatically collapse several
> write into single skbs (assuming TSO or GSO is on), and you'll see big
> GSO packets with tcpdump [1]. So TCP will help you to get less overhead
> in this case.
> 
> But if transport is fast, you'll see small packets, and thats good for
> latency.

But is a large CWND really a good indicator of a low latency link?  Can't
CWND grow (depending on the protocol) as long as there's no packet loss
even if the latency is high?

So if a VM is using a 10G backend link in the host, it seems that (due
to vmexit overhead) the latency is high so we are not gaining much from
sending the packet a bit earlier, OTOH, the bandwidth is high so the
per packet overhead becomes measureable. Virt workloads are probably not
the only ones that are like that, it's just that it's easier for people
to observe the overhead.

> So my opinion is : its exactly behaving as expected.
> 
> If you want bigger packets either :
> - Make the application doing big write()
> - Slow the vmexit ;)
> 
> [1] GSO fools tcpdump : Actual packets sent to the wire are not 'big
> packets', but they hit dev_hard_start_xmit() as GSO packets.
> 

-- 
MST

^ permalink raw reply

* RE: be2net failed to initialize regression
From: Perla, Sathya @ 2013-03-11 11:07 UTC (permalink / raw)
  To: Gavin Shan, CAI Qian; +Cc: Ivan Vecera, LKML, netdev@vger.kernel.org
In-Reply-To: <20130311025451.GA6646@shangw.(null)>

> -----Original Message-----
> From: Gavin Shan [mailto:shangw@linux.vnet.ibm.com]
> >>
> >> Could you give me the FW version (ethtool -i) of the adapter (after
> >> be2net successfully probes in a 3.7 kernel.)
> >firmware-version: 2.104.281.0
> >>
> >> If the FW version is as old as 2.x, then the culprit commit that
> >> broke compatibility with old FW versions on some (BE2) chips I is:
> >> commit 1bc8e7e4f36c0c19dd7dea29e7c248b7c6ef3a15
> >> be2net: fix access to SEMAPHORE reg
> >>
> >> The fix for this is (still on David's net tree I guess):
> >> commit c5b3ad4c67989c778e4753be4f91dc7193a04d21
> >> be2net: use CSR-BAR SEMAPHORE reg for BE2/BE3
> 
> Sathya, the fix introduced to the following patch wouldn't be safe enough
> because it possiblly causes race condition: the f/w is resetted after detecting
> EEH errors and the f/w is far from ready yet. At that point, accessing CSR-BAR
> register would incur additional EEH error.
> Unfortunately, the corresponding PE (Partitioning Endpoint), to which the
> problematic adapter belongs, has been marked as frozen state. So the additional
> EEH error won't be recoverred at all. Eventually, it will lead to failure on
> resuming the adapter :-)

Gavin, the SEMAPHORE register is read/polled-on only in be_eeh_reset(), which
is called only after the adapter is reset. Why will this read incur an additional EEH error?

> 
> 
> be2net: use CSR-BAR SEMAPHORE reg for BE2/BE3
> 
> I'm thinking that we would still check POST status through PCI-CFG register and
> then ensure CSR-BAR on the problematic adapter is ready while resuming the
> adapter. That's just like what the patches I send do :-)

On BE2/BE3 chips, the PCI-CFG register cannot be relied on. As I mentioned in my
previous mails, it returns the wrong FW ready state.

^ permalink raw reply

* Re: Fwd: [PATCH] phydev: Add sysctl variable for polling interval of phy
From: Florian Fainelli @ 2013-03-11 10:45 UTC (permalink / raw)
  To: eunb.song; +Cc: netdev
In-Reply-To: <2566257.7001362959040495.JavaMail.weblogic@epv6ml10>

Hello,

On 03/11/2013 12:44 AM, EUNBONG SONG wrote:
>
>  From d55a22be52e5a768409aa0999d6636cdfc369676 Mon Sep 17 00:00:00 2001
> From: eunbonsong
> Date: Sun, 10 Mar 2013 04:57:39 -0700
> Subject: [PATCH] phydev: Add sysctl variable for polling interval of phy state
>
> This adds a dev.phy.phy_poll_interval sysctl variable. This value is represented in milliseconds.
> And phy_state_machine() is scheduled as this variable.
> I think HZ is enough for PC. But sometimes especially in network devices
> such as switches,routers, needs more granularity for detecting phy state change.

This patch should be submitted according to the rules described in: 
https://www.kernel.org/doc/Documentation/SubmittingPatches

Besides that, I do not think that a system-wide knob here is 
appropriate, you may rather introduce a new ethtool ioctl() to change 
the PHY device polling interval on a per-PHY device basis.

Having said that don't your devices support a dedicated PHY interrupt 
line? This would definitively be the way to get better latency with 
respect to PHY events reported back to the host.

>
>
> ---
> drivers/net/phy/phy.c        |    4 +++-
> drivers/net/phy/phy_device.c |   43 ++++++++++++++++++++++++++++++++++++++++++
> include/linux/phy.h          |    1 -
> 3 files changed, 46 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index ef9ea92..126a69f 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -42,6 +42,8 @@
> #include
> #include
>
> +extern unsigned long sysctl_phy_poll_interval;
> +
> /**
>    * phy_print_status - Convenience function to print out the current phy status
>    * @phydev: the phy_device struct
> @@ -966,7 +968,7 @@ void phy_state_machine(struct work_struct *work)
>          if (err < 0)
>                  phy_error(phydev);
>
> -       schedule_delayed_work(&phydev->state_queue, PHY_STATE_TIME * HZ);
> +       schedule_delayed_work(&phydev->state_queue, msecs_to_jiffies(sysctl_phy_poll_interval));
> }
>
> static inline void mmd_phy_indirect(struct mii_bus *bus, int prtad, int devad,
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 3657b4a..c2697e2 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -33,6 +33,7 @@
> #include
> #include
> #include
> +#include
>
> #include
> #include
> @@ -42,6 +43,45 @@ MODULE_DESCRIPTION("PHY library");
> MODULE_AUTHOR("Andy Fleming");
> MODULE_LICENSE("GPL");
>
> +unsigned long sysctl_phy_poll_interval = 1000;
> +static unsigned long min_phy_poll_interval = 1;
> +static unsigned long max_phy_poll_interval = 10000;

1 millisecond sounds like we are going to eat up a lot of CPU time 
polling PHY registers. Do you need that much reactivity?
--
Florian

^ permalink raw reply

* [PATCH] netconsole: don't call __netpoll_cleanup() while atomic
From: Veaceslav Falico @ 2013-03-11 10:21 UTC (permalink / raw)
  To: netdev; +Cc: amwang, davem, vfalico, nhorman

__netpoll_cleanup() is called in netconsole_netdev_event() while holding a
spinlock. Release/acquire the spinlock before/after it and restart the
loop. Also, disable the netconsole completely, because we won't have chance
after the restart of the loop, and might end up in a situation where
nt->enabled == 1 and nt->np.dev == NULL.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/net/netconsole.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 37add21..59ac143 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -666,6 +666,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
 		goto done;
 
 	spin_lock_irqsave(&target_list_lock, flags);
+restart:
 	list_for_each_entry(nt, &target_list, list) {
 		netconsole_target_get(nt);
 		if (nt->np.dev == dev) {
@@ -678,15 +679,17 @@ static int netconsole_netdev_event(struct notifier_block *this,
 			case NETDEV_UNREGISTER:
 				/*
 				 * rtnl_lock already held
+				 * we might sleep in __netpoll_cleanup()
 				 */
-				if (nt->np.dev) {
-					__netpoll_cleanup(&nt->np);
-					dev_put(nt->np.dev);
-					nt->np.dev = NULL;
-				}
+				spin_unlock_irqrestore(&target_list_lock, flags);
+				__netpoll_cleanup(&nt->np);
+				spin_lock_irqsave(&target_list_lock, flags);
+				dev_put(nt->np.dev);
+				nt->np.dev = NULL;
 				nt->enabled = 0;
 				stopped = true;
-				break;
+				netconsole_target_put(nt);
+				goto restart;
 			}
 		}
 		netconsole_target_put(nt);
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH] netconsole: release the spinlock before __netpoll_cleanup()
From: Veaceslav Falico @ 2013-03-11 10:08 UTC (permalink / raw)
  To: Veaceslav Falico; +Cc: David Miller, nhorman, netdev, amwang
In-Reply-To: <20130310152546.GA4897@redhat.com>

On Sun, Mar 10, 2013 at 4:25 PM, Veaceslav Falico <vfalico@redhat.com> wrote:
> On Thu, Mar 07, 2013 at 04:14:38PM -0500, David Miller wrote:
>>
...snip...
>> Quite a bit of email corruption of this patch.
>
>
> Sorry, somehow messed it.
>
>
>>
>> Also, this code block is probably too deeply indented to be sane,
>> consider creating a small helper function to call instead.
>
>
> It gets quite ugly if I try to move it to another function. However, maybe
> something like that will work - it's effectively the same code, just that
> I've moved the long part out of the if () { } block. Looks a lot more
> readable, though one line still breaks 80chars limit. I've reworked the
> subject/commit message too.
>
> Subject: [PATCH] netconsole: don't call __netpoll_cleanup() while atomic
>
> __netpoll_cleanup() is called in netconsole_netdev_event() while holding a
> spinlock. Release/acquire the spinlock before/after it and restart the
>
> loop.
>
> Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
> ---
>    drivers/net/netconsole.c |   22 +++++++++++++++-------
>    1 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> index 37add21..38eaa8c 100644
>
> --- a/drivers/net/netconsole.c
> +++ b/drivers/net/netconsole.c
> @@ -666,6 +666,7 @@ static int netconsole_netdev_event(struct notifier_block
> *this,
>                 goto done;
>         spin_lock_irqsave(&target_list_lock, flags);
> +restart:
>         list_for_each_entry(nt, &target_list, list) {
>                 netconsole_target_get(nt);
>                 if (nt->np.dev == dev) {
> @@ -679,14 +680,21 @@ static int netconsole_netdev_event(struct
> notifier_block *this,
>                                 /*
>
>                                  * rtnl_lock already held
>                                  */
> -                               if (nt->np.dev) {
> -                                       __netpoll_cleanup(&nt->np);
> -                                       dev_put(nt->np.dev);
> -                                       nt->np.dev = NULL;
> +                               if (!nt->np.dev) {
> +                                       nt->enabled = 0;
> +                                       stopped = true;
> +                                       break;
>                                 }
> -                               nt->enabled = 0;
> -                               stopped = true;
> -                               break;
> +                               /*
> +                                * we might sleep in __netpoll_cleanup()
> +                                */
> +                               spin_unlock_irqrestore(&target_list_lock,
> flags);
> +                               __netpoll_cleanup(&nt->np);
> +                               spin_lock_irqsave(&target_list_lock, flags);
> +                               dev_put(nt->np.dev);
> +                               nt->np.dev = NULL;
>
> +                               netconsole_target_put(nt);
> +                               goto restart;
>                         }
>                 }
>                 netconsole_target_put(nt);
> --
> 1.7.1

Self-NAK this patch, I've triggered another kernel panic with it. Will
send another one shortly. Basicly, the whole if (!nt->np.dev) is not
needed and nt->enabled=0 should always be set, otherwise we
end up with nt->np.dev == NULL and nt->enabled == 1, thus
triggering panics in places like write_msg(), where it verifies only
if the nt->enabled is true.

-- 
Best regards,
Veaceslav Falico

^ permalink raw reply

* Trying to implement secondary loopback
From: Thomas Martitz @ 2013-03-11  9:49 UTC (permalink / raw)
  To: netdev

Hello folks,

I'm Thomas Martitz, working on my Master Thesis: an Ethernet NIC. As 
part of my work I want to develop a custom loopback interface (for 
testing purposes).

However I'm facing a problem: It doesn't appear to be possible for a 
second loopback device to exist. Even when copying (and module'ifying) 
drivers/net/loopback.c the resulting device doesn't behave like the 
standard lo interface.

After examing the code I found this line (in loopback_net_init()):

loopback.c:206         net->loopback_dev = dev;

This suggests that the current network namespace can only have one 
loopback interface. And indeed after modifying my custom interface to 
include this particular line it begins to work, but obviously at the 
same time the standard lo interface stops working.

So my questions are:
* Is this on purpse/expected?
* Is there anyway around it so that I can have a custom loopback 
interface without touching lo's functionality.

Many thanks in advance.

Best regards.

-----
visit us at

CeBIT 2013 / March 5-9 / Hannover, Germany / hall 9, booth E08

OFC 2013 / March 19-21 / Anaheim Convention Center, CA, USA / booth 11807

www.hhi.fraunhofer.de/events

^ permalink raw reply

* Trying to implement secondary loopback
From: Thomas Martitz @ 2013-03-11  9:25 UTC (permalink / raw)
  To: netdev

Hello folks,

I'm Thomas Martitz, working on my Master Thesis: an Ethernet NIC. As 
part of my work I want to develop a custom loopback interface (for 
testing purposes).

However I'm facing a problem: It doesn't appear to be possible for a 
second loopback device to exist. Even when copying (and module'ifying) 
drivers/net/loopback.c the resulting device doesn't behave like the 
standard lo interface.

After examing the code I found this line (in loopback_net_init()):

loopback.c:206         net->loopback_dev = dev;

This suggests that the current network namespace can only have one 
loopback interface. And indeed after modifying my custom interface to 
include this particular line it begins to work, but obviously at the 
same time the standard lo interface stops working.

So my questions are:
* Is this on purpse/expected?
* Is there anyway around it so that I can have a custom loopback 
interface without touching lo's functionality.

Many thanks in advance.

Best regards.

-----
visit us at

CeBIT 2013 / March 5-9 / Hannover, Germany / hall 9, booth E08

OFC 2013 / March 19-21 / Anaheim Convention Center, CA, USA / booth 11807

www.hhi.fraunhofer.de/events

^ permalink raw reply

* Re: [net-next.git 2/9] stmmac: add IEEE 1588-2002 PTP support
From: Giuseppe CAVALLARO @ 2013-03-11  6:35 UTC (permalink / raw)
  To: Richard Cochran; +Cc: netdev, bh74.an, Rayagond K
In-Reply-To: <20130310122553.GA6407@netboy.at.omicron.at>

On 3/10/2013 1:25 PM, Richard Cochran wrote:
> On Fri, Mar 08, 2013 at 08:02:21AM +0100, Giuseppe CAVALLARO wrote:
>> On 3/8/2013 7:34 AM, Richard Cochran wrote:
>
>>>> +
>>>> +static int enh_desc_get_rx_timestamp_status(struct dma_desc *p)
>>>> +{
>>>> +	/* FIXME if Enhance descriptor with 8 DWORDS is enabled */
>>>
>>> Why not fix these FIXMEs for the next respin?
>>
>> This is fixed in the patch #5 where we use the extended descriptors
>> for PTP2.
>
> If possible, it is nice for the reviewers and for the logic of the
> patch series to order the changes so that these FIXMEs go away.
>
>>>> +	struct hwtstamp_config config;
>>>> +	struct timespec now;
>>>> +	u64 temp = 0;
>>>
>>> You add this new code here, but you change it all around again a few
>>> patches later. Please just submit the final, combined version.
>>
>> we kept these separately because the patch #5 (for example) depends on
>> another one that adds the extended descriptor support. Also If I add
>> all the code in a single patch this will be very big. I had some
>> problems to review all separately. So I suspect that if we merge all
>> in a single patch this will not help (especially myself). At any rate,
>> tell me if you prefer to have a single patch. I can do that.
>
> I am not asking for bigger patches. It is good to arrange your patches
> in small steps, since that makes both reviewing and bisecting easier.

I tried to do that :-(

>
> However, for brand new code, I find it quite annoying to read one
> patch, and then to have it all re-written in the next one. (If a new
> function *only* grows during a patch series, that is easy to follow.)
>
> So what I would like to see is a logical, understandable series of
> small steps, but when new code appears, it is the real, final form.

Ok, I'll try to better re-organize the patches in the next version.

Thx a lot
Peppe

>
> Thanks,
> Richard
> --
> 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

* [PATCH 2/2] phy/micrel: move flag handling to function for common use
From: Hector Palacios @ 2013-03-11  8:50 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, marex, davem, Hector Palacios
In-Reply-To: <1362991803-4610-1-git-send-email-hector.palacios@digi.com>

The flag MICREL_PHY_50MHZ_CLK is not of exclusive use of KSZ8051
model. At least KSZ8021 and KSZ8031 models also use it.
This patch moves the handling of this and future flags to a
separate function so that the different PHY models can call it on
their init function, if needed.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
---
 drivers/net/phy/micrel.c |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 1ab6743..6a0834b 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -48,6 +48,18 @@
 #define KS8737_CTRL_INT_ACTIVE_HIGH		(1 << 14)
 #define KSZ8051_RMII_50MHZ_CLK			(1 << 7)
 
+static int ksz_config_flags(struct phy_device *phydev)
+{
+	int regval;
+
+	if (phydev->dev_flags & MICREL_PHY_50MHZ_CLK) {
+		regval = phy_read(phydev, MII_KSZPHY_CTRL);
+		regval |= KSZ8051_RMII_50MHZ_CLK;
+		return phy_write(phydev, MII_KSZPHY_CTRL, regval);
+	}
+	return 0;
+}
+
 static int kszphy_ack_interrupt(struct phy_device *phydev)
 {
 	/* bit[7..0] int status, which is a read and clear register. */
@@ -109,22 +121,19 @@ static int kszphy_config_init(struct phy_device *phydev)
 
 static int ksz8021_config_init(struct phy_device *phydev)
 {
+	int rc;
 	const u16 val = KSZPHY_OMSO_B_CAST_OFF | KSZPHY_OMSO_RMII_OVERRIDE;
 	phy_write(phydev, MII_KSZPHY_OMSO, val);
-	return 0;
+	rc = ksz_config_flags(phydev);
+	return rc < 0 ? rc : 0;
 }
 
 static int ks8051_config_init(struct phy_device *phydev)
 {
-	int regval;
-
-	if (phydev->dev_flags & MICREL_PHY_50MHZ_CLK) {
-		regval = phy_read(phydev, MII_KSZPHY_CTRL);
-		regval |= KSZ8051_RMII_50MHZ_CLK;
-		phy_write(phydev, MII_KSZPHY_CTRL, regval);
-	}
+	int rc;
 
-	return 0;
+	rc = ksz_config_flags(phydev);
+	return rc < 0 ? rc : 0;
 }
 
 #define KSZ8873MLL_GLOBAL_CONTROL_4	0x06
-- 
1.7.9.5

^ 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