Netdev List
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH 3/9] vxge: Removed accessing non-supported registers.
From: Sreenivasa Honnur @ 2009-10-05  9:08 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

 - Removed accessing GENDMA_INT register
 - This allowed the firmware to perform a generic DMA write to host memory.
   This feature is not supported by the ASIC, this patch removes access to
   GENDMA_INT register.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch2/drivers/net/vxge/vxge-config.c patch3/drivers/net/vxge/vxge-config.c
--- patch2/drivers/net/vxge/vxge-config.c	2009-09-04 01:17:22.000000000 -0700
+++ patch3/drivers/net/vxge/vxge-config.c	2009-09-04 01:19:53.000000000 -0700
@@ -4106,8 +4106,6 @@ __vxge_hw_vpath_initialize(struct __vxge
 	if (status != VXGE_HW_OK)
 		goto exit;
 
-	writeq(0, &vp_reg->gendma_int);
-
 	val64 = readq(&vp_reg->rtdma_rd_optimization_ctrl);
 
 	/* Get MRRS value from device control */
diff -urpN patch2/drivers/net/vxge/vxge-reg.h patch3/drivers/net/vxge/vxge-reg.h
--- patch2/drivers/net/vxge/vxge-reg.h	2009-09-04 01:17:22.000000000 -0700
+++ patch3/drivers/net/vxge/vxge-reg.h	2009-09-04 01:20:26.000000000 -0700
@@ -4326,10 +4326,6 @@ struct vxge_hw_vpath_reg {
 /*0x011e0*/	u64	umq_bwr_init_byte;
 #define VXGE_HW_UMQ_BWR_INIT_BYTE_COUNT(val) vxge_vBIT(val, 0, 32)
 /*0x011e8*/	u64	gendma_int;
-#define	VXGE_HW_GENDMA_INT_IMMED_ENABLE	vxge_mBIT(6)
-#define	VXGE_HW_GENDMA_INT_EVENT_ENABLE	vxge_mBIT(7)
-#define VXGE_HW_GENDMA_INT_NUMBER(val) vxge_vBIT(val, 9, 7)
-#define VXGE_HW_GENDMA_INT_BITMAP(val) vxge_vBIT(val, 16, 16)
 /*0x011f0*/	u64	umqdmq_ir_init_notify;
 #define	VXGE_HW_UMQDMQ_IR_INIT_NOTIFY_PULSE	vxge_mBIT(3)
 /*0x011f8*/	u64	dmq_init_notify;


^ permalink raw reply

* [net-next-2.6 PATCH 2/9] vxge: Update driver_config->vpath_per_dev for each function in probe
From: Sreenivasa Honnur @ 2009-10-05  9:08 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- Update driver_config->vpath_per_dev for each function in probe.

- vpath_per_device specifies number of vpaths supported for each function/device. The
  current code was updating vpath_per_device only for physical device, however this has
  to be updated for each function also in case of a MF(Multi function) device.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch1/drivers/net/vxge/vxge-main.c patch2/drivers/net/vxge/vxge-main.c
--- patch1/drivers/net/vxge/vxge-main.c	2009-09-03 22:40:14.000000000 -0700
+++ patch2/drivers/net/vxge/vxge-main.c	2009-09-04 01:18:13.000000000 -0700
@@ -4088,9 +4088,10 @@ vxge_probe(struct pci_dev *pdev, const s
 		driver_config->config_dev_cnt = 0;
 		driver_config->total_dev_cnt = 0;
 		driver_config->g_no_cpus = 0;
-		driver_config->vpath_per_dev = max_config_vpath;
 	}
 
+	driver_config->vpath_per_dev = max_config_vpath;
+
 	driver_config->total_dev_cnt++;
 	if (++driver_config->config_dev_cnt > max_config_dev) {
 		ret = 0;


^ permalink raw reply

* [net-next-2.6 PATCH 1/9] vxge: Modify __vxge_hw_device_is_privilaged() to not assume function-0 as privilaged function.
From: Sreenivasa Honnur @ 2009-10-05  9:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- vxge driver was assuming function-0 is always the privilaged function. Now that
  restriction has been removed any function can act as a privilaged function.

- This patch modifies the __vxge_hw_device_is_privilaged routine to not assume
  function-0 as the privileged function.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN orig//drivers/net/vxge/vxge-config.c patch1//drivers/net/vxge/vxge-config.c
--- orig//drivers/net/vxge/vxge-config.c	2009-09-03 22:39:48.000000000 -0700
+++ patch1//drivers/net/vxge/vxge-config.c	2009-09-03 23:11:24.000000000 -0700
@@ -356,10 +356,8 @@ __vxge_hw_device_access_rights_get(u32 h
 
 	switch (host_type) {
 	case VXGE_HW_NO_MR_NO_SR_NORMAL_FUNCTION:
-		if (func_id == 0) {
-			access_rights |= VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM |
-					VXGE_HW_DEVICE_ACCESS_RIGHT_SRPCIM;
-		}
+		access_rights |= VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM |
+				VXGE_HW_DEVICE_ACCESS_RIGHT_SRPCIM;
 		break;
 	case VXGE_HW_MR_NO_SR_VH0_BASE_FUNCTION:
 		access_rights |= VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM |
@@ -382,6 +380,22 @@ __vxge_hw_device_access_rights_get(u32 h
 	return access_rights;
 }
 /*
+ * __vxge_hw_device_is_privilaged
+ * This routine checks if the device function is privilaged or not
+ */
+
+enum vxge_hw_status
+__vxge_hw_device_is_privilaged(u32 host_type, u32 func_id)
+{
+	if (__vxge_hw_device_access_rights_get(host_type,
+		func_id) &
+		VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM)
+		return VXGE_HW_OK;
+	else
+		return VXGE_HW_ERR_PRIVILAGED_OPEARATION;
+}
+
+/*
  * __vxge_hw_device_host_info_get
  * This routine returns the host type assignments
  */
@@ -446,18 +460,6 @@ __vxge_hw_verify_pci_e_info(struct __vxg
 	return VXGE_HW_OK;
 }
 
-enum vxge_hw_status
-__vxge_hw_device_is_privilaged(struct __vxge_hw_device *hldev)
-{
-	if ((hldev->host_type == VXGE_HW_NO_MR_NO_SR_NORMAL_FUNCTION ||
-	hldev->host_type == VXGE_HW_MR_NO_SR_VH0_BASE_FUNCTION ||
-	hldev->host_type == VXGE_HW_NO_MR_SR_VH0_FUNCTION0) &&
-	(hldev->func_id == 0))
-		return VXGE_HW_OK;
-	else
-		return VXGE_HW_ERR_PRIVILAGED_OPEARATION;
-}
-
 /*
  * vxge_hw_wrr_rebalance - Rebalance the RX_WRR and KDFC_WRR calandars.
  * Rebalance the RX_WRR and KDFC_WRR calandars.
@@ -470,7 +472,8 @@ vxge_hw_status vxge_hw_wrr_rebalance(str
 	u32 i, j, how_often = 1;
 	enum vxge_hw_status status = VXGE_HW_OK;
 
-	status = __vxge_hw_device_is_privilaged(hldev);
+	status = __vxge_hw_device_is_privilaged(hldev->host_type,
+			hldev->func_id);
 	if (status != VXGE_HW_OK)
 		goto exit;
 
@@ -668,7 +671,8 @@ enum vxge_hw_status __vxge_hw_device_ini
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 
-	if (VXGE_HW_OK == __vxge_hw_device_is_privilaged(hldev)) {
+	if (VXGE_HW_OK == __vxge_hw_device_is_privilaged(hldev->host_type,
+				hldev->func_id)) {
 		/* Validate the pci-e link width and speed */
 		status = __vxge_hw_verify_pci_e_info(hldev);
 		if (status != VXGE_HW_OK)
@@ -953,7 +957,8 @@ vxge_hw_mrpcim_stats_access(struct __vxg
 	u64 val64;
 	enum vxge_hw_status status = VXGE_HW_OK;
 
-	status = __vxge_hw_device_is_privilaged(hldev);
+	status = __vxge_hw_device_is_privilaged(hldev->host_type,
+			hldev->func_id);
 	if (status != VXGE_HW_OK)
 		goto exit;
 
@@ -990,7 +995,8 @@ vxge_hw_device_xmac_aggr_stats_get(struc
 
 	val64 = (u64 *)aggr_stats;
 
-	status = __vxge_hw_device_is_privilaged(hldev);
+	status = __vxge_hw_device_is_privilaged(hldev->host_type,
+			hldev->func_id);
 	if (status != VXGE_HW_OK)
 		goto exit;
 
@@ -1023,7 +1029,8 @@ vxge_hw_device_xmac_port_stats_get(struc
 	u32 offset = 0x0;
 	val64 = (u64 *) port_stats;
 
-	status = __vxge_hw_device_is_privilaged(hldev);
+	status = __vxge_hw_device_is_privilaged(hldev->host_type,
+			hldev->func_id);
 	if (status != VXGE_HW_OK)
 		goto exit;
 
@@ -1221,7 +1228,8 @@ enum vxge_hw_status vxge_hw_device_setpa
 		goto exit;
 	}
 
-	status = __vxge_hw_device_is_privilaged(hldev);
+	status = __vxge_hw_device_is_privilaged(hldev->host_type,
+			hldev->func_id);
 	if (status != VXGE_HW_OK)
 		goto exit;
 


^ permalink raw reply

* [net-next-2.6 PATCH 5/9] vxge: Removed unused functions.
From: Sreenivasa Honnur @ 2009-10-05  9:10 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- Removed the wrr_rebalance function

- This feature is not supported by the ASIC, hence removing the related code.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch4/drivers/net/vxge/vxge-config.c patch5/drivers/net/vxge/vxge-config.c
--- patch4/drivers/net/vxge/vxge-config.c	2009-09-04 01:21:52.000000000 -0700
+++ patch5/drivers/net/vxge/vxge-config.c	2009-09-04 01:24:25.000000000 -0700
@@ -461,209 +461,6 @@ __vxge_hw_verify_pci_e_info(struct __vxg
 }
 
 /*
- * vxge_hw_wrr_rebalance - Rebalance the RX_WRR and KDFC_WRR calandars.
- * Rebalance the RX_WRR and KDFC_WRR calandars.
- */
-static enum
-vxge_hw_status vxge_hw_wrr_rebalance(struct __vxge_hw_device *hldev)
-{
-	u64 val64;
-	u32 wrr_states[VXGE_HW_WEIGHTED_RR_SERVICE_STATES];
-	u32 i, j, how_often = 1;
-	enum vxge_hw_status status = VXGE_HW_OK;
-
-	status = __vxge_hw_device_is_privilaged(hldev->host_type,
-			hldev->func_id);
-	if (status != VXGE_HW_OK)
-		goto exit;
-
-	/* Reset the priorities assigned to the WRR arbitration
-	phases for the receive traffic */
-	for (i = 0; i < VXGE_HW_WRR_RING_COUNT; i++)
-		writeq(0, ((&hldev->mrpcim_reg->rx_w_round_robin_0) + i));
-
-	/* Reset the transmit FIFO servicing calendar for FIFOs */
-	for (i = 0; i < VXGE_HW_WRR_FIFO_COUNT; i++) {
-		writeq(0, ((&hldev->mrpcim_reg->kdfc_w_round_robin_0) + i));
-		writeq(0, ((&hldev->mrpcim_reg->kdfc_w_round_robin_20) + i));
-	}
-
-	/* Assign WRR priority  0 for all FIFOs */
-	for (i = 1; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
-		writeq(VXGE_HW_KDFC_FIFO_0_CTRL_WRR_NUMBER(0),
-				((&hldev->mrpcim_reg->kdfc_fifo_0_ctrl)  + i));
-
-		writeq(VXGE_HW_KDFC_FIFO_17_CTRL_WRR_NUMBER(0),
-			((&hldev->mrpcim_reg->kdfc_fifo_17_ctrl) + i));
-	}
-
-	/* Reset to service non-offload doorbells */
-	writeq(0, &hldev->mrpcim_reg->kdfc_entry_type_sel_0);
-	writeq(0, &hldev->mrpcim_reg->kdfc_entry_type_sel_1);
-
-	/* Set priority 0 to all receive queues */
-	writeq(0, &hldev->mrpcim_reg->rx_queue_priority_0);
-	writeq(0, &hldev->mrpcim_reg->rx_queue_priority_1);
-	writeq(0, &hldev->mrpcim_reg->rx_queue_priority_2);
-
-	/* Initialize all the slots as unused */
-	for (i = 0; i < VXGE_HW_WEIGHTED_RR_SERVICE_STATES; i++)
-		wrr_states[i] = -1;
-
-	/* Prepare the Fifo service states */
-	for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
-
-		if (!hldev->config.vp_config[i].min_bandwidth)
-			continue;
-
-		how_often = VXGE_HW_VPATH_BANDWIDTH_MAX /
-				hldev->config.vp_config[i].min_bandwidth;
-		if (how_often) {
-
-			for (j = 0; j < VXGE_HW_WRR_FIFO_SERVICE_STATES;) {
-				if (wrr_states[j] == -1) {
-					wrr_states[j] = i;
-					/* Make sure each fifo is serviced
-					 * atleast once */
-					if (i == j)
-						j += VXGE_HW_MAX_VIRTUAL_PATHS;
-					else
-						j += how_often;
-				} else
-					j++;
-			}
-		}
-	}
-
-	/* Fill the unused slots with 0 */
-	for (j = 0; j < VXGE_HW_WEIGHTED_RR_SERVICE_STATES; j++) {
-		if (wrr_states[j] == -1)
-			wrr_states[j] = 0;
-	}
-
-	/* Assign WRR priority number for FIFOs */
-	for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
-		writeq(VXGE_HW_KDFC_FIFO_0_CTRL_WRR_NUMBER(i),
-				((&hldev->mrpcim_reg->kdfc_fifo_0_ctrl) + i));
-
-		writeq(VXGE_HW_KDFC_FIFO_17_CTRL_WRR_NUMBER(i),
-			((&hldev->mrpcim_reg->kdfc_fifo_17_ctrl) + i));
-	}
-
-	/* Modify the servicing algorithm applied to the 3 types of doorbells.
-	i.e, none-offload, message and offload */
-	writeq(VXGE_HW_KDFC_ENTRY_TYPE_SEL_0_NUMBER_0(0) |
-				VXGE_HW_KDFC_ENTRY_TYPE_SEL_0_NUMBER_1(0) |
-				VXGE_HW_KDFC_ENTRY_TYPE_SEL_0_NUMBER_2(0) |
-				VXGE_HW_KDFC_ENTRY_TYPE_SEL_0_NUMBER_3(0) |
-				VXGE_HW_KDFC_ENTRY_TYPE_SEL_0_NUMBER_4(1) |
-				VXGE_HW_KDFC_ENTRY_TYPE_SEL_0_NUMBER_5(0) |
-				VXGE_HW_KDFC_ENTRY_TYPE_SEL_0_NUMBER_6(0) |
-				VXGE_HW_KDFC_ENTRY_TYPE_SEL_0_NUMBER_7(0),
-				&hldev->mrpcim_reg->kdfc_entry_type_sel_0);
-
-	writeq(VXGE_HW_KDFC_ENTRY_TYPE_SEL_1_NUMBER_8(1),
-				&hldev->mrpcim_reg->kdfc_entry_type_sel_1);
-
-	for (i = 0, j = 0; i < VXGE_HW_WRR_FIFO_COUNT; i++) {
-
-		val64 = VXGE_HW_KDFC_W_ROUND_ROBIN_0_NUMBER_0(wrr_states[j++]);
-		val64 |= VXGE_HW_KDFC_W_ROUND_ROBIN_0_NUMBER_1(wrr_states[j++]);
-		val64 |= VXGE_HW_KDFC_W_ROUND_ROBIN_0_NUMBER_2(wrr_states[j++]);
-		val64 |= VXGE_HW_KDFC_W_ROUND_ROBIN_0_NUMBER_3(wrr_states[j++]);
-		val64 |= VXGE_HW_KDFC_W_ROUND_ROBIN_0_NUMBER_4(wrr_states[j++]);
-		val64 |= VXGE_HW_KDFC_W_ROUND_ROBIN_0_NUMBER_5(wrr_states[j++]);
-		val64 |= VXGE_HW_KDFC_W_ROUND_ROBIN_0_NUMBER_6(wrr_states[j++]);
-		val64 |= VXGE_HW_KDFC_W_ROUND_ROBIN_0_NUMBER_7(wrr_states[j++]);
-
-		writeq(val64, (&hldev->mrpcim_reg->kdfc_w_round_robin_0 + i));
-		writeq(val64, (&hldev->mrpcim_reg->kdfc_w_round_robin_20 + i));
-	}
-
-	/* Set up the priorities assigned to receive queues */
-	writeq(VXGE_HW_RX_QUEUE_PRIORITY_0_RX_Q_NUMBER_0(0) |
-			VXGE_HW_RX_QUEUE_PRIORITY_0_RX_Q_NUMBER_1(1) |
-			VXGE_HW_RX_QUEUE_PRIORITY_0_RX_Q_NUMBER_2(2) |
-			VXGE_HW_RX_QUEUE_PRIORITY_0_RX_Q_NUMBER_3(3) |
-			VXGE_HW_RX_QUEUE_PRIORITY_0_RX_Q_NUMBER_4(4) |
-			VXGE_HW_RX_QUEUE_PRIORITY_0_RX_Q_NUMBER_5(5) |
-			VXGE_HW_RX_QUEUE_PRIORITY_0_RX_Q_NUMBER_6(6) |
-			VXGE_HW_RX_QUEUE_PRIORITY_0_RX_Q_NUMBER_7(7),
-			&hldev->mrpcim_reg->rx_queue_priority_0);
-
-	writeq(VXGE_HW_RX_QUEUE_PRIORITY_1_RX_Q_NUMBER_8(8) |
-			VXGE_HW_RX_QUEUE_PRIORITY_1_RX_Q_NUMBER_9(9) |
-			VXGE_HW_RX_QUEUE_PRIORITY_1_RX_Q_NUMBER_10(10) |
-			VXGE_HW_RX_QUEUE_PRIORITY_1_RX_Q_NUMBER_11(11) |
-			VXGE_HW_RX_QUEUE_PRIORITY_1_RX_Q_NUMBER_12(12) |
-			VXGE_HW_RX_QUEUE_PRIORITY_1_RX_Q_NUMBER_13(13) |
-			VXGE_HW_RX_QUEUE_PRIORITY_1_RX_Q_NUMBER_14(14) |
-			VXGE_HW_RX_QUEUE_PRIORITY_1_RX_Q_NUMBER_15(15),
-			&hldev->mrpcim_reg->rx_queue_priority_1);
-
-	writeq(VXGE_HW_RX_QUEUE_PRIORITY_2_RX_Q_NUMBER_16(16),
-				&hldev->mrpcim_reg->rx_queue_priority_2);
-
-	/* Initialize all the slots as unused */
-	for (i = 0; i < VXGE_HW_WEIGHTED_RR_SERVICE_STATES; i++)
-		wrr_states[i] = -1;
-
-	/* Prepare the Ring service states */
-	for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
-
-		if (!hldev->config.vp_config[i].min_bandwidth)
-			continue;
-
-		how_often = VXGE_HW_VPATH_BANDWIDTH_MAX /
-				hldev->config.vp_config[i].min_bandwidth;
-
-		if (how_often) {
-			for (j = 0; j < VXGE_HW_WRR_RING_SERVICE_STATES;) {
-				if (wrr_states[j] == -1) {
-					wrr_states[j] = i;
-					/* Make sure each ring is
-					 * serviced atleast once */
-					if (i == j)
-						j += VXGE_HW_MAX_VIRTUAL_PATHS;
-					else
-						j += how_often;
-				} else
-					j++;
-			}
-		}
-	}
-
-	/* Fill the unused slots with 0 */
-	for (j = 0; j < VXGE_HW_WEIGHTED_RR_SERVICE_STATES; j++) {
-		if (wrr_states[j] == -1)
-			wrr_states[j] = 0;
-	}
-
-	for (i = 0, j = 0; i < VXGE_HW_WRR_RING_COUNT; i++) {
-		val64 =  VXGE_HW_RX_W_ROUND_ROBIN_0_RX_W_PRIORITY_SS_0(
-				wrr_states[j++]);
-		val64 |=  VXGE_HW_RX_W_ROUND_ROBIN_0_RX_W_PRIORITY_SS_1(
-				wrr_states[j++]);
-		val64 |=  VXGE_HW_RX_W_ROUND_ROBIN_0_RX_W_PRIORITY_SS_2(
-				wrr_states[j++]);
-		val64 |=  VXGE_HW_RX_W_ROUND_ROBIN_0_RX_W_PRIORITY_SS_3(
-				wrr_states[j++]);
-		val64 |=  VXGE_HW_RX_W_ROUND_ROBIN_0_RX_W_PRIORITY_SS_4(
-				wrr_states[j++]);
-		val64 |=  VXGE_HW_RX_W_ROUND_ROBIN_0_RX_W_PRIORITY_SS_5(
-				wrr_states[j++]);
-		val64 |=  VXGE_HW_RX_W_ROUND_ROBIN_0_RX_W_PRIORITY_SS_6(
-				wrr_states[j++]);
-		val64 |=  VXGE_HW_RX_W_ROUND_ROBIN_0_RX_W_PRIORITY_SS_7(
-				wrr_states[j++]);
-
-		writeq(val64, ((&hldev->mrpcim_reg->rx_w_round_robin_0) + i));
-	}
-exit:
-	return status;
-}
-
-/*
  * __vxge_hw_device_initialize
  * Initialize Titan-V hardware.
  */
@@ -679,7 +476,6 @@ enum vxge_hw_status __vxge_hw_device_ini
 			goto exit;
 	}
 
-	vxge_hw_wrr_rebalance(hldev);
 exit:
 	return status;
 }


^ permalink raw reply

* [net-next-2.6 PATCH 4/9] vxge: Fixed crash in PAE system due to wrong typecasting.
From: Sreenivasa Honnur @ 2009-10-05  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- Fix a crash in PAE system due to wrong typecasting.

- On PAE system size_t is unsigned int which is 32bit. Avoid casting
  64 bit address to 32 bit

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch3/drivers/net/vxge/vxge-traffic.c patch4/drivers/net/vxge/vxge-traffic.c
--- patch3/drivers/net/vxge/vxge-traffic.c	2009-09-04 01:19:23.000000000 -0700
+++ patch4/drivers/net/vxge/vxge-traffic.c	2009-09-04 01:22:35.000000000 -0700
@@ -1232,7 +1232,7 @@ void vxge_hw_fifo_txdl_post(struct __vxg
 	vxge_hw_channel_dtr_post(&fifo->channel, txdlh);
 
 	__vxge_hw_non_offload_db_post(fifo,
-		(u64)(size_t)txdl_priv->dma_addr,
+		(u64)txdl_priv->dma_addr,
 		txdl_priv->frags - 1,
 		fifo->no_snoop_bits);
 


^ permalink raw reply

* vxge: Update driver_config->vpath_per_dev for each function in probe.
From: Sreenivasa Honnur @ 2009-10-05  9:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- Update driver_config->vpath_per_dev for each function in probe.

- vpath_per_device specifies number of vpaths supported for each function/device. The
  current code was updating vpath_per_device only for physical device, however this has
  to be updated for each function also in case of a MF(Multi function) device.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch1/drivers/net/vxge/vxge-main.c patch2/drivers/net/vxge/vxge-main.c
--- patch1/drivers/net/vxge/vxge-main.c	2009-09-03 22:40:14.000000000 -0700
+++ patch2/drivers/net/vxge/vxge-main.c	2009-09-04 01:18:13.000000000 -0700
@@ -4088,9 +4088,10 @@ vxge_probe(struct pci_dev *pdev, const s
 		driver_config->config_dev_cnt = 0;
 		driver_config->total_dev_cnt = 0;
 		driver_config->g_no_cpus = 0;
-		driver_config->vpath_per_dev = max_config_vpath;
 	}
 
+	driver_config->vpath_per_dev = max_config_vpath;
+
 	driver_config->total_dev_cnt++;
 	if (++driver_config->config_dev_cnt > max_config_dev) {
 		ret = 0;


^ permalink raw reply

* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: Eric Dumazet @ 2009-10-05  9:22 UTC (permalink / raw)
  To: William Allen Simpson; +Cc: David Miller, netdev
In-Reply-To: <4AC9AD14.2060500@gmail.com>

William Allen Simpson a écrit :
> This will be widely deployed.  Deployment in DNS root servers is
> expected by December.  It will be hammered with 600,000+ queries per
> minute.  Does that impact your design expectations?
> 

10.000 queries per second are challenging, definitly worth to study.


I could not find exact RFC number for this new feature.

Could you give us the up2date info ?

http://ietfreport.isoc.org/all-ids/draft-agl-tcpm-sadata-00.txt is expired.


^ permalink raw reply

* Re: [PATCH] wext: let get_wireless_stats() sleep
From: David Miller @ 2009-10-05  9:22 UTC (permalink / raw)
  To: johannes-cdvu00un1VgdHxzADdlk8Q
  Cc: linville-2XuSBdqkA4R54TAoqtyWWQ,
	miles.lane-Re5JQEeQqe8AvxtiuMwx3w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1254734159.22426.6.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org>

From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
Date: Mon, 05 Oct 2009 11:15:59 +0200

> A number of drivers (recently including cfg80211-based ones)
> assume that all wireless handlers, including statistics, can
> sleep and they often also implicitly assume that the rtnl is
> held around their invocation. This is almost always true now
> except when reading from sysfs:
 ...
> Fix this by using the rtnl instead of dev_base_lock.
> 
> Reported-by: Miles Lane <miles.lane-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>

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

^ permalink raw reply

* Re: [net-next-2.6 PATCH 1/9] vxge: Modify __vxge_hw_device_is_privilaged() to not assume function-0 as privilaged function.
From: David Miller @ 2009-10-05  9:20 UTC (permalink / raw)
  To: Sreenivasa.Honnur; +Cc: netdev, support
In-Reply-To: <Pine.GSO.4.10.10910050503530.2346-100000@guinness>

From: Sreenivasa Honnur <Sreenivasa.Honnur@neterion.com>
Date: Mon, 5 Oct 2009 05:06:06 -0400 (EDT)

> - vxge driver was assuming function-0 is always the privilaged function. Now that
>   restriction has been removed any function can act as a privilaged function.
> 
> - This patch modifies the __vxge_hw_device_is_privilaged routine to not assume
>   function-0 as the privileged function.
> 
> Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
> ---
> diff -urpN orig//drivers/net/vxge/vxge-config.c patch1//drivers/net/vxge/vxge-config.c
> --- orig//drivers/net/vxge/vxge-config.c	2009-09-03 22:39:48.000000000 -0700
> +++ patch1//drivers/net/vxge/vxge-config.c	2009-09-03 23:11:24.000000000 -0700

You can't have the double slash there in your paths, this
gets interpreted as "/drivers/net/vxge/vxge-config.c" by
all the patch applying tools.

Please "-p1" root your patches properly as described in
linux/Documentation/SubmittingPatches

You'll need to resubmit your entire patch set with this
fixed up.

Thanks.


^ permalink raw reply

* [net-next-2.6 PATCH 9/9] vxge: Version update
From: Sreenivasa Honnur @ 2009-10-05  9:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- Version Update.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN orig//drivers/net/vxge/vxge-version.h patch-9//drivers/net/vxge/vxge-version.h
--- orig//drivers/net/vxge/vxge-version.h	2009-10-04 22:43:59.000000000 -0700
+++ patch-9//drivers/net/vxge/vxge-version.h	2009-10-04 22:43:08.000000000 -0700
@@ -17,7 +17,7 @@
 
 #define VXGE_VERSION_MAJOR	"2"
 #define VXGE_VERSION_MINOR	"0"
-#define VXGE_VERSION_FIX	"5"
-#define VXGE_VERSION_BUILD	"18053"
+#define VXGE_VERSION_FIX	"6"
+#define VXGE_VERSION_BUILD	"18707"
 #define VXGE_VERSION_FOR	"k"
 #endif


^ permalink raw reply

* [PATCH] wext: let get_wireless_stats() sleep
From: Johannes Berg @ 2009-10-05  9:15 UTC (permalink / raw)
  To: John Linville; +Cc: Miles Lane, linux-wireless, netdev

A number of drivers (recently including cfg80211-based ones)
assume that all wireless handlers, including statistics, can
sleep and they often also implicitly assume that the rtnl is
held around their invocation. This is almost always true now
except when reading from sysfs:

  BUG: sleeping function called from invalid context at kernel/mutex.c:280
  in_atomic(): 1, irqs_disabled(): 0, pid: 10450, name: head
  2 locks held by head/10450:
   #0:  (&buffer->mutex){+.+.+.}, at: [<c10ceb99>] sysfs_read_file+0x24/0xf4
   #1:  (dev_base_lock){++.?..}, at: [<c12844ee>] wireless_show+0x1a/0x4c
  Pid: 10450, comm: head Not tainted 2.6.32-rc3 #1
  Call Trace:
   [<c102301c>] __might_sleep+0xf0/0xf7
   [<c1324355>] mutex_lock_nested+0x1a/0x33
   [<f8cea53b>] wdev_lock+0xd/0xf [cfg80211]
   [<f8cea58f>] cfg80211_wireless_stats+0x45/0x12d [cfg80211]
   [<c13118d6>] get_wireless_stats+0x16/0x1c
   [<c12844fe>] wireless_show+0x2a/0x4c

Fix this by using the rtnl instead of dev_base_lock.

Reported-by: Miles Lane <miles.lane-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
---
 net/core/net-sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- wireless-testing.orig/net/core/net-sysfs.c	2009-10-05 11:09:56.000000000 +0200
+++ wireless-testing/net/core/net-sysfs.c	2009-10-05 11:10:52.000000000 +0200
@@ -366,13 +366,13 @@ static ssize_t wireless_show(struct devi
 	const struct iw_statistics *iw;
 	ssize_t ret = -EINVAL;
 
-	read_lock(&dev_base_lock);
+	rtnl_lock();
 	if (dev_isalive(dev)) {
 		iw = get_wireless_stats(dev);
 		if (iw)
 			ret = (*format)(iw, buf);
 	}
-	read_unlock(&dev_base_lock);
+	rtnl_unlock();
 
 	return ret;
 }


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

^ permalink raw reply

* [net-next-2.6 PATCH 8/9] vxge: Acquire correct lock based on interrupt context.
From: Sreenivasa Honnur @ 2009-10-05  9:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- Added macros that check if the thread is in interrupt context or not to
  acquire or release locks

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch7/drivers/net/vxge/vxge-main.c patch8/drivers/net/vxge/vxge-main.c
--- patch7/drivers/net/vxge/vxge-main.c	2009-09-04 02:13:34.000000000 -0700
+++ patch8/drivers/net/vxge/vxge-main.c	2009-09-04 02:18:15.000000000 -0700
@@ -97,10 +97,10 @@ static inline void VXGE_COMPLETE_VPATH_T
 		more = 0;
 		skb_ptr = completed;
 
-		if (spin_trylock_irqsave(&fifo->tx_lock, flags)) {
+		if (vxge_spin_trylock(&fifo->tx_lock, flags)) {
 			vxge_hw_vpath_poll_tx(fifo->handle, &skb_ptr,
 						NR_SKB_COMPLETED, &more);
-			spin_unlock_irqrestore(&fifo->tx_lock, flags);
+			vxge_spin_unlock(&fifo->tx_lock, flags);
 		}
 		/* free SKBs */
 		for (temp = completed; temp != skb_ptr; temp++)
diff -urpN patch7/drivers/net/vxge/vxge-main.h patch8/drivers/net/vxge/vxge-main.h
--- patch7/drivers/net/vxge/vxge-main.h	2009-09-04 02:05:36.000000000 -0700
+++ patch8/drivers/net/vxge/vxge-main.h	2009-09-04 02:16:40.000000000 -0700
@@ -89,6 +89,26 @@
 
 #define VXGE_LL_MAX_FRAME_SIZE(dev) ((dev)->mtu + VXGE_HW_MAC_HEADER_MAX_SIZE)
 
+#define vxge_spin_lock(l, f) {                  \
+	if (in_interrupt())                     \
+		spin_lock(l);                   \
+	else                                    \
+		spin_lock_irqsave(l, f);        \
+}
+
+#define vxge_spin_trylock(l, f) \
+({ \
+	in_interrupt() ? \
+	spin_trylock(l) : spin_trylock_irqsave(l, f); \
+})
+
+#define vxge_spin_unlock(l, f) {                \
+	if (in_interrupt())                     \
+		spin_unlock(l);                 \
+	else                                    \
+		spin_unlock_irqrestore(l, f);   \
+}
+
 enum vxge_reset_event {
 	/* reset events */
 	VXGE_LL_VPATH_RESET	= 0,


^ permalink raw reply

* [net-next-2.6 PATCH 7/9] vxge: Allow multiple functions with INTA.
From: Sreenivasa Honnur @ 2009-10-05  9:12 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- Allow multiple functions with INTA.
- Removed the condition to allow only one vpath with INTA
- Ensure that the alarm bit in titan_mask_all_int register is cleared when
  driver exits.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch6/drivers/net/vxge/vxge-config.c patch7/drivers/net/vxge/vxge-config.cllow multiple functions with INTA.
- Removed the condition to allow only one vpath with INTA
- Ensure that the alarm bit in titan_mask_all_int register is cleared when
  driver exits.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
--- patch6/drivers/net/vxge/vxge-config.c	2009-09-04 01:33:43.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-config.c	2009-09-04 02:11:29.000000000 -0700
@@ -3882,6 +3882,30 @@ __vxge_hw_vpath_tim_configure(struct __v
 	return status;
 }
 
+void
+vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id)
+{
+	struct __vxge_hw_virtualpath *vpath;
+	struct vxge_hw_vpath_reg __iomem *vp_reg;
+	struct vxge_hw_vp_config *config;
+	u64 val64;
+
+	vpath = &hldev->virtual_paths[vp_id];
+	vp_reg = vpath->vp_reg;
+	config = vpath->vp_config;
+
+	if (config->fifo.enable == VXGE_HW_FIFO_ENABLE) {
+		val64 = readq(&vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_TX]);
+
+		if (config->tti.timer_ci_en != VXGE_HW_TIM_TIMER_CI_ENABLE) {
+			config->tti.timer_ci_en = VXGE_HW_TIM_TIMER_CI_ENABLE;
+			val64 |= VXGE_HW_TIM_CFG1_INT_NUM_TIMER_CI;
+			writeq(val64,
+			&vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_TX]);
+		}
+	}
+	return;
+}
 /*
  * __vxge_hw_vpath_initialize
  * This routine is the final phase of init which initializes the
diff -urpN patch6/drivers/net/vxge/vxge-main.c patch7/drivers/net/vxge/vxge-main.c
--- patch6/drivers/net/vxge/vxge-main.c	2009-09-04 01:31:12.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-main.c	2009-09-04 02:13:34.000000000 -0700
@@ -2435,7 +2435,6 @@ static int vxge_add_isr(struct vxgedev *
 	int ret = 0;
 #ifdef CONFIG_PCI_MSI
 	int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0;
-	u64 function_mode = vdev->config.device_hw_info.function_mode;
 	int pci_fun = PCI_FUNC(vdev->pdev->devfn);
 
 	if (vdev->config.intr_type == MSI_X)
@@ -2444,20 +2443,9 @@ static int vxge_add_isr(struct vxgedev *
 	if (ret) {
 		vxge_debug_init(VXGE_ERR,
 			"%s: Enabling MSI-X Failed", VXGE_DRIVER_NAME);
-		if ((function_mode == VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION) &&
-			test_and_set_bit(__VXGE_STATE_CARD_UP,
-				&driver_config->inta_dev_open))
-			return VXGE_HW_FAIL;
-		else {
-			vxge_debug_init(VXGE_ERR,
-				"%s: Defaulting to INTA", VXGE_DRIVER_NAME);
-			vdev->config.intr_type = INTA;
-			vxge_hw_device_set_intr_type(vdev->devh,
-				VXGE_HW_INTR_MODE_IRQLINE);
-			vxge_close_vpaths(vdev, 1);
-			vdev->no_of_vpath = 1;
-			vdev->stats.vpaths_open = 1;
-		}
+		vxge_debug_init(VXGE_ERR,
+			"%s: Defaulting to INTA", VXGE_DRIVER_NAME);
+		vdev->config.intr_type = INTA;
 	}
 
 	if (vdev->config.intr_type == MSI_X) {
@@ -2505,24 +2493,11 @@ static int vxge_add_isr(struct vxgedev *
 					"%s: MSIX - %d  Registration failed",
 					vdev->ndev->name, intr_cnt);
 				vxge_rem_msix_isr(vdev);
-				if ((function_mode ==
-					VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION) &&
-					test_and_set_bit(__VXGE_STATE_CARD_UP,
-						&driver_config->inta_dev_open))
-					return VXGE_HW_FAIL;
-				else {
-					vxge_hw_device_set_intr_type(
-						vdev->devh,
-						VXGE_HW_INTR_MODE_IRQLINE);
-						vdev->config.intr_type = INTA;
-					vxge_debug_init(VXGE_ERR,
-						"%s: Defaulting to INTA"
-						, vdev->ndev->name);
-					vxge_close_vpaths(vdev, 1);
-					vdev->no_of_vpath = 1;
-					vdev->stats.vpaths_open = 1;
+				vdev->config.intr_type = INTA;
+				vxge_debug_init(VXGE_ERR,
+					"%s: Defaulting to INTA"
+					, vdev->ndev->name);
 					goto INTA_MODE;
-				}
 			}
 
 			if (irq_req) {
@@ -2555,23 +2530,11 @@ static int vxge_add_isr(struct vxgedev *
 				"%s: MSIX - %d Registration failed",
 				vdev->ndev->name, intr_cnt);
 			vxge_rem_msix_isr(vdev);
-			if ((function_mode ==
-				VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION) &&
-				test_and_set_bit(__VXGE_STATE_CARD_UP,
-						&driver_config->inta_dev_open))
-				return VXGE_HW_FAIL;
-			else {
-				vxge_hw_device_set_intr_type(vdev->devh,
-						VXGE_HW_INTR_MODE_IRQLINE);
-				vdev->config.intr_type = INTA;
-				vxge_debug_init(VXGE_ERR,
-					"%s: Defaulting to INTA",
-					vdev->ndev->name);
-				vxge_close_vpaths(vdev, 1);
-				vdev->no_of_vpath = 1;
-				vdev->stats.vpaths_open = 1;
+			vdev->config.intr_type = INTA;
+			vxge_debug_init(VXGE_ERR,
+				"%s: Defaulting to INTA",
+				vdev->ndev->name);
 				goto INTA_MODE;
-			}
 		}
 
 		vxge_hw_vpath_msix_unmask(vdev->vpaths[vp_idx].handle,
@@ -2584,6 +2547,10 @@ INTA_MODE:
 	snprintf(vdev->desc[0], VXGE_INTR_STRLEN, "%s:vxge", vdev->ndev->name);
 
 	if (vdev->config.intr_type == INTA) {
+		vxge_hw_device_set_intr_type(vdev->devh,
+			VXGE_HW_INTR_MODE_IRQLINE);
+		vxge_hw_vpath_tti_ci_set(vdev->devh,
+			vdev->vpaths[0].device_id);
 		ret = request_irq((int) vdev->pdev->irq,
 			vxge_isr_napi,
 			IRQF_SHARED, vdev->desc[0], vdev);
@@ -2688,13 +2655,6 @@ vxge_open(struct net_device *dev)
 	 * initialized */
 	netif_carrier_off(dev);
 
-	/* Check for another device already opn with INTA */
-	if ((function_mode == VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION) &&
-		test_bit(__VXGE_STATE_CARD_UP, &driver_config->inta_dev_open)) {
-		ret = -EPERM;
-		goto out0;
-	}
-
 	/* Open VPATHs */
 	status = vxge_open_vpaths(vdev);
 	if (status != VXGE_HW_OK) {
@@ -2983,7 +2943,6 @@ int do_vxge_close(struct net_device *dev
 	vxge_debug_entryexit(VXGE_TRACE,
 		"%s: %s:%d  Exiting...", dev->name, __func__, __LINE__);
 
-	clear_bit(__VXGE_STATE_CARD_UP, &driver_config->inta_dev_open);
 	clear_bit(__VXGE_STATE_RESET_CARD, &vdev->state);
 
 	return 0;
@@ -4397,6 +4356,27 @@ vxge_probe(struct pci_dev *pdev, const s
 	}
 
 	kfree(device_config);
+
+	/*
+	 * INTA is shared in multi-function mode. This is unlike the INTA
+	 * implementation in MR mode, where each VH has its own INTA message.
+	 * - INTA is masked (disabled) as long as at least one function sets
+	 * its TITAN_MASK_ALL_INT.ALARM bit.
+	 * - INTA is unmasked (enabled) when all enabled functions have cleared
+	 * their own TITAN_MASK_ALL_INT.ALARM bit.
+	 * The TITAN_MASK_ALL_INT ALARM & TRAFFIC bits are cleared on power up.
+	 * Though this driver leaves the top level interrupts unmasked while
+	 * leaving the required module interrupt bits masked on exit, there
+	 * could be a rougue driver around that does not follow this procedure
+	 * resulting in a failure to generate interrupts. The following code is
+	 * present to prevent such a failure.
+	 */
+
+	if (ll_config.device_hw_info.function_mode ==
+		VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION)
+		if (vdev->config.intr_type == INTA)
+			vxge_hw_device_unmask_all(hldev);
+
 	vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d  Exiting...",
 		vdev->ndev->name, __func__, __LINE__);
 
diff -urpN patch6/drivers/net/vxge/vxge-main.h patch7/drivers/net/vxge/vxge-main.h
--- patch6/drivers/net/vxge/vxge-main.h	2009-09-04 01:25:50.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-main.h	2009-09-04 02:05:36.000000000 -0700
@@ -112,7 +112,6 @@ enum vxge_mac_addr_state {
 struct vxge_drv_config {
 	int config_dev_cnt;
 	int total_dev_cnt;
-	unsigned long inta_dev_open;
 	int g_no_cpus;
 	unsigned int vpath_per_dev;
 };
diff -urpN patch6/drivers/net/vxge/vxge-traffic.c patch7/drivers/net/vxge/vxge-traffic.c
--- patch6/drivers/net/vxge/vxge-traffic.c	2009-09-04 01:25:50.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-traffic.c	2009-09-04 02:06:25.000000000 -0700
@@ -295,6 +295,8 @@ void vxge_hw_device_intr_enable(struct _
 	u64 val64;
 	u32 val32;
 
+	vxge_hw_device_mask_all(hldev);
+
 	for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
 
 		if (!(hldev->vpaths_deployed & vxge_mBIT(i)))
diff -urpN patch6/drivers/net/vxge/vxge-traffic.h patch7/drivers/net/vxge/vxge-traffic.h
--- patch6/drivers/net/vxge/vxge-traffic.h	2009-09-04 01:25:50.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-traffic.h	2009-09-04 02:07:28.000000000 -0700
@@ -2389,6 +2389,8 @@ vxge_hw_channel_dtr_free(struct __vxge_h
 
 int
 vxge_hw_channel_dtr_count(struct __vxge_hw_channel *channel);
+void
+vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id);
 
 /* ========================== PRIVATE API ================================= */
 


^ permalink raw reply

* [net-next-2.6 PATCH 6/9] vxge: Check if FCS stripping is disabled by the firmware.
From: Sreenivasa Honnur @ 2009-10-05  9:11 UTC (permalink / raw)
  To: davem; +Cc: netdev, support

- Added a function to check if FCS stripping is disabled by the firmware, if
  it is not disabled fail driver load.

- By default FCS stripping is disabled by the firmware. With this assumption
  driver decrements the indicated packet length by 4 bytes(FCS length).

- This patch ensures that FCS stripping is disabled during driver load time.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch5/drivers/net/vxge/vxge-config.c patch6/drivers/net/vxge/vxge-config.c
--- patch5/drivers/net/vxge/vxge-config.c	2009-09-04 01:24:25.000000000 -0700
+++ patch6/drivers/net/vxge/vxge-config.c	2009-09-04 01:33:43.000000000 -0700
@@ -2157,6 +2157,28 @@ exit:
 }
 
 /*
+ * vxge_hw_vpath_strip_fcs_check - Check for FCS strip.
+ */
+enum vxge_hw_status
+vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask)
+{
+	struct vxge_hw_vpmgmt_reg       __iomem *vpmgmt_reg;
+	enum vxge_hw_status status = VXGE_HW_OK;
+	int i = 0, j = 0;
+
+	for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
+		if (!((vpath_mask) & vxge_mBIT(i)))
+			continue;
+		vpmgmt_reg = hldev->vpmgmt_reg[i];
+		for (j = 0; j < VXGE_HW_MAC_MAX_MAC_PORT_ID; j++) {
+			if (readq(&vpmgmt_reg->rxmac_cfg0_port_vpmgmt_clone[j])
+			& VXGE_HW_RXMAC_CFG0_PORT_VPMGMT_CLONE_STRIP_FCS)
+				return VXGE_HW_FAIL;
+		}
+	}
+	return status;
+}
+/*
  * vxge_hw_mgmt_reg_Write - Write Titan register.
  */
 enum vxge_hw_status
diff -urpN patch5/drivers/net/vxge/vxge-config.h patch6/drivers/net/vxge/vxge-config.h
--- patch5/drivers/net/vxge/vxge-config.h	2009-09-04 01:23:26.000000000 -0700
+++ patch6/drivers/net/vxge/vxge-config.h	2009-09-04 01:29:17.000000000 -0700
@@ -2201,6 +2201,8 @@ __vxge_hw_vpath_func_id_get(
 enum vxge_hw_status
 __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
 
+enum vxge_hw_status
+vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
 /**
  * vxge_debug
  * @level: level of debug verbosity.
diff -urpN patch5/drivers/net/vxge/vxge-main.c patch6/drivers/net/vxge/vxge-main.c
--- patch5/drivers/net/vxge/vxge-main.c	2009-09-04 01:23:26.000000000 -0700
+++ patch6/drivers/net/vxge/vxge-main.c	2009-09-04 01:31:12.000000000 -0700
@@ -4244,6 +4244,15 @@ vxge_probe(struct pci_dev *pdev, const s
 			goto _exit3;
 	}
 
+	/* if FCS stripping is not disabled in MAC fail driver load */
+	if (vxge_hw_vpath_strip_fcs_check(hldev, vpath_mask) != VXGE_HW_OK) {
+		vxge_debug_init(VXGE_ERR,
+			"%s: FCS stripping is not disabled in MAC"
+			" failing driver load", VXGE_DRIVER_NAME);
+		ret = -EINVAL;
+		goto _exit4;
+	}
+
 	vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_LL);
 
 	/* set private device info */


^ permalink raw reply

* Re: [PATCH] be2net: Fix a bug in preparation of mcc wrb which was causing flash operation to fail
From: David Miller @ 2009-10-05  9:09 UTC (permalink / raw)
  To: ajitk, ajitkhaparde; +Cc: netdev
In-Reply-To: <20091005090555.GA12287@serverengines.com>

From: Ajit Khaparde <ajitkhaparde@gmail.com>
Date: Mon, 5 Oct 2009 14:36:07 +0530

> This patch fixes a bug that got introduced in commit 76998bc7.
> During preparation of mcc wrb, req was being wrongly overwritten
> and the flash operation was failing.
> This patch is against the net-2.6 tree.
> 
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>

Applied, thanks.

^ permalink raw reply

* [PATCH] be2net: Fix a bug in preparation of mcc wrb which was causing flash operation to fail
From: Ajit Khaparde @ 2009-10-05  9:06 UTC (permalink / raw)
  To: davem, netdev

This patch fixes a bug that got introduced in commit 76998bc7.
During preparation of mcc wrb, req was being wrongly overwritten
and the flash operation was failing.
This patch is against the net-2.6 tree.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
 drivers/net/benet/be_cmds.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 79d35d1..89876ad 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1129,7 +1129,6 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
 	spin_lock_bh(&adapter->mcc_lock);
 
 	wrb = wrb_from_mccq(adapter);
-	req = embedded_payload(wrb);
 	sge = nonembedded_sgl(wrb);
 
 	be_wrb_hdr_prepare(wrb, cmd->size, false, 1);
-- 
1.6.0.4


^ permalink raw reply related

* [PATCH] iproute2 add hoplimit and reordering route options usage and parsing
From: Gilad Ben-Yossef @ 2009-10-05  8:54 UTC (permalink / raw)
  To: netdev; +Cc: ori

From: Yuki Arbel <yuki@comsleep.com>

iproute2 git HEAD (spotted originally on 2.6.26, so it's probably not new) 
does  not parse the hoplimit route option when proccessing parameters, nor 
does it  print hoplimit and reordering options in the usage lines.  
This patch fixes both. 

Tested by setting hoplimit and be retreiving it via "show".

Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com>
[ported to HEAD and fixed a bug with hoplimit lock handling in original]
Signed-off-by: Ori Finkelman <ori@comsleep.com>
Signed-off-by: Yuki Arbel <yuki@comsleep.com>

---

Carved out from original patch by Yuki Arbel and Ori Finkelman from 
Comsleep Ltd. which I'm asssiting in mainlining.

diff --git a/ip/iproute.c b/ip/iproute.c
index bf0f31b..4821a1d 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -73,7 +73,7 @@ static void usage(void)
 	fprintf(stderr, "           [ rtt TIME ] [ rttvar TIME ]\n");
 	fprintf(stderr, "           [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n");
 	fprintf(stderr, "           [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n");
-	fprintf(stderr, "           [ rto_min TIME ]\n");
+	fprintf(stderr, "           [ rto_min TIME ] [ hoplimit NUMBER ] [ reordering NUMBER] \n");
 	fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n");
 	fprintf(stderr, "          unreachable | prohibit | blackhole | nat ]\n");
 	fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n");
@@ -768,6 +768,16 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
 			if (get_unsigned(&mtu, *argv, 0))
 				invarg("\"mtu\" value is invalid\n", *argv);
 			rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu);
+		} else if (strcmp(*argv, "hoplimit") == 0) {
+			unsigned hoplimit;
+			NEXT_ARG();
+			if (strcmp(*argv, "lock") == 0) {
+				mxlock |= (1<<RTAX_HOPLIMIT);
+				NEXT_ARG();
+			}
+			if (get_unsigned(&hoplimit, *argv, 0))
+				invarg("\"hoplimit\" value is invalid\n", *argv);
+			rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplimit);
 #ifdef RTAX_ADVMSS
 		} else if (strcmp(*argv, "advmss") == 0) {
 			unsigned mss;

^ permalink raw reply related

* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: David Miller @ 2009-10-05  8:50 UTC (permalink / raw)
  To: william.allen.simpson; +Cc: netdev
In-Reply-To: <4AC9AD14.2060500@gmail.com>

From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Mon, 05 Oct 2009 04:23:48 -0400

> This will be widely deployed.  Deployment in DNS root servers is
> expected by December.  It will be hammered with 600,000+ queries per
> minute.  Does that impact your design expectations?

Great, so 600,000 times per second we'll take two new atomic
operations with your most recent suggestion...

> Tomorrow, I'll send out a new patch with everything buried in a single
> kref, the various tests will only be a trifle slower....

This one..

The reason we want tcp_sock smaller is to get better performance (less
memory references) and to save memory.  If you're exchanging the space
savings for atomic operations and whatnot, you're defeating half of
the point of making the tcp_sock state smaller.

Make your state take up less space in tcp_sock without making it cost
more in some other form.

And btw, it's not our problem that all of a sudden this is critical
and important for you, and that you don't like how not all aspects of
your implementation were commented upon long ago when the first
implementation was posted.

Your insistence to keep harping on those issues will only irritate me
(and probably others).  So please keep that out of the discussion,
thanks.

^ permalink raw reply

* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: David Miller @ 2009-10-05  8:45 UTC (permalink / raw)
  To: william.allen.simpson; +Cc: netdev
In-Reply-To: <4AC9AA3E.2090001@gmail.com>

From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Mon, 05 Oct 2009 04:11:42 -0400

> Given that size is now a concern, would a single kref pointer with a
> u16 field for flags be acceptable?  I could bury the rest in the
> kref block.
> 
> Would that be acceptable without a config option?

Then we'll eat an atomic operation every connect() or something
like that?

That's bad too.  We're trying desperately to remove as many
atomic operations as possible from the socket paths.

Compress your state, really compress it, don't just externalize
it somewhere else in exchange for a different cost.

^ permalink raw reply

* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: William Allen Simpson @ 2009-10-05  8:23 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20091005.010630.214808506.davem@davemloft.net>

David Miller wrote:
> I'm looking at the patch more closely, and as I learn more
> things about your change, my position changes.
> 
>> Perhaps you would prefer this as a config option after all?
> 
> No, then nobody is going to deploy this thing (meaning it really will
> be useless), or everyone will and everyone will enable it and thus eat
> the space.
> 
> It's bad either way.
> 
> Store the data either somewhere else or in an extremely compact form.
> 
More cross-posting, a good thing for responsiveness....

OK, no config option.

This will be widely deployed.  Deployment in DNS root servers is
expected by December.  It will be hammered with 600,000+ queries per
minute.  Does that impact your design expectations?

Tomorrow, I'll send out a new patch with everything buried in a single
kref, the various tests will only be a trifle slower....


^ permalink raw reply

* Re: [PATCH 1/7] mlx4: Added interrupts test support
From: Yevgeny Petrilin @ 2009-10-05 11:16 UTC (permalink / raw)
  To: Roland Dreier; +Cc: davem, netdev
In-Reply-To: <adaeipmqxmv.fsf@cisco.com>

Roland Dreier wrote:
> This feels like a pretty risky thing to do while the device might be
> handling all sorts of other traffic at the same time.  Are you sure
> there are no races you expose here? 
We did testing on this, during heavy traffic.
A race can happen when there are two processes that execute that test simultaneously,
but the tests always executed from Ethtool context.
I will add additional protection in case somebody tries to execute this test from another context.

> Have you actually seen cases where
> the interrupt test during initialization works but then this test
> catches a problem?  (My experience has been that if any MSI-X interrupts
> work from a device, then they'll all work)
It also checks that all the EQs work properly. During initialization we only check the asynchronous EQ


^ permalink raw reply

* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: William Allen Simpson @ 2009-10-05  8:11 UTC (permalink / raw)
  To: netdev
In-Reply-To: <4AC9A714.7060903@gmail.com>

William Allen Simpson wrote:
> David Miller wrote:
>> struct tcp_sock is already WAY TOO BIG on 64-bit systems, adding 20
>> more bytes to it for some odd-ball feature is not something I'm
>> willing to do, sorry.
>>
> I see we're cross-posting at the same time....  Since in your previous
> review (last year) this issue was not mentioned, is there some other
> data organization that you would suggest?
> 
> http://article.gmane.org/gmane.linux.network/102779
> 
>   "This looks mostly fine to me.  I would even advocate not using a config
>    option for this."
> 
As a quick followup, I wish this had been raised in my previous posting,
where I'd given the headers, for exactly this kind of feedback. :-)

Given that size is now a concern, would a single kref pointer with a u16
field for flags be acceptable?  I could bury the rest in the kref block.

Would that be acceptable without a config option?

^ permalink raw reply

* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: David Miller @ 2009-10-05  8:06 UTC (permalink / raw)
  To: william.allen.simpson; +Cc: netdev
In-Reply-To: <4AC9A714.7060903@gmail.com>

From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Mon, 05 Oct 2009 03:58:12 -0400

> I see we're cross-posting at the same time....  Since in your previous
> review (last year) this issue was not mentioned, is there some other
> data organization that you would suggest?
> 
> http://article.gmane.org/gmane.linux.network/102779
> 
>   "This looks mostly fine to me.  I would even advocate not using a
>   config
>    option for this."

I'm looking at the patch more closely, and as I learn more
things about your change, my position changes.

> Perhaps you would prefer this as a config option after all?

No, then nobody is going to deploy this thing (meaning it really will
be useless), or everyone will and everyone will enable it and thus eat
the space.

It's bad either way.

Store the data either somewhere else or in an extremely compact form.

^ permalink raw reply

* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: William Allen Simpson @ 2009-10-05  7:58 UTC (permalink / raw)
  Cc: netdev
In-Reply-To: <20091005.002719.146534039.davem@davemloft.net>

David Miller wrote:
> From: William Allen Simpson <william.allen.simpson@gmail.com>
> Date: Sat, 03 Oct 2009 14:33:41 -0400
> 
>> @@ -406,6 +454,32 @@ struct tcp_sock {
>  ...
>> +	struct tcp_s_data_payload	*s_data_payload;
>  ...
>> +	struct tcp_cookie_pair	  	*cookie_pair;
>  ...
>> +	u16				s_data_desired;	/* bytes */
>  ...
>> +	u8				cookie_desired;	/* bytes */
>> +	u8				s_data_in:1,
>> +					s_data_out:1,
>> +					cookie_in_always:1,
>> +					cookie_out_never:1;
> 
> struct tcp_sock is already WAY TOO BIG on 64-bit systems, adding 20
> more bytes to it for some odd-ball feature is not something I'm
> willing to do, sorry.
> 
I see we're cross-posting at the same time....  Since in your previous
review (last year) this issue was not mentioned, is there some other
data organization that you would suggest?

http://article.gmane.org/gmane.linux.network/102779

   "This looks mostly fine to me.  I would even advocate not using a config
    option for this."

Perhaps you would prefer this as a config option after all?

As for "odd-ball feature", of course this is the initial pass on a much
larger project....


^ permalink raw reply

* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: William Allen Simpson @ 2009-10-05  7:45 UTC (permalink / raw)
  To: netdev
In-Reply-To: <4AC79905.1030904@gmail.com>

As I'm new to Linux kernel development, this was based entirely on code
previously reviewed (by Miller), as that seemed a good path for me to learn
proper coding and style.

Now that I'm trying to grok Linux locking functions for the next patch, I've
noticed that setsockopt code uses lock_sock(), but getsockopt doesn't.  In a
preemptive kernel, or with SMP, isn't there a possibility that these socket
values could be modified or destroyed at the same time?

I'm especially concerned here, as there are kref blocks, and they could be
left pointing into the weeds?

^ 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