From patchwork Thu Apr 30 16:03:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13BA0C47247 for ; Thu, 30 Apr 2020 16:08:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E15C620757 for ; Thu, 30 Apr 2020 16:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262919; bh=/BdKHFSNyDbHVw0vpNwfTVV9aP7/cQNWyPNxpQEngRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zmVs8SdSHKvNo3sBfPaIqP6p9MEcAgXtfnvt7XVWkQxzZEV+RTvj7b4lPLykGQoG4 TejCsjEoHJTc9QEqZt7k96b9eBRK70P/ZLdXD8jj4JNef8eXhftmbAqJweB0zClhSV w5O9PEXPbBQFjNQS9FKoyJwuyToRXazeycxhxCOE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728138AbgD3QIj (ORCPT ); Thu, 30 Apr 2020 12:08:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:50402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbgD3QEh (ORCPT ); Thu, 30 Apr 2020 12:04:37 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BEB172076D; Thu, 30 Apr 2020 16:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262675; bh=/BdKHFSNyDbHVw0vpNwfTVV9aP7/cQNWyPNxpQEngRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TnzOnpNhxy52GvCuYqXJJByjrVzgoNe9uvMDhvOhWPzJxfC8d3KNyetfZwMVv6sC0 sa6STxUrXALFH9pNqbFIo7Qcfe5AMjdwkOz/ra7yV1ABaYO6KqyJt0XzpLDAZzCvun irMJ8miuGe8X8mKMgWTxGN9aLs+zO2ePQoDXVZiA= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxEB-01; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 01/37] docs: networking: convert l2tp.txt to ReST Date: Thu, 30 Apr 2020 18:03:56 +0200 Message-Id: <157b3aa863c15a4b8feeeb0cdd5475c2596c5dde.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - add a document title; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../networking/{l2tp.txt => l2tp.rst} | 145 ++++++++++-------- 2 files changed, 80 insertions(+), 66 deletions(-) rename Documentation/networking/{l2tp.txt => l2tp.rst} (79%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index e1ff08b94d90..0c5d7a037983 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -74,6 +74,7 @@ Contents: ipvlan ipvs-sysctl kcm + l2tp .. only:: subproject and html diff --git a/Documentation/networking/l2tp.txt b/Documentation/networking/l2tp.rst similarity index 79% rename from Documentation/networking/l2tp.txt rename to Documentation/networking/l2tp.rst index 9bc271cdc9a8..a48238a2ec09 100644 --- a/Documentation/networking/l2tp.txt +++ b/Documentation/networking/l2tp.rst @@ -1,3 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0 + +==== +L2TP +==== + This document describes how to use the kernel's L2TP drivers to provide L2TP functionality. L2TP is a protocol that tunnels one or more sessions over an IP tunnel. It is commonly used for VPNs @@ -121,14 +127,16 @@ Userspace may control behavior of the tunnel or session using setsockopt and ioctl on the PPPoX socket. The following socket options are supported:- -DEBUG - bitmask of debug message categories. See below. -SENDSEQ - 0 => don't send packets with sequence numbers - 1 => send packets with sequence numbers -RECVSEQ - 0 => receive packet sequence numbers are optional - 1 => drop receive packets without sequence numbers -LNSMODE - 0 => act as LAC. - 1 => act as LNS. -REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder. +========= =========================================================== +DEBUG bitmask of debug message categories. See below. +SENDSEQ - 0 => don't send packets with sequence numbers + - 1 => send packets with sequence numbers +RECVSEQ - 0 => receive packet sequence numbers are optional + - 1 => drop receive packets without sequence numbers +LNSMODE - 0 => act as LAC. + - 1 => act as LNS. +REORDERTO reorder timeout (in millisecs). If 0, don't try to reorder. +========= =========================================================== Only the DEBUG option is supported by the special tunnel management PPPoX socket. @@ -177,20 +185,22 @@ setsockopt on the PPPoX socket to set a debug mask. The following debug mask bits are available: +================ ============================== L2TP_MSG_DEBUG verbose debug (if compiled in) L2TP_MSG_CONTROL userspace - kernel interface L2TP_MSG_SEQ sequence numbers handling L2TP_MSG_DATA data packets +================ ============================== If enabled, files under a l2tp debugfs directory can be used to dump kernel state about L2TP tunnels and sessions. To access it, the -debugfs filesystem must first be mounted. +debugfs filesystem must first be mounted:: -# mount -t debugfs debugfs /debug + # mount -t debugfs debugfs /debug -Files under the l2tp directory can then be accessed. +Files under the l2tp directory can then be accessed:: -# cat /debug/l2tp/tunnels + # cat /debug/l2tp/tunnels The debugfs files should not be used by applications to obtain L2TP state information because the file format is subject to change. It is @@ -211,14 +221,14 @@ iproute2's ip utility to support this. To create an L2TPv3 ethernet pseudowire between local host 192.168.1.1 and peer 192.168.1.2, using IP addresses 10.5.1.1 and 10.5.1.2 for the -tunnel endpoints:- +tunnel endpoints:: -# ip l2tp add tunnel tunnel_id 1 peer_tunnel_id 1 udp_sport 5000 \ - udp_dport 5000 encap udp local 192.168.1.1 remote 192.168.1.2 -# ip l2tp add session tunnel_id 1 session_id 1 peer_session_id 1 -# ip -s -d show dev l2tpeth0 -# ip addr add 10.5.1.2/32 peer 10.5.1.1/32 dev l2tpeth0 -# ip li set dev l2tpeth0 up + # ip l2tp add tunnel tunnel_id 1 peer_tunnel_id 1 udp_sport 5000 \ + udp_dport 5000 encap udp local 192.168.1.1 remote 192.168.1.2 + # ip l2tp add session tunnel_id 1 session_id 1 peer_session_id 1 + # ip -s -d show dev l2tpeth0 + # ip addr add 10.5.1.2/32 peer 10.5.1.1/32 dev l2tpeth0 + # ip li set dev l2tpeth0 up Choose IP addresses to be the address of a local IP interface and that of the remote system. The IP addresses of the l2tpeth0 interface can be @@ -228,75 +238,78 @@ Repeat the above at the peer, with ports, tunnel/session ids and IP addresses reversed. The tunnel and session IDs can be any non-zero 32-bit number, but the values must be reversed at the peer. +======================== =================== Host 1 Host2 +======================== =================== udp_sport=5000 udp_sport=5001 udp_dport=5001 udp_dport=5000 tunnel_id=42 tunnel_id=45 peer_tunnel_id=45 peer_tunnel_id=42 session_id=128 session_id=5196755 peer_session_id=5196755 peer_session_id=128 +======================== =================== When done at both ends of the tunnel, it should be possible to send -data over the network. e.g. +data over the network. e.g.:: -# ping 10.5.1.1 + # ping 10.5.1.1 Sample Userspace Code ===================== -1. Create tunnel management PPPoX socket +1. Create tunnel management PPPoX socket:: - kernel_fd = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OL2TP); - if (kernel_fd >= 0) { - struct sockaddr_pppol2tp sax; - struct sockaddr_in const *peer_addr; + kernel_fd = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OL2TP); + if (kernel_fd >= 0) { + struct sockaddr_pppol2tp sax; + struct sockaddr_in const *peer_addr; - peer_addr = l2tp_tunnel_get_peer_addr(tunnel); - memset(&sax, 0, sizeof(sax)); - sax.sa_family = AF_PPPOX; - sax.sa_protocol = PX_PROTO_OL2TP; - sax.pppol2tp.fd = udp_fd; /* fd of tunnel UDP socket */ - sax.pppol2tp.addr.sin_addr.s_addr = peer_addr->sin_addr.s_addr; - sax.pppol2tp.addr.sin_port = peer_addr->sin_port; - sax.pppol2tp.addr.sin_family = AF_INET; - sax.pppol2tp.s_tunnel = tunnel_id; - sax.pppol2tp.s_session = 0; /* special case: mgmt socket */ - sax.pppol2tp.d_tunnel = 0; - sax.pppol2tp.d_session = 0; /* special case: mgmt socket */ + peer_addr = l2tp_tunnel_get_peer_addr(tunnel); + memset(&sax, 0, sizeof(sax)); + sax.sa_family = AF_PPPOX; + sax.sa_protocol = PX_PROTO_OL2TP; + sax.pppol2tp.fd = udp_fd; /* fd of tunnel UDP socket */ + sax.pppol2tp.addr.sin_addr.s_addr = peer_addr->sin_addr.s_addr; + sax.pppol2tp.addr.sin_port = peer_addr->sin_port; + sax.pppol2tp.addr.sin_family = AF_INET; + sax.pppol2tp.s_tunnel = tunnel_id; + sax.pppol2tp.s_session = 0; /* special case: mgmt socket */ + sax.pppol2tp.d_tunnel = 0; + sax.pppol2tp.d_session = 0; /* special case: mgmt socket */ - if(connect(kernel_fd, (struct sockaddr *)&sax, sizeof(sax) ) < 0 ) { - perror("connect failed"); - result = -errno; - goto err; - } - } + if(connect(kernel_fd, (struct sockaddr *)&sax, sizeof(sax) ) < 0 ) { + perror("connect failed"); + result = -errno; + goto err; + } + } -2. Create session PPPoX data socket +2. Create session PPPoX data socket:: - struct sockaddr_pppol2tp sax; - int fd; + struct sockaddr_pppol2tp sax; + int fd; - /* Note, the target socket must be bound already, else it will not be ready */ - sax.sa_family = AF_PPPOX; - sax.sa_protocol = PX_PROTO_OL2TP; - sax.pppol2tp.fd = tunnel_fd; - sax.pppol2tp.addr.sin_addr.s_addr = addr->sin_addr.s_addr; - sax.pppol2tp.addr.sin_port = addr->sin_port; - sax.pppol2tp.addr.sin_family = AF_INET; - sax.pppol2tp.s_tunnel = tunnel_id; - sax.pppol2tp.s_session = session_id; - sax.pppol2tp.d_tunnel = peer_tunnel_id; - sax.pppol2tp.d_session = peer_session_id; + /* Note, the target socket must be bound already, else it will not be ready */ + sax.sa_family = AF_PPPOX; + sax.sa_protocol = PX_PROTO_OL2TP; + sax.pppol2tp.fd = tunnel_fd; + sax.pppol2tp.addr.sin_addr.s_addr = addr->sin_addr.s_addr; + sax.pppol2tp.addr.sin_port = addr->sin_port; + sax.pppol2tp.addr.sin_family = AF_INET; + sax.pppol2tp.s_tunnel = tunnel_id; + sax.pppol2tp.s_session = session_id; + sax.pppol2tp.d_tunnel = peer_tunnel_id; + sax.pppol2tp.d_session = peer_session_id; - /* session_fd is the fd of the session's PPPoL2TP socket. - * tunnel_fd is the fd of the tunnel UDP socket. - */ - fd = connect(session_fd, (struct sockaddr *)&sax, sizeof(sax)); - if (fd < 0 ) { - return -errno; - } - return 0; + /* session_fd is the fd of the session's PPPoL2TP socket. + * tunnel_fd is the fd of the tunnel UDP socket. + */ + fd = connect(session_fd, (struct sockaddr *)&sax, sizeof(sax)); + if (fd < 0 ) { + return -errno; + } + return 0; Internal Implementation ======================= From patchwork Thu Apr 30 16:03:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9DC6C47253 for ; Thu, 30 Apr 2020 16:04:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C00442076D for ; Thu, 30 Apr 2020 16:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262680; bh=sFuN0vBK+JwBRLNPQc/i7o6rOqaphy84PmOAJvpLo7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TuzOECfDfYGFYBclzuaNb4VqAhGbUmdeuQKYalH1geYFzf2dCuBO5jmGHN1B1T2xk st6c1RlgJ1GPAFVeBzODOYd+BXWNjecEHTCDAX/4cCzBMLWl0vvkTe1diIl5cLhhCw zZzsfcAFmHn86n9QTqlpIDqlvpWUWc6n98O4VwxY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727911AbgD3QEk (ORCPT ); Thu, 30 Apr 2020 12:04:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:50438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbgD3QEh (ORCPT ); Thu, 30 Apr 2020 12:04:37 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDD98208CA; Thu, 30 Apr 2020 16:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=sFuN0vBK+JwBRLNPQc/i7o6rOqaphy84PmOAJvpLo7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tY0oVDQIEQe0IOgIkcGS66w2Yi+puKEyzkMHYZ7arBix0cK6asc8NkbsCVqyROh4c pNT4G88lN11RiEj2Gu4rDqz6tmZAN2RmI3n5QoaAqWw/KpFiP7CncgcPBocbRXX4LW jSiZHgd3QsOiNMUgHUNLgmQr3H3GIJezV1CfckmM= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxEN-2j; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , Johannes Berg , netdev@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 04/37] docs: networking: convert mac80211-injection.txt to ReST Date: Thu, 30 Apr 2020 18:03:59 +0200 Message-Id: <015916acf01942ca53453444aa48f70e7bfa5221.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + ...1-injection.txt => mac80211-injection.rst} | 39 ++++++++++++------- MAINTAINERS | 2 +- net/mac80211/tx.c | 2 +- 4 files changed, 27 insertions(+), 17 deletions(-) rename Documentation/networking/{mac80211-injection.txt => mac80211-injection.rst} (68%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index b3608b177a8b..81c1834bfb57 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -77,6 +77,7 @@ Contents: l2tp lapb-module ltpc + mac80211-injection .. only:: subproject and html diff --git a/Documentation/networking/mac80211-injection.txt b/Documentation/networking/mac80211-injection.rst similarity index 68% rename from Documentation/networking/mac80211-injection.txt rename to Documentation/networking/mac80211-injection.rst index d58d78df9ca2..75d4edcae852 100644 --- a/Documentation/networking/mac80211-injection.txt +++ b/Documentation/networking/mac80211-injection.rst @@ -1,9 +1,12 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========================================= How to use packet injection with mac80211 ========================================= mac80211 now allows arbitrary packets to be injected down any Monitor Mode interface from userland. The packet you inject needs to be composed in the -following format: +following format:: [ radiotap header ] [ ieee80211 header ] @@ -18,15 +21,19 @@ radiotap headers and used to control injection: * IEEE80211_RADIOTAP_FLAGS - IEEE80211_RADIOTAP_F_FCS: FCS will be removed and recalculated - IEEE80211_RADIOTAP_F_WEP: frame will be encrypted if key available - IEEE80211_RADIOTAP_F_FRAG: frame will be fragmented if longer than the + ========================= =========================================== + IEEE80211_RADIOTAP_F_FCS FCS will be removed and recalculated + IEEE80211_RADIOTAP_F_WEP frame will be encrypted if key available + IEEE80211_RADIOTAP_F_FRAG frame will be fragmented if longer than the current fragmentation threshold. + ========================= =========================================== * IEEE80211_RADIOTAP_TX_FLAGS - IEEE80211_RADIOTAP_F_TX_NOACK: frame should be sent without waiting for + ============================= ======================================== + IEEE80211_RADIOTAP_F_TX_NOACK frame should be sent without waiting for an ACK even if it is a unicast frame + ============================= ======================================== * IEEE80211_RADIOTAP_RATE @@ -37,8 +44,10 @@ radiotap headers and used to control injection: HT rate for the transmission (only for devices without own rate control). Also some flags are parsed - IEEE80211_RADIOTAP_MCS_SGI: use short guard interval - IEEE80211_RADIOTAP_MCS_BW_40: send in HT40 mode + ============================ ======================== + IEEE80211_RADIOTAP_MCS_SGI use short guard interval + IEEE80211_RADIOTAP_MCS_BW_40 send in HT40 mode + ============================ ======================== * IEEE80211_RADIOTAP_DATA_RETRIES @@ -51,17 +60,17 @@ radiotap headers and used to control injection: without own rate control). Also other fields are parsed flags field - IEEE80211_RADIOTAP_VHT_FLAG_SGI: use short guard interval + IEEE80211_RADIOTAP_VHT_FLAG_SGI: use short guard interval bandwidth field - 1: send using 40MHz channel width - 4: send using 80MHz channel width - 11: send using 160MHz channel width + * 1: send using 40MHz channel width + * 4: send using 80MHz channel width + * 11: send using 160MHz channel width The injection code can also skip all other currently defined radiotap fields facilitating replay of captured radiotap headers directly. -Here is an example valid radiotap header defining some parameters +Here is an example valid radiotap header defining some parameters:: 0x00, 0x00, // <-- radiotap version 0x0b, 0x00, // <- radiotap header length @@ -71,7 +80,7 @@ Here is an example valid radiotap header defining some parameters 0x01 //<-- antenna The ieee80211 header follows immediately afterwards, looking for example like -this: +this:: 0x08, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -84,10 +93,10 @@ Then lastly there is the payload. After composing the packet contents, it is sent by send()-ing it to a logical mac80211 interface that is in Monitor mode. Libpcap can also be used, (which is easier than doing the work to bind the socket to the right -interface), along the following lines: +interface), along the following lines::: ppcap = pcap_open_live(szInterfaceName, 800, 1, 20, szErrbuf); -... + ... r = pcap_inject(ppcap, u8aSendBuffer, nLength); You can also find a link to a complete inject application here: diff --git a/MAINTAINERS b/MAINTAINERS index 0db63acd07b0..1546ecb855b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10112,7 +10112,7 @@ S: Maintained W: https://wireless.wiki.kernel.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git -F: Documentation/networking/mac80211-injection.txt +F: Documentation/networking/mac80211-injection.rst F: Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst F: drivers/net/wireless/mac80211_hwsim.[ch] F: include/net/mac80211.h diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 6dad67eb60b2..47f460c8bd74 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2144,7 +2144,7 @@ static bool ieee80211_parse_tx_radiotap(struct ieee80211_local *local, /* * Please update the file - * Documentation/networking/mac80211-injection.txt + * Documentation/networking/mac80211-injection.rst * when parsing new fields here. */ From patchwork Thu Apr 30 16:04:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E10B8C4724C for ; Thu, 30 Apr 2020 16:07:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0F5420775 for ; Thu, 30 Apr 2020 16:07:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262865; bh=VskrOSds+k6lATCBRxSNU8FwGkjkFNi0RCLoQYUzeio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2pmyX3C0XsPQhhGD2vvMWur7RjVMD3Yt4JmlqMPBz2NrkLJzG/WmEsX6ZJixFI87y a7s+YuvTNcvIdOnxl5JNzCBbZDUzEc3Dg4FyZpLFliA5dG3cDmsi/A0ViH8Xd6ZCYL NYRNKtThVLLMxkYjDK7b5aasVPaNEg+fczmg9GXs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728531AbgD3QHn (ORCPT ); Thu, 30 Apr 2020 12:07:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:50866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbgD3QEi (ORCPT ); Thu, 30 Apr 2020 12:04:38 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA6F3217BA; Thu, 30 Apr 2020 16:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=VskrOSds+k6lATCBRxSNU8FwGkjkFNi0RCLoQYUzeio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w96YBFQL43JPBzEzOIR2cQc1RJ1EREU8munTIHlc6DD2iW/w2zeeoTWGmN4q7IP9v /Vd7qXRQzofKcwb3CwxqsUeayJzgBMhkogOEWKx6gHc3/551p5K2eSZKWyAq3h5DUH Wi/MHtE9M2Qdtm2ZEGG2+AhB82t+i1tnsCZgEIEA= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxEi-6Z; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 08/37] docs: networking: convert netdev-features.txt to ReST Date: Thu, 30 Apr 2020 18:04:03 +0200 Message-Id: <6990088c4a50c1da5a563649189e5fd0c114ddf3.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Not much to be done here: - add SPDX header; - adjust titles and chapters, adding proper markups; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- .../networking/checksum-offloads.rst | 2 +- Documentation/networking/index.rst | 1 + ...etdev-features.txt => netdev-features.rst} | 19 +++++++++++-------- include/linux/netdev_features.h | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) rename Documentation/networking/{netdev-features.txt => netdev-features.rst} (95%) diff --git a/Documentation/networking/checksum-offloads.rst b/Documentation/networking/checksum-offloads.rst index 905c8a84b103..69b23cf6879e 100644 --- a/Documentation/networking/checksum-offloads.rst +++ b/Documentation/networking/checksum-offloads.rst @@ -59,7 +59,7 @@ recomputed for each resulting segment. See the skbuff.h comment (section 'E') for more details. A driver declares its offload capabilities in netdev->hw_features; see -Documentation/networking/netdev-features.txt for more. Note that a device +Documentation/networking/netdev-features.rst for more. Note that a device which only advertises NETIF_F_IP[V6]_CSUM must still obey the csum_start and csum_offset given in the SKB; if it tries to deduce these itself in hardware (as some NICs do) the driver should check that the values in the SKB match diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index e58f872d401d..4c6aa3db97d4 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -81,6 +81,7 @@ Contents: mpls-sysctl multiqueue netconsole + netdev-features .. only:: subproject and html diff --git a/Documentation/networking/netdev-features.txt b/Documentation/networking/netdev-features.rst similarity index 95% rename from Documentation/networking/netdev-features.txt rename to Documentation/networking/netdev-features.rst index 58dd1c1e3c65..a2d7d7160e39 100644 --- a/Documentation/networking/netdev-features.txt +++ b/Documentation/networking/netdev-features.rst @@ -1,3 +1,6 @@ +.. SPDX-License-Identifier: GPL-2.0 + +===================================================== Netdev features mess and how to get out from it alive ===================================================== @@ -6,8 +9,8 @@ Author: - Part I: Feature sets -====================== +Part I: Feature sets +==================== Long gone are the days when a network card would just take and give packets verbatim. Today's devices add multiple features and bugs (read: offloads) @@ -39,8 +42,8 @@ one used internally by network core: - Part II: Controlling enabled features -======================================= +Part II: Controlling enabled features +===================================== When current feature set (netdev->features) is to be changed, new set is calculated and filtered by calling ndo_fix_features callback @@ -65,8 +68,8 @@ driver except by means of ndo_fix_features callback. - Part III: Implementation hints -================================ +Part III: Implementation hints +============================== * ndo_fix_features: @@ -94,8 +97,8 @@ Errors returned are not (and cannot be) propagated anywhere except dmesg. - Part IV: Features -=================== +Part IV: Features +================= For current list of features, see include/linux/netdev_features.h. This section describes semantics of some of them. diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 9d53c5ad272c..2cc3cf80b49a 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -89,7 +89,7 @@ enum { * Add your fresh new feature above and remember to update * netdev_features_strings[] in net/core/ethtool.c and maybe * some feature mask #defines below. Please also describe it - * in Documentation/networking/netdev-features.txt. + * in Documentation/networking/netdev-features.rst. */ /**/NETDEV_FEATURE_COUNT From patchwork Thu Apr 30 16:04:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C741DC47247 for ; Thu, 30 Apr 2020 16:08:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A752C2082E for ; Thu, 30 Apr 2020 16:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262901; bh=qd7kn84OagFUysKXIXX2kLbZbPYWdZY7QoCvFH7ExWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RUjVQYZ2e/VGRtBOY3COpc7m/8E2nqxCREkkGBax8xLO3hjjCXrZz2h76HSMDpxHz Ff9oRa3kdjYTEtihWSQafQib3OmFGjioFsn4ArSBH8e5H1ENPXdt+tYvhi3b7RrHaW yA6tmy7MMo7vs8h9BT30mIwKvwf7gH5J3LNgxh4I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728015AbgD3QII (ORCPT ); Thu, 30 Apr 2020 12:08:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:50840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726827AbgD3QEh (ORCPT ); Thu, 30 Apr 2020 12:04:37 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E360021775; Thu, 30 Apr 2020 16:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=qd7kn84OagFUysKXIXX2kLbZbPYWdZY7QoCvFH7ExWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zewLwoR5gpbg89jj3RBoyAkOKlKbBwaG78zDZhml4NmCTEad7J+eJD7if6juXweYC N5dIZO62A0PUXSOMPrR7EIRUS6aXDqrFJzt376vFrVybtHem9J2yi7RqO9xZPThPcD EuxIEz7n0UdctdfrFxfavc2DyKxoSfIQMaEngU1s= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxEn-7O; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Oliver Hartkopp , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 09/37] docs: networking: convert netdevices.txt to ReST Date: Thu, 30 Apr 2020 18:04:04 +0200 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - adjust title markup; - mark lists as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/can.rst | 2 +- Documentation/networking/index.rst | 1 + .../{netdevices.txt => netdevices.rst} | 21 ++++++++++++------- 3 files changed, 16 insertions(+), 8 deletions(-) rename Documentation/networking/{netdevices.txt => netdevices.rst} (89%) diff --git a/Documentation/networking/can.rst b/Documentation/networking/can.rst index 2fd0b51a8c52..ff05cbd05e0d 100644 --- a/Documentation/networking/can.rst +++ b/Documentation/networking/can.rst @@ -1058,7 +1058,7 @@ drivers you mainly have to deal with: - TX: Put the CAN frame from the socket buffer to the CAN controller. - RX: Put the CAN frame from the CAN controller to the socket buffer. -See e.g. at Documentation/networking/netdevices.txt . The differences +See e.g. at Documentation/networking/netdevices.rst . The differences for writing CAN network device driver are described below: diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 4c6aa3db97d4..5a320553ffba 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -82,6 +82,7 @@ Contents: multiqueue netconsole netdev-features + netdevices .. only:: subproject and html diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.rst similarity index 89% rename from Documentation/networking/netdevices.txt rename to Documentation/networking/netdevices.rst index 7fec2061a334..5a85fcc80c76 100644 --- a/Documentation/networking/netdevices.txt +++ b/Documentation/networking/netdevices.rst @@ -1,5 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 +===================================== Network Devices, the Kernel, and You! +===================================== Introduction @@ -75,11 +78,12 @@ ndo_start_xmit: Don't use it for new drivers. Context: Process with BHs disabled or BH (timer), - will be called with interrupts disabled by netconsole. + will be called with interrupts disabled by netconsole. - Return codes: - o NETDEV_TX_OK everything ok. - o NETDEV_TX_BUSY Cannot transmit packet, try later + Return codes: + + * NETDEV_TX_OK everything ok. + * NETDEV_TX_BUSY Cannot transmit packet, try later Usually a bug, means queue start/stop flow control is broken in the driver. Note: the driver must NOT put the skb in its DMA ring. @@ -95,10 +99,13 @@ ndo_set_rx_mode: struct napi_struct synchronization rules ======================================== napi->poll: - Synchronization: NAPI_STATE_SCHED bit in napi->state. Device + Synchronization: + NAPI_STATE_SCHED bit in napi->state. Device driver's ndo_stop method will invoke napi_disable() on all NAPI instances which will do a sleeping poll on the NAPI_STATE_SCHED napi->state bit, waiting for all pending NAPI activity to cease. - Context: softirq - will be called with interrupts disabled by netconsole. + + Context: + softirq + will be called with interrupts disabled by netconsole. From patchwork Thu Apr 30 16:04:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9166C4724C for ; Thu, 30 Apr 2020 16:07:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C36920775 for ; Thu, 30 Apr 2020 16:07:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262879; bh=yFi98m0dMb+zcVAw2IGTkDdl9KK+Ps1SAKk7Nkf6Fwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0uJ4Bq9xnXZzrCPOseLUulqZ+rhT3W8Pk99r3N5RNEhFmzlnY5T4NNzNHFT36xgUW DV/Lo0j/BC8LGNSkN9vDogW4TMDfZGFu/7YIu0h8gFicJgxTgEL8q1e5G63PYcJPEf kN/qrsTRiENv4TZAEwdEp3JYw5TjErFfa9E0I0/0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728067AbgD3QH6 (ORCPT ); Thu, 30 Apr 2020 12:07:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbgD3QEh (ORCPT ); Thu, 30 Apr 2020 12:04:37 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC6C124953; Thu, 30 Apr 2020 16:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=yFi98m0dMb+zcVAw2IGTkDdl9KK+Ps1SAKk7Nkf6Fwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1SVqXcieMewTFeMAntOPvpidXTy5lXp7EMl/8ayfKMojHuwESUkG9XscmShiHFbVk /0PIShBLnclxg1Clp4W+xd5TVFMRUgrW9V37gCrdfljiPkHIbOpfpo82av6k6uxA7K lbuYLggRuZg6LkOqbeCm09ff7Z1L60nBWOMMFnWI= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxEu-8O; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 10/37] docs: networking: convert netfilter-sysctl.txt to ReST Date: Thu, 30 Apr 2020 18:04:05 +0200 Message-Id: <5e9c77b49925c2154cc30b7c18f89d9db29ce9ed.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Not much to be done here: - add SPDX header; - add a document title; - add a chapter markup; - mark tables as such; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../{netfilter-sysctl.txt => netfilter-sysctl.rst} | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) rename Documentation/networking/{netfilter-sysctl.txt => netfilter-sysctl.rst} (62%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 5a320553ffba..1ae0cbef8c04 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -83,6 +83,7 @@ Contents: netconsole netdev-features netdevices + netfilter-sysctl .. only:: subproject and html diff --git a/Documentation/networking/netfilter-sysctl.txt b/Documentation/networking/netfilter-sysctl.rst similarity index 62% rename from Documentation/networking/netfilter-sysctl.txt rename to Documentation/networking/netfilter-sysctl.rst index 55791e50e169..beb6d7b275d4 100644 --- a/Documentation/networking/netfilter-sysctl.txt +++ b/Documentation/networking/netfilter-sysctl.rst @@ -1,8 +1,15 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========================= +Netfilter Sysfs variables +========================= + /proc/sys/net/netfilter/* Variables: +==================================== nf_log_all_netns - BOOLEAN - 0 - disabled (default) - not 0 - enabled + - 0 - disabled (default) + - not 0 - enabled By default, only init_net namespace can log packets into kernel log with LOG target; this aims to prevent containers from flooding host From patchwork Thu Apr 30 16:04:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE867C4724C for ; Thu, 30 Apr 2020 16:07:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABF542076D for ; Thu, 30 Apr 2020 16:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262846; bh=AKLSRgDRMriBe2VoqmymF5TgViMK8zitSGO+zOckj4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GNZUrafK38CtoNnzauQfKdw2ZNmMf8DsKfsylvJE/G1ZjIDVnA/wVHF0FFq8fEfyk u+MgNJrWK7f7gcj76aBnn/bbDNWjhfPniOAc8xDZJRUR8KKadjNKXu+OxKc2EIcPDo Xm7TepyKUud4pg78xav9Y9+JG5oBte0C/KN4eq1A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728084AbgD3QH0 (ORCPT ); Thu, 30 Apr 2020 12:07:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:50840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726907AbgD3QEi (ORCPT ); Thu, 30 Apr 2020 12:04:38 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1ECD424960; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=AKLSRgDRMriBe2VoqmymF5TgViMK8zitSGO+zOckj4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gmz2JniklUmBdPRbKa2AoCq051T0Mmlq6iC1/X2xhwrCFRLKwyuDwgMbn58tU1E3O H9Fzrae1h+3NJ3h1TRtpKdoGgRXO0knnexhH6niXDR9202ah23t1yFNgpIHGChaSG+ v8JUvHp7ECphYKGa1/MlifkBkLyBs8MF5kmRhRYc= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxF3-9x; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 12/37] docs: networking: convert nf_conntrack-sysctl.txt to ReST Date: Thu, 30 Apr 2020 18:04:07 +0200 Message-Id: <4ce89bb56e2bf138c78dbf9ad9d654051b786be1.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - add a document title; - mark lists as such; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + ...ack-sysctl.txt => nf_conntrack-sysctl.rst} | 51 +++++++++++-------- 2 files changed, 30 insertions(+), 22 deletions(-) rename Documentation/networking/{nf_conntrack-sysctl.txt => nf_conntrack-sysctl.rst} (85%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index d98509f15363..e5128bb7e7df 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -85,6 +85,7 @@ Contents: netdevices netfilter-sysctl netif-msg + nf_conntrack-sysctl .. only:: subproject and html diff --git a/Documentation/networking/nf_conntrack-sysctl.txt b/Documentation/networking/nf_conntrack-sysctl.rst similarity index 85% rename from Documentation/networking/nf_conntrack-sysctl.txt rename to Documentation/networking/nf_conntrack-sysctl.rst index f75c2ce6e136..11a9b76786cb 100644 --- a/Documentation/networking/nf_conntrack-sysctl.txt +++ b/Documentation/networking/nf_conntrack-sysctl.rst @@ -1,8 +1,15 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=================================== +Netfilter Conntrack Sysfs variables +=================================== + /proc/sys/net/netfilter/nf_conntrack_* Variables: +================================================= nf_conntrack_acct - BOOLEAN - 0 - disabled (default) - not 0 - enabled + - 0 - disabled (default) + - not 0 - enabled Enable connection tracking flow accounting. 64-bit byte and packet counters per flow are added. @@ -16,8 +23,8 @@ nf_conntrack_buckets - INTEGER This sysctl is only writeable in the initial net namespace. nf_conntrack_checksum - BOOLEAN - 0 - disabled - not 0 - enabled (default) + - 0 - disabled + - not 0 - enabled (default) Verify checksum of incoming packets. Packets with bad checksums are in INVALID state. If this is enabled, such packets will not be @@ -27,8 +34,8 @@ nf_conntrack_count - INTEGER (read-only) Number of currently allocated flow entries. nf_conntrack_events - BOOLEAN - 0 - disabled - not 0 - enabled (default) + - 0 - disabled + - not 0 - enabled (default) If this option is enabled, the connection tracking code will provide userspace with connection tracking events via ctnetlink. @@ -62,8 +69,8 @@ nf_conntrack_generic_timeout - INTEGER (seconds) protocols. nf_conntrack_helper - BOOLEAN - 0 - disabled (default) - not 0 - enabled + - 0 - disabled (default) + - not 0 - enabled Enable automatic conntrack helper assignment. If disabled it is required to set up iptables rules to assign @@ -81,14 +88,14 @@ nf_conntrack_icmpv6_timeout - INTEGER (seconds) Default for ICMP6 timeout. nf_conntrack_log_invalid - INTEGER - 0 - disable (default) - 1 - log ICMP packets - 6 - log TCP packets - 17 - log UDP packets - 33 - log DCCP packets - 41 - log ICMPv6 packets - 136 - log UDPLITE packets - 255 - log packets of any protocol + - 0 - disable (default) + - 1 - log ICMP packets + - 6 - log TCP packets + - 17 - log UDP packets + - 33 - log DCCP packets + - 41 - log ICMPv6 packets + - 136 - log UDPLITE packets + - 255 - log packets of any protocol Log invalid packets of a type specified by value. @@ -97,15 +104,15 @@ nf_conntrack_max - INTEGER nf_conntrack_buckets value * 4. nf_conntrack_tcp_be_liberal - BOOLEAN - 0 - disabled (default) - not 0 - enabled + - 0 - disabled (default) + - not 0 - enabled Be conservative in what you do, be liberal in what you accept from others. If it's non-zero, we mark only out of window RST segments as INVALID. nf_conntrack_tcp_loose - BOOLEAN - 0 - disabled - not 0 - enabled (default) + - 0 - disabled + - not 0 - enabled (default) If it is set to zero, we disable picking up already established connections. @@ -148,8 +155,8 @@ nf_conntrack_tcp_timeout_unacknowledged - INTEGER (seconds) default 300 nf_conntrack_timestamp - BOOLEAN - 0 - disabled (default) - not 0 - enabled + - 0 - disabled (default) + - not 0 - enabled Enable connection tracking flow timestamping. From patchwork Thu Apr 30 16:04:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220200 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85D95C4724C for ; Thu, 30 Apr 2020 16:05:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 661152076D for ; Thu, 30 Apr 2020 16:05:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262723; bh=g9zsgpMU0pRn05Q4I3LMUZnpSVfK6mm2505LsXBMD94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IZpo95KahtN/OivO/NhtqFfAjjIVjuvWcwK3UJBYg3V4fQ664oF+kz/+cNHUGMPq/ GTsmtHYvxq3UEXHI3iNS+4FK9q+cjL1RUs1FhGATujaNRZhegtvNoPILQgjsYPl9sf tuDbvqfs7de6t9infFfgpSPp6EjVqbdo/SbwaZEw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727999AbgD3QEl (ORCPT ); Thu, 30 Apr 2020 12:04:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:50876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbgD3QEi (ORCPT ); Thu, 30 Apr 2020 12:04:38 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25B2E24962; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=g9zsgpMU0pRn05Q4I3LMUZnpSVfK6mm2505LsXBMD94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ECQ+zWV1v8xBEkDa4frh21wMgN4qKZo8CjC6BwGA6TkLwWMmKzPbJCEEMnJiO2LDq 0RenjuWdT1Jgkmy4um/yCCUIUm+D2JOpVPYYEIqf6/Zvv/GpW1MMz2lPMR7bW9p3q0 /FS0iuJJST5yLJRe77LY+elwc7IPZRZKeiv3wxpk= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxFD-Bc; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 14/37] docs: networking: convert openvswitch.txt to ReST Date: Thu, 30 Apr 2020 18:04:09 +0200 Message-Id: <8ef8171942cf528a54c569cae56f8864ed9c74f2.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../{openvswitch.txt => openvswitch.rst} | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) rename Documentation/networking/{openvswitch.txt => openvswitch.rst} (95%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index c4e8a43741be..b7f558480aca 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -87,6 +87,7 @@ Contents: netif-msg nf_conntrack-sysctl nf_flowtable + openvswitch .. only:: subproject and html diff --git a/Documentation/networking/openvswitch.txt b/Documentation/networking/openvswitch.rst similarity index 95% rename from Documentation/networking/openvswitch.txt rename to Documentation/networking/openvswitch.rst index b3b9ac61d29d..1a8353dbf1b6 100644 --- a/Documentation/networking/openvswitch.txt +++ b/Documentation/networking/openvswitch.rst @@ -1,3 +1,6 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============================================= Open vSwitch datapath developer documentation ============================================= @@ -80,13 +83,13 @@ The header file defines the exact format of the flow key attributes. For informal explanatory purposes here, we write them as comma-separated strings, with parentheses indicating arguments and nesting. For example, the following could represent a flow key -corresponding to a TCP packet that arrived on vport 1: +corresponding to a TCP packet that arrived on vport 1:: in_port(1), eth(src=e0:91:f5:21:d0:b2, dst=00:02:e3:0f:80:a4), eth_type(0x0800), ipv4(src=172.16.0.20, dst=172.18.0.52, proto=17, tos=0, frag=no), tcp(src=49163, dst=80) -Often we ellipsize arguments not important to the discussion, e.g.: +Often we ellipsize arguments not important to the discussion, e.g.:: in_port(1), eth(...), eth_type(0x0800), ipv4(...), tcp(...) @@ -151,20 +154,20 @@ Some care is needed to really maintain forward and backward compatibility for applications that follow the rules listed under "Flow key compatibility" above. -The basic rule is obvious: +The basic rule is obvious:: - ------------------------------------------------------------------ + ================================================================== New network protocol support must only supplement existing flow key attributes. It must not change the meaning of already defined flow key attributes. - ------------------------------------------------------------------ + ================================================================== This rule does have less-obvious consequences so it is worth working through a few examples. Suppose, for example, that the kernel module did not already implement VLAN parsing. Instead, it just interpreted the 802.1Q TPID (0x8100) as the Ethertype then stopped parsing the packet. The flow key for any packet with an 802.1Q header would look -essentially like this, ignoring metadata: +essentially like this, ignoring metadata:: eth(...), eth_type(0x8100) @@ -172,7 +175,7 @@ Naively, to add VLAN support, it makes sense to add a new "vlan" flow key attribute to contain the VLAN tag, then continue to decode the encapsulated headers beyond the VLAN tag using the existing field definitions. With this change, a TCP packet in VLAN 10 would have a -flow key much like this: +flow key much like this:: eth(...), vlan(vid=10, pcp=0), eth_type(0x0800), ip(proto=6, ...), tcp(...) @@ -187,7 +190,7 @@ across kernel versions even though it follows the compatibility rules. The solution is to use a set of nested attributes. This is, for example, why 802.1Q support uses nested attributes. A TCP packet in -VLAN 10 is actually expressed as: +VLAN 10 is actually expressed as:: eth(...), eth_type(0x8100), vlan(vid=10, pcp=0), encap(eth_type(0x0800), ip(proto=6, ...), tcp(...))) @@ -215,14 +218,14 @@ For example, consider a packet that contains an IP header that indicates protocol 6 for TCP, but which is truncated just after the IP header, so that the TCP header is missing. The flow key for this packet would include a tcp attribute with all-zero src and dst, like -this: +this:: eth(...), eth_type(0x0800), ip(proto=6, ...), tcp(src=0, dst=0) As another example, consider a packet with an Ethernet type of 0x8100, indicating that a VLAN TCI should follow, but which is truncated just after the Ethernet type. The flow key for this packet would include -an all-zero-bits vlan and an empty encap attribute, like this: +an all-zero-bits vlan and an empty encap attribute, like this:: eth(...), eth_type(0x8100), vlan(0), encap() From patchwork Thu Apr 30 16:04:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB03AC47255 for ; Thu, 30 Apr 2020 16:07:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A99432076D for ; Thu, 30 Apr 2020 16:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262834; bh=+k2ZI+83OqAv8SgP/rHh8+y4ELKKcvrshRN7zFngHYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TCAJbUc8L1B1mYnIx07ibyjlMCNPWjiTSQ9pV44OyhJRO55W+DWwFeO8znt6zi4uq 1m7UvaHDyIEQIzU3J9VxhDbGxacKPQYnwoRRpP9q/6nAO6SO/ksu1DBA0n7s4SVuqI no3Hm2FLHL/623/kgNdpMuQjXJE5lyyf+Xkol2Ek= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728467AbgD3QG4 (ORCPT ); Thu, 30 Apr 2020 12:06:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:50886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727082AbgD3QEi (ORCPT ); Thu, 30 Apr 2020 12:04:38 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27BFD24963; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=+k2ZI+83OqAv8SgP/rHh8+y4ELKKcvrshRN7zFngHYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f/BEeEmpqRnOcvdGABiLIRLxrXFqnPlXXZG/MFY+kDtHENeg5rFQseDf8nDz9A1wX inWAWNLAzBhizetP8QtoWMzNejg8HjlpRkfRj071V1NBVxIQnFHBX/fYTEC1w0v78I LBCblgg48z61suaBtuHuuObh/6tYt9vhW9xClUm0= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxFI-CT; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 15/37] docs: networking: convert operstates.txt to ReST Date: Thu, 30 Apr 2020 18:04:10 +0200 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - add a document title; - adjust chapters, adding proper markups; - mark lists as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../{operstates.txt => operstates.rst} | 45 ++++++++++++++----- 2 files changed, 34 insertions(+), 12 deletions(-) rename Documentation/networking/{operstates.txt => operstates.rst} (87%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index b7f558480aca..028a36821b9a 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -88,6 +88,7 @@ Contents: nf_conntrack-sysctl nf_flowtable openvswitch + operstates .. only:: subproject and html diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.rst similarity index 87% rename from Documentation/networking/operstates.txt rename to Documentation/networking/operstates.rst index b203d1334822..9c918f7cb0e8 100644 --- a/Documentation/networking/operstates.txt +++ b/Documentation/networking/operstates.rst @@ -1,5 +1,12 @@ +.. SPDX-License-Identifier: GPL-2.0 + +================== +Operational States +================== + 1. Introduction +=============== Linux distinguishes between administrative and operational state of an interface. Administrative state is the result of "ip link set dev @@ -20,6 +27,7 @@ and changeable from userspace under certain rules. 2. Querying from userspace +========================== Both admin and operational state can be queried via the netlink operation RTM_GETLINK. It is also possible to subscribe to RTNLGRP_LINK @@ -30,16 +38,20 @@ These values contain interface state: ifinfomsg::if_flags & IFF_UP: Interface is admin up + ifinfomsg::if_flags & IFF_RUNNING: Interface is in RFC2863 operational state UP or UNKNOWN. This is for backward compatibility, routing daemons, dhcp clients can use this flag to determine whether they should use the interface. + ifinfomsg::if_flags & IFF_LOWER_UP: Driver has signaled netif_carrier_on() + ifinfomsg::if_flags & IFF_DORMANT: Driver has signaled netif_dormant_on() TLV IFLA_OPERSTATE +------------------ contains RFC2863 state of the interface in numeric representation: @@ -47,26 +59,33 @@ IF_OPER_UNKNOWN (0): Interface is in unknown state, neither driver nor userspace has set operational state. Interface must be considered for user data as setting operational state has not been implemented in every driver. + IF_OPER_NOTPRESENT (1): Unused in current kernel (notpresent interfaces normally disappear), just a numerical placeholder. + IF_OPER_DOWN (2): Interface is unable to transfer data on L1, f.e. ethernet is not plugged or interface is ADMIN down. + IF_OPER_LOWERLAYERDOWN (3): Interfaces stacked on an interface that is IF_OPER_DOWN show this state (f.e. VLAN). + IF_OPER_TESTING (4): Unused in current kernel. + IF_OPER_DORMANT (5): Interface is L1 up, but waiting for an external event, f.e. for a protocol to establish. (802.1X) + IF_OPER_UP (6): Interface is operational up and can be used. This TLV can also be queried via sysfs. TLV IFLA_LINKMODE +----------------- contains link policy. This is needed for userspace interaction described below. @@ -75,6 +94,7 @@ This TLV can also be queried via sysfs. 3. Kernel driver API +==================== Kernel drivers have access to two flags that map to IFF_LOWER_UP and IFF_DORMANT. These flags can be set from everywhere, even from @@ -126,6 +146,7 @@ netif_carrier_ok() && !netif_dormant(): 4. Setting from userspace +========================= Applications have to use the netlink interface to influence the RFC2863 operational state of an interface. Setting IFLA_LINKMODE to 1 @@ -139,18 +160,18 @@ are multicasted on the netlink group RTNLGRP_LINK. So basically a 802.1X supplicant interacts with the kernel like this: --subscribe to RTNLGRP_LINK --set IFLA_LINKMODE to 1 via RTM_SETLINK --query RTM_GETLINK once to get initial state --if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until - netlink multicast signals this state --do 802.1X, eventually abort if flags go down again --send RTM_SETLINK to set operstate to IF_OPER_UP if authentication - succeeds, IF_OPER_DORMANT otherwise --see how operstate and IFF_RUNNING is echoed via netlink multicast --set interface back to IF_OPER_DORMANT if 802.1X reauthentication - fails --restart if kernel changes IFF_LOWER_UP or IFF_DORMANT flag +- subscribe to RTNLGRP_LINK +- set IFLA_LINKMODE to 1 via RTM_SETLINK +- query RTM_GETLINK once to get initial state +- if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until + netlink multicast signals this state +- do 802.1X, eventually abort if flags go down again +- send RTM_SETLINK to set operstate to IF_OPER_UP if authentication + succeeds, IF_OPER_DORMANT otherwise +- see how operstate and IFF_RUNNING is echoed via netlink multicast +- set interface back to IF_OPER_DORMANT if 802.1X reauthentication + fails +- restart if kernel changes IFF_LOWER_UP or IFF_DORMANT flag if supplicant goes down, bring back IFLA_LINKMODE to 0 and IFLA_OPERSTATE to a sane value. From patchwork Thu Apr 30 16:04:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220196 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DCD3C47247 for ; Thu, 30 Apr 2020 16:06:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4210B2076D for ; Thu, 30 Apr 2020 16:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262767; bh=ndPSdK70Z/eKCDwQ4HjVxQ8dfg86axtPMh33iuJPvoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=v5nSKPTKHISHxcld7r9detUjF4UjeLbtJyuAnb1mbcAtYOj+1tVuUeTXTEctmwJ4y 0iMO//C9w1zl1tNcmeiEJp/n3BLRahZn2TN2144AkrIAHy0zUfXCgn8ORJzCefALd4 +foH5Htg5IZE414l9giQFxvdlgluzO3Yl0K7BB1Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728223AbgD3QFn (ORCPT ); Thu, 30 Apr 2020 12:05:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:50850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727103AbgD3QEj (ORCPT ); Thu, 30 Apr 2020 12:04:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 329A524969; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=ndPSdK70Z/eKCDwQ4HjVxQ8dfg86axtPMh33iuJPvoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ua0Fay3ByRY0KI/jocoMhJI5S8xzjaXCQHFzlsm4VY9+ynIGr3Kdh9sdu5OOuLzTP sVBL1DBQJQ8drQEVs2o5BNd7n+0bBFM/7+uWeN9W/doRf02WMMXprL84v7Br/P0+1D +EG5K8bhL/J/sstehBJtGHHSuSs6pAsEWhhqQBfI= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxFX-F2; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 18/37] docs: networking: convert pktgen.txt to ReST Date: Thu, 30 Apr 2020 18:04:13 +0200 Message-Id: <087ccb2cf7d8af562e55ac99afefc3b2255e42ff.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - adjust title markup; - use bold markups on a few places; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../networking/{pktgen.txt => pktgen.rst} | 316 +++++++++--------- net/Kconfig | 2 +- net/core/pktgen.c | 2 +- samples/pktgen/README.rst | 2 +- 5 files changed, 168 insertions(+), 155 deletions(-) rename Documentation/networking/{pktgen.txt => pktgen.rst} (62%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index e460026331c6..696181a96e3c 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -91,6 +91,7 @@ Contents: operstates packet_mmap phonet + pktgen .. only:: subproject and html diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.rst similarity index 62% rename from Documentation/networking/pktgen.txt rename to Documentation/networking/pktgen.rst index d2fd78f85aa4..7afa1c9f1183 100644 --- a/Documentation/networking/pktgen.txt +++ b/Documentation/networking/pktgen.rst @@ -1,7 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 - - HOWTO for the linux packet generator - ------------------------------------ +==================================== +HOWTO for the linux packet generator +==================================== Enable CONFIG_NET_PKTGEN to compile and build pktgen either in-kernel or as a module. A module is preferred; modprobe pktgen if needed. Once @@ -9,17 +10,18 @@ running, pktgen creates a thread for each CPU with affinity to that CPU. Monitoring and controlling is done via /proc. It is easiest to select a suitable sample script and configure that. -On a dual CPU: +On a dual CPU:: -ps aux | grep pkt -root 129 0.3 0.0 0 0 ? SW 2003 523:20 [kpktgend_0] -root 130 0.3 0.0 0 0 ? SW 2003 509:50 [kpktgend_1] + ps aux | grep pkt + root 129 0.3 0.0 0 0 ? SW 2003 523:20 [kpktgend_0] + root 130 0.3 0.0 0 0 ? SW 2003 509:50 [kpktgend_1] -For monitoring and control pktgen creates: +For monitoring and control pktgen creates:: + /proc/net/pktgen/pgctrl /proc/net/pktgen/kpktgend_X - /proc/net/pktgen/ethX + /proc/net/pktgen/ethX Tuning NIC for max performance @@ -28,7 +30,8 @@ Tuning NIC for max performance The default NIC settings are (likely) not tuned for pktgen's artificial overload type of benchmarking, as this could hurt the normal use-case. -Specifically increasing the TX ring buffer in the NIC: +Specifically increasing the TX ring buffer in the NIC:: + # ethtool -G ethX tx 1024 A larger TX ring can improve pktgen's performance, while it can hurt @@ -46,7 +49,8 @@ This cleanup issue is specifically the case for the driver ixgbe and the cleanup interval is affected by the ethtool --coalesce setting of parameter "rx-usecs". -For ixgbe use e.g. "30" resulting in approx 33K interrupts/sec (1/30*10^6): +For ixgbe use e.g. "30" resulting in approx 33K interrupts/sec (1/30*10^6):: + # ethtool -C ethX rx-usecs 30 @@ -55,7 +59,7 @@ Kernel threads Pktgen creates a thread for each CPU with affinity to that CPU. Which is controlled through procfile /proc/net/pktgen/kpktgend_X. -Example: /proc/net/pktgen/kpktgend_0 +Example: /proc/net/pktgen/kpktgend_0:: Running: Stopped: eth4@0 @@ -64,6 +68,7 @@ Example: /proc/net/pktgen/kpktgend_0 Most important are the devices assigned to the thread. The two basic thread commands are: + * add_device DEVICE@NAME -- adds a single device * rem_device_all -- remove all associated devices @@ -73,7 +78,7 @@ be unique. To support adding the same device to multiple threads, which is useful with multi queue NICs, the device naming scheme is extended with "@": - device@something +device@something The part after "@" can be anything, but it is custom to use the thread number. @@ -83,30 +88,30 @@ Viewing devices The Params section holds configured information. The Current section holds running statistics. The Result is printed after a run or after -interruption. Example: +interruption. Example:: -/proc/net/pktgen/eth4@0 + /proc/net/pktgen/eth4@0 - Params: count 100000 min_pkt_size: 60 max_pkt_size: 60 - frags: 0 delay: 0 clone_skb: 64 ifname: eth4@0 - flows: 0 flowlen: 0 - queue_map_min: 0 queue_map_max: 0 - dst_min: 192.168.81.2 dst_max: - src_min: src_max: - src_mac: 90:e2:ba:0a:56:b4 dst_mac: 00:1b:21:3c:9d:f8 - udp_src_min: 9 udp_src_max: 109 udp_dst_min: 9 udp_dst_max: 9 - src_mac_count: 0 dst_mac_count: 0 - Flags: UDPSRC_RND NO_TIMESTAMP QUEUE_MAP_CPU - Current: - pkts-sofar: 100000 errors: 0 - started: 623913381008us stopped: 623913396439us idle: 25us - seq_num: 100001 cur_dst_mac_offset: 0 cur_src_mac_offset: 0 - cur_saddr: 192.168.8.3 cur_daddr: 192.168.81.2 - cur_udp_dst: 9 cur_udp_src: 42 - cur_queue_map: 0 - flows: 0 - Result: OK: 15430(c15405+d25) usec, 100000 (60byte,0frags) - 6480562pps 3110Mb/sec (3110669760bps) errors: 0 + Params: count 100000 min_pkt_size: 60 max_pkt_size: 60 + frags: 0 delay: 0 clone_skb: 64 ifname: eth4@0 + flows: 0 flowlen: 0 + queue_map_min: 0 queue_map_max: 0 + dst_min: 192.168.81.2 dst_max: + src_min: src_max: + src_mac: 90:e2:ba:0a:56:b4 dst_mac: 00:1b:21:3c:9d:f8 + udp_src_min: 9 udp_src_max: 109 udp_dst_min: 9 udp_dst_max: 9 + src_mac_count: 0 dst_mac_count: 0 + Flags: UDPSRC_RND NO_TIMESTAMP QUEUE_MAP_CPU + Current: + pkts-sofar: 100000 errors: 0 + started: 623913381008us stopped: 623913396439us idle: 25us + seq_num: 100001 cur_dst_mac_offset: 0 cur_src_mac_offset: 0 + cur_saddr: 192.168.8.3 cur_daddr: 192.168.81.2 + cur_udp_dst: 9 cur_udp_src: 42 + cur_queue_map: 0 + flows: 0 + Result: OK: 15430(c15405+d25) usec, 100000 (60byte,0frags) + 6480562pps 3110Mb/sec (3110669760bps) errors: 0 Configuring devices @@ -114,11 +119,12 @@ Configuring devices This is done via the /proc interface, and most easily done via pgset as defined in the sample scripts. You need to specify PGDEV environment variable to use functions from sample -scripts, i.e.: -export PGDEV=/proc/net/pktgen/eth4@0 -source samples/pktgen/functions.sh +scripts, i.e.:: -Examples: + export PGDEV=/proc/net/pktgen/eth4@0 + source samples/pktgen/functions.sh + +Examples:: pg_ctrl start starts injection. pg_ctrl stop aborts injection. Also, ^C aborts generator. @@ -126,17 +132,17 @@ Examples: pgset "clone_skb 1" sets the number of copies of the same packet pgset "clone_skb 0" use single SKB for all transmits pgset "burst 8" uses xmit_more API to queue 8 copies of the same - packet and update HW tx queue tail pointer once. - "burst 1" is the default + packet and update HW tx queue tail pointer once. + "burst 1" is the default pgset "pkt_size 9014" sets packet size to 9014 pgset "frags 5" packet will consist of 5 fragments pgset "count 200000" sets number of packets to send, set to zero - for continuous sends until explicitly stopped. + for continuous sends until explicitly stopped. pgset "delay 5000" adds delay to hard_start_xmit(). nanoseconds pgset "dst 10.0.0.1" sets IP destination address - (BEWARE! This generator is very aggressive!) + (BEWARE! This generator is very aggressive!) pgset "dst_min 10.0.0.1" Same as dst pgset "dst_max 10.0.0.254" Set the maximum destination IP. @@ -149,46 +155,46 @@ Examples: pgset "queue_map_min 0" Sets the min value of tx queue interval pgset "queue_map_max 7" Sets the max value of tx queue interval, for multiqueue devices - To select queue 1 of a given device, - use queue_map_min=1 and queue_map_max=1 + To select queue 1 of a given device, + use queue_map_min=1 and queue_map_max=1 pgset "src_mac_count 1" Sets the number of MACs we'll range through. - The 'minimum' MAC is what you set with srcmac. + The 'minimum' MAC is what you set with srcmac. pgset "dst_mac_count 1" Sets the number of MACs we'll range through. - The 'minimum' MAC is what you set with dstmac. + The 'minimum' MAC is what you set with dstmac. pgset "flag [name]" Set a flag to determine behaviour. Current flags - are: IPSRC_RND # IP source is random (between min/max) - IPDST_RND # IP destination is random - UDPSRC_RND, UDPDST_RND, - MACSRC_RND, MACDST_RND - TXSIZE_RND, IPV6, - MPLS_RND, VID_RND, SVID_RND - FLOW_SEQ, - QUEUE_MAP_RND # queue map random - QUEUE_MAP_CPU # queue map mirrors smp_processor_id() - UDPCSUM, - IPSEC # IPsec encapsulation (needs CONFIG_XFRM) - NODE_ALLOC # node specific memory allocation - NO_TIMESTAMP # disable timestamping + are: IPSRC_RND # IP source is random (between min/max) + IPDST_RND # IP destination is random + UDPSRC_RND, UDPDST_RND, + MACSRC_RND, MACDST_RND + TXSIZE_RND, IPV6, + MPLS_RND, VID_RND, SVID_RND + FLOW_SEQ, + QUEUE_MAP_RND # queue map random + QUEUE_MAP_CPU # queue map mirrors smp_processor_id() + UDPCSUM, + IPSEC # IPsec encapsulation (needs CONFIG_XFRM) + NODE_ALLOC # node specific memory allocation + NO_TIMESTAMP # disable timestamping pgset 'flag ![name]' Clear a flag to determine behaviour. - Note that you might need to use single quote in - interactive mode, so that your shell wouldn't expand - the specified flag as a history command. + Note that you might need to use single quote in + interactive mode, so that your shell wouldn't expand + the specified flag as a history command. pgset "spi [SPI_VALUE]" Set specific SA used to transform packet. pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then - cycle through the port range. + cycle through the port range. pgset "udp_src_max 9" set UDP source port max. pgset "udp_dst_min 9" set UDP destination port min, If < udp_dst_max, then - cycle through the port range. + cycle through the port range. pgset "udp_dst_max 9" set UDP destination port max. pgset "mpls 0001000a,0002000a,0000000a" set MPLS labels (in this example - outer label=16,middle label=32, + outer label=16,middle label=32, inner label=0 (IPv4 NULL)) Note that there must be no spaces between the arguments. Leading zeros are required. @@ -232,10 +238,14 @@ A collection of tutorial scripts and helpers for pktgen is in the samples/pktgen directory. The helper parameters.sh file support easy and consistent parameter parsing across the sample scripts. -Usage example and help: +Usage example and help:: + ./pktgen_sample01_simple.sh -i eth4 -m 00:1B:21:3C:9D:F8 -d 192.168.8.2 -Usage: ./pktgen_sample01_simple.sh [-vx] -i ethX +Usage::: + + ./pktgen_sample01_simple.sh [-vx] -i ethX + -i : ($DEV) output interface/device (required) -s : ($PKT_SIZE) packet size -d : ($DEST_IP) destination IP @@ -250,13 +260,13 @@ The global variables being set are also listed. E.g. the required interface/device parameter "-i" sets variable $DEV. Copy the pktgen_sampleXX scripts and modify them to fit your own needs. -The old scripts: +The old scripts:: -pktgen.conf-1-2 # 1 CPU 2 dev -pktgen.conf-1-1-rdos # 1 CPU 1 dev w. route DoS -pktgen.conf-1-1-ip6 # 1 CPU 1 dev ipv6 -pktgen.conf-1-1-ip6-rdos # 1 CPU 1 dev ipv6 w. route DoS -pktgen.conf-1-1-flows # 1 CPU 1 dev multiple flows. + pktgen.conf-1-2 # 1 CPU 2 dev + pktgen.conf-1-1-rdos # 1 CPU 1 dev w. route DoS + pktgen.conf-1-1-ip6 # 1 CPU 1 dev ipv6 + pktgen.conf-1-1-ip6-rdos # 1 CPU 1 dev ipv6 w. route DoS + pktgen.conf-1-1-flows # 1 CPU 1 dev multiple flows. Interrupt affinity @@ -271,10 +281,10 @@ to the running threads CPU (directly from smp_processor_id()). Enable IPsec ============ Default IPsec transformation with ESP encapsulation plus transport mode -can be enabled by simply setting: +can be enabled by simply setting:: -pgset "flag IPSEC" -pgset "flows 1" + pgset "flag IPSEC" + pgset "flows 1" To avoid breaking existing testbed scripts for using AH type and tunnel mode, you can use "pgset spi SPI_VALUE" to specify which transformation mode @@ -284,115 +294,117 @@ to employ. Current commands and configuration options ========================================== -** Pgcontrol commands: +**Pgcontrol commands**:: -start -stop -reset + start + stop + reset -** Thread commands: +**Thread commands**:: -add_device -rem_device_all + add_device + rem_device_all -** Device commands: +**Device commands**:: -count -clone_skb -burst -debug + count + clone_skb + burst + debug -frags -delay + frags + delay -src_mac_count -dst_mac_count + src_mac_count + dst_mac_count -pkt_size -min_pkt_size -max_pkt_size + pkt_size + min_pkt_size + max_pkt_size -queue_map_min -queue_map_max -skb_priority + queue_map_min + queue_map_max + skb_priority -tos (ipv4) -traffic_class (ipv6) + tos (ipv4) + traffic_class (ipv6) -mpls + mpls -udp_src_min -udp_src_max + udp_src_min + udp_src_max -udp_dst_min -udp_dst_max + udp_dst_min + udp_dst_max -node + node -flag - IPSRC_RND - IPDST_RND - UDPSRC_RND - UDPDST_RND - MACSRC_RND - MACDST_RND - TXSIZE_RND - IPV6 - MPLS_RND - VID_RND - SVID_RND - FLOW_SEQ - QUEUE_MAP_RND - QUEUE_MAP_CPU - UDPCSUM - IPSEC - NODE_ALLOC - NO_TIMESTAMP + flag + IPSRC_RND + IPDST_RND + UDPSRC_RND + UDPDST_RND + MACSRC_RND + MACDST_RND + TXSIZE_RND + IPV6 + MPLS_RND + VID_RND + SVID_RND + FLOW_SEQ + QUEUE_MAP_RND + QUEUE_MAP_CPU + UDPCSUM + IPSEC + NODE_ALLOC + NO_TIMESTAMP -spi (ipsec) + spi (ipsec) -dst_min -dst_max + dst_min + dst_max -src_min -src_max + src_min + src_max -dst_mac -src_mac + dst_mac + src_mac -clear_counters + clear_counters -src6 -dst6 -dst6_max -dst6_min + src6 + dst6 + dst6_max + dst6_min -flows -flowlen + flows + flowlen -rate -ratep + rate + ratep -xmit_mode + xmit_mode -vlan_cfi -vlan_id -vlan_p + vlan_cfi + vlan_id + vlan_p -svlan_cfi -svlan_id -svlan_p + svlan_cfi + svlan_id + svlan_p References: -ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/ -ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/examples/ + +- ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/ +- tp://robur.slu.se/pub/Linux/net-development/pktgen-testing/examples/ Paper from Linux-Kongress in Erlangen 2004. -ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/pktgen_paper.pdf +- ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/pktgen_paper.pdf Thanks to: + Grant Grundler for testing on IA-64 and parisc, Harald Welte, Lennert Buytenhek Stephen Hemminger, Andi Kleen, Dave Miller and many others. diff --git a/net/Kconfig b/net/Kconfig index 8b1f85820a6b..c5ba2d180c43 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -344,7 +344,7 @@ config NET_PKTGEN what was just said, you don't need it: say N. Documentation on how to use the packet generator can be found - at . + at . To compile this code as a module, choose M here: the module will be called pktgen. diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 08e2811b5274..b53b6d38c4df 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -56,7 +56,7 @@ * Integrated to 2.5.x 021029 --Lucio Maciel (luciomaciel@zipmail.com.br) * * 021124 Finished major redesign and rewrite for new functionality. - * See Documentation/networking/pktgen.txt for how to use this. + * See Documentation/networking/pktgen.rst for how to use this. * * The new operation: * For each CPU one thread/process is created at start. This process checks diff --git a/samples/pktgen/README.rst b/samples/pktgen/README.rst index 3f6483e8b2df..f9c53ca5cf93 100644 --- a/samples/pktgen/README.rst +++ b/samples/pktgen/README.rst @@ -3,7 +3,7 @@ Sample and benchmark scripts for pktgen (packet generator) This directory contains some pktgen sample and benchmark scripts, that can easily be copied and adjusted for your own use-case. -General doc is located in kernel: Documentation/networking/pktgen.txt +General doc is located in kernel: Documentation/networking/pktgen.rst Helper include files ==================== From patchwork Thu Apr 30 16:04:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31834C47247 for ; Thu, 30 Apr 2020 16:06:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08212208D5 for ; Thu, 30 Apr 2020 16:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262819; bh=nFix0a/j/Cj5TviaDz5+T9+Ut0oC83oAgMWkoZOnEvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=B0XHHHEKFwk+rGCcORzt3zj30zFtZzXpxDmjR4bWaR0Lys9JB1jEcYxKtsecp0L0h 7EjuWtVD8+iGUb/shdTIUrfqrIFqvsjdhXx/6m//5Khyq1tgi3Rgns+OwK2FWNwAhi UFfJyarLLqAEKWvBh50rQzqvYUpNhWTdPOSlyhhk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728489AbgD3QG6 (ORCPT ); Thu, 30 Apr 2020 12:06:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726960AbgD3QEi (ORCPT ); Thu, 30 Apr 2020 12:04:38 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A49624970; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=nFix0a/j/Cj5TviaDz5+T9+Ut0oC83oAgMWkoZOnEvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IkzFj0pBnvQtFcGQpcY7mKuY7CwzkLdlE9w6FUv7aqrdOx4zaGMTkIpYV8ysll2T1 YWMwLz/uVefvLrz5q1HgKt9hKtsA6TpgTUSWhUnk7V6Ll+9UTUBJpAFWzWDgGHYEKr kSTOF+2o8uoSimJ5RQtZMq8CkGNGhZnKfh58O9FU= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxFc-Fq; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 19/37] docs: networking: convert PLIP.txt to ReST Date: Thu, 30 Apr 2020 18:04:14 +0200 Message-Id: <3a25bd7bb5cda9f622d43584bd0d062034fa4fb6.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../networking/{PLIP.txt => plip.rst} | 43 +++++++++++-------- drivers/net/plip/Kconfig | 2 +- 3 files changed, 27 insertions(+), 19 deletions(-) rename Documentation/networking/{PLIP.txt => plip.rst} (92%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 696181a96e3c..18bb10239cad 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -92,6 +92,7 @@ Contents: packet_mmap phonet pktgen + plip .. only:: subproject and html diff --git a/Documentation/networking/PLIP.txt b/Documentation/networking/plip.rst similarity index 92% rename from Documentation/networking/PLIP.txt rename to Documentation/networking/plip.rst index ad7e3f7c3bbf..0eda745050ff 100644 --- a/Documentation/networking/PLIP.txt +++ b/Documentation/networking/plip.rst @@ -1,4 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 + +================================================ PLIP: The Parallel Line Internet Protocol Device +================================================ Donald Becker (becker@super.org) I.D.A. Supercomputing Research Center, Bowie MD 20715 @@ -83,7 +87,7 @@ When the PLIP driver is used in IRQ mode, the timeout used for triggering a data transfer (the maximal time the PLIP driver would allow the other side before announcing a timeout, when trying to handshake a transfer of some data) is, by default, 500usec. As IRQ delivery is more or less immediate, -this timeout is quite sufficient. +this timeout is quite sufficient. When in IRQ-less mode, the PLIP driver polls the parallel port HZ times per second (where HZ is typically 100 on most platforms, and 1024 on an @@ -115,7 +119,7 @@ printer "null" cable to transfer data four bits at a time using data bit outputs connected to status bit inputs. The second data transfer method relies on both machines having -bi-directional parallel ports, rather than output-only ``printer'' +bi-directional parallel ports, rather than output-only ``printer`` ports. This allows byte-wide transfers and avoids reconstructing nibbles into bytes, leading to much faster transfers. @@ -132,7 +136,7 @@ bits with standard status register implementation. A cable that implements this protocol is available commercially as a "Null Printer" or "Turbo Laplink" cable. It can be constructed with -two DB-25 male connectors symmetrically connected as follows: +two DB-25 male connectors symmetrically connected as follows:: STROBE output 1* D0->ERROR 2 - 15 15 - 2 @@ -146,7 +150,8 @@ two DB-25 male connectors symmetrically connected as follows: SLCTIN 17 - 17 extra grounds are 18*,19*,20*,21*,22*,23*,24* GROUND 25 - 25 -* Do not connect these pins on either end + + * Do not connect these pins on either end If the cable you are using has a metallic shield it should be connected to the metallic DB-25 shell at one end only. @@ -155,14 +160,14 @@ Parallel Transfer Mode 1 ======================== The second data transfer method relies on both machines having -bi-directional parallel ports, rather than output-only ``printer'' +bi-directional parallel ports, rather than output-only ``printer`` ports. This allows byte-wide transfers, and avoids reconstructing nibbles into bytes. This cable should not be used on unidirectional -``printer'' (as opposed to ``parallel'') ports or when the machine +``printer`` (as opposed to ``parallel``) ports or when the machine isn't configured for PLIP, as it will result in output driver conflicts and the (unlikely) possibility of damage. -The cable for this transfer mode should be constructed as follows: +The cable for this transfer mode should be constructed as follows:: STROBE->BUSY 1 - 11 D0->D0 2 - 2 @@ -179,7 +184,8 @@ The cable for this transfer mode should be constructed as follows: GND->ERROR 18 - 15 extra grounds are 19*,20*,21*,22*,23*,24* GROUND 25 - 25 -* Do not connect these pins on either end + + * Do not connect these pins on either end Once again, if the cable you are using has a metallic shield it should be connected to the metallic DB-25 shell at one end only. @@ -188,7 +194,7 @@ PLIP Mode 0 transfer protocol ============================= The PLIP driver is compatible with the "Crynwr" parallel port transfer -standard in Mode 0. That standard specifies the following protocol: +standard in Mode 0. That standard specifies the following protocol:: send header nibble '0x8' count-low octet @@ -196,20 +202,21 @@ standard in Mode 0. That standard specifies the following protocol: ... data octets checksum octet -Each octet is sent as +Each octet is sent as:: + >4)&0x0F)> To start a transfer the transmitting machine outputs a nibble 0x08. That raises the ACK line, triggering an interrupt in the receiving machine. The receiving machine disables interrupts and raises its own ACK -line. +line. -Restated: +Restated:: -(OUT is bit 0-4, OUT.j is bit j from OUT. IN likewise) -Send_Byte: - OUT := low nibble, OUT.4 := 1 - WAIT FOR IN.4 = 1 - OUT := high nibble, OUT.4 := 0 - WAIT FOR IN.4 = 0 + (OUT is bit 0-4, OUT.j is bit j from OUT. IN likewise) + Send_Byte: + OUT := low nibble, OUT.4 := 1 + WAIT FOR IN.4 = 1 + OUT := high nibble, OUT.4 := 0 + WAIT FOR IN.4 = 0 diff --git a/drivers/net/plip/Kconfig b/drivers/net/plip/Kconfig index b41035be2d51..e03556d1d0c2 100644 --- a/drivers/net/plip/Kconfig +++ b/drivers/net/plip/Kconfig @@ -21,7 +21,7 @@ config PLIP bits at a time (mode 0) or with special PLIP cables, to be used on bidirectional parallel ports only, which can transmit 8 bits at a time (mode 1); you can find the wiring of these cables in - . The cables can be up to + . The cables can be up to 15m long. Mode 0 works also if one of the machines runs DOS/Windows and has some PLIP software installed, e.g. the Crynwr PLIP packet driver () From patchwork Thu Apr 30 16:04:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220190 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97A82C47257 for ; Thu, 30 Apr 2020 16:07:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7408920775 for ; Thu, 30 Apr 2020 16:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262841; bh=hk3yJGCIoqdz1qoglNsbEPKNyxiVbJmRAddO2RhD+jM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=WIo1yyM5SswgyYucX4GuEBBeCFYqB4bXfjafvKrk+QcH6iOG4108J+YDTw+25LJrh GtjGdxyefRiaZ4RoeI/ZQQg+NDl/d7rqfa2uFtWB26Yfk6hmJZ0yFMWkxt1j3PfxvZ OiNkC2jqrROWjNHMMfMfy7itZjS8/zYXurvlUvYw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728444AbgD3QGy (ORCPT ); Thu, 30 Apr 2020 12:06:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:50894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727094AbgD3QEi (ORCPT ); Thu, 30 Apr 2020 12:04:38 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3E19024972; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=hk3yJGCIoqdz1qoglNsbEPKNyxiVbJmRAddO2RhD+jM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ncQxzJ/1gi9OxLSNVmcXW0rNCJ1WppLY+3NVQ+kTXgOk63MLMqTDWS5NuuO+J/U+w SKagRP9Qrj1tz5BCA9rQF3O11dSiSt7aDLHKNO+rX0F9oo+tcih8HXwNwZgjUgTHkI pFxYyJWVoAl5CyY8ajusv6MkQHZ3gzXU8bqAqu0g= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxFn-Ha; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 21/37] docs: networking: convert proc_net_tcp.txt to ReST Date: Thu, 30 Apr 2020 18:04:16 +0200 Message-Id: <9d38ccde3b8d3de2479fcdfa8e6e0d317f72934d.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - add a document title; - 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 --- Documentation/networking/index.rst | 1 + .../{proc_net_tcp.txt => proc_net_tcp.rst} | 23 +++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) rename Documentation/networking/{proc_net_tcp.txt => proc_net_tcp.rst} (83%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index f89535871481..0da7eb0ec85a 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -94,6 +94,7 @@ Contents: pktgen plip ppp_generic + proc_net_tcp .. only:: subproject and html diff --git a/Documentation/networking/proc_net_tcp.txt b/Documentation/networking/proc_net_tcp.rst similarity index 83% rename from Documentation/networking/proc_net_tcp.txt rename to Documentation/networking/proc_net_tcp.rst index 4a79209e77a7..7d9dfe36af45 100644 --- a/Documentation/networking/proc_net_tcp.txt +++ b/Documentation/networking/proc_net_tcp.rst @@ -1,15 +1,21 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============================================ +The proc/net/tcp and proc/net/tcp6 variables +============================================ + This document describes the interfaces /proc/net/tcp and /proc/net/tcp6. Note that these interfaces are deprecated in favor of tcp_diag. -These /proc interfaces provide information about currently active TCP +These /proc interfaces provide information about currently active TCP connections, and are implemented by tcp4_seq_show() in net/ipv4/tcp_ipv4.c and tcp6_seq_show() in net/ipv6/tcp_ipv6.c, respectively. It will first list all listening TCP sockets, and next list all established -TCP connections. A typical entry of /proc/net/tcp would look like this (split -up into 3 parts because of the length of the line): +TCP connections. A typical entry of /proc/net/tcp would look like this (split +up into 3 parts because of the length of the line):: - 46: 010310AC:9C4C 030310AC:1770 01 + 46: 010310AC:9C4C 030310AC:1770 01 | | | | | |--> connection state | | | | |------> remote TCP port number | | | |-------------> remote IPv4 address @@ -17,7 +23,7 @@ up into 3 parts because of the length of the line): | |---------------------------> local IPv4 address |----------------------------------> number of entry - 00000150:00000000 01:00000019 00000000 + 00000150:00000000 01:00000019 00000000 | | | | |--> number of unrecovered RTO timeouts | | | |----------> number of jiffies until timer expires | | |----------------> timer_active (see below) @@ -25,7 +31,7 @@ up into 3 parts because of the length of the line): |-------------------------------> transmit-queue 1000 0 54165785 4 cd1e6040 25 4 27 3 -1 - | | | | | | | | | |--> slow start size threshold, + | | | | | | | | | |--> slow start size threshold, | | | | | | | | | or -1 if the threshold | | | | | | | | | is >= 0xFFFF | | | | | | | | |----> sending congestion window @@ -40,9 +46,12 @@ up into 3 parts because of the length of the line): |---------------------------------------------> uid timer_active: + + == ================================================================ 0 no timer is pending 1 retransmit-timer is pending 2 another timer (e.g. delayed ack or keepalive) is pending - 3 this is a socket in TIME_WAIT state. Not all fields will contain + 3 this is a socket in TIME_WAIT state. Not all fields will contain data (or even exist) 4 zero window probe timer is pending + == ================================================================ From patchwork Thu Apr 30 16:04:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60845C47254 for ; Thu, 30 Apr 2020 16:05:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3949720775 for ; Thu, 30 Apr 2020 16:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262709; bh=pdicZomMtf28CtsI0bBw5bIyiIGVYP4UbC45/HOcPuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dnABq/bqSOqTVFl6xp8BpxZDx+LoFHNLyH/f2vq4bw7e6V3oxsEFkb/HsD4XLIvow jW0zw/1UdzoR91ixc3kueEvBZCD/dHGzYAs8YqVRxh9Ch51FfHaXIQxdHDho9xmrWF Q81WRuQyFfaBzWieampulKdJF3OUSDTn6A8PfR8g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728021AbgD3QEm (ORCPT ); Thu, 30 Apr 2020 12:04:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:50896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727097AbgD3QEj (ORCPT ); Thu, 30 Apr 2020 12:04:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A60924975; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=pdicZomMtf28CtsI0bBw5bIyiIGVYP4UbC45/HOcPuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y+0kfYQ8ug5CaCrOOdG771Rb9c40Wm0NqaHAa2n9Yr8SoKq/rTCv/GssKvOWM0iRs UnAdPALXndBCia7ozw4FVbdINfr+JGAaUb3gBjQfi6nP05MtkoJW7Xl5q4/k81Hagg 5YymVlvou+Iraan40oXBxKupKTOTZuDYf64LT7WA= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxFr-IR; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , Johannes Berg , netdev@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 22/37] docs: networking: convert radiotap-headers.txt to ReST Date: Thu, 30 Apr 2020 18:04:17 +0200 Message-Id: <7916711801e55e457baed67023c47b0fd5fa56f7.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - adjust title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../networking/mac80211-injection.rst | 2 +- ...iotap-headers.txt => radiotap-headers.rst} | 99 ++++++++++--------- include/net/cfg80211.h | 2 +- net/wireless/radiotap.c | 2 +- 5 files changed, 57 insertions(+), 49 deletions(-) rename Documentation/networking/{radiotap-headers.txt => radiotap-headers.rst} (70%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 0da7eb0ec85a..85bc52d0b3a6 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -95,6 +95,7 @@ Contents: plip ppp_generic proc_net_tcp + radiotap-headers .. only:: subproject and html diff --git a/Documentation/networking/mac80211-injection.rst b/Documentation/networking/mac80211-injection.rst index 75d4edcae852..be65f886ff1f 100644 --- a/Documentation/networking/mac80211-injection.rst +++ b/Documentation/networking/mac80211-injection.rst @@ -13,7 +13,7 @@ following format:: [ payload ] The radiotap format is discussed in -./Documentation/networking/radiotap-headers.txt. +./Documentation/networking/radiotap-headers.rst. Despite many radiotap parameters being currently defined, most only make sense to appear on received packets. The following information is parsed from the diff --git a/Documentation/networking/radiotap-headers.txt b/Documentation/networking/radiotap-headers.rst similarity index 70% rename from Documentation/networking/radiotap-headers.txt rename to Documentation/networking/radiotap-headers.rst index 953331c7984f..1a1bd1ec0650 100644 --- a/Documentation/networking/radiotap-headers.txt +++ b/Documentation/networking/radiotap-headers.rst @@ -1,3 +1,6 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=========================== How to use radiotap headers =========================== @@ -5,9 +8,9 @@ Pointer to the radiotap include file ------------------------------------ Radiotap headers are variable-length and extensible, you can get most of the -information you need to know on them from: +information you need to know on them from:: -./include/net/ieee80211_radiotap.h + ./include/net/ieee80211_radiotap.h This document gives an overview and warns on some corner cases. @@ -21,6 +24,8 @@ of the it_present member of ieee80211_radiotap_header is set, it means that the header for argument index 0 (IEEE80211_RADIOTAP_TSFT) is present in the argument area. +:: + < 8-byte ieee80211_radiotap_header > [ ] [ ... ] @@ -76,6 +81,8 @@ ieee80211_radiotap_header. Example valid radiotap header ----------------------------- +:: + 0x00, 0x00, // <-- radiotap version + pad byte 0x0b, 0x00, // <- radiotap header length 0x04, 0x0c, 0x00, 0x00, // <-- bitmap @@ -89,64 +96,64 @@ Using the Radiotap Parser If you are having to parse a radiotap struct, you can radically simplify the job by using the radiotap parser that lives in net/wireless/radiotap.c and has -its prototypes available in include/net/cfg80211.h. You use it like this: +its prototypes available in include/net/cfg80211.h. You use it like this:: -#include + #include -/* buf points to the start of the radiotap header part */ + /* buf points to the start of the radiotap header part */ -int MyFunction(u8 * buf, int buflen) -{ - int pkt_rate_100kHz = 0, antenna = 0, pwr = 0; - struct ieee80211_radiotap_iterator iterator; - int ret = ieee80211_radiotap_iterator_init(&iterator, buf, buflen); + int MyFunction(u8 * buf, int buflen) + { + int pkt_rate_100kHz = 0, antenna = 0, pwr = 0; + struct ieee80211_radiotap_iterator iterator; + int ret = ieee80211_radiotap_iterator_init(&iterator, buf, buflen); - while (!ret) { + while (!ret) { - ret = ieee80211_radiotap_iterator_next(&iterator); + ret = ieee80211_radiotap_iterator_next(&iterator); - if (ret) - continue; + if (ret) + continue; - /* see if this argument is something we can use */ + /* see if this argument is something we can use */ - switch (iterator.this_arg_index) { - /* - * You must take care when dereferencing iterator.this_arg - * for multibyte types... the pointer is not aligned. Use - * get_unaligned((type *)iterator.this_arg) to dereference - * iterator.this_arg for type "type" safely on all arches. - */ - case IEEE80211_RADIOTAP_RATE: - /* radiotap "rate" u8 is in - * 500kbps units, eg, 0x02=1Mbps - */ - pkt_rate_100kHz = (*iterator.this_arg) * 5; - break; + switch (iterator.this_arg_index) { + /* + * You must take care when dereferencing iterator.this_arg + * for multibyte types... the pointer is not aligned. Use + * get_unaligned((type *)iterator.this_arg) to dereference + * iterator.this_arg for type "type" safely on all arches. + */ + case IEEE80211_RADIOTAP_RATE: + /* radiotap "rate" u8 is in + * 500kbps units, eg, 0x02=1Mbps + */ + pkt_rate_100kHz = (*iterator.this_arg) * 5; + break; - case IEEE80211_RADIOTAP_ANTENNA: - /* radiotap uses 0 for 1st ant */ - antenna = *iterator.this_arg); - break; + case IEEE80211_RADIOTAP_ANTENNA: + /* radiotap uses 0 for 1st ant */ + antenna = *iterator.this_arg); + break; - case IEEE80211_RADIOTAP_DBM_TX_POWER: - pwr = *iterator.this_arg; - break; + case IEEE80211_RADIOTAP_DBM_TX_POWER: + pwr = *iterator.this_arg; + break; - default: - break; - } - } /* while more rt headers */ + default: + break; + } + } /* while more rt headers */ - if (ret != -ENOENT) - return TXRX_DROP; + if (ret != -ENOENT) + return TXRX_DROP; - /* discard the radiotap header part */ - buf += iterator.max_length; - buflen -= iterator.max_length; + /* discard the radiotap header part */ + buf += iterator.max_length; + buflen -= iterator.max_length; - ... + ... -} + } Andy Green diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index e67897fabacd..582881d67f70 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -5300,7 +5300,7 @@ u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband, * Radiotap parsing functions -- for controlled injection support * * Implemented in net/wireless/radiotap.c - * Documentation in Documentation/networking/radiotap-headers.txt + * Documentation in Documentation/networking/radiotap-headers.rst */ struct radiotap_align_size { diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c index 6582d155e2fc..d5e28239e030 100644 --- a/net/wireless/radiotap.c +++ b/net/wireless/radiotap.c @@ -90,7 +90,7 @@ static const struct ieee80211_radiotap_namespace radiotap_ns = { * iterator.this_arg for type "type" safely on all arches. * * Example code: - * See Documentation/networking/radiotap-headers.txt + * See Documentation/networking/radiotap-headers.rst */ int ieee80211_radiotap_iterator_init( From patchwork Thu Apr 30 16:04:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4451C4724C for ; Thu, 30 Apr 2020 16:06:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3A6720873 for ; Thu, 30 Apr 2020 16:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262789; bh=CiNEctCJ4qmZ6A7gwBTuE6/yRFv3lOhbxOpl1PZPlZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CcBVeg+KAjR5BRTvzTs5zpMpd4Y7JPRa/8DwAtvUT/icd86hO6DS7VUS954q3byJd z42L14w+/Dexhm5ugJETRMxHbv2igQUYA5/vw/d3UYivPlYHMWWBiV8HJreFzwL1Y4 nlYgzUAOyUYLnrA1/DdBUYPAfHNUC6IJE+8xkz0s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728396AbgD3QGX (ORCPT ); Thu, 30 Apr 2020 12:06:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:50866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727104AbgD3QEj (ORCPT ); Thu, 30 Apr 2020 12:04:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5AC822497A; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=CiNEctCJ4qmZ6A7gwBTuE6/yRFv3lOhbxOpl1PZPlZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j6X+nqwhEHeI2O8KFeO7SKuPclwQunTHnqA0A1W0f+gg3tlk2Xo19aDNIvEe85pJr mHITqAI7ie86IHUzlfODP3YTJbzch1tSuLCHh6UMWnBtPBiSBeq0HUmkvDiLw8F+qK PVZwXiwFKkVcd2lA3jCC2u87nqtElB+0RCN6VZ2o= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxFx-JX; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , Kalle Valo , netdev@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 23/37] docs: networking: convert ray_cs.txt to ReST Date: Thu, 30 Apr 2020 18:04:18 +0200 Message-Id: <2a554708f40ab8fd34905755518eeeda315cf4c9.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - use copyright symbol; - add a document title; - 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 --- Documentation/networking/index.rst | 1 + .../networking/{ray_cs.txt => ray_cs.rst} | 101 ++++++++++-------- drivers/net/wireless/Kconfig | 2 +- 3 files changed, 60 insertions(+), 44 deletions(-) rename Documentation/networking/{ray_cs.txt => ray_cs.rst} (65%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 85bc52d0b3a6..b7e35b0d905c 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -96,6 +96,7 @@ Contents: ppp_generic proc_net_tcp radiotap-headers + ray_cs .. only:: subproject and html diff --git a/Documentation/networking/ray_cs.txt b/Documentation/networking/ray_cs.rst similarity index 65% rename from Documentation/networking/ray_cs.txt rename to Documentation/networking/ray_cs.rst index c0c12307ed9d..9a46d1ae8f20 100644 --- a/Documentation/networking/ray_cs.txt +++ b/Documentation/networking/ray_cs.rst @@ -1,6 +1,14 @@ +.. SPDX-License-Identifier: GPL-2.0 + +.. include:: + +========================= +Raylink wireless LAN card +========================= + September 21, 1999 -Copyright (c) 1998 Corey Thomas (corey@world.std.com) +Copyright |copy| 1998 Corey Thomas (corey@world.std.com) This file is the documentation for the Raylink Wireless LAN card driver for Linux. The Raylink wireless LAN card is a PCMCIA card which provides IEEE @@ -13,7 +21,7 @@ wireless LAN cards. As of kernel 2.3.18, the ray_cs driver is part of the Linux kernel source. My web page for the development of ray_cs is at -http://web.ralinktech.com/ralink/Home/Support/Linux.html +http://web.ralinktech.com/ralink/Home/Support/Linux.html and I can be emailed at corey@world.std.com The kernel driver is based on ray_cs-1.62.tgz @@ -29,6 +37,7 @@ with nondefault parameters, they can be edited in will find them all. Information on card services is available at: + http://pcmcia-cs.sourceforge.net/ @@ -39,72 +48,78 @@ the driver. Currently, ray_cs is not part of David Hinds card services package, so the following magic is required. -At the end of the /etc/pcmcia/config.opts file, add the line: -source ./ray_cs.opts +At the end of the /etc/pcmcia/config.opts file, add the line: +source ./ray_cs.opts This will make card services read the ray_cs.opts file when starting. Create the file /etc/pcmcia/ray_cs.opts containing the -following: +following:: -#### start of /etc/pcmcia/ray_cs.opts ################### -# Configuration options for Raylink Wireless LAN PCMCIA card -device "ray_cs" - class "network" module "misc/ray_cs" + #### start of /etc/pcmcia/ray_cs.opts ################### + # Configuration options for Raylink Wireless LAN PCMCIA card + device "ray_cs" + class "network" module "misc/ray_cs" -card "RayLink PC Card WLAN Adapter" - manfid 0x01a6, 0x0000 - bind "ray_cs" + card "RayLink PC Card WLAN Adapter" + manfid 0x01a6, 0x0000 + bind "ray_cs" -module "misc/ray_cs" opts "" -#### end of /etc/pcmcia/ray_cs.opts ##################### + module "misc/ray_cs" opts "" + #### end of /etc/pcmcia/ray_cs.opts ##################### To join an existing network with -different parameters, contact the network administrator for the +different parameters, contact the network administrator for the configuration information, and edit /etc/pcmcia/ray_cs.opts. Add the parameters below between the empty quotes. Parameters for ray_cs driver which may be specified in ray_cs.opts: -bc integer 0 = normal mode (802.11 timing) - 1 = slow down inter frame timing to allow - operation with older breezecom access - points. +=============== =============== ============================================= +bc integer 0 = normal mode (802.11 timing), + 1 = slow down inter frame timing to allow + operation with older breezecom access + points. -beacon_period integer beacon period in Kilo-microseconds - legal values = must be integer multiple - of hop dwell - default = 256 +beacon_period integer beacon period in Kilo-microseconds, -country integer 1 = USA (default) - 2 = Europe - 3 = Japan - 4 = Korea - 5 = Spain - 6 = France - 7 = Israel - 8 = Australia + legal values = must be integer multiple + of hop dwell + + default = 256 + +country integer 1 = USA (default), + 2 = Europe, + 3 = Japan, + 4 = Korea, + 5 = Spain, + 6 = France, + 7 = Israel, + 8 = Australia essid string ESS ID - network name to join + string with maximum length of 32 chars default value = "ADHOC_ESSID" -hop_dwell integer hop dwell time in Kilo-microseconds +hop_dwell integer hop dwell time in Kilo-microseconds + legal values = 16,32,64,128(default),256 irq_mask integer linux standard 16 bit value 1bit/IRQ + lsb is IRQ 0, bit 1 is IRQ 1 etc. Used to restrict choice of IRQ's to use. - Recommended method for controlling - interrupts is in /etc/pcmcia/config.opts + Recommended method for controlling + interrupts is in /etc/pcmcia/config.opts -net_type integer 0 (default) = adhoc network, +net_type integer 0 (default) = adhoc network, 1 = infrastructure phy_addr string string containing new MAC address in hex, must start with x eg x00008f123456 -psm integer 0 = continuously active +psm integer 0 = continuously active, 1 = power save mode (not useful yet) pc_debug integer (0-5) larger values for more verbose @@ -114,14 +129,14 @@ ray_debug integer Replaced with pc_debug ray_mem_speed integer defaults to 500 -sniffer integer 0 = not sniffer (default) - 1 = sniffer which can be used to record all - network traffic using tcpdump or similar, - but no normal network use is allowed. +sniffer integer 0 = not sniffer (default), + 1 = sniffer which can be used to record all + network traffic using tcpdump or similar, + but no normal network use is allowed. -translate integer 0 = no translation (encapsulate frames) +translate integer 0 = no translation (encapsulate frames), 1 = translation (RFC1042/802.1) - +=============== =============== ============================================= More on sniffer mode: @@ -136,7 +151,7 @@ package which parses the 802.11 headers. Known Problems and missing features - Does not work with non x86 + Does not work with non x86 Does not work with SMP diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 1c98d781ae49..15b0ad171f4c 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -57,7 +57,7 @@ config PCMCIA_RAYCS ---help--- Say Y here if you intend to attach an Aviator/Raytheon PCMCIA (PC-card) wireless Ethernet networking card to your computer. - Please read the file for + Please read the file for details. To compile this driver as a module, choose M here: the module will be From patchwork Thu Apr 30 16:04:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C31EDC47254 for ; Thu, 30 Apr 2020 16:05:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98C942076D for ; Thu, 30 Apr 2020 16:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262729; bh=OqKfYEWUJFcOEzHWGOpswKqGwVjxOYu4O53nxIx1wgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HCNHtWRkag6MHNgnEieL3i7Lh4rl9/Znm/cMBd0aLsj8NFgHRXoqthrqwGT9bSytC yn/5i0RgPhpGXTr8ExkPOIZKFLPQIUl7vDEAnxV3tiKl8Ck1YTH/dxe4iA/OZKulh9 dktCO+eg/BiCu49uSbwNcce6OIbEAP/aVB6XurdI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728168AbgD3QFZ (ORCPT ); Thu, 30 Apr 2020 12:05:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:50938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727804AbgD3QEk (ORCPT ); Thu, 30 Apr 2020 12:04:40 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 614C52497B; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=OqKfYEWUJFcOEzHWGOpswKqGwVjxOYu4O53nxIx1wgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WTKNhWSFq+Hg7EDn5aH/+qpnzZ/0fNqqyxI4oOc37wBVLryOtfcfydhz41VUkgkDr BPdHkljVYtoHV6MvJfUhHjta6QmUFRRc9AqMEXEJlZG/UWjWlXnIRpBm16kayCKXk0 yufqvbZq/IKNPcT8z9aeekq6anYswHTLX6xgu+WE= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxG2-Kh; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , Santosh Shilimkar , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com Subject: [PATCH 24/37] docs: networking: convert rds.txt to ReST Date: Thu, 30 Apr 2020 18:04:19 +0200 Message-Id: <6c2adf3f895bea317c2f69cb14e2cf0eb203ac64.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - add a document title; - mark code blocks and literals as such; - mark tables as such; - mark lists as such; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + Documentation/networking/{rds.txt => rds.rst} | 295 ++++++++++-------- MAINTAINERS | 2 +- 3 files changed, 162 insertions(+), 136 deletions(-) rename Documentation/networking/{rds.txt => rds.rst} (59%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index b7e35b0d905c..e63a2cb2e4cb 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -97,6 +97,7 @@ Contents: proc_net_tcp radiotap-headers ray_cs + rds .. only:: subproject and html diff --git a/Documentation/networking/rds.txt b/Documentation/networking/rds.rst similarity index 59% rename from Documentation/networking/rds.txt rename to Documentation/networking/rds.rst index eec61694e894..44936c27ab3a 100644 --- a/Documentation/networking/rds.txt +++ b/Documentation/networking/rds.rst @@ -1,3 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 + +== +RDS +=== Overview ======== @@ -24,36 +29,39 @@ as IB. The high-level semantics of RDS from the application's point of view are * Addressing - RDS uses IPv4 addresses and 16bit port numbers to identify - the end point of a connection. All socket operations that involve - passing addresses between kernel and user space generally - use a struct sockaddr_in. - The fact that IPv4 addresses are used does not mean the underlying - transport has to be IP-based. In fact, RDS over IB uses a - reliable IB connection; the IP address is used exclusively to - locate the remote node's GID (by ARPing for the given IP). + RDS uses IPv4 addresses and 16bit port numbers to identify + the end point of a connection. All socket operations that involve + passing addresses between kernel and user space generally + use a struct sockaddr_in. - The port space is entirely independent of UDP, TCP or any other - protocol. + The fact that IPv4 addresses are used does not mean the underlying + transport has to be IP-based. In fact, RDS over IB uses a + reliable IB connection; the IP address is used exclusively to + locate the remote node's GID (by ARPing for the given IP). + + The port space is entirely independent of UDP, TCP or any other + protocol. * Socket interface - RDS sockets work *mostly* as you would expect from a BSD - socket. The next section will cover the details. At any rate, - all I/O is performed through the standard BSD socket API. - Some additions like zerocopy support are implemented through - control messages, while other extensions use the getsockopt/ - setsockopt calls. - Sockets must be bound before you can send or receive data. - This is needed because binding also selects a transport and - attaches it to the socket. Once bound, the transport assignment - does not change. RDS will tolerate IPs moving around (eg in - a active-active HA scenario), but only as long as the address - doesn't move to a different transport. + RDS sockets work *mostly* as you would expect from a BSD + socket. The next section will cover the details. At any rate, + all I/O is performed through the standard BSD socket API. + Some additions like zerocopy support are implemented through + control messages, while other extensions use the getsockopt/ + setsockopt calls. + + Sockets must be bound before you can send or receive data. + This is needed because binding also selects a transport and + attaches it to the socket. Once bound, the transport assignment + does not change. RDS will tolerate IPs moving around (eg in + a active-active HA scenario), but only as long as the address + doesn't move to a different transport. * sysctls - RDS supports a number of sysctls in /proc/sys/net/rds + + RDS supports a number of sysctls in /proc/sys/net/rds Socket Interface @@ -66,89 +74,88 @@ Socket Interface options. fd = socket(PF_RDS, SOCK_SEQPACKET, 0); - This creates a new, unbound RDS socket. + This creates a new, unbound RDS socket. setsockopt(SOL_SOCKET): send and receive buffer size - RDS honors the send and receive buffer size socket options. - You are not allowed to queue more than SO_SNDSIZE bytes to - a socket. A message is queued when sendmsg is called, and - it leaves the queue when the remote system acknowledges - its arrival. + RDS honors the send and receive buffer size socket options. + You are not allowed to queue more than SO_SNDSIZE bytes to + a socket. A message is queued when sendmsg is called, and + it leaves the queue when the remote system acknowledges + its arrival. - The SO_RCVSIZE option controls the maximum receive queue length. - This is a soft limit rather than a hard limit - RDS will - continue to accept and queue incoming messages, even if that - takes the queue length over the limit. However, it will also - mark the port as "congested" and send a congestion update to - the source node. The source node is supposed to throttle any - processes sending to this congested port. + The SO_RCVSIZE option controls the maximum receive queue length. + This is a soft limit rather than a hard limit - RDS will + continue to accept and queue incoming messages, even if that + takes the queue length over the limit. However, it will also + mark the port as "congested" and send a congestion update to + the source node. The source node is supposed to throttle any + processes sending to this congested port. bind(fd, &sockaddr_in, ...) - This binds the socket to a local IP address and port, and a - transport, if one has not already been selected via the + This binds the socket to a local IP address and port, and a + transport, if one has not already been selected via the SO_RDS_TRANSPORT socket option sendmsg(fd, ...) - Sends a message to the indicated recipient. The kernel will - transparently establish the underlying reliable connection - if it isn't up yet. + Sends a message to the indicated recipient. The kernel will + transparently establish the underlying reliable connection + if it isn't up yet. - An attempt to send a message that exceeds SO_SNDSIZE will - return with -EMSGSIZE + An attempt to send a message that exceeds SO_SNDSIZE will + return with -EMSGSIZE - An attempt to send a message that would take the total number - of queued bytes over the SO_SNDSIZE threshold will return - EAGAIN. + An attempt to send a message that would take the total number + of queued bytes over the SO_SNDSIZE threshold will return + EAGAIN. - An attempt to send a message to a destination that is marked - as "congested" will return ENOBUFS. + An attempt to send a message to a destination that is marked + as "congested" will return ENOBUFS. recvmsg(fd, ...) - Receives a message that was queued to this socket. The sockets - recv queue accounting is adjusted, and if the queue length - drops below SO_SNDSIZE, the port is marked uncongested, and - a congestion update is sent to all peers. + Receives a message that was queued to this socket. The sockets + recv queue accounting is adjusted, and if the queue length + drops below SO_SNDSIZE, the port is marked uncongested, and + a congestion update is sent to all peers. - Applications can ask the RDS kernel module to receive - notifications via control messages (for instance, there is a - notification when a congestion update arrived, or when a RDMA - operation completes). These notifications are received through - the msg.msg_control buffer of struct msghdr. The format of the - messages is described in manpages. + Applications can ask the RDS kernel module to receive + notifications via control messages (for instance, there is a + notification when a congestion update arrived, or when a RDMA + operation completes). These notifications are received through + the msg.msg_control buffer of struct msghdr. The format of the + messages is described in manpages. poll(fd) - RDS supports the poll interface to allow the application - to implement async I/O. + RDS supports the poll interface to allow the application + to implement async I/O. - POLLIN handling is pretty straightforward. When there's an - incoming message queued to the socket, or a pending notification, - we signal POLLIN. + POLLIN handling is pretty straightforward. When there's an + incoming message queued to the socket, or a pending notification, + we signal POLLIN. - POLLOUT is a little harder. Since you can essentially send - to any destination, RDS will always signal POLLOUT as long as - there's room on the send queue (ie the number of bytes queued - is less than the sendbuf size). + POLLOUT is a little harder. Since you can essentially send + to any destination, RDS will always signal POLLOUT as long as + there's room on the send queue (ie the number of bytes queued + is less than the sendbuf size). - However, the kernel will refuse to accept messages to - a destination marked congested - in this case you will loop - forever if you rely on poll to tell you what to do. - This isn't a trivial problem, but applications can deal with - this - by using congestion notifications, and by checking for - ENOBUFS errors returned by sendmsg. + However, the kernel will refuse to accept messages to + a destination marked congested - in this case you will loop + forever if you rely on poll to tell you what to do. + This isn't a trivial problem, but applications can deal with + this - by using congestion notifications, and by checking for + ENOBUFS errors returned by sendmsg. setsockopt(SOL_RDS, RDS_CANCEL_SENT_TO, &sockaddr_in) - This allows the application to discard all messages queued to a - specific destination on this particular socket. + This allows the application to discard all messages queued to a + specific destination on this particular socket. - This allows the application to cancel outstanding messages if - it detects a timeout. For instance, if it tried to send a message, - and the remote host is unreachable, RDS will keep trying forever. - The application may decide it's not worth it, and cancel the - operation. In this case, it would use RDS_CANCEL_SENT_TO to - nuke any pending messages. + This allows the application to cancel outstanding messages if + it detects a timeout. For instance, if it tried to send a message, + and the remote host is unreachable, RDS will keep trying forever. + The application may decide it's not worth it, and cancel the + operation. In this case, it would use RDS_CANCEL_SENT_TO to + nuke any pending messages. - setsockopt(fd, SOL_RDS, SO_RDS_TRANSPORT, (int *)&transport ..) - getsockopt(fd, SOL_RDS, SO_RDS_TRANSPORT, (int *)&transport ..) + ``setsockopt(fd, SOL_RDS, SO_RDS_TRANSPORT, (int *)&transport ..), getsockopt(fd, SOL_RDS, SO_RDS_TRANSPORT, (int *)&transport ..)`` Set or read an integer defining the underlying encapsulating transport to be used for RDS packets on the socket. When setting the option, integer argument may be @@ -180,32 +187,39 @@ RDS Protocol Message header The message header is a 'struct rds_header' (see rds.h): + Fields: + h_sequence: - per-packet sequence number + per-packet sequence number h_ack: - piggybacked acknowledgment of last packet received + piggybacked acknowledgment of last packet received h_len: - length of data, not including header + length of data, not including header h_sport: - source port + source port h_dport: - destination port + destination port h_flags: - CONG_BITMAP - this is a congestion update bitmap - ACK_REQUIRED - receiver must ack this packet - RETRANSMITTED - packet has previously been sent + Can be: + + ============= ================================== + CONG_BITMAP this is a congestion update bitmap + ACK_REQUIRED receiver must ack this packet + RETRANSMITTED packet has previously been sent + ============= ================================== + h_credit: - indicate to other end of connection that - it has more credits available (i.e. there is - more send room) + indicate to other end of connection that + it has more credits available (i.e. there is + more send room) h_padding[4]: - unused, for future use + unused, for future use h_csum: - header checksum + header checksum h_exthdr: - optional data can be passed here. This is currently used for - passing RDMA-related information. + optional data can be passed here. This is currently used for + passing RDMA-related information. ACK and retransmit handling @@ -260,7 +274,7 @@ RDS Protocol RDS Transport Layer -================== +=================== As mentioned above, RDS is not IB-specific. Its code is divided into a general RDS layer and a transport layer. @@ -281,19 +295,25 @@ RDS Kernel Structures be sent and sets header fields as needed, based on the socket API. This is then queued for the individual connection and sent by the connection's transport. + struct rds_incoming a generic struct referring to incoming data that can be handed from the transport to the general code and queued by the general code while the socket is awoken. It is then passed back to the transport code to handle the actual copy-to-user. + struct rds_socket per-socket information + struct rds_connection per-connection information + struct rds_transport pointers to transport-specific functions + struct rds_statistics non-transport-specific statistics + struct rds_cong_map wraps the raw congestion bitmap, contains rbnode, waitq, etc. @@ -317,53 +337,58 @@ The send path ============= rds_sendmsg() - struct rds_message built from incoming data - CMSGs parsed (e.g. RDMA ops) - transport connection alloced and connected if not already - rds_message placed on send queue - send worker awoken + - struct rds_message built from incoming data + - CMSGs parsed (e.g. RDMA ops) + - transport connection alloced and connected if not already + - rds_message placed on send queue + - send worker awoken + rds_send_worker() - calls rds_send_xmit() until queue is empty + - calls rds_send_xmit() until queue is empty + rds_send_xmit() - transmits congestion map if one is pending - may set ACK_REQUIRED - calls transport to send either non-RDMA or RDMA message - (RDMA ops never retransmitted) + - transmits congestion map if one is pending + - may set ACK_REQUIRED + - calls transport to send either non-RDMA or RDMA message + (RDMA ops never retransmitted) + rds_ib_xmit() - allocs work requests from send ring - adds any new send credits available to peer (h_credits) - maps the rds_message's sg list - piggybacks ack - populates work requests - post send to connection's queue pair + - allocs work requests from send ring + - adds any new send credits available to peer (h_credits) + - maps the rds_message's sg list + - piggybacks ack + - populates work requests + - post send to connection's queue pair The recv path ============= rds_ib_recv_cq_comp_handler() - looks at write completions - unmaps recv buffer from device - no errors, call rds_ib_process_recv() - refill recv ring + - looks at write completions + - unmaps recv buffer from device + - no errors, call rds_ib_process_recv() + - refill recv ring + rds_ib_process_recv() - validate header checksum - copy header to rds_ib_incoming struct if start of a new datagram - add to ibinc's fraglist - if competed datagram: - update cong map if datagram was cong update - call rds_recv_incoming() otherwise - note if ack is required + - validate header checksum + - copy header to rds_ib_incoming struct if start of a new datagram + - add to ibinc's fraglist + - if competed datagram: + - update cong map if datagram was cong update + - call rds_recv_incoming() otherwise + - note if ack is required + rds_recv_incoming() - drop duplicate packets - respond to pings - find the sock associated with this datagram - add to sock queue - wake up sock - do some congestion calculations + - drop duplicate packets + - respond to pings + - find the sock associated with this datagram + - add to sock queue + - wake up sock + - do some congestion calculations rds_recvmsg - copy data into user iovec - handle CMSGs - return to application + - copy data into user iovec + - handle CMSGs + - return to application Multipath RDS (mprds) ===================== diff --git a/MAINTAINERS b/MAINTAINERS index 0d2005e8380e..d525b85a37a0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14254,7 +14254,7 @@ L: linux-rdma@vger.kernel.org L: rds-devel@oss.oracle.com (moderated for non-subscribers) S: Supported W: https://oss.oracle.com/projects/rds/ -F: Documentation/networking/rds.txt +F: Documentation/networking/rds.rst F: net/rds/ RDT - RESOURCE ALLOCATION From patchwork Thu Apr 30 16:04:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220194 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F617C47256 for ; Thu, 30 Apr 2020 16:06:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D94BB208D6 for ; Thu, 30 Apr 2020 16:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262795; bh=B3ezwvg2knS6uHnv/WO13S9rLymkt8WrzNj9AI610QI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KyjYKXSEt0R/hGN/m6Bm2BuKo4xvcwCO4Rivm00IyoqNPjJbNAQF5AmclVuTCWL5P ZgGb37kxk2lq9GakdR42HMREA62E0fVKB2fg0zRC5J050oU0RiqixR/FBxyuBu6806 UGcxpZoewmZZTEhbKr1TjfNV/47GuOd03ogATpvU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728372AbgD3QGV (ORCPT ); Thu, 30 Apr 2020 12:06:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:50924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbgD3QEj (ORCPT ); Thu, 30 Apr 2020 12:04:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7267824985; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=B3ezwvg2knS6uHnv/WO13S9rLymkt8WrzNj9AI610QI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tRDdD0eiyHCV5Jl0zgghDNKs9SFJAQPmGZLUk+txXHb9yRGvPyK3yk3z1Mjr6+4nP bnei9NbbUpXG/kJYokBJ+1io6to81MN3VZ8WM/sNsjrUQ6cVW88HimhaXQr7eU36cb zfOGk/w/FN+uZ6UcMxDNVlTYa9tTCF+jPSMjZZ5c= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxGG-N5; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , Vlad Yasevich , Neil Horman , Marcelo Ricardo Leitner , netdev@vger.kernel.org, linux-sctp@vger.kernel.org Subject: [PATCH 27/37] docs: networking: convert sctp.txt to ReST Date: Thu, 30 Apr 2020 18:04:22 +0200 Message-Id: <5bbbf00c3aba45253e9d6ba0efeaf34bf2a8450f.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - add a document title; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../networking/{sctp.txt => sctp.rst} | 37 +++++++++++-------- MAINTAINERS | 2 +- 3 files changed, 24 insertions(+), 16 deletions(-) rename Documentation/networking/{sctp.txt => sctp.rst} (64%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index cd307b9601fa..1761eb715061 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -100,6 +100,7 @@ Contents: rds regulatory rxrpc + sctp .. only:: subproject and html diff --git a/Documentation/networking/sctp.txt b/Documentation/networking/sctp.rst similarity index 64% rename from Documentation/networking/sctp.txt rename to Documentation/networking/sctp.rst index 97b810ca9082..9f4d9c8a925b 100644 --- a/Documentation/networking/sctp.txt +++ b/Documentation/networking/sctp.rst @@ -1,35 +1,42 @@ -Linux Kernel SCTP +.. SPDX-License-Identifier: GPL-2.0 + +================= +Linux Kernel SCTP +================= This is the current BETA release of the Linux Kernel SCTP reference -implementation. +implementation. SCTP (Stream Control Transmission Protocol) is a IP based, message oriented, reliable transport protocol, with congestion control, support for transparent multi-homing, and multiple ordered streams of messages. RFC2960 defines the core protocol. The IETF SIGTRAN working group originally -developed the SCTP protocol and later handed the protocol over to the -Transport Area (TSVWG) working group for the continued evolvement of SCTP as a -general purpose transport. +developed the SCTP protocol and later handed the protocol over to the +Transport Area (TSVWG) working group for the continued evolvement of SCTP as a +general purpose transport. -See the IETF website (http://www.ietf.org) for further documents on SCTP. -See http://www.ietf.org/rfc/rfc2960.txt +See the IETF website (http://www.ietf.org) for further documents on SCTP. +See http://www.ietf.org/rfc/rfc2960.txt The initial project goal is to create an Linux kernel reference implementation -of SCTP that is RFC 2960 compliant and provides an programming interface -referred to as the UDP-style API of the Sockets Extensions for SCTP, as -proposed in IETF Internet-Drafts. +of SCTP that is RFC 2960 compliant and provides an programming interface +referred to as the UDP-style API of the Sockets Extensions for SCTP, as +proposed in IETF Internet-Drafts. -Caveats: +Caveats +======= --lksctp can be built as statically or as a module. However, be aware that -module removal of lksctp is not yet a safe activity. +- lksctp can be built as statically or as a module. However, be aware that + module removal of lksctp is not yet a safe activity. --There is tentative support for IPv6, but most work has gone towards -implementation and testing lksctp on IPv4. +- There is tentative support for IPv6, but most work has gone towards + implementation and testing lksctp on IPv4. For more information, please visit the lksctp project website: + http://www.sf.net/projects/lksctp Or contact the lksctp developers through the mailing list: + diff --git a/MAINTAINERS b/MAINTAINERS index 93e1b253ae51..64789b29c085 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15044,7 +15044,7 @@ M: Marcelo Ricardo Leitner L: linux-sctp@vger.kernel.org S: Maintained W: http://lksctp.sourceforge.net -F: Documentation/networking/sctp.txt +F: Documentation/networking/sctp.rst F: include/linux/sctp.h F: include/net/sctp/ F: include/uapi/linux/sctp.h From patchwork Thu Apr 30 16:04:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83367C47257 for ; Thu, 30 Apr 2020 16:04:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56D8024953 for ; Thu, 30 Apr 2020 16:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262699; bh=nolpLC+XtpUxWUQxmtZr8j7lwop5gfR05OFWb3huBdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hF/Ak41mJ7c/dy9qj2DO+PBDcl/s3PM+qY0TN4gksEzkMdrBg0TPPzNdoQjNertAo W8N2JV9BTdmCcBI1N421sXOZnyh7OLyVJdwPqk5tCHQGn9zHHg1IdnqRhVYjiojl+c hpzJrZvDSG4Jtlf6aLG4CFevHISyCjahKImZ4J9g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728036AbgD3QEn (ORCPT ); Thu, 30 Apr 2020 12:04:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:50872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbgD3QEj (ORCPT ); Thu, 30 Apr 2020 12:04:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 841F82498F; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=nolpLC+XtpUxWUQxmtZr8j7lwop5gfR05OFWb3huBdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bGWUoL4Q3uWwP3L8NAkbk2ZuJ1wilnBnV0iBopMtH0LSKQHYE5Sb6nGbrOwNSCo+b gylqZKQXSPj7RH4WmjBbkfLYWZWEM+d//4msWKgAbdUX0C06Y+oM6OAqSLIRJ6esrG lOXTO4dgr5C0l2J5WwcSlliptUDsAWSm/5VQZW5s= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxGV-Px; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 30/37] docs: networking: convert skfp.txt to ReST Date: Thu, 30 Apr 2020 18:04:25 +0200 Message-Id: <1f1a7504063f2b79f8f21144cf8d493df04941e3.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - use copyright symbol; - add a document title; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../networking/{skfp.txt => skfp.rst} | 153 +++++++++++------- drivers/net/fddi/Kconfig | 2 +- 3 files changed, 95 insertions(+), 61 deletions(-) rename Documentation/networking/{skfp.txt => skfp.rst} (68%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 716744c568b7..d19ddcbe66e5 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -103,6 +103,7 @@ Contents: sctp secid seg6-sysctl + skfp .. only:: subproject and html diff --git a/Documentation/networking/skfp.txt b/Documentation/networking/skfp.rst similarity index 68% rename from Documentation/networking/skfp.txt rename to Documentation/networking/skfp.rst index 203ec66c9fb4..58f548105c1d 100644 --- a/Documentation/networking/skfp.txt +++ b/Documentation/networking/skfp.rst @@ -1,35 +1,41 @@ -(C)Copyright 1998-2000 SysKonnect, -=========================================================================== +.. SPDX-License-Identifier: GPL-2.0 + +.. include:: + +======================== +SysKonnect driver - SKFP +======================== + +|copy| Copyright 1998-2000 SysKonnect, skfp.txt created 11-May-2000 Readme File for skfp.o v2.06 -This file contains -(1) OVERVIEW -(2) SUPPORTED ADAPTERS -(3) GENERAL INFORMATION -(4) INSTALLATION -(5) INCLUSION OF THE ADAPTER IN SYSTEM START -(6) TROUBLESHOOTING -(7) FUNCTION OF THE ADAPTER LEDS -(8) HISTORY +.. This file contains -=========================================================================== + (1) OVERVIEW + (2) SUPPORTED ADAPTERS + (3) GENERAL INFORMATION + (4) INSTALLATION + (5) INCLUSION OF THE ADAPTER IN SYSTEM START + (6) TROUBLESHOOTING + (7) FUNCTION OF THE ADAPTER LEDS + (8) HISTORY - -(1) OVERVIEW -============ +1. Overview +=========== This README explains how to use the driver 'skfp' for Linux with your network adapter. Chapter 2: Contains a list of all network adapters that are supported by - this driver. +this driver. -Chapter 3: Gives some general information. +Chapter 3: + Gives some general information. Chapter 4: Describes common problems and solutions. @@ -37,14 +43,13 @@ Chapter 5: Shows the changed functionality of the adapter LEDs. Chapter 6: History of development. -*** - -(2) SUPPORTED ADAPTERS -====================== +2. Supported adapters +===================== The network driver 'skfp' supports the following network adapters: SysKonnect adapters: + - SK-5521 (SK-NET FDDI-UP) - SK-5522 (SK-NET FDDI-UP DAS) - SK-5541 (SK-NET FDDI-FP) @@ -55,157 +60,187 @@ SysKonnect adapters: - SK-5841 (SK-NET FDDI-FP64) - SK-5843 (SK-NET FDDI-LP64) - SK-5844 (SK-NET FDDI-LP64 DAS) + Compaq adapters (not tested): + - Netelligent 100 FDDI DAS Fibre SC - Netelligent 100 FDDI SAS Fibre SC - Netelligent 100 FDDI DAS UTP - Netelligent 100 FDDI SAS UTP - Netelligent 100 FDDI SAS Fibre MIC -*** -(3) GENERAL INFORMATION -======================= +3. General Information +====================== From v2.01 on, the driver is integrated in the linux kernel sources. Therefore, the installation is the same as for any other adapter supported by the kernel. + Refer to the manual of your distribution about the installation of network adapters. + Makes my life much easier :-) -*** - -(4) TROUBLESHOOTING -=================== +4. Troubleshooting +================== If you run into problems during installation, check those items: -Problem: The FDDI adapter cannot be found by the driver. -Reason: Look in /proc/pci for the following entry: - 'FDDI network controller: SysKonnect SK-FDDI-PCI ...' +Problem: + The FDDI adapter cannot be found by the driver. + +Reason: + Look in /proc/pci for the following entry: + + 'FDDI network controller: SysKonnect SK-FDDI-PCI ...' + If this entry exists, then the FDDI adapter has been found by the system and should be able to be used. + If this entry does not exist or if the file '/proc/pci' is not there, then you may have a hardware problem or PCI support may not be enabled in your kernel. + The adapter can be checked using the diagnostic program which is available from the SysKonnect web site: + www.syskonnect.de + Some COMPAQ machines have a problem with PCI under Linux. This is described in the 'PCI howto' document (included in some distributions or available from the www, e.g. at 'www.linux.org') and no workaround is available. -Problem: You want to use your computer as a router between - multiple IP subnetworks (using multiple adapters), but +Problem: + You want to use your computer as a router between + multiple IP subnetworks (using multiple adapters), but you cannot reach computers in other subnetworks. -Reason: Either the router's kernel is not configured for IP + +Reason: + Either the router's kernel is not configured for IP forwarding or there is a problem with the routing table and gateway configuration in at least one of the computers. If your problem is not listed here, please contact our -technical support for help. -You can send email to: - linux@syskonnect.de +technical support for help. + +You can send email to: linux@syskonnect.de + When contacting our technical support, please ensure that the following information is available: + - System Manufacturer and Model - Boards in your system - Distribution - Kernel version -*** +5. Function of the Adapter LEDs +=============================== -(5) FUNCTION OF THE ADAPTER LEDS -================================ + The functionality of the LED's on the FDDI network adapters was + changed in SMT version v2.82. With this new SMT version, the yellow + LED works as a ring operational indicator. An active yellow LED + indicates that the ring is down. The green LED on the adapter now + works as a link indicator where an active GREEN LED indicates that + the respective port has a physical connection. - The functionality of the LED's on the FDDI network adapters was - changed in SMT version v2.82. With this new SMT version, the yellow - LED works as a ring operational indicator. An active yellow LED - indicates that the ring is down. The green LED on the adapter now - works as a link indicator where an active GREEN LED indicates that - the respective port has a physical connection. + With versions of SMT prior to v2.82 a ring up was indicated if the + yellow LED was off while the green LED(s) showed the connection + status of the adapter. During a ring down the green LED was off and + the yellow LED was on. - With versions of SMT prior to v2.82 a ring up was indicated if the - yellow LED was off while the green LED(s) showed the connection - status of the adapter. During a ring down the green LED was off and - the yellow LED was on. + All implementations indicate that a driver is not loaded if + all LEDs are off. - All implementations indicate that a driver is not loaded if - all LEDs are off. -*** - - -(6) HISTORY -=========== +6. History +========== v2.06 (20000511) (In-Kernel version) New features: + - 64 bit support - new pci dma interface - in kernel 2.3.99 v2.05 (20000217) (In-Kernel version) New features: + - Changes for 2.3.45 kernel v2.04 (20000207) (Standalone version) New features: + - Added rx/tx byte counter v2.03 (20000111) (Standalone version) Problems fixed: + - Fixed printk statements from v2.02 v2.02 (991215) (Standalone version) Problems fixed: + - Removed unnecessary output - Fixed path for "printver.sh" in makefile v2.01 (991122) (In-Kernel version) New features: + - Integration in Linux kernel sources - Support for memory mapped I/O. v2.00 (991112) New features: + - Full source released under GPL v1.05 (991023) Problems fixed: + - Compilation with kernel version 2.2.13 failed v1.04 (990427) Changes: + - New SMT module included, changing LED functionality + Problems fixed: + - Synchronization on SMP machines was buggy v1.03 (990325) Problems fixed: + - Interrupt routing on SMP machines could be incorrect v1.02 (990310) New features: + - Support for kernel versions 2.2.x added - Kernel patch instead of private duplicate of kernel functions v1.01 (980812) Problems fixed: + Connection hangup with telnet Slow telnet connection v1.00 beta 01 (980507) New features: + None. + Problems fixed: + None. + Known limitations: - - tar archive instead of standard package format (rpm). + + - tar archive instead of standard package format (rpm). - FDDI statistic is empty. - not tested with 2.1.xx kernels - integration in kernel not tested @@ -216,5 +251,3 @@ v1.00 beta 01 (980507) - does not work on some COMPAQ machines. See the PCI howto document for details about this problem. - data corruption with kernel versions below 2.0.33. - -*** End of information file *** diff --git a/drivers/net/fddi/Kconfig b/drivers/net/fddi/Kconfig index 3b412a56f2cb..da4f58eed08f 100644 --- a/drivers/net/fddi/Kconfig +++ b/drivers/net/fddi/Kconfig @@ -77,7 +77,7 @@ config SKFP - Netelligent 100 FDDI SAS UTP - Netelligent 100 FDDI SAS Fibre MIC - Read for information about + Read for information about the driver. Questions concerning this driver can be addressed to: From patchwork Thu Apr 30 16:04:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA63EC47257 for ; Thu, 30 Apr 2020 16:05:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A25712082E for ; Thu, 30 Apr 2020 16:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262742; bh=d94CsypiJEYQM/PseQEmq5pXeaworePLCyj5TfMicOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=a2muYHaWYgFR8k7RrdK1NTn+viqNRKhG0M7MmRNqvjIks03rfhTXDvN36nCtSKdbS sxJFInlJA39vQn+4uSOW179bC01nVAOX3Bocz9qY2fegiIw82ipjxEnzeGRgs8b/ZU DnoX12fJlRZvQCp1Lc6Q+9Xcg9LT0+/dHf69j8Ow= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728199AbgD3QFl (ORCPT ); Thu, 30 Apr 2020 12:05:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:50948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726350AbgD3QEj (ORCPT ); Thu, 30 Apr 2020 12:04:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9BB9C24996; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=d94CsypiJEYQM/PseQEmq5pXeaworePLCyj5TfMicOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QFVTwCE05GKbjAIiVWJcmuvzyWF1jmAYqlXSW9p5IVHDimnMzYxwl18SBzoXsPjOV sjcwD95387WIN+GKr/aHZmRLIuUBhuiNx2v9FHbqtqPuZ/lAhewdf8JEQgX21GVT1m BLthGxSjsmPsVaC5Q/p65FRdBm6y04cfWO3uUZR8= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxGg-Rg; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , Ioana Radulescu , Ioana Ciornei , Greg Kroah-Hartman , netdev@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 32/37] docs: networking: convert switchdev.txt to ReST Date: Thu, 30 Apr 2020 18:04:27 +0200 Message-Id: <549e294cfa5dc175b4b72c624cbabfbee9f0b84f.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - use copyright symbol; - adjust title markup; - 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 --- Documentation/networking/index.rst | 1 + .../{switchdev.txt => switchdev.rst} | 114 ++++++++++-------- drivers/staging/fsl-dpaa2/ethsw/README | 2 +- 3 files changed, 66 insertions(+), 51 deletions(-) rename Documentation/networking/{switchdev.txt => switchdev.rst} (84%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index e5a705024c6a..5e495804f96f 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -105,6 +105,7 @@ Contents: seg6-sysctl skfp strparser + switchdev .. only:: subproject and html diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.rst similarity index 84% rename from Documentation/networking/switchdev.txt rename to Documentation/networking/switchdev.rst index 86174ce8cd13..ddc3f35775dc 100644 --- a/Documentation/networking/switchdev.txt +++ b/Documentation/networking/switchdev.rst @@ -1,7 +1,13 @@ +.. SPDX-License-Identifier: GPL-2.0 +.. include:: + +=============================================== Ethernet switch device driver model (switchdev) =============================================== -Copyright (c) 2014 Jiri Pirko -Copyright (c) 2014-2015 Scott Feldman + +Copyright |copy| 2014 Jiri Pirko + +Copyright |copy| 2014-2015 Scott Feldman The Ethernet switch device driver model (switchdev) is an in-kernel driver @@ -12,53 +18,57 @@ Figure 1 is a block diagram showing the components of the switchdev model for an example setup using a data-center-class switch ASIC chip. Other setups with SR-IOV or soft switches, such as OVS, are possible. +:: - User-space tools + + User-space tools user space | +-------------------------------------------------------------------+ kernel | Netlink - | - +--------------+-------------------------------+ - | Network stack | - | (Linux) | - | | - +----------------------------------------------+ + | + +--------------+-------------------------------+ + | Network stack | + | (Linux) | + | | + +----------------------------------------------+ - sw1p2 sw1p4 sw1p6 - sw1p1 + sw1p3 + sw1p5 + eth1 - + | + | + | + - | | | | | | | - +--+----+----+----+----+----+---+ +-----+-----+ - | Switch driver | | mgmt | - | (this document) | | driver | - | | | | - +--------------+----------------+ +-----------+ - | + sw1p2 sw1p4 sw1p6 + sw1p1 + sw1p3 + sw1p5 + eth1 + + | + | + | + + | | | | | | | + +--+----+----+----+----+----+---+ +-----+-----+ + | Switch driver | | mgmt | + | (this document) | | driver | + | | | | + +--------------+----------------+ +-----------+ + | kernel | HW bus (eg PCI) +-------------------------------------------------------------------+ hardware | - +--------------+----------------+ - | Switch device (sw1) | - | +----+ +--------+ - | | v offloaded data path | mgmt port - | | | | - +--|----|----+----+----+----+---+ - | | | | | | - + + + + + + - p1 p2 p3 p4 p5 p6 + +--------------+----------------+ + | Switch device (sw1) | + | +----+ +--------+ + | | v offloaded data path | mgmt port + | | | | + +--|----|----+----+----+----+---+ + | | | | | | + + + + + + + + p1 p2 p3 p4 p5 p6 - front-panel ports + front-panel ports - Fig 1. + Fig 1. Include Files ------------- -#include -#include +:: + + #include + #include Configuration @@ -114,10 +124,10 @@ Using port PHYS name (ndo_get_phys_port_name) for the key is particularly useful for dynamically-named ports where the device names its ports based on external configuration. For example, if a physical 40G port is split logically into 4 10G ports, resulting in 4 port netdevs, the device can give a unique -name for each port using port PHYS name. The udev rule would be: +name for each port using port PHYS name. The udev rule would be:: -SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}=="", \ - ATTR{phys_port_name}!="", NAME="swX$attr{phys_port_name}" + SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}=="", \ + ATTR{phys_port_name}!="", NAME="swX$attr{phys_port_name}" Suggested naming convention is "swXpYsZ", where X is the switch name or ID, Y is the port name or ID, and Z is the sub-port name or ID. For example, sw1p1s0 @@ -173,7 +183,7 @@ Static FDB Entries The switchdev driver should implement ndo_fdb_add, ndo_fdb_del and ndo_fdb_dump to support static FDB entries installed to the device. Static bridge FDB -entries are installed, for example, using iproute2 bridge cmd: +entries are installed, for example, using iproute2 bridge cmd:: bridge fdb add ADDR dev DEV [vlan VID] [self] @@ -185,7 +195,7 @@ XXX: what should be done if offloading this rule to hardware fails (for example, due to full capacity in hardware tables) ? Note: by default, the bridge does not filter on VLAN and only bridges untagged -traffic. To enable VLAN support, turn on VLAN filtering: +traffic. To enable VLAN support, turn on VLAN filtering:: echo 1 >/sys/class/net//bridge/vlan_filtering @@ -194,7 +204,7 @@ Notification of Learned/Forgotten Source MAC/VLANs The switch device will learn/forget source MAC address/VLAN on ingress packets and notify the switch driver of the mac/vlan/port tuples. The switch driver, -in turn, will notify the bridge driver using the switchdev notifier call: +in turn, will notify the bridge driver using the switchdev notifier call:: err = call_switchdev_notifiers(val, dev, info, extack); @@ -202,7 +212,7 @@ Where val is SWITCHDEV_FDB_ADD when learning and SWITCHDEV_FDB_DEL when forgetting, and info points to a struct switchdev_notifier_fdb_info. On SWITCHDEV_FDB_ADD, the bridge driver will install the FDB entry into the bridge's FDB and mark the entry as NTF_EXT_LEARNED. The iproute2 bridge -command will label these entries "offload": +command will label these entries "offload":: $ bridge fdb 52:54:00:12:35:01 dev sw1p1 master br0 permanent @@ -219,11 +229,11 @@ command will label these entries "offload": 01:00:5e:00:00:01 dev br0 self permanent 33:33:ff:12:35:01 dev br0 self permanent -Learning on the port should be disabled on the bridge using the bridge command: +Learning on the port should be disabled on the bridge using the bridge command:: bridge link set dev DEV learning off -Learning on the device port should be enabled, as well as learning_sync: +Learning on the device port should be enabled, as well as learning_sync:: bridge link set dev DEV learning on self bridge link set dev DEV learning_sync on self @@ -314,12 +324,16 @@ forwards the packet to the matching FIB entry's nexthop(s) egress ports. To program the device, the driver has to register a FIB notifier handler using register_fib_notifier. The following events are available: -FIB_EVENT_ENTRY_ADD: used for both adding a new FIB entry to the device, - or modifying an existing entry on the device. -FIB_EVENT_ENTRY_DEL: used for removing a FIB entry -FIB_EVENT_RULE_ADD, FIB_EVENT_RULE_DEL: used to propagate FIB rule changes -FIB_EVENT_ENTRY_ADD and FIB_EVENT_ENTRY_DEL events pass: +=================== =================================================== +FIB_EVENT_ENTRY_ADD used for both adding a new FIB entry to the device, + or modifying an existing entry on the device. +FIB_EVENT_ENTRY_DEL used for removing a FIB entry +FIB_EVENT_RULE_ADD, +FIB_EVENT_RULE_DEL used to propagate FIB rule changes +=================== =================================================== + +FIB_EVENT_ENTRY_ADD and FIB_EVENT_ENTRY_DEL events pass:: struct fib_entry_notifier_info { struct fib_notifier_info info; /* must be first */ @@ -332,12 +346,12 @@ FIB_EVENT_ENTRY_ADD and FIB_EVENT_ENTRY_DEL events pass: u32 nlflags; }; -to add/modify/delete IPv4 dst/dest_len prefix on table tb_id. The *fi -structure holds details on the route and route's nexthops. *dev is one of the -port netdevs mentioned in the route's next hop list. +to add/modify/delete IPv4 dst/dest_len prefix on table tb_id. The ``*fi`` +structure holds details on the route and route's nexthops. ``*dev`` is one +of the port netdevs mentioned in the route's next hop list. Routes offloaded to the device are labeled with "offload" in the ip route -listing: +listing:: $ ip route show default via 192.168.0.2 dev eth0 diff --git a/drivers/staging/fsl-dpaa2/ethsw/README b/drivers/staging/fsl-dpaa2/ethsw/README index f6fc07f780d1..b48dcbf7c5fb 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/README +++ b/drivers/staging/fsl-dpaa2/ethsw/README @@ -79,7 +79,7 @@ The DPSW can have ports connected to DPNIs or to PHYs via DPMACs. For a more detailed description of the Ethernet switch device driver model see: - Documentation/networking/switchdev.txt + Documentation/networking/switchdev.rst Creating an Ethernet Switch =========================== From patchwork Thu Apr 30 16:04:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220198 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ACD0C47259 for ; Thu, 30 Apr 2020 16:05:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAF2C2076D for ; Thu, 30 Apr 2020 16:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262757; bh=2swBC8r+6DylYJS2HK2nzZ/1FoxLj3zxrPtfpoRAFVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=19LTlYu3aFyOUrbDZBpEPFqXV7Hk2FSGJ0Icbq7IdxIYjlmsL9p4ay0m4NJDKzYuc WeNTeo47fuBcaMsewLdPeXDjOkcPlnYC0hI4jGiLQTbb8TmRQa7h1jfaTfksbxUksK VrgSbwVaXWkxg0qKoPO4AVQ6uqK0sZzExpTRdyGo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728275AbgD3QFt (ORCPT ); Thu, 30 Apr 2020 12:05:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:50876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727813AbgD3QEj (ORCPT ); Thu, 30 Apr 2020 12:04:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A39024995; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=2swBC8r+6DylYJS2HK2nzZ/1FoxLj3zxrPtfpoRAFVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ok9ZinEe1ctZCFADH2tEs/hUj+qvCbP71fEhwL5gKyOyork/CvCHVF0g3V5W+QhBg f05pc27u5ieV54rR1ZLXVWUIFcD7XuRgrxqR4iP4DfeWiUoA8/MuG8ovBQjbykjpo1 6uWXUqh3Ds3UPKhS7/IB8DuLC0Mhef05A25cf/Us= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxGl-SV; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 33/37] docs: networking: convert tc-actions-env-rules.txt to ReST Date: Thu, 30 Apr 2020 18:04:28 +0200 Message-Id: <88a50c11478412a67595b1b93d2e79ebe5ba150a.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - add SPDX header; - add a document title; - use the right numbered list markup; - adjust identation, whitespaces and blank lines where needed; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + .../networking/tc-actions-env-rules.rst | 29 +++++++++++++++++++ .../networking/tc-actions-env-rules.txt | 24 --------------- 3 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 Documentation/networking/tc-actions-env-rules.rst delete mode 100644 Documentation/networking/tc-actions-env-rules.txt diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 5e495804f96f..f53d89b5679a 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -106,6 +106,7 @@ Contents: skfp strparser switchdev + tc-actions-env-rules .. only:: subproject and html diff --git a/Documentation/networking/tc-actions-env-rules.rst b/Documentation/networking/tc-actions-env-rules.rst new file mode 100644 index 000000000000..86884b8fb4e0 --- /dev/null +++ b/Documentation/networking/tc-actions-env-rules.rst @@ -0,0 +1,29 @@ +.. SPDX-License-Identifier: GPL-2.0 + +================================ +TC Actions - Environmental Rules +================================ + + +The "environmental" rules for authors of any new tc actions are: + +1) If you stealeth or borroweth any packet thou shalt be branching + from the righteous path and thou shalt cloneth. + + For example if your action queues a packet to be processed later, + or intentionally branches by redirecting a packet, then you need to + clone the packet. + +2) If you munge any packet thou shalt call pskb_expand_head in the case + someone else is referencing the skb. After that you "own" the skb. + +3) Dropping packets you don't own is a no-no. You simply return + TC_ACT_SHOT to the caller and they will drop it. + +The "environmental" rules for callers of actions (qdiscs etc) are: + +#) Thou art responsible for freeing anything returned as being + TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is + returned, then all is great and you don't need to do anything. + +Post on netdev if something is unclear. diff --git a/Documentation/networking/tc-actions-env-rules.txt b/Documentation/networking/tc-actions-env-rules.txt deleted file mode 100644 index f37814693ad3..000000000000 --- a/Documentation/networking/tc-actions-env-rules.txt +++ /dev/null @@ -1,24 +0,0 @@ - -The "environmental" rules for authors of any new tc actions are: - -1) If you stealeth or borroweth any packet thou shalt be branching -from the righteous path and thou shalt cloneth. - -For example if your action queues a packet to be processed later, -or intentionally branches by redirecting a packet, then you need to -clone the packet. - -2) If you munge any packet thou shalt call pskb_expand_head in the case -someone else is referencing the skb. After that you "own" the skb. - -3) Dropping packets you don't own is a no-no. You simply return -TC_ACT_SHOT to the caller and they will drop it. - -The "environmental" rules for callers of actions (qdiscs etc) are: - -*) Thou art responsible for freeing anything returned as being -TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is -returned, then all is great and you don't need to do anything. - -Post on netdev if something is unclear. - From patchwork Thu Apr 30 16:04:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 220193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CCCBC47258 for ; Thu, 30 Apr 2020 16:06:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0AC12082E for ; Thu, 30 Apr 2020 16:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262803; bh=DGsx6h/Swi27aAMJQlbcrw/nxI9G75+HiBG54132wHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hfwR5U7z8Isc0ZeVRhjVMVHulnC08AANhY13o05gA4/HZHQAlbUOANQl3ZzxOON+j xycrnDoph9su1U1Z0qpIDo29rregaeLAYFOIrLjL3XUcPayIkvW48FxJbXGTOyuuxQ YylfklEiWCFl50eR7CsPNI0+Gs7pdA3mw5q3JOK8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbgD3QGT (ORCPT ); Thu, 30 Apr 2020 12:06:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:50950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbgD3QEj (ORCPT ); Thu, 30 Apr 2020 12:04:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE4E32499C; Thu, 30 Apr 2020 16:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588262676; bh=DGsx6h/Swi27aAMJQlbcrw/nxI9G75+HiBG54132wHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t7bLXBIdis3/P3r5maKygrUkusCX8BbpuHEQ80yP0kt6Mj5DP4IAsVbaB7PIQOU48 TqqlVqcoaHq0FRM2u/TojaoL+d5iYxuy82TGJjBAI97jNNIRAUAsz75kr4U4N0Y2mh Uf8O7oUC+yxeL+dJNyfkX4MFBgqAs3W9mw40JqpQ= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jUBfu-00AxGu-UB; Thu, 30 Apr 2020 18:04:34 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 35/37] docs: networking: convert team.txt to ReST Date: Thu, 30 Apr 2020 18:04:30 +0200 Message-Id: <970a11887c8007cc02fbb99f6890c36616be286e.1588261997.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Not much to be done here: - add SPDX header; - add a document title; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/networking/index.rst | 1 + Documentation/networking/{team.txt => team.rst} | 6 ++++++ 2 files changed, 7 insertions(+) rename Documentation/networking/{team.txt => team.rst} (67%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 89b02fbfc2eb..be65ee509669 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -108,6 +108,7 @@ Contents: switchdev tc-actions-env-rules tcp-thin + team .. only:: subproject and html diff --git a/Documentation/networking/team.txt b/Documentation/networking/team.rst similarity index 67% rename from Documentation/networking/team.txt rename to Documentation/networking/team.rst index 5a013686b9ea..0a7f3a059586 100644 --- a/Documentation/networking/team.txt +++ b/Documentation/networking/team.rst @@ -1,2 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 + +==== +Team +==== + Team devices are driven from userspace via libteam library which is here: https://github.com/jpirko/libteam