lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1462286566.17746.1.camel@pengutronix.de>
Date:	Tue, 03 May 2016 16:42:46 +0200
From:	Lucas Stach <l.stach@...gutronix.de>
To:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
Cc:	Fugang Duan <fugang.duan@....com>,
	"David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	kernel@...gutronix.de
Subject: Re: [PATCH] net: fec: only clear a queue's work bit if the queue
 was emptied

Am Dienstag, den 03.05.2016, 16:38 +0200 schrieb Uwe Kleine-König:
> In the receive path a queue's work bit was cleared unconditionally even
> if fec_enet_rx_queue only read out a part of the available packets from
> the hardware. This resulted in not reading any packets in the next napi
> turn and so packets were delayed or lost.
> 
> The obvious fix is to only clear a queue's bit when the queue was
> emptied.
> 
> Fixes: 4d494cdc92b3 ("net: fec: change data structure to support multiqueue")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>

Reviewed-by: Lucas Stach <l.stach@...gutronix.de>

> ---
> Hello,
> 
> I created this patch against net/master. If you think it's to late to
> get it into 4.6 and it doesn't fit on net-next/master, just tell me and
> I will rebase.
> 
> Best regards
> Uwe
> 
> 
>  drivers/net/ethernet/freescale/fec_main.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 08243c2ff4b4..2a03857cca18 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1521,9 +1521,15 @@ fec_enet_rx(struct net_device *ndev, int budget)
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  
>  	for_each_set_bit(queue_id, &fep->work_rx, FEC_ENET_MAX_RX_QS) {
> -		clear_bit(queue_id, &fep->work_rx);
> -		pkt_received += fec_enet_rx_queue(ndev,
> +		int ret;
> +
> +		ret = fec_enet_rx_queue(ndev,
>  					budget - pkt_received, queue_id);
> +
> +		if (ret < budget - pkt_received)
> +			clear_bit(queue_id, &fep->work_rx);
> +
> +		pkt_received += ret;
>  	}
>  	return pkt_received;
>  }


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