qcacld-3.0: Move TC based dynamic GRO logic to DP component
Move TC based dynamic GRO logic to DP component. Change-Id: I3c6658e8f19a71e548c77ff6fd637148925008d7 CRs-Fixed: 3219451
This commit is contained in:

committed by
Madan Koyyalamudi

vanhempi
2304bbd8de
commit
6529648bf3
@@ -321,7 +321,7 @@ struct wlan_dp_intf {
|
||||
qdf_atomic_t num_active_task;
|
||||
uint32_t sap_tx_block_mask;
|
||||
|
||||
uint8_t gro_disallowed[DP_MAX_RX_THREADS];
|
||||
qdf_atomic_t gro_disallowed;
|
||||
uint8_t gro_flushed[DP_MAX_RX_THREADS];
|
||||
|
||||
bool runtime_disable_rx_thread;
|
||||
@@ -430,7 +430,8 @@ struct wlan_dp_psoc_context {
|
||||
struct {
|
||||
qdf_atomic_t rx_aggregation;
|
||||
uint8_t gro_force_flush[DP_MAX_RX_THREADS];
|
||||
bool force_gro_enable;
|
||||
bool tc_based_dyn_gro;
|
||||
uint32_t tc_ingress_prio;
|
||||
}
|
||||
dp_agg_param;
|
||||
|
||||
|
@@ -1650,6 +1650,48 @@ static void dp_pld_request_bus_bandwidth(struct wlan_dp_psoc_context *dp_ctx,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_RX_AGGREGATION
|
||||
/**
|
||||
* dp_rx_check_qdisc_for_intf() - Check if any ingress qdisc is configured
|
||||
* for given adapter
|
||||
* @dp_intf: pointer to DP interface context
|
||||
*
|
||||
* The function checks if ingress qdisc is registered for a given
|
||||
* net device.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void
|
||||
dp_rx_check_qdisc_for_intf(struct wlan_dp_intf *dp_intf)
|
||||
{
|
||||
struct wlan_dp_psoc_callbacks *dp_ops;
|
||||
QDF_STATUS status;
|
||||
|
||||
dp_ops = &dp_intf->dp_ctx->dp_ops;
|
||||
status = dp_ops->dp_rx_check_qdisc_configured(dp_intf->dev,
|
||||
dp_intf->dp_ctx->dp_agg_param.tc_ingress_prio);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
if (qdf_likely(qdf_atomic_read(&dp_intf->gro_disallowed)))
|
||||
return;
|
||||
|
||||
dp_debug("ingress qdisc/filter configured disable GRO");
|
||||
qdf_atomic_set(&dp_intf->gro_disallowed, 1);
|
||||
|
||||
return;
|
||||
} else if (status == QDF_STATUS_E_NOSUPPORT) {
|
||||
if (qdf_unlikely(qdf_atomic_read(&dp_intf->gro_disallowed))) {
|
||||
dp_debug("ingress qdisc/filter removed enable GRO");
|
||||
qdf_atomic_set(&dp_intf->gro_disallowed, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void
|
||||
dp_rx_check_qdisc_for_intf(struct wlan_dp_intf *dp_intf)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* __dp_bus_bw_work_handler() - Bus bandwidth work handler
|
||||
* @dp_ctx: handle to DP context
|
||||
@@ -1709,6 +1751,9 @@ static void __dp_bus_bw_work_handler(struct wlan_dp_psoc_context *dp_ctx)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dp_ctx->dp_agg_param.tc_based_dyn_gro)
|
||||
dp_rx_check_qdisc_for_intf(dp_intf);
|
||||
|
||||
tx_packets += DP_BW_GET_DIFF(
|
||||
QDF_NET_DEV_STATS_TX_PKTS(&dp_intf->stats),
|
||||
dp_intf->prev_tx_packets);
|
||||
|
@@ -961,11 +961,13 @@ static QDF_STATUS dp_gro_rx_bh_disable(struct wlan_dp_intf *dp_intf,
|
||||
uint32_t rx_aggregation;
|
||||
uint8_t rx_ctx_id = QDF_NBUF_CB_RX_CTX_ID(nbuf);
|
||||
uint8_t low_tput_force_flush = 0;
|
||||
int32_t gro_disallowed;
|
||||
|
||||
rx_aggregation = qdf_atomic_read(&dp_ctx->dp_agg_param.rx_aggregation);
|
||||
gro_disallowed = qdf_atomic_read(&dp_intf->gro_disallowed);
|
||||
|
||||
if (dp_get_current_throughput_level(dp_ctx) == PLD_BUS_WIDTH_IDLE ||
|
||||
!rx_aggregation || dp_intf->gro_disallowed[rx_ctx_id]) {
|
||||
!rx_aggregation || gro_disallowed) {
|
||||
status = dp_ctx->dp_ops.dp_rx_napi_gro_flush(napi_to_use, nbuf,
|
||||
&low_tput_force_flush);
|
||||
if (!low_tput_force_flush)
|
||||
@@ -973,7 +975,7 @@ static QDF_STATUS dp_gro_rx_bh_disable(struct wlan_dp_intf *dp_intf,
|
||||
rx_gro_low_tput_flush++;
|
||||
if (!rx_aggregation)
|
||||
dp_ctx->dp_agg_param.gro_force_flush[rx_ctx_id] = 1;
|
||||
if (dp_intf->gro_disallowed[rx_ctx_id])
|
||||
if (gro_disallowed)
|
||||
dp_intf->gro_flushed[rx_ctx_id] = 1;
|
||||
} else {
|
||||
status = dp_ctx->dp_ops.dp_rx_napi_gro_receive(napi_to_use,
|
||||
@@ -1400,58 +1402,6 @@ void wlan_dp_set_fisa_disallowed_for_vdev(ol_txrx_soc_handle soc,
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_RX_AGGREGATION
|
||||
/**
|
||||
* dp_rx_check_qdisc_for_intf() - Check if any ingress qdisc is configured
|
||||
* for given adapter
|
||||
* @dp_intf: pointer to DP interface context
|
||||
* @rx_ctx_id: Rx context id
|
||||
*
|
||||
* The function checks if ingress qdisc is registered for a given
|
||||
* net device.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void
|
||||
dp_rx_check_qdisc_for_intf(struct wlan_dp_intf *dp_intf,
|
||||
uint8_t rx_ctx_id)
|
||||
{
|
||||
ol_txrx_soc_handle soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
struct wlan_dp_psoc_callbacks *dp_ops;
|
||||
QDF_STATUS status;
|
||||
|
||||
/*
|
||||
* Restrict the qdisc based dynamic GRO enable/disable to
|
||||
* standalone STA mode only. Reset the configuration for
|
||||
* any other device mode or concurrency.
|
||||
*/
|
||||
if (dp_intf->device_mode != QDF_STA_MODE ||
|
||||
(qdf_atomic_read(&dp_intf->dp_ctx->rx_skip_qdisc_chk_conc)))
|
||||
goto reset_wl;
|
||||
|
||||
dp_ops = &dp_intf->dp_ctx->dp_ops;
|
||||
status = dp_ops->dp_rx_check_qdisc_configured(dp_intf->dev,
|
||||
rx_ctx_id);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
if (qdf_likely(dp_intf->gro_disallowed[rx_ctx_id]))
|
||||
return;
|
||||
|
||||
dp_debug("ingress qdisc/filter configured disable GRO");
|
||||
dp_intf->gro_disallowed[rx_ctx_id] = 1;
|
||||
wlan_dp_set_fisa_disallowed_for_vdev(soc, dp_intf->intf_id,
|
||||
rx_ctx_id, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
reset_wl:
|
||||
if (qdf_unlikely(dp_intf->gro_disallowed[rx_ctx_id])) {
|
||||
dp_debug("ingress qdisc/filter removed enable GRO");
|
||||
wlan_dp_set_fisa_disallowed_for_vdev(soc, dp_intf->intf_id,
|
||||
rx_ctx_id, 0);
|
||||
dp_intf->gro_disallowed[rx_ctx_id] = 0;
|
||||
dp_intf->gro_flushed[rx_ctx_id] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_dp_rx_deliver_to_stack(struct wlan_dp_intf *dp_intf,
|
||||
qdf_nbuf_t nbuf)
|
||||
{
|
||||
@@ -1461,15 +1411,29 @@ QDF_STATUS wlan_dp_rx_deliver_to_stack(struct wlan_dp_intf *dp_intf,
|
||||
bool nbuf_receive_offload_ok = false;
|
||||
enum dp_nbuf_push_type push_type;
|
||||
uint8_t rx_ctx_id = QDF_NBUF_CB_RX_CTX_ID(nbuf);
|
||||
|
||||
if (!dp_ctx->dp_agg_param.force_gro_enable)
|
||||
/* rx_ctx_id is already verified for out-of-range */
|
||||
dp_rx_check_qdisc_for_intf(dp_intf, rx_ctx_id);
|
||||
ol_txrx_soc_handle soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
int32_t gro_disallowed;
|
||||
|
||||
if (QDF_NBUF_CB_RX_TCP_PROTO(nbuf) &&
|
||||
!QDF_NBUF_CB_RX_PEER_CACHED_FRM(nbuf))
|
||||
nbuf_receive_offload_ok = true;
|
||||
|
||||
gro_disallowed = qdf_atomic_read(&dp_intf->gro_disallowed);
|
||||
if (gro_disallowed == 0 &&
|
||||
dp_intf->gro_flushed[rx_ctx_id] != 0) {
|
||||
if (qdf_likely(soc))
|
||||
wlan_dp_set_fisa_disallowed_for_vdev(soc,
|
||||
dp_intf->intf_id,
|
||||
rx_ctx_id, 0);
|
||||
dp_intf->gro_flushed[rx_ctx_id] = 0;
|
||||
} else if (gro_disallowed &&
|
||||
dp_intf->gro_flushed[rx_ctx_id] == 0) {
|
||||
if (qdf_likely(soc))
|
||||
wlan_dp_set_fisa_disallowed_for_vdev(soc,
|
||||
dp_intf->intf_id,
|
||||
rx_ctx_id, 1);
|
||||
}
|
||||
|
||||
if (nbuf_receive_offload_ok && dp_ctx->receive_offload_cb &&
|
||||
!dp_ctx->dp_agg_param.gro_force_flush[rx_ctx_id] &&
|
||||
!dp_intf->gro_flushed[rx_ctx_id] &&
|
||||
|
@@ -618,7 +618,7 @@ struct wlan_dp_psoc_callbacks {
|
||||
void (*dp_register_rx_offld_flush_cb)(enum dp_rx_offld_flush_cb type);
|
||||
|
||||
QDF_STATUS (*dp_rx_check_qdisc_configured)(qdf_netdev_t dev,
|
||||
uint8_t rx_ctx_id);
|
||||
uint32_t prio);
|
||||
|
||||
bool (*dp_is_gratuitous_arp_unsolicited_na)(qdf_nbuf_t nbuf);
|
||||
|
||||
|
@@ -256,19 +256,16 @@ bool ucfg_dp_is_ol_enabled(struct wlan_objmgr_psoc *psoc);
|
||||
/**
|
||||
* ucfg_dp_rx_handle_concurrency() - Handle concurrency setting in DP
|
||||
* @psoc: PSOC mapped to DP context
|
||||
* @is_wifi3_0_target: true if it is wifi3.0 target
|
||||
* @is_concurrency: Is concurrency enabled/disabled
|
||||
* @disable: true/false to disable/enable the Rx offload
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void ucfg_dp_rx_handle_concurrency(struct wlan_objmgr_psoc *psoc,
|
||||
bool is_wifi3_0_target,
|
||||
bool is_concurrency);
|
||||
bool disable);
|
||||
#else
|
||||
static inline
|
||||
void ucfg_dp_rx_handle_concurrency(struct wlan_objmgr_psoc *psoc,
|
||||
bool is_wifi3_0_target,
|
||||
bool is_concurrency) { }
|
||||
bool disable) { }
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1124,13 +1121,13 @@ void ucfg_dp_set_rx_aggregation_val(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t value);
|
||||
|
||||
/**
|
||||
* ucfg_dp_set_force_gro_enable() - Set force gro enable
|
||||
* ucfg_dp_set_tc_based_dyn_gro() - Set tc based dynamic gro
|
||||
* @psoc: psoc handle
|
||||
* @value : value to be set
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void ucfg_dp_set_force_gro_enable(struct wlan_objmgr_psoc *psoc, bool value);
|
||||
void ucfg_dp_set_tc_based_dyn_gro(struct wlan_objmgr_psoc *psoc, bool value);
|
||||
|
||||
/**
|
||||
* ucfg_dp_runtime_disable_rx_thread() - Disable rx thread
|
||||
@@ -1149,4 +1146,13 @@ void ucfg_dp_runtime_disable_rx_thread(struct wlan_objmgr_vdev *vdev,
|
||||
* Return: true if NAPI enabled
|
||||
*/
|
||||
bool ucfg_dp_get_napi_enabled(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_dp_set_tc_ingress_prio() - Set tc ingress priority
|
||||
* @psoc: psoc handle mapped to DP context
|
||||
* @value: value to be set
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void ucfg_dp_set_tc_ingress_prio(struct wlan_objmgr_psoc *psoc, uint32_t value);
|
||||
#endif /* _WLAN_DP_UCFG_API_H_ */
|
||||
|
@@ -91,6 +91,7 @@ ucfg_dp_create_intf(struct wlan_objmgr_psoc *psoc,
|
||||
dp_nud_init_tracking(dp_intf);
|
||||
dp_mic_init_work(dp_intf);
|
||||
qdf_atomic_init(&dp_ctx->num_latency_critical_clients);
|
||||
qdf_atomic_init(&dp_intf->gro_disallowed);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -678,8 +679,7 @@ bool ucfg_dp_is_ol_enabled(struct wlan_objmgr_psoc *psoc)
|
||||
|
||||
#ifdef RECEIVE_OFFLOAD
|
||||
void ucfg_dp_rx_handle_concurrency(struct wlan_objmgr_psoc *psoc,
|
||||
bool is_wifi3_0_target,
|
||||
bool is_concurrency)
|
||||
bool disable)
|
||||
{
|
||||
struct wlan_dp_psoc_context *dp_ctx;
|
||||
|
||||
@@ -689,23 +689,7 @@ void ucfg_dp_rx_handle_concurrency(struct wlan_objmgr_psoc *psoc,
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_wifi3_0_target) {
|
||||
/*
|
||||
* Donot disable rx offload on concurrency for lithium and
|
||||
* beryllium based targets
|
||||
*/
|
||||
if (is_concurrency)
|
||||
qdf_atomic_set(&dp_ctx->rx_skip_qdisc_chk_conc, 1);
|
||||
else
|
||||
qdf_atomic_set(&dp_ctx->rx_skip_qdisc_chk_conc, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dp_ctx->ol_enable)
|
||||
return;
|
||||
|
||||
if (is_concurrency) {
|
||||
if (disable) {
|
||||
if (DP_BUS_BW_CFG(dp_ctx->dp_cfg.enable_tcp_delack)) {
|
||||
struct wlan_rx_tp_data rx_tp_data;
|
||||
|
||||
@@ -2048,7 +2032,7 @@ void ucfg_dp_set_rx_aggregation_val(struct wlan_objmgr_psoc *psoc,
|
||||
qdf_atomic_set(&dp_ctx->dp_agg_param.rx_aggregation, !!value);
|
||||
}
|
||||
|
||||
void ucfg_dp_set_force_gro_enable(struct wlan_objmgr_psoc *psoc, bool value)
|
||||
void ucfg_dp_set_tc_based_dyn_gro(struct wlan_objmgr_psoc *psoc, bool value)
|
||||
{
|
||||
struct wlan_dp_psoc_context *dp_ctx = dp_psoc_get_priv(psoc);
|
||||
|
||||
@@ -2056,7 +2040,7 @@ void ucfg_dp_set_force_gro_enable(struct wlan_objmgr_psoc *psoc, bool value)
|
||||
dp_err("DP ctx is NULL");
|
||||
return;
|
||||
}
|
||||
dp_ctx->dp_agg_param.force_gro_enable = value;
|
||||
dp_ctx->dp_agg_param.tc_based_dyn_gro = value;
|
||||
}
|
||||
|
||||
void ucfg_dp_runtime_disable_rx_thread(struct wlan_objmgr_vdev *vdev,
|
||||
@@ -2081,3 +2065,14 @@ bool ucfg_dp_get_napi_enabled(struct wlan_objmgr_psoc *psoc)
|
||||
}
|
||||
return dp_ctx->napi_enable;
|
||||
}
|
||||
|
||||
void ucfg_dp_set_tc_ingress_prio(struct wlan_objmgr_psoc *psoc, uint32_t value)
|
||||
{
|
||||
struct wlan_dp_psoc_context *dp_ctx = dp_psoc_get_priv(psoc);
|
||||
|
||||
if (!dp_ctx) {
|
||||
dp_err("DP ctx is NULL");
|
||||
return;
|
||||
}
|
||||
dp_ctx->dp_agg_param.tc_ingress_prio = value;
|
||||
}
|
||||
|
Viittaa uudesa ongelmassa
Block a user