Netdev List
 help / color / mirror / Atom feed
* Re: batostr() function
From: Johannes Berg @ 2012-05-08 14:25 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, netdev
In-Reply-To: <CANq1E4QW4vSn_r9C=rirShE+-eyPjRX+b5tpC+mx69Hs6aEYqQ@mail.gmail.com>

On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> Hi Johannes
> 
> On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > Really? 2 static buffers that are used alternately based on a static
> > variable? How can that possibly be thread-safe? That may work in very
> > restricted scenarios, but ...
> 
> Looking at "git blame" it seems the whole function is still from
> linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> it, thanks.

I was thinking you could use %pM, but it seems BT addresses are stored
the wrong way around for some reason ...

johannes

^ permalink raw reply

* Re: batostr() function
From: Andrei Emeltchenko @ 2012-05-08 14:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: David Herrmann, linux-bluetooth, netdev
In-Reply-To: <1336487108.4320.2.camel@jlt3.sipsolutions.net>

On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
> On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> > Hi Johannes
> > 
> > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > > Really? 2 static buffers that are used alternately based on a static
> > > variable? How can that possibly be thread-safe? That may work in very
> > > restricted scenarios, but ...
> > 
> > Looking at "git blame" it seems the whole function is still from
> > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> > it, thanks.
> 
> I was thinking you could use %pM, but it seems BT addresses are stored
> the wrong way around for some reason ...

This looks like better idea then allocating buffers, we can use swap to
take care about "wrong order".

Best regards 
Andrei Emeltchenko 

^ permalink raw reply

* Re: [PATCH RFC 4/6] tun: orphan frags on xmit
From: Michael S. Tsirkin @ 2012-05-08 14:36 UTC (permalink / raw)
  To: Ian Campbell; +Cc: David Miller, netdev@vger.kernel.org, eric.dumazet@gmail.com
In-Reply-To: <248cee8310a8d41b58b988dfea94e75ee79c6647.1336397823.git.mst@redhat.com>

On Mon, May 07, 2012 at 04:54:46PM +0300, Michael S. Tsirkin wrote:
> tun xmit is actually receive of the internal tun
> socket. Orphan the frags same as we do for normal rx path.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

If tun is built as a module, skb_copy_ubufs needs to be exported:

---->

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

---

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 83b04d9..a809014 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -765,7 +765,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
 	skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
 	return 0;
 }
