From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 790BEA052E;
	Mon,  9 Mar 2020 11:13:03 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 0AB9D1C02A;
	Mon,  9 Mar 2020 11:13:03 +0100 (CET)
Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com
 [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id AC24A1C01F
 for <dev@dpdk.org>; Mon,  9 Mar 2020 11:13:01 +0100 (CET)
Received: by mail-wr1-f68.google.com with SMTP id n15so10231951wrw.13
 for <dev@dpdk.org>; Mon, 09 Mar 2020 03:13:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:subject:message-id:mime-version:content-disposition
 :content-transfer-encoding:user-agent;
 bh=n4h/yvyI0UaXf8g/Y2CcxGfbS+FCi6WqO3fy+0pecuQ=;
 b=nzakGJyPLKbeVUPyO5fYvRanBtlnvGXUlxu2kaOmUuiL0HTRc0cESgvOyLy1dUzLZ8
 d9jGqyj0H1b4/oIGvBPU9NUkPhuYdw8aQL5wgCQB/JUZkzSObxiTTAG8jdN+bX5g9vE7
 Iyme3vPWZjoJk0dd8v1dku7U7URLJBqX76DDIxD4Io3oNkCK0nNxMhRkPc40Z3oBHqtN
 QzSbhFnLUKm40tRZ8wWtI9BlfsP0DVrFGkAC82MDwn1fr1gqFLw4qeiIOVYpN+YIG45J
 Cs8TqkYbcgDunoTgPOjrITEjsF+ytYyQJF1IuKoMMOn4Ks+Y5tOurDBsGyFU79t5Nwft
 jI3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:subject:message-id:mime-version
 :content-disposition:content-transfer-encoding:user-agent;
 bh=n4h/yvyI0UaXf8g/Y2CcxGfbS+FCi6WqO3fy+0pecuQ=;
 b=jv6t2nokjjSDCvp6ASrc5Co2exBJ9U+YVaXYoW1XzyHxD2VttFcy0cLS6yEZNaFa4L
 +sYzqCrtobJ7USmYbohWHUxNNzj5PL+M5hZciQjXD36MTQL3rtL326N1CqvUk2bR7Cuo
 Eq6tY2FfcOq1+pJIUtKItW1okvTdLQsHvSVqGeyXHxulnj0zFp2DKpNH5RmgLouMvXGi
 sfXnoh9VBlmHHw4t3n5ITqc9JGPAieNqcM2hMOo8FHGZEFolprsWHEjunOcxtrEDiYdF
 t+73q6qHuDy4wsX7qLiXf50O74M7EBfser0KZmo7dggXKq32bTevdg4Tp74I+Nl1SyoC
 Kqfg==
X-Gm-Message-State: ANhLgQ29gqjitBj8zz7uz6K3+X0oCjIDizHjn6VPV4peHnEfkP+5w0jd
 Htscn5zep98JJ61IyithbJ4=
X-Google-Smtp-Source: ADFU+vsBgwxfcsc5VWWftTLnX4VFpjbJmQWTru98WlAGjaZZCyALlk5oSTNXJ+EhcT0MlIIyxBB4ug==
X-Received: by 2002:a5d:518b:: with SMTP id k11mr20912847wrv.114.1583748781387; 
 Mon, 09 Mar 2020 03:13:01 -0700 (PDT)
Received: from vbox (81.89.53.154.host.vnet.sk. [81.89.53.154])
 by smtp.gmail.com with ESMTPSA id s14sm48867414wrv.44.2020.03.09.03.13.00
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 09 Mar 2020 03:13:00 -0700 (PDT)
Date: Mon, 9 Mar 2020 13:12:59 +0100
From: =?iso-8859-1?Q?J=FAlius?= Milan <jmilan.dev@gmail.com>
To: ferruh.yigit@intel.com, dev@dpdk.org, jgrajcia@cisco.com
Message-ID: <20200309121259.GA29453@vbox>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
User-Agent: Mutt/1.9.4 (2018-02-28)
Subject: [dpdk-dev]  [PATCH] doc: document memif loopback feature
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Shows the example of how to connect 2 memif ports into loopback and test
the communication.

Signed-off-by: JĂșlius Milan <jmilan.dev@gmail.com>
---
 doc/guides/nics/memif.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
index 4d7f0086a..08a9fda86 100644
--- a/doc/guides/nics/memif.rst
+++ b/doc/guides/nics/memif.rst
@@ -272,3 +272,21 @@ Send ping from VPP::
     64 bytes from 192.168.1.2: icmp_seq=3 ttl=254 time=23.3927 ms
     64 bytes from 192.168.1.2: icmp_seq=4 ttl=254 time=24.2975 ms
     64 bytes from 192.168.1.2: icmp_seq=5 ttl=254 time=17.7049 ms
+
+Example: testpmd memif loopback
+-------------------------------
+In this example we will create 2 memif ports connected into loopback.
+The situation is analogous to cross connecting 2 ports of the NIC by cable.
+
+To set the loopback, just use the same socket and id with different roles::
+
+    #./testpmd --vdev=net_memif0,role=master,id=0 --vdev=net_memif1,role=slave,id=0 -- -i
+
+Then start the communication::
+
+    testpmd> start tx_first
+
+Finally we can check port stats to see the traffic::
+
+    testpmd> show port stats all
+    testpmd> show port stats all
-- 
2.17.1