LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2019, 12:38 PM   #1
shaikh.kamal
LQ Newbie
 
Registered: Jun 2019
Posts: 2

Rep: Reputation: Disabled
napi_schedule() is not triggering napi poll in hrtimer callback handler


I'm scheduling the napi from the hrtimer callback handler.
Please find below code snippet.
In init function:
registering napi poll-->
netif_napi_add(netdev, &port->napi, napi_poll,2);



static enum hrtimer_restart gmac_delay_expired(struct hrtimer *timer)
{
struct gemini_ethernet_port *port =
container_of(timer, struct gemini_ethernet_port,
rx_coalesce_timer);

napi_schedule(&port->napi);
hrtimer_forward_now(timer, 100);
return HRTIMER_RESTART;
}


hrtimer_init(&port->timer,LOCK_MONOTONIC,HRTIMER_MODE_REL);
port->timer.function = &gmac_delay_expired;
hrtimer_start(&port->timer,port->timer_interval,HRTIMER_MODE_REL);


timer handler keep polling at 100ms, but not able to call napi_poll.

Please suggest on this.
 
Old 06-30-2019, 09:19 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,810

Rep: Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771
Quote:
Originally Posted by shaikh.kamal View Post
I'm scheduling the napi from the hrtimer callback handler.
Please find below code snippet.
In init function:
[CODE]
registering napi poll-->
netif_napi_add(netdev, &port->napi, napi_poll,2);

static enum hrtimer_restart gmac_delay_expired(struct hrtimer *timer)
{
struct gemini_ethernet_port *port =
container_of(timer, struct gemini_ethernet_port,
rx_coalesce_timer);

napi_schedule(&port->napi);
hrtimer_forward_now(timer, 100);
return HRTIMER_RESTART;
}
hrtimer_init(&port->timer,LOCK_MONOTONIC,HRTIMER_MODE_REL);
port->timer.function = &gmac_delay_expired;
hrtimer_start(&port->timer,port->timer_interval,HRTIMER_MODE_REL);[CODE]
timer handler keep polling at 100ms, but not able to call napi_poll. Please suggest on this.
Based on the VERY little you've told us and posted, the best we can suggest is "your code is broken somewhere; debug it and fix it".

We have no idea what's going on in the rest of your code, any ideas about your Linux system, or what you're trying to accomplish. Based on the lack of details, there's nothing we can even guess at.
 
1 members found this post helpful.
Old 07-09-2019, 12:13 PM   #3
shaikh.kamal
LQ Newbie
 
Registered: Jun 2019
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Based on the VERY little you've told us and posted, the best we can suggest is "your code is broken somewhere; debug it and fix it".

We have no idea what's going on in the rest of your code, any ideas about your Linux system, or what you're trying to accomplish. Based on the lack of details, there's nothing we can even guess at.
0


I have set an HR Timer for given xx ms time interval. The timer tick handler works fine enough. But the issue that I am facing right now is to invoke NAPI poll at every timer tick handler event. At the interval elapsed event, I have called napi_schedule(napi). This simply does not trigger napi poll scheduling the napi_schedule()--> it should call my NAPI poll callback function which is registered in netif_napi_add(,,napi_poll, weight)

Please check this link has similar issue:
https://lists.osuosl.org/pipermail/i...04/009966.html
 
Old 07-09-2019, 12:25 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,810

Rep: Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771Reputation: 5771
Quote:
Originally Posted by shaikh.kamal View Post
I have set an HR Timer for given xx ms time interval. The timer tick handler works fine enough. But the issue that I am facing right now is to invoke NAPI poll at every timer tick handler event. At the interval elapsed event, I have called napi_schedule(napi). This simply does not trigger napi poll scheduling the napi_schedule()--> it should call my NAPI poll callback function which is registered in netif_napi_add(,,napi_poll, weight)
Again; you tell us nothing about your system, or show us the rest of the code. Based on the lack of information, there is nothing we can tell you.
Quote:
Please check this link has similar issue:
https://lists.osuosl.org/pipermail/i...04/009966.html
No. Not going to chase down links; either post things here to receive assistance here, or post your questions in that other forum.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hrtimer Source on ARM architecture using SMP gaurav87 Linux - Embedded & Single-board computer 0 11-09-2012 02:19 AM
HRTIMER issue in kernel module smrithytr Linux - Newbie 1 06-13-2012 09:00 PM
hrtimer dennisdd Programming 22 05-16-2012 10:30 PM
query ..napi and non-napi compatibilty in tg3 ethernet driver for kernel 2.6.28 sarvesh Linux - Kernel 1 04-14-2010 07:19 PM
query ..napi and non-napi compatibilty in tg3 ethernet driver for kernel 2.6.28 sarvesh Linux - Networking 0 04-08-2010 11:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration