Netdev List
 help / color / mirror / Atom feed
* [PATCH v3 07/11] NFS: avoid rpcbind clients creation during service creation
From: Stanislav Kinsbursky @ 2011-09-13 18:14 UTC (permalink / raw)
  To: Trond.Myklebust
  Cc: linux-nfs, xemul, neilb, netdev, linux-kernel, bfields, davem
In-Reply-To: <20110913180953.3961.69217.stgit@localhost6.localdomain6>

NFS callbacks doesn't communicate portmapper and thus doesn't need rpcbind
clients.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

---
 fs/nfs/callback.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index e3d2942..2715c02 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -259,7 +259,7 @@ int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt)
 		nfs_callback_bc_serv(minorversion, xprt, cb_info);
 		goto out;
 	}
-	serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE, NULL);
+	serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE, 0, NULL);
 	if (!serv) {
 		ret = -ENOMEM;
 		goto out_err;

^ permalink raw reply related

* [PATCH v3 10/11] SUNRPC: remove rpcbind clients creation during service registering
From: Stanislav Kinsbursky @ 2011-09-13 18:14 UTC (permalink / raw)
  To: Trond.Myklebust
  Cc: linux-nfs, xemul, neilb, netdev, linux-kernel, bfields, davem
In-Reply-To: <20110913180953.3961.69217.stgit@localhost6.localdomain6>

We don't need this code since rpcbind clients are creating during RPC service
creation.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

---
 net/sunrpc/rpcb_clnt.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index d42b642..e5c936d 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -428,11 +428,6 @@ int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port)
 	struct rpc_message msg = {
 		.rpc_argp	= &map,
 	};
-	int error;
-
-	error = rpcb_create_local();
-	if (error)
-		return error;
 
 	dprintk("RPC:       %sregistering (%u, %u, %d, %u) with local "
 			"rpcbind\n", (port ? "" : "un"),
@@ -568,11 +563,7 @@ int rpcb_v4_register(const u32 program, const u32 version,
 	struct rpc_message msg = {
 		.rpc_argp	= &map,
 	};
-	int error;
 
-	error = rpcb_create_local();
-	if (error)
-		return error;
 	if (rpcb_local_clnt4 == NULL)
 		return -EPROTONOSUPPORT;
 

^ permalink raw reply related

* [PATCH v3 11/11] SUNRPC: remove rpcbind clients destruction on module cleanup
From: Stanislav Kinsbursky @ 2011-09-13 18:14 UTC (permalink / raw)
  To: Trond.Myklebust
  Cc: linux-nfs, xemul, neilb, netdev, linux-kernel, bfields, davem
In-Reply-To: <20110913180953.3961.69217.stgit@localhost6.localdomain6>

Rpcbind clients destruction during SUNRPC module removing is obsolete since now
those clients are destroying during last RPC service shutdown.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

---
 net/sunrpc/rpcb_clnt.c   |   12 ------------
 net/sunrpc/sunrpc_syms.c |    3 ---
 2 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index e5c936d..fc6c59b 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -1097,15 +1097,3 @@ static struct rpc_program rpcb_program = {
 	.version	= rpcb_version,
 	.stats		= &rpcb_stats,
 };
-
-/**
- * cleanup_rpcb_clnt - remove xprtsock's sysctls, unregister
- *
- */
-void cleanup_rpcb_clnt(void)
-{
-	if (rpcb_local_clnt4)
-		rpc_shutdown_client(rpcb_local_clnt4);
-	if (rpcb_local_clnt)
-		rpc_shutdown_client(rpcb_local_clnt);
-}
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index 9d08091..8ec9778 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -61,8 +61,6 @@ static struct pernet_operations sunrpc_net_ops = {
 
 extern struct cache_detail unix_gid_cache;
 
-extern void cleanup_rpcb_clnt(void);
-
 static int __init
 init_sunrpc(void)
 {
@@ -102,7 +100,6 @@ out:
 static void __exit
 cleanup_sunrpc(void)
 {
-	cleanup_rpcb_clnt();
 	rpcauth_remove_module();
 	cleanup_socket_xprt();
 	svc_cleanup_xprt_sock();

^ permalink raw reply related

* [PATCH net-next 2/2] qlcnic: Change CDRP function
From: Anirban Chakraborty @ 2011-09-13 18:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Anirban Chakraborty
In-Reply-To: <1315937179-22383-1-git-send-email-anirban.chakraborty@qlogic.com>

Argument list to CDRP function has become unmanageably long. Fix it by properly
declaring a struct that encompasses all the input and output parameters.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h        |   21 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c    |  374 +++++++++-----------
 .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c    |   12 +-
 3 files changed, 185 insertions(+), 222 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 04c7015..2fd1ba8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -36,8 +36,8 @@
 
 #define _QLCNIC_LINUX_MAJOR 5
 #define _QLCNIC_LINUX_MINOR 0
-#define _QLCNIC_LINUX_SUBVERSION 23
-#define QLCNIC_LINUX_VERSIONID  "5.0.23"
+#define _QLCNIC_LINUX_SUBVERSION 24
+#define QLCNIC_LINUX_VERSIONID  "5.0.24"
 #define QLCNIC_DRV_IDC_VER  0x01
 #define QLCNIC_DRIVER_VERSION  ((_QLCNIC_LINUX_MAJOR << 16) |\
 		 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
@@ -583,6 +583,7 @@ struct qlcnic_recv_context {
 #define QLCNIC_CDRP_CMD_DESTROY_RX_CTX          0x00000008
 #define QLCNIC_CDRP_CMD_CREATE_TX_CTX           0x00000009
 #define QLCNIC_CDRP_CMD_DESTROY_TX_CTX          0x0000000a
+#define QLCNIC_CDRP_CMD_INTRPT_TEST		0x00000011
 #define QLCNIC_CDRP_CMD_SET_MTU                 0x00000012
 #define QLCNIC_CDRP_CMD_READ_PHY		0x00000013
 #define QLCNIC_CDRP_CMD_WRITE_PHY		0x00000014
@@ -1358,6 +1359,18 @@ struct qlcnic_dump_operations {
 			struct qlcnic_dump_entry *, u32 *);
 };
 
+struct _cdrp_cmd {
+	u32 cmd;
+	u32 arg1;
+	u32 arg2;
+	u32 arg3;
+};
+
+struct qlcnic_cmd_args {
+	struct _cdrp_cmd req;
+	struct _cdrp_cmd rsp;
+};
+
 int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter);
 int qlcnic_fw_cmd_set_port(struct qlcnic_adapter *adapter, u32 config);
 
@@ -1470,9 +1483,7 @@ int qlcnic_check_loopback_buff(unsigned char *data, u8 mac[]);
 
 /* Functions from qlcnic_main.c */
 int qlcnic_reset_context(struct qlcnic_adapter *);
-u32 qlcnic_issue_cmd(struct qlcnic_adapter *adapter,
-	u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd,
-		u32 *rd_args[3]);
+void qlcnic_issue_cmd(struct qlcnic_adapter *adapter, struct qlcnic_cmd_args *);
 void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings);
 int qlcnic_diag_alloc_res(struct net_device *netdev, int test);
 netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index e0c85a5..569a837 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -26,50 +26,54 @@ qlcnic_poll_rsp(struct qlcnic_adapter *adapter)
 	return rsp;
 }
 
-u32
-qlcnic_issue_cmd(struct qlcnic_adapter *adapter,
-	u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd,
-		u32 *rd_args[3])
+void
+qlcnic_issue_cmd(struct qlcnic_adapter *adapter, struct qlcnic_cmd_args *cmd)
 {
 	u32 rsp;
 	u32 signature;
-	u32 rcode = QLCNIC_RCODE_SUCCESS;
 	struct pci_dev *pdev = adapter->pdev;
+	struct qlcnic_hardware_context *ahw = adapter->ahw;
 
-	signature = QLCNIC_CDRP_SIGNATURE_MAKE(pci_fn, version);
+	signature = QLCNIC_CDRP_SIGNATURE_MAKE(ahw->pci_func,
+		adapter->fw_hal_version);
 
 	/* Acquire semaphore before accessing CRB */
-	if (qlcnic_api_lock(adapter))
-		return QLCNIC_RCODE_TIMEOUT;
+	if (qlcnic_api_lock(adapter)) {
+		cmd->rsp.cmd = QLCNIC_RCODE_TIMEOUT;
+		return;
+	}
 
 	QLCWR32(adapter, QLCNIC_SIGN_CRB_OFFSET, signature);
-	QLCWR32(adapter, QLCNIC_ARG1_CRB_OFFSET, arg1);
-	QLCWR32(adapter, QLCNIC_ARG2_CRB_OFFSET, arg2);
-	QLCWR32(adapter, QLCNIC_ARG3_CRB_OFFSET, arg3);
-	QLCWR32(adapter, QLCNIC_CDRP_CRB_OFFSET, QLCNIC_CDRP_FORM_CMD(cmd));
+	QLCWR32(adapter, QLCNIC_ARG1_CRB_OFFSET, cmd->req.arg1);
+	QLCWR32(adapter, QLCNIC_ARG2_CRB_OFFSET, cmd->req.arg2);
+	QLCWR32(adapter, QLCNIC_ARG3_CRB_OFFSET, cmd->req.arg3);
+	QLCWR32(adapter, QLCNIC_CDRP_CRB_OFFSET,
+		QLCNIC_CDRP_FORM_CMD(cmd->req.cmd));
 
 	rsp = qlcnic_poll_rsp(adapter);
 
 	if (rsp == QLCNIC_CDRP_RSP_TIMEOUT) {
 		dev_err(&pdev->dev, "card response timeout.\n");
-		rcode = QLCNIC_RCODE_TIMEOUT;
+		cmd->rsp.cmd = QLCNIC_RCODE_TIMEOUT;
 	} else if (rsp == QLCNIC_CDRP_RSP_FAIL) {
-		rcode = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
+		cmd->rsp.cmd = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
 		dev_err(&pdev->dev, "failed card response code:0x%x\n",
-				rcode);
+				cmd->rsp.cmd);
 	} else if (rsp == QLCNIC_CDRP_RSP_OK) {
-		if (rd_args[1])
-			*rd_args[1] = QLCRD32(adapter, QLCNIC_ARG2_CRB_OFFSET);
-		if (rd_args[2])
-			*rd_args[2] = QLCRD32(adapter, QLCNIC_ARG3_CRB_OFFSET);
+		cmd->rsp.cmd = QLCNIC_RCODE_SUCCESS;
+		if (cmd->rsp.arg2)
+			cmd->rsp.arg2 = QLCRD32(adapter,
+				QLCNIC_ARG2_CRB_OFFSET);
+		if (cmd->rsp.arg3)
+			cmd->rsp.arg3 = QLCRD32(adapter,
+				QLCNIC_ARG3_CRB_OFFSET);
 	}
-	if (rd_args[0])
-		*rd_args[0] = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
+	if (cmd->rsp.arg1)
+		cmd->rsp.arg1 = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
 
 	/* Release semaphore */
 	qlcnic_api_unlock(adapter);
 
-	return rcode;
 }
 
 static uint32_t qlcnic_temp_checksum(uint32_t *temp_buffer, u16 temp_size)
@@ -88,30 +92,25 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
 	int err, i;
 	u16 temp_size;
 	void *tmp_addr;
-	u32 version, csum, *template, *tmp_buf, rsp;
-	u32 *rd_args[3];
+	u32 version, csum, *template, *tmp_buf;
+	struct qlcnic_cmd_args cmd;
 	struct qlcnic_hardware_context *ahw;
 	struct qlcnic_dump_template_hdr *tmpl_hdr, *tmp_tmpl;
 	dma_addr_t tmp_addr_t = 0;
 
 	ahw = adapter->ahw;
-	rd_args[0] = &rsp;
-	rd_args[1] = (u32 *) &temp_size;
-	rd_args[2] = &version;
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			0,
-			0,
-			0,
-			QLCNIC_CDRP_CMD_TEMP_SIZE,
-			rd_args);
-	if (err != QLCNIC_RCODE_SUCCESS) {
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_TEMP_SIZE;
+	memset(&cmd.rsp, 1, sizeof(struct _cdrp_cmd));
+	qlcnic_issue_cmd(adapter, &cmd);
+	if (cmd.rsp.cmd != QLCNIC_RCODE_SUCCESS) {
 		dev_info(&adapter->pdev->dev,
-			"Can't get template size %d\n", rsp);
+			"Can't get template size %d\n", cmd.rsp.cmd);
 		err = -EIO;
 		return err;
 	}
