netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: leitao@linux.vnet.ibm.com, michael@ellerman.id.au,
	jesse@kernel.org, bhutchings@solarflare.com
Cc: netdev@vger.kernel.org
Subject: [PATCH 04/15] ehea: Remove num_tx_qps module option
Date: Thu, 12 May 2011 10:52:17 +1000	[thread overview]
Message-ID: <20110512005622.862264994@samba.org> (raw)
In-Reply-To: 20110512005213.897432612@samba.org

[-- Attachment #1: ehea_5.patch --]
[-- Type: text/plain, Size: 7457 bytes --]

The num_tx_qps module option allows a user to configure a different
number of tx and rx queues. Now the networking stack is multiqueue
aware it makes little sense just to enable the tx queues and not the
rx queues so remove the option.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-net/drivers/net/ehea/ehea.h
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea.h	2011-05-12 07:47:51.960153456 +1000
+++ linux-net/drivers/net/ehea/ehea.h	2011-05-12 07:47:53.490177714 +1000
@@ -58,7 +58,6 @@
 #define EHEA_MIN_ENTRIES_QP  127
 
 #define EHEA_SMALL_QUEUES
-#define EHEA_NUM_TX_QP 1
 #define EHEA_LRO_MAX_AGGR 64
 
 #ifdef EHEA_SMALL_QUEUES
@@ -460,8 +459,6 @@ struct ehea_port {
 	char int_aff_name[EHEA_IRQ_NAME_SIZE];
 	int allmulti;			 /* Indicates IFF_ALLMULTI state */
 	int promisc;		 	 /* Indicates IFF_PROMISC state */
-	int num_tx_qps;
-	int num_add_tx_qps;
 	int num_mcs;
 	int resets;
 	unsigned long flags;
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c	2011-05-12 07:47:51.960153456 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c	2011-05-12 07:47:53.490177714 +1000
@@ -63,7 +63,6 @@ static int sq_entries = EHEA_DEF_ENTRIES
 static int use_mcs = 1;
 static int use_lro;
 static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
-static int num_tx_qps = EHEA_NUM_TX_QP;
 static int prop_carrier_state;
 
 module_param(msg_level, int, 0);
@@ -75,9 +74,7 @@ module_param(prop_carrier_state, int, 0)
 module_param(use_mcs, int, 0);
 module_param(use_lro, int, 0);
 module_param(lro_max_aggr, int, 0);
-module_param(num_tx_qps, int, 0);
 
-MODULE_PARM_DESC(num_tx_qps, "Number of TX-QPS");
 MODULE_PARM_DESC(msg_level, "msg_level");
 MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical "
 		 "port to stack. 1:yes, 0:no.  Default = 0 ");
@@ -172,7 +169,7 @@ static void ehea_update_firmware_handles
 				continue;
 
 			num_ports++;
-			num_portres += port->num_def_qps + port->num_add_tx_qps;
+			num_portres += port->num_def_qps;
 		}
 	}
 
@@ -198,9 +195,7 @@ static void ehea_update_firmware_handles
 			    (num_ports == 0))
 				continue;
 
