From nobody Sat Apr 27 21:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1494296213654280.8426935465758; Mon, 8 May 2017 19:16:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4029EC0467C5; Tue, 9 May 2017 02:16:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49C069F9A1; Tue, 9 May 2017 02:16:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E9F3D410B1; Tue, 9 May 2017 02:16:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v492GiPL027104 for ; Mon, 8 May 2017 22:16:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 40DE5784CF; Tue, 9 May 2017 02:16:44 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 37EA8784D7 for ; Tue, 9 May 2017 02:16:41 +0000 (UTC) Received: from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by mx1.redhat.com (Postfix) with ESMTP id 6656F88E60 for ; Tue, 9 May 2017 02:16:34 +0000 (UTC) Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 9 May 2017 01:58:37 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v4929ce4018362 for ; Tue, 9 May 2017 10:09:38 +0800 (GMT-8) (envelope-from lu.zhipeng@zte.com.cn) Received: from ceshi.localdomain ([10.74.120.130]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017050910093982-541048 ; Tue, 9 May 2017 10:09:39 +0800 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4029EC0467C5 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4029EC0467C5 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6656F88E60 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lu.zhipeng@zte.com.cn DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6656F88E60 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170509095837 From: ZhiPeng Lu To: libvir-list@redhat.com Date: Tue, 9 May 2017 10:09:07 +0800 Message-Id: <1494295747-3754-1-git-send-email-lu.zhipeng@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-05-09 10:09:39, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-05-09 10:09:22, Serialize complete at 2017-05-09 10:09:22 X-MAIL: mse01.zte.com.cn v4929ce4018362 X-HQIP: 127.0.0.1 X-Greylist: Delayed for 00:06:33 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 09 May 2017 02:16:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 09 May 2017 02:16:39 +0000 (UTC) for IP:'202.103.147.172' DOMAIN:'out1.zte.com.cn' HELO:'out1.zte.com.cn' FROM:'lu.zhipeng@zte.com.cn' RCPT:'' X-RedHat-Spam-Score: 0.398 (BAYES_50, DCC_REPUT_00_12, RP_MATCHES_RCVD, SPF_PASS) 202.103.147.172 out1.zte.com.cn 202.103.147.172 out1.zte.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: "ning.bo" Subject: [libvirt] [PATCH] nodedev_udev: Fix missing events when kernel report lots of udev events within a short time X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 09 May 2017 02:16:52 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "ning.bo" When create Virtual Function for Inter XL710 use below commands: for i in `seq 0 1`; do echo 63 > /sys/devices/pci0000:00/0000:00:03.2/0000:07:00.$i/sriov_= numvfs done for i in `seq 0 3`; do echo 31 > /sys/devices/pci0000:80/0000:80:02.2/0000:82:00.$i/sriov_= numvfs done The libvirtd will missing some udev events, the result of libvirt-python API listDevices('pci') will not list all pci devices. The reason is that the buffer of udev monitor default size cann't save all = udev events reported by kernel. So we need change buffer size so that we can receive as much events as poss= ible whitin a short time. Signed-off-by: ning.bo --- src/node_device/node_device_udev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 6e706a1..d813206 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1564,6 +1564,7 @@ static int nodeStateInitialize(bool privileged, } =20 udev_monitor_enable_receiving(priv->udev_monitor); + udev_monitor_set_receive_buffer_size(priv->udev_monitor, 128 * 1024 * = 1024); =20 /* We register the monitor with the event callback so we are * notified by udev of device changes before we enumerate existing --=20 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list