qcacmn: Tx desc counter changes

Add following Tx desc counter changes:
1. Initialize tx_desc allocated counter
2. Initialize tx desc free counter
3. Use per pool tx desc counter num_allocated to populate desc_in_use
   counter

Change-Id: I4d80d0acfbbdd32a9f7d66e938e0a0f4e2cd7048
CRs-Fixed: 2239623
This commit is contained in:
Soumya Bhat
2018-05-18 11:01:34 +05:30
committed by nshrivas
parent 993a384744
commit dbb8530245
3 changed files with 35 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -38,6 +38,29 @@ do { \
#define DP_TX_DESC_PAGE_DIVIDER(soc, num_desc_per_page, pool_id) {}
#endif /* DESC_PARTITION */
/**
* dp_tx_desc_pool_counter_initialize() - Initialize counters
* @tx_desc_pool Handle to DP tx_desc_pool structure
* @num_elem Number of descriptor elements per pool
*
* Return: None
*/
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
static void
dp_tx_desc_pool_counter_initialize(struct dp_tx_desc_pool_s *tx_desc_pool,
uint16_t num_elem)
{
}
#else
static void
dp_tx_desc_pool_counter_initialize(struct dp_tx_desc_pool_s *tx_desc_pool,
uint16_t num_elem)
{
tx_desc_pool->num_free = num_elem;
tx_desc_pool->num_allocated = 0;
}
#endif
/**
* dp_tx_desc_pool_alloc() - Allocate Tx Descriptor pool(s)
* @soc Handle to DP SoC structure
@@ -115,6 +138,7 @@ QDF_STATUS dp_tx_desc_pool_alloc(struct dp_soc *soc, uint8_t pool_id,
count++;
}
dp_tx_desc_pool_counter_initialize(tx_desc_pool, num_elem);
TX_DESC_LOCK_CREATE(&tx_desc_pool->lock);
return QDF_STATUS_SUCCESS;