From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 27185431E1 for ; Mon, 23 Oct 2023 13:50:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAE4B40275; Mon, 23 Oct 2023 13:50:42 +0200 (CEST) Received: from v03.bc.feishu.cn (v03.bc.feishu.cn [101.36.218.31]) by mails.dpdk.org (Postfix) with UTF8SMTP id 0F718402B7 for ; Fri, 20 Oct 2023 08:54:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2308190927; d=venusgroup.com.cn; t=1697784840; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=meB/I4h40lDB93c8fcDCoCNytbS7lTZbVvdhFwQK0CI=; b=wNmJScuuZbJ13NtvVQ+9oJU8xkA8yx+DhkZDa1S0RH4vW/d0b/RgAF2DrsZCNhyiwF5hEg X+dvmiSIBTeI7crZNuZfjdOIOtwb14MjC+1ULBowlEEWgTMptbHf7a3DgXwnaTZqMWeB0x 7pcX3I7WxX3jJMd+sISq/TKvw8WNmkv6CBzeGJ+xBcNKOYkQixrIW1mzIFln/a0QWodmGT 9h4Y98+0NPTP1U+QmoGuGNchbjmvnthyZ2tTjyUzRGWp/7BBz0Gd5V3qx8geFeAqV52j3X cubj2WVx00ly/dmVHAvKHGFwaIqY/yC1qgLUGXbks5ECSqVJcramReE1MvyAUg== From: =?utf-8?q?=E6=9D=A8=E4=BD=B3=E6=98=8A?= Mime-Version: 1.0 X-Lms-Return-Path: Content-Type: multipart/alternative; boundary=b7e5b5ace2670332d0fe7406f6ecc5da798deb23c38fff0b0831ee8ad713 Date: Fri, 20 Oct 2023 14:53:58 +0800 Message-Id: To: "users" Subject: dpdk-virio get wrong mac X-Mailman-Approved-At: Mon, 23 Oct 2023 13:50:41 +0200 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --b7e5b5ace2670332d0fe7406f6ecc5da798deb23c38fff0b0831ee8ad713 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 dpdk=EF=BC=9Adpdk-20.08 Host=EF=BC=9A Dell=C2=A0 ubuntu-PowerEdge-R740 22.04 virtual machine=EF=BC=9Aarch linux kernel3.16.44 Virtual machine driver=EF=BC=9A virtio-transitional=EF=BC=880.95=EF=BC=89 ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= -------------- Problem Description=EF=BC=9A In virtio kernel driver=EF=BC=8Ceverything goes right. In dpdk=EF=BC=8CI get=C2=A0mac wrong on fist=C2=A0dpdk boot.when=EF=BC=8Cdp= dk reboot=EF=BC=8Cmac is right. By debugging, in legacy_read_dev_config=C2=A0dpdk-virio read mac by wrong o= ffset =C2=A0=C2=A0 < =C2=A0 =C2=A0 rte_pci_ioport_read(VTPCI_IO(hw), dst, length, =C2=A0=C2=A0 < =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 VIRTIO_PCI_CONFIG(hw) + o= ffset); =C2=A0 < =C2=A0 #define VIRTIO_PCI_CONFIG(hw) \ =C2=A0 < =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 (((hw)->use_msix =3D=3D V= IRTIO_MSIX_ENABLED) ? 24 : 20) I found dpdk reads pci=C2=A0config with offset by hw->use_msix. In kernel d= mesg, it shows that MSIX is enable.But,value of hw->misx in dpdk-virtio is = uncertain. The above description causes the starting address of reading mac to be eith= er 4 bits ahead or 4 bits behind. However, after restarting dpdk once,dpdk no longer uses the legacy interfac= e, but the modern interface.The mac got through the modern interface is alw= ays correct. I don't know if this is a bug in dpdk,or there is=C2=A0something wrong with= my environment? --b7e5b5ace2670332d0fe7406f6ecc5da798deb23c38fff0b0831ee8ad713 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8
dpdk=EF=BC=9Adpdk-20.08
Host=EF=BC=9A D= ell  ubuntu-PowerEdge-R740 22.04
virtual machin= e=EF=BC=9Aarch linux kernel3.16.44
Virtual machine d= river=EF=BC=9A virtio-transitional=EF=BC=880.95=EF=BC=89
----------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= -------------------
Problem Description=EF=BC=9A
In virtio kernel driver=EF=BC=8Ceverything goes right= .
In dpdk=EF=BC=8CI get mac wrong on fist = dpdk boot.when=EF=BC=8Cdpdk reboot=EF=BC=8Cmac is right.
By debugging, in legacy_read= _dev_config dpdk-virio read mac by wrong offset

   <     rte_pc= i_ioport_read(VTPCI_IO(hw), dst, length,
 &nbs= p; <           VIRTIO_PCI_CONFIG(hw) + offset);=

  <   #d= efine VIRTIO_PCI_CONFIG(hw) \
  <   &n= bsp;        (((hw)->use_msix =3D=3D VIRTIO_MSIX_ENAB= LED) ? 24 : 20)

I fo= und dpdk reads pci config with offset by hw->use_msix. I= n kernel dmesg, it shows that MSIX is enable.But,value of hw->misx in dp= dk-virtio is uncertain.
The = above description causes the starting address of reading mac to be either 4= bits ahead or 4 bits behind.
However, after restarting dpdk once,dpdk no l= onger uses the legacy interface, but the modern interface.The mac got throu= gh the modern interface is always correct.
<= span style=3D"color: rgb(0, 0, 0);">I don't know if this is a bug in dpdk,o= r there is something wrong with my environment?





<= /div>
--b7e5b5ace2670332d0fe7406f6ecc5da798deb23c38fff0b0831ee8ad713--