Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next 2/2] PPC: net: bpf_jit_comp: add VLAN instructions for BPF JIT
From: David Miller @ 2012-11-18  3:13 UTC (permalink / raw)
  To: matt; +Cc: dxchgb, benh, netdev
In-Reply-To: <45EBCE3A-FE92-4A8D-B5D8-DED4E30DF419@ozlabs.org>

From: Matt Evans <matt@ozlabs.org>
Date: Sat, 17 Nov 2012 00:06:03 +0000

> Hi,
> 
> On 08/11/2012, at 9:41 PM, Daniel Borkmann wrote:
> 
>> This patch is a follow-up for patch "net: filter: add vlan tag access"
>> to support the new VLAN_TAG/VLAN_TAG_PRESENT accessors in BPF JIT.
>> 
>> Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
>> Cc: Matt Evans <matt@ozlabs.org>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> ---
>> Disclaimer: uncompiled and untested, since I don't have a PPC machine,
>> but it should (hopefully) integrate cleanly; impl. after PPC instruction
>> reference.
> 
> And for this too,
> 
> Acked-by: Matt Evans <matt@ozlabs.org>
> 
> Sorry for the delay in reviewing this!

Applied, thanks for reviewing.

^ permalink raw reply

* [PATCH RFC 1/2] ixp4xx_eth: avoid calling dma_pool_create() with NULL dev
From: Xi Wang @ 2012-11-18  6:25 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: netdev, Xi Wang, Andrew Morton

Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
See also
https://lkml.org/lkml/2012/11/14/11
---
 drivers/net/ethernet/xscale/ixp4xx_eth.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 98934bd..477d672 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1102,10 +1102,12 @@ static int init_queues(struct port *port)
 {
 	int i;
 
-	if (!ports_open)
-		if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
-						 POOL_ALLOC_SIZE, 32, 0)))
+	if (!ports_open) {
+		dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
+					   POOL_ALLOC_SIZE, 32, 0);
+		if (!dma_pool)
 			return -ENOMEM;
+	}
 
 	if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
 					      &port->desc_tab_phys)))
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH RFC 2/2] ixp4xx_hss: avoid calling dma_pool_create() with NULL dev
From: Xi Wang @ 2012-11-18  6:25 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: netdev, Xi Wang, Andrew Morton
In-Reply-To: <1353219910-24690-1-git-send-email-xi.wang@gmail.com>

Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
See also
https://lkml.org/lkml/2012/11/14/11
---
 drivers/net/wan/ixp4xx_hss.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index 3f575af..e9a3da5 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -969,10 +969,12 @@ static int init_hdlc_queues(struct port *port)
 {
 	int i;
 
-	if (!ports_open)
-		if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
-						 POOL_ALLOC_SIZE, 32, 0)))
+	if (!ports_open) {
+		dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
+					   POOL_ALLOC_SIZE, 32, 0);
+		if (!dma_pool)
 			return -ENOMEM;
+	}
 
 	if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
 					      &port->desc_tab_phys)))
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 2/2] qlcnic: fix sparse warnings
From: Sony Chacko @ 2012-11-18  7:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Sony Chacko
In-Reply-To: <1353222279-15736-1-git-send-email-sony.chacko@qlogic.com>

From: Sony Chacko <sony.chacko@qlogic.com>

qlcnic_hw.c:1337:17: warning: cast removes address space of expression
qlcnic_hw.c:1337:17: warning: incorrect type in argument 2 (different address spaces)
qlcnic_hw.c:1337:17:    expected void volatile [noderef] <asn:2>*addr
qlcnic_hw.c:1337:17:    got void *<noident>
qlcnic_hw.c:1337:17: warning: cast removes address space of expression
qlcnic_hw.c:1337:17: warning: incorrect type in argument 1 (different address spaces)
qlcnic_hw.c:1337:17:    expected void const volatile [noderef] <asn:2>*addr
qlcnic_hw.c:1337:17:    got void *<noident>

The above warnings are originating from the macros QLCNIC_RD_DUMP_REG and
QLCNIC_WR_DUMP_REG.
The warnings are fixed and macros are replaced with equivalent functions
in the only file from where it is called.

The following warnings are fixed by making the functions static.

qlcnic_hw.c:543:5: warning: symbol 'qlcnic_set_fw_loopback' was not declared. Should it be static?
qlcnic_init.c:1853:6: warning: symbol 'qlcnic_process_rcv_diag' was not declared. Should it be static?

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h  | 16 ----
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c   | 98 +++++++++++++++---------
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c |  4 +-
 3 files changed, 65 insertions(+), 53 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h
index 28a6b28..bd5030e 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h
@@ -792,22 +792,6 @@ static const u32 MIU_TEST_READ_DATA[] = {
 #define QLCNIC_FLASH_SEM2_ULK	0x0013C014
 #define QLCNIC_FLASH_LOCK_ID	0x001B2100
 
-#define QLCNIC_RD_DUMP_REG(addr, bar0, data) do {			\
-	writel((addr & 0xFFFF0000), (void *) (bar0 +			\
-		QLCNIC_FW_DUMP_REG1));					\
-	readl((void *) (bar0 + QLCNIC_FW_DUMP_REG1));			\
-	*data = readl((void *) (bar0 + QLCNIC_FW_DUMP_REG2 +		\
-		LSW(addr)));						\
-} while (0)
-
-#define QLCNIC_WR_DUMP_REG(addr, bar0, data) do {			\
-	writel((addr & 0xFFFF0000), (void *) (bar0 +			\
-		QLCNIC_FW_DUMP_REG1));					\
-	readl((void *) (bar0 + QLCNIC_FW_DUMP_REG1));			\
-	writel(data, (void *) (bar0 + QLCNIC_FW_DUMP_REG2 + LSW(addr)));\
-	readl((void *) (bar0 + QLCNIC_FW_DUMP_REG2 + LSW(addr)));	\
-} while (0)
-
 /* PCI function operational mode */
 enum {
 	QLCNIC_MGMT_FUNC	= 0,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index fc308c8..bd3e766 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -266,6 +266,33 @@ static const unsigned crb_hub_agt[64] = {
 	0,
 };
 
+static void qlcnic_read_dump_reg(u32 addr, void __iomem *bar0, u32 *data)
+{
+	u32 dest;
+	void __iomem *window_reg;
+
+	dest = addr & 0xFFFF0000;
+	window_reg = bar0 + QLCNIC_FW_DUMP_REG1;
+	writel(dest, window_reg);
+	readl(window_reg);
+	window_reg = bar0 + QLCNIC_FW_DUMP_REG2 + LSW(addr);
+	*data = readl(window_reg);
+}
+
+static void qlcnic_write_dump_reg(u32 addr, void __iomem *bar0, u32 data)
+{
+	u32 dest;
+	void __iomem *window_reg;
+
+	dest = addr & 0xFFFF0000;
+	window_reg = bar0 + QLCNIC_FW_DUMP_REG1;
+	writel(dest, window_reg);
+	readl(window_reg);
+	window_reg = bar0 + QLCNIC_FW_DUMP_REG2 + LSW(addr);
+	writel(data, window_reg);
+	readl(window_reg);
+}
+
 /*  PCI Windowing for DDR regions.  */
 
 #define QLCNIC_PCIE_SEM_TIMEOUT	10000
@@ -540,7 +567,7 @@ void qlcnic_delete_lb_filters(struct qlcnic_adapter *adapter)
 	}
 }
 
