[dpdk-dev] examples/vhost: fix sending arp packet to self

Message ID 1514542463-146522-1-git-send-email-junjie.j.chen@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Yuanhan Liu
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

junjie.j.chen@intel.com Dec. 29, 2017, 10:14 a.m. UTC
  ARP packets are not dropped when dest vdev is itself, which breaks
RX ring inconspicuously.

Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
---
 examples/vhost/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Yang, Zhiyong Dec. 29, 2017, 6:27 a.m. UTC | #1
Hi Junjie,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Junjie Chen
> Sent: Friday, December 29, 2017 6:14 PM
> To: yliu@fridaylinux.org; maxime.coquelin@redhat.com
> Cc: dev@dpdk.org; Chen, Junjie J <junjie.j.chen@intel.com>
> Subject: [dpdk-dev] [PATCH] examples/vhost: fix sending arp packet to self
> 
> ARP packets are not dropped when dest vdev is itself, which breaks RX ring
> inconspicuously.
> 
If you are fixing a bug,  it's better to write one fixline before SOB that can describe which commit caused the issue.
For example,
Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API")

Thanks
Zhiyong

> Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
> ---
...
<snip>
  
junjie.j.chen@intel.com Dec. 29, 2017, 6:52 a.m. UTC | #2
Thanks Zhiyong

Updated in v2.

> -----Original Message-----
> From: Yang, Zhiyong
> Sent: Friday, December 29, 2017 2:27 PM
> To: Chen, Junjie J <junjie.j.chen@intel.com>; yliu@fridaylinux.org;
> maxime.coquelin@redhat.com
> Cc: dev@dpdk.org; Chen, Junjie J <junjie.j.chen@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] examples/vhost: fix sending arp packet to self
> 
> Hi Junjie,
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Junjie Chen
> > Sent: Friday, December 29, 2017 6:14 PM
> > To: yliu@fridaylinux.org; maxime.coquelin@redhat.com
> > Cc: dev@dpdk.org; Chen, Junjie J <junjie.j.chen@intel.com>
> > Subject: [dpdk-dev] [PATCH] examples/vhost: fix sending arp packet to
> > self
> >
> > ARP packets are not dropped when dest vdev is itself, which breaks RX
> > ring inconspicuously.
> >
> If you are fixing a bug,  it's better to write one fixline before SOB that can
> describe which commit caused the issue.
> For example,
> Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API")
> 
> Thanks
> Zhiyong
> 
> > Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
> > ---
> ...
> <snip>
  

Patch

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 89a61f0..10a7f5d 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -964,7 +964,8 @@  virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m, uint16_t vlan_tag)
 		struct vhost_dev *vdev2;
 
 		TAILQ_FOREACH(vdev2, &vhost_dev_list, global_vdev_entry) {
-			virtio_xmit(vdev2, vdev, m);
+			if (vdev2 != vdev)
+				virtio_xmit(vdev2, vdev, m);
 		}
 		goto queue2nic;
 	}