From patchwork Thu Oct 27 06:15:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Qiu X-Patchwork-Id: 687460 X-Patchwork-Delegate: diproiettod@vmware.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3t4GyD6y81z9sCZ for ; Thu, 27 Oct 2016 17:22:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=wt/o7IPi; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 36D46101D5; Wed, 26 Oct 2016 23:22:12 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 1E987101D5 for ; Wed, 26 Oct 2016 23:22:11 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id A77654201DD for ; Thu, 27 Oct 2016 00:22:10 -0600 (MDT) X-ASG-Debug-ID: 1477549330-09eadd4cc7241ba0001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id 26s1huam8NLs4thq (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 27 Oct 2016 00:22:10 -0600 (MDT) X-Barracuda-Envelope-From: qdy220091330@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-pf0-f194.google.com) (209.85.192.194) by mx3-pf2.cudamail.com with ESMTPS (AES128-SHA encrypted); 27 Oct 2016 06:22:09 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.194 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.192.194 X-Barracuda-RBL-IP: 209.85.192.194 Received: by mail-pf0-f194.google.com with SMTP id s8so1648130pfj.2 for ; Wed, 26 Oct 2016 23:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=el5PQviGgYqpHBoWAY2tha2rokPjMRxvRq5yT7b+2Ts=; b=wt/o7IPis3vEN5IocRpaxqboWc7vV5liPVtNPB2CguZoFEKqmvQTa3bPuZbHc+8LUA a0KD31kGqXZUGDwjfb0QZhg/iOZOIK0aGBz5JszngJ4eJdNdDRY1DO6/+n0wlZs0ljR3 8jtPfehPUK//nd8rF4RtOB5UB3Us52IO0cUDfMl0iQjuGE11dosykG9t16i7vd4Ntk2h Mk+7BqW0fYdauVgbrVzXSEfOUKsVWRH9sh/xef9t/zzwnQ5MfNH2Mj7NazbPDHYsSUn9 4hWefM0Hdbzux96W7dcI7VsPgQNkaQLZjPMQORBeVfI+detbW6Q59VXHgzkF5Pm6z6Us AScA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=el5PQviGgYqpHBoWAY2tha2rokPjMRxvRq5yT7b+2Ts=; b=LBQQgoOvUYqsY3KRMm7myGvezU7xSXPMQQSmlU5i0PI8j35O1d3nZGZf838PsJYR3G jannNYjYrTqgL4nwiIDgWFRcwitoRJk97pKwqVwc2zT+vN8D801tJwB66ehCcj4QIz1e z1erpozSSPKPs09YoEfgkMpMCddI9IEFlBXo8kB+JKZA8y6Lar3XqcjWYrRE50+7ugIJ 9sgf3fjUw0FO0Vii5r3K5yrOzikE0v6ofxV+B/XbT/Ih/3Ifxe030fI0cE4htnkKcH6L iBOC1rGeOKzNf0PNX9yIuR2SdUqwT5LLGJFYJh8JfCKOXVjDth3M70JKTn6uWg/v439b h7Qg== X-Gm-Message-State: ABUngvez0+6xkTwxIqVkgw3HccOyk05DXSjZv29n4AaQXEXWXc6Ju3/9IFZmwTCcXfnMxA== X-Received: by 10.98.53.199 with SMTP id c190mr2327050pfa.63.1477549328964; Wed, 26 Oct 2016 23:22:08 -0700 (PDT) Received: from localhost.localdomain ([67.229.141.125]) by smtp.gmail.com with ESMTPSA id 141sm8410079pfw.63.2016.10.26.23.22.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Oct 2016 23:22:08 -0700 (PDT) X-CudaMail-Envelope-Sender: qdy220091330@gmail.com From: Michael Qiu X-Google-Original-From: Michael Qiu To: dev@openvswitch.org X-CudaMail-MID: CM-V2-1026000197 X-CudaMail-DTE: 102716 X-CudaMail-Originating-IP: 209.85.192.194 Date: Thu, 27 Oct 2016 14:15:20 +0800 X-ASG-Orig-Subj: [##CM-V2-1026000197##][PATCH 1/5] lib/dp-packet: init the mbuf to zero when build with DPDK Message-Id: <1477548924-26376-2-git-send-email-qiudayu@chinac.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477548924-26376-1-git-send-email-qiudayu@chinac.com> References: <1477548924-26376-1-git-send-email-qiudayu@chinac.com> X-GBUdb-Analysis: 0, 209.85.192.194, Ugly c=0.291963 p=-0.176471 Source Normal X-MessageSniffer-Rules: 0-0-0-4707-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1477549330 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.34084 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Jijiang Liu , kevin.traynor@intel.com, Michael Qiu Subject: [ovs-dev] [PATCH 1/5] lib/dp-packet: init the mbuf to zero when build with DPDK X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" When building with DPDK, and using xmalloc() to get a new packet, field mbuf of the packet will not be initialized, but it's very important for DPDK port when copying the data to DPDK mbuf, because if ol_flags and other info are random values, DPDK driver may hang. Signed-off-by: Michael Qiu Signed-off-by: Jijiang Liu --- lib/dp-packet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 8e7defc..bf8522e 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -131,6 +131,9 @@ struct dp_packet * dp_packet_new(size_t size) { struct dp_packet *b = xmalloc(sizeof *b); + #ifdef DPDK_NETDEV + memset(&(b->mbuf), 0, sizeof(struct rte_mbuf)); + #endif dp_packet_init(b, size); return b; }