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 60A30A2EFC for ; Wed, 18 Sep 2019 11:00:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9FC2C1C197; Wed, 18 Sep 2019 11:00:57 +0200 (CEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by dpdk.org (Postfix) with ESMTP id CACE11BFFE for ; Wed, 18 Sep 2019 11:00:56 +0200 (CEST) Received: by mail-wm1-f46.google.com with SMTP id x2so1610774wmj.2 for ; Wed, 18 Sep 2019 02:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vFdPUJdcbeiiH6pn42bx3+tcQzMMew1881YpueOQq2w=; b=m4s0VRgm4l/M0SDZDNm5J0aqqhVHaCDmAsfd7nEWZ/GHxxSRAqnSUPeaXxUR1FOJUY DCiTOpoH36xBWlAyA6ICczOuWywqFiAAYJGLG8xRh3aQEpTpVYOPaV/nE9mm0uNpWEoa A8KFyluuLcVew1lw/Y6eU5nZH4bit9uXIbyYqwnSL5jISm+yXzblIoloiZfXKTup3YEt mAsWdPfTL5O+8bkixN0yH5taLxa4ryLQo9hXPzZ19VA50D8wQq2E8YBAKNuzbPs8sH9h LnDuHpWuFnjxsmR2VJV2LYZE1H43htBPUd7WLfEBo76ijw11Gh/SPFhbEzXPuzlzkXv8 dZhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vFdPUJdcbeiiH6pn42bx3+tcQzMMew1881YpueOQq2w=; b=TU4rr6c8O7ADiYIuG/+d1nUZvkIcGoRNB9T1OXKbjLVp3KXYD1oL6ND7wMytC7hhrP sRDQrn3kWpXZV2xfKGFSaZEYnsiPJ3r62I9VeB4mIbl2n0RbK4OWVtdWnwMd60Lg04+1 wDb5Zk343fjQWzEDhSyoYMPiU3g5GWKm8xM1dHDdk2aQhPCJmLCP7DIZXqtKO2zp/lZo 0zlM1seEgbRg6vd8niiRqHVhexe1KNd/wyyUxy7WaCWzvw+zoj0vMyGDIuYbsWbWkdka KoVuev0ROHkP5OxqGHb3D6rZY1I73e5bOgmW9u0oPgwor5+2M2nXcxWCzlZMiGrL/WJ1 LlGQ== X-Gm-Message-State: APjAAAUnvj7oSlTlqZoIxV7HMoHuICgnBduYeY9E3RLeTkAW/8bTHypi CQIlVKAtjomGUW5LQO+BzqTeFxYU/9uUI67wKcc= X-Google-Smtp-Source: APXvYqwsQ22cSUXx0w+HG8de53hLjS3ZhiVMM1CIEGxUEYq2HJhRxBm2H3wdNE9TBC43KeqjzcyJPFDmxoXMSg7mtWM= X-Received: by 2002:a7b:c8d6:: with SMTP id f22mr1720271wml.173.1568797256406; Wed, 18 Sep 2019 02:00:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: madhukar mythri Date: Wed, 18 Sep 2019 14:30:45 +0530 Message-ID: To: Derek Cc: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [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" Did you configured the testpmd with "io" forwarding mode? you can cross-check with this command: "show config rxtx". For more information, you can go-through this testpmd documentation under "4.4.7" section: https://doc.dpdk.org/guides/testpmd_app_ug/testpmd_funcs.html ~~ Madhukar. On Wed, Sep 18, 2019 at 9:39 AM Derek wrote: > 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. >