From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=OYecqvvkVgkB1yltew3EuclJcY2Pl+C4nDu4EvfmxnI=; b=ePb9m+keLSw1VDWZl8bbkFLf9/aJhj+omvkrCt0l/V5kvo+CmDySyBqDglIdssd/yV zLid612YEacBVABzmHX9OgN7Xs5hQpS3O8mNCNCdJ4B7T5VamZPlo65KEMBaOdshn7vq gkLyvLV2/puXGATKsSEypU+xLy4IwbSOpnZYGxqtFcDZ1ZH7HkowaeAQvvFc+6UQ1lti 5wenpZFJm/zGfltE5M5hDdg9O4XlWJcbvNWhyl7gse2V/211Z7CfvU6BSD/kaROSA1XD 0fIwtVAmmWD8+SQOiQZIa6gBKKYFqrwdk6YY3SIIftaYgGN/P9RKuAKVQgipAh/O4G8c nB1w== X-Gm-Message-State: ALoCoQnyaaNretdCQmZFTmVXNKUlM1SibSZjiiPMVGgC9asBici9tk6xDo72t6qVK2WD8+W0aXz4 X-Received: by 10.70.34.38 with SMTP id w6mr20338033pdi.147.1437670146339; Thu, 23 Jul 2015 09:49:06 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id so5sm9972709pab.37.2015.07.23.09.49.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2015 09:49:05 -0700 (PDT) Date: Thu, 23 Jul 2015 09:49:13 -0700 From: Stephen Hemminger To: Marco Lee Message-ID: <20150723094913.27cc335f@urahara> In-Reply-To: <1437641492-7622-1-git-send-email-mac_leehk@yahoo.com.hk> 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 Subject: Re: [dpdk-dev] [PATCH] The VMXNET3 PMD can't receive packet suddenly after a lot of traffic coming in X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 16:49:07 -0000 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); ^