linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH 36/38] docs: networking: convert ipvlan.txt to ReST
Date: Tue, 28 Apr 2020 00:01:51 +0200	[thread overview]
Message-ID: <bb7662049e543c61fd0ab53af50ee5c6a2acaccd.1588024424.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1588024424.git.mchehab+huawei@kernel.org>

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 Documentation/networking/index.rst            |   1 +
 .../networking/{ipvlan.txt => ipvlan.rst}     | 159 +++++++++++-------
 2 files changed, 102 insertions(+), 58 deletions(-)
 rename Documentation/networking/{ipvlan.txt => ipvlan.rst} (54%)

diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst
index 709675464e51..54dee1575b54 100644
--- a/Documentation/networking/index.rst
+++ b/Documentation/networking/index.rst
@@ -71,6 +71,7 @@ Contents:
    ipsec
    ip-sysctl
    ipv6
+   ipvlan
 
 .. only::  subproject and html
 
diff --git a/Documentation/networking/ipvlan.txt b/Documentation/networking/ipvlan.rst
similarity index 54%
rename from Documentation/networking/ipvlan.txt
rename to Documentation/networking/ipvlan.rst
index 27a38e50c287..694adcba36b0 100644
--- a/Documentation/networking/ipvlan.txt
+++ b/Documentation/networking/ipvlan.rst
@@ -1,11 +1,15 @@
+.. SPDX-License-Identifier: GPL-2.0
 
-                            IPVLAN Driver HOWTO
+===================
+IPVLAN Driver HOWTO
+===================
 
 Initial Release:
 	Mahesh Bandewar <maheshb AT google.com>
 
 1. Introduction:
-	This is conceptually very similar to the macvlan driver with one major
+================
+This is conceptually very similar to the macvlan driver with one major
 exception of using L3 for mux-ing /demux-ing among slaves. This property makes
 the master device share the L2 with it's slave devices. I have developed this
 driver in conjunction with network namespaces and not sure if there is use case
@@ -13,34 +17,48 @@ outside of it.
 
 
 2. Building and Installation:
-	In order to build the driver, please select the config item CONFIG_IPVLAN.
+=============================
+
+In order to build the driver, please select the config item CONFIG_IPVLAN.
 The driver can be built into the kernel (CONFIG_IPVLAN=y) or as a module
 (CONFIG_IPVLAN=m).
 
 
 3. Configuration:
-	There are no module parameters for this driver and it can be configured
+=================
+
+There are no module parameters for this driver and it can be configured
 using IProute2/ip utility.
+::
 
     ip link add link <master> name <slave> type ipvlan [ mode MODE ] [ FLAGS ]
        where
-         MODE: l3 (default) | l3s | l2
-         FLAGS: bridge (default) | private | vepa
+	 MODE: l3 (default) | l3s | l2
+	 FLAGS: bridge (default) | private | vepa
+
+e.g.
 
-    e.g.
     (a) Following will create IPvlan link with eth0 as master in
-        L3 bridge mode
-          bash# ip link add link eth0 name ipvl0 type ipvlan
-    (b) This command will create IPvlan link in L2 bridge mode.
-          bash# ip link add link eth0 name ipvl0 type ipvlan mode l2 bridge
-    (c) This command will create an IPvlan device in L2 private mode.
-          bash# ip link add link eth0 name ipvlan type ipvlan mode l2 private
-    (d) This command will create an IPvlan device in L2 vepa mode.
-          bash# ip link add link eth0 name ipvlan type ipvlan mode l2 vepa
+	L3 bridge mode::
+
+	  bash# ip link add link eth0 name ipvl0 type ipvlan
+    (b) This command will create IPvlan link in L2 bridge mode::
+
+	  bash# ip link add link eth0 name ipvl0 type ipvlan mode l2 bridge
+
+    (c) This command will create an IPvlan device in L2 private mode::
+
+	  bash# ip link add link eth0 name ipvlan type ipvlan mode l2 private
+
+    (d) This command will create an IPvlan device in L2 vepa mode::
+
+	  bash# ip link add link eth0 name ipvlan type ipvlan mode l2 vepa
 
 
 4. Operating modes:
-	IPvlan has two modes of operation - L2 and L3. For a given master device,
+===================
+
+IPvlan has two modes of operation - L2 and L3. For a given master device,
 you can select one of these two modes and all slaves on that master will
 operate in the same (selected) mode. The RX mode is almost identical except
 that in L3 mode the slaves wont receive any multicast / broadcast traffic.
