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 07/37] docs: networking: convert xfrm_device.txt to ReST
Date: Fri,  1 May 2020 16:44:29 +0200	[thread overview]
Message-ID: <0977c0a0683059dabe314ceb543d3e8f0abbc506.1588344146.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1588344146.git.mchehab+huawei@kernel.org>

- add SPDX header;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 Documentation/networking/index.rst            |  1 +
 .../{xfrm_device.txt => xfrm_device.rst}      | 33 ++++++++++++-------
 2 files changed, 23 insertions(+), 11 deletions(-)
 rename Documentation/networking/{xfrm_device.txt => xfrm_device.rst} (92%)

diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst
index 75521e6c473b..e31f6cb564b4 100644
--- a/Documentation/networking/index.rst
+++ b/Documentation/networking/index.rst
@@ -117,6 +117,7 @@ Contents:
    vxlan
    x25-iface
    x25
+   xfrm_device
 
 .. only::  subproject and html
 
diff --git a/Documentation/networking/xfrm_device.txt b/Documentation/networking/xfrm_device.rst
similarity index 92%
rename from Documentation/networking/xfrm_device.txt
rename to Documentation/networking/xfrm_device.rst
index a1c904dc70dc..da1073acda96 100644
--- a/Documentation/networking/xfrm_device.txt
+++ b/Documentation/networking/xfrm_device.rst
@@ -1,7 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0
 
 ===============================================
 XFRM device - offloading the IPsec computations
 ===============================================
+
 Shannon Nelson <shannon.nelson@oracle.com>
 
 
@@ -19,7 +21,7 @@ hardware offload.
 Userland access to the offload is typically through a system such as
 libreswan or KAME/raccoon, but the iproute2 'ip xfrm' command set can
 be handy when experimenting.  An example command might look something
-like this:
+like this::
 
   ip x s add proto esp dst 14.0.0.70 src 14.0.0.52 spi 0x07 mode transport \
      reqid 0x07 replay-window 32 \
@@ -34,15 +36,17 @@ Yes, that's ugly, but that's what shell scripts and/or libreswan are for.
 Callbacks to implement
 ======================
 
-/* from include/linux/netdevice.h */
-struct xfrmdev_ops {
+::
+
+  /* from include/linux/netdevice.h */
+  struct xfrmdev_ops {
 	int	(*xdo_dev_state_add) (struct xfrm_state *x);
 	void	(*xdo_dev_state_delete) (struct xfrm_state *x);
 	void	(*xdo_dev_state_free) (struct xfrm_state *x);
 	bool	(*xdo_dev_offload_ok) (struct sk_buff *skb,
 				       struct xfrm_state *x);
 	void    (*xdo_dev_state_advance_esn) (struct xfrm_state *x);
-};
+  };
 
 The NIC driver offering ipsec offload will need to implement these
 callbacks to make the offload available to the network stack's
@@ -58,6 +62,8 @@ At probe time and before the call to register_netdev(), the driver should
 set up local data structures and XFRM callbacks, and set the feature bits.
 The XFRM code's listener will finish the setup on NETDEV_REGISTER.
 
+::
+
 		adapter->netdev->xfrmdev_ops = &ixgbe_xfrmdev_ops;
 		adapter->netdev->features |= NETIF_F_HW_ESP;
 		adapter->netdev->hw_enc_features |= NETIF_F_HW_ESP;
@@ -65,16 +71,20 @@ The XFRM code's listener will finish the setup on NETDEV_REGISTER.
 When new SAs are set up with a request for "offload" feature, the
 driver's xdo_dev_state_add() will be given the new SA to be offloaded
 and an indication of whether it is for Rx or Tx.  The driver should
+
 	- verify the algorithm is supported for offloads
 	- store the SA information (key, salt, target-ip, protocol, etc)
 	- enable the HW offload of the SA
 	- return status value:
+
+		===========   ===================================
 		0             success
 		-EOPNETSUPP   offload not supported, try SW IPsec
 		other         fail the request
+		===========   ===================================
 
 The driver can also set an offload_handle in the SA, an opaque void pointer
-that can be used to convey context into the fast-path offload requests.
+that can be used to convey context into the fast-path offload requests::
 
 		xs->xso.offload_handle = context;
 
@@ -88,7 +98,7 @@ return true of false to signify its support.
 
 When ready to send, the driver needs to inspect the Tx packet for the
 offload information, including the opaque context, and set up the packet
-send accordingly.
+send accordingly::
 
 		xs = xfrm_input_state(skb);
 		context = xs->xso.offload_handle;
