qcacmn: Add support to flush rx packets for a vdev

When a particular vdev is deleted, the corresponding rx
packets which have been queued to the rx thread are not
flushed. Hence when such packets are submitted to the
network stack, the dev for this skb will be invalid,
since we have already freed the adapter.

Flush out the packets in the rx thread queues, before
deleting the vdev.

CRs-Fixed: 2543392
Change-Id: I2490d0f5ce965f62152613a17a59232521ca058f
This commit is contained in:
Rakesh Pillai
2019-10-24 06:44:11 +05:30
committed by nshrivas
parent b3518aff5c
commit 534a143d8f
7 changed files with 123 additions and 1 deletions

View File

@@ -705,6 +705,9 @@ typedef void (*qdf_nbuf_free_t)(__qdf_nbuf_t);
#define __qdf_nbuf_data_attr_set(skb, data_attr) \
(QDF_NBUF_CB_TX_DATA_ATTR(skb) = (data_attr))
#define __qdf_nbuf_queue_walk_safe(queue, var, tvar) \
skb_queue_walk_safe(queue, var, tvar)
/**
* __qdf_nbuf_num_frags_init() - init extra frags
* @skb: sk buffer
@@ -1085,6 +1088,22 @@ __qdf_nbuf_set_tail_pointer(struct sk_buff *skb, int len)
skb_set_tail_pointer(skb, len);
}
/**
* __qdf_nbuf_unlink_no_lock() - unlink an skb from skb queue
* @skb: Pointer to network buffer
* @list: list to use
*
* This is a lockless version, driver must acquire locks if it
* needs to synchronize
*
* Return: none
*/
static inline void
__qdf_nbuf_unlink_no_lock(struct sk_buff *skb, struct sk_buff_head *list)
{
__skb_unlink(skb, list);
}
/**
* __qdf_nbuf_reset() - reset the buffer data and pointer
* @buf: Network buf instance
@@ -2204,6 +2223,30 @@ void __qdf_nbuf_queue_head_purge(struct sk_buff_head *skb_queue_head)
return skb_queue_purge(skb_queue_head);
}
/**
* __qdf_nbuf_queue_head_lock() - Acquire the skb list lock
* @head: skb list for which lock is to be acquired
*
* Return: void
*/
static inline
void __qdf_nbuf_queue_head_lock(struct sk_buff_head *skb_queue_head)
{
spin_lock_bh(&skb_queue_head->lock);
}
/**
* __qdf_nbuf_queue_head_unlock() - Release the skb list lock
* @head: skb list for which lock is to be release
*
* Return: void
*/
static inline
void __qdf_nbuf_queue_head_unlock(struct sk_buff_head *skb_queue_head)
{
spin_unlock_bh(&skb_queue_head->lock);
}
#ifdef CONFIG_NBUF_AP_PLATFORM
#include <i_qdf_nbuf_w.h>
#else