Netdev List
 help / color / mirror / Atom feed
* RE: [Pv-drivers] [PATCH] vmxnet3: remove unused variable
From: Bhavesh Davda @ 2011-06-13 17:10 UTC (permalink / raw)
  To: Neil Horman, netdev@vger.kernel.org; +Cc: VMware, Inc., David S. Miller
In-Reply-To: <1307980110-9585-1-git-send-email-nhorman@tuxdriver.com>

Good find. LGTM.

Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>

- Bhavesh
 
Bhavesh P. Davda

> -----Original Message-----
> From: pv-drivers-bounces@vmware.com [mailto:pv-drivers-bounces@vmware.com] On
> Behalf Of Neil Horman
> Sent: Monday, June 13, 2011 8:49 AM
> To: netdev@vger.kernel.org
> Cc: VMware, Inc.; David S. Miller; Neil Horman
> Subject: [Pv-drivers] [PATCH] vmxnet3: remove unused variable
> 
> While doing some backporting I noticed that vmxnet3 had a variable that was
> set
> but never used.  Get rid of it, and stop the compiler from griping
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: "VMware, Inc." <pv-drivers@vmware.com>
> CC: "David S. Miller" <davem@davemloft.net>
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c
> b/drivers/net/vmxnet3/vmxnet3_drv.c
> index fa6e2ac..a9b60a2 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -405,10 +405,8 @@ vmxnet3_tq_cleanup(struct vmxnet3_tx_queue *tq,
> 
>  	while (tq->tx_ring.next2comp != tq->tx_ring.next2fill) {
>  		struct vmxnet3_tx_buf_info *tbi;
> -		union Vmxnet3_GenericDesc *gdesc;
> 
>  		tbi = tq->buf_info + tq->tx_ring.next2comp;
> -		gdesc = tq->tx_ring.base + tq->tx_ring.next2comp;
> 
>  		vmxnet3_unmap_tx_buf(tbi, adapter->pdev);
>  		if (tbi->skb) {
> --
> 1.7.5.4
> 
> _______________________________________________
> Pv-drivers mailing list
> Pv-drivers@vmware.com
> http://mailman2.vmware.com/mailman/listinfo/pv-drivers

^ permalink raw reply

* [PATCH] vmxnet3: remove unused variable
From: Neil Horman @ 2011-06-13 15:48 UTC (permalink / raw)
  To: netdev; +Cc: Neil Horman, VMware, Inc., David S. Miller

While doing some backporting I noticed that vmxnet3 had a variable that was set
but never used.  Get rid of it, and stop the compiler from griping

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: "VMware, Inc." <pv-drivers@vmware.com>
CC: "David S. Miller" <davem@davemloft.net>
---
 drivers/net/vmxnet3/vmxnet3_drv.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index fa6e2ac..a9b60a2 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -405,10 +405,8 @@ vmxnet3_tq_cleanup(struct vmxnet3_tx_queue *tq,
 
 	while (tq->tx_ring.next2comp != tq->tx_ring.next2fill) {
 		struct vmxnet3_tx_buf_info *tbi;
-		union Vmxnet3_GenericDesc *gdesc;
 
 		tbi = tq->buf_info + tq->tx_ring.next2comp;
-		gdesc = tq->tx_ring.base + tq->tx_ring.next2comp;
 
 		vmxnet3_unmap_tx_buf(tbi, adapter->pdev);
 		if (tbi->skb) {
-- 
1.7.5.4


^ permalink raw reply related

* Re: [PATCH] net/usb: Add Samsung Kalmia driver for Samsung GT-B3730
From: Dan Williams @ 2011-06-13 15:19 UTC (permalink / raw)
  To: Marius Kotsbak
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Marius B. Kotsbak
In-Reply-To: <4DF62656.8060506-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Mon, 2011-06-13 at 17:01 +0200, Marius Kotsbak wrote:
> On 13. juni 2011 16:57, Dan Williams wrote:
> > On Sat, 2011-06-11 at 01:34 +0200, Marius B. Kotsbak wrote:
> >> Introducing driver for the network port of Samsung Kalmia based USB LTE modems.
> >> It has also an ACM interface that previous patches associates with the "option"
> >> module. To access those interfaces, the modem must first be switched from modem
> >> mode using a tool like usb_modeswitch.
> >>
> >> As the proprietary protocol has been discovered by watching the MS Windows driver
> >> behavior, there might be errors in the protocol handling, but stable and fast
> >> connection has been established for hours with Norwegian operator NetCom that
> >> distributes this modem with their LTE/4G subscription.
> > Why make the driver bind to both the switched and unswitched USB IDs?
> > Shouldn't the kernel bind the driver after switch when the device
> > reconnects with the new IDs?
> 
> No, I tried and it did not happen, so I assumed that the kernel modules
> are only loaded at USB insertion event, not when the interfaces changes.
> Does anyone here know if my observation is right?
> 
> Usb_modeswitch autoloads "option" module after switching, but not my
> kalmia module.

Try killing the modeswitch autoload thing first by moving the udev
script out of the way.  Then plug your device in, and run
"usb-modeswitch -c /path/to/config" so that the usb_modeswitch autoload
thing doesn't run.  Does that work?  I don't want to slander
usb_modeswitch but I've seen some odd behavior which I suspect is it's
module force-loading feature, though I haven't investigated too much
yet.  But ruling that out could be helpful.

Dan


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] net/usb: Add Samsung Kalmia driver for Samsung GT-B3730
From: Marius Kotsbak @ 2011-06-13 15:01 UTC (permalink / raw)
  To: Dan Williams
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Marius B. Kotsbak
In-Reply-To: <1307977039.2117.7.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>

On 13. juni 2011 16:57, Dan Williams wrote:
> On Sat, 2011-06-11 at 01:34 +0200, Marius B. Kotsbak wrote:
>> Introducing driver for the network port of Samsung Kalmia based USB LTE modems.
>> It has also an ACM interface that previous patches associates with the "option"
>> module. To access those interfaces, the modem must first be switched from modem
>> mode using a tool like usb_modeswitch.
>>
>> As the proprietary protocol has been discovered by watching the MS Windows driver
>> behavior, there might be errors in the protocol handling, but stable and fast
>> connection has been established for hours with Norwegian operator NetCom that
>> distributes this modem with their LTE/4G subscription.
> Why make the driver bind to both the switched and unswitched USB IDs?
> Shouldn't the kernel bind the driver after switch when the device
> reconnects with the new IDs?

No, I tried and it did not happen, so I assumed that the kernel modules
are only loaded at USB insertion event, not when the interfaces changes.
Does anyone here know if my observation is right?

Usb_modeswitch autoloads "option" module after switching, but not my
kalmia module.

--
Marius


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] net/usb: Add Samsung Kalmia driver for Samsung GT-B3730
From: Dan Williams @ 2011-06-13 14:57 UTC (permalink / raw)
  To: Marius B. Kotsbak
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Marius B. Kotsbak
In-Reply-To: <1307748870-12950-1-git-send-email-marius-iy5w9mehe2BBDgjK7y7TUQ@public.gmane.org>

On Sat, 2011-06-11 at 01:34 +0200, Marius B. Kotsbak wrote:
> Introducing driver for the network port of Samsung Kalmia based USB LTE modems.
> It has also an ACM interface that previous patches associates with the "option"
> module. To access those interfaces, the modem must first be switched from modem
> mode using a tool like usb_modeswitch.
> 
> As the proprietary protocol has been discovered by watching the MS Windows driver
> behavior, there might be errors in the protocol handling, but stable and fast
> connection has been established for hours with Norwegian operator NetCom that
> distributes this modem with their LTE/4G subscription.

Why make the driver bind to both the switched and unswitched USB IDs?
Shouldn't the kernel bind the driver after switch when the device
reconnects with the new IDs?

Dan

> More and updated information about how to use this driver is available here:
> 
> http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=465
> https://github.com/mkotsbak/Samsung-GT-B3730-linux-driver
> 
> Signed-off-by: Marius B. Kotsbak <marius-iy5w9mehe2BBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/net/usb/Kconfig  |   10 ++
>  drivers/net/usb/Makefile |    2 +-
>  drivers/net/usb/kalmia.c |  393 ++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 404 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/net/usb/kalmia.c
> 
> diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
> index 9d4f911..b6e4efc 100644
> --- a/drivers/net/usb/Kconfig
> +++ b/drivers/net/usb/Kconfig
> @@ -385,6 +385,16 @@ config USB_NET_CX82310_ETH
>  	  router with USB ethernet port. This driver is for routers only,
>  	  it will not work with ADSL modems (use cxacru driver instead).
>  
> +config CONFIG_USB_NET_KALMIA
> +	tristate "Samsung Kalmia based LTE USB modem"
> +	depends on USB_USBNET
> +	help
> +	  Choose this option if you have a Samsung Kalmia based USB modem
> +	  as Samsung GT-B3730.
> +
> +	  To compile this driver as a module, choose M here: the
> +	  module will be called kalmia.
> +
>  config USB_HSO
>  	tristate "Option USB High Speed Mobile Devices"
>  	depends on USB && RFKILL
> diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
> index c7ec8a5..6091249 100644
> --- a/drivers/net/usb/Makefile
> +++ b/drivers/net/usb/Makefile
> @@ -28,4 +28,4 @@ obj-$(CONFIG_USB_SIERRA_NET)	+= sierra_net.o
>  obj-$(CONFIG_USB_NET_CX82310_ETH)	+= cx82310_eth.o
>  obj-$(CONFIG_USB_NET_CDC_NCM)	+= cdc_ncm.o
>  obj-$(CONFIG_USB_VL600)		+= lg-vl600.o
> -
> +obj-$(CONFIG_USB_NET_KALMIA)	+= kalmia.o
> diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c
> new file mode 100644
> index 0000000..d1e80e0
> --- /dev/null
> +++ b/drivers/net/usb/kalmia.c
> @@ -0,0 +1,393 @@
> +/*
> + * USB network interface driver for Samsung Kalmia based LTE USB modem like the
> + * Samsung GT-B3730 and GT-B3710.
> + *
> + * Copyright (C) 2011 Marius Bjoernstad Kotsbak
> + *
> + * Sponsored by Quicklink Video Distribution Services Ltd.
> + *
> + * Based on the cdc_eem module.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> + */
> +
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/netdevice.h>
> +#include <linux/etherdevice.h>
> +#include <linux/ctype.h>
> +#include <linux/ethtool.h>
> +#include <linux/workqueue.h>
> +#include <linux/mii.h>
> +#include <linux/usb.h>
> +#include <linux/crc32.h>
> +#include <linux/usb/cdc.h>
> +#include <linux/usb/usbnet.h>
> +#include <linux/gfp.h>
> +
> +/*
> + * The Samsung Kalmia based LTE USB modems have a CDC ACM port for modem control
> + * handled by the "option" module and an ethernet data port handled by this
> + * module.
> + *
> + * The stick must first be switched into modem mode by usb_modeswitch
> + * or similar tool. Then the modem gets sent two initialization packets by
> + * this module, which gives the MAC address of the device. User space can then
> + * connect the modem using AT commands through the ACM port and then use
> + * DHCP on the network interface exposed by this module. Network packets are
> + * sent to and from the modem in a proprietary format discovered after watching
> + * the behavior of the windows driver for the modem.
> + *
> + * More information about the use of the modem is available in usb_modeswitch
> + * forum and the project page:
> + *
> + * http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=465
> + * https://github.com/mkotsbak/Samsung-GT-B3730-linux-driver
> + */
> +
> +/* #define	DEBUG */
> +/* #define	VERBOSE */
> +
> +#define KALMIA_HEADER_LENGTH 6
> +#define KALMIA_ALIGN_SIZE 4
> +#define KALMIA_USB_TIMEOUT 10000
> +
> +/*-------------------------------------------------------------------------*/
> +
> +static int
> +kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len,
> +	u8 *buffer, u8 expected_len)
> +{
> +	int act_len;
> +	int status;
> +
> +	netdev_dbg(dev->net, "Sending init packet");
> +
> +	status = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 0x02),
> +		init_msg, init_msg_len, &act_len, KALMIA_USB_TIMEOUT);
> +	if (status != 0) {
> +		netdev_err(dev->net,
> +			"Error sending init packet. Status %i, length %i\n",
> +			status, act_len);
> +		return status;
> +	}
> +	else if (act_len != init_msg_len) {
> +		netdev_err(dev->net,
> +			"Did not send all of init packet. Bytes sent: %i",
> +			act_len);
> +	}
> +	else {
> +		netdev_dbg(dev->net, "Successfully sent init packet.");
> +	}
> +
> +	status = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, 0x81),
> +		buffer, expected_len, &act_len, KALMIA_USB_TIMEOUT);
> +
> +	if (status != 0)
> +		netdev_err(dev->net,
> +			"Error receiving init result. Status %i, length %i\n",
> +			status, act_len);
> +	else if (act_len != expected_len)
> +		netdev_err(dev->net, "Unexpected init result length: %i\n",
> +			act_len);
> +
> +	return status;
> +}
> +
> +static int
> +kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr)
> +{
> +	char init_msg_1[] =
> +		{ 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
> +		0x00, 0x00 };
> +	char init_msg_2[] =
> +		{ 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4,
> +		0x00, 0x00 };
> +	char receive_buf[28];
> +	int status;
> +
> +	status = kalmia_send_init_packet(dev, init_msg_1, sizeof(init_msg_1)
> +		/ sizeof(init_msg_1[0]), receive_buf, 24);
> +	if (status != 0)
> +		return status;
> +
> +	status = kalmia_send_init_packet(dev, init_msg_2, sizeof(init_msg_2)
> +		/ sizeof(init_msg_2[0]), receive_buf, 28);
> +	if (status != 0)
> +		return status;
> +
> +	memcpy(ethernet_addr, receive_buf + 10, ETH_ALEN);
> +
> +	return status;
> +}
> +
> +static int
> +kalmia_bind(struct usbnet *dev, struct usb_interface *intf)
> +{
> +	u8 status;
> +	u8 ethernet_addr[ETH_ALEN];
> +
> +	/* Don't bind to AT command interface */
> +	if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
> +		return -EINVAL;
> +
> +	dev->in = usb_rcvbulkpipe(dev->udev, 0x81 & USB_ENDPOINT_NUMBER_MASK);
> +	dev->out = usb_sndbulkpipe(dev->udev, 0x02 & USB_ENDPOINT_NUMBER_MASK);
> +	dev->status = NULL;
> +
> +	dev->net->hard_header_len += KALMIA_HEADER_LENGTH;
> +	dev->hard_mtu = 1400;
> +	dev->rx_urb_size = dev->hard_mtu * 10; // Found as optimal after testing
> +
> +	status = kalmia_init_and_get_ethernet_addr(dev, ethernet_addr);
> +
> +	if (status < 0) {
> +		usb_set_intfdata(intf, NULL);
> +		usb_driver_release_interface(driver_of(intf), intf);
> +		return status;
> +	}
> +
> +	memcpy(dev->net->dev_addr, ethernet_addr, ETH_ALEN);
> +	memcpy(dev->net->perm_addr, ethernet_addr, ETH_ALEN);
> +
> +	return status;
> +}
> +
> +static struct sk_buff *
> +kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
> +{
> +	struct sk_buff *skb2 = NULL;
> +	u16 content_len;
> +	unsigned char *header_start;
> +	unsigned char ether_type_1, ether_type_2;
> +	u8 remainder, padlen = 0;
> +
> +	if (!skb_cloned(skb)) {
> +		int headroom = skb_headroom(skb);
> +		int tailroom = skb_tailroom(skb);
> +
> +		if ((tailroom >= KALMIA_ALIGN_SIZE) && (headroom
> +			>= KALMIA_HEADER_LENGTH))
> +			goto done;
> +
> +		if ((headroom + tailroom) > (KALMIA_HEADER_LENGTH
> +			+ KALMIA_ALIGN_SIZE)) {
> +			skb->data = memmove(skb->head + KALMIA_HEADER_LENGTH,
> +				skb->data, skb->len);
> +			skb_set_tail_pointer(skb, skb->len);
> +			goto done;
> +		}
> +	}
> +
> +	skb2 = skb_copy_expand(skb, KALMIA_HEADER_LENGTH,
> +		KALMIA_ALIGN_SIZE, flags);
> +	if (!skb2)
> +		return NULL;
> +
> +	dev_kfree_skb_any(skb);
> +	skb = skb2;
> +
> +	done: header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
> +	ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12];
> +	ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13];
> +
> +	netdev_dbg(dev->net, "Sending etherType: %02x%02x", ether_type_1,
> +		ether_type_2);
> +
> +	/* According to empiric data for data packages */
> +	header_start[0] = 0x57;
> +	header_start[1] = 0x44;
> +	content_len = skb->len - KALMIA_HEADER_LENGTH;
> +	header_start[2] = (content_len & 0xff); /* low byte */
> +	header_start[3] = (content_len >> 8); /* high byte */
> +
> +	header_start[4] = ether_type_1;
> +	header_start[5] = ether_type_2;
> +
> +	/* Align to 4 bytes by padding with zeros */
> +	remainder = skb->len % KALMIA_ALIGN_SIZE;
> +	if (remainder > 0) {
> +		padlen = KALMIA_ALIGN_SIZE - remainder;
> +		memset(skb_put(skb, padlen), 0, padlen);
> +	}
> +
> +	netdev_dbg(
> +		dev->net,
> +		"Sending package with length %i and padding %i. Header: %02x:%02x:%02x:%02x:%02x:%02x.",
> +		content_len, padlen, header_start[0], header_start[1],
> +		header_start[2], header_start[3], header_start[4],
> +		header_start[5]);
> +
> +	return skb;
> +}
> +
> +static int
> +kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
> +{
> +	/*
> +	 * Our task here is to strip off framing, leaving skb with one
> +	 * data frame for the usbnet framework code to process.
> +	 */
> +	const u8 HEADER_END_OF_USB_PACKET[] =
> +		{ 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 };
> +	const u8 EXPECTED_UNKNOWN_HEADER_1[] =
> +		{ 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 };
> +	const u8 EXPECTED_UNKNOWN_HEADER_2[] =
> +		{ 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 };
> +	u8 i = 0;
> +
> +	/* incomplete header? */
> +	if (skb->len < KALMIA_HEADER_LENGTH)
> +		return 0;
> +
> +	do {
> +		struct sk_buff *skb2 = NULL;
> +		u8 *header_start;
> +		u16 usb_packet_length, ether_packet_length;
> +		int is_last;
> +
> +		header_start = skb->data;
> +
> +		if (unlikely(header_start[0] != 0x57 || header_start[1] != 0x44)) {
> +			if (!memcmp(header_start, EXPECTED_UNKNOWN_HEADER_1,
> +				sizeof(EXPECTED_UNKNOWN_HEADER_1)) || !memcmp(
> +				header_start, EXPECTED_UNKNOWN_HEADER_2,
> +				sizeof(EXPECTED_UNKNOWN_HEADER_2))) {
> +				netdev_dbg(
> +					dev->net,
> +					"Received expected unknown frame header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n",
> +					header_start[0], header_start[1],
> +					header_start[2], header_start[3],
> +					header_start[4], header_start[5],
> +					skb->len - KALMIA_HEADER_LENGTH);
> +			}
> +			else {
> +				netdev_err(
> +					dev->net,
> +					"Received unknown frame header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n",
> +					header_start[0], header_start[1],
> +					header_start[2], header_start[3],
> +					header_start[4], header_start[5],
> +					skb->len - KALMIA_HEADER_LENGTH);
> +				return 0;
> +			}
> +		}
> +		else
> +			netdev_dbg(
> +				dev->net,
> +				"Received header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n",
> +				header_start[0], header_start[1], header_start[2],
> +				header_start[3], header_start[4], header_start[5],
> +				skb->len - KALMIA_HEADER_LENGTH);
> +
> +		/* subtract start header and end header */
> +		usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH);
> +		ether_packet_length = header_start[2] + (header_start[3] << 8);
> +		skb_pull(skb, KALMIA_HEADER_LENGTH);
> +
> +		/* Some small packets misses end marker */
> +		if (usb_packet_length < ether_packet_length) {
> +			ether_packet_length = usb_packet_length
> +				+ KALMIA_HEADER_LENGTH;
> +			is_last = true;
> +		}
> +		else {
> +			netdev_dbg(dev->net, "Correct package length #%i", i
> +				+ 1);
> +
> +			is_last = (memcmp(skb->data + ether_packet_length,
> +				HEADER_END_OF_USB_PACKET,
> +				sizeof(HEADER_END_OF_USB_PACKET)) == 0);
> +			if (!is_last) {
> +				header_start = skb->data + ether_packet_length;
> +				netdev_dbg(
> +					dev->net,
> +					"End header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n",
> +					header_start[0], header_start[1],
> +					header_start[2], header_start[3],
> +					header_start[4], header_start[5],
> +					skb->len - KALMIA_HEADER_LENGTH);
> +			}
> +		}
> +
> +		if (is_last) {
> +			skb2 = skb;
> +		}
> +		else {
> +			skb2 = skb_clone(skb, GFP_ATOMIC);
> +			if (unlikely(!skb2))
> +				return 0;
> +		}
> +
> +		skb_trim(skb2, ether_packet_length);
> +
> +		if (is_last) {
> +			return 1;
> +		}
> +		else {
> +			usbnet_skb_return(dev, skb2);
> +			skb_pull(skb, ether_packet_length);
> +		}
> +
> +		i++;
> +	}
> +	while (skb->len);
> +
> +	return 1;
> +}
> +
> +static const struct driver_info kalmia_info = {
> +	.description = "Samsung Kalmia LTE USB dongle",
> +	.flags = FLAG_WWAN,
> +	.bind = kalmia_bind,
> +	.rx_fixup = kalmia_rx_fixup,
> +	.tx_fixup = kalmia_tx_fixup
> +};
> +
> +/*-------------------------------------------------------------------------*/
> +
> +static const struct usb_device_id products[] = {
> +	/* The unswitched USB ID, to get the module auto loaded: */
> +	{ USB_DEVICE(0x04e8, 0x689a) },
> +	/* The stick swithed into modem (by e.g. usb_modeswitch): */
> +	{ USB_DEVICE(0x04e8, 0x6889),
> +		.driver_info = (unsigned long) &kalmia_info, },
> +	{ /* EMPTY == end of list */} };
> +MODULE_DEVICE_TABLE( usb, products);
> +
> +static struct usb_driver kalmia_driver = {
> +	.name = "kalmia",
> +	.id_table = products,
> +	.probe = usbnet_probe,
> +	.disconnect = usbnet_disconnect,
> +	.suspend = usbnet_suspend,
> +	.resume = usbnet_resume
> +};
> +
> +static int __init kalmia_init(void)
> +{
> +	return usb_register(&kalmia_driver);
> +}
> +module_init( kalmia_init);
> +
> +static void __exit kalmia_exit(void)
> +{
> +	usb_deregister(&kalmia_driver);
> +}
> +module_exit( kalmia_exit);
> +
> +MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius-iy5w9mehe2BBDgjK7y7TUQ@public.gmane.org>");
> +MODULE_DESCRIPTION("Samsung Kalmia USB network driver");
> +MODULE_LICENSE("GPL");


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] net/r8169: Update the new parser for the new firmware
From: Francois Romieu @ 2011-06-13 14:32 UTC (permalink / raw)
  To: Hayes Wang; +Cc: netdev, linux-kernel