@@ -48,39 +66,50 @@ L3 mode is more restrictive since routing is controlled from the other (mostly)
 default namespace.
 
 4.1 L2 mode:
-	In this mode TX processing happens on the stack instance attached to the
+------------
+
+In this mode TX processing happens on the stack instance attached to the
 slave device and packets are switched and queued to the master device to send
 out. In this mode the slaves will RX/TX multicast and broadcast (if applicable)
 as well.
 
 4.2 L3 mode:
-	In this mode TX processing up to L3 happens on the stack instance attached
+------------
+
+In this mode TX processing up to L3 happens on the stack instance attached
 to the slave device and packets are switched to the stack instance of the
 master device for the L2 processing and routing from that instance will be
 used before packets are queued on the outbound device. In this mode the slaves
 will not receive nor can send multicast / broadcast traffic.
 
 4.3 L3S mode:
-	This is very similar to the L3 mode except that iptables (conn-tracking)
+-------------
+
+This is very similar to the L3 mode except that iptables (conn-tracking)
 works in this mode and hence it is L3-symmetric (L3s). This will have slightly less
 performance but that shouldn't matter since you are choosing this mode over plain-L3
 mode to make conn-tracking work.
 
 5. Mode flags:
-	At this time following mode flags are available
+==============
+
+At this time following mode flags are available
 
 5.1 bridge:
-	This is the default option. To configure the IPvlan port in this mode,
+-----------
+This is the default option. To configure the IPvlan port in this mode,
 user can choose to either add this option on the command-line or don't specify
 anything. This is the traditional mode where slaves can cross-talk among
 themselves apart from talking through the master device.
 
 5.2 private:
-	If this option is added to the command-line, the port is set in private
+------------
+If this option is added to the command-line, the port is set in private
 mode. i.e. port won't allow cross communication between slaves.
 
 5.3 vepa:
-	If this is added to the command-line, the port is set in VEPA mode.
+---------
+If this is added to the command-line, the port is set in VEPA mode.
 i.e. port will offload switching functionality to the external entity as
 described in 802.1Qbg
 Note: VEPA mode in IPvlan has limitations. IPvlan uses the mac-address of the
@@ -89,18 +118,25 @@ neighbor will have source and destination mac same. This will make the switch /
 router send the redirect message.
 
 6. What to choose (macvlan vs. ipvlan)?
-	These two devices are very similar in many regards and the specific use
+=======================================
+
+These two devices are very similar in many regards and the specific use
 case could very well define which device to choose. if one of the following
-situations defines your use case then you can choose to use ipvlan -
-	(a) The Linux host that is connected to the external switch / router has
-policy configured that allows only one mac per port.
-	(b) No of virtual devices created on a master exceed the mac capacity and
-puts the NIC in promiscuous mode and degraded performance is a concern.
-	(c) If the slave device is to be put into the hostile / untrusted network
-namespace where L2 on the slave could be changed / misused.
+situations defines your use case then you can choose to use ipvlan:
+
+
+(a) The Linux host that is connected to the external switch / router has
+    policy configured that allows only one mac per port.
+(b) No of virtual devices created on a master exceed the mac capacity and
+    puts the NIC in promiscuous mode and degraded performance is a concern.
+(c) If the slave device is to be put into the hostile / untrusted network
+    namespace where L2 on the slave could be changed / misused.
 
 
 6. Example configuration:
+=========================
+
+::
 
   +=============================================================+
   |  Host: host1                                                |
@@ -117,30 +153,37 @@ namespace where L2 on the slave could be changed / misused.
   +==============================#==============================+
 
 
