From 35bbeb6cf0ec2547dc47fc554a901ed7adbdeb79 Mon Sep 17 00:00:00 2001 From: Orhan K AKYILDIZ Date: Mon, 11 Dec 2017 11:46:15 -0800 Subject: qcacmn: Dont initialize gsonapi to napi In monkey tests we have observed that gsonapi and NAPI instances are same. During the creation of rx NAPI instances, the GSONAPI corresponding to them are initialized to rx napi, and soon after the right value is overwritten when the flush callbacks are registered. However, durign this window, the same NAPI struct is used by two different objects and therefore collisions happen. Init the gsonapi with NULL until the real value is set later during initialization. Change-Id: Iaff3adf193a3eeb16603ce5e6d0e93ea6f456e52 CRs-Fixed: 2154636 --- hif/src/hif_napi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hif/src/hif_napi.c b/hif/src/hif_napi.c index 4f1d503081ab..a854172c0b36 100644 --- a/hif/src/hif_napi.c +++ b/hif/src/hif_napi.c @@ -185,7 +185,7 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx, NAPI_DEBUG("adding napi=%pK to netdev=%pK (poll=%pK, bdgt=%d)", &(napii->napi), &(napii->netdev), poll, budget); netif_napi_add(&(napii->netdev), &(napii->napi), poll, budget); - napii->offld_ctx = &(napii->napi); + napii->offld_ctx = NULL; NAPI_DEBUG("after napi_add"); NAPI_DEBUG("napi=0x%pK, netdev=0x%pK", @@ -884,9 +884,10 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx, normalized++; bucket = normalized / (QCA_NAPI_BUDGET / QCA_NAPI_NUM_BUCKETS); if (bucket >= QCA_NAPI_NUM_BUCKETS) { + HIF_ERROR("Bad bucket#(%d) > QCA_NAPI_NUM_BUCKETS(%d)" + " (rc=%d/normalized=%d- corrected", + bucket, QCA_NAPI_NUM_BUCKETS, rc, normalized); bucket = QCA_NAPI_NUM_BUCKETS - 1; - HIF_ERROR("Bad bucket#(%d) > QCA_NAPI_NUM_BUCKETS(%d)", - bucket, QCA_NAPI_NUM_BUCKETS); } napi_info->stats[cpu].napi_budget_uses[bucket]++; } else { -- cgit v1.2.3