In-Reply-To: <1307956594-1248-1-git-send-email-hayeswang@realtek.com>

Hayes Wang <hayeswang@realtek.com> :
> Update the parser for the new firmware which is embedded some information.
> The paser cannot be used for the old firmware. It is only for the new type one.

> 
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
>  drivers/net/r8169.c |   59 ++++++++++++++++++++++++++++----------------------
>  1 files changed, 33 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
> index ef1ce2e..87b684f 100644
> --- a/drivers/net/r8169.c
> +++ b/drivers/net/r8169.c
> @@ -36,11 +36,11 @@
>  #define MODULENAME "r8169"
>  #define PFX MODULENAME ": "
>  
> -#define FIRMWARE_8168D_1	"rtl_nic/rtl8168d-1.fw"
> -#define FIRMWARE_8168D_2	"rtl_nic/rtl8168d-2.fw"
> -#define FIRMWARE_8168E_1	"rtl_nic/rtl8168e-1.fw"
> -#define FIRMWARE_8168E_2	"rtl_nic/rtl8168e-2.fw"
> -#define FIRMWARE_8105E_1	"rtl_nic/rtl8105e-1.fw"
> +#define FIRMWARE_8168D_1	"rtl_nic/rtl8168d-3.fw"
> +#define FIRMWARE_8168D_2	"rtl_nic/rtl8168d-4.fw"
> +#define FIRMWARE_8168E_1	"rtl_nic/rtl8168e-3.fw"
> +#define FIRMWARE_8168E_2	"rtl_nic/rtl8168e-4.fw"
> +#define FIRMWARE_8105E_1	"rtl_nic/rtl8105e-2.fw"

