net: Change the current NAPI context to use latest API
Commit47405a253d
("percpu: Remove __this_cpu_ptr") and commit6c51ec4d18
("percpu: remove __get_cpu_var and __raw_get_cpu_var macros") removed __this_cpu_ptr which is needed to access current NAPI. Use this_cpu_ptr instead. Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
parent
09a36c1368
commit
0dc9f20694
1 changed files with 5 additions and 4 deletions
|
@ -4620,7 +4620,7 @@ EXPORT_SYMBOL(__napi_schedule_irqoff);
|
|||
|
||||
void __napi_complete(struct napi_struct *n)
|
||||
{
|
||||
struct softnet_data *sd = &__get_cpu_var(softnet_data);
|
||||
struct softnet_data *sd = this_cpu_ptr(&softnet_data);
|
||||
|
||||
BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state));
|
||||
|
||||
|
@ -4779,17 +4779,16 @@ void netif_napi_del(struct napi_struct *napi)
|
|||
}
|
||||
EXPORT_SYMBOL(netif_napi_del);
|
||||
|
||||
static int napi_poll(struct napi_struct *n, struct list_head *repoll)
|
||||
|
||||
struct napi_struct *get_current_napi_context(void)
|
||||
{
|
||||
struct softnet_data *sd = &__get_cpu_var(softnet_data);
|
||||
struct softnet_data *sd = this_cpu_ptr(&softnet_data);
|
||||
|
||||
return sd->current_napi;
|
||||
}
|
||||
EXPORT_SYMBOL(get_current_napi_context);
|
||||
|
||||
static void net_rx_action(struct softirq_action *h)
|
||||
static int napi_poll(struct napi_struct *n, struct list_head *repoll)
|
||||
{
|
||||
void *have;
|
||||
int work, weight;
|
||||
|
@ -4808,6 +4807,8 @@ static void net_rx_action(struct softirq_action *h)
|
|||
*/
|
||||
work = 0;
|
||||
if (test_bit(NAPI_STATE_SCHED, &n->state)) {
|
||||
struct softnet_data *sd = this_cpu_ptr(&softnet_data);
|
||||
|
||||
sd->current_napi = n;
|
||||
work = n->poll(n, weight);
|
||||
trace_napi_poll(n);
|
||||
|
|
Loading…
Add table
Reference in a new issue