From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBTs5-0001AO-Oj for qemu-devel@nongnu.org; Tue, 22 Dec 2015 15:49:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBTs2-0005QW-Ip for qemu-devel@nongnu.org; Tue, 22 Dec 2015 15:49:25 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBTs2-0005QK-AM for qemu-devel@nongnu.org; Tue, 22 Dec 2015 15:49:22 -0500 Received: by mail-wm0-x22c.google.com with SMTP id p187so123624769wmp.1 for ; Tue, 22 Dec 2015 12:49:22 -0800 (PST) Date: Tue, 22 Dec 2015 22:49:18 +0200 From: Shmulik Ladkani Message-ID: <20151222224918.704b58b2@halley> In-Reply-To: <1450765104-26135-3-git-send-email-yanmiaobest@gmail.com> References: <1450765104-26135-1-git-send-email-yanmiaobest@gmail.com> <1450765104-26135-3-git-send-email-yanmiaobest@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/4] net/vmxnet3: return correct value for VMXNET3_CMD_GET_DID_* command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Miao Yan Cc: dmitry@daynix.com, jasowang@redhat.com, qemu-devel@nongnu.org Hi, On Mon, 21 Dec 2015 22:18:22 -0800 Miao Yan wrote: > VMXNET3_CMD_GET_DID_LO should return PCI ID of the device > and VMXNET3_CMD_GET_DID_HI should return vmxnet3 revision ID. > > This behavior can be observed by the following steps: > > 1) run a Linux distro on esxi server > 2) modify vmxnet3 Linux driver to read DID_HI and DID_LO: > > VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_DID_LO); > lo = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); > > VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_DID_HI); > high = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); > pr_info("vmxnet3 DID lo: 0x%x, high: 0x%x\n", lo, high); > > The kernel log will have something like the following message: > > [ 7005.111170] vmxnet3 DID lo: 0x7b0, high: 0x1 [...] > + case VMXNET3_CMD_GET_DID_HI: > + ret = VMXNET3_DEVICE_REVISION; > + break; > + Do we know whether VMXNET3_DEVICE_REVISION needs to be returned, or should it be VMXNET3_DEVICE_VERSION instead? I see both are currently defined as 1, but I assume this could potentially be changed in the future. How can we tell what's the right semantics for VMXNET3_CMD_GET_DID_HI? Regards, Shmulik