Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 951cc93a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1287 commits)
  icmp: Fix regression in nexthop resolution during replies.
  net: Fix ppc64 BPF JIT dependencies.
  acenic: include NET_SKB_PAD headroom to incoming skbs
  ixgbe: convert to ndo_fix_features
  ixgbe: only enable WoL for magic packet by default
  ixgbe: remove ifdef check for non-existent define
  ixgbe: Pass staterr instead of re-reading status and error bits from descriptor
  ixgbe: Move interrupt related values out of ring and into q_vector
  ixgbe: add structure for containing RX/TX rings to q_vector
  ixgbe: inline the ixgbe_maybe_stop_tx function
  ixgbe: Update ATR to use recorded TX queues instead of CPU for routing
  igb: Fix for DH89xxCC near end loopback test
  e1000: always call e1000_check_for_link() on e1000_ce4100 MACs.
  netxen: add fw version compatibility check
  be2net: request native mode each time the card is reset
  ipv4: Constrain UFO fragment sizes to multiples of 8 bytes
  virtio_net: Fix panic in virtnet_remove
  ipv6: make fragment identifications less predictable
  ipv6: unshare inetpeers
  can: make function can_get_bittiming static
  ...
parents a7e1aabb 415b3334
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -402,8 +402,9 @@
!Finclude/net/mac80211.h set_key_cmd
!Finclude/net/mac80211.h set_key_cmd
!Finclude/net/mac80211.h ieee80211_key_conf
!Finclude/net/mac80211.h ieee80211_key_conf
!Finclude/net/mac80211.h ieee80211_key_flags
!Finclude/net/mac80211.h ieee80211_key_flags
!Finclude/net/mac80211.h ieee80211_tkip_key_type
!Finclude/net/mac80211.h ieee80211_get_tkip_p1k
!Finclude/net/mac80211.h ieee80211_get_tkip_key
!Finclude/net/mac80211.h ieee80211_get_tkip_p1k_iv
!Finclude/net/mac80211.h ieee80211_get_tkip_p2k
!Finclude/net/mac80211.h ieee80211_key_removed
!Finclude/net/mac80211.h ieee80211_key_removed
      </chapter>
      </chapter>


+9 −9
Original line number Original line Diff line number Diff line
@@ -260,7 +260,7 @@ int main(int argc, char *argv[])
		case 'V': opt_V++; exclusive++; break;
		case 'V': opt_V++; exclusive++; break;


		case '?':
		case '?':
			fprintf(stderr, usage_msg);
			fprintf(stderr, "%s", usage_msg);
			res = 2;
			res = 2;
			goto out;
			goto out;
		}
		}
@@ -268,13 +268,13 @@ int main(int argc, char *argv[])


	/* options check */
	/* options check */
	if (exclusive > 1) {
	if (exclusive > 1) {
		fprintf(stderr, usage_msg);
		fprintf(stderr, "%s", usage_msg);
		res = 2;
		res = 2;
		goto out;
		goto out;
	}
	}


	if (opt_v || opt_V) {
	if (opt_v || opt_V) {
		printf(version);
		printf("%s", version);
		if (opt_V) {
		if (opt_V) {
			res = 0;
			res = 0;
			goto out;
			goto out;
@@ -282,14 +282,14 @@ int main(int argc, char *argv[])
	}
	}


	if (opt_u) {
	if (opt_u) {
		printf(usage_msg);
		printf("%s", usage_msg);
		res = 0;
		res = 0;
		goto out;
		goto out;
	}
	}


	if (opt_h) {
	if (opt_h) {
		printf(usage_msg);
		printf("%s", usage_msg);
		printf(help_msg);
		printf("%s", help_msg);
		res = 0;
		res = 0;
		goto out;
		goto out;
	}
	}
@@ -309,7 +309,7 @@ int main(int argc, char *argv[])
			goto out;
			goto out;
		} else {
		} else {
			/* Just show usage */
			/* Just show usage */
			fprintf(stderr, usage_msg);
			fprintf(stderr, "%s", usage_msg);
			res = 2;
			res = 2;
			goto out;
			goto out;
		}
		}
@@ -320,7 +320,7 @@ int main(int argc, char *argv[])
	master_ifname = *spp++;
	master_ifname = *spp++;


	if (master_ifname == NULL) {
	if (master_ifname == NULL) {
		fprintf(stderr, usage_msg);
		fprintf(stderr, "%s", usage_msg);
		res = 2;
		res = 2;
		goto out;
		goto out;
	}
	}