Why ?

I see it more as a calling convention to communicate with userspace
than as a place to funnel a partial version information.

>  #ifdef RTL8169_DEBUG
>  #define assert(expr) \
> @@ -594,6 +594,13 @@ struct ring_info {
>  	u8		__pad[sizeof(void *) - sizeof(u32)];
>  };
>  
> +struct fw_info {
> +	char	version[32];
> +	u32	fw_start;
> +	u32	fw_len;
> +	u8	chksum;

The chksum field is never used.

[...]
> @@ -1743,16 +1750,30 @@ static void rtl_writephy_batch(struct rtl8169_private *tp,
>  static void
>  rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
>  {
> -	__le32 *phytable = (__le32 *)fw->data;
> +	__le32 *phytable;
>  	struct net_device *dev = tp->dev;
> -	size_t index, fw_size = fw->size / sizeof(*phytable);
> +	struct fw_info *f_info;
> +	size_t index, fw_size;

s/index/i/

>  	u32 predata, count;
> +	u8 checksum;
> +
> +	f_info = (struct fw_info *)fw->data;

It will not work very well on big-endian computers. start and len should
both use le32_to_cpu.

>  
> -	if (fw->size % sizeof(*phytable)) {
> -		netif_err(tp, probe, dev, "odd sized firmware %zd\n", fw->size);
> +	if (checksum != 0) {
> +		netif_err(tp, probe, dev, "none zero checksum(%u)\n", checksum);
>  		return;
>  	}

Nit: "checksum" is not used beyond this point. It should be possible to put
a few things in distinct functions to save some local variables.

> +	netif_info(tp, probe, dev, "firmware: %s\n", f_info->version);
> +
> +	phytable = (__le32 *)(fw->data + f_info->fw_start);
> +	fw_size = f_info->fw_len;
> +
>  	for (index = 0; index < fw_size; index++) {

It's a bit paranoid but I would feel safer if f_info->fw_len was compared
to fw->size beforehand.

[...]
> @@ -1892,14 +1913,6 @@ static void rtl_apply_firmware(struct rtl8169_private *tp)
>  		rtl_phy_write_fw(tp, fw);
>  }
>  
> -static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
> -{
> -	if (rtl_readphy(tp, reg) != val)
> -		netif_warn(tp, hw, tp->dev, "chipset not ready for firmware\n");
> -	else
> -		rtl_apply_firmware(tp);
> -}
> -
>  static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
>  {
>  	static const struct phy_reg phy_reg_init[] = {
> @@ -2334,10 +2347,7 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
>  	rtl_w1w0_phy(tp, 0x02, 0x0100, 0x0600);
>  	rtl_w1w0_phy(tp, 0x03, 0x0000, 0xe000);
>  
> -	rtl_writephy(tp, 0x1f, 0x0005);
> -	rtl_writephy(tp, 0x05, 0x001b);
> -
> -	rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xbf00);
> +	rtl_apply_firmware(tp);
>  
>  	rtl_writephy(tp, 0x1f, 0x0000);
>  }
> @@ -2437,10 +2447,7 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
>  	rtl_writephy(tp, 0x1f, 0x0002);
>  	rtl_patchphy(tp, 0x0f, 0x0017);
>  
> -	rtl_writephy(tp, 0x1f, 0x0005);
> -	rtl_writephy(tp, 0x05, 0x001b);
> -
> -	rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xb300);
> +	rtl_apply_firmware(tp);

Actually both the format and the content of the firmware are changed by the
patch.

Imho the new firmware format could include some specific string so that the
driver can identify the new firmware format and fallback to the old format
otherwise. Any fixed magic prefix would be enough as the new format mandates
the version information.

This way Linus's test machine won't risk of breaking (again...) if he builds
a new kernel without updating the firmware at the same time.

-- 
Ueimor

^ permalink raw reply

* Re: [PATCH 1/5] iwlegacy: remove unreachable code
From: Stanislaw Gruszka @ 2011-06-13 14:39 UTC (permalink / raw)
  To: Greg Dietsche
  Cc: linville, kernel-janitors, linux-wireless, netdev, linux-kernel
In-Reply-To: <4DF61E7E.908@cuw.edu>

On Mon, Jun 13, 2011 at 09:28:14AM -0500, Greg Dietsche wrote:
> On 06/02/2011 09:06 PM, Greg Dietsche wrote:
> >return; at the end of the function is unecessary.
> >
> >Signed-off-by: Greg Dietsche<Gregory.Dietsche@cuw.edu>
> >---
> >  drivers/net/wireless/iwlegacy/iwl-eeprom.c |    1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
> >
> >diff --git a/drivers/net/wireless/iwlegacy/iwl-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
> >index cb346d1..5bf3f49 100644
> >--- a/drivers/net/wireless/iwlegacy/iwl-eeprom.c
> >+++ b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
> >@@ -316,7 +316,6 @@ static void iwl_legacy_init_band_reference(const struct iwl_priv *priv,
> >  		break;
> >  	default:
> >  		BUG();
> >-		return;
> >  	}
> >  }
> >
> 
> any comments/reviews/acks on this patch series?

All 5 patches are applied in wireless-testing tree.

Thanks
Stanislaw

^ permalink raw reply

* [PATCH] bonding:delete a dereference before check
From: Weiping Pan @ 2011-06-13 14:30 UTC (permalink / raw)
  To: error27
  Cc: Weiping Pan, Jay Vosburgh, Andy Gospodarek,
	open list:BONDING DRIVER, open list
In-Reply-To: <20110611081214.GA21427@shale.localdomain>

Dan Carpenter found that there was a dereference before a check,
added in 56d00c677de0(bonding:delete lacp_fast from ad_bond_info).

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 drivers/net/bonding/bond_3ad.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 6122725..77da2e8 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1900,7 +1900,6 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
 int bond_3ad_bind_slave(struct slave *slave)
 {
 	struct bonding *bond = bond_get_bond_by_slave(slave);
-	int lacp_fast = bond->params.lacp_fast;
 	struct port *port;
 	struct aggregator *aggregator;
 
@@ -1916,7 +1915,7 @@ int bond_3ad_bind_slave(struct slave *slave)
 		// port initialization
 		port = &(SLAVE_AD_INFO(slave).port);
 
-		ad_initialize_port(port, lacp_fast);
+		ad_initialize_port(port, bond->params.lacp_fast);
 
 		port->slave = slave;
 		port->actor_port_number = SLAVE_AD_INFO(slave).id;
-- 
1.7.4.4

^ permalink raw reply related

* Re: [PATCH 1/5] iwlegacy: remove unreachable code
From: Greg Dietsche @ 2011-06-13 14:28 UTC (permalink / raw)
  To: sgruszka, linville
  Cc: Greg Dietsche, kernel-janitors, linux-wireless, netdev,
	linux-kernel
In-Reply-To: <1307066770-27309-1-git-send-email-Gregory.Dietsche@cuw.edu>

On 06/02/2011 09:06 PM, Greg Dietsche wrote:
> return; at the end of the function is unecessary.
>
> Signed-off-by: Greg Dietsche<Gregory.Dietsche@cuw.edu>
> ---
>   drivers/net/wireless/iwlegacy/iwl-eeprom.c |    1 -
>   1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlegacy/iwl-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
> index cb346d1..5bf3f49 100644
> --- a/drivers/net/wireless/iwlegacy/iwl-eeprom.c
> +++ b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
> @@ -316,7 +316,6 @@ static void iwl_legacy_init_band_reference(const struct iwl_priv *priv,
>   		break;
>   	default:
>   		BUG();
> -		return;
>   	}
>   }
>
>    

any comments/reviews/acks on this patch series?

thanks,
Greg

^ permalink raw reply

* Re: [PATCHv2 RFC 0/4] virtio and vhost-net capacity handling
From: Krishna Kumar2 @ 2011-06-13 13:44 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: habanero-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	lguest-uLR06cmDAlY/bJ5BZ2RsiQ, Shirley Ma,
	kvm-u79uwXL29TY76Z2rM5mHXA, Carsten Otte,
	linux-s390-u79uwXL29TY76Z2rM5mHXA, Heiko Carstens,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	steved-r/Jw6+rmf7HQT0dZR+AlfA, Christian Borntraeger,
	Tom Lendacky, netdev-u79uwXL29TY76Z2rM5mHXA, Martin Schwidefsky,
	linux390-tA70FqPdS9bQT0dZR+AlfA
In-Reply-To: <20110613133513.GA29884-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

"Michael S. Tsirkin" <mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote on 06/13/2011 07:05:13 PM:

> > I ran the latest patches with 1K I/O (guest->local host) and
> > the results are (60 sec run for each test case):
>
> Hi!
> Did you apply this one:
> [PATCHv2 RFC 4/4] Revert "virtio: make add_buf return capacity remaining"
> ?
>
> It turns out that that patch has a bug and should be reverted,
> only patches 1-3 should be applied.
>
> Could you confirm please?

No, I didn't apply that patch. I had also seen your mail
earlier on this patch breaking receive buffer processing
if applied.

thanks,

- KK

^ permalink raw reply

* Re: [PATCHv2 RFC 0/4] virtio and vhost-net capacity handling
From: Krishna Kumar2 @ 2011-06-13 13:38 UTC (permalink / raw)
  To: Krishna Kumar2
  Cc: habanero-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	lguest-uLR06cmDAlY/bJ5BZ2RsiQ, Shirley Ma,
	kvm-u79uwXL29TY76Z2rM5mHXA, Carsten Otte,
	linux-s390-u79uwXL29TY76Z2rM5mHXA, Michael S. Tsirkin,
	Heiko Carstens, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-owner-u79uwXL29TY76Z2rM5mHXA,
	steved-r/Jw6+rmf7HQT0dZR+AlfA, Christian Borntraeger,
	Tom Lendacky, netdev-u79uwXL29TY76Z2rM5mHXA, Martin Schwidefsky,
	linux390-tA70FqPdS9bQT0dZR+AlfA,
	virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
In-Reply-To: <OFE36F9C2B.43D9DB04-ON652578AE.0048E1AB-652578AE.004A1462-xthvdsQ13ZrQT0dZR+AlfA@public.gmane.org>

> Krishna Kumar2/India/IBM@IBMIN wrote on 06/13/2011 07:02:27 PM:

...

> With 16K, there was an improvement in SD, but
> higher sessions seem to slightly degrade BW/SD:

I meant to say "With 16K, there was an improvement in BW"
above. Again the numbers are not very reproducible,
I will test with remote host also to see if I get more
consistent numbers.

Thanks,

- KK

>
> ______________________________
> #sessions  BW%      SD%
> ______________________________
> 1          30.9    -25.0
> 2          16.5    -19.4
> 4         -1.3      7.9
> 8          1.4      6.2
> 16         3.9     -5.4
> 32         0        4.3
> 48        -.5        .1
> 64         32.1    -1.5
> 96        -2.1      23.2
> 128       -7.4      3.8
> ______________________________
> BW: 5.0          SD: 7.5

^ permalink raw reply

* Re: [PATCHv2 RFC 0/4] virtio and vhost-net capacity handling
From: Michael S. Tsirkin @ 2011-06-13 13:35 UTC (permalink / raw)
  To: Krishna Kumar2
  Cc: habanero-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	lguest-uLR06cmDAlY/bJ5BZ2RsiQ, Shirley Ma,
	kvm-u79uwXL29TY76Z2rM5mHXA, Carsten Otte,
	linux-s390-u79uwXL29TY76Z2rM5mHXA, Heiko Carstens,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	steved-r/Jw6+rmf7HQT0dZR+AlfA, Christian Borntraeger,
	Tom Lendacky, netdev-u79uwXL29TY76Z2rM5mHXA, Martin Schwidefsky,
	linux390-tA70FqPdS9bQT0dZR+AlfA
In-Reply-To: <OFE36F9C2B.43D9DB04-ON652578AE.0048E1AB-652578AE.004A1462-xthvdsQ13ZrQT0dZR+AlfA@public.gmane.org>

On Mon, Jun 13, 2011 at 07:02:27PM +0530, Krishna Kumar2 wrote:
> "Michael S. Tsirkin" <mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote on 06/07/2011 09:38:30 PM:
> 
> > > This is on top of the patches applied by Rusty.
> > >
> > > Warning: untested. Posting now to give people chance to
> > > comment on the API.
> >
> > OK, this seems to have survived some testing so far,
> > after I dropped patch 4 and fixed build for patch 3
> > (build fixup patch sent in reply to the original).
> >
> > I'll be mostly offline until Sunday, would appreciate
> > testing reports.
> 
> Hi Michael,
> 
> I ran the latest patches with 1K I/O (guest->local host) and
> the results are (60 sec run for each test case):

Hi!
Did you apply this one:
[PATCHv2 RFC 4/4] Revert "virtio: make add_buf return capacity remaining"
?

It turns out that that patch has a bug and should be reverted,
only patches 1-3 should be applied.

Could you confirm please?


> ___________________/
> #sessions   BW%       SD%
> ______________________________
> 1           -25.6     47.0
> 2           -29.3     22.9
> 4              .8     1.6
> 8             1.6     0
> 16          -1.6      4.1
> 32          -5.3      2.1
> 48           11.3    -7.8
> 64          -2.8      .7
> 96          -6.2      .6
> 128         -10.6     12.7
> ______________________________
> BW: -4.8     SD: 5.4
> 
> I tested it again to see if the regression is fleeting (since
> the numbers vary quite a bit for 1K I/O even between guest->
> local host), but:
> 
> ______________________________
> #sessions  BW%     SD%
> ______________________________
> 1          14.0    -17.3
> 2          19.9    -11.1
> 4          7.9     -15.3
> 8          9.6     -13.1
> 16         1.2     -7.3
> 32        -.6      -13.5
> 48        -28.7     10.0
> 64        -5.7     -.7
> 96        -9.4     -8.1
> 128       -9.4      .7
> ______________________________
> BW: -3.7     SD: -2.0
> 
> 
> With 16K, there was an improvement in SD, but
> higher sessions seem to slightly degrade BW/SD:
> 
> ______________________________
> #sessions  BW%      SD%
> ______________________________
> 1          30.9    -25.0
> 2          16.5    -19.4
> 4         -1.3      7.9
> 8          1.4      6.2
> 16         3.9     -5.4
> 32         0        4.3
> 48        -.5        .1
> 64         32.1    -1.5
> 96        -2.1      23.2
> 128       -7.4      3.8
> ______________________________
> BW: 5.0          SD: 7.5
> 
> 
> Thanks,
> 
> - KK

^ permalink raw reply

* Re: [PATCHv2 RFC 0/4] virtio and vhost-net capacity handling
From: Krishna Kumar2 @ 2011-06-13 13:32 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Christian Borntraeger, Carsten Otte, habanero, Heiko Carstens,
	kvm, lguest, linux-kernel, linux-s390, linux390, netdev,
	Rusty Russell, Martin Schwidefsky, steved, Tom Lendacky,
	virtualization, Shirley Ma
In-Reply-To: <20110607160830.GB17581@redhat.com>

"Michael S. Tsirkin" <mst@redhat.com> wrote on 06/07/2011 09:38:30 PM:

> > This is on top of the patches applied by Rusty.
> >
> > Warning: untested. Posting now to give people chance to
> > comment on the API.
>
> OK, this seems to have survived some testing so far,
> after I dropped patch 4 and fixed build for patch 3
> (build fixup patch sent in reply to the original).
>
> I'll be mostly offline until Sunday, would appreciate
> testing reports.

Hi Michael,

I ran the latest patches with 1K I/O (guest->local host) and
the results are (60 sec run for each test case):

______________________________
#sessions   BW%       SD%
______________________________
1           -25.6     47.0
2           -29.3     22.9
4              .8     1.6
8             1.6     0
16          -1.6      4.1
32          -5.3      2.1
48           11.3    -7.8
64          -2.8      .7
96          -6.2      .6
128         -10.6     12.7
______________________________
BW: -4.8     SD: 5.4

I tested it again to see if the regression is fleeting (since
the numbers vary quite a bit for 1K I/O even between guest->
local host), but:

______________________________
#sessions  BW%     SD%
______________________________
1          14.0    -17.3
2          19.9    -11.1
4          7.9     -15.3
8          9.6     -13.1
16         1.2     -7.3
32        -.6      -13.5
48        -28.7     10.0
64        -5.7     -.7
96        -9.4     -8.1
128       -9.4      .7
______________________________
BW: -3.7     SD: -2.0


With 16K, there was an improvement in SD, but
higher sessions seem to slightly degrade BW/SD:

______________________________
#sessions  BW%      SD%
______________________________
1          30.9    -25.0
2          16.5    -19.4
4         -1.3      7.9
8          1.4      6.2
16         3.9     -5.4
32         0        4.3
48        -.5        .1
64         32.1    -1.5
96        -2.1      23.2
128       -7.4      3.8
______________________________
BW: 5.0          SD: 7.5


Thanks,

- KK


^ permalink raw reply

* RE: [PATCH 1/1] cdc_ncm: Fix TCP Window Size issue by CDC NCM driver
From: Elof Vrigborn @ 2011-06-13 11:24 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Oliver Neukum, netdev@vger.kernel.org
In-Reply-To: <1307715036.4044.11.camel@edumazet-laptop>

> 
> I find this patch dubious.
> 
> skb truesize is not meant to be skb->len + sizeof(struct sk_buff);
> 
> truesize is really accounting for the truesize of memory 
> blocks, not the used one.
> 
> Many drivers allocate a full 2Kbyte block, even if only 100 
> bytes are used in it. If we want to reduce "truesize", then 
> we perform a "copybreak", to allocate a right sized skb. Some 
> NICS do that for small frames.
> 
> If you have TCP performance problems, this might be because 
> of another high level problem. This truesize underestimation 
> is only hiding the problem, but makes the whole machine more 
> subject to OOM bugs.
> 
> Could you provide more information ?
> 
> 
> 
I'll explain further: The skb_in input of cdc_ncm_rx_fixup function holds the data of several ethernet packets received, as collected in one NCM packet. In CDC NCM driver cdc_ncm_rx_fixup function the skb_in is traversed and a new skb clone is created for each of the contained ethernet packets. Each of these clones are then modified by the len and data members to present only one ethernet packet each, but the truesize still is indicating the truesize of the parent skb which were holding the data of all clones. Each of the clones, but not the parent, will end up in the tcp_grow_window function now indicating the len of a single ethernet packet but a truesize of the collected ethernet packets. To the tcp_grow_window function of the TCP stack this seems as there is a huge overhead for each sk
 b, as it analyzes the skb clones but not the parent skb when comparing the len to the truesize when determining how to increase rcv_ssthres. By limiting rcv_ssthres, also the the advertised TCP window size will be limited, leading to the TCP throughput performance being low.

The original reason for simply cloning the skb holding the several packets, instead of any "copybreak" would probably be to limit the need for memory operations on the received data. I can not tell if this was a good or not so good choise.

Drivers that allocate 2Kbyte blocks and then use only a portion of that does in fact introduce the indicated overhead. But the situation with the CDC NCM driver is that the skb clones are only seemingly introducing an overhead. In reality, as indicated by the further non-used skb parent, there is in fact no such overhead.

Yes, we do have TCP throughput performance problems. By comparing the handling of data received through other interfaces we could conclude that the performance issue was due to that tcp_grow_window function of the TCP stack did limit the rcv_ssthres in Check #2 because of skb->truesize was much larger than the skb->len, for the abocve described clones. 

^ permalink raw reply

* Re: [RFC PATCH 1/1] IPVS netns shutdown/startup dead-lock
From: Simon Horman @ 2011-06-13 11:11 UTC (permalink / raw)
  To: Hans Schillstrom; +Cc: ja, wensong, lvs-devel, netdev, netfilter-devel, hans
In-Reply-To: <1307957530-12732-1-git-send-email-hans.schillstrom@ericsson.com>

On Mon, Jun 13, 2011 at 11:32:10AM +0200, Hans Schillstrom wrote:
> ip_vs_mutext is used by both netns shutdown code and startup
> and both implicit uses sk_lock-AF_INET mutex.
> 
> cleanup CPU-1         startup CPU-2
> ip_vs_dst_event()     ip_vs_genl_set_cmd()
>  sk_lock-AF_INET     __ip_vs_mutex
>                      sk_lock-AF_INET
> __ip_vs_mutex
> * DEAD LOCK *
> 
> This can be solved by have the ip_vs_mutex per netns
> or avid locking when starting/stoping sync-threads.
> i.e. just add a starting/stoping flag.
> 
> ip_vs_mutex per name-space seems to be a more future proof solution.
> 
> Which one should be used ?

I don't feel strongly either way.

> Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> ---
>  include/net/ip_vs.h             |    2 ++
>  net/netfilter/ipvs/ip_vs_ctl.c  |   15 ++++++++++-----
>  net/netfilter/ipvs/ip_vs_sync.c |   30 +++++++++++++++++++++++++-----
>  3 files changed, 37 insertions(+), 10 deletions(-)
> 

[snip]

> diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> index 699c79a..21c541f 100644
> --- a/net/netfilter/ipvs/ip_vs_ctl.c
> +++ b/net/netfilter/ipvs/ip_vs_ctl.c

[snip]

> @@ -3305,12 +3309,13 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
>  			ret = -EINVAL;
>  			goto out;
>  		}
> -
> +		/* Unlock since a global socket lock will be taken later */
> +		mutex_unlock(&__ip_vs_mutex);
>  		if (cmd == IPVS_CMD_NEW_DAEMON)
>  			ret = ip_vs_genl_new_daemon(net, daemon_attrs);
>  		else
>  			ret = ip_vs_genl_del_daemon(net, daemon_attrs);
> -		goto out;
> +		goto out_nounlock;

I'm not a huge fan of labels that only return.
So I think it would be slightly easier on the eyes
to just return here, not add out_nounlock,
and possibly rename out as out_unlock.

>  	} else if (cmd == IPVS_CMD_ZERO &&
>  		   !info->attrs[IPVS_CMD_ATTR_SERVICE]) {
>  		ret = ip_vs_zero_all(net);

[snip]

^ permalink raw reply

* [PATCH 2/2] IPVS: remove unused init and cleanup functions.
From: Hans Schillstrom @ 2011-06-13 10:19 UTC (permalink / raw)
  To: horms, ja, wensong, lvs-devel, netdev, netfilter-devel
  Cc: hans, Hans Schillstrom
In-Reply-To: <1307960367-15318-1-git-send-email-hans.schillstrom@ericsson.com>

After restructuring, there is some unused or empty functions
left to be removed.

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
---
 include/net/ip_vs.h             |    6 ------
 net/netfilter/ipvs/ip_vs_app.c  |   10 ----------
 net/netfilter/ipvs/ip_vs_core.c |   29 ++++-------------------------
 net/netfilter/ipvs/ip_vs_est.c  |    9 ---------
 net/netfilter/ipvs/ip_vs_sync.c |    9 ---------
 5 files changed, 4 insertions(+), 59 deletions(-)

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 1b0985f..b1370c4 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1117,8 +1117,6 @@ extern void ip_vs_app_inc_put(struct ip_vs_app *inc);
 
 extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb);
 extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
-extern int ip_vs_app_init(void);
-extern void ip_vs_app_cleanup(void);
 
 void ip_vs_bind_pe(struct ip_vs_service *svc, struct ip_vs_pe *pe);
 void ip_vs_unbind_pe(struct ip_vs_service *svc);
@@ -1221,15 +1219,11 @@ extern int start_sync_thread(struct net *net, int state, char *mcast_ifn,
 			     __u8 syncid);
 extern int stop_sync_thread(struct net *net, int state);
 extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp);
-extern int ip_vs_sync_init(void);
-extern void ip_vs_sync_cleanup(void);
 
 
 /*
  *      IPVS rate estimator prototypes (from ip_vs_est.c)
  */
-extern int ip_vs_estimator_init(void);
-extern void ip_vs_estimator_cleanup(void);
 extern void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats);
 extern void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats);
 extern void ip_vs_zero_estimator(struct ip_vs_stats *stats);
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index e223fb7..fe6cb43 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -589,13 +589,3 @@ void __net_exit ip_vs_app_net_cleanup(struct net *net)
 {
 	proc_net_remove(net, "ip_vs_app");
 }
-
-int __init ip_vs_app_init(void)
-{
-	return 0;
-}
-
-
-void ip_vs_app_cleanup(void)
-{
-}
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 673504e..267529b 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1968,36 +1968,23 @@ static int __init ip_vs_init(void)
 {
 	int ret;
 
-	ip_vs_estimator_init();
 	ret = ip_vs_control_init();
 	if (ret < 0) {
 		pr_err("can't setup control.\n");
-		goto cleanup_estimator;
+		goto exit;
 	}
 
 	ip_vs_protocol_init();
 
-	ret = ip_vs_app_init();
-	if (ret < 0) {
-		pr_err("can't setup application helper.\n");
-		goto cleanup_protocol;
-	}
-
 	ret = ip_vs_conn_init();
 	if (ret < 0) {
 		pr_err("can't setup connection table.\n");
-		goto cleanup_app;
-	}
-
-	ret = ip_vs_sync_init();
-	if (ret < 0) {
-		pr_err("can't setup sync data.\n");
-		goto cleanup_conn;
+		goto cleanup_protocol;
 	}
 
 	ret = register_pernet_subsys(&ipvs_core_ops);	/* Alloc ip_vs struct */
 	if (ret < 0)
-		goto cleanup_sync;
+		goto cleanup_conn;
 
 	ret = register_pernet_device(&ipvs_core_dev_ops);
 	if (ret < 0)
@@ -2017,17 +2004,12 @@ cleanup_dev:
 	unregister_pernet_device(&ipvs_core_dev_ops);
 cleanup_sub:
 	unregister_pernet_subsys(&ipvs_core_ops);
-cleanup_sync:
-	ip_vs_sync_cleanup();
 cleanup_conn:
 	ip_vs_conn_cleanup();
-cleanup_app:
-	ip_vs_app_cleanup();
 cleanup_protocol:
 	ip_vs_protocol_cleanup();
 	ip_vs_control_cleanup();
-cleanup_estimator:
-	ip_vs_estimator_cleanup();
+exit:
 	return ret;
 }
 
