Skip to contentSkip to conversation

ehea: NAPI multi queue TX/RX path for SMP

PATCH In review Jan-Bernd Themann 2 participants 3 messages Feb 27, 2007 – Feb 28, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ehea: NAPI multi queue TX/RX path for SMP

This patch provides a functionality that allows parallel RX processing on multiple RX queues by using dummy netdevices.

---

drivers/net/ehea/ehea.h +5 -6
diff -Nurp -X dontdiff linux-2.6.21-rc1/drivers/net/ehea/ehea.h patched_kernel/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME	"ehea"
-#define DRV_VERSION	"EHEA_0048"
+#define DRV_VERSION	"EHEA_0051"
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
 	| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
@@ -78,8 +78,6 @@
 #define EHEA_RQ2_PKT_SIZE       1522
 #define EHEA_L_PKT_SIZE         256	/* low latency */
 
-#define EHEA_POLL_MAX_RWQE      1000
-
 /* Send completion signaling */
 #define EHEA_SIG_IV_LONG           1
 
@@ -357,8 +355,8 @@ struct ehea_port_res {
 	struct ehea_qp *qp;
 	struct ehea_cq *send_cq;
 	struct ehea_cq *recv_cq;
-	struct ehea_eq *send_eq;
-	struct ehea_eq *recv_eq;
+	struct ehea_eq *eq;
+	struct net_device *d_netdev;
 	spinlock_t send_lock;
 	struct ehea_q_skb_arr rq1_skba;
 	struct ehea_q_skb_arr rq2_skba;
@@ -372,7 +370,6 @@ struct ehea_port_res {
 	int swqe_count;
 	u32 swqe_id_counter;
 	u64 tx_packets;
-	struct tasklet_struct send_comp_task;
 	spinlock_t recv_lock;
 	struct port_state p_state;
 	u64 rx_packets;
@@ -416,7 +413,9 @@ 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;
 	u64 mac_addr;
 	u32 logical_port_id;
drivers/net/ehea/ehea_main.c +156 -123

540 lines not on this page · raw message

drivers/net/ehea/ehea_qmr.h +6 -1
diff -Nurp -X dontdiff linux-2.6.21-rc1/drivers/net/ehea/ehea_qmr.h patched_kernel/drivers/net/ehea/ehea_qmr.h
@@ -320,6 +320,11 @@ static inline struct ehea_cqe *ehea_poll
 	return hw_qeit_get_valid(queue);
 }
 
+static inline void ehea_inc_cq(struct ehea_cq *cq)
+{
+	hw_qeit_inc(&cq->hw_queue);
+}
+
 static inline void ehea_inc_rq1(struct ehea_qp *qp)
 {
 	hw_qeit_inc(&qp->hw_rqueue1);
@@ -327,7 +332,7 @@ static inline void ehea_inc_rq1(struct e
 
 static inline struct ehea_cqe *ehea_poll_cq(struct ehea_cq *my_cq)
 {
-	return hw_qeit_get_inc_valid(&my_cq->hw_queue);
+	return hw_qeit_get_valid(&my_cq->hw_queue);
 }
 
 #define EHEA_CQ_REGISTER_ORIG 0
#1 lore raw

drivers/net/ehea/ehea_main.c static void ehea_xmit3(struct sk_buff *s · line 1805

Quoted 9 lines · Jan-Bernd Themann

This patch provides a functionality that allows parallel RX processing on multiple RX queues by using dummy netdevices.

drivers/net/ehea/ehea_main.c +5 -0
+static inline int ehea_hash_skb(struct sk_buff *skb, int num_qps)
+{
+	u32 tmp;
+	if ((skb->nh.iph->protocol == IPPROTO_TCP)
+	    && skb->protocol == ETH_P_IP) {

skb->protocol has network byte order. The ETH_P_IP test should also logically come before checking the IP protocol.

drivers/net/ehea/ehea_main.c static void ehea_xmit3(struct sk_buff *s · line 1806

Quoted 1 line
drivers/net/ehea/ehea_main.c +1 -0
+		tmp = (skb->h.th->source + (skb->h.th->dest << 16)) % 31;

Only locally generated packets have a valid h.th pointer.

Quoted 19 lines
drivers/net/ehea/ehea_main.c +11 -1
+		tmp += skb->nh.iph->daddr % 31;
+		return tmp % num_qps;
+	}
+	else
+		return 0;
+}
+
 static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct ehea_port *port = netdev_priv(dev);
@@ -1796,9 +1818,18 @@ static int ehea_start_xmit(struct sk_buf
 	unsigned long flags;
 	u32 lkey;
 	int swqe_index;
-	struct ehea_port_res *pr = &port->port_res[0];
+	struct ehea_port_res *pr;
+
+	pr = &port->port_res[ehea_hash_skb(skb, port->num_tx_qps)];
+
#2 lore raw

Hi,

Quoted 10 lines

drivers/net/ehea/ehea_main.c static void ehea_xmit3(struct sk_buff *s · line 1805

Quoted 6 lines
drivers/net/ehea/ehea_main.c +5 -0
+static inline int ehea_hash_skb(struct sk_buff *skb, int num_qps)
+{
+	u32 tmp;
+	if ((skb->nh.iph->protocol == IPPROTO_TCP)
+	    && skb->protocol == ETH_P_IP) {

skb->protocol has network byte order. The ETH_P_IP test should also logically come before checking the IP protocol.

fixed.

Quoted 4 lines

drivers/net/ehea/ehea_main.c static void ehea_xmit3(struct sk_buff *s · line 1806

Quoted 1 line
drivers/net/ehea/ehea_main.c +1 -0
+		tmp = (skb->h.th->source + (skb->h.th->dest << 16)) % 31;

Only locally generated packets have a valid h.th pointer.

good point. I'll fix that.

I'll send a new patch set later today

Thanks,
Jan-Bernd