@@ -339,7 +339,7 @@ int main(int argc, char *argv[])


	if (slave_ifname == NULL) {
	if (slave_ifname == NULL) {
		if (opt_d || opt_c) {
		if (opt_d || opt_c) {
			fprintf(stderr, usage_msg);
			fprintf(stderr, "%s", usage_msg);
			res = 2;
			res = 2;
			goto out;
			goto out;
		}
		}
+13 −16
Original line number Original line Diff line number Diff line
@@ -106,16 +106,6 @@ inet_peer_maxttl - INTEGER
	when the number of entries in the pool is very small).
	when the number of entries in the pool is very small).
	Measured in seconds.
	Measured in seconds.


inet_peer_gc_mintime - INTEGER
	Minimum interval between garbage collection passes.  This interval is
	in effect under high memory pressure on the pool.
	Measured in seconds.

inet_peer_gc_maxtime - INTEGER
	Minimum interval between garbage collection passes.  This interval is
	in effect under low (or absent) memory pressure on the pool.
	Measured in seconds.

TCP variables:
TCP variables:


somaxconn - INTEGER
somaxconn - INTEGER
@@ -394,7 +384,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max
	min: Minimal size of receive buffer used by TCP sockets.
	min: Minimal size of receive buffer used by TCP sockets.
	It is guaranteed to each TCP socket, even under moderate memory
	It is guaranteed to each TCP socket, even under moderate memory
	pressure.
	pressure.
	Default: 8K
	Default: 1 page


	default: initial size of receive buffer used by TCP sockets.
	default: initial size of receive buffer used by TCP sockets.
	This value overrides net.core.rmem_default used by other protocols.
	This value overrides net.core.rmem_default used by other protocols.
@@ -483,7 +473,7 @@ tcp_window_scaling - BOOLEAN
tcp_wmem - vector of 3 INTEGERs: min, default, max
tcp_wmem - vector of 3 INTEGERs: min, default, max
	min: Amount of memory reserved for send buffers for TCP sockets.
	min: Amount of memory reserved for send buffers for TCP sockets.
	Each TCP socket has rights to use it due to fact of its birth.
	Each TCP socket has rights to use it due to fact of its birth.
	Default: 4K
	Default: 1 page


	default: initial size of send buffer used by TCP sockets.  This
	default: initial size of send buffer used by TCP sockets.  This
	value overrides net.core.wmem_default used by other protocols.
	value overrides net.core.wmem_default used by other protocols.
@@ -553,13 +543,13 @@ udp_rmem_min - INTEGER
	Minimal size of receive buffer used by UDP sockets in moderation.
	Minimal size of receive buffer used by UDP sockets in moderation.
	Each UDP socket is able to use the size for receiving data, even if
	Each UDP socket is able to use the size for receiving data, even if
	total pages of UDP sockets exceed udp_mem pressure. The unit is byte.
	total pages of UDP sockets exceed udp_mem pressure. The unit is byte.
	Default: 4096
	Default: 1 page


udp_wmem_min - INTEGER
udp_wmem_min - INTEGER
	Minimal size of send buffer used by UDP sockets in moderation.
	Minimal size of send buffer used by UDP sockets in moderation.
	Each UDP socket is able to use the size for sending data, even if
	Each UDP socket is able to use the size for sending data, even if
	total pages of UDP sockets exceed udp_mem pressure. The unit is byte.
	total pages of UDP sockets exceed udp_mem pressure. The unit is byte.
	Default: 4096
	Default: 1 page


CIPSOv4 Variables:
CIPSOv4 Variables:


@@ -1465,10 +1455,17 @@ sctp_mem - vector of 3 INTEGERs: min, pressure, max
	Default is calculated at boot time from amount of available memory.
	Default is calculated at boot time from amount of available memory.


sctp_rmem - vector of 3 INTEGERs: min, default, max
sctp_rmem - vector of 3 INTEGERs: min, default, max
	See tcp_rmem for a description.
	Only the first value ("min") is used, "default" and "max" are
	ignored.

	min: Minimal size of receive buffer used by SCTP socket.
	It is guaranteed to each SCTP socket (but not association) even
	under moderate memory pressure.

	Default: 1 page


sctp_wmem  - vector of 3 INTEGERs: min, default, max
sctp_wmem  - vector of 3 INTEGERs: min, default, max
	See tcp_wmem for a description.
	Currently this tunable has no effect.


addr_scope_policy - INTEGER
addr_scope_policy - INTEGER
	Control IPv4 address scoping - draft-stewart-tsvwg-sctp-ipv4-00
	Control IPv4 address scoping - draft-stewart-tsvwg-sctp-ipv4-00