-	(a) Create two network namespaces - ns0, ns1
-		ip netns add ns0
-		ip netns add ns1
-
-	(b) Create two ipvlan slaves on eth0 (master device)
-		ip link add link eth0 ipvl0 type ipvlan mode l2
-		ip link add link eth0 ipvl1 type ipvlan mode l2
-
-	(c) Assign slaves to the respective network namespaces
-		ip link set dev ipvl0 netns ns0
-		ip link set dev ipvl1 netns ns1
-
-	(d) Now switch to the namespace (ns0 or ns1) to configure the slave devices
-		- For ns0
-			(1) ip netns exec ns0 bash
-			(2) ip link set dev ipvl0 up
-			(3) ip link set dev lo up
-			(4) ip -4 addr add 127.0.0.1 dev lo
-			(5) ip -4 addr add $IPADDR dev ipvl0
-			(6) ip -4 route add default via $ROUTER dev ipvl0
-		- For ns1
-			(1) ip netns exec ns1 bash
-			(2) ip link set dev ipvl1 up
-			(3) ip link set dev lo up
-			(4) ip -4 addr add 127.0.0.1 dev lo
-			(5) ip -4 addr add $IPADDR dev ipvl1
-			(6) ip -4 route add default via $ROUTER dev ipvl1
+(a) Create two network namespaces - ns0, ns1::
+
+	ip netns add ns0
+	ip netns add ns1
+
+(b) Create two ipvlan slaves on eth0 (master device)::
+
+	ip link add link eth0 ipvl0 type ipvlan mode l2
+	ip link add link eth0 ipvl1 type ipvlan mode l2
+
+(c) Assign slaves to the respective network namespaces::
+
+	ip link set dev ipvl0 netns ns0
+	ip link set dev ipvl1 netns ns1
+
+(d) Now switch to the namespace (ns0 or ns1) to configure the slave devices
+
+	- For ns0::
+
+		(1) ip netns exec ns0 bash
+		(2) ip link set dev ipvl0 up
+		(3) ip link set dev lo up
+		(4) ip -4 addr add 127.0.0.1 dev lo
+		(5) ip -4 addr add $IPADDR dev ipvl0
+		(6) ip -4 route add default via $ROUTER dev ipvl0
+
+	- For ns1::
+
+		(1) ip netns exec ns1 bash
+		(2) ip link set dev ipvl1 up
+		(3) ip link set dev lo up
+		(4) ip -4 addr add 127.0.0.1 dev lo
+		(5) ip -4 addr add $IPADDR dev ipvl1
+		(6) ip -4 route add default via $ROUTER dev ipvl1
-- 
2.25.4


  parent reply	other threads:[~2020-04-27 22:03 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 22:01 [PATCH 00/38] net: manually convert files to ReST format - part 1 Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 01/38] docs: networking: convert caif files to ReST Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 02/38] docs: networking: convert 6pack.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 03/38] docs: networking: convert altera_tse.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 04/38] docs: networking: convert arcnet-hardware.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 05/38] docs: networking: convert arcnet.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 06/38] docs: networking: convert atm.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 07/38] docs: networking: convert ax25.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 08/38] docs: networking: convert baycom.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 09/38] docs: networking: convert bonding.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 10/38] docs: networking: convert cdc_mbim.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 11/38] docs: networking: convert cops.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 12/38] docs: networking: convert cxacru.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 13/38] docs: networking: convert dccp.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 14/38] docs: networking: convert dctcp.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 15/38] docs: networking: convert decnet.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 16/38] docs: networking: convert defza.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 17/38] docs: networking: convert dns_resolver.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 18/38] docs: networking: convert driver.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 19/38] docs: networking: convert eql.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 20/38] docs: networking: convert fib_trie.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 21/38] docs: networking: convert filter.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 22/38] docs: networking: convert fore200e.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 23/38] docs: networking: convert framerelay.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 24/38] docs: networking: convert generic-hdlc.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 25/38] docs: networking: convert generic_netlink.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 26/38] docs: networking: convert gen_stats.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 27/38] docs: networking: convert gtp.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 28/38] docs: networking: convert hinic.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 29/38] docs: networking: convert ila.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 30/38] docs: networking: convert ipddp.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 31/38] docs: networking: convert ip_dynaddr.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 32/38] docs: networking: convert iphase.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 33/38] docs: networking: convert ipsec.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 34/38] docs: networking: convert ip-sysctl.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` [PATCH 35/38] docs: networking: convert ipv6.txt " Mauro Carvalho Chehab
2020-04-27 22:01 ` Mauro Carvalho Chehab [this message]
2020-04-27 22:01 ` [PATCH 37/38] docs: networking: convert ipvs-sysctl.txt " Mauro Carvalho Chehab
2020-04-28  9:08   ` Simon Horman
2020-04-27 22:01 ` [PATCH 38/38] docs: networking: convert kcm.txt " Mauro Carvalho Chehab
2020-04-28 20:11 ` [PATCH 00/38] net: manually convert files to ReST format - part 1 David Miller
2020-04-28 20:15   ` Jonathan Corbet
2020-04-28 21:40 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb7662049e543c61fd0ab53af50ee5c6a2acaccd.1588024424.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).