From 7e8f67cfca814e2980c131dd078c28f410b3839a Mon Sep 17 00:00:00 2001 From: Nisha Menon Date: Tue, 17 Dec 2019 13:47:24 -0800 Subject: [PATCH] qcacmn: Update Wifi netdevs for IPA exception path NAPI Starting Kernel 4.19 IPA LAN RX supports NAPI polling mechanism. Netdevs that hook into IPA need to call netif_receive_skb() or similar to deliver the packet to network stack instead of using netif_rx_ni(). IPA driver exports ipa_get_lan_rx_napi(void) API for this purpose. If this API call returns true use netif_receive_skb() or fallback on legacy api. Add the changes under a feature flag IPA_LAN_RX_NAPI_SUPPORT which is enabled under a linux kernel version check for 4.19 and above. Change-Id: I449404e86e934fd6113cb71e494575e67602f678 CRs-Fixed: 2588500 --- qdf/inc/qdf_ipa.h | 19 ++++++++++++++++++- qdf/linux/src/i_qdf_ipa.h | 18 +++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/qdf/inc/qdf_ipa.h b/qdf/inc/qdf_ipa.h index 83e6f3105d..6d13de7d69 100644 --- a/qdf/inc/qdf_ipa.h +++ b/qdf/inc/qdf_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020, 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 above @@ -665,5 +665,22 @@ static inline bool qdf_get_ipa_smmu_enabled(void) } #endif +#ifdef IPA_LAN_RX_NAPI_SUPPORT +/** + * qdf_ipa_get_lan_rx_napi() - Check if NAPI is enabled in LAN + * RX DP + * + * Returns: true if enabled, false otherwise + */ +static inline bool qdf_ipa_get_lan_rx_napi(void) +{ + return __qdf_ipa_get_lan_rx_napi(); +} +#else +static inline bool qdf_ipa_get_lan_rx_napi(void) +{ + return false; +} +#endif /* IPA_LAN_RX_NAPI_SUPPORT */ #endif /* IPA_OFFLOAD */ #endif /* _QDF_IPA_H */ diff --git a/qdf/linux/src/i_qdf_ipa.h b/qdf/linux/src/i_qdf_ipa.h index edd99fdd67..273f5a3748 100644 --- a/qdf/linux/src/i_qdf_ipa.h +++ b/qdf/linux/src/i_qdf_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020, 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 above @@ -20,6 +20,7 @@ #ifdef IPA_OFFLOAD #include +#include /** * __qdf_ipa_wdi_meter_evt_type_t - type of event client callback is @@ -554,6 +555,10 @@ typedef struct ipa_wlan_hdr_attrib_val __qdf_ipa_wlan_hdr_attrib_val_t; #define __QDF_IPA_CLIENT_WLAN3_CONS IPA_CLIENT_WLAN3_CONS #define __QDF_IPA_CLIENT_WLAN4_CONS IPA_CLIENT_WLAN4_CONS +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) +#define IPA_LAN_RX_NAPI_SUPPORT +#endif + /* * Resume / Suspend */ @@ -967,5 +972,16 @@ static bool __qdf_get_ipa_smmu_enabled(void) } #endif +#ifdef IPA_LAN_RX_NAPI_SUPPORT +/** + * ipa_get_lan_rx_napi() - Check if NAPI is enabled in LAN RX DP + * + * Returns: true if enabled, false otherwise + */ +static inline bool __qdf_ipa_get_lan_rx_napi(void) +{ + return ipa_get_lan_rx_napi(); +} +#endif /* IPA_LAN_RX_NAPI_SUPPORT */ #endif /* IPA_OFFLOAD */ #endif /* _I_QDF_IPA_H */