+154 −0
Original line number Original line Diff line number Diff line
Netdev features mess and how to get out from it alive
=====================================================

Author:
	Michał Mirosław <mirq-linux@rere.qmqm.pl>



 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)
that relieve an OS of various tasks like generating and checking checksums,
splitting packets, classifying them.  Those capabilities and their state
are commonly referred to as netdev features in Linux kernel world.

There are currently three sets of features relevant to the driver, and
one used internally by network core:

 1. netdev->hw_features set contains features whose state may possibly
    be changed (enabled or disabled) for a particular device by user's
    request.  This set should be initialized in ndo_init callback and not
    changed later.

 2. netdev->features set contains features which are currently enabled
    for a device.  This should be changed only by network core or in
    error paths of ndo_set_features callback.

 3. netdev->vlan_features set contains features whose state is inherited
    by child VLAN devices (limits netdev->features set).  This is currently
    used for all VLAN devices whether tags are stripped or inserted in
    hardware or software.

 4. netdev->wanted_features set contains feature set requested by user.
    This set is filtered by ndo_fix_features callback whenever it or
    some device-specific conditions change. This set is internal to
    networking core and should not be referenced in drivers.



 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
and netdev_fix_features(). If the resulting set differs from current
set, it is passed to ndo_set_features callback and (if the callback
returns success) replaces value stored in netdev->features.
NETDEV_FEAT_CHANGE notification is issued after that whenever current
set might have changed.

The following events trigger recalculation:
 1. device's registration, after ndo_init returned success
 2. user requested changes in features state
 3. netdev_update_features() is called

ndo_*_features callbacks are called with rtnl_lock held. Missing callbacks
are treated as always returning success.

A driver that wants to trigger recalculation must do so by calling
netdev_update_features() while holding rtnl_lock. This should not be done
from ndo_*_features callbacks. netdev->features should not be modified by
driver except by means of ndo_fix_features callback.



 Part III: Implementation hints
================================

 * ndo_fix_features:

All dependencies between features should be resolved here. The resulting
set can be reduced further by networking core imposed limitations (as coded
in netdev_fix_features()). For this reason it is safer to disable a feature
when its dependencies are not met instead of forcing the dependency on.

This callback should not modify hardware nor driver state (should be
stateless).  It can be called multiple times between successive
ndo_set_features calls.

Callback must not alter features contained in NETIF_F_SOFT_FEATURES or
NETIF_F_NEVER_CHANGE sets. The exception is NETIF_F_VLAN_CHALLENGED but
care must be taken as the change won't affect already configured VLANs.

 * ndo_set_features:

Hardware should be reconfigured to match passed feature set. The set
should not be altered unless some error condition happens that can't
be reliably detected in ndo_fix_features. In this case, the callback
should update netdev->features to match resulting hardware state.
Errors returned are not (and cannot be) propagated anywhere except dmesg.
(Note: successful return is zero, >0 means silent error.)



 Part IV: Features
===================

For current list of features, see include/linux/netdev_features.h.
This section describes semantics of some of them.

 * Transmit checksumming

For complete description, see comments near the top of include/linux/skbuff.h.

Note: NETIF_F_HW_CSUM is a superset of NETIF_F_IP_CSUM + NETIF_F_IPV6_CSUM.
It means that device can fill TCP/UDP-like checksum anywhere in the packets
whatever headers there might be.

 * Transmit TCP segmentation offload

NETIF_F_TSO_ECN means that hardware can properly split packets with CWR bit
set, be it TCPv4 (when NETIF_F_TSO is enabled) or TCPv6 (NETIF_F_TSO6).

 * Transmit DMA from high memory

On platforms where this is relevant, NETIF_F_HIGHDMA signals that
ndo_start_xmit can handle skbs with frags in high memory.

 * Transmit scatter-gather

Those features say that ndo_start_xmit can handle fragmented skbs:
NETIF_F_SG --- paged skbs (skb_shinfo()->frags), NETIF_F_FRAGLIST ---
chained skbs (skb->next/prev list).

 * Software features

Features contained in NETIF_F_SOFT_FEATURES are features of networking
stack. Driver should not change behaviour based on them.

 * LLTX driver (deprecated for hardware drivers)

NETIF_F_LLTX should be set in drivers that implement their own locking in
transmit path or don't need locking at all (e.g. software tunnels).
In ndo_start_xmit, it is recommended to use a try_lock and return
NETDEV_TX_LOCKED when the spin lock fails.  The locking should also properly
protect against other callbacks (the rules you need to find out).

Don't use it for new drivers.

 * netns-local device

NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between
network namespaces (e.g. loopback).

Don't use it in drivers.

 * VLAN challenged

NETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN
headers. Some drivers set this because the cards can't handle the bigger MTU.
[FIXME: Those cases could be fixed in VLAN code by allowing only reduced-MTU
VLANs. This may be not useful, though.]
+128 −0
Original line number Original line Diff line number Diff line
Linux NFC subsystem
===================

The Near Field Communication (NFC) subsystem is required to standardize the
NFC device drivers development and to create an unified userspace interface.

This document covers the architecture overview, the device driver interface
description and the userspace interface description.

Architecture overview
---------------------

The NFC subsystem is responsible for:
      - NFC adapters management;
      - Polling for targets;
      - Low-level data exchange;

The subsystem is divided in some parts. The 'core' is responsible for
providing the device driver interface. On the other side, it is also
responsible for providing an interface to control operations and low-level
data exchange.

The control operations are available to userspace via generic netlink.

The low-level data exchange interface is provided by the new socket family
PF_NFC. The NFC_SOCKPROTO_RAW performs raw communication with NFC targets.


             +--------------------------------------+
             |              USER SPACE              |
             +--------------------------------------+
                 ^                       ^
                 | low-level             | control
                 | data exchange         | operations
                 |                       |
                 |                       v
                 |                  +-----------+
                 | AF_NFC           |  netlink  |
                 | socket           +-----------+
                 | raw                   ^
                 |                       |
                 v                       v
             +---------+            +-----------+
             | rawsock | <--------> |   core    |
             +---------+            +-----------+
                                         ^
                                         |
                                         v
                                    +-----------+
                                    |  driver   |
                                    +-----------+

Device Driver Interface
-----------------------

When registering on the NFC subsystem, the device driver must inform the core
of the set of supported NFC protocols and the set of ops callbacks. The ops
callbacks that must be implemented are the following:

* start_poll - setup the device to poll for targets
* stop_poll - stop on progress polling operation
* activate_target - select and initialize one of the targets found
* deactivate_target - deselect and deinitialize the selected target
* data_exchange - send data and receive the response (transceive operation)

Userspace interface
--------------------

The userspace interface is divided in control operations and low-level data
exchange operation.

CONTROL OPERATIONS:

Generic netlink is used to implement the interface to the control operations.
The operations are composed by commands and events, all listed below:

* NFC_CMD_GET_DEVICE - get specific device info or dump the device list
* NFC_CMD_START_POLL - setup a specific device to polling for targets
* NFC_CMD_STOP_POLL - stop the polling operation in a specific device
* NFC_CMD_GET_TARGET - dump the list of targets found by a specific device

* NFC_EVENT_DEVICE_ADDED - reports an NFC device addition
* NFC_EVENT_DEVICE_REMOVED - reports an NFC device removal
* NFC_EVENT_TARGETS_FOUND - reports START_POLL results when 1 or more targets
are found

The user must call START_POLL to poll for NFC targets, passing the desired NFC
protocols through NFC_ATTR_PROTOCOLS attribute. The device remains in polling
state until it finds any target. However, the user can stop the polling
operation by calling STOP_POLL command. In this case, it will be checked if
the requester of STOP_POLL is the same of START_POLL.

If the polling operation finds one or more targets, the event TARGETS_FOUND is
sent (including the device id). The user must call GET_TARGET to get the list of
all targets found by such device. Each reply message has target attributes with
relevant information such as the supported NFC protocols.

All polling operations requested through one netlink socket are stopped when
it's closed.

LOW-LEVEL DATA EXCHANGE:

The userspace must use PF_NFC sockets to perform any data communication with
targets. All NFC sockets use AF_NFC:

struct sockaddr_nfc {
       sa_family_t sa_family;
       __u32 dev_idx;
       __u32 target_idx;
       __u32 nfc_protocol;
};

To establish a connection with one target, the user must create an
NFC_SOCKPROTO_RAW socket and call the 'connect' syscall with the sockaddr_nfc
struct correctly filled. All information comes from NFC_EVENT_TARGETS_FOUND
netlink event. As a target can support more than one NFC protocol, the user
must inform which protocol it wants to use.

Internally, 'connect' will result in an activate_target call to the driver.
When the socket is closed, the target is deactivated.

The data format exchanged through the sockets is NFC protocol dependent. For
instance, when communicating with MIFARE tags, the data exchanged are MIFARE
commands and their responses.

The first received package is the response to the first sent package and so
on. In order to allow valid "empty" responses, every data received has a NULL
header of 1 byte.
Loading