@@ -2036,12 +2018,9 @@ static void __exit ip_vs_cleanup(void)
 	nf_unregister_hooks(ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
 	unregister_pernet_device(&ipvs_core_dev_ops);
 	unregister_pernet_subsys(&ipvs_core_ops);	/* free ip_vs struct */
-	ip_vs_sync_cleanup();
 	ip_vs_conn_cleanup();
-	ip_vs_app_cleanup();
 	ip_vs_protocol_cleanup();
 	ip_vs_control_cleanup();
-	ip_vs_estimator_cleanup();
 	pr_info("ipvs unloaded.\n");
 }
 
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c
index f5d2a01..0fac601 100644
--- a/net/netfilter/ipvs/ip_vs_est.c
+++ b/net/netfilter/ipvs/ip_vs_est.c
@@ -207,12 +207,3 @@ void __net_exit ip_vs_estimator_net_cleanup(struct net *net)
 {
 	del_timer_sync(&net_ipvs(net)->est_timer);
 }
-
-int __init ip_vs_estimator_init(void)
-{
-	return 0;
-}
-
-void ip_vs_estimator_cleanup(void)
-{
-}
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 58bfabb..7ee7215 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1689,12 +1689,3 @@ void ip_vs_sync_net_cleanup(struct net *net)
 	if (retc && retc != -ESRCH)
 		pr_err("Failed to stop Backup Daemon\n");
 }
-
-int __init ip_vs_sync_init(void)
-{
-	return 0;
-}
-
-void ip_vs_sync_cleanup(void)
-{
-}
-- 
1.7.2.3


^ permalink raw reply related

* [PATCH 1/2] IPVS: labels at pos 0
From: Hans Schillstrom @ 2011-06-13 10:19 UTC (permalink / raw)
  To: horms, ja, wensong, lvs-devel, netdev, netfilter-devel
  Cc: hans, Hans Schillstrom
In-Reply-To: <1307960367-15318-1-git-send-email-hans.schillstrom@ericsson.com>

Put goto labels at the beginig of row
acording to coding style example.

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
---
 net/netfilter/ipvs/ip_vs_core.c |   10 +++++-----
 net/netfilter/ipvs/ip_vs_ctl.c  |    8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index f54719a..673504e 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1384,7 +1384,7 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
 		offset += 2 * sizeof(__u16);
 	verdict = ip_vs_icmp_xmit(skb, cp, pp, offset, hooknum);
 
-  out:
+out:
 	__ip_vs_conn_put(cp);
 
 	return verdict;
@@ -2019,14 +2019,14 @@ cleanup_sub:
 	unregister_pernet_subsys(&ipvs_core_ops);
 cleanup_sync:
 	ip_vs_sync_cleanup();
-  cleanup_conn:
+cleanup_conn:
 	ip_vs_conn_cleanup();
-  cleanup_app:
+cleanup_app:
 	ip_vs_app_cleanup();
-  cleanup_protocol:
+cleanup_protocol:
 	ip_vs_protocol_cleanup();
 	ip_vs_control_cleanup();
-  cleanup_estimator:
+cleanup_estimator:
 	ip_vs_estimator_cleanup();
 	return ret;
 }
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 6bedea1..be43fd8 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1334,9 +1334,9 @@ ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user_kern *u)
 		ip_vs_bind_pe(svc, pe);
 	}
 
-  out_unlock:
+out_unlock:
 	write_unlock_bh(&__ip_vs_svc_lock);
-  out:
+out:
 	ip_vs_scheduler_put(old_sched);
 	ip_vs_pe_put(old_pe);
 	return ret;
@@ -2469,7 +2469,7 @@ __ip_vs_get_service_entries(struct net *net,
 			count++;
 		}
 	}
-  out:
+out:
 	return ret;
 }
 
@@ -2707,7 +2707,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
 		ret = -EINVAL;
 	}
 
-  out:
+out:
 	mutex_unlock(&__ip_vs_mutex);
 	return ret;
 }
-- 
1.7.2.3


^ permalink raw reply related

* [PATCH 0/2] IPVS: init and cleanup.
From: Hans Schillstrom @ 2011-06-13 10:19 UTC (permalink / raw)
  To: horms, ja, wensong, lvs-devel, netdev, netfilter-devel
  Cc: hans, Hans Schillstrom

Re submission of patch 2 & 5 in serie below.
skip patch 6.

>
> [v4 PATCH 1/6] IPVS: Change of socket usage to enable name space exit.
> [v4 PATCH 2/6] IPVS: labels at pos 0
> [v4 PATCH 3/6] IPVS: init and cleanup restructuring.
> [v4 PATCH 4/6] IPVS: rename of netns init and cleanup functions.
> [v4 PATCH 5/6] IPVS: remove unused init and cleanup functions.
> [v4 PATCH 6/6] IPVS: add debug functions
> 
> Variants of 1/6 and 3/6 were included in 2.6.39.
> I have applied 4/6 to ipvs-next-2.6 [1]
> The remaining patches no longer apply cleanly,
> could you send fresh versions?
> 
> [1] git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next-2.6.git


^ permalink raw reply

* [RFC PATCH 1/1] IPVS netns shutdown/startup dead-lock
From: Hans Schillstrom @ 2011-06-13  9:32 UTC (permalink / raw)
  To: horms, ja, wensong, lvs-devel, netdev, netfilter-devel
  Cc: hans, Hans Schillstrom

ip_vs_mutext is used by both netns shutdown code and startup
and both implicit uses sk_lock-AF_INET mutex.

cleanup CPU-1         startup CPU-2
ip_vs_dst_event()     ip_vs_genl_set_cmd()
 sk_lock-AF_INET     __ip_vs_mutex
                     sk_lock-AF_INET
__ip_vs_mutex
* DEAD LOCK *

This can be solved by have the ip_vs_mutex per netns
or avid locking when starting/stoping sync-threads.
i.e. just add a starting/stoping flag.

ip_vs_mutex per name-space seems to be a more future proof solution.

Which one should be used ?

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
---
 include/net/ip_vs.h             |    2 ++
 net/netfilter/ipvs/ip_vs_ctl.c  |   15 ++++++++++-----
 net/netfilter/ipvs/ip_vs_sync.c |   30 +++++++++++++++++++++++++-----
 3 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 34a6fa8..e82fa8d 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -895,6 +895,8 @@ struct netns_ipvs {
 	struct sockaddr_in	sync_mcast_addr;
 	struct task_struct	*master_thread;
 	struct task_struct	*backup_thread;
+	atomic_t		master_flg;	/* Start-up flag*/
+	atomic_t		backup_flg;
 	int			send_mesg_maxlen;
 	int			recv_mesg_maxlen;
 	volatile int		sync_state;
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 699c79a..21c541f 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2318,13 +2318,17 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
 		goto out_unlock;
 	} else if (cmd == IP_VS_SO_SET_STARTDAEMON) {
 		struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;
+		/* Unlock since a global socket lock will be taken later */
+		mutex_unlock(&__ip_vs_mutex);
 		ret = start_sync_thread(net, dm->state, dm->mcast_ifn,
 					dm->syncid);
-		goto out_unlock;
+		goto out_dec;
 	} else if (cmd == IP_VS_SO_SET_STOPDAEMON) {
 		struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;
+		/* Unlock since a global socket lock will be taken later */
+		mutex_unlock(&__ip_vs_mutex);
 		ret = stop_sync_thread(net, dm->state);
-		goto out_unlock;
+		goto out_dec;
 	}
 
 	usvc_compat = (struct ip_vs_service_user *)arg;
@@ -3305,12 +3309,13 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
 			ret = -EINVAL;
 			goto out;
 		}
-
+		/* Unlock since a global socket lock will be taken later */
+		mutex_unlock(&__ip_vs_mutex);
 		if (cmd == IPVS_CMD_NEW_DAEMON)
 			ret = ip_vs_genl_new_daemon(net, daemon_attrs);
 		else
 			ret = ip_vs_genl_del_daemon(net, daemon_attrs);
-		goto out;
+		goto out_nounlock;
 	} else if (cmd == IPVS_CMD_ZERO &&
 		   !info->attrs[IPVS_CMD_ATTR_SERVICE]) {
 		ret = ip_vs_zero_all(net);
@@ -3382,7 +3387,7 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
 
 out:
 	mutex_unlock(&__ip_vs_mutex);
-
+out_nounlock:
 	return ret;
 }
 
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index e292e5b..7a996dc 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1540,30 +1540,37 @@ int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid)
 	char *name, *buf = NULL;
 	int (*threadfn)(void *data);
 	int result = -ENOMEM;
+	atomic_t *run_flg;
 
 	IP_VS_DBG(7, "%s(): pid %d\n", __func__, task_pid_nr(current));
 	IP_VS_DBG(7, "Each ip_vs_sync_conn entry needs %Zd bytes\n",
 		  sizeof(struct ip_vs_sync_conn_v0));
 
+	/* master/backup_flag is used to protect for multiple starts
+	 * the ip_vs_mutex can't be used here due to deadlock problems.*/
 	if (state == IP_VS_STATE_MASTER) {
-		if (ipvs->master_thread)
+		if (ipvs->master_thread ||
+		    !atomic_dec_and_test(&ipvs->master_flg))
 			return -EEXIST;
 
 		strlcpy(ipvs->master_mcast_ifn, mcast_ifn,
 			sizeof(ipvs->master_mcast_ifn));
 		ipvs->master_syncid = syncid;
 		realtask = &ipvs->master_thread;
+		run_flg = &ipvs->master_flg;
 		name = "ipvs_master:%d";
 		threadfn = sync_thread_master;
 		sock = make_send_sock(net);
 	} else if (state == IP_VS_STATE_BACKUP) {
-		if (ipvs->backup_thread)
+		if (ipvs->backup_thread ||
+		    !atomic_dec_and_test(&ipvs->backup_flg))
 			return -EEXIST;
 
 		strlcpy(ipvs->backup_mcast_ifn, mcast_ifn,
 			sizeof(ipvs->backup_mcast_ifn));
 		ipvs->backup_syncid = syncid;
 		realtask = &ipvs->backup_thread;
+		run_flg = &ipvs->backup_flg;
 		name = "ipvs_backup:%d";
 		threadfn = sync_thread_backup;
 		sock = make_receive_sock(net);
@@ -1600,7 +1607,8 @@ int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid)
 	/* mark as active */
 	*realtask = task;
 	ipvs->sync_state |= state;
