qcacmn: Strip hif_irq_afinity of duplicate logic
Leave the duplicate logic in hif_napi.c until more thorough cleanup can be done. Also clean up the HELIUMPLUS macro dependency. Change-Id: Idbfaacb3b74b358198691a288def07d454e17659 CRs-Fixed: 2051902
This commit is contained in:

committed by
snandini

parent
a0ecf33aa9
commit
b3497c0daf
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <hif_exec.h>
|
||||
#include <ce_main.h>
|
||||
#include <hif_irq_affinity.h>
|
||||
|
||||
|
||||
static void hif_exec_tasklet_schedule(struct hif_exec_context *ctx)
|
||||
@@ -101,11 +102,15 @@ static void hif_exec_napi_schedule(struct hif_exec_context *ctx)
|
||||
static void hif_exec_napi_kill(struct hif_exec_context *ctx)
|
||||
{
|
||||
struct hif_napi_exec_context *n_ctx = hif_exec_get_napi(ctx);
|
||||
int irq_ind;
|
||||
|
||||
if (ctx->inited) {
|
||||
napi_disable(&n_ctx->napi);
|
||||
ctx->inited = 0;
|
||||
}
|
||||
|
||||
for (irq_ind = 0; irq_ind < ctx->numirq; irq_ind++)
|
||||
hif_irq_affinity_remove(ctx->os_irq[irq_ind]);
|
||||
}
|
||||
|
||||
struct hif_execution_ops napi_sched_ops = {
|
||||
@@ -150,12 +155,16 @@ static struct hif_exec_context *hif_exec_napi_create(void)
|
||||
static void hif_exec_tasklet_kill(struct hif_exec_context *ctx)
|
||||
{
|
||||
struct hif_tasklet_exec_context *t_ctx = hif_exec_get_tasklet(ctx);
|
||||
int irq_ind;
|
||||
|
||||
if (ctx->inited) {
|
||||
tasklet_disable(&t_ctx->tasklet);
|
||||
tasklet_kill(&t_ctx->tasklet);
|
||||
}
|
||||
ctx->inited = false;
|
||||
|
||||
for (irq_ind = 0; irq_ind < ctx->numirq; irq_ind++)
|
||||
hif_irq_affinity_remove(ctx->os_irq[irq_ind]);
|
||||
}
|
||||
|
||||
struct hif_execution_ops tasklet_sched_ops = {
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -16,250 +16,49 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __HIF_NAPI_H__
|
||||
#define __HIF_NAPI_H__
|
||||
|
||||
/**
|
||||
* DOC: hif_napi.h
|
||||
*
|
||||
* Interface to HIF implemented functions of NAPI.
|
||||
* These are used by hdd_napi.
|
||||
*/
|
||||
#ifndef __HIF_IRQ_AFFINITY_H__
|
||||
#define __HIF_IRQ_AFFINITY_H__
|
||||
|
||||
#ifdef HIF_IRQ_AFFINITY
|
||||
#ifndef FEATURE_NAPI
|
||||
#error /*HIF_IRQ_AFFINITY currently relies on FEATURE_NAPI*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* CLD headers */
|
||||
#include <hif.h> /* struct hif_opaque_softc; */
|
||||
#include <hif_napi.h>
|
||||
struct hif_opaque_softc;
|
||||
enum qca_blacklist_op;
|
||||
|
||||
/**
|
||||
* common stuff
|
||||
* The declarations until #ifdef FEATURE_NAPI below
|
||||
* are valid whether or not FEATURE_NAPI has been
|
||||
* defined.
|
||||
*/
|
||||
int hif_exec_cpu_migrate(struct qca_napi_data *napid, int cpu, int action);
|
||||
|
||||
/**
|
||||
* NAPI manages the following states:
|
||||
* NAPI state: per NAPI instance, ENABLED/DISABLED
|
||||
* CPU state: per CPU, DOWN/UP
|
||||
* TPUT state: global, LOW/HI
|
||||
*
|
||||
* "Dynamic" changes to state of various NAPI structures are
|
||||
* managed by NAPI events. The events may be produced by
|
||||
* various detection points. With each event, some data is
|
||||
* sent. The main event handler in hif_napi handles and makes
|
||||
* the state changes.
|
||||
*
|
||||
* event : data : generated
|
||||
* ---------------:------------------:------------------
|
||||
* EVT_INI_FILE : cfg->napi_enable : after ini file processed
|
||||
* EVT_CMD_STATE : cmd arg : by the vendor cmd
|
||||
* EVT_INT_STATE : 0 : internal - shut off/disable
|
||||
* EVT_CPU_STATE : (cpu << 16)|state: CPU hotplug events
|
||||
* EVT_TPUT_STATE : (high/low) : tput trigger
|
||||
* EVT_USR_SERIAL : num-serial_calls : WMA/ROAMING-START/IND
|
||||
* EVT_USR_NORMAL : N/A : WMA/ROAMING-END
|
||||
*/
|
||||
enum qca_napi_event {
|
||||
NAPI_EVT_INVALID,
|
||||
NAPI_EVT_INI_FILE,
|
||||
NAPI_EVT_CMD_STATE,
|
||||
NAPI_EVT_INT_STATE,
|
||||
NAPI_EVT_CPU_STATE,
|
||||
NAPI_EVT_TPUT_STATE,
|
||||
NAPI_EVT_USR_SERIAL,
|
||||
NAPI_EVT_USR_NORMAL
|
||||
};
|
||||
/**
|
||||
* Following are some of NAPI related features controlled using feature flag
|
||||
* These flags need to be enabled in the qca_napi_data->flags variable for the
|
||||
* feature to kick in.
|
||||
.* QCA_NAPI_FEATURE_CPU_CORRECTION - controls CPU correction logic
|
||||
.* QCA_NAPI_FEATURE_IRQ_BLACKLISTING - controls call to irq_blacklist_on API
|
||||
.* QCA_NAPI_FEATURE_CORE_CTL_BOOST - controls call to core_ctl_set_boost API
|
||||
*/
|
||||
#define QCA_NAPI_FEATURE_CPU_CORRECTION BIT(1)
|
||||
#define QCA_NAPI_FEATURE_IRQ_BLACKLISTING BIT(2)
|
||||
#define QCA_NAPI_FEATURE_CORE_CTL_BOOST BIT(3)
|
||||
int hif_exec_cpu_blacklist(struct qca_napi_data *napid,
|
||||
enum qca_blacklist_op op);
|
||||
|
||||
/**
|
||||
* Macros to map ids -returned by ...create()- to pipes and vice versa
|
||||
*/
|
||||
#define NAPI_ID2PIPE(i) ((i)-1)
|
||||
#define NAPI_PIPE2ID(p) ((p)+1)
|
||||
|
||||
int hif_napi_lro_flush_cb_register(struct hif_opaque_softc *hif_hdl,
|
||||
void (lro_flush_handler)(void *arg),
|
||||
void *(lro_init_handler)(void));
|
||||
|
||||
void hif_napi_lro_flush_cb_deregister(struct hif_opaque_softc *hif_hdl,
|
||||
void (lro_deinit_cb)(void *arg));
|
||||
|
||||
void *hif_napi_get_lro_info(struct hif_opaque_softc *hif_hdl, int napi_id);
|
||||
#ifdef FEATURE_NAPI
|
||||
|
||||
/**
|
||||
* NAPI HIF API
|
||||
*
|
||||
* the declarations below only apply to the case
|
||||
* where FEATURE_NAPI is defined
|
||||
*/
|
||||
|
||||
int hif_napi_create(struct hif_opaque_softc *hif,
|
||||
int (*poll)(struct napi_struct *, int),
|
||||
int budget,
|
||||
int scale,
|
||||
uint8_t flags);
|
||||
int hif_napi_destroy(struct hif_opaque_softc *hif,
|
||||
uint8_t id,
|
||||
int force);
|
||||
|
||||
struct qca_napi_data *hif_napi_get_all(struct hif_opaque_softc *hif);
|
||||
|
||||
int hif_napi_event(struct hif_opaque_softc *hif,
|
||||
#ifdef HIF_IRQ_AFFINITY
|
||||
int hif_exec_event(struct hif_opaque_softc *hif,
|
||||
enum qca_napi_event event,
|
||||
void *data);
|
||||
|
||||
/* called from the ISR within hif, so, ce is known */
|
||||
int hif_napi_enabled(struct hif_opaque_softc *hif, int ce);
|
||||
|
||||
/* called from hdd (napi_poll), using napi id as a selector */
|
||||
void hif_napi_enable_irq(struct hif_opaque_softc *hif, int id);
|
||||
|
||||
/* called by ce_tasklet.c::ce_dispatch_interrupt*/
|
||||
int hif_napi_schedule(struct hif_opaque_softc *scn, int ce_id);
|
||||
|
||||
/* called by hdd_napi, which is called by kernel */
|
||||
int hif_napi_poll(struct hif_opaque_softc *hif_ctx,
|
||||
struct napi_struct *napi, int budget);
|
||||
#ifdef HELIUMPLUS
|
||||
/* called to retrieve NAPI CPU statistics */
|
||||
void hif_napi_stats(struct qca_napi_data *napid);
|
||||
void hif_napi_update_yield_stats(struct CE_state *ce_state,
|
||||
bool time_limit_reached,
|
||||
bool rxpkt_thresh_reached);
|
||||
/* hif_irq_affinity_remove() - remove affinity before freeing the irq
|
||||
* @os_irq: irq number to remove affinity from
|
||||
*/
|
||||
static inline void hif_irq_affinity_remove(int os_irq)
|
||||
{
|
||||
irq_set_affinity_hint(os_irq, NULL);
|
||||
}
|
||||
#else
|
||||
static inline void hif_napi_stats(struct qca_napi_data *napid) { }
|
||||
static inline void hif_irq_affinity_remove(int os_irq)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hif_napi_update_yield_stats(struct CE_state *ce_state,
|
||||
bool time_limit_reached,
|
||||
bool rxpkt_thresh_reached) { }
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_NAPI_DEBUG
|
||||
#define NAPI_DEBUG(fmt, ...) \
|
||||
qdf_print("wlan: NAPI: %s:%d "fmt, __func__, __LINE__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define NAPI_DEBUG(fmt, ...) /* NO-OP */
|
||||
#endif /* FEATURE NAPI_DEBUG */
|
||||
|
||||
#define HNC_ANY_CPU (-1)
|
||||
#define HNC_ACT_RELOCATE (0)
|
||||
#define HNC_ACT_COLLAPSE (1)
|
||||
#define HNC_ACT_DISPERSE (-1)
|
||||
|
||||
enum qca_blacklist_op {
|
||||
BLACKLIST_QUERY,
|
||||
BLACKLIST_OFF,
|
||||
BLACKLIST_ON
|
||||
};
|
||||
|
||||
int hif_napi_cpu_blacklist(struct qca_napi_data *napid,
|
||||
enum qca_blacklist_op op);
|
||||
/**
|
||||
* Local interface to HIF implemented functions of NAPI CPU affinity management.
|
||||
* Note:
|
||||
* 1- The symbols in this file are NOT supposed to be used by any
|
||||
* entity other than hif_napi.c
|
||||
* 2- The symbols are valid only if HELIUMPLUS is defined. They are otherwise
|
||||
* mere wrappers.
|
||||
*
|
||||
*/
|
||||
#ifndef HELIUMPLUS
|
||||
/**
|
||||
* stub functions
|
||||
*/
|
||||
/* fw-declare to make compiler happy */
|
||||
struct qca_napi_data;
|
||||
static inline int hif_napi_cpu_init(struct hif_opaque_softc *hif)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_cpu_deinit(struct hif_opaque_softc *hif)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on)
|
||||
{ return -EPERM; }
|
||||
#else /* HELIUMPLUS - NAPI CPU symbols are valid */
|
||||
|
||||
/*
|
||||
* prototype signatures
|
||||
*/
|
||||
int hif_napi_cpu_init(struct hif_opaque_softc *hif);
|
||||
int hif_napi_cpu_deinit(struct hif_opaque_softc *hif);
|
||||
|
||||
int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu, int action);
|
||||
int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on);
|
||||
|
||||
#endif /* HELIUMPLUS */
|
||||
|
||||
#else /* ! defined(FEATURE_NAPI) */
|
||||
|
||||
/**
|
||||
* Stub API
|
||||
*
|
||||
* The declarations in this section are valid only
|
||||
* when FEATURE_NAPI has *not* been defined.
|
||||
*/
|
||||
|
||||
#define NAPI_DEBUG(fmt, ...) /* NO-OP */
|
||||
|
||||
static inline int hif_napi_create(struct hif_opaque_softc *hif,
|
||||
uint8_t pipe_id,
|
||||
int (*poll)(struct napi_struct *, int),
|
||||
int budget,
|
||||
int scale,
|
||||
uint8_t flags)
|
||||
{ return -EPERM; }
|
||||
|
||||
static inline int hif_napi_destroy(struct hif_opaque_softc *hif,
|
||||
uint8_t id,
|
||||
int force)
|
||||
{ return -EPERM; }
|
||||
|
||||
static inline struct qca_napi_data *hif_napi_get_all(
|
||||
struct hif_opaque_softc *hif)
|
||||
{ return NULL; }
|
||||
|
||||
static inline int hif_napi_event(struct hif_opaque_softc *hif,
|
||||
static inline int hif_exec_event(struct hif_opaque_softc *hif,
|
||||
enum qca_napi_event event,
|
||||
void *data)
|
||||
{ return -EPERM; }
|
||||
|
||||
/* called from the ISR within hif, so, ce is known */
|
||||
static inline int hif_napi_enabled(struct hif_opaque_softc *hif, int ce)
|
||||
{ return 0; }
|
||||
|
||||
/* called from hdd (napi_poll), using napi id as a selector */
|
||||
static inline void hif_napi_enable_irq(struct hif_opaque_softc *hif, int id)
|
||||
{ return; }
|
||||
|
||||
static inline int hif_napi_schedule(struct hif_opaque_softc *hif, int ce_id)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_poll(struct napi_struct *napi, int budget)
|
||||
{ return -EPERM; }
|
||||
|
||||
static inline void hif_napi_stats(struct qca_napi_data *napid) { }
|
||||
static inline void hif_napi_update_yield_stats(struct CE_state *ce_state,
|
||||
bool time_limit_reached,
|
||||
bool rxpkt_thresh_reached) { }
|
||||
#endif /* FEATURE_NAPI */
|
||||
|
||||
static inline int hif_ext_napi_enabled(struct hif_opaque_softc *hif, int ce)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_schedule_grp(struct hif_opaque_softc *hif,
|
||||
uint32_t grp_id)
|
||||
{ return 0; }
|
||||
|
||||
#endif /* __HIF_NAPI_H__ */
|
||||
{
|
||||
return -EPERM;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -40,12 +40,10 @@
|
||||
#include <linux/topology.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#ifdef HELIUMPLUS
|
||||
#ifdef CONFIG_SCHED_CORE_CTL
|
||||
#include <linux/sched/core_ctl.h>
|
||||
#endif
|
||||
#include <pld_snoc.h>
|
||||
#endif
|
||||
#include <pld_common.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
/* Driver headers */
|
||||
@@ -54,6 +52,7 @@
|
||||
#include <hif_io32.h>
|
||||
#include <ce_api.h>
|
||||
#include <ce_internal.h>
|
||||
#include <hif_irq_affinity.h>
|
||||
|
||||
enum napi_decision_vector {
|
||||
HIF_NAPI_NOEVENT = 0,
|
||||
@@ -62,29 +61,6 @@ enum napi_decision_vector {
|
||||
};
|
||||
#define ENABLE_NAPI_MASK (HIF_NAPI_INITED | HIF_NAPI_CONF_UP)
|
||||
|
||||
#ifdef HELIUMPLUS
|
||||
static inline int hif_get_irq_for_ce(int ce_id)
|
||||
{
|
||||
return pld_snoc_get_irq(ce_id);
|
||||
}
|
||||
#else /* HELIUMPLUS */
|
||||
static inline int hif_get_irq_for_ce(int ce_id)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
static int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu,
|
||||
int action)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hif_napi_cpu_blacklist(struct qca_napi_data *napid,
|
||||
enum qca_blacklist_op op)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* HELIUMPLUS */
|
||||
|
||||
/**
|
||||
* hif_napi_create() - creates the NAPI structures for a given CE
|
||||
* @hif : pointer to hif context
|
||||
@@ -135,11 +111,12 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx,
|
||||
napid->flags = flags;
|
||||
|
||||
rc = hif_napi_cpu_init(hif_ctx);
|
||||
if (rc != 0) {
|
||||
if (rc != 0 && rc != -EALREADY) {
|
||||
HIF_ERROR("NAPI_initialization failed,. %d", rc);
|
||||
rc = napid->ce_map;
|
||||
goto hnc_err;
|
||||
}
|
||||
} else
|
||||
rc = 0;
|
||||
|
||||
HIF_DBG("%s: NAPI structures initialized, rc=%d",
|
||||
__func__, rc);
|
||||
@@ -149,6 +126,9 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx,
|
||||
NAPI_DEBUG("ce %d: htt_rx=%d htt_tx=%d",
|
||||
i, ce_state->htt_rx_data,
|
||||
ce_state->htt_tx_data);
|
||||
if (ce_srng_based(hif))
|
||||
continue;
|
||||
|
||||
if (!ce_state->htt_rx_data)
|
||||
continue;
|
||||
|
||||
@@ -173,7 +153,7 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx,
|
||||
napii->scale = scale;
|
||||
napii->id = NAPI_PIPE2ID(i);
|
||||
napii->hif_ctx = hif_ctx;
|
||||
napii->irq = hif_get_irq_for_ce(i);
|
||||
napii->irq = pld_get_irq(hif->qdf_dev->dev, i);
|
||||
|
||||
if (napii->irq < 0)
|
||||
HIF_WARN("%s: bad IRQ value for CE %d: %d",
|
||||
@@ -207,6 +187,13 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx,
|
||||
HIF_DBG("%s: NAPI id %d created for pipe %d", __func__,
|
||||
napii->id, i);
|
||||
}
|
||||
|
||||
/* no ces registered with the napi */
|
||||
if (!ce_srng_based(hif) && napid->ce_map == 0) {
|
||||
HIF_WARN("%s: no napis created for copy engines", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
NAPI_DEBUG("napi map = %x", napid->ce_map);
|
||||
NAPI_DEBUG("NAPI ids created for all applicable pipes");
|
||||
return napid->ce_map;
|
||||
@@ -435,6 +422,9 @@ int hif_napi_event(struct hif_opaque_softc *hif_ctx, enum qca_napi_event event,
|
||||
|
||||
NAPI_DEBUG("%s: -->(event=%d, aux=%p)", __func__, event, data);
|
||||
|
||||
if (ce_srng_based(hif))
|
||||
return hif_exec_event(hif_ctx, event, data);
|
||||
|
||||
if ((napid->state & HIF_NAPI_INITED) == 0) {
|
||||
NAPI_DEBUG("%s: got event when NAPI not initialized",
|
||||
__func__);
|
||||
@@ -850,7 +840,7 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifdef HELIUMPLUS
|
||||
#ifdef HIF_IRQ_AFFINITY
|
||||
/**
|
||||
*
|
||||
* hif_napi_update_yield_stats() - update NAPI yield related stats
|
||||
@@ -1183,6 +1173,19 @@ static int hnc_tput_hook(int install)
|
||||
* Implementation of hif_napi_cpu API
|
||||
*/
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
static inline void record_sibling_cpumask(struct qca_napi_cpu *cpus, int i)
|
||||
{
|
||||
cpumask_copy(&(cpus[i].thread_mask),
|
||||
topology_sibling_cpumask(i));
|
||||
}
|
||||
#else
|
||||
static inline void record_sibling_cpumask(struct qca_napi_cpu *cpus, int i)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* hif_napi_cpu_init() - initialization of irq affinity block
|
||||
* @ctx: pointer to qca_napi_data
|
||||
@@ -1220,8 +1223,7 @@ int hif_napi_cpu_init(struct hif_opaque_softc *hif)
|
||||
cpus[i].cluster_id = topology_physical_package_id(i);
|
||||
cpumask_copy(&(cpus[i].core_mask),
|
||||
topology_core_cpumask(i));
|
||||
cpumask_copy(&(cpus[i].thread_mask),
|
||||
topology_sibling_cpumask(i));
|
||||
record_sibling_cpumask(cpus, i);
|
||||
cpus[i].max_freq = cpufreq_quick_get_max(i);
|
||||
cpus[i].napis = 0x0;
|
||||
cpus[i].cluster_nxt = -1; /* invalid */
|
||||
@@ -1618,4 +1620,4 @@ int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on)
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif /* ifdef HELIUMPLUS */
|
||||
#endif /* ifdef HIF_IRQ_AFFINITY */
|
||||
|
@@ -133,20 +133,6 @@ int hif_napi_schedule(struct hif_opaque_softc *scn, int ce_id);
|
||||
/* called by hdd_napi, which is called by kernel */
|
||||
int hif_napi_poll(struct hif_opaque_softc *hif_ctx,
|
||||
struct napi_struct *napi, int budget);
|
||||
#ifdef HELIUMPLUS
|
||||
/* called to retrieve NAPI CPU statistics */
|
||||
void hif_napi_stats(struct qca_napi_data *napid);
|
||||
void hif_napi_update_yield_stats(struct CE_state *ce_state,
|
||||
bool time_limit_reached,
|
||||
bool rxpkt_thresh_reached);
|
||||
#else
|
||||
static inline void hif_napi_stats(struct qca_napi_data *napid) { }
|
||||
|
||||
static inline void hif_napi_update_yield_stats(struct CE_state *ce_state,
|
||||
bool time_limit_reached,
|
||||
bool rxpkt_thresh_reached) { }
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_NAPI_DEBUG
|
||||
#define NAPI_DEBUG(fmt, ...) \
|
||||
@@ -166,8 +152,6 @@ enum qca_blacklist_op {
|
||||
BLACKLIST_ON
|
||||
};
|
||||
|
||||
int hif_napi_cpu_blacklist(struct qca_napi_data *napid,
|
||||
enum qca_blacklist_op op);
|
||||
/**
|
||||
* Local interface to HIF implemented functions of NAPI CPU affinity management.
|
||||
* Note:
|
||||
@@ -177,32 +161,6 @@ int hif_napi_cpu_blacklist(struct qca_napi_data *napid,
|
||||
* mere wrappers.
|
||||
*
|
||||
*/
|
||||
#ifndef HELIUMPLUS
|
||||
/**
|
||||
* stub functions
|
||||
*/
|
||||
/* fw-declare to make compiler happy */
|
||||
struct qca_napi_data;
|
||||
static inline int hif_napi_cpu_init(struct hif_opaque_softc *hif)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_cpu_deinit(struct hif_opaque_softc *hif)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on)
|
||||
{ return -EPERM; }
|
||||
#else /* HELIUMPLUS - NAPI CPU symbols are valid */
|
||||
|
||||
/*
|
||||
* prototype signatures
|
||||
*/
|
||||
int hif_napi_cpu_init(struct hif_opaque_softc *hif);
|
||||
int hif_napi_cpu_deinit(struct hif_opaque_softc *hif);
|
||||
|
||||
int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu, int action);
|
||||
int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on);
|
||||
|
||||
#endif /* HELIUMPLUS */
|
||||
|
||||
#else /* ! defined(FEATURE_NAPI) */
|
||||
|
||||
@@ -215,6 +173,15 @@ int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on);
|
||||
|
||||
#define NAPI_DEBUG(fmt, ...) /* NO-OP */
|
||||
|
||||
static inline int hif_napi_cpu_init(struct hif_opaque_softc *hif)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int hif_napi_cpu_deinit(struct hif_opaque_softc *hif)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int hif_napi_create(struct hif_opaque_softc *hif,
|
||||
uint8_t pipe_id,
|
||||
int (*poll)(struct napi_struct *, int),
|
||||
@@ -251,17 +218,49 @@ static inline int hif_napi_schedule(struct hif_opaque_softc *hif, int ce_id)
|
||||
static inline int hif_napi_poll(struct napi_struct *napi, int budget)
|
||||
{ return -EPERM; }
|
||||
|
||||
#endif /* FEATURE_NAPI */
|
||||
|
||||
#if defined(HIF_IRQ_AFFINITY) && defined(FEATURE_NAPI)
|
||||
/*
|
||||
* prototype signatures
|
||||
*/
|
||||
int hif_napi_cpu_init(struct hif_opaque_softc *hif);
|
||||
int hif_napi_cpu_deinit(struct hif_opaque_softc *hif);
|
||||
|
||||
int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu, int action);
|
||||
int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on);
|
||||
|
||||
int hif_napi_cpu_blacklist(struct qca_napi_data *napid,
|
||||
enum qca_blacklist_op op);
|
||||
|
||||
/* not directly related to irq affinity, but oh well */
|
||||
void hif_napi_stats(struct qca_napi_data *napid);
|
||||
void hif_napi_update_yield_stats(struct CE_state *ce_state,
|
||||
bool time_limit_reached,
|
||||
bool rxpkt_thresh_reached);
|
||||
#else
|
||||
struct qca_napi_data;
|
||||
static inline int hif_napi_cpu_init(struct hif_opaque_softc *hif)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_cpu_deinit(struct hif_opaque_softc *hif)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu,
|
||||
int action)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_serialize(struct hif_opaque_softc *hif, int is_on)
|
||||
{ return -EPERM; }
|
||||
|
||||
static inline void hif_napi_stats(struct qca_napi_data *napid) { }
|
||||
static inline void hif_napi_update_yield_stats(struct CE_state *ce_state,
|
||||
bool time_limit_reached,
|
||||
bool rxpkt_thresh_reached) { }
|
||||
#endif /* FEATURE_NAPI */
|
||||
|
||||
static inline int hif_ext_napi_enabled(struct hif_opaque_softc *hif, int ce)
|
||||
{ return 0; }
|
||||
|
||||
static inline int hif_napi_schedule_grp(struct hif_opaque_softc *hif,
|
||||
uint32_t grp_id)
|
||||
static inline int hif_napi_cpu_blacklist(struct qca_napi_data *napid,
|
||||
enum qca_blacklist_op op)
|
||||
{ return 0; }
|
||||
#endif /* HIF_IRQ_AFFINITY */
|
||||
|
||||
#endif /* __HIF_NAPI_H__ */
|
||||
|
@@ -211,6 +211,11 @@ static inline void pld_get_msi_address(struct device *dev,
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int pld_get_irq(struct device *dev, int ce_id)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int pld_ce_request_irq(struct device *dev, unsigned int ce_id,
|
||||
irqreturn_t (*handler)(int, void *),
|
||||
unsigned long flags, const char *name,
|
||||
|
Reference in New Issue
Block a user