From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 156A858F6 for ; Sun, 3 Sep 2017 18:14:41 +0200 (CEST) Received: by mail-pf0-f172.google.com with SMTP id r187so12058680pfr.3 for ; Sun, 03 Sep 2017 09:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yD3S+uHlXQl432RaRfq8SDjgZtTvV8ooIKINlTwgnLQ=; b=mL1IzfDYkkkQp0q+Q4LtlMLZv5nuMeCFcDJh3SFh2RMp/TflULMhjLuhgvACikYEoS OHX023Q+mdvX/pN13g5HD5AyKJu8kUOAlrbnKpvhq1oF7t82VltTcRa90oc4RuSKpV0r UvM/rC/1Fpivo8ObI0ZAd1/VS/ZWodrbYifQxFACZjrAfpKdpD1AQ4fn+A9t0P7qs1bG K9yCbAXtOZ64XDjSdlHQyOfwWwGqg4b3Hv9gs+PVBNZzkeEuqdpQ70/lNtMWhSrTrk1b J6vdk2TNv1hXuG6uIyq2eznxE+K8cztsNzRGAF+suDBuVdFgGpTrEN6K8Glx0r8lLnmH VM5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yD3S+uHlXQl432RaRfq8SDjgZtTvV8ooIKINlTwgnLQ=; b=Iug2oYDJOFH5SRHr125sRC91Ss6MsROL0I7IE5xwcy2PLALGgckRqoWeMXdXWJMR+v 0pSYvWI6DdLNNEUP38c+LufYtRSsXp56NbUEX4LqJOxKUmMkt5TedmyNGn4iboTBgX3V +3UFQtGljVGo3LpfSzC1sQaosQ6Lig2w/9soV/wHvb73p6QV67/EDjtFZmaqLSm8nL5B Fo+SPkNuklieZlI0aN81y1YL33fWB621MUzmN4Ws5TiSKszex33sWxNB5StR6P3IuR7B R8nX5DzBnfaekV147gwG0BIT+pGIFjiIUPbgrLZn399XFfr6CQ/bHfm2zAJJuuNPN+Rb 5ryA== X-Gm-Message-State: AHPjjUj0x9RSYaMg4qhpXdV5Yzon3+K90WSCccYZ/O/LXjPHRX8QDN1F UUx9yL3SEeDPsScR X-Google-Smtp-Source: ADKCNb5aUAcoFpJm5u6VNppjzUtajBSP3kJnQGitZoQQlCGD+DOIls5fiw8GtTPJa8vOb7T6Ph7OnA== X-Received: by 10.101.90.196 with SMTP id d4mr9150142pgt.439.1504455281275; Sun, 03 Sep 2017 09:14:41 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id h192sm6944318pgc.36.2017.09.03.09.14.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Sep 2017 09:14:41 -0700 (PDT) Date: Sun, 3 Sep 2017 09:14:39 -0700 From: Stephen Hemminger To: Jeff Guo Cc: bruce.richardson@intel.com, dev@dpdk.org, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com, jblunck@infradead.org, helin.zhang@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, thomas@monjalon.net, jingjing.wu@intel.com Message-ID: <20170903091439.7c40d04f@xeon-e3> In-Reply-To: <1504453785-15735-2-git-send-email-jia.guo@intel.com> References: <1498712510-44217-2-git-send-email-jia.guo@intel.com> <1504453785-15735-1-git-send-email-jia.guo@intel.com> <1504453785-15735-2-git-send-email-jia.guo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 1/2] eal: add uevent monitor for hot plug X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Sep 2017 16:14:42 -0000 On Sun, 3 Sep 2017 23:49:44 +0800 Jeff Guo wrote: > + char buf[RTE_EAL_UEVENT_MSG_LEN]; > + > + memset(uevent, 0, sizeof(struct rte_eal_uevent)); > + memset(buf, 0, RTE_EAL_UEVENT_MSG_LEN); Please don't initialize everything all the time; you are even initializing receive data. > + ret = recv(fd, buf, RTE_EAL_UEVENT_MSG_LEN - 1, MSG_DONTWAIT); > + if (ret > 0) > + return rte_eal_uev_parse(buf, uevent); > + else if (ret < 0) { else is unnecessary after return. Checkpatch would have told you that if you ran it. > + RTE_LOG(ERR, EAL, > + "Socket read error(%d): %s\n", > + errno, strerror(er Please indent arguements to match the first line: RTE_LOG(ERR, EAL, "Socket read error ...