From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6B428A2EFC for ; Wed, 18 Sep 2019 06:09:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 98F431BF45; Wed, 18 Sep 2019 06:09:26 +0200 (CEST) Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) by dpdk.org (Postfix) with ESMTP id DA0F51BEC0 for ; Wed, 18 Sep 2019 06:09:24 +0200 (CEST) Received: by mail-ot1-f48.google.com with SMTP id f21so1959827otl.13 for ; Tue, 17 Sep 2019 21:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=moR3+KYiqgx2ig5Wt/dvE9yxyxa+zTTyHg9yL6mPYZE=; b=M1w4fIxNH2dhNgKs7qd0DVOYtmq4gFxfIDc9Uj5j1HU04prkpLOAEtt7nyZLuMIOnO 7AaANLdeN97CaqCw9JF3+LfGB9jQKgMnChcHbR4/GmBmgO6u3es7GT+B5fP65yc5ryt7 SkL2Ikw0+WRZnBHayyGm3XQhkQLvkA+2N82bGDh5z34SoKoFCVPsd6T1OtwbWBOD6gXk Az+ZnVXWsES2eyjuGAbYTy91oc4MbuKszobEAQGk+Ua70mO8feCO/ghcGK7HBoRhhg5p cOc/GbvOV5oP27IJBmCyZzRpOULWVLyAwuCd6abucMJcXLA+4h29OS3VdQ8ZXlcq+AeJ nP/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=moR3+KYiqgx2ig5Wt/dvE9yxyxa+zTTyHg9yL6mPYZE=; b=rjwfsB85Ev4OOVWxfTgczd0ZW54LPIX5TisZYx82boGBIVd2BdymVsG4/DCpG15XEt +JEnRLi/sETpNrtp9Ze7br2PcR1snd5WKPb2ivdDVDd+kjZWHyXD+0kREkjqe2pacdv4 BwlCC5UfAhaM5N+QdbyOezg4syjpKXNNj345A03oMnyW4gwVWTMEaLtmNHuqixDcviyA GCpIpPc0yIyJyOUyeNxd4gwadNKYV1znvQmLTh3Q4kFjQGH0KSXcX2jDzAUkgD75pRnZ jjLpEif8brHmmZIQFImAi0C1JkceU+QP+7SLCrwQsi+t8tlPPGD7jvsbUosTtss4+nMe Vr/Q== X-Gm-Message-State: APjAAAXu3bH9ePyMPqAq2jjzIhwC8StV00/Ch+cfeeQqa5RUBdWkC/QD ofLNLKDpvJiDH57xe/oroEzfLhXXxx5LOOcZRf9d+tkOXnM= X-Google-Smtp-Source: APXvYqyhFcSlllCuqq8rqv8uXaaHDsEcrNmeLdaP6oTlRRXsn7d8PhoMUGQKcTDEoD729UdG7+u4Io6qxmRES+xahSY= X-Received: by 2002:a9d:73c7:: with SMTP id m7mr1701827otk.203.1568779763693; Tue, 17 Sep 2019 21:09:23 -0700 (PDT) MIME-Version: 1.0 From: Derek Date: Wed, 18 Sep 2019 12:09:12 +0800 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] Usage of example vhost (vhost-switch) X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi, I try to run the vhost example in DPDK. The steps I did are: (1) The guest vm created by QEMU using the shell script #!/bin/bash USER_SOCK="/tmp/sock0" MPATH="/dev/hugepages" MEMSZ=2048 IMG=/home/derek/ubuntu-guest.img qemu-system-x86_64 \ -boot c \ -machine accel=kvm -cpu host \ -m ${MEMSZ} -object memory-backend-file,id=hugemem,size=${MEMSZ}M,mem-path=/dev/hugepages,share=on \ -mem-prealloc -smp 2 -numa node,memdev=hugemem \ -chardev socket,id=char1,path=/tmp/sock0,server \ -netdev type=vhost-user,id=hostnet1,chardev=char1 \ -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:00:00:14 \ -drive format=raw,file=${IMG} -vnc :4,password -monitor stdio (2) run the vhost-switch on the host #> ./build/vhost-switch -l 0-3 -n 4--2 uge-dir /dev/hugepages --socket-mem 1024 --log-level 8 -w 00000:73:00.1 -- --socket-file /tmp/sock0 --client -p 0x1 --stats 20 (3) The guest vm is started successfully. Then, in the guest vm i did #> ./x86_64-native-gcc/app/testpmd -l 0-1 -- -i > start tx_first I can see the TX packets on the host's vhost-switch stats and got the message VHOST_DATA: (0) mac 52:54:00:00:00:14 and vlan 1000 registered Device statistics ================================= Statistics for device 0 ----------------------- TX total: 32 TX dropped: 0 TX successful: 32 RX total: 0 RX dropped: 0 RX successful: 0 =================================================== My question is that how can I inject packets to the MAC address and VLAN ID 1000. I've tried to setup a pktgen on another host whose physical NIC is directly connected to the physical NIC port of the host. Then, set pktgen's dst mac to 52:54:00:00:00:14 and vlan id to 1000. But the "Device statistics" is not changed. Any idea for this problem? Very thanks.