qcacmn: Support for DP RX Threads

Add support for DP RX Threads as a part of the FR. Multiple RX
threads can be enabled from the ini. The code is added in a new DP
module outside of the cmn project.

Change-Id: Id966c46c2799d23c2a4fa1c884610955afed3565
CRs-Fixed: 2256470
This commit is contained in:
Mohit Khanna
2018-05-24 11:58:13 -07:00
committato da nshrivas
parent 2e590ab62b
commit 7ac554bda5
14 ha cambiato i file con 331 aggiunte e 34 eliminazioni

Vedi File

@@ -607,6 +607,11 @@ enum qdf_proto_subtype {
*/
typedef __qdf_nbuf_t qdf_nbuf_t;
/**
* typedef qdf_nbuf_queue_head_t - Platform indepedent nbuf queue head
*/
typedef __qdf_nbuf_queue_head_t qdf_nbuf_queue_head_t;
/**
* @qdf_dma_map_cb_t - Dma map callback prototype
*/
@@ -787,6 +792,68 @@ qdf_nbuf_unmap_nbytes_single(
}
#endif /* NBUF_MEMORY_DEBUG */
/**
* qdf_nbuf_queue_head_dequeue() - dequeue nbuf from the head of queue
* @nbuf_queue_head: pointer to nbuf queue head
*
* Return: pointer to network buffer dequeued
*/
static inline
qdf_nbuf_t qdf_nbuf_queue_head_dequeue(qdf_nbuf_queue_head_t *nbuf_queue_head)
{
return __qdf_nbuf_queue_head_dequeue(nbuf_queue_head);
}
/**
* qdf_nbuf_queue_head_qlen() - length of the queue
* @nbuf_queue_head: pointer to nbuf queue head
*
* Return: length of queue (number of nbufs) pointed by qdf_nbuf_queue_head_t
*/
static inline
uint32_t qdf_nbuf_queue_head_qlen(qdf_nbuf_queue_head_t *nbuf_queue_head)
{
return __qdf_nbuf_queue_head_qlen(nbuf_queue_head);
}
/**
* qdf_nbuf_queue_head_enqueue_tail() - enqueue nbuf into queue tail
* @nbuf_queue_head: pointer to nbuf queue head
* @nbuf: nbuf to be enqueued
*
* Return: None
*/
static inline
void qdf_nbuf_queue_head_enqueue_tail(qdf_nbuf_queue_head_t *nbuf_queue_head,
qdf_nbuf_t nbuf)
{
return __qdf_nbuf_queue_head_enqueue_tail(nbuf_queue_head, nbuf);
}
/**
* qdf_nbuf_queue_head_init() - initialize qdf_nbuf_queue_head_t
* @nbuf_queue_head: pointer to nbuf queue head to be initialized
*
* Return: None
*/
static inline
void qdf_nbuf_queue_head_init(qdf_nbuf_queue_head_t *nbuf_queue_head)
{
return __qdf_nbuf_queue_head_init(nbuf_queue_head);
}
/**
* qdf_nbuf_queue_head_purge() - purge qdf_nbuf_queue_head_t
* @nbuf_queue_head: pointer to nbuf queue head to be purged
*
* Return: None
*/
static inline
void qdf_nbuf_queue_head_purge(qdf_nbuf_queue_head_t *nbuf_queue_head)
{
return __qdf_nbuf_queue_head_purge(nbuf_queue_head);
}
static inline void
qdf_nbuf_sync_for_cpu(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
{
@@ -1305,16 +1372,27 @@ static inline qdf_nbuf_t qdf_nbuf_copy(qdf_nbuf_t buf)
void qdf_nbuf_init_fast(qdf_nbuf_t nbuf);
#endif /* WLAN_FEATURE_FASTPATH */
static inline void qdf_nbuf_tx_free(qdf_nbuf_t buf_list, int tx_err)
/**
* @qdf_nbuf_list_free() - free a list of nbufs
* @buf_list: A list of nbufs to be freed
*
* Return: none
*/
static inline void qdf_nbuf_list_free(qdf_nbuf_t buf_list)
{
while (buf_list) {
qdf_nbuf_t next = qdf_nbuf_next(buf_list);
qdf_nbuf_free(buf_list);
buf_list = next;
}
}
static inline void qdf_nbuf_tx_free(qdf_nbuf_t buf_list, int tx_err)
{
qdf_nbuf_list_free(buf_list);
}
static inline void qdf_nbuf_ref(qdf_nbuf_t buf)
{
__qdf_nbuf_ref(buf);

Vedi File

@@ -38,12 +38,20 @@ void qdf_sleep_us(uint32_t us_interval);
void qdf_busy_wait(uint32_t us_interval);
/**
* qdf_set_wake_up_idle() - set wakeup idle value
* @idle: true/false value for wake up idle
*
* Return: none
*/
void qdf_set_wake_up_idle(bool idle);
/**
* qdf_set_user_nice() - set thread's nice value
* @thread: pointer to thread
* @nice: nice value
*
* Return: none
* Return: void
*/
void qdf_set_user_nice(qdf_thread_t *thread, long nice);
@@ -52,7 +60,7 @@ void qdf_set_user_nice(qdf_thread_t *thread, long nice);
* @thread: pointer to thread
* @nice: nice value
*
* Return: pointer to created kernel thread
* Return: pointer to created kernel thread on success else NULL
*/
qdf_thread_t *qdf_create_thread(int (*thread_handler)(void *data), void *data,
const char thread_name[]);
@@ -111,4 +119,19 @@ void qdf_print_thread_trace(qdf_thread_t *thread);
* Return: pointer to task struct
*/
qdf_thread_t *qdf_get_current_task(void);
/**
* qdf_get_current_pid() - get current task's process id
*
* Return: current task's process id (int)
*/
int qdf_get_current_pid(void);
/**
* qdf_get_current_comm() - get current task's command name
*
* Return: current task's command name(char *)
*/
const char *qdf_get_current_comm(void);
#endif /* __QDF_THREADS_H */

Vedi File

@@ -44,6 +44,13 @@
*/
typedef struct sk_buff *__qdf_nbuf_t;
/**
* typedef __qdf_nbuf_queue_head_t - abstraction for sk_buff_head linux struct
*
* This is used for skb queue management via linux skb buff head APIs
*/
typedef struct sk_buff_head __qdf_nbuf_queue_head_t;
#define QDF_NBUF_CB_TX_MAX_OS_FRAGS 1
/* QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS -
@@ -95,7 +102,7 @@ typedef union {
* @rx.dev.priv_cb_m.tcp_ack_num: TCP ACK number
* @rx.dev.priv_cb_m.lro_ctx: LRO context
* @rx.dev.priv_cb_m.map_index:
* @rx.dev.priv_cb_m.reserved: reserved
* @rx.dev.priv_cb_m.peer_local_id: peer_local_id for RX pkt
*
* @rx.lro_eligible: flag to indicate whether the MSDU is LRO eligible
* @rx.peer_cached_buf_frm: peer cached buffer
@@ -105,6 +112,8 @@ typedef union {
* @rx.ip_offset: offset to IP header
* @rx.tcp_offset: offset to TCP header
* @rx_ctx_id: Rx context id
* @flush_ind: flush indication
* @num_elements_in_list: number of elements in the nbuf list
*
* @rx.tcp_udp_chksum: L4 payload checksum
* @rx.tcp_wim: TCP window size
@@ -187,7 +196,7 @@ struct qdf_nbuf_cb {
uint32_t tcp_ack_num;
unsigned char *lro_ctx;
uint32_t map_index;
uint32_t reserved;
uint32_t peer_local_id;
} priv_cb_m;
} dev;
uint32_t lro_eligible:1,
@@ -197,9 +206,11 @@ struct qdf_nbuf_cb {
ipv6_proto:1,
ip_offset:7,
tcp_offset:7,
rx_ctx_id:4;
rx_ctx_id:4,
flush_ind:1,
num_elements_in_list:8;
uint32_t tcp_udp_chksum:16,
tcp_win:16;
tcp_win:16;
uint32_t flow_id;
uint8_t flag_chfrag_start:1,
flag_chfrag_cont:1,
@@ -297,6 +308,10 @@ QDF_COMPILE_TIME_ASSERT(qdf_nbuf_cb_size,
(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.tcp_offset)
#define QDF_NBUF_CB_RX_CTX_ID(skb) \
(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.rx_ctx_id)
#define QDF_NBUF_CB_RX_FLUSH_IND(skb) \
(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.flush_ind)
#define QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(skb) \
(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.num_elements_in_list)
#define QDF_NBUF_CB_RX_TCP_CHKSUM(skb) \
(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.tcp_udp_chksum)
@@ -1837,6 +1852,38 @@ static inline void __qdf_nbuf_orphan(struct sk_buff *skb)
{
return skb_orphan(skb);
}
static inline struct sk_buff *
__qdf_nbuf_queue_head_dequeue(struct sk_buff_head *skb_queue_head)
{
return skb_dequeue(skb_queue_head);
}
static inline
uint32_t __qdf_nbuf_queue_head_qlen(struct sk_buff_head *skb_queue_head)
{
return skb_queue_head->qlen;
}
static inline
void __qdf_nbuf_queue_head_enqueue_tail(struct sk_buff_head *skb_queue_head,
struct sk_buff *skb)
{
return skb_queue_tail(skb_queue_head, skb);
}
static inline
void __qdf_nbuf_queue_head_init(struct sk_buff_head *skb_queue_head)
{
return skb_queue_head_init(skb_queue_head);
}
static inline
void __qdf_nbuf_queue_head_purge(struct sk_buff_head *skb_queue_head)
{
return skb_queue_purge(skb_queue_head);
}
#ifdef CONFIG_WIN
#include <i_qdf_nbuf_w.h>
#else

Vedi File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-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
@@ -34,6 +34,9 @@
#define QDF_NBUF_CB_RX_LRO_CTX(skb) \
(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.dev.priv_cb_m.lro_ctx)
#define QDF_NBUF_CB_RX_PEER_LOCAL_ID(skb) \
(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.dev.priv_cb_m.peer_local_id)
#define QDF_NBUF_CB_TX_IPA_OWNED(skb) \
(((struct qdf_nbuf_cb *)((skb)->cb))->u.tx.dev.priv_cb_m.ipa.owned)
#define QDF_NBUF_CB_TX_IPA_PRIV(skb) \
@@ -58,7 +61,18 @@
#define __qdf_nbuf_ipa_priv_set(skb, priv) \
(QDF_NBUF_CB_TX_IPA_PRIV(skb) = (priv))
/**
* qdf_nbuf_cb_update_peer_local_id() - update peer local id in skb cb
* @skb: skb pointer whose cb is updated with peer local id information
* @peer_local_id: peer local id to be update in cb
*
* Return: void
*/
static inline void qdf_nbuf_cb_update_peer_local_id(struct sk_buff *skb,
uint32_t peer_local_id)
{
QDF_NBUF_CB_RX_PEER_LOCAL_ID(skb) = peer_local_id;
}
void __qdf_nbuf_init_replenish_timer(void);
void __qdf_nbuf_deinit_replenish_timer(void);

Vedi File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-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
@@ -66,7 +66,18 @@
#define __qdf_nbuf_get_tx_fctx(skb) \
QDF_NBUF_CB_TX_FCTX((skb))
/**
* qdf_nbuf_cb_update_peer_local_id() - update peer local id in skb cb
* @skb: skb pointer whose cb is updated with peer local id information
* @peer_local_id: peer local id to be update in cb
*
* Return: void
*/
static inline void qdf_nbuf_cb_update_peer_local_id(struct sk_buff *skb,
uint32_t peer_local_id)
{
/* Does not apply to WIN */
}
/**
* __qdf_nbuf_push_head() - Push data in the front

Vedi File

@@ -106,6 +106,19 @@ void qdf_busy_wait(uint32_t us_interval)
}
qdf_export_symbol(qdf_busy_wait);
#ifdef MSM_PLATFORM
void qdf_set_wake_up_idle(bool idle)
{
set_wake_up_idle(idle);
}
#else
void qdf_set_wake_up_idle(bool idle)
{
}
#endif /* MSM_PLATFORM */
qdf_export_symbol(qdf_set_wake_up_idle);
void qdf_set_user_nice(qdf_thread_t *thread, long nice)
{
set_user_nice(thread, nice);
@@ -115,7 +128,14 @@ qdf_export_symbol(qdf_set_user_nice);
qdf_thread_t *qdf_create_thread(int (*thread_handler)(void *data), void *data,
const char thread_name[])
{
return kthread_create(thread_handler, data, thread_name);
struct task_struct *task;
task = kthread_create(thread_handler, data, thread_name);
if (IS_ERR(task))
return NULL;
return task;
}
qdf_export_symbol(qdf_create_thread);
@@ -196,3 +216,15 @@ qdf_thread_t *qdf_get_current_task(void)
return current;
}
qdf_export_symbol(qdf_get_current_task);
int qdf_get_current_pid(void)
{
return current->pid;
}
qdf_export_symbol(qdf_get_current_pid);
const char *qdf_get_current_comm(void)
{
return current->comm;
}
qdf_export_symbol(qdf_get_current_comm);