qcacld-3.0: Add support for flush GRO packets using RX thread
Add support for flush GRO packets using RX thread in OSIF module. Change-Id: I776e863d03923bcaac685547d3047df2c8afb27e CRs-Fixed: 3316855
This commit is contained in:

committed by
Madan Koyyalamudi

parent
b81f52931c
commit
0c616f6306
@@ -37,8 +37,6 @@
|
|||||||
#include <ol_defines.h>
|
#include <ol_defines.h>
|
||||||
#include <hif_napi.h>
|
#include <hif_napi.h>
|
||||||
#include <hif.h>
|
#include <hif.h>
|
||||||
#include <dp_rx_thread.h>
|
|
||||||
#include <dp_txrx.h>
|
|
||||||
#include <wlan_hdd_main.h>
|
#include <wlan_hdd_main.h>
|
||||||
#include "wlan_hdd_wmm.h"
|
#include "wlan_hdd_wmm.h"
|
||||||
|
|
||||||
@@ -171,6 +169,46 @@ void osif_dp_mark_pkt_type(struct sk_buff *skb)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
|
||||||
|
/**
|
||||||
|
* osif_dp_rx_thread_napi_gro_flush() - do gro flush
|
||||||
|
* @napi: napi used to do gro flush
|
||||||
|
* @flush_code: flush_code differentiating low_tput_flush and normal_flush
|
||||||
|
*
|
||||||
|
* if there is RX GRO_NORMAL packets pending in napi
|
||||||
|
* rx_list, flush them manually right after napi_gro_flush.
|
||||||
|
*
|
||||||
|
* Return: none
|
||||||
|
*/
|
||||||
|
static inline
|
||||||
|
void osif_dp_rx_thread_napi_gro_flush(struct napi_struct *napi,
|
||||||
|
enum dp_rx_gro_flush_code flush_code)
|
||||||
|
{
|
||||||
|
if (napi->poll) {
|
||||||
|
/* Skipping GRO flush in low TPUT */
|
||||||
|
if (flush_code != DP_RX_GRO_LOW_TPUT_FLUSH)
|
||||||
|
napi_gro_flush(napi, false);
|
||||||
|
|
||||||
|
if (napi->rx_count) {
|
||||||
|
netif_receive_skb_list(&napi->rx_list);
|
||||||
|
qdf_init_list_head(&napi->rx_list);
|
||||||
|
napi->rx_count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static inline
|
||||||
|
void osif_dp_rx_thread_napi_gro_flush(struct napi_struct *napi,
|
||||||
|
enum dp_rx_gro_flush_code flush_code)
|
||||||
|
{
|
||||||
|
if (napi->poll) {
|
||||||
|
/* Skipping GRO flush in low TPUT */
|
||||||
|
if (flush_code != DP_RX_GRO_LOW_TPUT_FLUSH)
|
||||||
|
napi_gro_flush(napi, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* osif_dp_rx_napi_gro_flush() - GRO RX/flush function.
|
* osif_dp_rx_napi_gro_flush() - GRO RX/flush function.
|
||||||
* @napi_to_use: napi to be used to give packets to the stack, gro flush
|
* @napi_to_use: napi to be used to give packets to the stack, gro flush
|
||||||
@@ -201,8 +239,8 @@ osif_dp_rx_napi_gro_flush(qdf_napi_struct *napi_to_use,
|
|||||||
|
|
||||||
if (DP_IS_EXTRA_GRO_FLUSH_NECESSARY(gro_ret)) {
|
if (DP_IS_EXTRA_GRO_FLUSH_NECESSARY(gro_ret)) {
|
||||||
*low_tput_force_flush = 1;
|
*low_tput_force_flush = 1;
|
||||||
dp_rx_napi_gro_flush((struct napi_struct *)napi_to_use,
|
osif_dp_rx_thread_napi_gro_flush((struct napi_struct *)napi_to_use,
|
||||||
DP_RX_GRO_NORMAL_FLUSH);
|
DP_RX_GRO_NORMAL_FLUSH);
|
||||||
}
|
}
|
||||||
|
|
||||||
local_bh_enable();
|
local_bh_enable();
|
||||||
@@ -243,12 +281,13 @@ osif_dp_rx_napi_gro_receive(qdf_napi_struct *napi_to_use,
|
|||||||
|
|
||||||
#ifdef RECEIVE_OFFLOAD
|
#ifdef RECEIVE_OFFLOAD
|
||||||
/**
|
/**
|
||||||
* osif_dp_rxthread_napi_gro_flush() - GRO flush cbk for NAPI+Rx_Thread Rx mode
|
* osif_dp_rxthread_napi_normal_gro_flush() - GRO flush cbk for NAPI+Rx_Thread
|
||||||
|
* Rx mode
|
||||||
* @data: hif NAPI context
|
* @data: hif NAPI context
|
||||||
*
|
*
|
||||||
* Return: none
|
* Return: none
|
||||||
*/
|
*/
|
||||||
static void osif_dp_rxthread_napi_gro_flush(void *data)
|
static void osif_dp_rxthread_napi_normal_gro_flush(void *data)
|
||||||
{
|
{
|
||||||
struct qca_napi_info *qca_napi = (struct qca_napi_info *)data;
|
struct qca_napi_info *qca_napi = (struct qca_napi_info *)data;
|
||||||
|
|
||||||
@@ -257,8 +296,8 @@ static void osif_dp_rxthread_napi_gro_flush(void *data)
|
|||||||
* As we are breaking context in Rxthread mode, there is rx_thread NAPI
|
* As we are breaking context in Rxthread mode, there is rx_thread NAPI
|
||||||
* corresponds each hif_napi.
|
* corresponds each hif_napi.
|
||||||
*/
|
*/
|
||||||
dp_rx_napi_gro_flush(&qca_napi->rx_thread_napi,
|
osif_dp_rx_thread_napi_gro_flush(&qca_napi->rx_thread_napi,
|
||||||
DP_RX_GRO_NORMAL_FLUSH);
|
DP_RX_GRO_NORMAL_FLUSH);
|
||||||
local_bh_enable();
|
local_bh_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -509,7 +548,7 @@ void osif_dp_register_rx_offld_flush_cb(enum dp_rx_offld_flush_cb cb_type)
|
|||||||
cdp_register_rx_offld_flush_cb(soc, osif_dp_qdf_lro_flush);
|
cdp_register_rx_offld_flush_cb(soc, osif_dp_qdf_lro_flush);
|
||||||
else if (cb_type == DP_RX_FLUSH_THREAD)
|
else if (cb_type == DP_RX_FLUSH_THREAD)
|
||||||
cdp_register_rx_offld_flush_cb(soc,
|
cdp_register_rx_offld_flush_cb(soc,
|
||||||
osif_dp_rxthread_napi_gro_flush);
|
osif_dp_rxthread_napi_normal_gro_flush);
|
||||||
else if (cb_type == DP_RX_FLUSH_NAPI)
|
else if (cb_type == DP_RX_FLUSH_NAPI)
|
||||||
cdp_register_rx_offld_flush_cb(soc,
|
cdp_register_rx_offld_flush_cb(soc,
|
||||||
osif_dp_hif_napi_gro_flush);
|
osif_dp_hif_napi_gro_flush);
|
||||||
@@ -548,6 +587,7 @@ void os_if_dp_register_txrx_callbacks(struct wlan_dp_psoc_callbacks *cb_obj)
|
|||||||
cb_obj->dp_nbuf_push_pkt = osif_dp_rx_pkt_to_nw;
|
cb_obj->dp_nbuf_push_pkt = osif_dp_rx_pkt_to_nw;
|
||||||
cb_obj->dp_rx_napi_gro_flush = osif_dp_rx_napi_gro_flush;
|
cb_obj->dp_rx_napi_gro_flush = osif_dp_rx_napi_gro_flush;
|
||||||
cb_obj->dp_rx_napi_gro_receive = osif_dp_rx_napi_gro_receive;
|
cb_obj->dp_rx_napi_gro_receive = osif_dp_rx_napi_gro_receive;
|
||||||
|
cb_obj->dp_rx_thread_napi_gro_flush = osif_dp_rx_thread_napi_gro_flush;
|
||||||
cb_obj->dp_lro_rx_cb = osif_dp_lro_rx;
|
cb_obj->dp_lro_rx_cb = osif_dp_lro_rx;
|
||||||
cb_obj->dp_register_rx_offld_flush_cb =
|
cb_obj->dp_register_rx_offld_flush_cb =
|
||||||
osif_dp_register_rx_offld_flush_cb;
|
osif_dp_register_rx_offld_flush_cb;
|
||||||
|
Reference in New Issue
Block a user