From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 154AA2BA5 for ; Thu, 29 Mar 2018 15:48:26 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2018 06:48:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,376,1517904000"; d="scan'208";a="29920180" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.164]) by orsmga006.jf.intel.com with ESMTP; 29 Mar 2018 06:48:24 -0700 Date: Thu, 29 Mar 2018 21:46:49 +0800 From: Tiwei Bie To: Maxime Coquelin Cc: dev@dpdk.org, jianfeng.tan@intel.com, yliu@fridaylinux.org, zhihong.wang@intel.com, xiao.w.wang@intel.com, cunming.liang@intel.com, dan.daly@intel.com Message-ID: <20180329134649.cykuce2k3biieo7j@debian> References: <20180306104327.14470-1-tiwei.bie@intel.com> <20180306104327.14470-2-tiwei.bie@intel.com> <7e8fb43f-4cef-efb6-069b-469ebcecc800@redhat.com> <20180329132521.6rrabfiobwjommfn@debian> <1dadbc4a-8ca8-c1b8-ff36-417fc1395a23@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1dadbc4a-8ca8-c1b8-ff36-417fc1395a23@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 1/3] vhost: do not generate signal when sendmsg fails 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: Thu, 29 Mar 2018 13:48:27 -0000 On Thu, Mar 29, 2018 at 03:41:23PM +0200, Maxime Coquelin wrote: > On 03/29/2018 03:25 PM, Tiwei Bie wrote: > > On Thu, Mar 29, 2018 at 02:19:35PM +0200, Maxime Coquelin wrote: > > > Hi Tiwei, > > > > > > On 03/06/2018 11:43 AM, Tiwei Bie wrote: > > > > Signed-off-by: Tiwei Bie > > > > > > Could you please elaborate a bit more why this is needed? > > > Is it fixing a real issue or just an improvement? > > > > My bad, I really should write a more useful commit log.. > > > > I saw your comments on this mail: > > > > http://dpdk.org/ml/archives/dev/2018-March/094201.html > > > > Thank you so much! :-) > > > > It's fixing an issue I met when adding the vDPA support. > > SIGPIPE would be generated when sending messages via a > > closed slave fd, and it will terminate the process by > > default. But as a library, we shouldn't crash the process > > in this case, instead we just need to return with an error. > > I didn't meet this issue without my vDPA related changes, > > so I didn't put a fixline on it. That is to say, I'm > > treating it as an improvement. > > Great, thanks for the details! > I'll apply the patch with below commit message. Thank you very much! :-) Best regards, Tiwei Bie > > Maxime > > > > Below is the commit log for your reference: > > > > ------ START HERE ------ > > > > vhost: do not generate signal when sendmsg fails > > > > More precisely, do not generate a SIGPIPE signal if the peer > > has closed the connection. Otherwise, it will terminate the > > process by default. As a library, we should avoid terminating > > the application process when error happens and just need to > > return with an error. > > > > ------ END HERE ------ > > > > Thanks again! :-) > > > > Best regards, > > Tiwei Bie > > > > > > > > Thanks! > > > Maxime > > > > --- > > > > lib/librte_vhost/socket.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c > > > > index 0354740fa..d703d2114 100644 > > > > --- a/lib/librte_vhost/socket.c > > > > +++ b/lib/librte_vhost/socket.c > > > > @@ -181,7 +181,7 @@ send_fd_message(int sockfd, char *buf, int buflen, int *fds, int fd_num) > > > > } > > > > do { > > > > - ret = sendmsg(sockfd, &msgh, 0); > > > > + ret = sendmsg(sockfd, &msgh, MSG_NOSIGNAL); > > > > } while (ret < 0 && errno == EINTR); > > > > if (ret < 0) { > > > >