Skip to contentSkip to conversation

cxgb3 - napi update

PATCH In review Divy Le Ray 2 participants 2 messages Sep 9, 2007 – Sep 12, 2007

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

PATCH 1/1 cxgb3 - napi update

From: Divy Le Ray <[email protected]>

Embed napi_struct directly into sge_qset.
Use napi_schedule/napi_complete.

---

 drivers/net/cxgb3/adapter.h    |   20 +++-------
 drivers/net/cxgb3/cxgb3_main.c |   57 ++++++++++--------------------
 drivers/net/cxgb3/sge.c        |   77 +++++++++++++++-------------------------
 3 files changed, 55 insertions(+), 99 deletions(-)
drivers/net/cxgb3/adapter.h +6 -14
index e723e7b..0442617 100644
@@ -49,11 +49,13 @@
 typedef irqreturn_t(*intr_handler_t) (int, void *);
 
 struct vlan_group;
-
 struct adapter;
+struct sge_qset;
+
 struct port_info {
 	struct adapter *adapter;
 	struct vlan_group *vlan_grp;
+	struct sge_qset *qs;
 	const struct port_type_info *port_type;
 	u8 port_id;
 	u8 rx_csum_offload;
@@ -172,12 +174,12 @@ enum {				/* per port SGE statistics */
 	SGE_PSTAT_MAX		/* must be last */
 };
 
-struct adapter_napi;
 struct sge_qset {		/* an SGE queue set */
+	struct adapter *adap;
+	struct napi_struct napi;
 	struct sge_rspq rspq;
 	struct sge_fl fl[SGE_RXQ_PER_SET];
 	struct sge_txq txq[SGE_TXQ_PER_SET];
-	struct adapter_napi *anapi;
 	struct net_device *netdev;
 	unsigned long txq_stopped;	/* which Tx queues are stopped */
 	struct timer_list tx_reclaim_timer;	/* reclaims TX buffers */
@@ -189,13 +191,6 @@ struct sge {
 	spinlock_t reg_lock;	/* guards non-atomic SGE registers (eg context) */
 };
 
-struct adapter_napi {
-	struct napi_struct napi;
-	struct adapter *adapter;
-	int port;
-	int qset;
-};
-
 struct adapter {
 	struct t3cdev tdev;
 	struct list_head adapter_list;
@@ -230,8 +225,6 @@ struct adapter {
 	struct delayed_work adap_check_task;
 	struct work_struct ext_intr_handler_task;
 
-	struct adapter_napi napi[SGE_QSETS];
-
 	struct dentry *debugfs_root;
 
 	struct mutex mdio_lock;
@@ -283,8 +276,7 @@ int t3_mgmt_tx(struct adapter *adap, struct sk_buff *skb);
 void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p);
 int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
 		      int irq_vec_idx, const struct qset_params *p,
-		      int ntxq, struct adapter_napi *anapi,
-		      struct net_device *dev);
+		      int ntxq, struct net_device *dev);
 int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx,
 		unsigned char *data);
 irqreturn_t t3_sge_intr_msix(int irq, void *cookie);
drivers/net/cxgb3/cxgb3_main.c +20 -37

123 lines not on this page · raw message

drivers/net/cxgb3/sge.c +29 -48

198 lines not on this page · raw message