Merge "[qca-nss-qdisc] Remove default_nq field in nss_qdisc structure"
diff --git a/nss_qdisc/nss_bf.c b/nss_qdisc/nss_bf.c
index 7aecb95..2ba081f 100644
--- a/nss_qdisc/nss_bf.c
+++ b/nss_qdisc/nss_bf.c
@@ -129,7 +129,7 @@
 		}
 
 		/*
-		 * Set qos_tag of parent to which the class needs to e attached to.
+		 * Set qos_tag of parent to which the class needs to be attached to.
 		 */
 		nim_attach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = q->nq.qos_tag;
 
diff --git a/nss_qdisc/nss_qdisc.c b/nss_qdisc/nss_qdisc.c
index b8ece3b..5226c56 100644
--- a/nss_qdisc/nss_qdisc.c
+++ b/nss_qdisc/nss_qdisc.c
@@ -1119,17 +1119,6 @@
 	int32_t state, rc;
 	int msg_type;
 	struct nss_if_msg nim;
-	struct nss_qdisc *nq_root;
-
-	/*
-	 * Get root nss qdisc
-	 */
-	if (nq->is_root) {
-		nq_root = nq;
-	} else {
-		struct Qdisc *root = qdisc_root(nq->qdisc);
-		nq_root = qdisc_priv(root);
-	}
 
 	nss_qdisc_info("%s: Setting qdisc %p (type %d) as default\n", __func__,
 			nq->qdisc, nq->type);
@@ -1166,8 +1155,7 @@
 
 	/*
 	 * Wait until cleanup operation is complete at which point the state
-	 * shall become idle. NOTE: This relies on the NSS driver to be able
-	 * to operate asynchronously which means kernel preemption is required.
+	 * shall become non-idle.
 	 */
 	while (NSS_QDISC_STATE_IDLE == (state = atomic_read(&nq->state))) {
 		yield();
@@ -1180,13 +1168,6 @@
 		return -1;
 	}
 
-	/*
-	 * Save the default nss qdisc pointer
-	 */
-	spin_lock_bh(&nq_root->lock);
-	nq_root->default_nq = nq;
-	spin_unlock_bh(&nq_root->lock);
-
 	nss_qdisc_info("%s: Qdisc %p (type %d): shaper node default complete\n",
 			__func__, nq->qdisc, nq->type);
 	return 0;
@@ -1259,8 +1240,7 @@
 
 	/*
 	 * Wait until cleanup operation is complete at which point the state
-	 * shall become idle. NOTE: This relies on the NSS driver to be able
-	 * to operate asynchronously which means kernel preemption is required.
+	 * shall become non-idle.
 	 */
 	while (NSS_QDISC_STATE_IDLE == (state = atomic_read(&nq->state))) {
 		yield();
@@ -1347,9 +1327,7 @@
 	}
 
 	/*
-	 * Wait until cleanup operation is complete at which point the state shall become idle.
-	 * NOTE: This relies on the NSS driver to be able to operate asynchronously which means
-	 * kernel preemption is required.
+	 * Wait until cleanup operation is complete at which point the state shall become non-idle.
 	 */
 	while (NSS_QDISC_STATE_IDLE == (state = atomic_read(&nq->state))) {
 		yield();
@@ -1436,8 +1414,7 @@
 
 	/*
 	 * Wait until cleanup operation is complete at which point the state
-	 * shall become idle. NOTE: This relies on the NSS driver to be able
-	 * to operate asynchronously which means kernel preemption is required.
+	 * shall become non-idle.
 	 */
 	while (NSS_QDISC_STATE_IDLE == (state = atomic_read(&nq->state))) {
 		yield();
@@ -1503,8 +1480,7 @@
 
 	/*
 	 * Wait until cleanup operation is complete at which point the state
-	 * shall become idle. NOTE: This relies on the NSS driver to be able
-	 * to operate asynchronously which means kernel preemption is required.
+	 * shall become idle.
 	 */
 	while (NSS_QDISC_STATE_IDLE != (state = atomic_read(&nq->state))) {
 		yield();
@@ -1698,8 +1674,6 @@
 
 		/*
 		 * Wait until init operation is complete.
-		 * NOTE: This relies on the NSS driver to be able to operate
-		 * asynchronously which means kernel preemption is required.
 		 */
 		while (NSS_QDISC_STATE_IDLE == (state = atomic_read(&nq->state))) {
 			yield();
@@ -1846,8 +1820,6 @@
 
 	/*
 	 * Wait until init operation is complete.
-	 * NOTE: This relies on the NSS driver to be able to operate asynchronously which means
-	 * kernel preemption is required.
 	 */
 	nss_qdisc_info("%s: Qdisc %p (type %d): Waiting on response from NSS for "
 			"shaper assign message\n", __func__, nq->qdisc, nq->type);
@@ -1949,21 +1921,6 @@
 	}
 
 	/*
-	 * Get the right stats pointers based on whether it is a class
-	 * or a qdisc.
-	 */
-	if (nq->is_class) {
-		bstats = &nq->bstats;
-		qstats = &nq->qstats;
-		refcnt = &nq->refcnt;
-	} else {
-		bstats = &qdisc->bstats;
-		qstats = &qdisc->qstats;
-		refcnt = &qdisc->refcnt;
-		qdisc->q.qlen = nq->basic_stats_latest.qlen_packets;
-	}
-
-	/*
 	 * Update qdisc->bstats
 	 */
 	spin_lock_bh(&nq->lock);
diff --git a/nss_qdisc/nss_qdisc.h b/nss_qdisc/nss_qdisc.h
index 6ce9f25..b041ef3 100644
--- a/nss_qdisc/nss_qdisc.h
+++ b/nss_qdisc/nss_qdisc.h
@@ -94,7 +94,6 @@
 struct nss_qdisc {
 	struct Qdisc *qdisc;			/* Handy pointer back to containing qdisc */
 	struct nss_qdisc *parent;		/* Pointer to parent nss qdisc */
-	struct nss_qdisc *default_nq;		/* Default enqueue node */
 	void *nss_shaping_ctx;			/* NSS context for general operations */
 	int32_t nss_interface_number;		/* NSS Interface number we are shaping on */
 	nss_shaper_node_type_t type;		/* Type of shaper node */