@@ -105,18 +115,21 @@ the packet's skb.  At this point the data should be decrypted but the
 IPsec headers are still in the packet data; they are removed later up
 the stack in xfrm_input().
 
-	find and hold the SA that was used to the Rx skb
+	find and hold the SA that was used to the Rx skb::
+
 		get spi, protocol, and destination IP from packet headers
 		xs = find xs from (spi, protocol, dest_IP)
 		xfrm_state_hold(xs);
 
-	store the state information into the skb
+	store the state information into the skb::
+
 		sp = secpath_set(skb);
 		if (!sp) return;
 		sp->xvec[sp->len++] = xs;
 		sp->olen++;
 
-	indicate the success and/or error status of the offload
+	indicate the success and/or error status of the offload::
+
 		xo = xfrm_offload(skb);
 		xo->flags = CRYPTO_DONE;
 		xo->status = crypto_status;
@@ -136,5 +149,3 @@ hardware needs.
 As a netdev is set to DOWN the XFRM stack's netdev listener will call
 xdo_dev_state_delete() and xdo_dev_state_free() on any remaining offloaded
 states.
-
-
-- 
2.25.4


  parent reply	other threads:[~2020-05-01 14:45 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 14:44 [PATCH 00/37]net: manually convert files to ReST format - part 3 (final) Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 01/37] docs: networking: convert tuntap.txt to ReST Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 02/37] docs: networking: convert udplite.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 03/37] docs: networking: convert vrf.txt " Mauro Carvalho Chehab
2020-05-01 14:51   ` David Ahern
2020-05-01 14:44 ` [PATCH 04/37] docs: networking: convert vxlan.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 05/37] docs: networking: convert x25-iface.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 06/37] docs: networking: convert x25.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` Mauro Carvalho Chehab [this message]
2020-05-01 14:44 ` [PATCH 08/37] docs: networking: convert xfrm_proc.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 09/37] docs: networking: convert xfrm_sync.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 10/37] docs: networking: convert xfrm_sysctl.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 11/37] docs: networking: convert z8530drv.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 12/37] docs: networking: device drivers: convert 3com/3c509.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 13/37] docs: networking: device drivers: convert 3com/vortex.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 14/37] docs: networking: device drivers: convert amazon/ena.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 15/37] docs: networking: device drivers: convert aquantia/atlantic.txt " Mauro Carvalho Chehab
2020-05-01 20:42   ` [EXT] " Igor Russkikh
2020-05-01 14:44 ` [PATCH 16/37] docs: networking: device drivers: convert chelsio/cxgb.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 17/37] docs: networking: device drivers: convert cirrus/cs89x0.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 18/37] docs: networking: device drivers: convert davicom/dm9000.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 19/37] docs: networking: device drivers: convert dec/de4x5.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 20/37] docs: networking: device drivers: convert dec/dmfe.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 21/37] docs: networking: device drivers: convert dlink/dl2k.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 22/37] docs: networking: device drivers: convert freescale/dpaa.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 23/37] docs: networking: device drivers: convert freescale/gianfar.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 24/37] docs: networking: device drivers: convert intel/ipw2100.txt " Mauro Carvalho Chehab
2020-05-04  9:20   ` Kalle Valo
2020-05-01 14:44 ` [PATCH 25/37] docs: networking: device drivers: convert intel/ipw2200.txt " Mauro Carvalho Chehab
2020-05-04  9:21   ` Kalle Valo
2020-05-01 14:44 ` [PATCH 26/37] docs: networking: device drivers: convert microsoft/netvsc.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 27/37] docs: networking: device drivers: convert neterion/s2io.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 28/37] docs: networking: device drivers: convert neterion/vxge.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 29/37] docs: networking: device drivers: convert qualcomm/rmnet.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 30/37] docs: networking: device drivers: convert sb1000.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 31/37] docs: networking: device drivers: convert smsc/smc9.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 32/37] docs: networking: device drivers: convert ti/cpsw_switchdev.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 33/37] docs: networking: device drivers: convert ti/cpsw.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 34/37] docs: networking: device drivers: convert ti/tlan.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 35/37] docs: networking: device drivers: convert toshiba/spider_net.txt " Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 36/37] net: docs: add page_pool.rst to index.rst Mauro Carvalho Chehab
2020-05-01 14:44 ` [PATCH 37/37] docs: networking: arcnet-hardware.rst: don't duplicate chapter names Mauro Carvalho Chehab
2020-05-01 19:33 ` [PATCH 00/37]net: manually convert files to ReST format - part 3 (final) 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=0977c0a0683059dabe314ceb543d3e8f0abbc506.1588344146.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).