qcacmn: add API to get NAPI instance corresponding to NAPI ID

Add API to get NAPI instance from NAPI ID. Handle to NAPI is required
for Rx processing via GRO.

Change-Id: I15535827a03953231670d4138235c4876b16e045
CRs-Fixed: 2062180
This commit is contained in:
Manjunathappa Prakash
2018-04-15 00:42:41 -07:00
committed by nshrivas
parent 2f5727960b
commit c3aeffb5e9
7 changed files with 48 additions and 31 deletions

View File

@@ -882,6 +882,21 @@ struct hif_target_info *hif_get_target_info_handle(
}
qdf_export_symbol(hif_get_target_info_handle);
#ifdef RECEIVE_OFFLOAD
int hif_get_rx_ctx_id(int ctx_id, struct hif_opaque_softc *hif_hdl)
{
if (hif_napi_enabled(hif_hdl, -1))
return NAPI_PIPE2ID(ctx_id);
else
return ctx_id;
}
#else
int hif_get_rx_ctx_id(int ctx_id, struct hif_opaque_softc *hif_hdl)
{
return 0;
}
#endif
#if defined(FEATURE_LRO)
/**
@@ -902,27 +917,6 @@ void *hif_get_lro_info(int ctx_id, struct hif_opaque_softc *hif_hdl)
return data;
}
/**
* hif_get_rx_ctx_id - Returns LRO instance ID based on underlying LRO instance
* @ctx_id: LRO context ID
* @hif_hdl: HIF Context
*
* Return: LRO instance ID
*/
int hif_get_rx_ctx_id(int ctx_id, struct hif_opaque_softc *hif_hdl)
{
if (hif_napi_enabled(hif_hdl, -1))
return NAPI_PIPE2ID(ctx_id);
else
return ctx_id;
}
#else /* !defined(FEATURE_LRO) */
int hif_get_rx_ctx_id(int ctx_id, struct hif_opaque_softc *hif_hdl)
{
return 0;
}
#endif
/**

View File

@@ -277,6 +277,13 @@ void hif_wlan_disable(struct hif_softc *scn);
int hif_target_sleep_state_adjust(struct hif_softc *scn,
bool sleep_ok,
bool wait_for_it);
/**
* hif_get_rx_ctx_id() - Returns NAPI instance ID based on CE ID
* @ctx_id: Rx CE context ID
* @hif_hdl: HIF Context
*
* Return: Rx instance ID
*/
int hif_get_rx_ctx_id(int ctx_id, struct hif_opaque_softc *hif_hdl);
void hif_ramdump_handler(struct hif_opaque_softc *scn);
#ifdef HIF_USB

View File

@@ -361,6 +361,13 @@ inline struct qca_napi_data *hif_napi_get_all(struct hif_opaque_softc *hif_ctx)
return &(hif->napi_data);
}
struct napi_struct *hif_get_napi(int napi_id, struct qca_napi_data *napid)
{
int id = NAPI_ID2PIPE(napi_id);
return &(napid->napis[id]->napi);
}
/**
*
* hif_napi_event() - reacts to events that impact NAPI

View File

@@ -124,6 +124,15 @@ int hif_napi_destroy(struct hif_opaque_softc *hif,
struct qca_napi_data *hif_napi_get_all(struct hif_opaque_softc *hif);
/**
* hif_get_napi() - get NAPI corresponding to napi_id
* @napi_id: NAPI instance
* @napi_d: Handle NAPI
*
* Return: napi corresponding napi_id
*/
struct napi_struct *hif_get_napi(int napi_id, struct qca_napi_data *napid);
int hif_napi_event(struct hif_opaque_softc *hif,
enum qca_napi_event event,
void *data);

View File

@@ -864,12 +864,12 @@ struct policy_mgr_cdp_cbacks {
/**
* struct policy_mgr_dp_cbacks - CDP Callbacks to be invoked
* from policy manager
* @hdd_disable_lro_in_concurrency: Callback to disable LRO
* @hdd_disable_rx_ol_in_concurrency: Callback to disable LRO/GRO offloads
* @hdd_set_rx_mode_rps_cb: Callback to set RPS
* @hdd_ipa_set_mcc_mode_cb: Callback to set mcc mode for ipa module
*/
struct policy_mgr_dp_cbacks {
void (*hdd_disable_lro_in_concurrency)(bool);
void (*hdd_disable_rx_ol_in_concurrency)(bool);
void (*hdd_set_rx_mode_rps_cb)(bool);
void (*hdd_ipa_set_mcc_mode_cb)(bool);
};

View File

@@ -1159,7 +1159,7 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc,
pm_ctx->tdls_cbacks.tdls_notify_increment_session(psoc);
/*
* Disable LRO if P2P or IBSS or SAP connection has come up or
* Disable LRO/GRO if P2P or IBSS or SAP connection has come up or
* there are more than one STA connections
*/
if ((policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, NULL) > 1) ||
@@ -1168,8 +1168,8 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc,
0) ||
(policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE, NULL) > 0) ||
(policy_mgr_mode_specific_connection_count(psoc, PM_IBSS_MODE, NULL) > 0)) {
if (pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency != NULL)
pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(true);
if (pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency != NULL)
pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency(true);
};
/* Enable RPS if SAP interface has come up */
@@ -1229,15 +1229,15 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc,
/* Notify tdls */
if (pm_ctx->tdls_cbacks.tdls_notify_decrement_session)
pm_ctx->tdls_cbacks.tdls_notify_decrement_session(psoc);
/* Enable LRO if there no concurrency */
/* Enable LRO/GRO if there no concurrency */
if ((policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, NULL) == 1) &&
(policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL) == 0) &&
(policy_mgr_mode_specific_connection_count(psoc, PM_P2P_CLIENT_MODE, NULL) ==
0) &&
(policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE, NULL) == 0) &&
(policy_mgr_mode_specific_connection_count(psoc, PM_IBSS_MODE, NULL) == 0)) {
if (pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency != NULL)
pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(false);
if (pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency != NULL)
pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency(false);
};
/* Disable RPS if SAP interface has come up */

View File

@@ -645,8 +645,8 @@ QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_FAILURE;
}
pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency =
dp_cbacks->hdd_disable_lro_in_concurrency;
pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency =
dp_cbacks->hdd_disable_rx_ol_in_concurrency;
pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb =
dp_cbacks->hdd_set_rx_mode_rps_cb;
pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb =