From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4F76C433F5 for ; Fri, 8 Oct 2021 06:55:45 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 2E14B61040 for ; Fri, 8 Oct 2021 06:55:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2E14B61040 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4907640140; Fri, 8 Oct 2021 08:55:44 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 73F8A4003C for ; Fri, 8 Oct 2021 08:55:42 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HQf752TB2zWl50; Fri, 8 Oct 2021 14:54:09 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Fri, 8 Oct 2021 14:55:39 +0800 To: David Christensen , CC: Maxime Coquelin , , Thomas Monjalon , Ferruh Yigit References: <7d1804f4-e8df-82be-0c61-1d2fa182442a@huawei.com> <309f930f-1022-77f8-d65c-2920275e7d0d@huawei.com> From: "Min Hu (Connor)" Message-ID: <8516a885-3427-9b7b-0891-afd8b430788f@huawei.com> Date: Fri, 8 Oct 2021 14:55:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] Questions about vm2vm vhost-user/virtio-net test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, David, thanks for your reply, other question as below, 在 2021/10/1 2:25, David Christensen 写道: > > > On 9/30/21 2:07 AM, Min Hu (Connor) wrote: >> Hi, all, >>      I got the answer: testpmd fwd mode should be set "io", then ping >> OK. >> >>      IO fwd mode, it will not change packet MAC address info, and >> ping OK >>      MAC fwd mode, it will change packet MAC address info, like: >>      "rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr], >>                  ð_hdr->d_addr); >>      rte_ether_addr_copy(&ports[fs->tx_port].eth_addr, >>                  ð_hdr->s_addr)" >>      Then, ping failed. >> >>      So, everyone, I got one question: how could this happen? >>      router change packet src MAC and dst MAC, but ping OK, >>      testpmd vhost, treated as switch, also changes packert src MAC >>      and dst MAC, but ping failed ? > > Running testpmd in this configuration is more like a virtual wire, not a > switch, though in both cases the SRC/DST MAC addresses aren't typically Well, if SRC/DST MAC addresses modifed in some case, what will happen? That is, A send ping request to B, while SRC/DST MAC addresses modified,B can get the packet, but B cannot send ping reply. This is the result of my test. Why? > modified by the wire/switch when the frame is in transit. Both endpoints > reside in the same Ethernet broadcast domain and can talk to each other > directly. > > A router typically connects two different broadcast domains, which may > or may not be using Ethernet, so the router usually changes the SRC/DST > MAC address to work correctly as the frame transitions from one > broadcast domain into another. See > https://en.wikipedia.org/wiki/Broadcast_domain. > > Dave > .