-
+	/* Free to use again */
+	atomic_set(run_flg, 1);
 	/* increase the module use count */
 	ip_vs_use_count_inc();
 
@@ -1613,6 +1621,7 @@ outbuf:
 outsocket:
 	sk_release_kernel(sock->sk);
 out:
+	atomic_set(run_flg, -1);
 	return result;
 }
 
@@ -1621,11 +1630,15 @@ int stop_sync_thread(struct net *net, int state)
 {
 	struct netns_ipvs *ipvs = net_ipvs(net);
 	int retc = -EINVAL;
+	atomic_t *run_flg;
 
 	IP_VS_DBG(7, "%s(): pid %d\n", __func__, task_pid_nr(current));
 
+	/* master/backup_flag is used to protect for multiple shutdowns
+	 * the ip_vs_mutex can't be used here due to deadlock problems.*/
 	if (state == IP_VS_STATE_MASTER) {
-		if (!ipvs->master_thread)
+		if (!ipvs->master_thread ||
+		    !atomic_dec_and_test(&ipvs->master_flg))
 			return -ESRCH;
 
 		pr_info("stopping master sync thread %d ...\n",
@@ -1642,8 +1655,11 @@ int stop_sync_thread(struct net *net, int state)
 		spin_unlock_bh(&ipvs->sync_lock);
 		retc = kthread_stop(ipvs->master_thread);
 		ipvs->master_thread = NULL;
+		/* Free to use again */
+		atomic_set(&ipvs->master_flg, 1);
 	} else if (state == IP_VS_STATE_BACKUP) {
-		if (!ipvs->backup_thread)
+		if (!ipvs->backup_thread ||
+		    !atomic_dec_and_test(&ipvs->backup_flg))
 			return -ESRCH;
 
 		pr_info("stopping backup sync thread %d ...\n",
@@ -1652,6 +1668,8 @@ int stop_sync_thread(struct net *net, int state)
 		ipvs->sync_state &= ~IP_VS_STATE_BACKUP;
 		retc = kthread_stop(ipvs->backup_thread);
 		ipvs->backup_thread = NULL;
+		/* Free to use again */
+		atomic_set(&ipvs->backup_flg, 1);
 	}
 
 	/* decrease the module use count */
@@ -1674,6 +1692,8 @@ int __net_init __ip_vs_sync_init(struct net *net)
 	ipvs->sync_mcast_addr.sin_family = AF_INET;
 	ipvs->sync_mcast_addr.sin_port = cpu_to_be16(IP_VS_SYNC_PORT);
 	ipvs->sync_mcast_addr.sin_addr.s_addr = cpu_to_be32(IP_VS_SYNC_GROUP);
+	atomic_set(&ipvs->master_flg, 1);
+	atomic_set(&ipvs->backup_flg, 1);
 	return 0;
 }
 
-- 
1.7.2.3


^ permalink raw reply related

* [PATCH] net/r8169: Update the new parser for the new firmware
From: Hayes Wang @ 2011-06-13  9:16 UTC (permalink / raw)
  To: romieu; +Cc: netdev, linux-kernel, Hayes Wang

Update the parser for the new firmware which is embedded some information.
The paser cannot be used for the old firmware. It is only for the new type one.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/r8169.c |   59 ++++++++++++++++++++++++++++----------------------
 1 files changed, 33 insertions(+), 26 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index ef1ce2e..87b684f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -36,11 +36,11 @@
 #define MODULENAME "r8169"
 #define PFX MODULENAME ": "
 
-#define FIRMWARE_8168D_1	"rtl_nic/rtl8168d-1.fw"
-#define FIRMWARE_8168D_2	"rtl_nic/rtl8168d-2.fw"
-#define FIRMWARE_8168E_1	"rtl_nic/rtl8168e-1.fw"
-#define FIRMWARE_8168E_2	"rtl_nic/rtl8168e-2.fw"
-#define FIRMWARE_8105E_1	"rtl_nic/rtl8105e-1.fw"
+#define FIRMWARE_8168D_1	"rtl_nic/rtl8168d-3.fw"
+#define FIRMWARE_8168D_2	"rtl_nic/rtl8168d-4.fw"
+#define FIRMWARE_8168E_1	"rtl_nic/rtl8168e-3.fw"
+#define FIRMWARE_8168E_2	"rtl_nic/rtl8168e-4.fw"
+#define FIRMWARE_8105E_1	"rtl_nic/rtl8105e-2.fw"
 
 #ifdef RTL8169_DEBUG
 #define assert(expr) \
@@ -594,6 +594,13 @@ struct ring_info {
 	u8		__pad[sizeof(void *) - sizeof(u32)];
 };
 
+struct fw_info {
+	char	version[32];
+	u32	fw_start;
+	u32	fw_len;
+	u8	chksum;
+};
+
 enum features {
 	RTL_FEATURE_WOL		= (1 << 0),
 	RTL_FEATURE_MSI		= (1 << 1),
@@ -1226,7 +1233,7 @@ static void rtl8169_get_drvinfo(struct net_device *dev,
 	strcpy(info->version, RTL8169_VERSION);
 	strcpy(info->bus_info, pci_name(tp->pci_dev));
 	strncpy(info->fw_version, IS_ERR_OR_NULL(tp->fw) ? "N/A" :
-		rtl_lookup_firmware_name(tp), sizeof(info->fw_version) - 1);
+		(char *)tp->fw->data, sizeof(info->fw_version) - 1);
 }
 
 static int rtl8169_get_regs_len(struct net_device *dev)
@@ -1743,16 +1750,30 @@ static void rtl_writephy_batch(struct rtl8169_private *tp,
 static void
 rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
 {
-	__le32 *phytable = (__le32 *)fw->data;
+	__le32 *phytable;
 	struct net_device *dev = tp->dev;
-	size_t index, fw_size = fw->size / sizeof(*phytable);
+	struct fw_info *f_info;
+	size_t index, fw_size;
 	u32 predata, count;
+	u8 checksum;
+
+	f_info = (struct fw_info *)fw->data;
+
+	checksum = 0;
+	for (index = 0; index < fw->size; index++) {
+		checksum += fw->data[index];
+	}
 
-	if (fw->size % sizeof(*phytable)) {
-		netif_err(tp, probe, dev, "odd sized firmware %zd\n", fw->size);
+	if (checksum != 0) {
+		netif_err(tp, probe, dev, "none zero checksum(%u)\n", checksum);
 		return;
 	}
 
+	netif_info(tp, probe, dev, "firmware: %s\n", f_info->version);
+
+	phytable = (__le32 *)(fw->data + f_info->fw_start);
+	fw_size = f_info->fw_len;
+
 	for (index = 0; index < fw_size; index++) {
 		u32 action = le32_to_cpu(phytable[index]);
 		u32 regno = (action & 0x0fff0000) >> 16;
@@ -1892,14 +1913,6 @@ static void rtl_apply_firmware(struct rtl8169_private *tp)
 		rtl_phy_write_fw(tp, fw);
 }
 
-static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
-{
-	if (rtl_readphy(tp, reg) != val)
-		netif_warn(tp, hw, tp->dev, "chipset not ready for firmware\n");
-	else
-		rtl_apply_firmware(tp);
-}
-
 static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
@@ -2334,10 +2347,7 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_w1w0_phy(tp, 0x02, 0x0100, 0x0600);
 	rtl_w1w0_phy(tp, 0x03, 0x0000, 0xe000);
 
-	rtl_writephy(tp, 0x1f, 0x0005);
-	rtl_writephy(tp, 0x05, 0x001b);
-
-	rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xbf00);
+	rtl_apply_firmware(tp);
 
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
@@ -2437,10 +2447,7 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0002);
 	rtl_patchphy(tp, 0x0f, 0x0017);
 
-	rtl_writephy(tp, 0x1f, 0x0005);
-	rtl_writephy(tp, 0x05, 0x001b);
-
-	rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xb300);
+	rtl_apply_firmware(tp);
 
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
-- 
1.7.3.2

^ permalink raw reply related

* [PATCH] linux-firmware: Replace the old firmware
From: Hayes Wang @ 2011-06-13  9:15 UTC (permalink / raw)
  To: dwmw2; +Cc: romieu, netdev, Hayes Wang

Replace the old firmware with the new one which is embedded more
information. The old firmware needs the old method of parsing, and
the new firmware needs the new one. They are not compatible.

rtl8168d-3.fw replace rtl8168d-1.fw.
rtl8168d-4.fw replace rtl8168d-2.fw.
rtl8168e-3.fw replace rtl8168e-1.fw.
rtl8168e-4.fw replace rtl8168e-2.fw.
rtl8105e-2.fw replace rtl8105e-1.fw.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 WHENCE                |    4 ++++
 rtl_nic/rtl8105e-2.fw |  Bin 0 -> 2144 bytes
 rtl_nic/rtl8168d-3.fw |  Bin 0 -> 1584 bytes
 rtl_nic/rtl8168d-4.fw |  Bin 0 -> 1408 bytes
 rtl_nic/rtl8168e-3.fw |  Bin 2804 -> 5568 bytes
 rtl_nic/rtl8168e-4.fw |  Bin 0 -> 3984 bytes
 6 files changed, 4 insertions(+), 0 deletions(-)
 create mode 100644 rtl_nic/rtl8105e-2.fw
 create mode 100644 rtl_nic/rtl8168d-3.fw
 create mode 100644 rtl_nic/rtl8168d-4.fw
 create mode 100644 rtl_nic/rtl8168e-4.fw

diff --git a/WHENCE b/WHENCE
index d2abe41..8eba04a 100644
--- a/WHENCE
+++ b/WHENCE
@@ -1613,10 +1613,14 @@ Driver: r8169 - RealTek 8169/8168/8101 ethernet driver.
 
 File: rtl_nic/rtl8168d-1.fw
 File: rtl_nic/rtl8168d-2.fw
+File: rtl_nic/rtl8168d-3.fw
+File: rtl_nic/rtl8168d-4.fw
 File: rtl_nic/rtl8105e-1.fw
+File: rtl_nic/rtl8105e-2.fw
 File: rtl_nic/rtl8168e-1.fw
 File: rtl_nic/rtl8168e-2.fw
 File: rtl_nic/rtl8168e-3.fw
+File: rtl_nic/rtl8168e-4.fw
 
 Licence:
  * Copyright © 2011, Realtek Semiconductor Corporation
diff --git a/rtl_nic/rtl8105e-2.fw b/rtl_nic/rtl8105e-2.fw
new file mode 100644
index 0000000000000000000000000000000000000000..c19d8288e4bfdb0549a88e0fdc5ae1c3e79e32db
GIT binary patch
literal 2144
zcma);Z-`W76vp4ZGp@U}<VuDX9(Ra^mI$0t+ZI2~LdFtpMH#xRFhj1XX|-rbAFNKb
zK~S3%T1YL8x&$SXv{6Yx`>BWs?T?XcA13HS`=ty;qBghRGxuJaZdeVxoO|E*oaa2}
z&wK7XxcT9omC?<+M|VF^=_?g)tgOGIGO}y?o-Mm7#lBT*LOF!c8ijBu6nj^eR<A6T
z3Z>q)YkJp~`oj1~cgTk>*BTwY+C%Gd4=<aCM_Jnwxy}6GfO*$m-fxR#3o^KQ{qcBj
zVHtTdt4Xi(Zr-ab?0dH&L%g~+nEzfe&%J5BaoBuC(R>6s_qzGacjimbd*h7xmB<}m
zm@h_N@ea?Y%sY5)ecQZ6TsE5LB{!L01BUimlD#~8!W}G`pJj<>0nYiVxp=K^;;FdW
z6wgyExQ6>!_|fV(Vg403vab&&{=mq_B+Sbby((Baa0*-g!pXg5eie2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BZ|~{~gChbj)Ne6&iy#I&S<66&i;(I>BT533#Imj7Pr!-smKc
z=_lch7M?^=g$lgUZVV6qal>3bDdj(OjXp?jpZ_j(j)fF|P;Y&==D!;&_~yOyJ2IE6
kbgsqrUD=&tPq|!`*}_+KFNL?fXN2;=oFWgpqnbGPKZs`*OaK4?

literal 0
HcmV?d00001

-- 
1.7.3.2


^ permalink raw reply related

* Re: [PATCH] Documentation:change all arch/i386 to arch/x86 in Documentation
From: Jiri Kosina @ 2011-06-13  9:02 UTC (permalink / raw)
  To: Wanlong Gao
  Cc: linux-doc, linux-kernel, netdev, linux-kbuild, linux-video,
	xiyoulinuxkernelgroup, linux-kernel, Dipankar Sarma,
	Paul E. McKenney, Randy Dunlap, Nick Piggin, Karsten Keil,
	Michal Marek, James Bottomley, Martin Mares, Harry Wei,
	Chuck Lever, Trond Myklebust, Thomas Weber, Mike Frysinger,
	Justin P. Mattock
In-Reply-To: <alpine.LNX.2.00.1106131055250.22872@pobox.suse.cz>

On Mon, 13 Jun 2011, Jiri Kosina wrote:

> > From: Wanlong Gao <wanlong.gao@gmail.com>
> > 
> > Change all "arch/i386" to "arch/x86" in Documentaion/,
> > since the directory has changed.
> 
> I can take it.

Actually no, I will not be taking it. Simple sed doesn't work here -- some 
of the files have either obtained a different name in the meantime, or 
don't exist any more at all.

So please, next time

- be reasonable about the recepient list of your patches
- make sure that the trivially verifiable changes are really valid (and 
  even more so if sending mail to 20+ random recepients)

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [PATCH] Documentation:change all arch/i386 to arch/x86 in Documentation
From: Jiri Kosina @ 2011-06-13  8:56 UTC (permalink / raw)
  To: Wanlong Gao
  Cc: linux-doc, linux-kernel, netdev, linux-kbuild, linux-video,
	xiyoulinuxkernelgroup, linux-kernel, Dipankar Sarma,
	Paul E. McKenney, Randy Dunlap, Nick Piggin, Karsten Keil,
	Michal Marek, James Bottomley, Martin Mares, Harry Wei,
	Chuck Lever, Trond Myklebust, Thomas Weber, Mike Frysinger,
	Justin P. Mattock
In-Reply-To: <1307942898-3728-1-git-send-email-wanlong.gao@gmail.com>

On Mon, 13 Jun 2011, Wanlong Gao wrote:

> From: Wanlong Gao <wanlong.gao@gmail.com>
> 
> Change all "arch/i386" to "arch/x86" in Documentaion/,
> since the directory has changed.

I can take it.

But please, be really reasonable about the CC list when sending patches 
next time. CCing gazillion of random people and mailinglists because such 
a super-simple change is very likely to be considered unncessarily 
annoying.

Thanks.

> 
> Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com>
> ---
>  Documentation/RCU/NMI-RCU.txt             |    4 +-
>  Documentation/blockdev/README.DAC960      |    2 +-
>  Documentation/blockdev/ramdisk.txt        |    8 +++---
>  Documentation/cpu-freq/cpu-drivers.txt    |    2 +-
>  Documentation/filesystems/nfs/nfsroot.txt |    2 +-
>  Documentation/isdn/README.HiSax           |    2 +-
>  Documentation/kbuild/makefiles.txt        |   38 ++++++++++++++--------------
>  Documentation/magic-number.txt            |    2 +-
>  Documentation/mca.txt                     |    6 ++--
>  Documentation/scheduler/sched-arch.txt    |    2 +-
>  Documentation/scsi/BusLogic.txt           |    2 +-
>  Documentation/serial/computone.txt        |    2 +-
>  Documentation/svga.txt                    |    2 +-
>  Documentation/zh_CN/magic-number.txt      |    2 +-
>  14 files changed, 38 insertions(+), 38 deletions(-)
> 
> diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.txt
> index a8536cb..bf82851 100644
> --- a/Documentation/RCU/NMI-RCU.txt
> +++ b/Documentation/RCU/NMI-RCU.txt
> @@ -5,8 +5,8 @@ Although RCU is usually used to protect read-mostly data structures,
>  it is possible to use RCU to provide dynamic non-maskable interrupt
>  handlers, as well as dynamic irq handlers.  This document describes
>  how to do this, drawing loosely from Zwane Mwaikambo's NMI-timer
> -work in "arch/i386/oprofile/nmi_timer_int.c" and in
> -"arch/i386/kernel/traps.c".
> +work in "arch/x86/oprofile/nmi_timer_int.c" and in
> +"arch/x86/kernel/traps.c".
>  
>  The relevant pieces of code are listed below, each followed by a
>  brief explanation.
> diff --git a/Documentation/blockdev/README.DAC960 b/Documentation/blockdev/README.DAC960
> index 0e8f618..bd85fb9 100644
> --- a/Documentation/blockdev/README.DAC960
> +++ b/Documentation/blockdev/README.DAC960
> @@ -214,7 +214,7 @@ replacing "/usr/src" with wherever you keep your Linux kernel source tree:
>    make config
>    make bzImage (or zImage)
>  
> -Then install "arch/i386/boot/bzImage" or "arch/i386/boot/zImage" as your
> +Then install "arch/x86/boot/bzImage" or "arch/x86/boot/zImage" as your
>  standard kernel, run lilo if appropriate, and reboot.
>  
>  To create the necessary devices in /dev, the "make_rd" script included in
> diff --git a/Documentation/blockdev/ramdisk.txt b/Documentation/blockdev/ramdisk.txt
> index 6c820ba..fa72e97 100644
> --- a/Documentation/blockdev/ramdisk.txt
> +++ b/Documentation/blockdev/ramdisk.txt
> @@ -64,9 +64,9 @@ the RAM disk dynamically grows as data is being written into it, a size field
>  is not required. Bits 11 to 13 are not currently used and may as well be zero.
>  These numbers are no magical secrets, as seen below:
>  
> -./arch/i386/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK     0x07FF
> -./arch/i386/kernel/setup.c:#define RAMDISK_PROMPT_FLAG          0x8000
> -./arch/i386/kernel/setup.c:#define RAMDISK_LOAD_FLAG            0x4000
> +./arch/x86/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK     0x07FF
> +./arch/x86/kernel/setup.c:#define RAMDISK_PROMPT_FLAG          0x8000
> +./arch/x86/kernel/setup.c:#define RAMDISK_LOAD_FLAG            0x4000
>  
>  Consider a typical two floppy disk setup, where you will have the
>  kernel on disk one, and have already put a RAM disk image onto disk #2.
> @@ -85,7 +85,7 @@ The command line equivalent is: "prompt_ramdisk=1"
>  Putting that together gives 2^15 + 2^14 + 0 = 49152 for an rdev word.
>  So to create disk one of the set, you would do:
>  
> -	/usr/src/linux# cat arch/i386/boot/zImage > /dev/fd0
> +	/usr/src/linux# cat arch/x86/boot/zImage > /dev/fd0
>  	/usr/src/linux# rdev /dev/fd0 /dev/fd0
>  	/usr/src/linux# rdev -r /dev/fd0 49152
>  
> diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
> index 6c30e93..ed07e4f 100644
> --- a/Documentation/cpu-freq/cpu-drivers.txt
> +++ b/Documentation/cpu-freq/cpu-drivers.txt
> @@ -168,7 +168,7 @@ in-chipset dynamic frequency switching to policy->min, the upper limit
>  to policy->max, and -if supported- select a performance-oriented
>  setting when policy->policy is CPUFREQ_POLICY_PERFORMANCE, and a
>  powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE. Also check
> -the reference implementation in arch/i386/kernel/cpu/cpufreq/longrun.c
> +the reference implementation in arch/x86/kernel/cpu/cpufreq/longrun.c
>  
>  
>  
> diff --git a/Documentation/filesystems/nfs/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt
> index 90c71c6..ffdd9d8 100644
> --- a/Documentation/filesystems/nfs/nfsroot.txt
> +++ b/Documentation/filesystems/nfs/nfsroot.txt
> @@ -226,7 +226,7 @@ They depend on various facilities being available:
>       	cdrecord.
>  
>  	e.g.
> -	  cdrecord dev=ATAPI:1,0,0 arch/i386/boot/image.iso
> +	  cdrecord dev=ATAPI:1,0,0 arch/x86/boot/image.iso
>  
>       	For more information on isolinux, including how to create bootdisks
>       	for prebuilt kernels, see http://syslinux.zytor.com/
> diff --git a/Documentation/isdn/README.HiSax b/Documentation/isdn/README.HiSax
> index 99e87a6..b1a573c 100644
> --- a/Documentation/isdn/README.HiSax
> +++ b/Documentation/isdn/README.HiSax
> @@ -506,7 +506,7 @@ to e.g. the Internet:
>       <ISDN subsystem - ISDN support -- HiSax>
>       make clean; make zImage; make modules; make modules_install
>  2. Install the new kernel
> -     cp /usr/src/linux/arch/i386/boot/zImage /etc/kernel/linux.isdn
> +     cp /usr/src/linux/arch/x86/boot/zImage /etc/kernel/linux.isdn
>       vi /etc/lilo.conf
>       <add new kernel in the bootable image section>
>       lilo
> diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
> index 47435e5..f47cdef 100644
> --- a/Documentation/kbuild/makefiles.txt
> +++ b/Documentation/kbuild/makefiles.txt
> @@ -441,7 +441,7 @@ more details, with real examples.
>  	specified if first option are not supported.
>  
>  	Example:
> -		#arch/i386/kernel/Makefile
> +		#arch/x86/kernel/Makefile
>  		vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
>  
>  	In the above example, vsyscall-flags will be assigned the option
> @@ -460,7 +460,7 @@ more details, with real examples.
>  	supported to use an optional second option.
>  
>  	Example:
> -		#arch/i386/Makefile
> +		#arch/x86/Makefile
>  		cflags-y += $(call cc-option,-march=pentium-mmx,-march=i586)
>  
>  	In the above example, cflags-y will be assigned the option
> @@ -522,7 +522,7 @@ more details, with real examples.
>  	even though the option was accepted by gcc.
>  
>  	Example:
> -		#arch/i386/Makefile
> +		#arch/x86/Makefile
>  		cflags-y += $(shell \
>  		if [ $(call cc-version) -ge 0300 ] ; then \
>  			echo "-mregparm=3"; fi ;)
> @@ -802,7 +802,7 @@ but in the architecture makefiles where the kbuild infrastructure
>  is not sufficient this sometimes needs to be explicit.
>  
>  	Example:
> -		#arch/i386/boot/Makefile
> +		#arch/x86/boot/Makefile
>  		subdir- := compressed/
>  
>  The above assignment instructs kbuild to descend down in the
> @@ -812,12 +812,12 @@ To support the clean infrastructure in the Makefiles that builds the
>  final bootimage there is an optional target named archclean:
>  
>  	Example:
> -		#arch/i386/Makefile
> +		#arch/x86/Makefile
>  		archclean:
> -			$(Q)$(MAKE) $(clean)=arch/i386/boot
> +			$(Q)$(MAKE) $(clean)=arch/x86/boot
>  
> -When "make clean" is executed, make will descend down in arch/i386/boot,
> -and clean as usual. The Makefile located in arch/i386/boot/ may use
> +When "make clean" is executed, make will descend down in arch/x86/boot,
> +and clean as usual. The Makefile located in arch/x86/boot/ may use
>  the subdir- trick to descend further down.
>  
>  Note 1: arch/$(ARCH)/Makefile cannot use "subdir-", because that file is
> @@ -882,7 +882,7 @@ When kbuild executes, the following steps are followed (roughly):
>  	LDFLAGS_vmlinux uses the LDFLAGS_$@ support.
>  
>  	Example:
> -		#arch/i386/Makefile
> +		#arch/x86/Makefile
>  		LDFLAGS_vmlinux := -e stext
>  
>      OBJCOPYFLAGS	objcopy flags
> @@ -920,14 +920,14 @@ When kbuild executes, the following steps are followed (roughly):
>  	Often, the KBUILD_CFLAGS variable depends on the configuration.
>  
>  	Example:
> -		#arch/i386/Makefile
> +		#arch/x86/Makefile
>  		cflags-$(CONFIG_M386) += -march=i386
>  		KBUILD_CFLAGS += $(cflags-y)
>  
>  	Many arch Makefiles dynamically run the target C compiler to
>  	probe supported options:
>  
> -		#arch/i386/Makefile
> +		#arch/x86/Makefile
>  
>  		...
>  		cflags-$(CONFIG_MPENTIUMII)     += $(call cc-option,\
> @@ -1038,8 +1038,8 @@ When kbuild executes, the following steps are followed (roughly):
>  	into the arch/$(ARCH)/boot/Makefile.
>  
>  	Example:
> -		#arch/i386/Makefile
> -		boot := arch/i386/boot
> +		#arch/x86/Makefile
> +		boot := arch/x86/boot
>  		bzImage: vmlinux
>  			$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
>  
> @@ -1051,7 +1051,7 @@ When kbuild executes, the following steps are followed (roughly):
>  	To support this, $(archhelp) must be defined.
>  
>  	Example:
> -		#arch/i386/Makefile
> +		#arch/x86/Makefile
>  		define archhelp
>  		  echo  '* bzImage      - Image (arch/$(ARCH)/boot/bzImage)'
>  		endif
> @@ -1065,7 +1065,7 @@ When kbuild executes, the following steps are followed (roughly):
>  	from vmlinux.
>  
>  	Example:
> -		#arch/i386/Makefile
> +		#arch/x86/Makefile
>  		all: bzImage
>  
>  	When "make" is executed without arguments, bzImage will be built.
> @@ -1083,7 +1083,7 @@ When kbuild executes, the following steps are followed (roughly):
>  	2) kbuild knows what files to delete during "make clean"
>  
>  	Example:
> -		#arch/i386/kernel/Makefile
> +		#arch/x86/kernel/Makefile
>  		extra-y := head.o init_task.o
>  
>  	In this example, extra-y is used to list object files that
> @@ -1133,7 +1133,7 @@ When kbuild executes, the following steps are followed (roughly):
>  	Compress target. Use maximum compression to compress target.
>  
>  	Example:
> -		#arch/i386/boot/Makefile
> +		#arch/x86/boot/Makefile
>  		LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
>  		LDFLAGS_setup    := -Ttext 0x0 -s --oformat binary -e begtext
>  
> @@ -1193,7 +1193,7 @@ When kbuild executes, the following steps are followed (roughly):
>  
>  	When updating the $(obj)/bzImage target, the line
>  
> -	BUILD    arch/i386/boot/bzImage
> +	BUILD    arch/x86/boot/bzImage
>  
>  	will be displayed with "make KBUILD_VERBOSE=0".
>  
> @@ -1207,7 +1207,7 @@ When kbuild executes, the following steps are followed (roughly):
>  	kbuild knows .lds files and includes a rule *lds.S -> *lds.
>  
>  	Example:
> -		#arch/i386/kernel/Makefile
> +		#arch/x86/kernel/Makefile
>  		always := vmlinux.lds
>  
>  		#Makefile
> diff --git a/Documentation/magic-number.txt b/Documentation/magic-number.txt
> index 4b12abc..20ec3d9 100644
> --- a/Documentation/magic-number.txt
> +++ b/Documentation/magic-number.txt
> @@ -66,7 +66,7 @@ MKISS_DRIVER_MAGIC    0x04bf      mkiss_channel     drivers/net/mkiss.h
>  RISCOM8_MAGIC         0x0907      riscom_port       drivers/char/riscom8.h
>  SPECIALIX_MAGIC       0x0907      specialix_port    drivers/char/specialix_io8.h
>  HDLC_MAGIC            0x239e      n_hdlc            drivers/char/n_hdlc.c
> -APM_BIOS_MAGIC        0x4101      apm_user          arch/i386/kernel/apm.c
> +APM_BIOS_MAGIC        0x4101      apm_user          arch/x86/kernel/apm.c
>  CYCLADES_MAGIC        0x4359      cyclades_port     include/linux/cyclades.h
>  DB_MAGIC              0x4442      fc_info           drivers/net/iph5526_novram.c
>  DL_MAGIC              0x444d      fc_info           drivers/net/iph5526_novram.c
> diff --git a/Documentation/mca.txt b/Documentation/mca.txt
> index 510375d..cf8fd39 100644
> --- a/Documentation/mca.txt
> +++ b/Documentation/mca.txt
> @@ -3,7 +3,7 @@ i386 Micro Channel Architecture Support
>  
>  MCA support is enabled using the CONFIG_MCA define.  A machine with a MCA
>  bus will have the kernel variable MCA_bus set, assuming the BIOS feature
> -bits are set properly (see arch/i386/boot/setup.S for information on
> +bits are set properly (see arch/x86/boot/setup.S for information on
>  how this detection is done).
>  
>  Adapter Detection
> @@ -11,7 +11,7 @@ Adapter Detection
>  
>  The ideal MCA adapter detection is done through the use of the
>  Programmable Option Select registers.  Generic functions for doing
> -this have been added in include/linux/mca.h and arch/i386/kernel/mca.c.
> +this have been added in include/linux/mca.h and arch/x86/kernel/mca.c.
>  Everything needed to detect adapters and read (and write) configuration
>  information is there.  A number of MCA-specific drivers already use
>  this.  The typical probe code looks like the following:
> @@ -81,7 +81,7 @@ more people use shared IRQs on PCI machines.
>  In general, an interrupt must be acknowledged not only at the ICU (which
>  is done automagically by the kernel), but at the device level.  In
>  particular, IRQ 0 must be reset after a timer interrupt (now done in
> -arch/i386/kernel/time.c) or the first timer interrupt hangs the system.
> +arch/x86/kernel/time.c) or the first timer interrupt hangs the system.
>  There were also problems with the 1.3.x floppy drivers, but that seems
>  to have been fixed.
>  
> diff --git a/Documentation/scheduler/sched-arch.txt b/Documentation/scheduler/sched-arch.txt
> index d43dbcb..28aa107 100644
> --- a/Documentation/scheduler/sched-arch.txt
> +++ b/Documentation/scheduler/sched-arch.txt
> @@ -66,7 +66,7 @@ Your cpu_idle routines need to obey the following rules:
>  	    barrier issued (followed by a test of need_resched with
>  	    interrupts disabled, as explained in 3).
>  
> -arch/i386/kernel/process.c has examples of both polling and
> +arch/x86/kernel/process.c has examples of both polling and
>  sleeping idle functions.
>  
>  
> diff --git a/Documentation/scsi/BusLogic.txt b/Documentation/scsi/BusLogic.txt
> index d7fbc94..48e982c 100644
> --- a/Documentation/scsi/BusLogic.txt
> +++ b/Documentation/scsi/BusLogic.txt
> @@ -553,7 +553,7 @@ replacing "/usr/src" with wherever you keep your Linux kernel source tree:
>    make config
>    make zImage
>  
> -Then install "arch/i386/boot/zImage" as your standard kernel, run lilo if
> +Then install "arch/x86/boot/zImage" as your standard kernel, run lilo if
>  appropriate, and reboot.
>  
>  
> diff --git a/Documentation/serial/computone.txt b/Documentation/serial/computone.txt
> index c57ea47..60a6f65 100644
> --- a/Documentation/serial/computone.txt
> +++ b/Documentation/serial/computone.txt
> @@ -87,7 +87,7 @@ c) Set address on ISA cards then:
>  	   edit /usr/src/linux/drivers/char/ip2.c  
>             (Optional - may be specified on kernel command line now)
>  d) Run "make zImage" or whatever target you prefer.
> -e) mv /usr/src/linux/arch/i386/boot/zImage to /boot.
> +e) mv /usr/src/linux/arch/x86/boot/zImage to /boot.
>  f) Add new config for this kernel into /etc/lilo.conf, run "lilo"
>  	or copy to a floppy disk and boot from that floppy disk.
>  g) Reboot using this kernel
> diff --git a/Documentation/svga.txt b/Documentation/svga.txt
> index cd66ec8..e5da082 100644
> --- a/Documentation/svga.txt
> +++ b/Documentation/svga.txt
> @@ -150,7 +150,7 @@ end of the display.
>  
>  4. Options
>  ~~~~~~~~~~
> -   Some options can be set in the source text (in arch/i386/boot/video.S).
> +   Some options can be set in the source text (in arch/x86/boot/video.S).
>  All of them are simple #define's -- change them to #undef's when you want to
>  switch them off. Currently supported:
>  
> diff --git a/Documentation/zh_CN/magic-number.txt b/Documentation/zh_CN/magic-number.txt
> index 4c4ce85..a9e6fdd 100644
> --- a/Documentation/zh_CN/magic-number.txt
> +++ b/Documentation/zh_CN/magic-number.txt
> @@ -66,7 +66,7 @@ MKISS_DRIVER_MAGIC    0x04bf      mkiss_channel     drivers/net/mkiss.h
>  RISCOM8_MAGIC         0x0907      riscom_port       drivers/char/riscom8.h
>  SPECIALIX_MAGIC       0x0907      specialix_port    drivers/char/specialix_io8.h
>  HDLC_MAGIC            0x239e      n_hdlc            drivers/char/n_hdlc.c
> -APM_BIOS_MAGIC        0x4101      apm_user          arch/i386/kernel/apm.c
> +APM_BIOS_MAGIC        0x4101      apm_user          arch/x86/kernel/apm.c
>  CYCLADES_MAGIC        0x4359      cyclades_port     include/linux/cyclades.h
>  DB_MAGIC              0x4442      fc_info           drivers/net/iph5526_novram.c
>  DL_MAGIC              0x444d      fc_info           drivers/net/iph5526_novram.c
> -- 
> 1.7.4.1
> 

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* [PATCH] IPVS netns exit causes crash in conntrack
From: Simon Horman @ 2011-06-13  8:47 UTC (permalink / raw)
  To: lvs-devel, netdev, netfilter-devel, netfilter
  Cc: Wensong Zhang, Julian Anastasov, Patrick McHardy,
	Pablo Neira Ayuso, Hans Schillstrom, Simon Horman
