From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m15-37.126.com (m15-37.126.com [220.181.15.37]) by dpdk.org (Postfix) with ESMTP id 82DB09AAD for ; Wed, 25 Feb 2015 10:56:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=z0zqw ZQC6e4OHoPDW/3VvSh8E9/yY/IZM5yNDAoCDhQ=; b=LS8W8yIVDpELxrb4lSTI7 BAkbeyyjb4+hXKZWTbY5ctZCqUH5iFQJr//A3+lJDB4KuRw4DiGUWyxIS7Pal2IK 08A3eYx0BK8JVfKnVAdkKWurRHX6G7dk9QSfBSHUThnE8Qv70eRUez8S9YIC94LD vSl8c8dY3KmHDj204IKTCM= Received: from dpdkdev$126.com ( [123.126.110.26, 176.34.62.243] ) by ajax-webmail-wmsvr37 (Coremail) ; Wed, 25 Feb 2015 17:55:57 +0800 (CST) X-Originating-IP: [123.126.110.26, 176.34.62.243] Date: Wed, 25 Feb 2015 17:55:57 +0800 (CST) From: "Tim Deng" To: "Zhou, Danny" X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 20150119(59087.7062) Copyright (c) 2002-2015 www.mailtech.cn 126com In-Reply-To: References: <15f7ead7.137b.14bbe735a7e.Coremail.dpdkdev@126.com> MIME-Version: 1.0 Message-ID: <9da2437.5fd7.14bc02a1013.Coremail.dpdkdev@126.com> X-CM-TRANSID: JcqowECplUYunO1UPAY1AA--.29622W X-CM-SenderInfo: pgsgyvlhy6ij2wof0z/1tbi2hurokidnxjdGAAAsf X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Manage DPDK port capability via KNI 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: Wed, 25 Feb 2015 09:56:03 -0000 VGhhbmtzIERhbm55LApUaGF0IG1lYW5zIERQREsgcG9ydHMgaGF2ZSB0byBoYXZlIGRlZGljYXRl ZCBjb250cm9sIHBhdGggb3RoZXIgdGhhbiBLTkkuCgoKSSBvcmlnaW5hbGx5IGdvdCBjb25mdXNl ZCBieSB0aGUgc3RhdGVtZW50IGF0IGh0dHA6Ly9kcGRrLm9yZy9kb2MvZ3VpZGVzL3Byb2dfZ3Vp ZGUva2VybmVsX25pY19pbnRlcmZhY2UuaHRtbDoKIi4uLkFsbG93cyBtYW5hZ2VtZW50IG9mIERQ REsgcG9ydHMgdXNpbmcgc3RhbmRhcmQgTGludXggbmV0IHRvb2xzIHN1Y2ggYXMgZXRodG9vbCwg aWZjb25maWcgYW5kIHRjcGR1bXAuIgpUaGFua3MsClRpbQoKCkF0IDIwMTUtMDItMjUgMTM6MDU6 MDgsICJaaG91LCBEYW5ueSIgPGRhbm55Lnpob3VAaW50ZWwuY29tPiB3cm90ZToKPllvdSBjYW4g ZG8gaXQgYnV0IGl0IHdpbGwgbm90IHN5bmMgd2l0aCBEUERLLiBJbiBjdXJyZW50IEtOSSBpbXBs ZW1lbnRhdGlvbiwgdGhlIGRldmljZXMnCj5JL08gYWRkcmVzcyBzcGFjZXMgYXJlIG1hcHBlZCB0 byBib3RoIHVzZXJzcGFjZSBEUERLIGFuZCBrZW5yZWxzcGFjZSBLTkksIHNvIG9uZQo+Y2FuIGNv bnRyb2wgdGhlIE5JQyBkZXZpY2UgaW5kZXBlbmRlbnRseSh1c2luZyBldGh0b29sIGZvciBLTkkg YW5kIGV0aGRldiBBUElzIGZvciBEUERLKQo+d2l0aG91dCBzeW5jaHJvbml6YXRpb24uCj4KPklu IHRoZW9yeSwgS05JIHNob3VsZCByb3V0ZSBhbGwgZGV2aWNlIGNvbnRyb2wgcmVxdWVzdCBmcm9t IGV0aHRvb2wgdG8gRFBESy4gQnV0IHVuZm9ydHVuYXRlbHksCj5hIHNob3J0IHBhdGggaXMgYWRv cHRlZCBhdCB0aGUgbW9tZW50IGR1ZSB0byBEUERLIHJldXNlZCBsb3RzIG9mIGxlZ2FjeSBrZXJu ZWwgY29kZXMgd2l0aCBCU0QgbGljZW5zZS4KPgo+PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0t LQo+PiBGcm9tOiBkZXYgW21haWx0bzpkZXYtYm91bmNlc0BkcGRrLm9yZ10gT24gQmVoYWxmIE9m IFRpbSBEZW5nCj4+IFNlbnQ6IFdlZG5lc2RheSwgRmVicnVhcnkgMjUsIDIwMTUgOTo1NyBBTQo+ PiBUbzogZGV2QGRwZGsub3JnCj4+IFN1YmplY3Q6IFtkcGRrLWRldl0gTWFuYWdlIERQREsgcG9y dCBjYXBhYmlsaXR5IHZpYSBLTkkKPj4gCj4+IEhpLAo+PiAKPj4gCj4+IEkgYW0gd29uZGVyaW5n IGhvdyBjb3VsZCB3ZSBtYW5hZ2UgYSBEUERLIHBvcnQgb2ZmbG9hZCBjYXBhYmlsaXRpZXMsCj4+ IGUuZy4gaWYgd2Ugd2FudCB0byBkaXNhYmxlIFRTTyBjYXBhYmlsaXR5IG9uIGEgRFBESyBwb3J0 LCBpcyBpdCBmZWFzaWJsZQo+PiB0aGF0IHdlIHVzZSBldGh0b29sIHRvIGNvbmZpZ3VyZSBhIEtO SSB0aGVuIHRoZSBjb25maWcgd2lsbCBiZSBzeW5jIHRvIGEgRFBESyBwb3J0Pwo+PiAKPj4gCj4+ IFRoYW5rcywKPj4gVGltCg== >From thomas.monjalon@6wind.com Wed Feb 25 10:56:56 2015 Return-Path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by dpdk.org (Postfix) with ESMTP id 044769AAD for ; Wed, 25 Feb 2015 10:56:56 +0100 (CET) Received: by mail-wi0-f178.google.com with SMTP id em10so3646421wid.5 for ; Wed, 25 Feb 2015 01:56:55 -0800 (PST) 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:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=HEH1M8MQcSBJmsmwG/WrC/JNe10dbLhWdwtYav5wiDk=; b=EwwcmyD3qC7E182HXORdxlsvXjSJk8hCYafCHr9/OFTGOewS2oLuvnRNTTTsfzcpOk gKBHBKdfMb252pZ/VuOMN71IBRYnFayeKy2bgPLSzW7l4xlGhzi6HV00o5cFIABICM6d M0dw1WT6rn1pzd335+sgPN26BJ9ldPO8h4+9bga+plA/o6M4syM//absTIKK33pXQWAH 4aTbEfcIOBCciXqKgsu6GI8INsbo8sZopWBH7TzV50+AjVTCMzRUH9WHOeNHLjM0t1X4 NNcLbX9SN3tRemrId+Rzb0WQF6RaDp9CmNLr+7xEcBsQWGXA/Qb5AAUzj7R6yoGFIL6i X59w== X-Gm-Message-State: ALoCoQloK+hz8zbeZjenuufQ6S4DLKdyeuFaooeKgbC/DabdFptmOVv+VfLy11wdjvjHaF/24yIm X-Received: by 10.180.87.169 with SMTP id az9mr4997399wib.72.1424858215900; Wed, 25 Feb 2015 01:56:55 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id fa3sm24342018wib.17.2015.02.25.01.56.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 01:56:55 -0800 (PST) From: Thomas Monjalon To: "Liang, Cunming" Date: Wed, 25 Feb 2015 10:56:22 +0100 Message-ID: <1918339.MLD1NqnMmG@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: References: <1423732089-6202-1-git-send-email-cunming.liang@intel.com> <1514821.oaVEE2NRMm@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, John Linville Subject: Re: [dpdk-dev] [PATCH v1] afpacket: fix critical issue reported by klocwork 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: Wed, 25 Feb 2015 09:56:56 -0000 2015-02-25 09:52, Liang, Cunming: > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > 2015-02-25 00:57, Liang, Cunming: > > > From: John W. Linville [mailto:linville@tuxdriver.com] > > > > On Fri, Feb 20, 2015 at 11:19:59AM +0100, Thomas Monjalon wrote: > > > > > 2015-02-12 17:08, Cunming Liang: > > > > > > --- a/lib/librte_pmd_af_packet/rte_eth_af_packet.c > > > > > > +++ b/lib/librte_pmd_af_packet/rte_eth_af_packet.c > > > > > > @@ -439,13 +439,15 @@ rte_pmd_init_internals(const char *name, > > > > > > size_t ifnamelen; > > > > > > unsigned k_idx; > > > > > > struct sockaddr_ll sockaddr; > > > > > > - struct tpacket_req *req; > > > > > > + struct tpacket_req *req = NULL; > > > > > > > > > > If *internals is set to NULL, there should be no case where req used > > > > > and undefined. > > > > > > [LCM] Agree, so that's why I add '*internals = NULL' below as well. > > > > > > > > I agree -- it looks to me like req is protected by checking for > > > > *internals == NULL. I don't think this patch is necessary. > > > > > > [LCM] The major piece of the patch is add setting for '*internals=NULL;'. > > > > Yes understood, but it is already initialized to NULL before calling > > rte_pmd_init_internals(): > > http://dpdk.org/browse/dpdk/tree/lib/librte_pmd_af_packet/rte_eth_af_packet > > .c#n706 > [LCM] I see, it's complained by klocwork. > So either adding 'internals=NULL' or adding some comments helps to avoid checking again on the next scanning. > How do you think ? No, we don't have to pollute the code for a tool. You should check how to disable this false positive in your tool.