-
+EXPORT_SYMBOL_GPL(skb_copy_ubufs);
 
 /**
  *	skb_clone	-	duplicate an sk_buff

^ permalink raw reply related

* Re: [PATCH RFC 0/6] copy aside frags with destructors (was [PATCH 7/9] net: add skb_orphan_frags to copy aside frags with destructors)
From: Michael S. Tsirkin @ 2012-05-08 14:49 UTC (permalink / raw)
  To: Ian Campbell; +Cc: David Miller, netdev@vger.kernel.org, eric.dumazet@gmail.com
In-Reply-To: <1336474451.14542.63.camel@zakaz.uk.xensource.com>

On Tue, May 08, 2012 at 11:54:11AM +0100, Ian Campbell wrote:
> On Tue, 2012-05-08 at 10:41 +0100, Michael S. Tsirkin wrote:
> > On Mon, May 07, 2012 at 04:53:46PM +0300, Michael S. Tsirkin wrote:
> > > > > > But I fear we're about to toss Ian into yet another rabbit hole. :-)
> > > > > > 
> > > > > > Let's try to converge on something quickly as I think integration of
> > > > > > his work has been delayed enough as-is.
> > 
> > ...
> > 
> > > Here's a first stub at a fix. Basically to be able to modify frags on
> > > the fly we must make sure the skb isn't cloned, so the moment someone
> > > clones the skb we need to trigger the frag copy logic.  And this is
> > > exactly what happens with SKBTX_DEV_ZEROCOPY so it seems to make sense
> > > to reuse that logic.
> > > 
> > > The below patchset replaces patch 7
> > > ([PATCH 7/9] net: add skb_orphan_frags to copy aside frags with destructors)
> > > in Ian's patchset and needs to be applied there.
> > > 
> > > 
> > > Compiled only but I'd like to hear what people think all the same
> > > because it does add a couple of branches on fast path.  On the other
> > > hand this makes it generic so the same logic will be reusable for packet
> > > sockets (which IIRC are currently buggy in the same way as sunrpc) and
> > > for adding zero copy support to tun.
> > > 
> > > Please comment,
> > > Thanks!
> > 
> > Ian, just to stress, need your ack that this does what you wanted.
> 
> Sure, yesterday was a public holiday and today looks likely to be crazy
> busy. I'll try and have a look later in the week.
> 
> Ian.
> 

In case you or anyone else has cycles to test this, here's the
updated tree, net-next based - so far I verified that it builds and boots
and regular networking works, but didn't test nfs yet.

git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git refs/heads/zerocopy

^ permalink raw reply

* Re: [PATCH] ipv4: Fixed checkpatch warnings and errors
From: Ben Greear @ 2012-05-08 15:13 UTC (permalink / raw)
  To: Cristian Chilipirea
  Cc: davem, kuznet, jmorris, yoshfuji, kaber, netdev, linux-kernel,
	daniel.baluta
In-Reply-To: <1336474704-9366-1-git-send-email-cristian.chilipirea@gmail.com>

On 05/08/2012 03:58 AM, Cristian Chilipirea wrote:
> Fixed warnings and errors in af_inet.c.

>   #ifdef CONFIG_COMPAT
> -static int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
> +static int inet_compat_ioctl(struct socket *sock, unsigned int cmd,
> +		unsigned long arg)
>   {

That is so much worse than what was there before.

Lets stop useless checkpatch crap on existing code
unless it's really ugly.

Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply

* [PATCH net-next 2/4] netxen_nic: Allow only useful and recommended firmware dump capture mask values
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko, Manish chopra
In-Reply-To: <1336489288-22347-1-git-send-email-rajesh.borundia@qlogic.com>

From: Manish chopra <manish.chopra@qlogic.com>

o 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F and 0xFF are the allowed capture masks.

Signed-off-by: Manish chopra <manish.chopra@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic.h    |    4 ++++
 .../ethernet/qlogic/netxen/netxen_nic_ethtool.c    |   18 ++++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index b5de8a7..b8614af 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -1201,6 +1201,10 @@ typedef struct {
 #define NX_FORCE_FW_RESET               0xdeaddead
 
 
+/* Fw dump levels */
+static const u32 FW_DUMP_LEVELS[] = {
+	0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };
+
 /* Flash read/write address */
 #define NX_FW_DUMP_REG1         0x00130060
 #define NX_FW_DUMP_REG2         0x001e0000
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
index 8c39299..3973040 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
@@ -834,7 +834,7 @@ netxen_get_dump_flag(struct net_device *netdev, struct ethtool_dump *dump)
 static int
 netxen_set_dump(struct net_device *netdev, struct ethtool_dump *val)
 {
-	int ret = 0;
+	int i;
 	struct netxen_adapter *adapter = netdev_priv(netdev);
 	struct netxen_minidump *mdump = &adapter->mdump;
 
@@ -844,7 +844,7 @@ netxen_set_dump(struct net_device *netdev, struct ethtool_dump *val)
 			mdump->md_enabled = 1;
 		if (adapter->fw_mdump_rdy) {
 			netdev_info(netdev, "Previous dump not cleared, not forcing dump\n");
-			return ret;
+			return 0;
 		}
 		netdev_info(netdev, "Forcing a fw dump\n");
 		nx_dev_request_reset(adapter);
@@ -867,19 +867,21 @@ netxen_set_dump(struct net_device *netdev, struct ethtool_dump *val)
 		adapter->flags &= ~NETXEN_FW_RESET_OWNER;
 		break;
 	default:
-		if (val->flag <= NX_DUMP_MASK_MAX &&
-			val->flag >= NX_DUMP_MASK_MIN) {
-			mdump->md_capture_mask = val->flag & 0xff;
-			netdev_info(netdev, "Driver mask changed to: 0x%x\n",
+		for (i = 0; i < ARRAY_SIZE(FW_DUMP_LEVELS); i++) {
+			if (val->flag == FW_DUMP_LEVELS[i]) {
+				mdump->md_capture_mask = val->flag;
+				netdev_info(netdev,
+					"Driver mask changed to: 0x%x\n",
 					mdump->md_capture_mask);
-			break;
+				return 0;
+			}
 		}
 		netdev_info(netdev,
 			"Invalid dump level: 0x%x\n", val->flag);
 		return -EINVAL;
 	}
 
-	return ret;
+	return 0;
 }
 
 static int
-- 
1.7.3.3

^ permalink raw reply related

* [PATCH 0/4] netxen: Fixes
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko

Please apply it to net-next.

^ permalink raw reply

* [PATCH net-next 1/4] netxen_nic: disable minidump by default
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko, Sritej Velaga
In-Reply-To: <1336489288-22347-1-git-send-email-rajesh.borundia@qlogic.com>

From: Sritej Velaga <sritej.velaga@qlogic.com>

disable fw dump by default at start up.

Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 .../net/ethernet/qlogic/netxen/netxen_nic_ctx.c    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
index f3c0057..c86ea12 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
@@ -229,7 +229,7 @@ netxen_setup_minidump(struct netxen_adapter *adapter)
 				adapter->mdump.md_template;
 	adapter->mdump.md_capture_buff = NULL;
 	adapter->mdump.fw_supports_md = 1;
-	adapter->mdump.md_enabled = 1;
+	adapter->mdump.md_enabled = 0;
 
 	return err;
 
-- 
1.7.3.3

^ permalink raw reply related

* [PATCH net-next 4/4] netxen_nic: Fix estimation of recv MSS in case of LRO
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko
In-Reply-To: <1336489288-22347-1-git-send-email-rajesh.borundia@qlogic.com>

o Linux stack estimates MSS from skb->len or skb_shinfo(skb)->gso_size.
In case of LRO skb->len is aggregate of len of number of packets hence MSS
obtained using skb->len would be incorrect. Incorrect estimation of recv MSS
would lead to delayed acks in some traffic patterns (which sends two or three
packets and wait for ack and only then send remaining packets). This leads to
drop in performance. Hence we need to set gso_size to MSS obtained from firmware.

o This is fixed recently in firmware hence the MSS is obtained based on
capability. If fw is capable of sending the MSS then only driver sets the gso_size.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic.h    |   10 ++++++++--
 .../net/ethernet/qlogic/netxen/netxen_nic_ctx.c    |    3 +++
 .../net/ethernet/qlogic/netxen/netxen_nic_hdr.h    |    1 +
 .../net/ethernet/qlogic/netxen/netxen_nic_init.c   |    4 +++-
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |    9 ++++++++-
 5 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index a43a26c..36ae0ae 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -53,8 +53,8 @@
 
 #define _NETXEN_NIC_LINUX_MAJOR 4
 #define _NETXEN_NIC_LINUX_MINOR 0
-#define _NETXEN_NIC_LINUX_SUBVERSION 78
-#define NETXEN_NIC_LINUX_VERSIONID  "4.0.78"
+#define _NETXEN_NIC_LINUX_SUBVERSION 79
+#define NETXEN_NIC_LINUX_VERSIONID  "4.0.79"
 
 #define NETXEN_VERSION_CODE(a, b, c)	(((a) << 24) + ((b) << 16) + (c))
 #define _major(v)	(((v) >> 24) & 0xff)
@@ -419,6 +419,8 @@ struct rcv_desc {
 	(((sts_data) >> 52) & 0x1)
 #define netxen_get_lro_sts_seq_number(sts_data)		\
 	((sts_data) & 0x0FFFFFFFF)
+#define netxen_get_lro_sts_mss(sts_data1)		\
+	((sts_data1 >> 32) & 0x0FFFF)
 
 
 struct status_desc {
@@ -794,6 +796,7 @@ struct netxen_cmd_args {
 #define NX_CAP0_JUMBO_CONTIGUOUS	NX_CAP_BIT(0, 7)
 #define NX_CAP0_LRO_CONTIGUOUS		NX_CAP_BIT(0, 8)
 #define NX_CAP0_HW_LRO			NX_CAP_BIT(0, 10)
+#define NX_CAP0_HW_LRO_MSS		NX_CAP_BIT(0, 21)
 
 /*
  * Context state
@@ -1073,6 +1076,8 @@ typedef struct {
 #define NX_FW_CAPABILITY_FVLANTX		(1 << 9)
 #define NX_FW_CAPABILITY_HW_LRO			(1 << 10)
 #define NX_FW_CAPABILITY_GBE_LINK_CFG		(1 << 11)
+#define NX_FW_CAPABILITY_MORE_CAPS		(1 << 31)
+#define NX_FW_CAPABILITY_2_LRO_MAX_TCP_SEG	(1 << 2)
 
 /* module types */
 #define LINKEVENT_MODULE_NOT_PRESENT			1
@@ -1155,6 +1160,7 @@ typedef struct {
 #define NETXEN_NIC_BRIDGE_ENABLED       0X10
 #define NETXEN_NIC_DIAG_ENABLED		0x20
 #define NETXEN_FW_RESET_OWNER           0x40
+#define NETXEN_FW_MSS_CAP	        0x80
 #define NETXEN_IS_MSI_FAMILY(adapter) \
 	((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED))
 
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
index c86ea12..7f556a8 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
@@ -328,6 +328,9 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
 	cap = (NX_CAP0_LEGACY_CONTEXT | NX_CAP0_LEGACY_MN);
 	cap |= (NX_CAP0_JUMBO_CONTIGUOUS | NX_CAP0_LRO_CONTIGUOUS);
 
+	if (adapter->flags & NETXEN_FW_MSS_CAP)
+		cap |= NX_CAP0_HW_LRO_MSS;
+
 	prq->capabilities[0] = cpu_to_le32(cap);
 	prq->host_int_crb_mode =
 		cpu_to_le32(NX_HOST_INT_CRB_MODE_SHARED);
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
index a41106b..28e0769 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
@@ -776,6 +776,7 @@ enum {
 #define CRB_SW_INT_MASK_3		(NETXEN_NIC_REG(0x1e8))
 
 #define CRB_FW_CAPABILITIES_1		(NETXEN_CAM_RAM(0x128))
+#define CRB_FW_CAPABILITIES_2		(NETXEN_CAM_RAM(0x12c))
 #define CRB_MAC_BLOCK_START		(NETXEN_CAM_RAM(0x1c0))
 
 /*
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
index 718b274..0d725dc 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
@@ -1131,7 +1131,6 @@ netxen_validate_firmware(struct netxen_adapter *adapter)
 		 _build(file_fw_ver));
 		return -EINVAL;
 	}
-
 	val = nx_get_bios_version(adapter);
 	netxen_rom_fast_read(adapter, NX_BIOS_VERSION_OFFSET, (int *)&bios);
 	if ((__force u32)val != bios) {
@@ -1661,6 +1660,9 @@ netxen_process_lro(struct netxen_adapter *adapter,
 
 	length = skb->len;
 
+	if (adapter->flags & NETXEN_FW_MSS_CAP)
+		skb_shinfo(skb)->gso_size  =  netxen_get_lro_sts_mss(sts_data1);
+
 	netif_receive_skb(skb);
 
 	adapter->stats.lro_pkts++;
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 05f3ffe..b025940 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -1184,6 +1184,7 @@ netxen_nic_attach(struct netxen_adapter *adapter)
 	int err, ring;
 	struct nx_host_rds_ring *rds_ring;
 	struct nx_host_tx_ring *tx_ring;
+	u32 capab2;
 
 	if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC)
 		return 0;
@@ -1192,6 +1193,13 @@ netxen_nic_attach(struct netxen_adapter *adapter)
 	if (err)
 		return err;
 
+	adapter->flags &= ~NETXEN_FW_MSS_CAP;
+	if (adapter->capabilities & NX_FW_CAPABILITY_MORE_CAPS) {
+		capab2 = NXRD32(adapter, CRB_FW_CAPABILITIES_2);
+		if (capab2 & NX_FW_CAPABILITY_2_LRO_MAX_TCP_SEG)
+			adapter->flags |= NETXEN_FW_MSS_CAP;
+	}
+
 	err = netxen_napi_add(adapter, netdev);
 	if (err)
 		return err;
@@ -1810,7 +1818,6 @@ netxen_tso_check(struct net_device *netdev,
 		flags = FLAGS_VLAN_TAGGED;
 
 	} else if (vlan_tx_tag_present(skb)) {
-
 		flags = FLAGS_VLAN_OOB;
 		vid = vlan_tx_tag_get(skb);
 		netxen_set_tx_vlan_tci(first_desc, vid);
-- 
1.7.3.3

^ permalink raw reply related

* [PATCH net-next 3/4] netxen: added miniDIMM support in driver.
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko, Sucheta Chakraborty
In-Reply-To: <1336489288-22347-1-git-send-email-rajesh.borundia@qlogic.com>

From: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

Driver queries DIMM information from firmware and accordingly
sets "presence" field of the structure.
"presence" field when set to 0xff denotes invalid flag. And when
set to 0x0 denotes DIMM memory is not present.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic.h    |    7 +
 .../net/ethernet/qlogic/netxen/netxen_nic_hdr.h    |   25 ++++
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |  131 ++++++++++++++++++++
 3 files changed, 163 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index b8614af..a43a26c 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -1818,6 +1818,13 @@ struct netxen_brdinfo {
 	char short_name[NETXEN_MAX_SHORT_NAME];
 };
 
+struct netxen_dimm_cfg {
+	u8 presence;
+	u8 mem_type;
+	u8 dimm_type;
+	u32 size;
+};
+
 static const struct netxen_brdinfo netxen_boards[] = {
 	{NETXEN_BRDTYPE_P2_SB31_10G_CX4, 1, "XGb CX4"},
 	{NETXEN_BRDTYPE_P2_SB31_10G_HMEZ, 1, "XGb HMEZ"},
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
index b1a897c..a41106b 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
@@ -955,6 +955,31 @@ enum {
 #define NX_CRB_DEV_REF_COUNT		(NETXEN_CAM_RAM(0x138))
 #define NX_CRB_DEV_STATE		(NETXEN_CAM_RAM(0x140))
 
+/* MiniDIMM related macros */
+#define NETXEN_DIMM_CAPABILITY		(NETXEN_CAM_RAM(0x258))
+#define NETXEN_DIMM_PRESENT			0x1
+#define NETXEN_DIMM_MEMTYPE_DDR2_SDRAM	0x2
+#define NETXEN_DIMM_SIZE			0x4
+#define NETXEN_DIMM_MEMTYPE(VAL)		((VAL >> 3) & 0xf)
+#define	NETXEN_DIMM_NUMROWS(VAL)		((VAL >> 7) & 0xf)
+#define	NETXEN_DIMM_NUMCOLS(VAL)		((VAL >> 11) & 0xf)
+#define	NETXEN_DIMM_NUMRANKS(VAL)		((VAL >> 15) & 0x3)
+#define NETXEN_DIMM_DATAWIDTH(VAL)		((VAL >> 18) & 0x3)
+#define NETXEN_DIMM_NUMBANKS(VAL)		((VAL >> 21) & 0xf)
+#define NETXEN_DIMM_TYPE(VAL)		((VAL >> 25) & 0x3f)
+#define NETXEN_DIMM_VALID_FLAG		0x80000000
+
+#define NETXEN_DIMM_MEM_DDR2_SDRAM	0x8
+
+#define NETXEN_DIMM_STD_MEM_SIZE	512
+
+#define NETXEN_DIMM_TYPE_RDIMM	0x1
+#define NETXEN_DIMM_TYPE_UDIMM	0x2
+#define NETXEN_DIMM_TYPE_SO_DIMM	0x4
+#define NETXEN_DIMM_TYPE_Micro_DIMM	0x8
+#define NETXEN_DIMM_TYPE_Mini_RDIMM	0x10
+#define NETXEN_DIMM_TYPE_Mini_UDIMM	0x20
+
 /* Device State */
 #define NX_DEV_COLD		1
 #define NX_DEV_INITALIZING	2
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 65a718f..05f3ffe 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -2926,6 +2926,134 @@ static struct bin_attribute bin_attr_mem = {
 	.write = netxen_sysfs_write_mem,
 };
 
+static ssize_t
+netxen_sysfs_read_dimm(struct file *filp, struct kobject *kobj,
+		struct bin_attribute *attr,
+		char *buf, loff_t offset, size_t size)
+{
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct netxen_adapter *adapter = dev_get_drvdata(dev);
+	struct net_device *netdev = adapter->netdev;
+	struct netxen_dimm_cfg dimm;
+	u8 dw, rows, cols, banks, ranks;
+	u32 val;
+
+	if (size != sizeof(struct netxen_dimm_cfg)) {
+		netdev_err(netdev, "Invalid size\n");
+		return -1;
+	}
+
+	memset(&dimm, 0, sizeof(struct netxen_dimm_cfg));
+	val = NXRD32(adapter, NETXEN_DIMM_CAPABILITY);
+
+	/* Checks if DIMM info is valid. */
+	if (val & NETXEN_DIMM_VALID_FLAG) {
+		netdev_err(netdev, "Invalid DIMM flag\n");
+		dimm.presence = 0xff;
+		goto out;
+	}
+
+	rows = NETXEN_DIMM_NUMROWS(val);
+	cols = NETXEN_DIMM_NUMCOLS(val);
+	ranks = NETXEN_DIMM_NUMRANKS(val);
+	banks = NETXEN_DIMM_NUMBANKS(val);
+	dw = NETXEN_DIMM_DATAWIDTH(val);
+
+	dimm.presence = (val & NETXEN_DIMM_PRESENT);
+
+	/* Checks if DIMM info is present. */
+	if (!dimm.presence) {
+		netdev_err(netdev, "DIMM not present\n");
+		goto out;
+	}
+
+	dimm.dimm_type = NETXEN_DIMM_TYPE(val);
+
+	switch (dimm.dimm_type) {
+	case NETXEN_DIMM_TYPE_RDIMM:
+	case NETXEN_DIMM_TYPE_UDIMM:
+	case NETXEN_DIMM_TYPE_SO_DIMM:
+	case NETXEN_DIMM_TYPE_Micro_DIMM:
+	case NETXEN_DIMM_TYPE_Mini_RDIMM:
+	case NETXEN_DIMM_TYPE_Mini_UDIMM:
+		break;
+	default:
+		netdev_err(netdev, "Invalid DIMM type %x\n", dimm.dimm_type);
+		goto out;
+	}
+
+	if (val & NETXEN_DIMM_MEMTYPE_DDR2_SDRAM)
+		dimm.mem_type = NETXEN_DIMM_MEM_DDR2_SDRAM;
+	else
+		dimm.mem_type = NETXEN_DIMM_MEMTYPE(val);
+
+	if (val & NETXEN_DIMM_SIZE) {
+		dimm.size = NETXEN_DIMM_STD_MEM_SIZE;
+		goto out;
+	}
+
+	if (!rows) {
+		netdev_err(netdev, "Invalid no of rows %x\n", rows);
+		goto out;
+	}
+
+	if (!cols) {
+		netdev_err(netdev, "Invalid no of columns %x\n", cols);
+		goto out;
+	}
+
+	if (!banks) {
+		netdev_err(netdev, "Invalid no of banks %x\n", banks);
+		goto out;
+	}
+
+	ranks += 1;
+
+	switch (dw) {
+	case 0x0:
+		dw = 32;
+		break;
+	case 0x1:
+		dw = 33;
+		break;
+	case 0x2:
+		dw = 36;
+		break;
+	case 0x3:
+		dw = 64;
+		break;
+	case 0x4:
+		dw = 72;
+		break;
+	case 0x5:
+		dw = 80;
+		break;
+	case 0x6:
+		dw = 128;
+		break;
+	case 0x7:
+		dw = 144;
+		break;
+	default:
+		netdev_err(netdev, "Invalid data-width %x\n", dw);
+		goto out;
+	}
+
+	dimm.size = ((1 << rows) * (1 << cols) * dw * banks * ranks) / 8;
+	/* Size returned in MB. */
+	dimm.size = (dimm.size) / 0x100000;
+out:
+	memcpy(buf, &dimm, sizeof(struct netxen_dimm_cfg));
+	return sizeof(struct netxen_dimm_cfg);
+
+}
+
+static struct bin_attribute bin_attr_dimm = {
+	.attr = {.name = "dimm", .mode = (S_IRUGO | S_IWUSR)},
+	.size = 0,
+	.read = netxen_sysfs_read_dimm,
+};
+
 
 static void
 netxen_create_sysfs_entries(struct netxen_adapter *adapter)
@@ -2963,6 +3091,8 @@ netxen_create_diag_entries(struct netxen_adapter *adapter)
 		dev_info(dev, "failed to create crb sysfs entry\n");
 	if (device_create_bin_file(dev, &bin_attr_mem))
 		dev_info(dev, "failed to create mem sysfs entry\n");
+	if (device_create_bin_file(dev, &bin_attr_dimm))
+		dev_info(dev, "failed to create dimm sysfs entry\n");
 }
 
 
@@ -2975,6 +3105,7 @@ netxen_remove_diag_entries(struct netxen_adapter *adapter)
 	device_remove_file(dev, &dev_attr_diag_mode);
 	device_remove_bin_file(dev, &bin_attr_crb);
 	device_remove_bin_file(dev, &bin_attr_mem);
+	device_remove_bin_file(dev, &bin_attr_dimm);
 }
 
 #ifdef CONFIG_INET
-- 
1.7.3.3

^ permalink raw reply related

* Re: SLUB warning in netfilter code on shutdown
From: Christoph Lameter @ 2012-05-08 15:33 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Pablo Neira Ayuso, Patrick McHardy, netfilter-devel, netfilter,
	coreteam, netdev, Pekka Enberg
In-Reply-To: <20120508112236.GA15404@otc-wbsnb-06>

On Tue, 8 May 2012, Kirill A. Shutemov wrote:

> On Tue, May 08, 2012 at 02:19:24PM +0300, Kirill A. Shutemov wrote:
> > Hi,
> >
> > Screenshot attached.
>
> It's v3.4-rc6 on x86_64. Config attached.

Cannot see the bug report but I guess this is a message related to object
remaining on kmem_cache_destroy? We have other reports on that one as
well. The IPI reduction patch introduces a bug in has_cpu_slab().

Modify the return statement to

return c->page || c->partial;

^ permalink raw reply

* Re: [PATCH] net: compare_ether_addr[_64bits]() has no ordering
From: Joe Perches @ 2012-05-08 16:44 UTC (permalink / raw)
  To: David Miller; +Cc: johannes, eric.dumazet, netdev
In-Reply-To: <20120508.033120.1272130362698029549.davem@davemloft.net>

On Tue, 2012-05-08 at 03:31 -0400, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Mon, 07 May 2012 23:35:36 -0700
> 
> > On Tue, 2012-05-08 at 02:26 -0400, David Miller wrote:
> >> From: Johannes Berg <johannes@sipsolutions.net>
> >> Date: Tue, 08 May 2012 07:25:44 +0200
> >> 
> >> > I suppose I could fix those first and then later change the type, but I
> >> > think having a "compare_ether_addr" function that returns *false* when
> >> > they *match* would be rather confusing. I'd rather have
> >> > "equal_ether_addr()" that returns *true* when they match.
> >> > 
> >> > I guess we could introduce equal_ether_addr() though and slowly convert,
> >> > keeping compare_ether_addr() as a sort of wrapper around it.
> >> 
> >> Indeed, this is one way to proceed.
> > 
> > perhaps is_equal_ether_addr or is_same_ether_addr instead?
> 
> Hmmm, my first choice would have been "eth_addr_equal()"

Perhaps ether_addr_equal for some API naming semi-consistency.

$ grep "\bint.*is_.*ether_addr" include/linux/etherdevice.h
static inline int is_zero_ether_addr(const u8 *addr)
static inline int is_multicast_ether_addr(const u8 *addr)
static inline int is_local_ether_addr(const u8 *addr)
static inline int is_broadcast_ether_addr(const u8 *addr)
static inline int is_unicast_ether_addr(const u8 *addr)
static inline int is_valid_ether_addr(const u8 *addr)

Perhaps all of these should be bool too
(patch in a separate email)

^ permalink raw reply

* [PATCH] etherdev.h: Convert int is_<foo>_ether_addr to bool
From: Joe Perches @ 2012-05-08 16:44 UTC (permalink / raw)
  To: David Miller; +Cc: johannes, eric.dumazet, netdev
In-Reply-To: <20120508.033120.1272130362698029549.davem@davemloft.net>

Make the return value explicitly true or false.

Signed-off-by: Joe Perches <joe@perches.com>

---

I grepped through the uses, there are a couple of
tests that store to an int that are unaffected.

There are also a couple of senseless tests of
	is_broadcast_ether_addr() || is_multicast_ether_addr()
in staging that could be improved.

 include/linux/etherdevice.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 8a18358..46a95ef 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -59,7 +59,7 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
  *
  * Return true if the address is all zeroes.
  */
-static inline int is_zero_ether_addr(const u8 *addr)
+static inline bool is_zero_ether_addr(const u8 *addr)
 {
 	return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
 }
@@ -71,7 +71,7 @@ static inline int is_zero_ether_addr(const u8 *addr)
  * Return true if the address is a multicast address.
  * By definition the broadcast address is also a multicast address.
  */
-static inline int is_multicast_ether_addr(const u8 *addr)
+static inline bool is_multicast_ether_addr(const u8 *addr)
 {
 	return 0x01 & addr[0];
 }
@@ -82,7 +82,7 @@ static inline int is_multicast_ether_addr(const u8 *addr)
  *
  * Return true if the address is a local address.
  */
-static inline int is_local_ether_addr(const u8 *addr)
+static inline bool is_local_ether_addr(const u8 *addr)
 {
 	return 0x02 & addr[0];
 }
@@ -93,7 +93,7 @@ static inline int is_local_ether_addr(const u8 *addr)
  *
  * Return true if the address is the broadcast address.
  */
-static inline int is_broadcast_ether_addr(const u8 *addr)
+static inline bool is_broadcast_ether_addr(const u8 *addr)
 {
 	return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff;
 }
@@ -104,7 +104,7 @@ static inline int is_broadcast_ether_addr(const u8 *addr)
  *
  * Return true if the address is a unicast address.
  */
-static inline int is_unicast_ether_addr(const u8 *addr)
+static inline bool is_unicast_ether_addr(const u8 *addr)
 {
 	return !is_multicast_ether_addr(addr);
 }
@@ -118,7 +118,7 @@ static inline int is_unicast_ether_addr(const u8 *addr)
  *
  * Return true if the address is valid.
  */
-static inline int is_valid_ether_addr(const u8 *addr)
+static inline bool is_valid_ether_addr(const u8 *addr)
 {
 	/* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
 	 * explicitly check for it here. */

^ permalink raw reply related

* Re: [PATCH 00/25] [v2] netfilter updates for net-next (upcoming 3.5)
From: David Miller @ 2012-05-08 16:49 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1336463394-3119-1-git-send-email-pablo@netfilter.org>

From: pablo@netfilter.org
Date: Tue,  8 May 2012 09:49:29 +0200

> Second version including requested updates.

There were lots of conflicts, due to my merge of net into net-next.

Those were easy enough, but the result doesn't build.

net/netfilter/nf_conntrack_helper.c: In function ‘nf_conntrack_helper_init_sysctl’:
net/netfilter/nf_conntrack_helper.c:65:2: error: implicit declaration of function ‘register_net_sysctl_table’ [-Werror=implicit-function-declaration]
net/netfilter/nf_conntrack_helper.c:66:4: error: ‘nf_net_netfilter_sysctl_path’ undeclared (first use in this function)
net/netfilter/nf_conntrack_helper.c:66:4: note: each undeclared identifier is reported only once for each function it appears in

^ permalink raw reply

* Re: [PATCH net-next 2/4] netxen_nic: Allow only useful and recommended firmware dump capture mask values
From: David Miller @ 2012-05-08 16:52 UTC (permalink / raw)
  To: rajesh.borundia; +Cc: netdev, ameen.rahman, sony.chacko, manish.chopra
In-Reply-To: <1336489288-22347-3-git-send-email-rajesh.borundia@qlogic.com>

From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Tue, 8 May 2012 08:01:26 -0700

> +/* Fw dump levels */
> +static const u32 FW_DUMP_LEVELS[] = {
> +	0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };

Format this more reasonably, this looks terrible.

^ permalink raw reply

* Re: [PATCH net-next 3/4] netxen: added miniDIMM support in driver.
From: David Miller @ 2012-05-08 16:53 UTC (permalink / raw)
  To: rajesh.borundia; +Cc: netdev, ameen.rahman, sony.chacko, sucheta.chakraborty
In-Reply-To: <1336489288-22347-4-git-send-email-rajesh.borundia@qlogic.com>

From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Tue, 8 May 2012 08:01:27 -0700

> +static struct bin_attribute bin_attr_dimm = {
> +	.attr = {.name = "dimm", .mode = (S_IRUGO | S_IWUSR)},

How about a space next to the braces?

^ permalink raw reply

* Re: [PATCH] ipv4: Fixed checkpatch warnings and errors
From: David Miller @ 2012-05-08 17:01 UTC (permalink / raw)
  To: greearb
  Cc: cristian.chilipirea, kuznet, jmorris, yoshfuji, kaber, netdev,
	linux-kernel, daniel.baluta
In-Reply-To: <4FA9382A.9090709@candelatech.com>

From: Ben Greear <greearb@candelatech.com>
Date: Tue, 08 May 2012 08:13:46 -0700

> On 05/08/2012 03:58 AM, Cristian Chilipirea wrote:
>> Fixed warnings and errors in af_inet.c.
> 
>>   #ifdef CONFIG_COMPAT
>> -static int inet_compat_ioctl(struct socket *sock, unsigned int cmd,
>> -unsigned long arg)
>> +static int inet_compat_ioctl(struct socket *sock, unsigned int cmd,
>> +		unsigned long arg)
>>   {
> 
> That is so much worse than what was there before.
> 
> Lets stop useless checkpatch crap on existing code
> unless it's really ugly.

Agreed, this patch is terrible.

^ permalink raw reply

* Re: [PATCH] etherdev.h: Convert int is_<foo>_ether_addr to bool
From: David Miller @ 2012-05-08 17:07 UTC (permalink / raw)
  To: joe; +Cc: johannes, eric.dumazet, netdev
In-Reply-To: <1336495480.29640.19.camel@joe2Laptop>

From: Joe Perches <joe@perches.com>
Date: Tue, 08 May 2012 09:44:40 -0700

> Make the return value explicitly true or false.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Looks good, applied, thanks Joe.

^ permalink raw reply

* Re: [PATCH 00/25] [v2] netfilter updates for net-next (upcoming 3.5)
From: Pablo Neira Ayuso @ 2012-05-08 17:10 UTC (permalink / raw)
  To: David Miller; +Cc: netfilter-devel, netdev
In-Reply-To: <20120508.124926.2241646617733136639.davem@davemloft.net>

On Tue, May 08, 2012 at 12:49:26PM -0400, David Miller wrote:
> From: pablo@netfilter.org
> Date: Tue,  8 May 2012 09:49:29 +0200
> 
> > Second version including requested updates.
> 
> There were lots of conflicts, due to my merge of net into net-next.
> 
> Those were easy enough, but the result doesn't build.
> 
> net/netfilter/nf_conntrack_helper.c: In function ‘nf_conntrack_helper_init_sysctl’:
> net/netfilter/nf_conntrack_helper.c:65:2: error: implicit declaration of function ‘register_net_sysctl_table’ [-Werror=implicit-function-declaration]
> net/netfilter/nf_conntrack_helper.c:66:4: error: ‘nf_net_netfilter_sysctl_path’ undeclared (first use in this function)
> net/netfilter/nf_conntrack_helper.c:66:4: note: each undeclared identifier is reported only once for each function it appears in

Strange, this compiles here. Probably you have to add the following
include to net/netfilter/nf_conntrack_helper.c:

#include <net/net_namespace.h>

I can rebase all my patches on top of fresh tree, fix all conflicts
myself and send you another patchset that will apply to your current
tree.

Please, let me know how to proceed.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 00/25] [v2] netfilter updates for net-next (upcoming 3.5)
From: David Miller @ 2012-05-08 17:12 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <20120508171049.GA16205@1984>

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue, 8 May 2012 19:10:49 +0200

> I can rebase all my patches on top of fresh tree, fix all conflicts
> myself and send you another patchset that will apply to your current
> tree.
> 
> Please, let me know how to proceed.

Yes, please build a tree that compiles properly :-)

The error is pretty trivial to reproduce, just "allmodconfig" like I
do.

^ permalink raw reply

* Re: batostr() function
From: Joe Perches @ 2012-05-08 17:18 UTC (permalink / raw)
  To: Andrei Emeltchenko
  Cc: Johannes Berg, David Herrmann,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA, netdev
In-Reply-To: <20120508143011.GD29352@aemeltch-MOBL1>

On Tue, 2012-05-08 at 17:30 +0300, Andrei Emeltchenko wrote:
> On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
> > On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> > > Hi Johannes
> > > 
> > > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:
> > > > Really? 2 static buffers that are used alternately based on a static
> > > > variable? How can that possibly be thread-safe? That may work in very
> > > > restricted scenarios, but ...
> > > 
> > > Looking at "git blame" it seems the whole function is still from
> > > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> > > it, thanks.
> > 
> > I was thinking you could use %pM, but it seems BT addresses are stored
> > the wrong way around for some reason ...
> 
> This looks like better idea then allocating buffers, we can use swap to
> take care about "wrong order".

https://lkml.org/lkml/2010/12/3/358

^ permalink raw reply

* Re: batostr() function
From: Johannes Berg @ 2012-05-08 17:48 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrei Emeltchenko, David Herrmann, linux-bluetooth, netdev,
	Luis R. Rodriguez
In-Reply-To: <1336497532.29640.24.camel@joe2Laptop>

On Tue, 2012-05-08 at 10:18 -0700, Joe Perches wrote:
> On Tue, 2012-05-08 at 17:30 +0300, Andrei Emeltchenko wrote:
> > On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
> > > On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> > > > Hi Johannes
> > > > 
> > > > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > > > > Really? 2 static buffers that are used alternately based on a static
> > > > > variable? How can that possibly be thread-safe? That may work in very
> > > > > restricted scenarios, but ...
> > > > 
> > > > Looking at "git blame" it seems the whole function is still from
> > > > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> > > > it, thanks.
> > > 
> > > I was thinking you could use %pM, but it seems BT addresses are stored
> > > the wrong way around for some reason ...
> > 
> > This looks like better idea then allocating buffers, we can use swap to
> > take care about "wrong order".
> 
> https://lkml.org/lkml/2010/12/3/358

Pretty much what I had in mind, thanks. Luis, you'll notice that this
will be a pain to backport in compat. :-)

johannes

^ permalink raw reply

* Re: [PATCH] net: update the usage of CHECKSUM_UNNECESSARY
From: Michael S. Tsirkin @ 2012-05-08 17:48 UTC (permalink / raw)
  To: Yi Zou; +Cc: netdev, devel, bhutchings, jeffrey.t.kirsher
In-Reply-To: <20120319211241.11291.53271.stgit@localhost6.localdomain6>

On Mon, Mar 19, 2012 at 02:12:41PM -0700, Yi Zou wrote:
> As suggested by Ben, this adds the clarification on the usage of
> CHECKSUM_UNNECESSARY on the outgoing patch. Also add the usage
> description of NETIF_F_FCOE_CRC and CHECKSUM_UNNECESSARY
> for the kernel FCoE protocol driver.
> 
> This is a follow-up to the following:
> http://patchwork.ozlabs.org/patch/147315/
> 
> Signed-off-by: Yi Zou <yi.zou@intel.com>
> Cc: Ben Hutchings <bhutchings@solarflare.com>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Cc: www.Open-FCoE.org <devel@open-fcoe.org>
> ---
> 
>  include/linux/skbuff.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 8dc8257..a2b9953 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -94,6 +94,13 @@
>   *			  about CHECKSUM_UNNECESSARY. 8)
>   *	NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
>   *
> + *	UNNECESSARY: device will do per protocol specific csum. Protocol drivers
> + *	that do not want net to perform the checksum calculation should use
> + *	this flag in their outgoing skbs.
> + *	NETIF_F_FCOE_CRC  this indicates the device can do FCoE FC CRC
> + *			  offload. Correspondingly, the FCoE protocol driver
> + *			  stack should use CHECKSUM_UNNECESSARY.
> + *
>   *	Any questions? No questions, good. 		--ANK
>   */
>  

So just to make sure I understand, you never get
UNNECESSARY packets on tx unless you declared NETIF_F_FCOE_CRC?

Maybe the comment says this somehow but could not figure it out.



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

^ permalink raw reply

* Re: [PATCH] net: update the usage of CHECKSUM_UNNECESSARY
From: Ben Hutchings @ 2012-05-08 18:20 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
	devel-s9riP+hp16TNLxjTenLetw
In-Reply-To: <20120508174831.GA27406-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Tue, 2012-05-08 at 20:48 +0300, Michael S. Tsirkin wrote:
> On Mon, Mar 19, 2012 at 02:12:41PM -0700, Yi Zou wrote:
> > As suggested by Ben, this adds the clarification on the usage of
> > CHECKSUM_UNNECESSARY on the outgoing patch. Also add the usage
> > description of NETIF_F_FCOE_CRC and CHECKSUM_UNNECESSARY
> > for the kernel FCoE protocol driver.
> > 
> > This is a follow-up to the following:
> > http://patchwork.ozlabs.org/patch/147315/
> > 
> > Signed-off-by: Yi Zou <yi.zou-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > Cc: Ben Hutchings <bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
> > Cc: Jeff Kirsher <jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > Cc: www.Open-FCoE.org <devel-s9riP+hp16TNLxjTenLetw@public.gmane.org>
> > ---
> > 
> >  include/linux/skbuff.h |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> > 
> > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> > index 8dc8257..a2b9953 100644
> > --- a/include/linux/skbuff.h
> > +++ b/include/linux/skbuff.h
> > @@ -94,6 +94,13 @@
> >   *			  about CHECKSUM_UNNECESSARY. 8)
> >   *	NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
> >   *
> > + *	UNNECESSARY: device will do per protocol specific csum. Protocol drivers
> > + *	that do not want net to perform the checksum calculation should use
> > + *	this flag in their outgoing skbs.
> > + *	NETIF_F_FCOE_CRC  this indicates the device can do FCoE FC CRC
> > + *			  offload. Correspondingly, the FCoE protocol driver
> > + *			  stack should use CHECKSUM_UNNECESSARY.
> > + *
> >   *	Any questions? No questions, good. 		--ANK
> >   */
> >  
> 
> So just to make sure I understand, you never get
> UNNECESSARY packets on tx unless you declared NETIF_F_FCOE_CRC?
> 
> Maybe the comment says this somehow but could not figure it out.

That's what should happen now.  In future CHECKSUM_UNNECESSARY could be
used on output by other protocols which don't use TCP/IP-style
checksums, but always dependent on the output device supporting the
relevant offload feature.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: batostr() function
From: Luis R. Rodriguez @ 2012-05-08 18:26 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Joe Perches, Andrei Emeltchenko, David Herrmann,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA, netdev
In-Reply-To: <1336499313.4320.4.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>

On Tue, May 8, 2012 at 10:48 AM, Johannes Berg
<johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:
> On Tue, 2012-05-08 at 10:18 -0700, Joe Perches wrote:
>> On Tue, 2012-05-08 at 17:30 +0300, Andrei Emeltchenko wrote:
>> > On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
>> > > On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
>> > > > Hi Johannes
>> > > >
>> > > > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:
>> > > > > Really? 2 static buffers that are used alternately based on a static
>> > > > > variable? How can that possibly be thread-safe? That may work in very
>> > > > > restricted scenarios, but ...
>> > > >
>> > > > Looking at "git blame" it seems the whole function is still from
>> > > > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
>> > > > it, thanks.
>> > >
>> > > I was thinking you could use %pM, but it seems BT addresses are stored
>> > > the wrong way around for some reason ...
>> >
>> > This looks like better idea then allocating buffers, we can use swap to
>> > take care about "wrong order".
>>
>> https://lkml.org/lkml/2010/12/3/358
>
> Pretty much what I had in mind, thanks. Luis, you'll notice that this
> will be a pain to backport in compat. :-)

Mumble grumble. Oh well! :) I'm starting to enjoy the curve balls.

  Luis

^ 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