-int qlcnic_set_fw_loopback(struct qlcnic_adapter *adapter, u8 flag)
+static int qlcnic_set_fw_loopback(struct qlcnic_adapter *adapter, u8 flag)
 {
 	struct qlcnic_nic_req req;
 	int rv;
@@ -1334,7 +1361,7 @@ qlcnic_dump_crb(struct qlcnic_adapter *adapter, struct qlcnic_dump_entry *entry,
 	addr = crb->addr;
 
 	for (i = 0; i < crb->no_ops; i++) {
-		QLCNIC_RD_DUMP_REG(addr, base, &data);
+		qlcnic_read_dump_reg(addr, base, &data);
 		*buffer++ = cpu_to_le32(addr);
 		*buffer++ = cpu_to_le32(data);
 		addr += crb->stride;
@@ -1364,25 +1391,25 @@ qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
 				continue;
 			switch (1 << k) {
 			case QLCNIC_DUMP_WCRB:
-				QLCNIC_WR_DUMP_REG(addr, base, ctr->val1);
+				qlcnic_write_dump_reg(addr, base, ctr->val1);
 				break;
 			case QLCNIC_DUMP_RWCRB:
-				QLCNIC_RD_DUMP_REG(addr, base, &data);
-				QLCNIC_WR_DUMP_REG(addr, base, data);
+				qlcnic_read_dump_reg(addr, base, &data);
+				qlcnic_write_dump_reg(addr, base, data);
 				break;
 			case QLCNIC_DUMP_ANDCRB:
-				QLCNIC_RD_DUMP_REG(addr, base, &data);
-				QLCNIC_WR_DUMP_REG(addr, base,
-					(data & ctr->val2));
+				qlcnic_read_dump_reg(addr, base, &data);
+				qlcnic_write_dump_reg(addr, base,
+						      data & ctr->val2);
 				break;
 			case QLCNIC_DUMP_ORCRB:
-				QLCNIC_RD_DUMP_REG(addr, base, &data);
-				QLCNIC_WR_DUMP_REG(addr, base,
-					(data | ctr->val3));
+				qlcnic_read_dump_reg(addr, base, &data);
+				qlcnic_write_dump_reg(addr, base,
+						      data | ctr->val3);
 				break;
 			case QLCNIC_DUMP_POLLCRB:
 				while (timeout <= ctr->timeout) {
-					QLCNIC_RD_DUMP_REG(addr, base, &data);
+					qlcnic_read_dump_reg(addr, base, &data);
 					if ((data & ctr->val2) == ctr->val1)
 						break;
 					msleep(1);
@@ -1397,7 +1424,7 @@ qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
 			case QLCNIC_DUMP_RD_SAVE:
 				if (ctr->index_a)
 					addr = t_hdr->saved_state[ctr->index_a];
-				QLCNIC_RD_DUMP_REG(addr, base, &data);
+				qlcnic_read_dump_reg(addr, base, &data);
 				t_hdr->saved_state[ctr->index_v] = data;
 				break;
 			case QLCNIC_DUMP_WRT_SAVED:
@@ -1407,7 +1434,7 @@ qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
 					data = ctr->val1;
 				if (ctr->index_a)
 					addr = t_hdr->saved_state[ctr->index_a];
-				QLCNIC_WR_DUMP_REG(addr, base, data);
+				qlcnic_write_dump_reg(addr, base, data);
 				break;
 			case QLCNIC_DUMP_MOD_SAVE_ST:
 				data = t_hdr->saved_state[ctr->index_v];
@@ -1441,8 +1468,8 @@ qlcnic_dump_mux(struct qlcnic_adapter *adapter, struct qlcnic_dump_entry *entry,
 
 	val = mux->val;
 	for (loop = 0; loop < mux->no_ops; loop++) {
-		QLCNIC_WR_DUMP_REG(mux->addr, base, val);
-		QLCNIC_RD_DUMP_REG(mux->read_addr, base, &data);
+		qlcnic_write_dump_reg(mux->addr, base, val);
+		qlcnic_read_dump_reg(mux->read_addr, base, &data);
 		*buffer++ = cpu_to_le32(val);
 		*buffer++ = cpu_to_le32(data);
 		val += mux->val_stride;
@@ -1463,10 +1490,10 @@ qlcnic_dump_que(struct qlcnic_adapter *adapter, struct qlcnic_dump_entry *entry,
 	cnt = que->read_addr_cnt;
 
 	for (loop = 0; loop < que->no_ops; loop++) {
-		QLCNIC_WR_DUMP_REG(que->sel_addr, base, que_id);
+		qlcnic_write_dump_reg(que->sel_addr, base, que_id);
 		addr = que->read_addr;
 		for (i = 0; i < cnt; i++) {
-			QLCNIC_RD_DUMP_REG(addr, base, &data);
+			qlcnic_read_dump_reg(addr, base, &data);
 			*buffer++ = cpu_to_le32(data);
 			addr += que->read_addr_stride;
 		}
@@ -1514,9 +1541,9 @@ lock_try:
 	writel(adapter->ahw->pci_func, (base + QLCNIC_FLASH_LOCK_ID));
 	for (i = 0; i < size; i++) {
 		addr = fl_addr & 0xFFFF0000;
-		QLCNIC_WR_DUMP_REG(FLASH_ROM_WINDOW, base, addr);
+		qlcnic_write_dump_reg(FLASH_ROM_WINDOW, base, addr);
 		addr = LSW(fl_addr) + FLASH_ROM_DATA;
-		QLCNIC_RD_DUMP_REG(addr, base, &val);
+		qlcnic_read_dump_reg(addr, base, &val);
 		fl_addr += 4;
 		*buffer++ = cpu_to_le32(val);
 	}
@@ -1536,12 +1563,12 @@ qlcnic_dump_l1_cache(struct qlcnic_adapter *adapter,
 	val = l1->init_tag_val;
 
 	for (i = 0; i < l1->no_ops; i++) {
-		QLCNIC_WR_DUMP_REG(l1->addr, base, val);
-		QLCNIC_WR_DUMP_REG(l1->ctrl_addr, base, LSW(l1->ctrl_val));
+		qlcnic_write_dump_reg(l1->addr, base, val);
+		qlcnic_write_dump_reg(l1->ctrl_addr, base, LSW(l1->ctrl_val));
 		addr = l1->read_addr;
 		cnt = l1->read_addr_num;
 		while (cnt) {
-			QLCNIC_RD_DUMP_REG(addr, base, &data);
+			qlcnic_read_dump_reg(addr, base, &data);
 			*buffer++ = cpu_to_le32(data);
 			addr += l1->read_addr_stride;
 			cnt--;
@@ -1566,14 +1593,14 @@ qlcnic_dump_l2_cache(struct qlcnic_adapter *adapter,
 	poll_to = MSB(MSW(l2->ctrl_val));
 
 	for (i = 0; i < l2->no_ops; i++) {
-		QLCNIC_WR_DUMP_REG(l2->addr, base, val);
+		qlcnic_write_dump_reg(l2->addr, base, val);
 		if (LSW(l2->ctrl_val))
-			QLCNIC_WR_DUMP_REG(l2->ctrl_addr, base,
-				LSW(l2->ctrl_val));
+			qlcnic_write_dump_reg(l2->ctrl_addr, base,
+					      LSW(l2->ctrl_val));
 		if (!poll_mask)
 			goto skip_poll;
 		do {
-			QLCNIC_RD_DUMP_REG(l2->ctrl_addr, base, &data);
+			qlcnic_read_dump_reg(l2->ctrl_addr, base, &data);
 			if (!(data & poll_mask))
 				break;
 			msleep(1);
@@ -1590,7 +1617,7 @@ skip_poll:
 		addr = l2->read_addr;
 		cnt = l2->read_addr_num;
 		while (cnt) {
-			QLCNIC_RD_DUMP_REG(addr, base, &data);
+			qlcnic_read_dump_reg(addr, base, &data);
 			*buffer++ = cpu_to_le32(data);
 			addr += l2->read_addr_stride;
 			cnt--;
@@ -1622,13 +1649,13 @@ qlcnic_read_memory(struct qlcnic_adapter *adapter,
 	mutex_lock(&adapter->ahw->mem_lock);
 
 	while (reg_read != 0) {
-		QLCNIC_WR_DUMP_REG(MIU_TEST_ADDR_LO, base, addr);
-		QLCNIC_WR_DUMP_REG(MIU_TEST_ADDR_HI, base, 0);
-		QLCNIC_WR_DUMP_REG(MIU_TEST_CTR, base,
-			TA_CTL_ENABLE | TA_CTL_START);
+		qlcnic_write_dump_reg(MIU_TEST_ADDR_LO, base, addr);
+		qlcnic_write_dump_reg(MIU_TEST_ADDR_HI, base, 0);
+		qlcnic_write_dump_reg(MIU_TEST_CTR, base,
+				      TA_CTL_ENABLE | TA_CTL_START);
 
 		for (i = 0; i < MAX_CTL_CHECK; i++) {
-			QLCNIC_RD_DUMP_REG(MIU_TEST_CTR, base, &test);
+			qlcnic_read_dump_reg(MIU_TEST_CTR, base, &test);
 			if (!(test & TA_CTL_BUSY))
 				break;
 		}
@@ -1641,7 +1668,8 @@ qlcnic_read_memory(struct qlcnic_adapter *adapter,
 			}
 		}
 		for (i = 0; i < 4; i++) {
-			QLCNIC_RD_DUMP_REG(MIU_TEST_READ_DATA[i], base, &data);
+			qlcnic_read_dump_reg(MIU_TEST_READ_DATA[i], base,
+					     &data);
 			*buffer++ = cpu_to_le32(data);
 		}
 		addr += 16;
@@ -1661,7 +1689,7 @@ qlcnic_dump_nop(struct qlcnic_adapter *adapter,
 	return 0;
 }
 
-struct qlcnic_dump_operations fw_dump_ops[] = {
+static const struct qlcnic_dump_operations fw_dump_ops[] = {
 	{ QLCNIC_DUMP_NOP, qlcnic_dump_nop },
 	{ QLCNIC_DUMP_READ_CRB, qlcnic_dump_crb },
 	{ QLCNIC_DUMP_READ_MUX, qlcnic_dump_mux },
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
index faae9c5..a7f5bbe 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
@@ -1849,8 +1849,8 @@ static void dump_skb(struct sk_buff *skb, struct qlcnic_adapter *adapter)
 	}
 }
 
-void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, int ring,
-			     u64 sts_data0)
+static void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, int ring,
+				    u64 sts_data0)
 {
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
 	struct sk_buff *skb;
-- 
1.8.0

^ permalink raw reply related

* [PATCH 1/2] qlcnic: fix compiler warnings
From: Sony Chacko @ 2012-11-18  7:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Sony Chacko
In-Reply-To: <1353222279-15736-1-git-send-email-sony.chacko@qlogic.com>

From: Sony Chacko <sony.chacko@qlogic.com>

Fix the following warnings:

qlcnic_main.c: In function 'qlcnic_update_cmd_producer':
qlcnic_main.c:119:51: warning: unused parameter 'adapter' [-Wunused-parameter]
qlcnic_main.c:119: warning: unused parameter adapter
qlcnic_init.c: In function qlcnic_process_lro
qlcnic_init.c:1586: warning: unused parameter sds_ring
qlcnic_init.c: In function qlcnic_process_rcv_diag
qlcnic_init.c:1854: warning: unused parameter sds_ring
qlcnic_init.c: In function qlcnic_fetch_mac
qlcnic_init.c:1938: warning: unused parameter adapter

warning: 'pci_using_dac' may be used uninitialized in this function [-Wmaybe-uninitialized]
qlcnic_main.c:1569:10: note: 'pci_using_dac' was declared here

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h      |  5 ++---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c  |  2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c   |  2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 16 ++++++----------
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 17 +++++++----------
 5 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index eaa1db9..8b3d3b3 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1530,9 +1530,8 @@ int qlcnic_set_features(struct net_device *netdev, netdev_features_t features);
 int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable);
 int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable);
 int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter);
-void qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
-		struct qlcnic_host_tx_ring *tx_ring);
-void qlcnic_fetch_mac(struct qlcnic_adapter *, u32, u32, u8, u8 *);
+void qlcnic_update_cmd_producer(struct qlcnic_host_tx_ring *);
+void qlcnic_fetch_mac(u32, u32, u8, u8 *);
 void qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring);
 void qlcnic_clear_lb_mode(struct qlcnic_adapter *adapter);
 int qlcnic_set_lb_mode(struct qlcnic_adapter *adapter, u8 mode);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index 2a179d0..bbd3b30 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -671,7 +671,7 @@ int qlcnic_get_mac_address(struct qlcnic_adapter *adapter, u8 *mac)
 	err = cmd.rsp.cmd;
 
 	if (err == QLCNIC_RCODE_SUCCESS)
-		qlcnic_fetch_mac(adapter, cmd.rsp.arg1, cmd.rsp.arg2, 0, mac);
+		qlcnic_fetch_mac(cmd.rsp.arg1, cmd.rsp.arg2, 0, mac);
 	else {
 		dev_err(&adapter->pdev->dev,
 			"Failed to get mac address%d\n", err);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 2a0c9dc..fc308c8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -350,7 +350,7 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
 
 	tx_ring->producer = producer;
 
-	qlcnic_update_cmd_producer(adapter, tx_ring);
+	qlcnic_update_cmd_producer(tx_ring);
 
 	__netif_tx_unlock_bh(tx_ring->txq);
 
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
index 0bcda9c..faae9c5 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
@@ -1583,7 +1583,6 @@ qlcnic_process_rcv(struct qlcnic_adapter *adapter,
 
 static struct qlcnic_rx_buffer *
 qlcnic_process_lro(struct qlcnic_adapter *adapter,
-		struct qlcnic_host_sds_ring *sds_ring,
 		int ring, u64 sts_data0, u64 sts_data1)
 {
 	struct net_device *netdev = adapter->netdev;
@@ -1698,8 +1697,8 @@ qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max)
 		case QLCNIC_LRO_DESC:
 			ring = qlcnic_get_lro_sts_type(sts_data0);
 			sts_data1 = le64_to_cpu(desc->status_desc_data[1]);
-			rxbuf = qlcnic_process_lro(adapter, sds_ring,
-					ring, sts_data0, sts_data1);
+			rxbuf = qlcnic_process_lro(adapter, ring, sts_data0,
+						   sts_data1);
 			break;
 		case QLCNIC_RESPONSE_DESC:
 			qlcnic_handle_fw_message(desc_cnt, consumer, sds_ring);
@@ -1850,9 +1849,8 @@ static void dump_skb(struct sk_buff *skb, struct qlcnic_adapter *adapter)
 	}
 }
 
-void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter,
-		struct qlcnic_host_sds_ring *sds_ring,
-		int ring, u64 sts_data0)
+void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, int ring,
+			     u64 sts_data0)
 {
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
 	struct sk_buff *skb;
@@ -1920,7 +1918,7 @@ qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
 		break;
 	default:
 		ring = qlcnic_get_sts_type(sts_data0);
-		qlcnic_process_rcv_diag(adapter, sds_ring, ring, sts_data0);
+		qlcnic_process_rcv_diag(adapter, ring, sts_data0);
 		break;
 	}
 
@@ -1934,9 +1932,7 @@ qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
 	writel(consumer, sds_ring->crb_sts_consumer);
 }
 
-void
-qlcnic_fetch_mac(struct qlcnic_adapter *adapter, u32 off1, u32 off2,
-			u8 alt_mac, u8 *mac)
+void qlcnic_fetch_mac(u32 off1, u32 off2, u8 alt_mac, u8 *mac)
 {
 	u32 mac_low, mac_high;
 	int i;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 24ad17e..4109a41 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -115,9 +115,7 @@ static DEFINE_PCI_DEVICE_TABLE(qlcnic_pci_tbl) = {
 MODULE_DEVICE_TABLE(pci, qlcnic_pci_tbl);
 
 
-inline void
-qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
-		struct qlcnic_host_tx_ring *tx_ring)
+inline void qlcnic_update_cmd_producer(struct qlcnic_host_tx_ring *tx_ring)
 {
 	writel(tx_ring->producer, tx_ring->crb_cmd_producer);
 }
@@ -1485,8 +1483,8 @@ qlcnic_reset_context(struct qlcnic_adapter *adapter)
 }
 
 static int
-qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
-		struct net_device *netdev, u8 pci_using_dac)
+qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
+		    int pci_using_dac)
 {
 	int err;
 	struct pci_dev *pdev = adapter->pdev;
@@ -1506,7 +1504,7 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
 
 	if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO)
 		netdev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6;
-	if (pci_using_dac)
+	if (pci_using_dac == 1)
 		netdev->hw_features |= NETIF_F_HIGHDMA;
 
 	netdev->vlan_features = netdev->hw_features;
@@ -1530,7 +1528,7 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
 	return 0;
 }
 
-static int qlcnic_set_dma_mask(struct pci_dev *pdev, u8 *pci_using_dac)
+static int qlcnic_set_dma_mask(struct pci_dev *pdev, int *pci_using_dac)
 {
 	if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
 			!pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)))
@@ -1564,9 +1562,8 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct net_device *netdev = NULL;
 	struct qlcnic_adapter *adapter = NULL;
-	int err;
+	int err, pci_using_dac = -1;
 	uint8_t revision_id;
-	uint8_t pci_using_dac;
 	char brd_name[QLCNIC_MAX_BOARD_NAME_LEN];
 
 	err = pci_enable_device(pdev);
@@ -2337,7 +2334,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	adapter->stats.txbytes += skb->len;
 	adapter->stats.xmitcalled++;
 
-	qlcnic_update_cmd_producer(adapter, tx_ring);
+	qlcnic_update_cmd_producer(tx_ring);
 
 	return NETDEV_TX_OK;
 
-- 
1.8.0

^ permalink raw reply related

* [PATCH 0/2] qlcnic: fix warnings
From: Sony Chacko @ 2012-11-18  7:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Sony Chacko

From: Sony Chacko <sony.chacko@qlogic.com>

Please apply to net-next.

Thanks,
Sony

^ permalink raw reply

* Re: [PATCH 0/2] qlcnic: fix warnings
From: David Miller @ 2012-11-18  7:32 UTC (permalink / raw)
  To: sony.chacko; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1353222279-15736-1-git-send-email-sony.chacko@qlogic.com>

From: Sony Chacko <sony.chacko@qlogic.com>
Date: Sun, 18 Nov 2012 02:04:37 -0500

> From: Sony Chacko <sony.chacko@qlogic.com>
> 
> Please apply to net-next.

Both applied, thanks.

^ permalink raw reply

* Re: [PATCH] openvswitch: Make IPv6 packet parsing dependent on IPv6 config
From: David Miller @ 2012-11-18  7:34 UTC (permalink / raw)
  To: vyasevic; +Cc: netdev, jesse, dev, fengguang.wu
In-Reply-To: <1353094881-28867-1-git-send-email-vyasevic@redhat.com>

From: Vlad Yasevich <vyasevic@redhat.com>
Date: Fri, 16 Nov 2012 14:41:21 -0500

> Ok.  How about this approach instead.  This keeps core functions we need
> still dependent on CONFIG_NET and makes new GSO stuff depend on CONFIG_INET
> since its quite useless without CONFIG_INET anyway...
 ...
> Subject: [PATCH] ipv6: Preserve ipv6 functionality needed by NET
> 
> Some pieces of network use core pieces of IPv6 stack.  Keep
> them available while letting new GSO offload pieces depend
> on CONFIG_INET.
> 
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>

Looks good, applied, thanks Vlad.

^ permalink raw reply

* [net-next:master 83/84] drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19: sparse: incorrect type in return expression (different base types)
From: kbuild test robot @ 2012-11-18  8:43 UTC (permalink / raw)
  To: Sony Chacko; +Cc: netdev

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   75fe83c32248d99e6d5fe64155e519b78bb90481
commit: 6d973cb163aede0b4a414abfda42d1bc35bfd7f9 [83/84] qlcnic: fix sparse warnings


sparse warnings:

drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1366:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1366:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1366:27:    got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1369:19: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1383:14: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1383:14:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1383:14:    got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1384:16: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1384:16:    expected unsigned char [unsigned] [usertype] no_ops
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1384:16:    got restricted __le32 [usertype] no_ops
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1394:70: sparse: incorrect type in argument 3 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1394:70:    expected unsigned int [unsigned] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1394:70:    got restricted __le32 [usertype] val1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1403:65: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1408:65: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1411:54: sparse: restricted __le16 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1413:56: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1413:70: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1418:50: sparse: restricted __le16 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1426:46: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1426:46:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1426:46:    got restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1428:66: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1428:66:    expected restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1428:66:    got unsigned int [unsigned] [addressable] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1432:46: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1432:46:    expected unsigned int [unsigned] [addressable] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1432:46:    got restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1434:46: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1434:46:    expected unsigned int [unsigned] [addressable] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1434:46:    got restricted __le32 [usertype] val1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1436:46: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1436:46:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1436:46:    got restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1440:38: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1440:38:    expected unsigned int [unsigned] [addressable] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1440:38:    got restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1444:46: sparse: invalid assignment: &=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1444:46:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1444:46:    right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1445:38: sparse: invalid assignment: |=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1445:38:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1445:38:    right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1446:38: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1446:38:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1446:38:    right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1447:66: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1447:66:    expected restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1447:66:    got unsigned int [unsigned] [addressable] [assigned] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1469:13: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1469:13:    expected unsigned int [unsigned] [usertype] val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1469:13:    got restricted __le32 [usertype] val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1470:34: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1471:42: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1471:42:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1471:42:    got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1472:41: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1472:41:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1472:41:    got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1473:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1473:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1473:27:    got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1474:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1474:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1474:27:    got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1475:21: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1475:21:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1475:21:    right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1477:23: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1489:14: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1489:14:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1489:14:    got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1492:34: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1493:42: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1493:42:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1493:42:    got restricted __le32 [usertype] sel_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1494:22: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1494:22:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1494:22:    got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1497:35: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1497:35:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1497:35:    got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1500:24: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1500:24:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1500:24:    right side has type restricted __le16
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1502:19: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1514:45: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1515:28: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1517:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1517:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1517:27:    got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1518:28: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1520:19: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1532:17: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1532:17:    expected unsigned int [unsigned] [usertype] fl_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1532:17:    got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1533:19: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1548:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1548:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1548:27:    got restricted __le32 [usertype] <noident>
+ drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19: sparse: incorrect type in return expression (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19:    expected unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19:    got restricted __le32 [usertype] size
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1563:13: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1563:13:    expected unsigned int [unsigned] [usertype] val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1563:13:    got restricted __le16 [usertype] init_tag_val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1565:27: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1566:41: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1566:41:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1566:41:    got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1567:41: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1567:41:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1567:41:    got restricted __le32 [usertype] ctrl_addr
+ drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1567:60: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1568:22: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1568:22:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1568:22:    got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1572:35: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1572:35:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1572:35:    got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1576:21: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1576:21:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1576:21:    right side has type restricted __le16
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1578:18: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1591:13: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1591:13:    expected unsigned int [unsigned] [usertype] val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1591:13:    got restricted __le16 [usertype] init_tag_val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1592:21: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1593:19: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1595:27: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1596:41: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1596:41:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1596:41:    got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1597:21: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1598:49: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1598:49:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1598:49:    got restricted __le32 [usertype] ctrl_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1599:47: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1603:48: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1603:48:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1603:48:    got restricted __le32 [usertype] ctrl_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1617:22: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1617:22:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1617:22:    got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1621:35: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1621:35:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1621:35:    got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1625:21: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1625:21:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1625:21:    right side has type restricted __le16
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1627:18: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1639:18: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1639:18:    expected int [signed] reg_read
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1639:18:    got restricted __le32 [usertype] size
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1640:14: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1640:14:    expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1640:14:    got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1673:35: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1673:35:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1673:35:    got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1681:19: sparse: incorrect type in return expression (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1681:19:    expected unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1681:19:    got restricted __le32 [usertype] size
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1721:31: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1749:33: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1750:35: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1750:35:    left side has type int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1750:35:    right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1763:20: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1763:20:    expected unsigned int [unsigned] [usertype] no_entries
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1763:20:    got restricted __le32 [usertype] num_entries
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1765:22: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1765:22:    expected unsigned int [unsigned] [usertype] entry_offset
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1765:22:    got restricted __le32 [usertype] offset
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1766:31: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1766:31:    expected restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1766:31:    got int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1767:31: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1767:31:    expected restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1767:31:    got unsigned int [unsigned] [usertype] fw_version
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1771:49: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1773:38: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1773:38:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1773:38:    right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1779:39: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1794:28: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1794:28:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1794:28:    right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1795:30: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1795:30:    left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1795:30:    right side has type restricted __le32

vim +1551 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c

18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1542  	for (i = 0; i < size; i++) {
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1543  		addr = fl_addr & 0xFFFF0000;
6d973cb1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c Sony Chacko         2012-11-17  1544  		qlcnic_write_dump_reg(FLASH_ROM_WINDOW, base, addr);
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1545  		addr = LSW(fl_addr) + FLASH_ROM_DATA;
6d973cb1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c Sony Chacko         2012-11-17  1546  		qlcnic_read_dump_reg(addr, base, &val);
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1547  		fl_addr += 4;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12 @1548  		*buffer++ = cpu_to_le32(val);
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1549  	}
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1550  	readl(base + QLCNIC_FLASH_SEM2_ULK);
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12 @1551  	return rom->size;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1552  }
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1553  
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1554  static u32
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1555  qlcnic_dump_l1_cache(struct qlcnic_adapter *adapter,
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1556  	struct qlcnic_dump_entry *entry, u32 *buffer)
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1557  {
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1558  	int i;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1559  	u32 cnt, val, data, addr;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1560  	void __iomem *base = adapter->ahw->pci_base0;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1561  	struct __cache *l1 = &entry->region.cache;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1562  
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1563  	val = l1->init_tag_val;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1564  
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1565  	for (i = 0; i < l1->no_ops; i++) {
6d973cb1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c Sony Chacko         2012-11-17  1566  		qlcnic_write_dump_reg(l1->addr, base, val);
6d973cb1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c Sony Chacko         2012-11-17 @1567  		qlcnic_write_dump_reg(l1->ctrl_addr, base, LSW(l1->ctrl_val));
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1568  		addr = l1->read_addr;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1569  		cnt = l1->read_addr_num;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c                 Anirban Chakraborty 2011-05-12  1570  		while (cnt) {

---
0-DAY kernel build testing backend         Open Source Technology Center
Fengguang Wu, Yuanhan Liu                              Intel Corporation

^ permalink raw reply

* Re: [PATCH net-next 1/3] mlx4_en: Remove remnants of LRO support
From: Amir Vadai @ 2012-11-18  9:03 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: David Miller, netdev, Eric Dumazet, Or Gerlitz, Roland Dreier
In-Reply-To: <1353105896.2743.53.camel@bwh-desktop.uk.solarflarecom.com>

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

On Sat, Nov 17, 2012 at 12:44 AM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> Commit fa37a9586f92051de03a13e55e5ec3880bb6783e ('mlx4_en: Moving to
> work with GRO') left behind the Kconfig depends/select, some dead
> code and comments referring to LRO.
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> The check for GRO eligibility in mlx4_en_process_rx_cq() should also be
> redundant, but I didn't touch it.
>
> Ben.
>
>  drivers/net/ethernet/mellanox/mlx4/Kconfig   |    3 +--
>  drivers/net/ethernet/mellanox/mlx4/en_rx.c   |    9 +++------
>  drivers/net/ethernet/mellanox/mlx4/mlx4_en.h |   17 -----------------
>  3 files changed, 4 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig
> index 5f027f9..eb520ab 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/Kconfig
> +++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig
> @@ -4,9 +4,8 @@
>
>  config MLX4_EN
>         tristate "Mellanox Technologies 10Gbit Ethernet support"
> -       depends on PCI && INET
> +       depends on PCI
>         select MLX4_CORE
> -       select INET_LRO
>         ---help---
>           This driver supports Mellanox Technologies ConnectX Ethernet
>           devices.
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> index 5aba5ec..f76c967 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> @@ -630,7 +630,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
>                         if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
>                             (cqe->checksum == cpu_to_be16(0xffff))) {
>                                 ring->csum_ok++;
> -                               /* This packet is eligible for LRO if it is:
> +                               /* This packet is eligible for GRO if it is:
>                                  * - DIX Ethernet (type interpretation)
>                                  * - TCP/IP (v4)
>                                  * - without IP options
> @@ -667,7 +667,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
>                                         goto next;
>                                 }
>
> -                               /* LRO not possible, complete processing here */
> +                               /* GRO not possible, complete processing here */
>                                 ip_summed = CHECKSUM_UNNECESSARY;
>                         } else {
>                                 ip_summed = CHECKSUM_NONE;
> @@ -710,11 +710,8 @@ next:
>                 ++cq->mcq.cons_index;
>                 index = (cq->mcq.cons_index) & ring->size_mask;
>                 cqe = &cq->buf[index];
> -               if (++polled == budget) {
> -                       /* We are here because we reached the NAPI budget -
> -                        * flush only pending LRO sessions */
> +               if (++polled == budget)
>                         goto out;
> -               }
>         }
>
>  out:
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> index 9d27e42..1809a8b 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> @@ -95,8 +95,6 @@
>  #define MLX4_EN_ALLOC_SIZE     PAGE_ALIGN(16384)
>  #define MLX4_EN_ALLOC_ORDER    get_order(MLX4_EN_ALLOC_SIZE)
>
> -#define MLX4_EN_MAX_LRO_DESCRIPTORS    32
> -
>  /* Receive fragment sizes; we use at most 4 fragments (for 9600 byte MTU
>   * and 4K allocations) */
>  enum {
> @@ -290,21 +288,6 @@ struct mlx4_en_rx_ring {
>         unsigned long csum_none;
>  };
>
> -
> -static inline int mlx4_en_can_lro(__be16 status)
> -{
> -       return (status & cpu_to_be16(MLX4_CQE_STATUS_IPV4       |
> -                                    MLX4_CQE_STATUS_IPV4F      |
> -                                    MLX4_CQE_STATUS_IPV6       |
> -                                    MLX4_CQE_STATUS_IPV4OPT    |
> -                                    MLX4_CQE_STATUS_TCP        |
> -                                    MLX4_CQE_STATUS_UDP        |
> -                                    MLX4_CQE_STATUS_IPOK)) ==
> -               cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
> -                           MLX4_CQE_STATUS_IPOK |
> -                           MLX4_CQE_STATUS_TCP);
> -}
> -
>  struct mlx4_en_cq {
>         struct mlx4_cq          mcq;
>         struct mlx4_hwq_resources wqres;
> --
> 1.7.7.6
>
>
>
> --
> 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.
>
> --
> 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-next 1/3] mlx4_en: Remove remnants of LRO support
From: Amir Vadai @ 2012-11-18  9:09 UTC (permalink / raw)
  To: Amir Vadai
  Cc: Ben Hutchings, David Miller, netdev, Eric Dumazet, Or Gerlitz,
	Roland Dreier
In-Reply-To: <CAPcc5Pi-xO8D5ndYTo7czuOAKSSMPHzAsvy5UoQ+-j1LVtE1Bw@mail.gmail.com>

I will also look at the checks in mlx4_en_process_rx_cq() as you suggested.

Amir.

On Sun, Nov 18, 2012 at 11:03 AM, Amir Vadai <amirv@mellanox.com> wrote:
> Acked-by: Amir Vadai <amirv@mellanox.com>
>
> On Sat, Nov 17, 2012 at 12:44 AM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
>> Commit fa37a9586f92051de03a13e55e5ec3880bb6783e ('mlx4_en: Moving to
>> work with GRO') left behind the Kconfig depends/select, some dead
>> code and comments referring to LRO.
>>
>> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
>> ---
>> The check for GRO eligibility in mlx4_en_process_rx_cq() should also be
>> redundant, but I didn't touch it.
>>
>> Ben.
>>
>>  drivers/net/ethernet/mellanox/mlx4/Kconfig   |    3 +--
>>  drivers/net/ethernet/mellanox/mlx4/en_rx.c   |    9 +++------
>>  drivers/net/ethernet/mellanox/mlx4/mlx4_en.h |   17 -----------------
>>  3 files changed, 4 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig
>> index 5f027f9..eb520ab 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/Kconfig
>> +++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig
>> @@ -4,9 +4,8 @@
>>
>>  config MLX4_EN
>>         tristate "Mellanox Technologies 10Gbit Ethernet support"
>> -       depends on PCI && INET
>> +       depends on PCI
>>         select MLX4_CORE
>> -       select INET_LRO
>>         ---help---
>>           This driver supports Mellanox Technologies ConnectX Ethernet
>>           devices.
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> index 5aba5ec..f76c967 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> @@ -630,7 +630,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
>>                         if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
>>                             (cqe->checksum == cpu_to_be16(0xffff))) {
>>                                 ring->csum_ok++;
>> -                               /* This packet is eligible for LRO if it is:
>> +                               /* This packet is eligible for GRO if it is:
>>                                  * - DIX Ethernet (type interpretation)
>>                                  * - TCP/IP (v4)
>>                                  * - without IP options
>> @@ -667,7 +667,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
>>                                         goto next;
>>                                 }
>>
>> -                               /* LRO not possible, complete processing here */
>> +                               /* GRO not possible, complete processing here */
>>                                 ip_summed = CHECKSUM_UNNECESSARY;
>>                         } else {
>>                                 ip_summed = CHECKSUM_NONE;
>> @@ -710,11 +710,8 @@ next:
>>                 ++cq->mcq.cons_index;
>>                 index = (cq->mcq.cons_index) & ring->size_mask;
>>                 cqe = &cq->buf[index];
>> -               if (++polled == budget) {
>> -                       /* We are here because we reached the NAPI budget -
>> -                        * flush only pending LRO sessions */
>> +               if (++polled == budget)
>>                         goto out;
>> -               }
>>         }
>>
>>  out:
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
>> index 9d27e42..1809a8b 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
>> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
>> @@ -95,8 +95,6 @@
>>  #define MLX4_EN_ALLOC_SIZE     PAGE_ALIGN(16384)
>>  #define MLX4_EN_ALLOC_ORDER    get_order(MLX4_EN_ALLOC_SIZE)
>>
>> -#define MLX4_EN_MAX_LRO_DESCRIPTORS    32
>> -
>>  /* Receive fragment sizes; we use at most 4 fragments (for 9600 byte MTU
>>   * and 4K allocations) */
>>  enum {
>> @@ -290,21 +288,6 @@ struct mlx4_en_rx_ring {
>>         unsigned long csum_none;
>>  };
>>
>> -
>> -static inline int mlx4_en_can_lro(__be16 status)
>> -{
>> -       return (status & cpu_to_be16(MLX4_CQE_STATUS_IPV4       |
>> -                                    MLX4_CQE_STATUS_IPV4F      |
>> -                                    MLX4_CQE_STATUS_IPV6       |
>> -                                    MLX4_CQE_STATUS_IPV4OPT    |
>> -                                    MLX4_CQE_STATUS_TCP        |
>> -                                    MLX4_CQE_STATUS_UDP        |
>> -                                    MLX4_CQE_STATUS_IPOK)) ==
>> -               cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
>> -                           MLX4_CQE_STATUS_IPOK |
>> -                           MLX4_CQE_STATUS_TCP);
>> -}
>> -
>>  struct mlx4_en_cq {
>>         struct mlx4_cq          mcq;
>>         struct mlx4_hwq_resources wqres;
>> --
>> 1.7.7.6
>>
>>
>>
>> --
>> 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.
>>
>> --
>> 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: [rfc net-next v6 2/3] virtio_net: multiqueue support
From: Michael S. Tsirkin @ 2012-11-18  9:13 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: krkumar2, kvm, netdev, linux-kernel, virtualization, edumazet,
	davem
In-Reply-To: <1353112529.2743.83.camel@bwh-desktop.uk.solarflarecom.com>

On Sat, Nov 17, 2012 at 12:35:29AM +0000, Ben Hutchings wrote:
> On Tue, 2012-11-13 at 08:40 +0200, Michael S. Tsirkin wrote:
> > On Mon, Nov 05, 2012 at 11:38:39AM +1030, Rusty Russell wrote:
> > > > @@ -924,11 +1032,10 @@ static void virtnet_get_ringparam(struct net_device *dev,
> > > >  {
> > > >  	struct virtnet_info *vi = netdev_priv(dev);
> > > >  
> > > > -	ring->rx_max_pending = virtqueue_get_vring_size(vi->rvq);
> > > > -	ring->tx_max_pending = virtqueue_get_vring_size(vi->svq);
> > > > +	ring->rx_max_pending = virtqueue_get_vring_size(vi->rq[0].vq);
> > > > +	ring->tx_max_pending = virtqueue_get_vring_size(vi->sq[0].vq);
> > > >  	ring->rx_pending = ring->rx_max_pending;
> > > >  	ring->tx_pending = ring->tx_max_pending;
> > > > -
> > > >  }
> > > 
> > > This assumes all vqs are the same size.  I think this should probably
> > > check: for mq mode, use the first vq, otherewise use the 0th.
> > 
> > For rx_pending/tx_pending I think what is required here is the
> > actual number of outstanding buffers.
> > Dave, Eric - right?
> > 
> > So this should be the total over all rings and to be useful,
> > rx_max_pending/tx_max_pending should be the total too.
> 
> So far as I know, all current implementations use the number of
> descriptors per ring here. virtio_net should be consistent with this.
> 
> Ben.

Problem is, it could in theory be different between rings. I guess we
could use the maximum.

What's the right thing to do for rx_pending - I am guessing
we want the current outstanding packets right?


> > > For bonus points, check this assertion at probe time.
> > 
> > Looks like we can easily support different queues too.
> > 
> 
> -- 
> 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: PROBLEM: freeze when resuming from suspend-to-ram
From: Jan Janssen @ 2012-11-18 10:28 UTC (permalink / raw)
  To: Francois Romieu; +Cc: Daniele Venzano, netdev
In-Reply-To: <20121117192036.GA29018@electric-eye.fr.zoreil.com>

On Saturday 17 November 2012 20:20:36 Francois Romieu wrote:
> Jan Janssen <medhefgo@web.de> :
> [...]
> 
> > I'd be glad to help you with that. The bug happens with 3.6.6 and with
> > 3.7-
> > rc6. Pick one that suits you best, I can work with both.
> 
> /me slaps head.
> 
> Please try the patch below against v3.7-rc6
> 
> diff --git a/drivers/net/ethernet/sis/sis900.c
> b/drivers/net/ethernet/sis/sis900.c index fb9f6b3..edf5edb 100644
> --- a/drivers/net/ethernet/sis/sis900.c
> +++ b/drivers/net/ethernet/sis/sis900.c
> @@ -2479,7 +2479,7 @@ static int sis900_resume(struct pci_dev *pci_dev)
>  	netif_start_queue(net_dev);
> 
>  	/* Workaround for EDB */
> -	sis900_set_mode(ioaddr, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
> +	sis900_set_mode(sis_priv, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
> 
>  	/* Enable all known interrupts by setting the interrupt mask. */
>  	sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE);
This seems to fix it. I was able to repeatedly suspend and resume.

On my first resume try I did get a netdev watchdog timeout right after I got 
back to my shell prompt, but it wasn't reproducable. So, I'm assuming it's 
some unrelated rc or hardware issue. Thought I might better mention it.

Jan

^ permalink raw reply

* Re: Optics (SFP) monitoring on ixgbe and igbe
From: Aurélien @ 2012-11-18 21:35 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev
In-Reply-To: <1353094719.2743.21.camel@bwh-desktop.uk.solarflarecom.com>

[-- Attachment #1: Type: text/plain, Size: 1982 bytes --]

Hi Ben,

I've rewritten things according to your remarks.

On Fri, Nov 16, 2012 at 8:38 PM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
>
> This is silly; log10() and <math.h> are part of standard C and -lm is
> standard on Unix.  Just use <math.h> and -lm unconditionally.

Ok, I wasn't sure.

>
> Please merge this with the existing -m option and update the
> documentation to say that this covers diagnostics where available.  You
> could add a long option alias like --dump-module or --module-info that
> covers the two types of information.

Done that, the current output of -m has been modified so that
everything lines up correctly.
The --module-info option alias has been added.

> All the above offsets need parentheses around their definitions.
[…]
> This is commented as an offset in the A2 'EEPROM' but the offsets
> actually used include the 0x100 offset from the start of the
> concatenated 'EEPROM'.

A new SFF_A2_BASE has been added, and the OFFSET_TO macros are now
using that, so I removed the 0x100 from all the offsets, and they are
now indeed A2-relative.

>
> Why are all the literals explicitly float and not double?
>

It was a keyboard/chair interface problem, now fixed :)

> Please follow kernel coding style for spacing.  checkpatch.pl will show
> you what should be changed.

Ran a checkpatch, and fixed everything that should be fixed.

>
> This seems awfuly complicated; why not:
>
> #define OFFSET_TO_TEMP(offset) (((s16)OFFSET_TO_U16(offset)) * 10 / 256)
>
> But why round to tenths of a degree here and then round again to whole
> degrees celsius/fahrenheit when printing?
>

I did not think a simple cast would work, but it seems to give the
right value. I also implemented externally calibrated optics in this
new version, so I now do the whole formatting in the printing, and
store the raw value in the struct.

It should be better now.

Best regards,
-- 
Aurélien Guillaume

[-- Attachment #2: 0001-Implemented-basic-optics-diagnostics-for-SFF-8472-co.patch --]
[-- Type: application/octet-stream, Size: 21479 bytes --]

From 2b96a1a65e1c24e3c43f479719bd3e3da499656c Mon Sep 17 00:00:00 2001
From: Aurelien Guillaume <aurelien@iwi.me>
Date: Fri, 16 Nov 2012 02:50:00 +0100
Subject: [PATCH]   Implemented basic optics diagnostics for SFF-8472 compliant
   transceivers in ethtool.


Signed-off-by: Aurelien Guillaume <aurelien@iwi.me>
---
 Makefile.am |    2 +-
 ethtool.c   |   17 +++-
 internal.h  |    3 +
 sfpdiag.c   |  364 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sfpid.c     |   35 +++---
 5 files changed, 402 insertions(+), 19 deletions(-)
 create mode 100644 sfpdiag.c

diff --git a/Makefile.am b/Makefile.am
index e33f71f..89a0d1e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@ ethtool_SOURCES = ethtool.c ethtool-copy.h internal.h net_tstamp-copy.h \
 		  fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c	\
 		  pcnet32.c realtek.c tg3.c marvell.c vioc.c	\
 		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
-		  rxclass.c sfpid.c
+		  rxclass.c sfpid.c sfpdiag.c
 
 TESTS = test-cmdline test-features
 check_PROGRAMS = test-cmdline test-features
diff --git a/ethtool.c b/ethtool.c
index 3db7fec..345c21c 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -3604,6 +3604,16 @@ static int do_getmodule(struct cmd_context *ctx)
 		return 1;
 	}
 
+	/*
+	 * SFF-8079 EEPROM layout contains the memory available at A0 address on
+	 * the PHY EEPROM.
+	 * SFF-8472 defines a virtual extension of the EEPROM, where the
+	 * microcontroller on the SFP/SFP+ generates a page at the A2 address,
+	 * which contains data relative to optical diagnostics.
+	 * The current kernel implementation returns a blob, which contains:
+	 *  - ETH_MODULE_SFF_8079 => The A0 page only.
+	 *  - ETH_MODULE_SFF_8472 => The A0 and A2 page concatenated.
+	 */
 	if (geeprom_dump_raw) {
 		fwrite(eeprom->data, 1, eeprom->len, stdout);
 	} else {
@@ -3613,8 +3623,11 @@ static int do_getmodule(struct cmd_context *ctx)
 		} else if (!geeprom_dump_hex) {
 			switch (modinfo.type) {
 			case ETH_MODULE_SFF_8079:
+				sff8079_show_all(eeprom->data);
+				break;
 			case ETH_MODULE_SFF_8472:
 				sff8079_show_all(eeprom->data);
+				sff8472_show_all(eeprom->data);
 				break;
 			default:
 				geeprom_dump_hex = 1;
@@ -3831,8 +3844,8 @@ static const struct option {
 	{ "--show-priv-flags" , 1, do_gprivflags, "Query private flags" },
 	{ "--set-priv-flags", 1, do_sprivflags, "Set private flags",
 	  "		FLAG on|off ...\n" },
-	{ "-m|--dump-module-eeprom", 1, do_getmodule,
-	  "Qeuery/Decode Module EEPROM information",
+	{ "-m|--dump-module-eeprom|--module-info", 1, do_getmodule,
+	  "Query/Decode Module EEPROM information and optical diagnostics if available",
 	  "		[ raw on|off ]\n"
 	  "		[ hex on|off ]\n"
 	  "		[ offset N ]\n"
diff --git a/internal.h b/internal.h
index 4f96fd5..e977a81 100644
--- a/internal.h
+++ b/internal.h
@@ -253,4 +253,7 @@ int rxclass_rule_del(struct cmd_context *ctx, __u32 loc);
 /* Module EEPROM parsing code */
 void sff8079_show_all(const __u8 *id);
 
+/* Optics diagnostics */
+void sff8472_show_all(const __u8 *id);
+
 #endif /* ETHTOOL_INTERNAL_H__ */
diff --git a/sfpdiag.c b/sfpdiag.c
new file mode 100644
index 0000000..1094bd7
--- /dev/null
+++ b/sfpdiag.c
@@ -0,0 +1,364 @@
+/*
+ * sfpdiag.c: Implements SFF-8472 optics diagnostics.
+ *
+ * Aurelien Guillaume <aurelien@iwi.me> (C) 2012
+ *   This implementation is loosely based on DOM patches
+ *   from Robert Olsson <robert@herjulf.se> (C) 2009
+ *   and SFF-8472 specs (ftp://ftp.seagate.com/pub/sff/SFF-8472.PDF)
+ *   by SFF Committee.
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include "internal.h"
+
+/* Offsets in decimal, for direct comparison with the SFF specs */
+
+/* A0-based EEPROM offsets for DOM support checks */
+#define SFF_A0_DOM                        92
+#define SFF_A0_OPTIONS                    93
+#define SFF_A0_COMP                       94
+
+/* EEPROM bit values for various registers */
+#define SFF_A0_DOM_EXTCAL                 (1 << 4)
+#define SFF_A0_DOM_INTCAL                 (1 << 5)
+#define SFF_A0_DOM_IMPL                   (1 << 6)
+#define SFF_A0_DOM_PWRT                   (1 << 3)
+
+#define SFF_A0_OPTIONS_AW                 (1 << 7)
+
+/*
+ * See ethtool.c comments about SFF-8472, this is the offset
+ * at which the A2 page is in the EEPROM blob returned by the
+ * kernel.
+ */
+#define SFF_A2_BASE                       0x100
+
+/* A2-based offsets for DOM */
+#define SFF_A2_TEMP                       96
+#define SFF_A2_TEMP_HALRM                 0
+#define SFF_A2_TEMP_LALRM                 2
+#define SFF_A2_TEMP_HWARN                 4
+#define SFF_A2_TEMP_LWARN                 6
+
+#define SFF_A2_VCC                        98
+#define SFF_A2_VCC_HALRM                  8
+#define SFF_A2_VCC_LALRM                  10
+#define SFF_A2_VCC_HWARN                  12
+#define SFF_A2_VCC_LWARN                  14
+
+#define SFF_A2_BIAS                       96
+#define SFF_A2_BIAS_HALRM                 16
+#define SFF_A2_BIAS_LALRM                 18
+#define SFF_A2_BIAS_HWARN                 20
+#define SFF_A2_BIAS_LWARN                 22
+
+#define SFF_A2_TX_PWR                     102
+#define SFF_A2_TX_PWR_HALRM               24
+#define SFF_A2_TX_PWR_LALRM               26
+#define SFF_A2_TX_PWR_HWARN               28
+#define SFF_A2_TX_PWR_LWARN               30
+
+#define SFF_A2_RX_PWR                     104
+#define SFF_A2_RX_PWR_HALRM               32
+#define SFF_A2_RX_PWR_LALRM               34
+#define SFF_A2_RX_PWR_HWARN               36
+#define SFF_A2_RX_PWR_LWARN               38
+
+#define SFF_A2_ALRM_FLG                   112
+#define SFF_A2_WARN_FLG                   116
+
+/* 32-bit little-endian calibration constants */
+#define SFF_A2_CAL_RXPWR4                 56
+#define SFF_A2_CAL_RXPWR3                 60
+#define SFF_A2_CAL_RXPWR2                 64
+#define SFF_A2_CAL_RXPWR1                 68
+#define SFF_A2_CAL_RXPWR0                 72
+
+/* 16-bit little endian calibration constants */
+#define SFF_A2_CAL_TXI_SLP                76
+#define SFF_A2_CAL_TXI_OFF                78
+#define SFF_A2_CAL_TXPWR_SLP              80
+#define SFF_A2_CAL_TXPWR_OFF              82
+#define SFF_A2_CAL_T_SLP                  84
+#define SFF_A2_CAL_T_OFF                  86
+#define SFF_A2_CAL_V_SLP                  88
+#define SFF_A2_CAL_V_OFF			      90
+
+
+struct sff8472_diags {
+
+#define MCURR 0
+#define LWARN 1
+#define HWARN 2
+#define LALRM 3
+#define HALRM 4
+
+	/* [5] tables are current, low/high warn, low/high alarm */
+	__u8 supports_dom;      /* Supports DOM */
+	__u8 supports_alarms;   /* Supports alarm/warning thold */
+	__u8 calibrated_ext;	/* Is externally calibrated */
+	__u16 bias_cur[5];		/* Measured bias current in 2uA units */
+	__u16 tx_power[5];		/* Measured TX Power in 0.1uW units */
+	__u16 rx_power[5];		/* Measured RX Power */
+	__u8  rx_power_type;    /* 0 = OMA, 1 = Average power */
+	__s16 sfp_temp[5];      /* SFP Temp in 16-bit signed 1/256 Celcius */
+	__u16 sfp_voltage[5];   /* SFP voltage in 0.1mV units */
+
+};
+
+static struct sff8472_aw_flags {
+	const char *str;        /* Human-readable string, null at the end */
+	int offset;             /* A2-relative adress offset */
+	__u8 value;             /* Alarm is on if (offset & value) != 0. */
+} sff8472_aw_flags[] = {
+	{ "Laser bias current high alarm",   SFF_A2_ALRM_FLG, (1 << 3) },
+	{ "Laser bias current low alarm",    SFF_A2_ALRM_FLG, (1 << 2) },
+	{ "Laser bias current high warning", SFF_A2_WARN_FLG, (1 << 3) },
+	{ "Laser bias current low warning",  SFF_A2_WARN_FLG, (1 << 2) },
+
+	{ "Laser output power high alarm",   SFF_A2_ALRM_FLG, (1 << 1) },
+	{ "Laser output power low alarm",    SFF_A2_ALRM_FLG, (1 << 0) },
+	{ "Laser output power high warning", SFF_A2_WARN_FLG, (1 << 1) },
+	{ "Laser output power low warning",  SFF_A2_WARN_FLG, (1 << 0) },
+
+	{ "Module temperature high alarm",   SFF_A2_ALRM_FLG, (1 << 7) },
+	{ "Module temperature low alarm",    SFF_A2_ALRM_FLG, (1 << 6) },
+	{ "Module temperature high warning", SFF_A2_WARN_FLG, (1 << 7) },
+	{ "Module temperature low warning",  SFF_A2_WARN_FLG, (1 << 6) },
+
+	{ "Module voltage high alarm",   SFF_A2_ALRM_FLG, (1 << 5) },
+	{ "Module voltage low alarm",    SFF_A2_ALRM_FLG, (1 << 4) },
+	{ "Module voltage high warning", SFF_A2_WARN_FLG, (1 << 5) },
+	{ "Module voltage low warning",  SFF_A2_WARN_FLG, (1 << 4) },
+
+	{ "Laser rx power high alarm",   SFF_A2_ALRM_FLG + 1, (1 << 7) },
+	{ "Laser rx power low alarm",    SFF_A2_ALRM_FLG + 1, (1 << 6) },
+	{ "Laser rx power high warning", SFF_A2_WARN_FLG + 1, (1 << 7) },
+	{ "Laser rx power low warning",  SFF_A2_WARN_FLG + 1, (1 << 6) },
+
+	{ NULL, 0, 0 },
+};
+
+static double convert_mw_to_dbm(double mw)
+{
+	return (10. * log10(mw / 1000.)) + 30.;
+}
+
+
+/* Most common case: 16-bit unsigned integer in a certain unit */
+#define A2_OFFSET_TO_U16(offset) \
+	(id[SFF_A2_BASE + (offset)] << 8 | id[SFF_A2_BASE + (offset) + 1])
+
+/* Calibration slope is a number between 0.0 included and 256.0 excluded. */
+#define A2_OFFSET_TO_SLP(offset) \
+	(id[SFF_A2_BASE + (offset)] + id[SFF_A2_BASE + (offset) + 1] / 256.)
+
+/* Calibration offset is an integer from -32768 to 32767 */
+#define A2_OFFSET_TO_OFF(offset) \
+	((__s16)A2_OFFSET_TO_U16(offset))
+
+/* RXPWR(x) are IEEE-754 floating point numbers in big-endian format */
+#define A2_OFFSET_TO_RXPWRx(offset) \
+	(befloattoh((__u32 *)(id + SFF_A2_BASE + (offset))))
+
+/*
+ * 2-byte internal temperature conversions:
+ * First byte is a signed 8-bit integer, which is the temp decimal part
+ * Second byte are 1/256th of degree, which are added to the dec part.
+ */
+#define A2_OFFSET_TO_TEMP(offset) ((__s16)A2_OFFSET_TO_U16(offset))
+
+
+static void sff8472_dom_parse(const __u8 *id, struct sff8472_diags *sd)
+{
+
+	sd->bias_cur[MCURR] = A2_OFFSET_TO_U16(SFF_A2_BIAS);
+	sd->bias_cur[HALRM] = A2_OFFSET_TO_U16(SFF_A2_BIAS_HALRM);
+	sd->bias_cur[LALRM] = A2_OFFSET_TO_U16(SFF_A2_BIAS_LALRM);
+	sd->bias_cur[HWARN] = A2_OFFSET_TO_U16(SFF_A2_BIAS_HWARN);
+	sd->bias_cur[LWARN] = A2_OFFSET_TO_U16(SFF_A2_BIAS_LWARN);
+
+	sd->sfp_voltage[MCURR] = A2_OFFSET_TO_U16(SFF_A2_VCC);
+	sd->sfp_voltage[HALRM] = A2_OFFSET_TO_U16(SFF_A2_VCC_HALRM);
+	sd->sfp_voltage[LALRM] = A2_OFFSET_TO_U16(SFF_A2_VCC_LALRM);
+	sd->sfp_voltage[HWARN] = A2_OFFSET_TO_U16(SFF_A2_VCC_HWARN);
+	sd->sfp_voltage[LWARN] = A2_OFFSET_TO_U16(SFF_A2_VCC_LWARN);
+
+	sd->tx_power[MCURR] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR);
+	sd->tx_power[HALRM] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR_HALRM);
+	sd->tx_power[LALRM] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR_LALRM);
+	sd->tx_power[HWARN] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR_HWARN);
+	sd->tx_power[LWARN] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR_LWARN);
+
+	sd->rx_power[MCURR] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR);
+	sd->rx_power[HALRM] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR_HALRM);
+	sd->rx_power[LALRM] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR_LALRM);
+	sd->rx_power[HWARN] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR_HWARN);
+	sd->rx_power[LWARN] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR_LWARN);
+
+	sd->sfp_temp[MCURR] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP);
+	sd->sfp_temp[HALRM] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP_HALRM);
+	sd->sfp_temp[LALRM] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP_LALRM);
+	sd->sfp_temp[HWARN] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP_HWARN);
+	sd->sfp_temp[LWARN] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP_LWARN);
+
+}
+
+/* Converts to a float from a big-endian 4-byte source buffer. */
+static float befloattoh(const __u32 *source)
+{
+	union {
+		__u32 src;
+		float dst;
+	} converter;
+
+	converter.src = be32toh(*source);
+	return converter.dst;
+}
+
+static void sff8472_calibration(const __u8 *id, struct sff8472_diags *sd)
+{
+	int i;
+	__u16 rx_reading;
+
+	/* Calibration should occur for all values (threshold and current) */
+	for (i = 0; i < sizeof(sd->bias_cur); ++i) {
+		/*
+		 * Apply calibration formula 1 (Temp., Voltage, Bias, Tx Power)
+		 */
+		sd->bias_cur[i]    *= A2_OFFSET_TO_SLP(SFF_A2_CAL_TXI_SLP);
+		sd->tx_power[i]    *= A2_OFFSET_TO_SLP(SFF_A2_CAL_TXPWR_SLP);
+		sd->sfp_voltage[i] *= A2_OFFSET_TO_SLP(SFF_A2_CAL_V_SLP);
+		sd->sfp_temp[i]    *= A2_OFFSET_TO_SLP(SFF_A2_CAL_T_SLP);
+
+		sd->bias_cur[i]    += A2_OFFSET_TO_OFF(SFF_A2_CAL_TXI_OFF);
+		sd->tx_power[i]    += A2_OFFSET_TO_OFF(SFF_A2_CAL_TXPWR_OFF);
+		sd->sfp_voltage[i] += A2_OFFSET_TO_OFF(SFF_A2_CAL_V_OFF);
+		sd->sfp_temp[i]    += A2_OFFSET_TO_OFF(SFF_A2_CAL_T_OFF);
+
+		/*
+		 * Apply calibration formula 2 (Rx Power only)
+		 */
+		rx_reading = sd->rx_power[i];
+		sd->rx_power[i]    = A2_OFFSET_TO_RXPWRx(SFF_A2_CAL_RXPWR0);
+		sd->rx_power[i]    += rx_reading *
+			A2_OFFSET_TO_RXPWRx(SFF_A2_CAL_RXPWR1);
+		sd->rx_power[i]    += rx_reading *
+			A2_OFFSET_TO_RXPWRx(SFF_A2_CAL_RXPWR2);
+		sd->rx_power[i]    += rx_reading *
+			A2_OFFSET_TO_RXPWRx(SFF_A2_CAL_RXPWR3);
+	}
+}
+
+static void sff8472_parse_eeprom(const __u8 *id, struct sff8472_diags *sd)
+{
+	sd->supports_dom = id[SFF_A0_DOM] & SFF_A0_DOM_IMPL;
+	sd->supports_alarms = id[SFF_A0_OPTIONS] & SFF_A0_OPTIONS_AW;
+	sd->calibrated_ext = id[SFF_A0_DOM] & SFF_A0_DOM_EXTCAL;
+	sd->rx_power_type = id[SFF_A0_DOM] & SFF_A0_DOM_PWRT;
+
+	sff8472_dom_parse(id, sd);
+
+	/*
+	 * If the SFP is externally calibrated, we need to read calibration data
+	 * and compensate the already stored readings.
+	 */
+	if (sd->calibrated_ext)
+		sff8472_calibration(id, sd);
+}
+
+
+
+void sff8472_show_all(const __u8 *id)
+{
+	struct sff8472_diags sd;
+	char *rx_power_string = NULL;
+	int i;
+
+	sff8472_parse_eeprom(id, &sd);
+
+	if (!sd.supports_dom) {
+		printf("\t%-41s : No\n", "Optical diagnostics support");
+		return ;
+	}
+	printf("\t%-41s : Yes\n", "Optical diagnostics support");
+
+#define PRINT_BIAS(string, index) \
+	printf("\t%-41s : %.3f mA\n", (string), \
+		   (double)(sd.bias_cur[(index)] / 500.));
+
+# define PRINT_xX_PWR(string, var, index) \
+	printf("\t%-41s : %.4f mW / %.2f dBm\n", (string), \
+		   (double)((var)[(index)] / 10000.), \
+		   convert_mw_to_dbm((double)((var)[(index)] / 10000.)));
+
+#define PRINT_TEMP(string, index) \
+	printf("\t%-41s : %.2f degrees C / %.2f degrees F\n", (string), \
+		   (double)(sd.sfp_temp[(index)] / 256.), \
+		   (double)(sd.sfp_temp[(index)] / 256. * 1.8 + 32.));
+
+#define PRINT_VCC(string, index) \
+	printf("\t%-41s : %.4f V\n", (string), \
+		   (double)(sd.sfp_voltage[(index)] / 10000.));
+
+
+	PRINT_BIAS("Laser bias current", MCURR);
+	PRINT_xX_PWR("Laser output power", sd.tx_power, MCURR);
+
+	if (!sd.rx_power_type)
+		rx_power_string = "Receiver signal OMA";
+	else
+		rx_power_string = "Receiver signal average optical power";
+
+	PRINT_xX_PWR(rx_power_string, sd.rx_power, MCURR);
+
+	PRINT_TEMP("Module temperature", MCURR);
+	PRINT_VCC("Module voltage", MCURR);
+
+	printf("\t%-41s : %s\n", "Alarm/warning flags implemented",
+		   (sd.supports_alarms ? "Yes" : "No"));
+	if (sd.supports_alarms) {
+
+		for (i = 0; sff8472_aw_flags[i].str; ++i) {
+			printf("\t%-41s : %s\n", sff8472_aw_flags[i].str,
+				   id[SFF_A2_BASE + sff8472_aw_flags[i].offset]
+				   & sff8472_aw_flags[i].value ? "On" : "Off");
+		}
+
+		PRINT_BIAS("Laser bias current high alarm threshold",   HALRM);
+		PRINT_BIAS("Laser bias current low alarm threshold",    LALRM);
+		PRINT_BIAS("Laser bias current high warning threshold", HWARN);
+		PRINT_BIAS("Laser bias current low warning threshold",  LWARN);
+
+		PRINT_xX_PWR("Laser output power high alarm threshold",
+					 sd.tx_power, HALRM);
+		PRINT_xX_PWR("Laser output power low alarm threshold",
+					 sd.tx_power, LALRM);
+		PRINT_xX_PWR("Laser output power high warning threshold",
+					 sd.tx_power, HWARN);
+		PRINT_xX_PWR("Laser output power low warning threshold",
+					 sd.tx_power, LWARN);
+
+		PRINT_TEMP("Module temperature high alarm threshold",   HALRM);
+		PRINT_TEMP("Module temperature low alarm threshold",    LALRM);
+		PRINT_TEMP("Module temperature high warning threshold", HWARN);
+		PRINT_TEMP("Module temperature low warning threshold",  LWARN);
+
+		PRINT_VCC("Module voltage high alarm threshold",   HALRM);
+		PRINT_VCC("Module voltage low alarm threshold",    LALRM);
+		PRINT_VCC("Module voltage high warning threshold", HWARN);
+		PRINT_VCC("Module voltage low warning threshold",  LWARN);
+
+		PRINT_xX_PWR("Laser rx power high alarm threshold",
+					 sd.rx_power, HALRM);
+		PRINT_xX_PWR("Laser rx power low alarm threshold",
+					 sd.rx_power, LALRM);
+		PRINT_xX_PWR("Laser rx power high warning threshold",
+					 sd.rx_power, HWARN);
+		PRINT_xX_PWR("Laser rx power low warning threshold",
+					 sd.rx_power, LWARN);
+	}
+
+}
+
diff --git a/sfpid.c b/sfpid.c
index a4a671d..2982d0d 100644
--- a/sfpid.c
+++ b/sfpid.c
@@ -12,7 +12,7 @@
 
 static void sff8079_show_identifier(const __u8 *id)
 {
-	printf("\tIdentifier          : 0x%02x", id[0]);
+	printf("\t%-41s : 0x%02x", "Identifier", id[0]);
 	switch (id[0]) {
 	case 0x00:
 		printf(" (no module present, unknown, or unspecified)\n");
@@ -34,7 +34,7 @@ static void sff8079_show_identifier(const __u8 *id)
 
 static void sff8079_show_ext_identifier(const __u8 *id)
 {
-	printf("\tExtended identifier : 0x%02x", id[1]);
+	printf("\t%-41s : 0x%02x", "Extended identifier", id[1]);
 	if (id[1] == 0x00)
 		printf(" (GBIC not specified / not MOD_DEF compliant)\n");
 	else if (id[1] == 0x04)
@@ -47,7 +47,7 @@ static void sff8079_show_ext_identifier(const __u8 *id)
 
 static void sff8079_show_connector(const __u8 *id)
 {
-	printf("\tConnector           : 0x%02x", id[2]);
+	printf("\t%-41s : 0x%02x", "Connector", id[2]);
 	switch (id[2]) {
 	case 0x00:
 		printf(" (unknown or unspecified)\n");
@@ -105,10 +105,12 @@ static void sff8079_show_connector(const __u8 *id)
 
 static void sff8079_show_transceiver(const __u8 *id)
 {
-	static const char *pfx = "\t                    :  =>";
+	static const char *pfx =
+		"\tTransceiver type                          :";
 
-	printf("\tTransceiver codes   : 0x%02x 0x%02x 0x%02x" \
+	printf("\t%-41s : 0x%02x 0x%02x 0x%02x " \
 	       "0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
+		   "Transceiver codes",
 	       id[3], id[4], id[5], id[6],
 	       id[7], id[8], id[9], id[10]);
 	/* 10G Ethernet Compliance Codes */
@@ -239,7 +241,7 @@ static void sff8079_show_transceiver(const __u8 *id)
 
 static void sff8079_show_encoding(const __u8 *id)
 {
-	printf("\tEncoding            : 0x%02x", id[11]);
+	printf("\t%-41s : 0x%02x", "Encoding", id[11]);
 	switch (id[11]) {
 	case 0x00:
 		printf(" (unspecified)\n");
@@ -270,7 +272,7 @@ static void sff8079_show_encoding(const __u8 *id)
 
 static void sff8079_show_rate_identifier(const __u8 *id)
 {
-	printf("\tRate identifier     : 0x%02x", id[13]);
+	printf("\t%-41s : 0x%02x", "Rate identifier", id[13]);
 	switch (id[13]) {
 	case 0x00:
 		printf(" (unspecified)\n");
@@ -295,14 +297,14 @@ static void sff8079_show_rate_identifier(const __u8 *id)
 
 static void sff8079_show_oui(const __u8 *id)
 {
-	printf("\tVendor OUI          : %02x:%02x:%02x\n",
+	printf("\t%-41s : %02x:%02x:%02x\n", "Vendor OUI",
 	       id[37], id[38], id[39]);
 }
 
 static void sff8079_show_wavelength_or_copper_compliance(const __u8 *id)
 {
 	if (id[8] & (1 << 2)) {
-		printf("\tPassive Cu cmplnce. : 0x%02x", id[60]);
+		printf("\t%-41s : 0x%02x", "Passive copper compliance", id[60]);
 		switch (id[60]) {
 		case 0x00:
 			printf(" (unspecified)");
@@ -316,7 +318,7 @@ static void sff8079_show_wavelength_or_copper_compliance(const __u8 *id)
 		}
 		printf(" [SFF-8472 rev10.4 only]\n");
 	} else if (id[8] & (1 << 3)) {
-		printf("\tActive Cu cmplnce.  : 0x%02x", id[60]);
+		printf("\t%-41s : 0x%02x", "Active copper compliance", id[60]);
 		switch (id[60]) {
 		case 0x00:
 			printf(" (unspecified)");
@@ -333,7 +335,7 @@ static void sff8079_show_wavelength_or_copper_compliance(const __u8 *id)
 		}
 		printf(" [SFF-8472 rev10.4 only]\n");
 	} else {
-		printf("\tLaser wavelength    : %unm\n",
+		printf("\t%-41s : %unm\n", "Laser wavelength",
 		       (id[60] << 8) | id[61]);
 	}
 }
@@ -344,7 +346,7 @@ static void sff8079_show_value_with_unit(const __u8 *id, unsigned int reg,
 {
 	unsigned int val = id[reg];
 
-	printf("\t%-20s: %u%s\n", name, val * mult, unit);
+	printf("\t%-41s : %u%s\n", name, val * mult, unit);
 }
 
 static void sff8079_show_ascii(const __u8 *id, unsigned int first_reg,
@@ -352,7 +354,7 @@ static void sff8079_show_ascii(const __u8 *id, unsigned int first_reg,
 {
 	unsigned int reg, val;
 
-	printf("\t%-20s: ", name);
+	printf("\t%-41s : ", name);
 	for (reg = first_reg; reg <= last_reg; reg++) {
 		val = id[reg];
 		putchar(((val >= 32) && (val <= 126)) ? val : '_');
@@ -368,14 +370,15 @@ void sff8079_show_all(const __u8 *id)
 		sff8079_show_connector(id);
 		sff8079_show_transceiver(id);
 		sff8079_show_encoding(id);
-		sff8079_show_value_with_unit(id, 12, "BR, Nominal", 100, "MBd");
+		sff8079_show_value_with_unit(id, 12,
+				"Nominal signalling rate", 100, "MBd");
 		sff8079_show_rate_identifier(id);
 		sff8079_show_value_with_unit(id, 14,
-					     "Length (SMF,km)", 1, "km");
+				"Length (SMF,km)", 1, "km");
 		sff8079_show_value_with_unit(id, 15, "Length (SMF)", 100, "m");
 		sff8079_show_value_with_unit(id, 16, "Length (50um)", 10, "m");
 		sff8079_show_value_with_unit(id, 17,
-					     "Length (62.5um)", 10, "m");
+				"Length (62.5um)", 10, "m");
 		sff8079_show_value_with_unit(id, 18, "Length (Copper)", 1, "m");
 		sff8079_show_value_with_unit(id, 19, "Length (OM3)", 10, "m");
 		sff8079_show_wavelength_or_copper_compliance(id);
-- 
1.7.0.4


^ permalink raw reply related

* Re: Latest 3.6.6 are not compiling due tg3 network driver, hwmon_device_unregister
From: David Rientjes @ 2012-11-18 22:42 UTC (permalink / raw)
  To: Nithin Nayak Sujir, Denys Fedoryshchenko
  Cc: Paul Gortmaker, Michael Chan, netdev, linux-kernel
In-Reply-To: <50A464E4.1080105@broadcom.com>

On Wed, 14 Nov 2012, Nithin Nayak Sujir wrote:

> On 11/14/2012 07:30 PM, David Rientjes wrote:
> > On Wed, 14 Nov 2012, Nithin Nayak Sujir wrote:
> > 
> > > This was fixed by
> > > 
> > > commit de0a41484c47d783dd4d442914815076aa2caac2
> > > Author: Paul Gortmaker <paul.gortmaker@windriver.com>
> > > Date:   Mon Oct 1 11:43:49 2012 -0400
> > > 
> > >      tg3: unconditionally select HWMON support when tg3 is enabled.
> > > 
> > Would you mind submitting this for stable by following the procedure
> > described in Documentation/stable_kernel_rules.txt?
> > 
> 
> Will do. Thank you for bringing this to our attention.
> 

Thanks for submitting the patch to stable, Greg has queued it for the 
kernels he maintains.  Denys, expect to see this fix in 3.6.8.

^ permalink raw reply

* [PATCH net 1/1] sis900: fix sis900_set_mode call parameters.
From: Francois Romieu @ 2012-11-18 22:41 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Jan Janssen, Daniele Venzano

Leftover of 57d6d456cfb89264f87d24f52640ede23fdf12bd ("sis900: stop
using net_device.{base_addr, irq} and convert to __iomem.").

It is needed for suspend / resume to work.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Jan Janssen <medhefgo@web.de>
Cc: Daniele Venzano <venza@brownhat.org>
---
 drivers/net/ethernet/sis/sis900.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c
index fb9f6b3..edf5edb 100644
--- a/drivers/net/ethernet/sis/sis900.c
+++ b/drivers/net/ethernet/sis/sis900.c
@@ -2479,7 +2479,7 @@ static int sis900_resume(struct pci_dev *pci_dev)
 	netif_start_queue(net_dev);
 
 	/* Workaround for EDB */
-	sis900_set_mode(ioaddr, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
+	sis900_set_mode(sis_priv, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
 
 	/* Enable all known interrupts by setting the interrupt mask. */
 	sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE);
-- 
1.7.11.7

^ permalink raw reply related

* Re: [PATCH net 1/1] sis900: fix sis900_set_mode call parameters.
From: David Miller @ 2012-11-18 23:28 UTC (permalink / raw)
  To: romieu; +Cc: netdev, medhefgo, venza
In-Reply-To: <20121118224150.GA6755@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Sun, 18 Nov 2012 23:41:50 +0100

> Leftover of 57d6d456cfb89264f87d24f52640ede23fdf12bd ("sis900: stop
> using net_device.{base_addr, irq} and convert to __iomem.").
> 
> It is needed for suspend / resume to work.
> 
> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> Tested-by: Jan Janssen <medhefgo@web.de>
> Cc: Daniele Venzano <venza@brownhat.org>

Ouch, applied, thanks!

^ permalink raw reply

* RE: [net-next:master 83/84] drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19: sparse: incorrect type in return expression (different base types)
From: Sony Chacko @ 2012-11-19  1:10 UTC (permalink / raw)
  To: kbuild test robot; +Cc: netdev
In-Reply-To: <50a89f9f.oTR4cFYr2+4dX7g+%fengguang.wu@intel.com>

> -----Original Message-----
> From: kbuild test robot [mailto:fengguang.wu@intel.com]
> Sent: Sunday, November 18, 2012 12:43 AM
> To: Sony Chacko
> Cc: netdev
> Subject: [net-next:master 83/84]
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19: sparse: incorrect
> type in return expression (different base types)

We will submit the fixes after testing the changes.

^ permalink raw reply

* Re: [PATCH net-next 0/17] Make the network stack usable by userns root
From: David Miller @ 2012-11-19  3:26 UTC (permalink / raw)
  To: ebiederm; +Cc: netdev, containers, serge
In-Reply-To: <87d2zd8zwn.fsf@xmission.com>

From: ebiederm@xmission.com (Eric W. Biederman)
Date: Fri, 16 Nov 2012 05:01:44 -0800

> 
> In a secondary user namespace the root user only has CAP_NET_ADMIN,
> CAP_NET_RAW and CAP_NET_BIND_SERVICE with respect to the secondary user
> namespace.  The test "capable(CAP_NET_ADMIN)" tests for capabilities in
> the initial user namespace.
> 
> The following set of patches goes through the networking stack.  First
> pushing the capable(CAP_NET_ADMIN) admin calls down farther in the stack
> so individual instances can be changed.  Then where I have I it appears
> safe I have relaxed the permission checks.
> 
> The code is available in git from:
> git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git netns-v73
> 
> The netns-v73 branch is against v3.7-rc3 and merges cleanly with net-next.
> 
> In my user namespace tree I am working to allow unprivileged users to
> create user namespace, and to allow the user namespace root able to
> create network namespaces.  Making these patches really about allowing
> unprivileged users able to use the networking stack (not that they will
> be able to talk to anyone).
> 
> David I have some small dependencies on the first two patches of this
> series in my later user namespace work.  So after these changes have
> been reviewed if you can pull my netns-v73 branch (which is just these
> patches) into net-next that will help me avoid unnecessary conflicts.

There were merge issues so I applied the patches and sorted the
conflicts out one-by-one.

I hope this doesn't cause major problems.

^ permalink raw reply

* Re: 82571EB: Detected Hardware Unit Hang
From: Joe Jin @ 2012-11-19  5:38 UTC (permalink / raw)
  To: Dave, Tushar N
  Cc: e1000-devel@lists.sf.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Mary Mcgrath
In-Reply-To: <061C8A8601E8EE4CA8D8FD6990CEA8913349A0B4@ORSMSX102.amr.corp.intel.com>

On 11/16/12 04:26, Dave, Tushar N wrote:
>> Would you please help to fine the offset of max payload size in eeprom?
>> I'd like to have a try to modify it by ethtool.
> 
> It is defined using bit 8 of word 0x1A.
> Bit value 0 = 128B , bit value 1 = 256B

Hi Tushar,

I checked one of my server which Max Payload Size is 128:

# lspci -vvv -s 52:00.1
52:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
        Subsystem: Intel Corporation PRO/1000 PT Quad Port Server Adapter
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin B routed to IRQ 266
        Region 0: Memory at dfea0000 (32-bit, non-prefetchable) [size=128K]
        Region 1: Memory at dfe80000 (32-bit, non-prefetchable) [size=128K]
        Region 2: I/O ports at 6020 [size=32]
        [virtual] Expansion ROM at d8120000 [disabled] [size=128K]
        Capabilities: [c8] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
        Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
                Address: 00000000fee00000  Data: 409a
        Capabilities: [e0] Express (v1) Endpoint, MSI 00
                DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <512ns, L1 <64us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-
                DevCtl: Report errors: Correctable+ Non-Fatal+ Fatal+ Unsupported+
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 4096 bytes
                DevSta: CorrErr- UncorrErr- FatalErr+ UnsuppReq+ AuxPwr- TransPend-
                LnkCap: Port #0, Speed 2.5GT/s, Width x4, ASPM L0s, Latency L0 <4us, L1 <64us
                        ClockPM- Surprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x4, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
        Capabilities: [100 v1] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-
                UESvrt: DLP+ SDES- TLP+ FCP+ CmpltTO+ CmpltAbrt+ UnxCmplt+ RxOF+ MalfTLP+ ECRC- UnsupReq+ ACSViol-
                CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
                CEMsk:  RxErr+ BadTLP+ BadDLLP+ Rollover+ Timeout+ NonFatalErr-
                AERCap: First Error Pointer: 14, GenCap- CGenEn- ChkCap- ChkEn-
        Capabilities: [140 v1] Device Serial Number 00-15-17-ff-ff-16-ed-86
        Kernel driver in use: e1000e
        Kernel modules: e1000e

And eeprom dump as below:

Offset          Values
------          ------
0x0000          00 15 17 16 ed 86 24 05 ff ff a2 50 ff ff ff ff 
0x0010          57 d4 07 74 2f a4 a4 11 86 80 a4 10 86 80 65 b1 
0x0020          08 00 a4 10 00 58 00 00 01 50 00 00 00 00 00 01 
0x0030          f6 6c b0 37 a6 07 03 84 83 07 00 00 03 c3 02 06 
0x0040          08 00 f0 0e 64 21 40 00 01 40 00 00 00 00 00 00 
0x0050          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0x0060          00 01 00 40 1e 12 07 40 00 01 00 40 ff ff ff ff 


If I did not misunderstand, the value of offset 0x1a is 0x07a6, then the bit 8 is 1, but 
my NIC's MPS is 128b, anything I'm wrong? 

Thanks,
Joe

^ permalink raw reply

* Re: [rfc net-next v6 2/3] virtio_net: multiqueue support
From: Jason Wang @ 2012-11-19  6:18 UTC (permalink / raw)
  To: Rusty Russell
  Cc: krkumar2, kvm, mst, netdev, linux-kernel, virtualization, davem
In-Reply-To: <874nl5yn4k.fsf@rustcorp.com.au>

On 11/05/2012 07:16 AM, Rusty Russell wrote:
> Jason Wang <jasowang@redhat.com> writes:
>> This addes multiqueue support to virtio_net driver. There's two mode supported:
>> single queue pair mode and multiple queue pairs mode. An obvious
>> difference compared with a physical mq card is that virtio-net reserve
>> first two virtqueues when it is working in multiqueue mode, this is
>> used for implementing adaptive mode switching in the future. The
>> virtqueues that were in both mq and sq mode were initialized and only
>> one queue pair (single queue mode) were used at default. User could
>> use ethtool -L to switch to multiqueue mode withe the next patch.
> Hi Jason,
>
>          This first patch looks good, but conflates three things
> together:
> (1) Separate per-queue structures from struct virtnet_info to allow
>      multiple queues.  This is the mechanical part of the patch.
> (2) An annotation bugfix, see below.
> (3) Enabling mq using a new feature and negotiation.

Hi Rusty:

Sorry for the late response, just back from vacation.

For 1 and 3, I will split the patch as you suggested.
For 2, will fix it.

Thanks
>
>> @@ -700,7 +767,8 @@ static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev,
>>   	unsigned int start;
>>   
>>   	for_each_possible_cpu(cpu) {
>> -		struct virtnet_stats *stats = per_cpu_ptr(vi->stats, cpu);
>> +		struct virtnet_stats __percpu *stats
>> +			= per_cpu_ptr(vi->stats, cpu);
>>   		u64 tpackets, tbytes, rpackets, rbytes;
>>   
>>   		do {
> Cheers,
> Rusty.
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" 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: [rfc net-next v6 3/3] virtio-net: change the number of queues through ethtool
From: Jason Wang @ 2012-11-19  6:22 UTC (permalink / raw)
  To: Rusty Russell
  Cc: krkumar2, kvm, mst, netdev, linux-kernel, virtualization, davem
In-Reply-To: <871ug9yls5.fsf@rustcorp.com.au>

On 11/05/2012 07:46 AM, Rusty Russell wrote:
> Jason Wang <jasowang@redhat.com> writes:
>> This patch implement the {set|get}_channels method of ethool to allow user to
>> change the number of queues dymaically when the device is running. This would
>> let the user to tune the device for specific applications.
> ...
>> +	/* Only two modes were support currently */
>> +	if (queue_pairs == 0)
>> +		return -EINVAL;
>> +	if (queue_pairs != vi->total_queue_pairs - 1 && queue_pairs != 1)
>> +		return -EINVAL;
> OK, so you let them do all or nothing, but this three-way test is
> pretty unclear.

True, looks like the first check could be removed.
>
> In fact, the whole total_queue_pairs/num_queue_pairs thing is weird (and
> uncommented).  I think for "total" you mean "max"; the maximum possible
> queue pair number.

Yes, "total" means "max", will add a comment or change the name to 
max_queue_pairs/current_queue_pairs.
>
> Let me go back and review the previous patch again...
>
> Cheers,
> Rusty.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply

* Re: Latest 3.6.6 are not compiling due tg3 network driver, hwmon_device_unregister
From: Denys Fedoryshchenko @ 2012-11-19  6:59 UTC (permalink / raw)
  To: David Rientjes
  Cc: Nithin Nayak Sujir, Paul Gortmaker, Michael Chan, netdev,
	linux-kernel
In-Reply-To: <alpine.DEB.2.00.1211181441470.5080@chino.kir.corp.google.com>

On 2012-11-19 00:42, David Rientjes wrote:
> On Wed, 14 Nov 2012, Nithin Nayak Sujir wrote:
>
>> On 11/14/2012 07:30 PM, David Rientjes wrote:
>> > On Wed, 14 Nov 2012, Nithin Nayak Sujir wrote:
>> >
>> > > This was fixed by
>> > >
>> > > commit de0a41484c47d783dd4d442914815076aa2caac2
>> > > Author: Paul Gortmaker <paul.gortmaker@windriver.com>
>> > > Date:   Mon Oct 1 11:43:49 2012 -0400
>> > >
>> > >      tg3: unconditionally select HWMON support when tg3 is 
>> enabled.
>> > >
>> > Would you mind submitting this for stable by following the 
>> procedure
>> > described in Documentation/stable_kernel_rules.txt?
>> >
>>
>> Will do. Thank you for bringing this to our attention.
>>
>
> Thanks for submitting the patch to stable, Greg has queued it for the
> kernels he maintains.  Denys, expect to see this fix in 3.6.8.
Thank you!

---
Denys Fedoryshchenko, Network Engineer, Virtual ISP S.A.L.

^ permalink raw reply

* Birthday Please
From: Samiul Haque @ 2012-11-19  6:53 UTC (permalink / raw)
  To: netdev

Hello

Click on the link below and please enter your birthday for me.  It will take less than one minute.

http://www.birthdayalarm.com/bd2/88069043a120552402b1546197641c338248399d1386

Thank You,
Samiul

^ permalink raw reply

* Re: [PATCH net-next 0/17] Make the network stack usable by userns root
From: Eric W. Biederman @ 2012-11-19  7:27 UTC (permalink / raw)
  To: David Miller
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
In-Reply-To: <20121118.222601.1683927229305655885.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> writes:

> There were merge issues so I applied the patches and sorted the
> conflicts out one-by-one.
>
> I hope this doesn't cause major problems.

Shucks, I had thought I had tested and verified there would not be merge
issues.  Oh well.

No major problems.

To keep it that way I am dropping all but the first two patches from my
userns development tree.  I have dependencies on the infrastructure bits.

A quick merge test reveals that your tree against my full development
tree has two minor conflicts that are trivial to resolve.  So I don't
anticipate Linus will have any problems.

Eric

^ 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