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 762DEA2EFC for ; Wed, 18 Sep 2019 15:55:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 840D71D15C; Wed, 18 Sep 2019 15:55:55 +0200 (CEST) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by dpdk.org (Postfix) with ESMTP id B94DE1C43C for ; Wed, 18 Sep 2019 15:55:53 +0200 (CEST) Received: by mail-oi1-f171.google.com with SMTP id t84so6002873oih.10 for ; Wed, 18 Sep 2019 06:55:53 -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; bh=ShoJxPAI905mrfq9MQaO132sb8AKfvvjPeu5fYyHCjI=; b=rjqwtMz7s2nQ0ukUJXS/tCM7b9BpdElTdfQUNTuwBOcvKdHT8VJ3H9jHHxz+B1MdBO /DAP0YBkno7mTDyYfNzaIZz3EBML50k9jEGgr5TLHYLNyX99ByLwLAltNoXXJkLxFL1T NUUEkxmv+h7zC+x8u0yz+nEZRdlVPKE1aDH9hTJyJP7054/8KCNY2V094eCFelKnt5VV Wm2W+a4B5hhwzxggIpnE91raQHl9a5qiKwpScYlssI7ArrNZvfnRwOGboFMAEzL+v40h +SpFLDxk5mgCjsya1riALvXOhA8GqJjOAoKEHyLRO6u4+GpYSV9sd0dmxh6vDiZ4zH0/ n9RA== 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; bh=ShoJxPAI905mrfq9MQaO132sb8AKfvvjPeu5fYyHCjI=; b=pcG0KQ3KQIpSKEVnX31QM99NNf6AbdslgqIqwZs+RgV0hQf4cnI7Kk1dljryA8fYNo pY9zWtM9JEAdWGPUsJDu+Loyql1R46WxtsmhdRhB9XowI5MD1oGJefBn1fafqu57W03k w5uOyRGoyPgLLWqtrsAn2vTJmmvF23ZzvQF3A6zDnsLfmRaOw0x8xT67q0OpCXCLNHaD C8ntst22d0K550hXbOhDxrFfywF2dKnQbPOJleAVz8JuGnvijRPBHGxmjJIMnx+HxiIX jF72a8DRyK6Y1DlOKhcabqH6zkIfZ3XsLLu2rgUjDTAdmx7Byf7Cqz9CX3TjzwZC6zZZ Ai1A== X-Gm-Message-State: APjAAAVZnZAGNPyYjJg0IfWV3WD3lmaZ1qFBsL29UffXN7jP44qzBmmn abN8X+j+tLZ4KnH9jZ2OqOUvrHLZsMFYKhvS/7M= X-Google-Smtp-Source: APXvYqzPOxcf7VGz5izqwWcE4A5Mq91AVhztIg9J2yfSjKpHwpiDtkyX2EJaCNBVazJpkjTHwtSc/DLaN3cYIqv9YLc= X-Received: by 2002:aca:4d08:: with SMTP id a8mr2344502oib.39.1568814952601; Wed, 18 Sep 2019 06:55:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Derek Date: Wed, 18 Sep 2019 21:55:41 +0800 Message-ID: To: madhukar mythri , users@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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" Hi, Madhukar The io forwarding mode is set. One question is when using pktgen generates packets to the host, in addition to the vlan id and mac, does it need to set the IP of source NIC and dst NIC? Thanks, Derek madhukar mythri =E6=96=BC 2019=E5=B9=B49=E6=9C= =8818=E6=97=A5 =E9=80=B1=E4=B8=89 =E4=B8=8B=E5=8D=885:00=E5=AF=AB=E9=81=93= =EF=BC=9A > 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=3D"/tmp/sock0" >> MPATH=3D"/dev/hugepages" >> MEMSZ=3D2048 >> IMG=3D/home/derek/ubuntu-guest.img >> >> qemu-system-x86_64 \ >> -boot c \ >> -machine accel=3Dkvm -cpu host \ >> -m ${MEMSZ} -object >> >> memory-backend-file,id=3Dhugemem,size=3D${MEMSZ}M,mem-path=3D/dev/hugepa= ges,share=3Don >> \ >> -mem-prealloc -smp 2 -numa node,memdev=3Dhugemem \ >> -chardev socket,id=3Dchar1,path=3D/tmp/sock0,server \ >> -netdev type=3Dvhost-user,id=3Dhostnet1,chardev=3Dchar1 \ >> -device virtio-net-pci,netdev=3Dhostnet1,id=3Dnet1,mac=3D52:54:00:00:00:= 14 \ >> -drive format=3Draw,file=3D${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-m= em >> 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> Statistics for device 0 >> ----------------------- >> TX total: 32 >> TX dropped: 0 >> TX successful: 32 >> RX total: 0 >> RX dropped: 0 >> RX successful: 0 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >> >> >> 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 m= ac >> 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. >> >