+	temp_size = cmd.rsp.arg2;
+	version = cmd.rsp.arg3;
 	if (!temp_size)
 		return -EIO;
 
@@ -122,16 +121,14 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
 			"Can't get memory for FW dump template\n");
 		return -ENOMEM;
 	}
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-		adapter->ahw->pci_func,
-		adapter->fw_hal_version,
-		LSD(tmp_addr_t),
-		MSD(tmp_addr_t),
-		temp_size,
-		QLCNIC_CDRP_CMD_GET_TEMP_HDR,
-		rd_args);
-
+	memset(&cmd.rsp, 0, sizeof(struct _cdrp_cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_GET_TEMP_HDR;
+	cmd.req.arg1 = LSD(tmp_addr_t);
+	cmd.req.arg2 = MSD(tmp_addr_t);
+	cmd.req.arg3 = temp_size;
+	qlcnic_issue_cmd(adapter, &cmd);
+
+	err = cmd.rsp.cmd;
 	if (err != QLCNIC_RCODE_SUCCESS) {
 		dev_err(&adapter->pdev->dev,
 			"Failed to get mini dump template header %d\n", err);
@@ -167,20 +164,17 @@ error:
 int
 qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu)
 {
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
 
-	memset(rd_args, 0, sizeof(rd_args));
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_SET_MTU;
+	cmd.req.arg1 = recv_ctx->context_id;
+	cmd.req.arg2 = mtu;
+	cmd.req.arg3 = 0;
 	if (recv_ctx->state == QLCNIC_HOST_CTX_STATE_ACTIVE) {
-		if (qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			recv_ctx->context_id,
-			mtu,
-			0,
-			QLCNIC_CDRP_CMD_SET_MTU,
-			rd_args)) {
-
+		qlcnic_issue_cmd(adapter, &cmd);
+		if (cmd.rsp.cmd) {
 			dev_err(&adapter->pdev->dev, "Failed to set mtu\n");
 			return -EIO;
 		}
@@ -201,6 +195,7 @@ qlcnic_fw_cmd_create_rx_ctx(struct qlcnic_adapter *adapter)
 	struct qlcnic_cardrsp_sds_ring *prsp_sds;
 	struct qlcnic_host_rds_ring *rds_ring;
 	struct qlcnic_host_sds_ring *sds_ring;
+	struct qlcnic_cmd_args cmd;
 
 	dma_addr_t hostrq_phys_addr, cardrsp_phys_addr;
 	u64 phys_addr;
@@ -208,7 +203,6 @@ qlcnic_fw_cmd_create_rx_ctx(struct qlcnic_adapter *adapter)
 	u8 i, nrds_rings, nsds_rings;
 	size_t rq_size, rsp_size;
 	u32 cap, reg, val, reg2;
-	u32 *rd_args[3];
 	int err;
 
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
@@ -290,15 +284,13 @@ qlcnic_fw_cmd_create_rx_ctx(struct qlcnic_adapter *adapter)
 	}
 
 	phys_addr = hostrq_phys_addr;
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			(u32)(phys_addr >> 32),
-			(u32)(phys_addr & 0xffffffff),
-			rq_size,
-			QLCNIC_CDRP_CMD_CREATE_RX_CTX,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.arg1 = (u32) (phys_addr >> 32);
+	cmd.req.arg2 = (u32) (phys_addr & 0xffffffff);
+	cmd.req.arg3 = rq_size;
+	cmd.req.cmd = QLCNIC_CDRP_CMD_CREATE_RX_CTX;
+	qlcnic_issue_cmd(adapter, &cmd);
+	err = cmd.rsp.cmd;
 	if (err) {
 		dev_err(&adapter->pdev->dev,
 			"Failed to create rx ctx in firmware%d\n", err);
@@ -344,22 +336,18 @@ out_free_rq:
 static void
 qlcnic_fw_cmd_destroy_rx_ctx(struct qlcnic_adapter *adapter)
 {
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
 
-	memset(rd_args, 0, sizeof(rd_args));
-	if (qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			recv_ctx->context_id,
-			QLCNIC_DESTROY_CTX_RESET,
-			0,
-			QLCNIC_CDRP_CMD_DESTROY_RX_CTX,
-			rd_args)) {
-
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.arg1 = recv_ctx->context_id;
+	cmd.req.arg2 = QLCNIC_DESTROY_CTX_RESET;
+	cmd.req.arg3 = 0;
+	cmd.req.cmd = QLCNIC_CDRP_CMD_DESTROY_RX_CTX;
+	qlcnic_issue_cmd(adapter, &cmd);
+	if (cmd.rsp.cmd)
 		dev_err(&adapter->pdev->dev,
 			"Failed to destroy rx ctx in firmware\n");
-	}
 
 	recv_ctx->state = QLCNIC_HOST_CTX_STATE_FREED;
 }
@@ -373,7 +361,7 @@ qlcnic_fw_cmd_create_tx_ctx(struct qlcnic_adapter *adapter)
 	void	*rq_addr, *rsp_addr;
 	size_t	rq_size, rsp_size;
 	u32	temp;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	int	err;
 	u64	phys_addr;
 	dma_addr_t	rq_phys_addr, rsp_phys_addr;
@@ -423,15 +411,13 @@ qlcnic_fw_cmd_create_tx_ctx(struct qlcnic_adapter *adapter)
 	prq_cds->ring_size = cpu_to_le32(tx_ring->num_desc);
 
 	phys_addr = rq_phys_addr;
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			(u32)(phys_addr >> 32),
-			((u32)phys_addr & 0xffffffff),
-			rq_size,
-			QLCNIC_CDRP_CMD_CREATE_TX_CTX,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.arg1 = (u32)(phys_addr >> 32);
+	cmd.req.arg2 = ((u32)phys_addr & 0xffffffff);
+	cmd.req.arg3 = rq_size;
+	cmd.req.cmd = QLCNIC_CDRP_CMD_CREATE_TX_CTX;
+	qlcnic_issue_cmd(adapter, &cmd);
+	err = cmd.rsp.cmd;
 
 	if (err == QLCNIC_RCODE_SUCCESS) {
 		temp = le32_to_cpu(prsp->cds_ring.host_producer_crb);
@@ -457,37 +443,30 @@ out_free_rq:
 static void
 qlcnic_fw_cmd_destroy_tx_ctx(struct qlcnic_adapter *adapter)
 {
-	u32 *rd_args[3];
-
-	memset(rd_args, 0, sizeof(rd_args));
-	if (qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			adapter->tx_context_id,
-			QLCNIC_DESTROY_CTX_RESET,
-			0,
-			QLCNIC_CDRP_CMD_DESTROY_TX_CTX,
-			rd_args)) {
-
+	struct qlcnic_cmd_args cmd;
+
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.arg1 = adapter->tx_context_id;
+	cmd.req.arg2 = QLCNIC_DESTROY_CTX_RESET;
+	cmd.req.arg3 = 0;
+	cmd.req.cmd = QLCNIC_CDRP_CMD_DESTROY_TX_CTX;
+	qlcnic_issue_cmd(adapter, &cmd);
+	if (cmd.rsp.cmd)
 		dev_err(&adapter->pdev->dev,
 			"Failed to destroy tx ctx in firmware\n");
-	}
 }
 
 int
 qlcnic_fw_cmd_set_port(struct qlcnic_adapter *adapter, u32 config)
 {
-	u32 *rd_args[3];
-
-	memset(rd_args, 0, sizeof(rd_args));
-	return qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			config,
-			0,
-			0,
-			QLCNIC_CDRP_CMD_CONFIG_PORT,
-			rd_args);
+	struct qlcnic_cmd_args cmd;
+
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.arg1 = config;
+	cmd.req.cmd = QLCNIC_CDRP_CMD_CONFIG_PORT;
+	qlcnic_issue_cmd(adapter, &cmd);
+
+	return cmd.rsp.cmd;
 }
 
 int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
@@ -652,24 +631,17 @@ void qlcnic_free_hw_resources(struct qlcnic_adapter *adapter)
 int qlcnic_get_mac_address(struct qlcnic_adapter *adapter, u8 *mac)
 {
 	int err;
-	u32 arg1, rd_arg1, rd_arg2;
-	u32 *rd_args[3];
-
-	arg1 = adapter->ahw->pci_func | BIT_8;
-	rd_args[0] = &rd_arg1;
-	rd_args[1] = &rd_arg2;
-	rd_args[2] = 0;
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			arg1,
-			0,
-			0,
-			QLCNIC_CDRP_CMD_MAC_ADDRESS,
-			rd_args);
+	struct qlcnic_cmd_args cmd;
+
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.arg1 = adapter->ahw->pci_func | BIT_8;
+	cmd.req.cmd = QLCNIC_CDRP_CMD_MAC_ADDRESS;
+	cmd.rsp.arg1 = cmd.rsp.arg2 = 1;
+	qlcnic_issue_cmd(adapter, &cmd);
+	err = cmd.rsp.cmd;
 
 	if (err == QLCNIC_RCODE_SUCCESS)
-		qlcnic_fetch_mac(adapter, rd_arg1, rd_arg2, 0, mac);
+		qlcnic_fetch_mac(adapter, cmd.rsp.arg1, cmd.rsp.arg2, 0, mac);
 	else {
 		dev_err(&adapter->pdev->dev,
 			"Failed to get mac address%d\n", err);
@@ -687,7 +659,7 @@ int qlcnic_get_nic_info(struct qlcnic_adapter *adapter,
 	dma_addr_t nic_dma_t;
 	struct qlcnic_info *nic_info;
 	void *nic_info_addr;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	size_t	nic_size = sizeof(struct qlcnic_info);
 
 	nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size,
@@ -697,15 +669,13 @@ int qlcnic_get_nic_info(struct qlcnic_adapter *adapter,
 	memset(nic_info_addr, 0, nic_size);
 
 	nic_info = nic_info_addr;
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			MSD(nic_dma_t),
-			LSD(nic_dma_t),
-			(func_id << 16 | nic_size),
-			QLCNIC_CDRP_CMD_GET_NIC_INFO,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_GET_NIC_INFO;
+	cmd.req.arg1 = MSD(nic_dma_t);
+	cmd.req.arg2 = LSD(nic_dma_t);
+	cmd.req.arg3 = (func_id << 16 | nic_size);
+	qlcnic_issue_cmd(adapter, &cmd);
+	err = cmd.rsp.cmd;
 
 	if (err == QLCNIC_RCODE_SUCCESS) {
 		npar_info->pci_func = le16_to_cpu(nic_info->pci_func);
@@ -744,7 +714,7 @@ int qlcnic_set_nic_info(struct qlcnic_adapter *adapter, struct qlcnic_info *nic)
 	int err = -EIO;
 	dma_addr_t nic_dma_t;
 	void *nic_info_addr;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	struct qlcnic_info *nic_info;
 	size_t nic_size = sizeof(struct qlcnic_info);
 
@@ -770,15 +740,13 @@ int qlcnic_set_nic_info(struct qlcnic_adapter *adapter, struct qlcnic_info *nic)
 	nic_info->min_tx_bw = cpu_to_le16(nic->min_tx_bw);
 	nic_info->max_tx_bw = cpu_to_le16(nic->max_tx_bw);
 
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			MSD(nic_dma_t),
-			LSD(nic_dma_t),
-			((nic->pci_func << 16) | nic_size),
-			QLCNIC_CDRP_CMD_SET_NIC_INFO,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_SET_NIC_INFO;
+	cmd.req.arg1 = MSD(nic_dma_t);
+	cmd.req.arg2 = LSD(nic_dma_t);
+	cmd.req.arg3 = ((nic->pci_func << 16) | nic_size);
+	qlcnic_issue_cmd(adapter, &cmd);
+	err = cmd.rsp.cmd;
 
 	if (err != QLCNIC_RCODE_SUCCESS) {
 		dev_err(&adapter->pdev->dev,
@@ -796,7 +764,7 @@ int qlcnic_get_pci_info(struct qlcnic_adapter *adapter,
 				struct qlcnic_pci_info *pci_info)
 {
 	int err = 0, i;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	dma_addr_t pci_info_dma_t;
 	struct qlcnic_pci_info *npar;
 	void *pci_info_addr;
@@ -810,15 +778,13 @@ int qlcnic_get_pci_info(struct qlcnic_adapter *adapter,
 	memset(pci_info_addr, 0, pci_size);
 
 	npar = pci_info_addr;
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			MSD(pci_info_dma_t),
-			LSD(pci_info_dma_t),
-			pci_size,
-			QLCNIC_CDRP_CMD_GET_PCI_INFO,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_GET_PCI_INFO;
+	cmd.req.arg1 = MSD(pci_info_dma_t);
+	cmd.req.arg2 = LSD(pci_info_dma_t);
+	cmd.req.arg3 = pci_size;
+	qlcnic_issue_cmd(adapter, &cmd);
+	err = cmd.rsp.cmd;
 
 	if (err == QLCNIC_RCODE_SUCCESS) {
 		for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++, npar++, pci_info++) {
@@ -850,7 +816,7 @@ int qlcnic_config_port_mirroring(struct qlcnic_adapter *adapter, u8 id,
 {
 	int err = -EIO;
 	u32 arg1;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 
 	if (adapter->op_mode != QLCNIC_MGMT_FUNC ||
 		!(adapter->eswitch[id].flags & QLCNIC_SWITCH_ENABLE))
@@ -859,15 +825,11 @@ int qlcnic_config_port_mirroring(struct qlcnic_adapter *adapter, u8 id,
 	arg1 = id | (enable_mirroring ? BIT_4 : 0);
 	arg1 |= pci_func << 8;
 
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			arg1,
-			0,
-			0,
-			QLCNIC_CDRP_CMD_SET_PORTMIRRORING,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_SET_PORTMIRRORING;
+	cmd.req.arg1 = arg1;
+	qlcnic_issue_cmd(adapter, &cmd);
+	err = cmd.rsp.cmd;
 
 	if (err != QLCNIC_RCODE_SUCCESS) {
 		dev_err(&adapter->pdev->dev,
@@ -890,7 +852,7 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *adapter, const u8 func,
 	dma_addr_t stats_dma_t;
 	void *stats_addr;
 	u32 arg1;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	int err;
 
 	if (esw_stats == NULL)
@@ -914,15 +876,13 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *adapter, const u8 func,
 	arg1 = func | QLCNIC_STATS_VERSION << 8 | QLCNIC_STATS_PORT << 12;
 	arg1 |= rx_tx << 15 | stats_size << 16;
 
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			arg1,
-			MSD(stats_dma_t),
-			LSD(stats_dma_t),
-			QLCNIC_CDRP_CMD_GET_ESWITCH_STATS,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_GET_ESWITCH_STATS;
+	cmd.req.arg1 = arg1;
+	cmd.req.arg2 = MSD(stats_dma_t);
+	cmd.req.arg3 = LSD(stats_dma_t);
+	qlcnic_issue_cmd(adapter, &cmd);
+	err = cmd.rsp.cmd;
 
 	if (!err) {
 		stats = stats_addr;
@@ -1003,7 +963,7 @@ int qlcnic_clear_esw_stats(struct qlcnic_adapter *adapter, const u8 func_esw,
 {
 
 	u32 arg1;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 
 	if (adapter->op_mode != QLCNIC_MGMT_FUNC)
 		return -EIO;
@@ -1024,15 +984,11 @@ int qlcnic_clear_esw_stats(struct qlcnic_adapter *adapter, const u8 func_esw,
 	arg1 = port | QLCNIC_STATS_VERSION << 8 | func_esw << 12;
 	arg1 |= BIT_14 | rx_tx << 15;
 
-	memset(rd_args, 0, sizeof(rd_args));
-	return qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			arg1,
-			0,
-			0,
-			QLCNIC_CDRP_CMD_GET_ESWITCH_STATS,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_GET_ESWITCH_STATS;
+	cmd.req.arg1 = arg1;
+	qlcnic_issue_cmd(adapter, &cmd);
+	return cmd.rsp.cmd;
 
 err_ret:
 	dev_err(&adapter->pdev->dev, "Invalid argument func_esw=%d port=%d"
@@ -1045,20 +1001,17 @@ __qlcnic_get_eswitch_port_config(struct qlcnic_adapter *adapter,
 					u32 *arg1, u32 *arg2)
 {
 	int err = -EIO;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	u8 pci_func;
 	pci_func = (*arg1 >> 8);
-	rd_args[0] = arg1;
-	rd_args[1] = arg2;
-	rd_args[2] = 0;
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			*arg1,
-			0,
-			0,
-			QLCNIC_CDRP_CMD_GET_ESWITCH_PORT_CONFIG,
-			rd_args);
+
+	cmd.req.cmd = QLCNIC_CDRP_CMD_GET_ESWITCH_PORT_CONFIG;
+	cmd.req.arg1 = *arg1;
+	cmd.rsp.arg1 = cmd.rsp.arg2 = 1;
+	qlcnic_issue_cmd(adapter, &cmd);
+	*arg1 = cmd.rsp.arg1;
+	*arg2 = cmd.rsp.arg2;
+	err = cmd.rsp.cmd;
 
 	if (err == QLCNIC_RCODE_SUCCESS) {
 		dev_info(&adapter->pdev->dev,
@@ -1082,7 +1035,7 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter,
 {
 	int err = -EIO;
 	u32 arg1, arg2 = 0;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 	u8 pci_func;
 
 	if (adapter->op_mode != QLCNIC_MGMT_FUNC)
@@ -1129,16 +1082,13 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter,
 		return err;
 	}
 
-	memset(rd_args, 0, sizeof(rd_args));
-	err = qlcnic_issue_cmd(adapter,
-			adapter->ahw->pci_func,
-			adapter->fw_hal_version,
-			arg1,
-			arg2,
-			0,
-			QLCNIC_CDRP_CMD_CONFIGURE_ESWITCH,
-			rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_CONFIGURE_ESWITCH;
+	cmd.req.arg1 = arg1;
+	cmd.req.arg2 = arg2;
+	qlcnic_issue_cmd(adapter, &cmd);
 
+	err = cmd.rsp.cmd;
 	if (err != QLCNIC_RCODE_SUCCESS) {
 		dev_err(&adapter->pdev->dev,
 			"Failed to configure eswitch pci func %d\n", pci_func);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index b127f80..11f4df7 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -659,7 +659,7 @@ static int qlcnic_irq_test(struct net_device *netdev)
 	struct qlcnic_adapter *adapter = netdev_priv(netdev);
 	int max_sds_rings = adapter->max_sds_rings;
 	int ret;
-	u32 *rd_args[3];
+	struct qlcnic_cmd_args cmd;
 
 	if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
 		return -EIO;
@@ -669,10 +669,12 @@ static int qlcnic_irq_test(struct net_device *netdev)
 		goto clear_it;
 
 	adapter->diag_cnt = 0;
-	memset(rd_args, 0, sizeof(rd_args));
-	ret = qlcnic_issue_cmd(adapter, adapter->ahw->pci_func,
-			adapter->fw_hal_version, adapter->ahw->pci_func,
-			0, 0, 0x00000011, rd_args);
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.req.cmd = QLCNIC_CDRP_CMD_INTRPT_TEST;
+	cmd.req.arg1 = adapter->ahw->pci_func;
+	qlcnic_issue_cmd(adapter, &cmd);
+	ret = cmd.rsp.cmd;
+
 	if (ret)
 		goto done;
 
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH net-next 1/2] qlcnic: Added error logging for firmware abort
From: Anirban Chakraborty @ 2011-09-13 18:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Ameen Rahman

From: Ameen Rahman <ameen.rahman@qlogic.com>

Signed-off-by: Ameen Rahman <ameen.rahman@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 690c93f..248d5fc 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -3087,7 +3087,7 @@ static int
 qlcnic_check_health(struct qlcnic_adapter *adapter)
 {
 	u32 state = 0, heartbeat;
-	struct net_device *netdev = adapter->netdev;
+	u32 peg_status;
 
 	if (qlcnic_check_temp(adapter))
 		goto detach;
@@ -3127,8 +3127,8 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
 	if (auto_fw_reset)
 		clear_bit(__QLCNIC_FW_ATTACHED, &adapter->state);
 
-	dev_info(&netdev->dev, "firmware hang detected\n");
-	dev_info(&adapter->pdev->dev, "Dumping hw/fw registers\n"
+	dev_err(&adapter->pdev->dev, "firmware hang detected\n");
+	dev_err(&adapter->pdev->dev, "Dumping hw/fw registers\n"
 			"PEG_HALT_STATUS1: 0x%x, PEG_HALT_STATUS2: 0x%x,\n"
 			"PEG_NET_0_PC: 0x%x, PEG_NET_1_PC: 0x%x,\n"
 			"PEG_NET_2_PC: 0x%x, PEG_NET_3_PC: 0x%x,\n"
@@ -3140,6 +3140,11 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
 			QLCRD32(adapter, QLCNIC_CRB_PEG_NET_2 + 0x3c),
 			QLCRD32(adapter, QLCNIC_CRB_PEG_NET_3 + 0x3c),
 			QLCRD32(adapter, QLCNIC_CRB_PEG_NET_4 + 0x3c));
+	peg_status = QLCRD32(adapter, QLCNIC_PEG_HALT_STATUS1);
+	if (LSW(MSB(peg_status)) == 0x67)
+		dev_err(&adapter->pdev->dev,
+			"Firmware aborted with error code 0x00006700. "
+				"Device is being reset.\n");
 detach:
 	adapter->dev_state = (state == QLCNIC_DEV_NEED_QUISCENT) ? state :
 		QLCNIC_DEV_NEED_RESET;
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH net-next 0/2] qlcnic: Fixes
From: Anirban Chakraborty @ 2011-09-13 18:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Anirban Chakraborty
In-Reply-To: <1315937179-22383-1-git-send-email-anirban.chakraborty@qlogic.com>

Please apply the series to net-next. Thanks.

-Anirban

^ permalink raw reply

* Re: [PATCH net-next 2/2] qlcnic: Change CDRP function
From: Joe Perches @ 2011-09-13 18:22 UTC (permalink / raw)
  To: Anirban Chakraborty; +Cc: David Miller, netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1315937179-22383-2-git-send-email-anirban.chakraborty@qlogic.com>

On Tue, 2011-09-13 at 11:06 -0700, Anirban Chakraborty wrote:
> Argument list to CDRP function has become unmanageably long. Fix it by properly
> declaring a struct that encompasses all the input and output parameters.

I don't think this is better.

I think you've overloaded the issue_cmd function and should
use separate issue_cmd_<type> functions instead.

^ permalink raw reply

* Re: Recall: [PATCH] RDSRDMA: Fix cleanup of rds_iw_mr_pool
From: David Miller @ 2011-09-13 18:37 UTC (permalink / raw)
  To: jonathan; +Cc: swise, netdev
In-Reply-To: <4E6F9831.8000203@opengridcomputing.com>

From: Jonathan Lallinger <jonathan@opengridcomputing.com>
Date: Tue, 13 Sep 2011 12:51:45 -0500

> I screwed up and submitted the wrong patch, if you could please remove
> this patch from the queue and I will resubmit the correct patch.

Ok, done.

In the future, please always CC: netdev when you are communicating
with me about networking patches.

^ permalink raw reply

* Re: [PATCH] per-cgroup tcp buffer limitation
From: Paul Menage @ 2011-09-13 18:46 UTC (permalink / raw)
  To: Glauber Costa
  Cc: Greg Thelen, linux-kernel, linux-mm, containers, netdev, xemul,
	David S. Miller, Hiroyouki Kamezawa, Eric W. Biederman,
	Suleiman Souhlal, Lennart Poettering
In-Reply-To: <4E6F9CC4.2000601@parallels.com>

On Tue, Sep 13, 2011 at 11:11 AM, Glauber Costa <glommer@parallels.com> wrote:
>
> What if they are all updated under the same lock ?

Right, that would be the kind of optimization that would remove the
need for worrying about whether or not to account it. It would
probably mean creating some memcg-specific structures like
res-counters that could handle multiple values, since you'd need to
update both the kernel charge and the total charge, in this cgroup
*and* its ancestors.

Paul

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [PATCHv2] ipv6: Create module parameter for use_tempaddr
From: Bjørn Mork @ 2011-09-13 18:39 UTC (permalink / raw)
  To: Paul Stewart; +Cc: netdev
In-Reply-To: <20110912212011.7C65B2041D@glenhelen.mtv.corp.google.com>

Paul Stewart <pstew@chromium.org> writes:

> When ipv6 is used as a module, there is no good place to set
> the default value for use_tempaddr.  Using sysctl.conf will
> set this parameter too early -- before the module is loaded.
> To solve this, create a module parameter that will set the
> default value of use_tempaddr for all devices.

How is use_tempaddr any different from the other /proc/sys/net/ipv6/*
variables?  Do you want to add a module parameter for all of them?

Why can't you run sysctl with an ipv6-specific sysctl.conf at a time
fitting your boot sequence?  Or load the ipv6 module before sysctl is
loads the default sysctl.conf if that is what you want?  Or just set the
variables in your network configuration scripts, prior to bringing the
interfaces up?

Or do as most people do nowadays:  Forget that ipv6 can be built as a
module, and just use it builtin.  It's not like it can be unloaded
anyway, so building it as a module does not give you anything.


Bjørn

^ permalink raw reply

* Re: [PATCH] per-cgroup tcp buffer limitation
From: Glauber Costa @ 2011-09-13 19:08 UTC (permalink / raw)
  To: Paul Menage
  Cc: Greg Thelen, linux-kernel, linux-mm, containers, netdev, xemul,
	David S. Miller, Hiroyouki Kamezawa, Eric W. Biederman,
	Suleiman Souhlal, Lennart Poettering
In-Reply-To: <CALdu-PDGpBnVHW7E5NobAwtXop5c03NTmijkk8oB7u-a5LEXww@mail.gmail.com>

On 09/13/2011 03:46 PM, Paul Menage wrote:
> On Tue, Sep 13, 2011 at 11:11 AM, Glauber Costa<glommer@parallels.com>  wrote:
>>
>> What if they are all updated under the same lock ?
>
> Right, that would be the kind of optimization that would remove the
> need for worrying about whether or not to account it. It would
> probably mean creating some memcg-specific structures like
> res-counters that could handle multiple values, since you'd need to
> update both the kernel charge and the total charge, in this cgroup
> *and* its ancestors.
>
> Paul
If we do that, we may have to commit to an intermediary user interface - 
with controls to to determine if kernel memory is billed to kernel or 
total, a enable/disable file, just to later render it pointless by a new 
optimization - that we seem to agree that seems possible.

I think it is preferred to always assume kernel memory is accounted to 
the kernel, and when we optimize it, no changes are made to what's 
exposed to userspace.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [PATCH] bridge: mask forwarding of IEEE 802 local multicast groups
From: Benjamin Poirier @ 2011-09-13 19:29 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David Lamparter, Nick Carter, netdev, Michał Mirosław,
	davem, Ed Swierk
In-Reply-To: <20110728084106.22166324@nehalam.ftrdhcpuser.net>

On 11-07-28 08:41, Stephen Hemminger wrote:
> On Wed, 27 Jul 2011 13:17:15 +0200
> David Lamparter <equinox@diac24.net> wrote:
> 
> > On Fri, Jul 15, 2011 at 06:33:45PM +0200, David Lamparter wrote:
> > > On Fri, Jul 15, 2011 at 06:03:57PM +0200, David Lamparter wrote:
> > > > On Fri, Jul 15, 2011 at 04:44:50PM +0100, Nick Carter wrote:
> > > > > On 12 July 2011 12:36, David Lamparter <equinox@diac24.net> wrote:
> > > > > > On Mon, Jul 11, 2011 at 08:27:55AM -0700, Stephen Hemminger wrote:
> > > > > >> I am still undecided on this. Understand the need, but don't like idea
> > > > > >> of bridge behaving in non-conforming manner. Will see if IEEE 802 committee
> > > > > >> has any input.
> > > > > >
> > > > > > The patch doesn't make the bridge behave nonconformant. The default mask
> > > > > > is 0, which just keeps the old behaviour.
> > > 
> > > P.S.: I'd like to once more stress this. In my opinion the patch should
> > > be merged because it provides desireable functionality at a small cost
> > > (one test, one knob) and __does not change any default behaviour__.
> > 
> > Stephen, anything new on this?
> 
> No.
> Don't like adding yet another hack user visible API which will have
> to be maintained for too long. But on the other hand I don't have
> a better solution at my finger tips. If better idea doesn't come
> along, then we can go with yours.

For virtualization-related problems, how about using macvtap? No need to
change the bridging code.

I had also previously submitted a patch to forward reserved group
addresses through the bridge. This was towards the goal of forwarding
EAPOL frames for virtual machines. I have since come to the realization
that one can use macvtap to achieve that instead. This forgoes the
bridge and offers better performance too.

I have tested macvtap + kvm to authenticate/authorize a virtual machine
connected to a 802.1X enabled switch. I used the instructions here for
macvtap:
http://virt.kernelnewbies.org/MacVTap
and tested with an HP switch and wpa_supplicant on the guest.

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

^ permalink raw reply

* [PATCH] RDSRDMA: Fix cleanup of rds_iw_mr_pool
From: Jonathan Lallinger @ 2011-09-13 19:41 UTC (permalink / raw)
  To: davem, venkat.x.venkatsubra; +Cc: netdev

In the rds_iw_mr_pool struct the free_pinned field keeps track of
memory pinned by free MRs. While this field is incremented properly
upon allocation, it is never decremented upon unmapping. This would
cause the rds_rdma module to crash the kernel upon unloading, by
triggering the BUG_ON in the rds_iw_destroy_mr_pool function.

This change keeps track of the MRs that become unpinned, so that
free_pinned can be decremented appropriately.

Signed-off-by: Jonathan Lallinger <jonathan@ogc.us>
Signed-off-by: Steve Wise <swise@ogc.us>
---

 net/rds/iw_rdma.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c
index 7c1c873..050256d 100644
--- a/net/rds/iw_rdma.c
+++ b/net/rds/iw_rdma.c
@@ -84,7 +84,8 @@ static int rds_iw_map_fastreg(struct rds_iw_mr_pool *pool,
 static void rds_iw_free_fastreg(struct rds_iw_mr_pool *pool, struct rds_iw_mr *ibmr);
 static unsigned int rds_iw_unmap_fastreg_list(struct rds_iw_mr_pool *pool,
 			struct list_head *unmap_list,
-			struct list_head *kill_list);
+			struct list_head *kill_list,
+			int *unpinned);
 static void rds_iw_destroy_fastreg(struct rds_iw_mr_pool *pool, struct rds_iw_mr *ibmr);
 
 static int rds_iw_get_device(struct rds_sock *rs, struct rds_iw_device **rds_iwdev, struct rdma_cm_id **cm_id)
@@ -499,7 +500,7 @@ static int rds_iw_flush_mr_pool(struct rds_iw_mr_pool *pool, int free_all)
 	LIST_HEAD(unmap_list);
 	LIST_HEAD(kill_list);
 	unsigned long flags;
-	unsigned int nfreed = 0, ncleaned = 0, free_goal;
+	unsigned int nfreed = 0, ncleaned = 0, unpinned = 0, free_goal;
 	int ret = 0;
 
 	rds_iw_stats_inc(s_iw_rdma_mr_pool_flush);
@@ -524,7 +525,8 @@ static int rds_iw_flush_mr_pool(struct rds_iw_mr_pool *pool, int free_all)
 	 * will be destroyed by the unmap function.
 	 */
 	if (!list_empty(&unmap_list)) {
-		ncleaned = rds_iw_unmap_fastreg_list(pool, &unmap_list, &kill_list);
+		ncleaned = rds_iw_unmap_fastreg_list(pool, &unmap_list,
+						     &kill_list, &unpinned);
 		/* If we've been asked to destroy all MRs, move those
 		 * that were simply cleaned to the kill list */
 		if (free_all)
@@ -548,6 +550,7 @@ static int rds_iw_flush_mr_pool(struct rds_iw_mr_pool *pool, int free_all)
 		spin_unlock_irqrestore(&pool->list_lock, flags);
 	}
 
+	atomic_sub(unpinned, &poll->free_pinned);
 	atomic_sub(ncleaned, &pool->dirty_count);
 	atomic_sub(nfreed, &pool->item_count);
 
@@ -828,7 +831,8 @@ static void rds_iw_free_fastreg(struct rds_iw_mr_pool *pool,
 
 static unsigned int rds_iw_unmap_fastreg_list(struct rds_iw_mr_pool *pool,
 				struct list_head *unmap_list,
-				struct list_head *kill_list)
+				struct list_head *kill_list,
+				int *unpinned)
 {
 	struct rds_iw_mapping *mapping, *next;
 	unsigned int ncleaned = 0;
@@ -855,6 +859,7 @@ static unsigned int rds_iw_unmap_fastreg_list(struct rds_iw_mr_pool *pool,
 
 		spin_lock_irqsave(&pool->list_lock, flags);
 		list_for_each_entry_safe(mapping, next, unmap_list, m_list) {
+			*unpinned += mapping->m_sg.len;
 			list_move(&mapping->m_list, &laundered);
 			ncleaned++;
 		}

^ permalink raw reply related

* Re: [PATCHv2] ipv6: Create module parameter for use_tempaddr
From: Paul Stewart @ 2011-09-13 19:56 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: netdev
In-Reply-To: <87r53ks2w3.fsf@nemi.mork.no>

On Tue, Sep 13, 2011 at 11:39 AM, Bjørn Mork <bjorn@mork.no> wrote:
> Paul Stewart <pstew@chromium.org> writes:
>
>> When ipv6 is used as a module, there is no good place to set
>> the default value for use_tempaddr.  Using sysctl.conf will
>> set this parameter too early -- before the module is loaded.
>> To solve this, create a module parameter that will set the
>> default value of use_tempaddr for all devices.
>
> How is use_tempaddr any different from the other /proc/sys/net/ipv6/*
> variables?  Do you want to add a module parameter for all of them?

With use_tempaddr and ipv6 loaded as a module, there is a gap of time
between addrconf starting up and whatever configuration one would use
to set use_tempaddr (you can't use sysctl.conf since module-load time
might be much later).  By the time boot scripts (or whatever you'd
use) are able to tweak use_tempaddr, it might be too late and the
global-trackable address (related to the MAC address) might end up in
use.  This negates the entire point of use_tempaddr.  If any of the
other flags suffer this badly at module-load time, I'd be happy to add
module parameters for them, but this is the only one that I've come to
be aware of.

> Why can't you run sysctl with an ipv6-specific sysctl.conf at a time
> fitting your boot sequence?  Or load the ipv6 module before sysctl is
> loads the default sysctl.conf if that is what you want?  Or just set the
> variables in your network configuration scripts, prior to bringing the
> interfaces up?
>
> Or do as most people do nowadays:  Forget that ipv6 can be built as a
> module, and just use it builtin.  It's not like it can be unloaded
> anyway, so building it as a module does not give you anything.

All helpful suggestions.  However, I'm not yet willing to accept the
claim that ipv6 cannot be used as a module unless the rest of the
system is painstakingly crafted to close any races between addrconf,
sysctl and other IPv6-using processes.  That strikes me as far too
brittle.

--
Paul

^ permalink raw reply

* Re: [PATCHv2] ipv6: Create module parameter for use_tempaddr
From: David Miller @ 2011-09-13 20:04 UTC (permalink / raw)
  To: pstew; +Cc: bjorn, netdev
In-Reply-To: <CAMcMvshXgKCpwLFPzUWvmacTuqmSEjDfPgvZU2BHeC+WcXRH0A@mail.gmail.com>

From: Paul Stewart <pstew@chromium.org>
Date: Tue, 13 Sep 2011 12:56:28 -0700

> However, I'm not yet willing to accept the claim that ipv6 cannot be
> used as a module unless the rest of the system is painstakingly
> crafted to close any races between addrconf, sysctl and other
> IPv6-using processes.  That strikes me as far too brittle.

Most distributions are moving to building ipv6 statically into the
kernel, largely because of the issues described here.

^ permalink raw reply

* Re: [PATCH net-next 2/2] qlcnic: Change CDRP function
From: Anirban Chakraborty @ 2011-09-13 20:28 UTC (permalink / raw)
  To: Joe Perches; +Cc: David Miller, netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1315938171.25776.11.camel@Joe-Laptop>


On Sep 13, 2011, at 11:22 AM, Joe Perches wrote:

> On Tue, 2011-09-13 at 11:06 -0700, Anirban Chakraborty wrote:
>> Argument list to CDRP function has become unmanageably long. Fix it by properly
>> declaring a struct that encompasses all the input and output parameters.
> 
> I don't think this is better.
> 
> I think you've overloaded the issue_cmd function and should
> use separate issue_cmd_<type> functions instead.

I did not overload issue_cmd(), instead I changed the function signature. 

-u32
-qlcnic_issue_cmd(struct qlcnic_adapter *adapter,
-       u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd,
-               u32 *rd_args[3])
+void
+qlcnic_issue_cmd(struct qlcnic_adapter *adapter, struct qlcnic_cmd_args *cmd)

Instead of having a long list of arguments, I put them into a struct and passed it around.

-Anirban

^ permalink raw reply

* bridge should flood non-IPv4-multicast ethernet frames
From: Chuck Anderson @ 2011-09-13 20:00 UTC (permalink / raw)
  To: netdev

When the bridge code grew multicast snooping capability (currently
IPv4/IGMPv2-only as I understand it), it stopped flooding non-IPv4
multicast ethernet frames.  This breaks the capability to bridge any
non-IPv4 protocols that also use multicast ethernet frames, such as
IPv6 and IS-IS, while the bridge snooping capability remains enabled
(it appears to be default enabled at least in the RHEL 6 vendor
kernel).  I noticed this when IPv6 neighbor discovery (ND) and router
advertisement (RA) packets weren't making it to a KVM guest via br0 on
the host, breaking IPv6 connectivity to the guest.  This type of thing
is a common bug with vendor's multicast snooping implementations, but
I was surprised to discover that Linux has this same bug.  See RFC
4541, section 1, last paragraph, and section 2.1.2, paragraph 4:

http://tools.ietf.org/html/rfc4541.html

I believe the relevent code is in br_device.c:

	if (is_broadcast_ether_addr(dest))
		br_flood_deliver(br, skb);
	else if (is_multicast_ether_addr(dest)) {
		if (unlikely(netpoll_tx_running(dev))) {
			br_flood_deliver(br, skb);
			goto out;
		}
		if (br_multicast_rcv(br, NULL, skb)) {
			kfree_skb(skb);
			goto out;
		}

		mdst = br_mdb_get(br, skb);
		if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb))
			br_multicast_deliver(mdst, skb);
		else
			br_flood_deliver(br, skb);
	} else if ((dst = __br_fdb_get(br, dest)) != NULL)
		br_deliver(dst->dst, skb);
	else
		br_flood_deliver(br, skb);

is_multicast_ether_addr() only checks to see if the lowest bit is
1--i.e. any multicast ethernet address.  That check alone isn't
sufficient.  There also needs to be a check that the ethernet frame is
in one of the well-known formats for the particular protocol for which
snooping is supported, IPv4 being the only one supported by Linux
bridging so far.

I see a few ways to fix this:

1.  IPv4 Multicast always uses multicast ethernet addresses in the
format 01:00:5E:xx:xx:xx.  Insert a check that the dest address
matches 01:00:5E:xx:xx:xx, otherwise always flood the frame so we
don't break non-IPv4-multicast frames from being bridged.  Something
like this pseudocode:

	if (is_broadcast_ether_addr(dest))
		br_flood_deliver(br, skb);
	else if (is_ipv4_multicast_ether_addr(dest)) {

...

static inline int is_ipv4_multicast_ether_addr(const u8 *addr)
{
	return (addr[0] == 0x01 && addr[1] == 0x00 && addr[2] == 0x5e);
}


2. Check that the Ethertype is 0x800 (IPv4), and if it is not, always
flood the frame so we don't break non-IPv6-multicast frames being
bridged.

3. Do both of the above, the key point being that IPv6 multicast
frames (33:33:xx:xx:xx:xx), along with any other ethernet multicast
frames that aren't supported by the current bridge snooping code,
should always be flooded unconditionally.  IS-IS for example uses
01:80:C2:00:00:14 and 01:80:C2:00:00:15.

Thoughts?

^ permalink raw reply

* Re: [PATCH net-next 2/2] qlcnic: Change CDRP function
From: Joe Perches @ 2011-09-13 20:56 UTC (permalink / raw)
  To: Anirban Chakraborty; +Cc: David Miller, netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <33055D09-742C-4751-9A4B-1AF11ED34E31@qlogic.com>

     On Tue, 2011-09-13 at 13:28 -0700, Anirban Chakraborty wrote:
> On Sep 13, 2011, at 11:22 AM, Joe Perches wrote:
> > On Tue, 2011-09-13 at 11:06 -0700, Anirban Chakraborty wrote:
> >> Argument list to CDRP function has become unmanageably long. Fix it by properly
> >> declaring a struct that encompasses all the input and output parameters.
> > I don't think this is better.
> > I think you've overloaded the issue_cmd function and should
> > use separate issue_cmd_<type> functions instead.
> I did not overload issue_cmd(), instead I changed the function signature. 
> -u32
> -qlcnic_issue_cmd(struct qlcnic_adapter *adapter,
> -       u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd,
> -               u32 *rd_args[3])
> +void
> +qlcnic_issue_cmd(struct qlcnic_adapter *adapter, struct qlcnic_cmd_args *cmd)
> Instead of having a long list of arguments, I put them into a struct and passed it around.

Yes, I saw that.

I think that if restructuring is done, perhaps there are
better alternatives to bundling all the arguments into a
single struct.

I think it might be more sensible to have multiple
issue_cmd_<cmd>(adapter, [appropriate_args]) functions
instead so that the arguments and returns are appropriate
for the cmd performed.

or maybe use

issue_cmd(adapter, cmd, struct)

so you make cmd explicit and it's a bit easier to read
if you really must use some struct where cmd doesn't
use all the elements of struct.

^ permalink raw reply

* Re: bridge should flood non-IPv4-multicast ethernet frames
From: Stephen Hemminger @ 2011-09-13 21:14 UTC (permalink / raw)
  To: Chuck Anderson; +Cc: netdev
In-Reply-To: <20110913200027.GQ28007@angus.ind.WPI.EDU>

On Tue, 13 Sep 2011 16:00:27 -0400
Chuck Anderson <cra@WPI.EDU> wrote:

> 2. Check that the Ethertype is 0x800 (IPv4), and if it is not, always
> flood the frame so we don't break non-IPv6-multicast frames being
> bridged.

Doing something based on Ether type is the correct solution.
It should handle ipv4 and ipv6 snooping and flood all other types.

^ permalink raw reply

* Re: [PATCH net-next 2/2] qlcnic: Change CDRP function
From: Anirban Chakraborty @ 2011-09-13 21:15 UTC (permalink / raw)
  To: Joe Perches; +Cc: David Miller, netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1315947384.25776.30.camel@Joe-Laptop>


On Sep 13, 2011, at 1:56 PM, Joe Perches wrote:

>     On Tue, 2011-09-13 at 13:28 -0700, Anirban Chakraborty wrote:
>> On Sep 13, 2011, at 11:22 AM, Joe Perches wrote:
>>> On Tue, 2011-09-13 at 11:06 -0700, Anirban Chakraborty wrote:
>>>> Argument list to CDRP function has become unmanageably long. Fix it by properly
>>>> declaring a struct that encompasses all the input and output parameters.
>>> I don't think this is better.
>>> I think you've overloaded the issue_cmd function and should
>>> use separate issue_cmd_<type> functions instead.
>> I did not overload issue_cmd(), instead I changed the function signature. 
>> -u32
>> -qlcnic_issue_cmd(struct qlcnic_adapter *adapter,
>> -       u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd,
>> -               u32 *rd_args[3])
>> +void
>> +qlcnic_issue_cmd(struct qlcnic_adapter *adapter, struct qlcnic_cmd_args *cmd)
>> Instead of having a long list of arguments, I put them into a struct and passed it around.
> 
> Yes, I saw that.
> 
> I think that if restructuring is done, perhaps there are
> better alternatives to bundling all the arguments into a
> single struct.
> 
> I think it might be more sensible to have multiple
> issue_cmd_<cmd>(adapter, [appropriate_args]) functions
> instead so that the arguments and returns are appropriate
> for the cmd performed.
> 
> or maybe use
> 
> issue_cmd(adapter, cmd, struct)
> 
> so you make cmd explicit and it's a bit easier to read
> if you really must use some struct where cmd doesn't
> use all the elements of struct.

The usage of issue_cmd() here is to send a message to the FW. In some cases, the caller
of the function may want to read additional data right after the FW cmd is executed and in some
cases it doesn't.  As you mentioned, one way to do is to use two different issue_cmd()s. However,
we find it easier to use a single issue_cmd(), where the caller indicates whether it needs additional
data by setting the parameters in the argument. 

Thank you for your feedback.

-Anirban

^ permalink raw reply

* Your Mail Quota Has Exceeded
From: Mail Administrator @ 2011-09-13 21:27 UTC (permalink / raw)


Your Mail Quota Has Exceeded The Set Quota/Limit. You Are Currently
Running On 23GB Due To Hidden Files And Folders On Your Mailbox,
you may not be able to receive or send new mails until you re-validate.

Please Click  Any of the Link Below To Validate Your Mailbox And Increase
Your Quota.

http://buzurl.com/bi51

Failure to do so may result cancellation of your web mail account.
Thanks, and sorry for the inconvenience

Mail Administrator



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

^ permalink raw reply

* (unknown), 
From: Mr. Song Lile Transfer Offer 2011 @ 2011-09-13 21:54 UTC (permalink / raw)


I am Song Lile. Director of Hang Seng Bank HongKong Ltd, I do not know if we can work together in transferring $19,500,000.USD from my bank to your bank account. Finally if you are interested I shall provide you with more details. Please contact me with this Email: mrsonglile2011@yahoo.cn

^ permalink raw reply

* Re: [PATCH] ixgbe: drop zero length frame segments during a packet split rx
From: Jeff Kirsher @ 2011-09-13 22:52 UTC (permalink / raw)
  To: Neil Horman
  Cc: netdev@vger.kernel.org, Thadeu Lima de Souza Cascardo,
	Brandeburg, Jesse, Duyck, Alexander H, Fastabend, John R,
	David S. Miller
In-Reply-To: <20110913105003.GA16222@hmsreliant.think-freely.org>

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

On Tue, 2011-09-13 at 03:50 -0700, Neil Horman wrote:
> On Fri, Sep 02, 2011 at 10:03:17AM -0400, Neil Horman wrote:
> > This oops was reported recently no ppc64 hardware:
> > Unable to handle kernel paging request for data at address 0x00000000
> > Faulting instruction address: 0xc0000000004dda0c
> > Oops: Kernel access of bad area, sig: 11 [#1]
> > SMP NR_CPUS=1024 NUMA pSeries
> > Modules linked in: sunrpc ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4
> > iptable_fi
> > lter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state
> > nf_conntrack ip6table_filter ip6_tables ipv6 jsm ses enclosure sg ixgbe
> > mdio e1000 ehea ext4 jbd2 mbcache sd_mod crc_t10dif ipr dm_mod
> > NIP: c0000000004dda0c LR: c0000000004e3e50 CTR: c0000000004e3e20
> > REGS: c0000001bffeb8d0 TRAP: 0300   Not tainted  (3.1.0-rc2-10121-gab7e2db)
> > MSR: 8000000000009032 <EE,ME,IR,DR>  CR: 28002042  XER: 20000000
> > CFAR: c000000000004d70
> > DAR: 0000000000000000, DSISR: 40000000
> > TASK = c000000000d548e0[0] 'swapper' THREAD: c000000000dfc000 CPU: 0
> > GPR04: c0000000010f4d80 c0000001bffebd80 0000000000000000 c0000001b18a8200
> > GPR08: 0000000000000280 c0000001bcc517a8 c0000001b18a7f80 0000000000000000
> > GPR12: d0000000047e5bb0 c000000001f10000 c0000001b19c8700 0000000000000000
> > GPR16: c0000001bffebd80 0000000000000083 c00000018f2447a0 0000000000000002
> > GPR20: 0000000000000000 c0000001ba860010 c0000001ba860000 d000000003d40000
> > GPR24: 0000000000000000 0000000000000083 d000000003d40000 0000000000000001
> > GPR28: c00000018f244780 c0000001b2b94310 c000000000da95f0 c0000001bcc51780
> > NIP [c0000000004dda0c] .skb_gro_reset_offset+0x5c/0xe0
> > LR [c0000000004e3e50] .napi_gro_receive+0x30/0x120
> > Call Trace:
> > [c0000001bffebb50] [c000000000da95f0] perf_callchain_user+0x0/0x10 (unreliable)
> > [c0000001bffebbf0] [d0000000047bd118] .ixgbe_clean_rx_irq+0x7a8/0x8a0 [ixgbe]
> > [c0000001bffebd10] [d0000000047bd414] .ixgbe_poll+0x64/0x160 [ixgbe]
> > [c0000001bffebdd0] [c0000000004e3358] .net_rx_action+0x108/0x2a0
> > [c0000001bffebea0] [c00000000009b220] .__do_softirq+0x110/0x2a0
> > [c0000001bffebf90] [c000000000023798] .call_do_softirq+0x14/0x24
> > [c000000000dff830] [c000000000011148] .do_softirq+0xf8/0x130
> > [c000000000dff8d0] [c00000000009aeb4] .irq_exit+0xb4/0xc0
> > [c000000000dff950] [c000000000011254] .do_IRQ+0xd4/0x300
> > [c000000000dffa10] [c000000000005024] hardware_interrupt_entry+0x18/0x74
> > --- Exception: 501 at .pseries_dedicated_idle_sleep+0xe4/0x210
> > LR = .pseries_dedicated_idle_sleep+0x8c/0x210
> > [c000000000dffd00] [c00000000005b194] .pseries_dedicated_idle_sleep+0x194/0x210
> > (unreliable)
> > [c000000000dffdc0] [c000000000018c84] .cpu_idle+0x164/0x210
> > [c000000000dffe70] [c00000000000b0d0] .rest_init+0x90/0xb0
> > [c000000000dffef0] [c000000000830bc0] .start_kernel+0x54c/0x56c
> > [c000000000dfff90] [c00000000000953c] .start_here_common+0x1c/0x60
> > 
> > Its caused when skb_gro_reset_offset attempts to call PageHighMem on
> > skb_shinfo(skb)->frags[0].page, when the frags array was left uninitalized.
> > This can happen in the ixgbe driver if the hardware reports a zero length rx
> > descriptor ni the middle of a packet split receive transaction.  I've consulted
> > with Jesse Brandeburg on this, who is attempting to root cause the issue at
> > Intel, but it seems prudent to add this check to the driver to discard frames of
> > that encounter this error to avoid the opps
> > 
> Sorry, I need to rescind this patch.  Looks like this is turning out to be an
> issue with an ideosyncracy in the dma hardware on this platform.
> 
> Thanks
> Neil
> 

Thanks for the update Neil.  I have dropped the patch from my queue.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH 2/3] netdev/of/phy: Add MDIO bus multiplexer support.
From: Kumar Gala @ 2011-09-13 23:07 UTC (permalink / raw)
  To: David Daney
  Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA, netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, ralf-6z/3iImG2C8G8FEW9MqTrA,
	David S. Miller
In-Reply-To: <1314820906-14004-3-git-send-email-david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>


> diff --git a/Documentation/devicetree/bindings/net/mdio-mux.txt b/Documentation/devicetree/bindings/net/mdio-mux.txt
> new file mode 100644
> index 0000000..a908312
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/mdio-mux.txt
> @@ -0,0 +1,132 @@
> +Common MDIO bus multiplexer/switch properties.
> +
> +An MDIO bus multiplexer/switch will have several child busses that are
> +numbered uniquely in a device dependent manner.  The nodes for an MDIO
> +bus multiplexer/switch will have one child node for each child bus.
> +
> +Required properties:
> +- parent-bus : phandle to the parent MDIO bus.

Should probably be mdio-parent-bus

> +
> +Optional properties:
> +- Other properties specific to the multiplexer/switch hardware.
> +
> +Required properties for child nodes:
> +- #address-cells = <1>;
> +- #size-cells = <0>;
> +- cell-index : The sub-bus number.

What does sub-bus number mean?

> +
> +
> +Example :

[snip]

> diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c
> new file mode 100644
> index 0000000..f9c5826
> --- /dev/null
> +++ b/drivers/net/phy/mdio-mux.c
> @@ -0,0 +1,182 @@
> +/*
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License.  See the file "COPYING" in the main directory of this archive
> + * for more details.
> + *
> + * Copyright (C) 2011 Cavium Networks
> + */
> +
> +#include <linux/platform_device.h>
> +#include <linux/of_mdio.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/gfp.h>
> +#include <linux/phy.h>
> +#include <linux/mdio-mux.h>
> +
> +#define DRV_VERSION "1.0"
> +#define DRV_DESCRIPTION "MDIO bus multiplexer driver"
> +
> +struct mdio_mux_parent_bus {
> +	struct mii_bus *mii_bus;
> +	int current_child;
> +	int parent_id;
> +	void *switch_data;
> +	int (*switch_fn)(int current_child, int desired_child, void *data);
> +};
> +
> +struct mdio_mux_child_bus {
> +	struct mii_bus *mii_bus;
> +	struct mdio_mux_parent_bus *parent;
> +	int bus_number;
> +	int phy_irq[PHY_MAX_ADDR];
> +};
> +
> +/*
> + * The parent bus' lock is used to order access to the switch_fn.
> + */
> +static int mdio_mux_read(struct mii_bus *bus, int phy_id, int regnum)
> +{
> +	struct mdio_mux_child_bus *cb = bus->priv;
> +	struct mdio_mux_parent_bus *pb = cb->parent;
> +	int r;
> +
> +	mutex_lock(&pb->mii_bus->mdio_lock);
> +	r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data);
> +	if (r)
> +		goto out;
> +
> +	pb->current_child = cb->bus_number;
> +
> +	r = pb->mii_bus->read(pb->mii_bus, phy_id, regnum);
> +out:
> +	mutex_unlock(&pb->mii_bus->mdio_lock);
> +
> +	return r;
> +}
> +
> +/*
> + * The parent bus' lock is used to order access to the switch_fn.
> + */
> +static int mdio_mux_write(struct mii_bus *bus, int phy_id,
> +			  int regnum, u16 val)
> +{
> +	struct mdio_mux_child_bus *cb = bus->priv;
> +	struct mdio_mux_parent_bus *pb = cb->parent;
> +
> +	int r;
> +
> +	mutex_lock(&pb->mii_bus->mdio_lock);
> +	r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data);
> +	if (r)
> +		goto out;
> +
> +	pb->current_child = cb->bus_number;
> +
> +	r = pb->mii_bus->write(pb->mii_bus, phy_id, regnum, val);
> +out:
> +	mutex_unlock(&pb->mii_bus->mdio_lock);
> +
> +	return r;
> +}
> +
> +static int parent_count;
> +
> +int mdio_mux_probe(struct platform_device *pdev,
> +		   int (*switch_fn)(int cur, int desired, void *data),
> +		   void *data)
> +{
> +	struct device_node *parent_bus_node;
> +	struct device_node *child_bus_node;
> +	int r, n, ret_val;
> +	struct mii_bus *parent_bus;
> +	struct mdio_mux_parent_bus *pb;
> +	struct mdio_mux_child_bus *cb;
> +
> +	if (!pdev->dev.of_node)
> +		return -ENODEV;
> +
> +	parent_bus_node = of_parse_phandle(pdev->dev.of_node, "parent-bus", 0);
> +
> +	if (!parent_bus_node)
> +		return -ENODEV;
> +
> +	parent_bus = of_mdio_find_bus(parent_bus_node);


So what happens if the parent bus probe happens after the mux probe?

> +
> +	pb = devm_kzalloc(&pdev->dev, sizeof(*pb), GFP_KERNEL);
> +	if (pb == NULL) {
> +		ret_val = -ENOMEM;
> +		goto err_parent_bus;
> +	}
> +
> +	pb->switch_data = data;
> +	pb->switch_fn = switch_fn;
> +	pb->current_child = -1;
> +	pb->parent_id = parent_count++;
> +	pb->mii_bus = parent_bus;
> +
> +	n = 0;
> +	for_each_child_of_node(pdev->dev.of_node, child_bus_node) {
> +		u32 v;
> +
> +		r = of_property_read_u32(child_bus_node, "cell-index", &v);
> +		if (r == 0) {
> +			cb = devm_kzalloc(&pdev->dev, sizeof(*cb), GFP_KERNEL);
> +			if (cb == NULL)
> +				break;
> +			cb->bus_number = v;
> +			cb->parent = pb;
> +			cb->mii_bus = mdiobus_alloc();
> +			cb->mii_bus->priv = cb;
> +
> +			cb->mii_bus->irq = cb->phy_irq;
> +			cb->mii_bus->name = "mdio_mux";
> +			snprintf(cb->mii_bus->id, MII_BUS_ID_SIZE, "%x.%x",
> +				 pb->parent_id, v);
> +			cb->mii_bus->parent = &pdev->dev;
> +			cb->mii_bus->read = mdio_mux_read;
> +			cb->mii_bus->write = mdio_mux_write;
> +			r = of_mdiobus_register(cb->mii_bus, child_bus_node);
> +			if (r) {
> +				of_node_put(child_bus_node);
> +				devm_kfree(&pdev->dev, cb);
> +			} else {
> +				n++;
> +			}
> +
> +		} else {
> +			of_node_put(child_bus_node);
> +		}
> +	}
> +	if (n) {
> +		dev_info(&pdev->dev, "Version " DRV_VERSION "\n");
> +		return 0;
> +	}
> +	ret_val = -ENOMEM;
> +	devm_kfree(&pdev->dev, pb);
> +err_parent_bus:
> +	of_node_put(parent_bus_node);
> +	return ret_val;
> +}
> +EXPORT_SYMBOL(mdio_mux_probe);
> +
> +static int __devexit mdio_mux_remove(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +static int __init mdio_mux_mod_init(void)
> +{
> +	return 0;
> +}
> +module_init(mdio_mux_mod_init);
> +
> +static void __exit mdio_mux_mod_exit(void)
> +{
> +}
> +module_exit(mdio_mux_mod_exit);
> +
> +MODULE_DESCRIPTION(DRV_DESCRIPTION);
> +MODULE_VERSION(DRV_VERSION);
> +MODULE_AUTHOR("David Daney");
> +MODULE_LICENSE("GPL");

^ permalink raw reply

* Query on a lockdep issue in neigh_lookup
From: Murali raja Muniraju @ 2011-09-13 23:11 UTC (permalink / raw)
  To: netdev

Hi,
   I see a potential deadlock situation on the kernel 2.6.34. Has this
been fixed in the later version of the kernel.

I see that one after holding the neigh_lookup, one can acquire the
lock for rt_hash_locks

But there is a situation while freed skb's in dst_release while
holding the rt_hash_locks, neigh_lookup can be called which tries to
acquire its lock.

This seems to be a deadlock candidate.

Thanks,
Murali

Below if the scenario found by lockdep on a debug kernel during the
kernel bootup.

    [   92.245713] =======================================================
 [   92.246640] [ INFO: possible circular locking dependency detected ]
 [   92.246640] 2.6.34-dbg-2011082906 #1
 [   92.246640] -------------------------------------------------------
 [   92.246640] swapper/0 is trying to acquire lock:
 [   92.246640]  (&tbl->lock){++--..}, at: [<ffffffff81553a22>]
neigh_lookup+0x42/0xd0
 [   92.246640]
 [   92.246640] but task is already holding lock:
 [   92.246640]  (&(&rt_hash_locks[i])->rlock){+.-...}, at:
[<ffffffff815798e0>] rt_intern_hash+0xd0/0x880
 [   92.246640]
 [   92.246640] which lock already depends on the new lock.
 [   92.246640]
 [   92.246640]
 [   92.246640] the existing dependency chain (in reverse order) is:
 [   92.246640]
 [   92.246640] -> #2 (&(&rt_hash_locks[i])->rlock){+.-...}:
 [   92.246640]        [<ffffffff810e7700>] __lock_acquire+0xe30/0x1190
 [   92.246640]        [<ffffffff810e7af3>] lock_acquire+0x93/0x120
 [   92.246640]        [<ffffffff815ed266>] _raw_spin_lock_bh+0x36/0x50
 [   92.246640]        [<ffffffff81576a26>] rt_dst_release+0x66/0xc0
 [   92.246640]        [<ffffffff8155194c>] dst_release+0x5c/0x90
 [   92.246640]        [<ffffffff8153aef5>] skb_release_head_state+0x95/0xd0
 [   92.246640]        [<ffffffff8153ad06>] __kfree_skb+0x16/0xa0
 [   92.246640]        [<ffffffff8153ae12>] kfree_skb+0x42/0x90
 [   92.246640]        [<ffffffff81552fae>] __neigh_event_send+0x11e/0x1d0
 [   92.246640]        [<ffffffff81553193>] neigh_resolve_output+0x133/0x2f0
 [   92.246640]        [<ffffffff81584742>] ip_output+0x2c2/0x3a0
 [   92.246640]        [<ffffffff8158291d>] ip_local_out+0xad/0xc0
 [   92.246640]        [<ffffffff81582cc0>] ip_send_reply+0x290/0x340
 [   92.246640]        [<ffffffff815a3ba1>] tcp_v4_send_reset+0x1a1/0x310
 [   92.246640]        [<ffffffff815a7b04>] tcp_v4_rcv+0x314/0x9b0
 [   92.246640]        [<ffffffff8157e344>] ip_local_deliver_finish+0xf4/0x200
 [   92.246640]        [<ffffffff8157e4e0>] ip_local_deliver+0x90/0xa0
 [   92.246640]        [<ffffffff8157dbf1>] ip_rcv_finish+0x111/0x460
 [   92.246640]        [<ffffffff8157e17d>] ip_rcv+0x23d/0x310
 [   92.246640]        [<ffffffff81549144>] __netif_receive_skb+0x2d4/0x570
 [   92.246640]        [<ffffffff81549620>] netif_receive_skb+0xb0/0xc0
 [   92.246640]        [<ffffffff81549d28>] napi_gro_receive+0x148/0x180
 [   92.246640]        [<ffffffffa0066aba>]
e1000_clean_rx_irq+0x2ba/0x470 [e1000e]
 [   92.246640]        [<ffffffffa006567f>] e1000_clean+0x7f/0x280 [e1000e]
 [   92.246640]        [<ffffffff8154b200>] net_rx_action+0x170/0x4f0
 [   92.246640]        [<ffffffff810a8ec7>] __do_softirq+0x127/0x2b0
 [   92.246640]        [<ffffffff8104514c>] call_softirq+0x1c/0x50
 [   92.246640]        [<ffffffff810472dd>] do_softirq+0x7d/0xb0
 [   92.246640]        [<ffffffff810a8cd5>] irq_exit+0xa5/0xb0
 [   92.246640]        [<ffffffff815f5555>] do_IRQ+0x75/0xf0
 [   92.246640]        [<ffffffff815edb13>] ret_from_intr+0x0/0xf
 [   92.510442]        [<ffffffff815ed7d3>] _raw_spin_unlock+0x23/0x40
 [   92.510442]        [<ffffffff811b1d03>] sys_close+0xc3/0x160
 [   92.510442]        [<ffffffff8107d0e7>] sysenter_dispatch+0x7/0x2c
 [   92.510442]
 [   92.510442] -> #1 (&n->lock){++--..}:
 [   92.510442]        [<ffffffff810e7700>] __lock_acquire+0xe30/0x1190
 [   92.510442]        [<ffffffff810e7af3>] lock_acquire+0x93/0x120
 [   92.510442]        [<ffffffff815ed3b1>] _raw_write_lock+0x31/0x40
 [   92.510442]        [<ffffffff81556b90>] neigh_periodic_work+0xa0/0x4a0
 [   92.510442]        [<ffffffff810c274c>] worker_thread+0x1cc/0x330
 [   92.510442]        [<ffffffff810c7de6>] kthread+0x96/0xa0
 [   92.510442]        [<ffffffff81045054>] kernel_thread_helper+0x4/0x10
 [   92.510442]
 [   92.510442] -> #0 (&tbl->lock){++--..}:
 [   92.510442]        [<ffffffff810e7a5e>] __lock_acquire+0x118e/0x1190
 [   92.510442]        [<ffffffff810e7af3>] lock_acquire+0x93/0x120
 [   92.510442]        [<ffffffff815ed569>] _raw_read_lock_bh+0x39/0x50
 [   92.510442]        [<ffffffff81553a22>] neigh_lookup+0x42/0xd0
 [   92.510442]        [<ffffffff815b1ce9>] arp_bind_neighbour+0x79/0xb0
 [   92.510442]        [<ffffffff815799a2>] rt_intern_hash+0x192/0x880
 [   92.510442]        [<ffffffff8157bb3c>] ip_route_output_slow+0x47c/0xa50
 [   92.510442]        [<ffffffff8157c53f>] __ip_route_output_key+0x5f/0x250
 [   92.510442]        [<ffffffff8157c7c1>] ip_route_output_key+0x21/0x70
 [   92.510442]        [<ffffffff815b3a28>] arp_process+0x7f8/0x970
 [   92.510442]        [<ffffffff815b3cb1>] arp_rcv+0x111/0x140
 [   92.510442]        [<ffffffff81549144>] __netif_receive_skb+0x2d4/0x570
 [   92.510442]        [<ffffffff81549620>] netif_receive_skb+0xb0/0xc0
 [   92.510442]        [<ffffffff81549d28>] napi_gro_receive+0x148/0x180
 [   92.510442]        [<ffffffffa0066aba>]
e1000_clean_rx_irq+0x2ba/0x470 [e1000e]
 [   92.510442]        [<ffffffffa006567f>] e1000_clean+0x7f/0x280 [e1000e]
 [   92.510442]        [<ffffffff8154b200>] net_rx_action+0x170/0x4f0
 [   92.510442]        [<ffffffff810a8ec7>] __do_softirq+0x127/0x2b0
 [   92.510442]        [<ffffffff8104514c>] call_softirq+0x1c/0x50
 [   92.510442]        [<ffffffff810472dd>] do_softirq+0x7d/0xb0
 [   92.510442]        [<ffffffff810a8cd5>] irq_exit+0xa5/0xb0
 [   92.510442]        [<ffffffff815f5555>] do_IRQ+0x75/0xf0
 [   92.510442]        [<ffffffff815edb13>] ret_from_intr+0x0/0xf
 [   92.510442]        [<ffffffff81043125>] cpu_idle+0x95/0x150
 [   92.510442]        [<ffffffff81b924e1>] start_secondary+0x1d1/0x1d5
 [   92.510442]
 [   92.510442] other info that might help us debug this:
 [   92.510442]
 [   92.742983] 4 locks held by swapper/0:
 [   92.742983]  #0:  (rcu_read_lock){.+.+.+}, at:
[<ffffffff8154b17e>] net_rx_action+0xee/0x4f0
 [   92.742983]  #1:  (&(&napi->poll_lock)->rlock){+.-...}, at:
[<ffffffff8154b1d6>] net_rx_action+0x146/0x4f0
 [   92.742983]  #2:  (rcu_read_lock){.+.+.+}, at:
[<ffffffff81548ff0>] __netif_receive_skb+0x180/0x570
 [   92.742983]  #3:  (&(&rt_hash_locks[i])->rlock){+.-...}, at:
[<ffffffff815798e0>] rt_intern_hash+0xd0/0x880
 [   92.742983]
 [   92.742983] stack backtrace:
 [   92.742983] Pid: 0, comm: swapper Not tainted 2.6.34-dbg-2011082906 #1
 [   92.742983] Call Trace:
 [   92.742983]  <IRQ>  [<ffffffff810e40b9>] print_circular_bug+0xe9/0xf0
 [   92.742983]  [<ffffffff810e7a5e>] __lock_acquire+0x118e/0x1190
 [   92.742983]  [<ffffffff810e7af3>] lock_acquire+0x93/0x120
 [   92.742983]  [<ffffffff81553a22>] ? neigh_lookup+0x42/0xd0
 [   92.742983]  [<ffffffff815ed569>] _raw_read_lock_bh+0x39/0x50
 [   92.742983]  [<ffffffff81553a22>] ? neigh_lookup+0x42/0xd0
 [   92.742983]  [<ffffffff81553a22>] neigh_lookup+0x42/0xd0
 [   92.742983]  [<ffffffff815b1ce9>] arp_bind_neighbour+0x79/0xb0
 [   92.742983]  [<ffffffff815798e0>] ? rt_intern_hash+0xd0/0x880
 [   92.742983]  [<ffffffff815799a2>] rt_intern_hash+0x192/0x880
 [   92.742983]  [<ffffffff8157bb3c>] ip_route_output_slow+0x47c/0xa50
 [   92.742983]  [<ffffffff8157b961>] ? ip_route_output_slow+0x2a1/0xa50
 [   92.742983]  [<ffffffff8157c53f>] __ip_route_output_key+0x5f/0x250
 [   92.742983]  [<ffffffff8157c560>] ? __ip_route_output_key+0x80/0x250
 [   92.742983]  [<ffffffff8157c7c1>] ip_route_output_key+0x21/0x70
 [   92.742983]  [<ffffffff815b3a28>] arp_process+0x7f8/0x970
 [   92.742983]  [<ffffffff815b3230>] ? arp_process+0x0/0x970
 [   92.742983]  [<ffffffff815b3cb1>] arp_rcv+0x111/0x140
 [   92.742983]  [<ffffffff81549144>] __netif_receive_skb+0x2d4/0x570
 [   92.742983]  [<ffffffff81548ff0>] ? __netif_receive_skb+0x180/0x570
 [   92.742983]  [<ffffffff811ab25d>] ? __kmalloc_node_track_caller+0x7d/0x100
 [   92.742983]  [<ffffffff811a88d0>] ? kmem_cache_alloc_node+0x0/0x280
 [   92.742983]  [<ffffffff81549620>] netif_receive_skb+0xb0/0xc0
 [   92.742983]  [<ffffffff81549570>] ? netif_receive_skb+0x0/0xc0
 [   92.742983]  [<ffffffff8153981f>] ? __alloc_skb+0x8f/0x1a0
 [   92.742983]  [<ffffffff81549d28>] napi_gro_receive+0x148/0x180
 [   92.742983]  [<ffffffffa0066aba>] e1000_clean_rx_irq+0x2ba/0x470 [e1000e]
 [   92.742983]  [<ffffffffa006567f>] e1000_clean+0x7f/0x280 [e1000e]
 [   92.742983]  [<ffffffff8154b200>] net_rx_action+0x170/0x4f0
 [   92.742983]  [<ffffffff8154b17e>] ? net_rx_action+0xee/0x4f0
 [   92.742983]  [<ffffffff810a8e71>] ? __do_softirq+0xd1/0x2b0
 [   92.742983]  [<ffffffff810a8ec7>] __do_softirq+0x127/0x2b0
 [   92.742983]  [<ffffffff8104514c>] call_softirq+0x1c/0x50
 [   92.742983]  [<ffffffff810472dd>] do_softirq+0x7d/0xb0
 [   92.742983]  [<ffffffff810a8cd5>] irq_exit+0xa5/0xb0
 [   92.742983]  [<ffffffff815f5555>] do_IRQ+0x75/0xf0
 [   93.005851]  [<ffffffff815edb13>] ret_from_intr+0x0/0xf
 [   93.005851]  <EOI>  [<ffffffff8104d737>] ? mwait_idle+0x77/0xd0
 [   93.005851]  [<ffffffff8104d72e>] ? mwait_idle+0x6e/0xd0
 [   93.005851]  [<ffffffff81043125>] cpu_idle+0x95/0x150
 [   93.005851]  [<ffffffff81b924e1>] start_secondary+0x1d1/0x1d5

-- 
__MURALI__

^ 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