In-Reply-To: <1307954861-21592-1-git-send-email-horms@verge.net.au>

From: Hans Schillstrom <hans.schillstrom@ericsson.com>

Quote from Patric Mc Hardy
"This looks like nfnetlink.c excited and destroyed the nfnl socket, but
ip_vs was still holding a reference to a conntrack. When the conntrack
got destroyed it created a ctnetlink event, causing an oops in
netlink_has_listeners when trying to use the destroyed nfnetlink
socket."

If nf_conntrack_netlink is loaded before ip_vs this is not a problem.

This patch simply avoids calling ip_vs_conn_drop_conntrack()
when netns is dying as suggested by Julian.

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_conn.c |   10 +++++++++-
 net/netfilter/ipvs/ip_vs_core.c |    1 +
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index bf28ac2..782db27 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -776,8 +776,16 @@ static void ip_vs_conn_expire(unsigned long data)
 		if (cp->control)
 			ip_vs_control_del(cp);
 
-		if (cp->flags & IP_VS_CONN_F_NFCT)
+		if (cp->flags & IP_VS_CONN_F_NFCT) {
 			ip_vs_conn_drop_conntrack(cp);
+			/* Do not access conntracks during subsys cleanup
+			 * because nf_conntrack_find_get can not be used after
+			 * conntrack cleanup for the net.
+			 */
+			smp_rmb();
+			if (ipvs->enable)
+				ip_vs_conn_drop_conntrack(cp);
+		}
 
 		ip_vs_pe_put(cp->pe);
 		kfree(cp->pe_data);
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 55af224..24c28d2 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1945,6 +1945,7 @@ static void __net_exit __ip_vs_dev_cleanup(struct net *net)
 {
 	EnterFunction(2);
 	net_ipvs(net)->enable = 0;	/* Disable packet reception */
+	smp_wmb();
 	__ip_vs_sync_cleanup(net);
 	LeaveFunction(2);
 }
-- 
1.7.4.4


^ permalink raw reply related

* [GIT PULL nf-2.6] IPVS
From: Simon Horman @ 2011-06-13  8:47 UTC (permalink / raw)
  To: lvs-devel, netdev, netfilter-devel, netfilter
  Cc: Wensong Zhang, Julian Anastasov, Patrick McHardy,
	Pablo Neira Ayuso

Hi Pablo,

please consider pulling
git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-2.6.git master
to get the following fix from Hans.

I believe this change should be considered for -stable.

Hans Schillstrom (1):
      IPVS netns exit causes crash in conntrack


^ permalink raw reply


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