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

Eric Dumazet eric.dumazet at gmail.com
Thu Jan 24 08:56:08 EST 2013


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

> +			/* 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()






More information about the linux-arm-kernel mailing list