Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755194AbbKRIKr (ORCPT ); Wed, 18 Nov 2015 03:10:47 -0500 Received: from smtp-1b.atlantis.sk ([80.94.52.26]:44693 "EHLO smtp-1b.atlantis.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754688AbbKRIKp (ORCPT ); Wed, 18 Nov 2015 03:10:45 -0500 From: Ondrej Zary To: Francois Romieu Subject: Re: [PATCH 1/3] dl2k: Handle memory allocation errors in alloc_list Date: Wed, 18 Nov 2015 09:10:40 +0100 User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748) Cc: netdev@vger.kernel.org, David Miller , Kernel development list References: <1447781298-19785-1-git-send-email-linux@rainbow-software.org> <20151117225403.GA3362@electric-eye.fr.zoreil.com> In-Reply-To: <20151117225403.GA3362@electric-eye.fr.zoreil.com> X-KMail-QuotePrefix: > MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201511180910.40728.linux@rainbow-software.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1059 Lines: 30 On Tuesday 17 November 2015, Francois Romieu wrote: > Ondrej Zary : > > If memory allocation fails in alloc_list(), free the already allocated > > memory and return -ENODEV. In rio_open(), call alloc_list() first and > > abort if it fails. Move HW access (set RFDListPtr) out ot alloc_list(). > > > > Signed-off-by: Ondrej Zary > > ENODEV vs ENOMEM aside, it's ok with me. Will fix the description in v2. > The driver may avoid depleting the receive ring when > netdev_alloc_skb_ip_align fails in receive_packet (drop and increase > stats->rx_dropped). > > Then you may replace the pci_* dma helpers with the plain dma_* ones (they > can fail). > > And perform a plain napi conversion. NAPI is on the todo list. Thanks for suggestions. -- Ondrej Zary -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/