-			for (l = 0;
-			     l < port->num_def_qps + port->num_add_tx_qps;
-			     l++) {
+			for (l = 0; l < port->num_def_qps; l++) {
 				struct ehea_port_res *pr = &port->port_res[l];
 
 				arr[i].adh = adapter->handle;
@@ -360,7 +355,7 @@ static struct net_device_stats *ehea_get
 	}
 
 	tx_packets = 0;
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+	for (i = 0; i < port->num_def_qps; i++) {
 		tx_packets += port->port_res[i].tx_packets;
 		tx_bytes   += port->port_res[i].tx_bytes;
 	}
@@ -811,7 +806,7 @@ static void reset_sq_restart_flag(struct
 {
 	int i;
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+	for (i = 0; i < port->num_def_qps; i++) {
 		struct ehea_port_res *pr = &port->port_res[i];
 		pr->sq_restart_flag = 0;
 	}
@@ -824,7 +819,7 @@ static void check_sqs(struct ehea_port *
 	int swqe_index;
 	int i, k;
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+	for (i = 0; i < port->num_def_qps; i++) {
 		struct ehea_port_res *pr = &port->port_res[i];
 		int ret;
 		k = 0;
@@ -1113,13 +1108,6 @@ int ehea_sense_port_attr(struct ehea_por
 		goto out_free;
 	}
 
-	port->num_tx_qps = num_tx_qps;
-
-	if (port->num_def_qps >= port->num_tx_qps)
-		port->num_add_tx_qps = 0;
-	else
-		port->num_add_tx_qps = port->num_tx_qps - port->num_def_qps;
-
 	ret = 0;
 out_free:
 	if (ret || netif_msg_probe(port))
@@ -1360,7 +1348,7 @@ static int ehea_reg_interrupts(struct ne
 		   port->qp_eq->attr.ist1);
 
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+	for (i = 0; i < port->num_def_qps; i++) {
 		pr = &port->port_res[i];
 		snprintf(pr->int_send_name, EHEA_IRQ_NAME_SIZE - 1,
 			 "%s-queue%d", dev->name, i);
@@ -1403,7 +1391,7 @@ static void ehea_free_interrupts(struct
 
 	/* send */
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+	for (i = 0; i < port->num_def_qps; i++) {
 		pr = &port->port_res[i];
 		ibmebus_free_irq(pr->eq->attr.ist1, pr);
 		netif_info(port, intr, dev,
@@ -2472,8 +2460,7 @@ out:
 	return ret;
 }
 
-static int ehea_port_res_setup(struct ehea_port *port, int def_qps,
-			       int add_tx_qps)
+static int ehea_port_res_setup(struct ehea_port *port, int def_qps)
 {
 	int ret, i;
 	struct port_res_cfg pr_cfg, pr_cfg_small_rx;
@@ -2506,7 +2493,7 @@ static int ehea_port_res_setup(struct eh
 		if (ret)
 			goto out_clean_pr;
 	}
-	for (i = def_qps; i < def_qps + add_tx_qps; i++) {
+	for (i = def_qps; i < def_qps; i++) {
 		ret = ehea_init_port_res(port, &port->port_res[i],
 					 &pr_cfg_small_rx, i);
 		if (ret)
@@ -2529,7 +2516,7 @@ static int ehea_clean_all_portres(struct
 	int ret = 0;
 	int i;
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+	for (i = 0; i < port->num_def_qps; i++)
 		ret |= ehea_clean_portres(port, &port->port_res[i]);
 
 	ret |= ehea_destroy_eq(port->qp_eq);
@@ -2561,8 +2548,7 @@ static int ehea_up(struct net_device *de
 	if (port->state == EHEA_PORT_UP)
 		return 0;
 
-	ret = ehea_port_res_setup(port, port->num_def_qps,
-				  port->num_add_tx_qps);
+	ret = ehea_port_res_setup(port, port->num_def_qps);
 	if (ret) {
 		netdev_err(dev, "port_res_failed\n");
 		goto out;
@@ -2581,7 +2567,7 @@ static int ehea_up(struct net_device *de
 		goto out_clean_pr;
 	}
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+	for (i = 0; i < port->num_def_qps; i++) {
 		ret = ehea_activate_qp(port->adapter, port->port_res[i].qp);
 		if (ret) {
 			netdev_err(dev, "activate_qp failed\n");
@@ -2627,7 +2613,7 @@ static void port_napi_disable(struct ehe
 {
 	int i;
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+	for (i = 0; i < port->num_def_qps; i++)
 		napi_disable(&port->port_res[i].napi);
 }
 
@@ -2635,7 +2621,7 @@ static void port_napi_enable(struct ehea
 {
 	int i;
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+	for (i = 0; i < port->num_def_qps; i++)
 		napi_enable(&port->port_res[i].napi);
 }
 
@@ -2721,7 +2707,7 @@ static void ehea_flush_sq(struct ehea_po
 {
 	int i;
 
-	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+	for (i = 0; i < port->num_def_qps; i++) {
 		struct ehea_port_res *pr = &port->port_res[i];
 		int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count;
 		int ret;
@@ -2755,7 +2741,7 @@ int ehea_stop_qps(struct net_device *dev
 		goto out;
 	}
 
-	for (i = 0; i < (port->num_def_qps + port->num_add_tx_qps); i++) {
+	for (i = 0; i < (port->num_def_qps); i++) {
 		struct ehea_port_res *pr =  &port->port_res[i];
 		struct ehea_qp *qp = pr->qp;
 
@@ -2857,7 +2843,7 @@ int ehea_restart_qps(struct net_device *
 		goto out;
 	}
 
-	for (i = 0; i < (port->num_def_qps + port->num_add_tx_qps); i++) {
+	for (i = 0; i < (port->num_def_qps); i++) {
 		struct ehea_port_res *pr =  &port->port_res[i];
 		struct ehea_qp *qp = pr->qp;
 
@@ -3217,8 +3203,7 @@ struct ehea_port *ehea_setup_single_port
 		goto out_free_mc_list;
 
 	netif_set_real_num_rx_queues(dev, port->num_def_qps);
-	netif_set_real_num_tx_queues(dev, port->num_def_qps +
-				     port->num_add_tx_qps);
+	netif_set_real_num_tx_queues(dev, port->num_def_qps);
 
 	port_dev = ehea_register_port(port, dn);
 	if (!port_dev)



  parent reply	other threads:[~2011-05-12  1:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12  0:52 [PATCH 00/15] ehea updates v2 Anton Blanchard
2011-05-12  0:52 ` [PATCH 01/15] ehea: Remove NETIF_F_LLTX Anton Blanchard
2011-05-12  0:52 ` [PATCH 02/15] ehea: Update multiqueue support Anton Blanchard
2011-05-12  2:31   ` Joe Perches
2011-05-12  2:57   ` Ben Hutchings
2011-05-12  0:52 ` [PATCH 03/15] ehea: Remove force_irq logic in napi poll routine Anton Blanchard
2011-05-12  2:31   ` Joe Perches
2011-05-12  3:06     ` David Miller
2011-05-12  2:47   ` Ben Hutchings
2011-05-24  3:32   ` Benjamin Herrenschmidt
2011-05-12  0:52 ` Anton Blanchard [this message]
2011-05-12  0:52 ` [PATCH 05/15] ehea: Dont check NETIF_F_TSO in TX path Anton Blanchard
2011-05-12  0:52 ` [PATCH 06/15] ehea: Add vlan_features Anton Blanchard
2011-05-12  0:52 ` [PATCH 07/15] ehea: Allocate large enough skbs to avoid partial cacheline DMA writes Anton Blanchard
2011-05-12  2:52   ` Ben Hutchings
2011-05-12  0:52 ` [PATCH 08/15] ehea: Simplify ehea_xmit2 and ehea_xmit3 Anton Blanchard
2011-05-12  0:52 ` [PATCH 09/15] ehea: Merge swqe2 TSO and non TSO paths Anton Blanchard
2011-05-12  0:52 ` [PATCH 10/15] ehea: Simplify type 3 transmit routine Anton Blanchard
2011-05-12  0:52 ` [PATCH 11/15] ehea: Remove some unused definitions Anton Blanchard
2011-05-12  0:52 ` [PATCH 12/15] ehea: Add 64bit statistics Anton Blanchard
2011-05-12  0:52 ` [PATCH 13/15] ehea: Remove LRO support Anton Blanchard
2011-05-12  0:52 ` [PATCH 14/15] ehea: Add GRO support Anton Blanchard
2011-05-12  6:03   ` Michał Mirosław
2011-05-12  0:52 ` [PATCH 15/15] ehea: Remove unused tcp_end field in send WQ Anton Blanchard
2011-05-12  2:31   ` Joe Perches
2011-05-12  3:06     ` David Miller
2011-05-12  3:12       ` Joe Perches
2011-05-31  1:16         ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2011-10-14 15:30 EHEA updates Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 04/15] ehea: Remove num_tx_qps module option Thadeu Lima de Souza Cascardo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110512005622.862264994@samba.org \
    --to=anton@samba.org \
    --cc=bhutchings@solarflare.com \
    --cc=jesse@kernel.org \
    --cc=leitao@linux.vnet.ibm.com \
    --cc=michael@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).