Selaa lähdekoodia

qcacld-3.0: Support multiple RX CEs for NAPI/LRO/FastPath

Make changes so that LRO and FastPath can check whether a
given CE is a datapath RX CE. This is done through new
flags in CE_state which indicate whether or not a given
CE is a htt_[tr]x CE.
Also add support to enable multi-queue NAPI.
Note that the paths are not yet parallel-execution protected,
but this should be OK as all NAPI instances are processing
the same interrupt now and as such as serialized.

Acked-by: Orhan K AKYILDIZ<[email protected]>

Change-Id: I57125b3e1fbad0345b6e1f4ed25e71babaf4f520
CRs-Fixed: 982728
Houston Hoffman 9 vuotta sitten
vanhempi
sitoutus
c1f962efb7
3 muutettua tiedostoa jossa 21 lisäystä ja 42 poistoa
  1. 10 15
      core/hdd/src/wlan_hdd_driver_ops.c
  2. 10 27
      core/hdd/src/wlan_hdd_napi.c
  3. 1 0
      target/inc/htc_services.h

+ 10 - 15
core/hdd/src/wlan_hdd_driver_ops.c

@@ -245,17 +245,6 @@ static int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid,
 		goto err_hif_close;
 	}
 
-	ret = hdd_napi_create();
-	if (hdd_napi_enabled(HDD_NAPI_ANY)) {
-		hdd_info("hdd_napi_create returned: %d", ret);
-		if (ret <= 0) {
-			hdd_err("NAPI creation error, rc: 0x%x, reinit = %d",
-				ret, reinit);
-			ret = -EFAULT;
-			goto err_hif_close;
-		}
-	}
-
 	status = hif_enable(hif_ctx, dev, bdev, bid, bus_type,
 			    (reinit == true) ?  HIF_ENABLE_TYPE_REINIT :
 			    HIF_ENABLE_TYPE_PROBE);
@@ -263,14 +252,20 @@ static int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid,
 		hdd_err("hif_enable error = %d, reinit = %d",
 			status, reinit);
 		ret = qdf_status_to_os_return(status);
-		goto err_napi_destroy;
+		goto err_hif_close;
+	} else {
+		ret = hdd_napi_create();
+		hdd_info("hdd_napi_create returned: %d", ret);
+		if (ret <= 0) {
+			hdd_err("NAPI creation error, rc: 0x%x, reinit = %d",
+				ret, reinit);
+			ret = -EFAULT;
+			goto err_hif_close;
+		}
 	}
 
 	return 0;
 
-err_napi_destroy:
-	hdd_napi_destroy(true);
-
 err_hif_close:
 	hdd_deinit_cds_hif_context();
 	hif_close(hif_ctx);

+ 10 - 27
core/hdd/src/wlan_hdd_napi.c

@@ -103,9 +103,7 @@ static uint32_t hdd_napi_get_map(void)
  */
 int hdd_napi_create(void)
 {
-	struct hif_opaque_softc *hif_ctx;
-	uint8_t ul, dl;
-	int     ul_polled, dl_polled;
+	struct  hif_opaque_softc *hif_ctx;
 	int     rc = 0;
 
 	NAPI_DEBUG("-->");
@@ -115,30 +113,15 @@ int hdd_napi_create(void)
 		QDF_ASSERT(NULL != hif_ctx);
 		rc = -EFAULT;
 	} else {
-		/*
-		 * Note: hif_service_to_pipe returns one pipe id per service.
-		 * For multi-queue NAPI for Adrastea, we will use multiple
-		 * services/calls.
-		 * For Rome, there is only one service, hence a single call
-		 */
-		if (QDF_STATUS_SUCCESS !=
-		    hif_map_service_to_pipe(hif_ctx, HTT_DATA_MSG_SVC,
-					    &ul, &dl, &ul_polled, &dl_polled)) {
-			hdd_err("cannot map service to pipe");
-			rc = -EINVAL;
-		} else {
-			rc = hif_napi_create(hif_ctx, dl, hdd_napi_poll,
-					     QCA_NAPI_BUDGET,
-					     QCA_NAPI_DEF_SCALE);
-			if (rc < 0)
-				hdd_err("ERR(%d) creating NAPI on pipe %d",
-					rc, dl);
-			else {
-				hdd_info("napi instance %d created on pipe %d",
-					 rc, dl);
-				/* rc = (0x01 << rc); -- phase 2 */
-			}
-		}
+		rc = hif_napi_create(hif_ctx, hdd_napi_poll,
+				     QCA_NAPI_BUDGET,
+				     QCA_NAPI_DEF_SCALE);
+		if (rc < 0)
+			hdd_err("ERR(%d) creating NAPI instances",
+				rc);
+		else
+			hdd_info("napi instances were created. Map=0x%x", rc);
+
 	}
 	NAPI_DEBUG("<-- [rc=%d]", rc);
 

+ 1 - 0
target/inc/htc_services.h

@@ -58,6 +58,7 @@ typedef enum {
 
 #define HTT_DATA_MSG_SVC  MAKE_SERVICE_ID(HTT_SERVICE_GROUP,0)
 #define HTT_DATA2_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,1)
+#define HTT_DATA3_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP, 2)
 
 /* raw stream service (i.e. flash, tcmd, calibration apps) */
 #define HTC_RAW_STREAMS_SVC MAKE_SERVICE_ID(HTC_TEST_GROUP,0)