RE: [GIT]: Networking

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Eric Dumazet <eric.dumazet@...>
Cc: David Miller <davem@...>, netdev@vger.kernel.org <netdev@...>
Date: Thursday, July 2, 2009 - 9:11 pm

Our hw only runs on architectures that provide coherency. i.e x86

I'm fine with keeping it with both napi_schedule_prep() and __napi_schedule() if you want it to be similar to other drivers.

Thanks!
________________________________________
From: Eric Dumazet [eric.dumazet@gmail.com]
Sent: Thursday, July 02, 2009 5:07 PM
To: Ayaz Abdulla
Cc: David Miller; netdev@vger.kernel.org
Subject: Re: [GIT]: Networking

Ayaz Abdulla a écrit :

Sorry, I dont get it. You are referring to softirqs, while I speak
of hardware (NIC) interrupts, that can be masked for ever.

With your patch :

CPU0                                     CPU1
napi_complete();
/* please note there is no smp_wmb()
   in __napi_complete() after
   clear_bit(NAPI_STATE_SCHED, &n->state);
   (It's implied on x86 because of lock prefix)
*/
writel(np->irqmask, base + NvRegIrqMask)
                                         writel(0, base + NvRegIrqMask);
                                         napi_schedule(&np->napi); // might do nothing because this cpu see
                                                                   // NAPI_STATE_SCHED set to one

NIC cannot deliver further interrupts.


With my patch :

CPU0                                     CPU1
napi_complete();
/* please note there is no smp_wmb()
   in __napi_complete() after
   clear_bit(NAPI_STATE_SCHED, &n->state);
*/
writel(np->irqmask, base + NvRegIrqMask)
                                          if (napi_schedule_prep(&np->napi)) // if false, NIC can deliver further interrupts.
                                                // if true, we mask interrupts but re-enable napi. packets will be processed,
                                                // interrupt will be re-enabled later.


My patch has a guarantee that we mask NIC interrupts *only* if napi is re-scheduled.

It probably makes no difference on x86, but it might be better to have same logic in all drivers...
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH net-2.6 6/7] jme: Tuning rxsum function, Guo-Fu Tseng, (Tue Jun 30, 5:14 pm)
[GIT]: Networking, David Miller, (Wed Jul 1, 12:39 am)
Re: [GIT]: Networking, Ingo Molnar, (Thu Jul 2, 3:57 am)
Re: [GIT]: Networking, Eric Dumazet, (Thu Jul 2, 6:51 am)
Re: [GIT]: Networking, Eric Dumazet, (Thu Jul 2, 10:04 am)
Re: [GIT]: Networking, Ayaz Abdulla, (Thu Jul 2, 12:13 pm)
Re: [GIT]: Networking, Eric Dumazet, (Thu Jul 2, 6:32 pm)
Re: [GIT]: Networking, Ayaz Abdulla, (Thu Jul 2, 1:29 pm)
Re: [GIT]: Networking, David Miller, (Thu Jul 2, 9:32 pm)
Re: [GIT]: Networking, Eric Dumazet, (Thu Jul 2, 8:07 pm)
RE: [GIT]: Networking, Ayaz Abdulla, (Thu Jul 2, 9:11 pm)
Re: [GIT]: Networking, David Miller, (Thu Jul 2, 9:30 pm)
Re: [GIT]: Networking, Ingo Molnar, (Thu Jul 2, 4:05 pm)
Re: [GIT]: Networking, Ingo Molnar, (Fri Jul 3, 5:46 pm)
Re: [GIT]: Networking, David Miller, (Sun Jul 5, 10:04 pm)
Re: [GIT]: Networking, Herbert Xu, (Sun Jul 5, 12:09 am)