[PATCH v2 1/1 net-next] net: fec: add napi support to improve proformance

Frank Li lznuaa at gmail.com
Thu Jan 24 21:02:09 EST 2013


2013/1/24 Eric Dumazet <eric.dumazet at gmail.com>:
> On Thu, 2013-01-24 at 15:58 +0800, Frank Li wrote:
>>
>>  static irqreturn_t
>> @@ -805,6 +823,7 @@ fec_enet_interrupt(int irq, void *dev_id)
>>       struct net_device *ndev = dev_id;
>>       struct fec_enet_private *fep = netdev_priv(ndev);
>>       uint int_events;
>> +     ulong flags;
>>       irqreturn_t ret = IRQ_NONE;
>>
>>       do {
>> @@ -813,7 +832,14 @@ fec_enet_interrupt(int irq, void *dev_id)
>>
>>               if (int_events & FEC_ENET_RXF) {
>>                       ret = IRQ_HANDLED;
>> -                     fec_enet_rx(ndev);
>> +
>> +                     spin_lock_irqsave(&fep->hw_lock, flags);
>
> You already are in a irq safe context, spin_lock() should be ok

Okay, I will fix it.

>
>> +                     /* Disable the RX interrupt */
>> +                     if (napi_schedule_prep(&fep->napi)) {
>> +                             fec_enet_rx_int_is_enabled(ndev, false);
>> +                             __napi_schedule(&fep->napi);
>> +                     }
>> +                     spin_unlock_irqrestore(&fep->hw_lock, flags);
>
>        spin_unlock();
>
>>               }
>>
>
>
> Same remark for the spin_lock_irqsave(&fep->tmreg_lock, flags) in
> fec_enet_tx()
>

Okay, but it is not related with NAPI support.
Need new patch for that.

>
>



More information about the linux-arm-kernel mailing list