From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] The VMXNET3 PMD can't receive packet suddenly after a lot of traffic coming in Date: Thu, 23 Jul 2015 09:49:13 -0700 Message-ID: <20150723094913.27cc335f@urahara> References: <1437641492-7622-1-git-send-email-mac_leehk@yahoo.com.hk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Marco Lee Return-path: Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 05AE6C3A8 for ; Thu, 23 Jul 2015 18:49:07 +0200 (CEST) Received: by pdbbh15 with SMTP id bh15so114216961pdb.1 for ; Thu, 23 Jul 2015 09:49:06 -0700 (PDT) In-Reply-To: <1437641492-7622-1-git-send-email-mac_leehk@yahoo.com.hk> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 23 Jul 2015 16:51:32 +0800 Marco Lee wrote: > The RX of VMXNET3 PMD will have deadlock when a lot of traffic coming in. > The root cause is due to mbuf allocation fail in vmxnet3_post_rx_bufs() and there is no error handling when it is called > from vmxnet3_recv_pkts(). The RXD will not have "free" mbuf for it but the counter still increment. > Finally, no packet can be received. > > This fix is allocate the mbuf first, if the allocation is failed, then reuse the old mbuf > If the allocation is sucess, the vmxnet3_post_rx_bufs() will call vmxnet3_renew_desc() > and RXD will be renew inside. > > Signed-off-by: Marco Lee Much better. I ran this patch through checkpatch and the following things should be fixed. WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #69: The root cause is due to mbuf allocation fail in vmxnet3_post_rx_bufs() and there is no error handling when it is called WARNING: 'sucess' may be misspelled - perhaps 'success'? #74: If the allocation is sucess, the vmxnet3_post_rx_bufs() will call vmxnet3_renew_desc() WARNING: line over 80 characters #91: FILE: drivers/net/vmxnet3/vmxnet3_rxtx.c:425: +vmxnet3_renew_desc(vmxnet3_rx_queue_t *rxq, uint8_t ring_id,struct rte_mbuf *mbuf) ERROR: space required after that ',' (ctx:VxV) #91: FILE: drivers/net/vmxnet3/vmxnet3_rxtx.c:425: +vmxnet3_renew_desc(vmxnet3_rx_queue_t *rxq, uint8_t ring_id,struct rte_mbuf *mbuf) ^ WARNING: braces {} are not necessary for any arm of this statement #101: FILE: drivers/net/vmxnet3/vmxnet3_rxtx.c:435: + if (ring->rid == 0) { [...] + } else { [...] ERROR: space required after that ',' (ctx:VxV) #145: FILE: drivers/net/vmxnet3/vmxnet3_rxtx.c:694: + vmxnet3_renew_desc(rxq, ring_idx,rep); ^