* Re: [PATCH v6 net-next 2/2] tcp: Add Redundant Data Bundling (RDB)
From: Yuchung Cheng @ 2016-03-14 21:54 UTC (permalink / raw)
To: Bendik Rønning Opstad
Cc: David S. Miller, netdev, Eric Dumazet, Neal Cardwell,
Andreas Petlund, Carsten Griwodz, Pål Halvorsen,
Jonas Markussen, Kristian Evensen, Kenneth Klette Jonassen
In-Reply-To: <1457028388-18226-3-git-send-email-bro.devel+kernel@gmail.com>
On Thu, Mar 3, 2016 at 10:06 AM, Bendik Rønning Opstad
<bro.devel@gmail.com> wrote:
>
> Redundant Data Bundling (RDB) is a mechanism for TCP aimed at reducing
> the latency for applications sending time-dependent data.
>
> Latency-sensitive applications or services, such as online games,
> remote control systems, and VoIP, produce traffic with thin-stream
> characteristics, characterized by small packets and relatively high
> inter-transmission times (ITT). When experiencing packet loss, such
> latency-sensitive applications are heavily penalized by the need to
> retransmit lost packets, which increases the latency by a minimum of
> one RTT for the lost packet. Packets coming after a lost packet are
> held back due to head-of-line blocking, causing increased delays for
> all data segments until the lost packet has been retransmitted.
>
> RDB enables a TCP sender to bundle redundant (already sent) data with
> TCP packets containing small segments of new data. By resending
> un-ACKed data from the output queue in packets with new data, RDB
> reduces the need to retransmit data segments on connections
> experiencing sporadic packet loss. By avoiding a retransmit, RDB
> evades the latency increase of at least one RTT for the lost packet,
> as well as alleviating head-of-line blocking for the packets following
> the lost packet. This makes the TCP connection more resistant to
> latency fluctuations, and reduces the application layer latency
> significantly in lossy environments.
>
> Main functionality added:
>
> o When a packet is scheduled for transmission, RDB builds and
> transmits a new SKB containing both the unsent data as well as
> data of previously sent packets from the TCP output queue.
>
> o RDB will only be used for streams classified as thin by the
> function tcp_stream_is_thin_dpifl(). This enforces a lower bound
> on the ITT for streams that may benefit from RDB, controlled by
> the sysctl variable net.ipv4.tcp_thin_dpifl_itt_lower_bound.
>
> o Loss detection of hidden loss events: When bundling redundant data
> with each packet, packet loss can be hidden from the TCP engine due
> to lack of dupACKs. This is because the loss is "repaired" by the
> redundant data in the packet coming after the lost packet. Based on
> incoming ACKs, such hidden loss events are detected, and CWR state
> is entered.
>
> RDB can be enabled on a connection with the socket option TCP_RDB, or
> on all new connections by setting the sysctl variable
> net.ipv4.tcp_rdb=1
>
> Cc: Andreas Petlund <apetlund@simula.no>
> Cc: Carsten Griwodz <griff@simula.no>
> Cc: Pål Halvorsen <paalh@simula.no>
> Cc: Jonas Markussen <jonassm@ifi.uio.no>
> Cc: Kristian Evensen <kristian.evensen@gmail.com>
> Cc: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
> Signed-off-by: Bendik Rønning Opstad <bro.devel+kernel@gmail.com>
> ---
> Documentation/networking/ip-sysctl.txt | 15 +++
> include/linux/skbuff.h | 1 +
> include/linux/tcp.h | 3 +-
> include/net/tcp.h | 15 +++
> include/uapi/linux/tcp.h | 1 +
> net/core/skbuff.c | 2 +-
> net/ipv4/Makefile | 3 +-
> net/ipv4/sysctl_net_ipv4.c | 25 ++++
> net/ipv4/tcp.c | 14 +-
> net/ipv4/tcp_input.c | 3 +
> net/ipv4/tcp_output.c | 48 ++++---
> net/ipv4/tcp_rdb.c | 228 +++++++++++++++++++++++++++++++++
> 12 files changed, 335 insertions(+), 23 deletions(-)
> create mode 100644 net/ipv4/tcp_rdb.c
>
> diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
> index 6a92b15..8f3f3bf 100644
> --- a/Documentation/networking/ip-sysctl.txt
> +++ b/Documentation/networking/ip-sysctl.txt
> @@ -716,6 +716,21 @@ tcp_thin_dpifl_itt_lower_bound - INTEGER
> calculated, which is used to classify whether a stream is thin.
> Default: 10000
>
> +tcp_rdb - BOOLEAN
> + Enable RDB for all new TCP connections.
Please describe RDB briefly, perhaps with a pointer to your paper.
I suggest have three level of controls:
0: disable RDB completely
1: enable indiv. thin-stream conn. to use RDB via TCP_RDB socket
options
2: enable RDB on all thin-stream conn. by default
currently it only provides mode 1 and 2. but there may be cases where
the administrator wants to disallow it (e.g., broken middle-boxes).
> + Default: 0
> +
> +tcp_rdb_max_bytes - INTEGER
> + Enable restriction on how many bytes an RDB packet can contain.
> + This is the total amount of payload including the new unsent data.
> + Default: 0
> +
> +tcp_rdb_max_packets - INTEGER
> + Enable restriction on how many previous packets in the output queue
> + RDB may include data from. A value of 1 will restrict bundling to
> + only the data from the last packet that was sent.
> + Default: 1
why two metrics on redundancy? It also seems better to
allow individual socket to select the redundancy level (e.g.,
setsockopt TCP_RDB=3 means <=3 pkts per bundle) vs a global setting.
This requires more bits in tcp_sock but 2-3 more is suffice.
/
> +
> tcp_limit_output_bytes - INTEGER
> Controls TCP Small Queue limit per tcp socket.
> TCP bulk sender tends to increase packets in flight until it
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 797cefb..0f2c9d1 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -2927,6 +2927,7 @@ int zerocopy_sg_from_iter(struct sk_buff *skb, struct iov_iter *frm);
> void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
> void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb);
> int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags);
> +void copy_skb_header(struct sk_buff *new, const struct sk_buff *old);
> int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
> int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
> __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
> index bcbf51d..c84de15 100644
> --- a/include/linux/tcp.h
> +++ b/include/linux/tcp.h
> @@ -207,9 +207,10 @@ struct tcp_sock {
> } rack;
> u16 advmss; /* Advertised MSS */
> u8 unused;
> - u8 nonagle : 4,/* Disable Nagle algorithm? */
> + u8 nonagle : 3,/* Disable Nagle algorithm? */
> thin_lto : 1,/* Use linear timeouts for thin streams */
> thin_dupack : 1,/* Fast retransmit on first dupack */
> + rdb : 1,/* Redundant Data Bundling enabled */
> repair : 1,
> frto : 1;/* F-RTO (RFC5682) activated in CA_Loss */
> u8 repair_queue;
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index d38eae9..2d42f4a 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -267,6 +267,9 @@ extern int sysctl_tcp_slow_start_after_idle;
> extern int sysctl_tcp_thin_linear_timeouts;
> extern int sysctl_tcp_thin_dupack;
> extern int sysctl_tcp_thin_dpifl_itt_lower_bound;
> +extern int sysctl_tcp_rdb;
> +extern int sysctl_tcp_rdb_max_bytes;
> +extern int sysctl_tcp_rdb_max_packets;
> extern int sysctl_tcp_early_retrans;
> extern int sysctl_tcp_limit_output_bytes;
> extern int sysctl_tcp_challenge_ack_limit;
> @@ -539,6 +542,8 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
> bool tcp_may_send_now(struct sock *sk);
> int __tcp_retransmit_skb(struct sock *, struct sk_buff *);
> int tcp_retransmit_skb(struct sock *, struct sk_buff *);
> +int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
> + gfp_t gfp_mask);
> void tcp_retransmit_timer(struct sock *sk);
> void tcp_xmit_retransmit_queue(struct sock *);
> void tcp_simple_retransmit(struct sock *);
> @@ -556,6 +561,7 @@ void tcp_send_ack(struct sock *sk);
> void tcp_send_delayed_ack(struct sock *sk);
> void tcp_send_loss_probe(struct sock *sk);
> bool tcp_schedule_loss_probe(struct sock *sk);
> +void tcp_skb_append_data(struct sk_buff *from_skb, struct sk_buff *to_skb);
>
> /* tcp_input.c */
> void tcp_resume_early_retransmit(struct sock *sk);
> @@ -565,6 +571,11 @@ void tcp_reset(struct sock *sk);
> void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb);
> void tcp_fin(struct sock *sk);
>
> +/* tcp_rdb.c */
> +void tcp_rdb_ack_event(struct sock *sk, u32 flags);
> +int tcp_transmit_rdb_skb(struct sock *sk, struct sk_buff *xmit_skb,
> + unsigned int mss_now, gfp_t gfp_mask);
> +
> /* tcp_timer.c */
> void tcp_init_xmit_timers(struct sock *);
> static inline void tcp_clear_xmit_timers(struct sock *sk)
> @@ -763,6 +774,7 @@ struct tcp_skb_cb {
> union {
> struct {
> /* There is space for up to 20 bytes */
> + __u32 rdb_start_seq; /* Start seq of rdb data */
> } tx; /* only used for outgoing skbs */
> union {
> struct inet_skb_parm h4;
> @@ -1497,6 +1509,9 @@ static inline struct sk_buff *tcp_write_queue_prev(const struct sock *sk,
> #define tcp_for_write_queue_from_safe(skb, tmp, sk) \
> skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
>
> +#define tcp_for_write_queue_reverse_from_safe(skb, tmp, sk) \
> + skb_queue_reverse_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
> +
> static inline struct sk_buff *tcp_send_head(const struct sock *sk)
> {
> return sk->sk_send_head;
> diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
> index fe95446..6799875 100644
> --- a/include/uapi/linux/tcp.h
> +++ b/include/uapi/linux/tcp.h
> @@ -115,6 +115,7 @@ enum {
> #define TCP_CC_INFO 26 /* Get Congestion Control (optional) info */
> #define TCP_SAVE_SYN 27 /* Record SYN headers for new connections */
> #define TCP_SAVED_SYN 28 /* Get SYN headers recorded for connection */
> +#define TCP_RDB 29 /* Enable Redundant Data Bundling mechanism */
>
> struct tcp_repair_opt {
> __u32 opt_code;
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 7af7ec6..50bc5b0 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -1055,7 +1055,7 @@ static void skb_headers_offset_update(struct sk_buff *skb, int off)
> skb->inner_mac_header += off;
> }
>
> -static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
> +void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
> {
> __copy_skb_header(new, old);
>
> diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile
> index bfa1336..459048c 100644
> --- a/net/ipv4/Makefile
> +++ b/net/ipv4/Makefile
> @@ -12,7 +12,8 @@ obj-y := route.o inetpeer.o protocol.o \
> tcp_offload.o datagram.o raw.o udp.o udplite.o \
> udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \
> fib_frontend.o fib_semantics.o fib_trie.o \
> - inet_fragment.o ping.o ip_tunnel_core.o gre_offload.o
> + inet_fragment.o ping.o ip_tunnel_core.o gre_offload.o \
> + tcp_rdb.o
>
> obj-$(CONFIG_NET_IP_TUNNEL) += ip_tunnel.o
> obj-$(CONFIG_SYSCTL) += sysctl_net_ipv4.o
> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> index f04320a..43b4390 100644
> --- a/net/ipv4/sysctl_net_ipv4.c
> +++ b/net/ipv4/sysctl_net_ipv4.c
> @@ -581,6 +581,31 @@ static struct ctl_table ipv4_table[] = {
> .extra1 = &tcp_thin_dpifl_itt_lower_bound_min,
> },
> {
> + .procname = "tcp_rdb",
> + .data = &sysctl_tcp_rdb,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec_minmax,
> + .extra1 = &zero,
> + .extra2 = &one,
> + },
> + {
> + .procname = "tcp_rdb_max_bytes",
> + .data = &sysctl_tcp_rdb_max_bytes,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec_minmax,
> + .extra1 = &zero,
> + },
> + {
> + .procname = "tcp_rdb_max_packets",
> + .data = &sysctl_tcp_rdb_max_packets,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec_minmax,
> + .extra1 = &zero,
> + },
> + {
> .procname = "tcp_early_retrans",
> .data = &sysctl_tcp_early_retrans,
> .maxlen = sizeof(int),
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 8421f3d..b53d4cb 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -288,6 +288,8 @@ int sysctl_tcp_autocorking __read_mostly = 1;
>
> int sysctl_tcp_thin_dpifl_itt_lower_bound __read_mostly = TCP_THIN_DPIFL_ITT_LOWER_BOUND_MIN;
>
> +int sysctl_tcp_rdb __read_mostly;
> +
> struct percpu_counter tcp_orphan_count;
> EXPORT_SYMBOL_GPL(tcp_orphan_count);
>
> @@ -407,6 +409,7 @@ void tcp_init_sock(struct sock *sk)
> u64_stats_init(&tp->syncp);
>
> tp->reordering = sock_net(sk)->ipv4.sysctl_tcp_reordering;
> + tp->rdb = sysctl_tcp_rdb;
> tcp_enable_early_retrans(tp);
> tcp_assign_congestion_control(sk);
>
> @@ -2412,6 +2415,13 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
> }
> break;
>
> + case TCP_RDB:
> + if (val < 0 || val > 1)
> + err = -EINVAL;
> + else
> + tp->rdb = val;
> + break;
> +
> case TCP_REPAIR:
> if (!tcp_can_repair_sock(sk))
> err = -EPERM;
> @@ -2842,7 +2852,9 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
> case TCP_THIN_DUPACK:
> val = tp->thin_dupack;
> break;
> -
> + case TCP_RDB:
> + val = tp->rdb;
> + break;
> case TCP_REPAIR:
> val = tp->repair;
> break;
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index e6e65f7..7b52ce4 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3537,6 +3537,9 @@ static inline void tcp_in_ack_event(struct sock *sk, u32 flags)
>
> if (icsk->icsk_ca_ops->in_ack_event)
> icsk->icsk_ca_ops->in_ack_event(sk, flags);
> +
> + if (unlikely(tcp_sk(sk)->rdb))
> + tcp_rdb_ack_event(sk, flags);
> }
>
> /* Congestion control has updated the cwnd already. So if we're in
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 7d2c7a4..6f92fae 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -897,8 +897,8 @@ out:
> * We are working here with either a clone of the original
> * SKB, or a fresh unique copy made by the retransmit engine.
> */
> -static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
> - gfp_t gfp_mask)
> +int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
> + gfp_t gfp_mask)
> {
> const struct inet_connection_sock *icsk = inet_csk(sk);
> struct inet_sock *inet;
> @@ -2110,9 +2110,12 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
> break;
> }
>
> - if (unlikely(tcp_transmit_skb(sk, skb, 1, gfp)))
> + if (unlikely(tcp_sk(sk)->rdb)) {
> + if (tcp_transmit_rdb_skb(sk, skb, mss_now, gfp))
> + break;
> + } else if (unlikely(tcp_transmit_skb(sk, skb, 1, gfp))) {
> break;
> -
> + }
> repair:
> /* Advance the send_head. This one is sent out.
> * This call will increment packets_out.
> @@ -2439,15 +2442,32 @@ u32 __tcp_select_window(struct sock *sk)
> return window;
> }
>
> +/**
> + * tcp_skb_append_data() - copy the linear data from an SKB to the end
> + * of another and update end sequence number
> + * and checksum
> + * @from_skb: the SKB to copy data from
> + * @to_skb: the SKB to copy data to
> + */
> +void tcp_skb_append_data(struct sk_buff *from_skb, struct sk_buff *to_skb)
> +{
> + skb_copy_from_linear_data(from_skb, skb_put(to_skb, from_skb->len),
> + from_skb->len);
> + TCP_SKB_CB(to_skb)->end_seq = TCP_SKB_CB(from_skb)->end_seq;
> +
> + if (from_skb->ip_summed == CHECKSUM_PARTIAL)
> + to_skb->ip_summed = CHECKSUM_PARTIAL;
> +
> + if (to_skb->ip_summed != CHECKSUM_PARTIAL)
> + to_skb->csum = csum_block_add(to_skb->csum, from_skb->csum,
> + to_skb->len);
> +}
> +
> /* Collapses two adjacent SKB's during retransmission. */
> static void tcp_collapse_retrans(struct sock *sk, struct sk_buff *skb)
> {
> struct tcp_sock *tp = tcp_sk(sk);
> struct sk_buff *next_skb = tcp_write_queue_next(sk, skb);
> - int skb_size, next_skb_size;
> -
> - skb_size = skb->len;
> - next_skb_size = next_skb->len;
>
> BUG_ON(tcp_skb_pcount(skb) != 1 || tcp_skb_pcount(next_skb) != 1);
>
> @@ -2455,17 +2475,7 @@ static void tcp_collapse_retrans(struct sock *sk, struct sk_buff *skb)
>
> tcp_unlink_write_queue(next_skb, sk);
>
> - skb_copy_from_linear_data(next_skb, skb_put(skb, next_skb_size),
> - next_skb_size);
> -
> - if (next_skb->ip_summed == CHECKSUM_PARTIAL)
> - skb->ip_summed = CHECKSUM_PARTIAL;
> -
> - if (skb->ip_summed != CHECKSUM_PARTIAL)
> - skb->csum = csum_block_add(skb->csum, next_skb->csum, skb_size);
> -
> - /* Update sequence range on original skb. */
> - TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(next_skb)->end_seq;
> + tcp_skb_append_data(next_skb, skb);
>
> /* Merge over control information. This moves PSH/FIN etc. over */
> TCP_SKB_CB(skb)->tcp_flags |= TCP_SKB_CB(next_skb)->tcp_flags;
> diff --git a/net/ipv4/tcp_rdb.c b/net/ipv4/tcp_rdb.c
> new file mode 100644
> index 0000000..2b37957
> --- /dev/null
> +++ b/net/ipv4/tcp_rdb.c
> @@ -0,0 +1,228 @@
> +#include <linux/skbuff.h>
> +#include <net/tcp.h>
> +
> +int sysctl_tcp_rdb_max_bytes __read_mostly;
> +int sysctl_tcp_rdb_max_packets __read_mostly = 1;
> +
> +/**
> + * rdb_detect_loss() - perform RDB loss detection by analysing ACKs
> + * @sk: socket
> + *
> + * Traverse the output queue and check if the ACKed packet is an RDB
> + * packet and if the redundant data covers one or more un-ACKed SKBs.
> + * If the incoming ACK acknowledges multiple SKBs, we can presume
> + * packet loss has occurred.
> + *
> + * We can infer packet loss this way because we can expect one ACK per
> + * transmitted data packet, as delayed ACKs are disabled when a host
> + * receives packets where the sequence number is not the expected
> + * sequence number.
> + *
> + * Return: The number of packets that are presumed to be lost
> + */
> +static unsigned int rdb_detect_loss(struct sock *sk)
> +{
> + struct sk_buff *skb, *tmp;
> + struct tcp_skb_cb *scb;
> + u32 seq_acked = tcp_sk(sk)->snd_una;
> + unsigned int packets_lost = 0;
> +
> + tcp_for_write_queue(skb, sk) {
> + if (skb == tcp_send_head(sk))
> + break;
> +
> + scb = TCP_SKB_CB(skb);
> + /* The ACK acknowledges parts of the data in this SKB.
> + * Can be caused by:
> + * - TSO: We abort as RDB is not used on SKBs split across
> + * multiple packets on lower layers as these are greater
> + * than one MSS.
> + * - Retrans collapse: We've had a retrans, so loss has already
> + * been detected.
> + */
> + if (after(scb->end_seq, seq_acked))
> + break;
> + else if (scb->end_seq != seq_acked)
> + continue;
> +
> + /* We have found the ACKed packet */
> +
> + /* This packet was sent with no redundant data, or no prior
> + * un-ACKed SKBs is in the output queue, so break here.
> + */
> + if (scb->tx.rdb_start_seq == scb->seq ||
> + skb_queue_is_first(&sk->sk_write_queue, skb))
> + break;
> + /* Find number of prior SKBs whose data was bundled in this
> + * (ACKed) SKB. We presume any redundant data covering previous
> + * SKB's are due to loss. (An exception would be reordering).
> + */
> + skb = skb->prev;
> + tcp_for_write_queue_reverse_from_safe(skb, tmp, sk) {
> + if (before(TCP_SKB_CB(skb)->seq, scb->tx.rdb_start_seq))
> + break;
> + packets_lost++;
since we only care if there is packet loss or not, we can return early here?
> + }
> + break;
> + }
> + return packets_lost;
> +}
> +
> +/**
> + * tcp_rdb_ack_event() - initiate RDB loss detection
> + * @sk: socket
> + * @flags: flags
> + */
> +void tcp_rdb_ack_event(struct sock *sk, u32 flags)
flags are not used
> +{
> + if (rdb_detect_loss(sk))
> + tcp_enter_cwr(sk);
> +}
> +
> +/**
> + * rdb_build_skb() - build a new RDB SKB and copy redundant + unsent
> + * data to the linear page buffer
> + * @sk: socket
> + * @xmit_skb: the SKB processed for transmission in the output engine
> + * @first_skb: the first SKB in the output queue to be bundled
> + * @bytes_in_rdb_skb: the total number of data bytes for the new
> + * rdb_skb (NEW + Redundant)
> + * @gfp_mask: gfp_t allocation
> + *
> + * Return: A new SKB containing redundant data, or NULL if memory
> + * allocation failed
> + */
> +static struct sk_buff *rdb_build_skb(const struct sock *sk,
> + struct sk_buff *xmit_skb,
> + struct sk_buff *first_skb,
> + u32 bytes_in_rdb_skb,
> + gfp_t gfp_mask)
> +{
> + struct sk_buff *rdb_skb, *tmp_skb = first_skb;
> +
> + rdb_skb = sk_stream_alloc_skb((struct sock *)sk,
> + (int)bytes_in_rdb_skb,
> + gfp_mask, false);
> + if (!rdb_skb)
> + return NULL;
> + copy_skb_header(rdb_skb, xmit_skb);
> + rdb_skb->ip_summed = xmit_skb->ip_summed;
> + TCP_SKB_CB(rdb_skb)->seq = TCP_SKB_CB(first_skb)->seq;
> + TCP_SKB_CB(xmit_skb)->tx.rdb_start_seq = TCP_SKB_CB(rdb_skb)->seq;
> +
> + /* Start on first_skb and append payload from each SKB in the output
> + * queue onto rdb_skb until we reach xmit_skb.
> + */
> + tcp_for_write_queue_from(tmp_skb, sk) {
> + tcp_skb_append_data(tmp_skb, rdb_skb);
> +
> + /* We reached xmit_skb, containing the unsent data */
> + if (tmp_skb == xmit_skb)
> + break;
> + }
> + return rdb_skb;
> +}
> +
> +/**
> + * rdb_can_bundle_test() - test if redundant data can be bundled
> + * @sk: socket
> + * @xmit_skb: the SKB processed for transmission by the output engine
> + * @max_payload: the maximum allowed payload bytes for the RDB SKB
> + * @bytes_in_rdb_skb: store the total number of payload bytes in the
> + * RDB SKB if bundling can be performed
> + *
> + * Traverse the output queue and check if any un-acked data may be
> + * bundled.
> + *
> + * Return: The first SKB to be in the bundle, or NULL if no bundling
> + */
> +static struct sk_buff *rdb_can_bundle_test(const struct sock *sk,
> + struct sk_buff *xmit_skb,
> + unsigned int max_payload,
> + u32 *bytes_in_rdb_skb)
> +{
> + struct sk_buff *first_to_bundle = NULL;
> + struct sk_buff *tmp, *skb = xmit_skb->prev;
> + u32 skbs_in_bundle_count = 1; /* Start on 1 to account for xmit_skb */
> + u32 total_payload = xmit_skb->len;
> +
> + if (sysctl_tcp_rdb_max_bytes)
> + max_payload = min_t(unsigned int, max_payload,
> + sysctl_tcp_rdb_max_bytes);
> +
> + /* We start at xmit_skb->prev, and go backwards */
> + tcp_for_write_queue_reverse_from_safe(skb, tmp, sk) {
> + /* Including data from this SKB would exceed payload limit */
> + if ((total_payload + skb->len) > max_payload)
> + break;
> +
> + if (sysctl_tcp_rdb_max_packets &&
> + (skbs_in_bundle_count > sysctl_tcp_rdb_max_packets))
> + break;
> +
> + total_payload += skb->len;
> + skbs_in_bundle_count++;
> + first_to_bundle = skb;
> + }
> + *bytes_in_rdb_skb = total_payload;
> + return first_to_bundle;
> +}
> +
> +/**
> + * tcp_transmit_rdb_skb() - try to create and send an RDB packet
> + * @sk: socket
> + * @xmit_skb: the SKB processed for transmission by the output engine
> + * @mss_now: current mss value
> + * @gfp_mask: gfp_t allocation
> + *
> + * If an RDB packet could not be created and sent, transmit the
> + * original unmodified SKB (xmit_skb).
> + *
> + * Return: 0 if successfully sent packet, else error from
> + * tcp_transmit_skb
> + */
> +int tcp_transmit_rdb_skb(struct sock *sk, struct sk_buff *xmit_skb,
> + unsigned int mss_now, gfp_t gfp_mask)
> +{
> + struct sk_buff *rdb_skb = NULL;
> + struct sk_buff *first_to_bundle;
> + u32 bytes_in_rdb_skb = 0;
> +
> + /* How we detect that RDB was used. When equal, no RDB data was sent */
> + TCP_SKB_CB(xmit_skb)->tx.rdb_start_seq = TCP_SKB_CB(xmit_skb)->seq;
> +
> + if (!tcp_stream_is_thin_dpifl(tcp_sk(sk)))
During loss recovery tcp inflight fluctuates and would like to trigger
this check even for non-thin-stream connections. Since the loss
already occurs, RDB can only take advantage from limited-transmit,
which it likely does not have (b/c its a thin-stream). It might be
checking if the state is open.
> + goto xmit_default;
> +
> + /* No bundling if first in queue, or on FIN packet */
> + if (skb_queue_is_first(&sk->sk_write_queue, xmit_skb) ||
> + (TCP_SKB_CB(xmit_skb)->tcp_flags & TCPHDR_FIN))
seems there are still benefit to bundle packets up to FIN?
> + goto xmit_default;
> +
> + /* Find number of (previous) SKBs to get data from */
> + first_to_bundle = rdb_can_bundle_test(sk, xmit_skb, mss_now,
> + &bytes_in_rdb_skb);
> + if (!first_to_bundle)
> + goto xmit_default;
> +
> + /* Create an SKB that contains redundant data starting from
> + * first_to_bundle.
> + */
> + rdb_skb = rdb_build_skb(sk, xmit_skb, first_to_bundle,
> + bytes_in_rdb_skb, gfp_mask);
> + if (!rdb_skb)
> + goto xmit_default;
> +
> + /* Set skb_mstamp for the SKB in the output queue (xmit_skb) containing
> + * the yet unsent data. Normally this would be done by
> + * tcp_transmit_skb(), but as we pass in rdb_skb instead, xmit_skb's
> + * timestamp will not be touched.
> + */
> + skb_mstamp_get(&xmit_skb->skb_mstamp);
> + rdb_skb->skb_mstamp = xmit_skb->skb_mstamp;
> + return tcp_transmit_skb(sk, rdb_skb, 0, gfp_mask);
> +
> +xmit_default:
> + /* Transmit the unmodified SKB from output queue */
> + return tcp_transmit_skb(sk, xmit_skb, 1, gfp_mask);
> +}
> --
> 1.9.1
>
since RDB will cause DSACKs, and we only blindly count DSACKs to
perform CWND undo. How does RDB handle that false positives?
^ permalink raw reply
* Re: [PATCH v6 net-next 0/2] tcp: Redundant Data Bundling (RDB)
From: Yuchung Cheng @ 2016-03-14 21:59 UTC (permalink / raw)
To: Bendik Rønning Opstad
Cc: David S. Miller, netdev, Eric Dumazet, Neal Cardwell,
Andreas Petlund, Carsten Griwodz, Pål Halvorsen,
Jonas Markussen, Kristian Evensen, Kenneth Klette Jonassen
In-Reply-To: <56E5F54F.3050507@gmail.com>
On Sun, Mar 13, 2016 at 4:18 PM, Bendik Rønning Opstad
<bro.devel@gmail.com> wrote:
> On 03/10/2016 01:20 AM, Yuchung Cheng wrote:
>> I read the paper. I think the underlying idea is neat. but the
>> implementation is little heavy-weight that requires changes on fast
>> path (tcp_write_xmit) and space in skb control blocks.
>
> Yuchung, thank you for taking the time to review the patch submission
> and read the paper.
>
> I must admit I was not particularly happy about the extra if-test on the
> fast path, and I fully understand the wish to keep the fast path as
> simple and clean as possible.
> However, is the performance hit that significant considering the branch
> prediction hint for the non-RDB path?
>
> The extra variable needed in the SKB CB does not require increasing the
> CB buffer size due to the "tcp: refactor struct tcp_skb_cb" patch:
> http://patchwork.ozlabs.org/patch/510674 and uses only some of the space
> made available in the outgoing SKBs' CB. Therefore I hoped the extra
> variable would be acceptable.
>
>> ultimately this
>> patch is meant for a small set of specific applications.
>
> Yes, the RDB mechanism is aimed at a limited set of applications,
> specifically time-dependent applications that produce non-greedy,
> application limited (thin) flows. However, our hope is that RDB may
> greatly improve TCP's position as a viable alternative for applications
> transmitting latency sensitive data.
>
>> In my mental model (please correct me if I am wrong), losses on these
>> thin streams would mostly resort to RTOs instead of fast recovery, due
>> to the bursty nature of Internet losses.
>
> This depends on the transmission pattern of the applications, which
> varies to a great deal, also between the different types of
> time-dependent applications that produce thin streams. For short flows,
> (bursty) loss at the end will result in an RTO (if TLP does not probe),
> but the thin streams are often long lived, and the applications
> producing them continue to write small data segments to the socket at
> intervals of tens to hundreds of milliseconds.
>
> What controls if an RTO and not fast retransmit will resend the packet,
> is the number of PIFs, which directly correlates to how often the
> application writes data to the socket in relation to the RTT. As long as
> the number of packets successfully completing a round trip before the
> RTO is >= the dupACK threshold, they will not depend on RTOs (not
> considering TLP). Early retransmit and the TCP_THIN_DUPACK socket option
> will also affect the likelihood of RTOs vs fast retransmits.
>
>> The HOLB comes from RTO only
>> retransmit the first (tiny) unacked packet while a small of new data is
>> readily available. But since Linux congestion control is packet-based,
>> and loss cwnd is 1, the new data needs to wait until the 1st packet is
>> acked which is for another RTT.
>
> If I understand you correctly, you are referring to HOLB on the sender
> side, which is the extra delay on new data that is held back when the
> connection is CWND-limited. In the paper, we refer to this extra delay
> as increased sojourn times for the outgoing data segments.
>
> We do not include this additional sojourn time for the segments on the
> sender side in the ACK Latency plots (Fig. 4 in the paper). This is
> simply because the pcap traces contain the timestamps when the packets
> are sent, and not when the segments are added to the output queue.
>
> When we refer to the HOLB effect in the paper as well as the thesis, we
> refer to the extra delays (sojourn times) on the receiver side where
> segments are held back (not made available to user space) due to gaps in
> the sequence range when packets are lost (we had no reordering).
>
> So, when considering the increased delays due to HOLB on the receiver
> side, HOLB is not at all limited to RTOs. Actually, it's mostly not due
> to RTOs in the tests we've run, however, this also depends very much on
> the transmission pattern of the application as well as loss levels.
> In general, HOLB on the receiver side will affect any flow that
> transmits a packet with new data after a packet is lost (sender may not
> know yet), where the lost packet has not already been retransmitted.
OK that makes sense.
I left some detailed comments on the actual patches. I would encourage
to submit an IETF draft to gather feedback from tcpm b/c the feature
seems portable.
>
> Consider a sender application that performs write calls every 30 ms on a
> 150 ms RTT link. It will need a CWND that allows 5-6 PIFs to be able to
> transmit all new data segments with no extra sojourn times on the sender
> side.
> When one packet is lost, the next 5 packets that are sent will be held
> back on the receiver side due to the missing segment (HOLB). In the best
> case scenario, the first dupACK triggers a fast retransmit around the
> same time as the fifth packet (after the lost packet) is sent. In that
> case, the first segment sent after the lost segment is held back on the
> receiver for 150 ms (the time it takes for the dupACK to reach the
> sender, and the fast retrans to arrive at the receiver). The second is
> held back 120 ms, the third 90 ms, the fourth 60 ms, an the fifth 30 ms.
>
> All of this extra delay is added before the sender even knows there was
> a loss. How it decides to react to the loss signal (dupACKs) will
> further decide how much extra delays will be added in addition to the
> delays already inflicted on the segments by the HOLB.
>
>> Instead what if we only perform RDB on the (first and recurring) RTO
>> retransmission?
>
> That will change RDB from being a proactive mechanism, to being
> reactive, i.e. change how the sender responds to the loss signal. The
> problem is that by this point (when the sender has received the loss
> signal), the HOLB on the receiver side has already caused significant
> increases to the application layer latency.
>
> The reason the RDB streams (in red) in fig. 4 in the paper get such low
> latencies is because there are almost no retransmissions. With 10%
> uniform loss, the latency for 90% of the packets is not affected at all.
> The latency for most of the lost segments is only increased by 30 ms,
> which is when the next RDB packet arrives at the receiver with the lost
> segment bundled in the payload.
> For the regular TCP streams (blue), the latency for 40% of the segments
> is affected, where almost 30% of the segments have additional delays of
> 150 ms or more.
> It is important to note that the increases to the latencies for the
> regular TCP streams compared to the RDB streams are solely due to HOLB
> on the receiver side.
>
> The longer the RTT, the greater the gains are by using RDB, considering
> the best case scenario of minimum one RTT required for a retransmission.
> As such, RDB will reduce the latencies the most for those that also need
> it the most.
>
> However, even with an RTT of 20 ms, an application writing a data
> segment every 10 ms will still get significant latency reductions simply
> because a retransmission will require a minimum of 20 ms, compared to
> the 10 ms it takes for the next RDB packet to arrive at the receiver.
>
>
> Bendik
^ permalink raw reply
* Re: [PATCH net]: ipv6: drop frames with attached skb->sk in forwarding
From: Francesco Ruggeri @ 2016-03-14 22:32 UTC (permalink / raw)
To: fruggeri, netdev, sasha.levin, davem, hannes
Should 9ef2e965e554 ["ipv6: drop frames with attached skb->sk in forwarding"]
be considered for stable?
It did address a crash in ip6_skb_dst_mtu that I was seeing in 3.18, where
an incoming packet found an inet_timewait_sock in tcp_v6_early_demux
but was later ip6_forward'ed (the local address that had been used for
the tcp connection had been moved out of the router).
Thanks,
Francesco Ruggeri
^ permalink raw reply
* [PATCH net] net: diag: add a scheduling point in inet_diag_dump_icsk()
From: Eric Dumazet @ 2016-03-14 22:40 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
On loaded TCP servers, looking at millions of sockets can hold
cpu for many seconds, if the lookup condition is very narrow.
(eg : ss dst 1.2.3.4 )
Better add a cond_resched() to allow other processes to access
the cpu.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/ipv4/inet_diag.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 6029157..7883473 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -879,6 +879,7 @@ next_normal:
}
spin_unlock_bh(lock);
+ cond_resched();
}
done:
^ permalink raw reply related
* Re: [PATCH net]: ipv6: drop frames with attached skb->sk in forwarding
From: Eric Dumazet @ 2016-03-14 22:41 UTC (permalink / raw)
To: Francesco Ruggeri; +Cc: fruggeri, netdev, sasha.levin, davem, hannes
In-Reply-To: <20160314223243.19F7F38508B@fruggeri-Arora18.sjc.aristanetworks.com>
On Mon, 2016-03-14 at 15:32 -0700, Francesco Ruggeri wrote:
> Should 9ef2e965e554 ["ipv6: drop frames with attached skb->sk in forwarding"]
> be considered for stable?
> It did address a crash in ip6_skb_dst_mtu that I was seeing in 3.18, where
> an incoming packet found an inet_timewait_sock in tcp_v6_early_demux
> but was later ip6_forward'ed (the local address that had been used for
> the tcp connection had been moved out of the router).
Yes, definitely stable material.
^ permalink raw reply
* [PATCH] smc91x: avoid self-comparison warning
From: Arnd Bergmann @ 2016-03-14 22:45 UTC (permalink / raw)
To: Nicolas Pitre
Cc: Arnd Bergmann, David S. Miller, Robert Jarzmik,
Uwe Kleine-König, netdev, linux-kernel
The smc91x driver defines a macro that compares its argument to
itself, apparently to get a true result while using its argument
to avoid a warning about unused local variables.
Unfortunately, this triggers a warning with gcc-6, as the comparison
is obviously useless:
drivers/net/ethernet/smsc/smc91x.c: In function 'smc_hardware_send_pkt':
drivers/net/ethernet/smsc/smc91x.c:563:14: error: self-comparison always evaluates to true [-Werror=tautological-compare]
if (!smc_special_trylock(&lp->lock, flags)) {
This replaces the macro with another one that behaves similarly,
with a cast to (void) to ensure the argument is used, and using
a literal 'true' as its value.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/smsc/smc91x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index db7db8ac4ca3..c5ed27c54724 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -540,7 +540,7 @@ static inline void smc_rcv(struct net_device *dev)
#define smc_special_lock(lock, flags) spin_lock_irqsave(lock, flags)
#define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags)
#else
-#define smc_special_trylock(lock, flags) (flags == flags)
+#define smc_special_trylock(lock, flags) ((void)flags, true)
#define smc_special_lock(lock, flags) do { flags = 0; } while (0)
#define smc_special_unlock(lock, flags) do { flags = 0; } while (0)
#endif
--
2.7.0
^ permalink raw reply related
* [ANNOUNCE] iproute2 4.5
From: Stephen Hemminger @ 2016-03-14 23:10 UTC (permalink / raw)
To: netdev, linux-kernel
Update to iproute2 utility to support new features in Linux 4.5.
The usual array small documentation changes and bug fixes.
Areas of large changes were BPF and more integration of management
of bridges.
Source:
http://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.5.0.tar.gz
Repository:
git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
Report problems (or enhancements) to the netdev@vger.kernel.org mailing list.
Net-next changes will be merged in next week.
---
Bjørn Mork (3):
iplink: support setting addrgenmode stable_secret
iplink: support show and set of "addrgenmode random"
man: iplink: document new addrgenmodes
Daniel Borkmann (17):
{f,m}_bpf: allow for sharing maps
{f,m}_bpf: make tail calls working
{f, m}_bpf: check map attributes when fetching as pinned
{f, m}_bpf: allow for user-defined object pinnings
{f,m}_bpf: allow updates on program arrays
{f,m}_bpf: add more example code
examples, bpf: further improve examples
bpf: minor fix in api and bpf_dump_error() usage
tc, ingress: clean up ingress handling a bit
tc, clsact: add clsact frontend
tc, bpf: check section names and type everywhere
tc, bpf: more header checks on loading elf
tc, bpf: make sure relo is in relation with map section
tc, bpf, examples: further bpf_api improvements
tc, bpf: improve verifier logging
tc, bpf: give some more hints wrt false relos
tc, bpf: use bind/type macros from gelf
Dmitrii Shcherbakov (2):
htb: remove printing of a deprecated overhead value
htb: rename b4 buffer to b3 to make its name more consistent
Gustavo Zacarias (1):
iproute2: fix building with musl
Hangbin Liu (3):
route: allow routes to be configured with expire values
iproute2: ip-route.8.in: Add missing '[' before 'pref'
iproute2: ip-route.8.in: Add expires option for ip route
Hiroshi Shimamoto (1):
iplink: Support VF Trust
John W. Linville (1):
geneve: add support for IPv6 link partners
Lorenzo Colitti (2):
libnetlink: don't print NETLINK_SOCK_DIAG errors in rtnl_talk
ss: support closing inet sockets via SOCK_DESTROY.
Nicolas Cavallari (1):
netns: Fix an off-by-one strcpy() in netns_map_add().
Nicolas Dichtel (1):
tc: fix compilation with old gcc (< 4.6) (bis)
Nikolay Aleksandrov (28):
iplink: bridge: export bridge_id and designated_root
iplink: bridge: export root_(port|path_cost), topology_change and change_detected
iplink: bridge: export read-only timers
iplink: bridge: add support for IFLA_BR_GROUP_FWD_MASK
iplink: bridge: add support for IFLA_BR_GROUP_ADDR
iplink: bridge: add support for IFLA_BR_VLAN_DEFAULT_PVID
iplink: bridge: add support for IFLA_BR_MCAST_ROUTER
iplink: bridge: add support for IFLA_BR_MCAST_SNOOPING
iplink: bridge: add support for IFLA_BR_MCAST_QUERY_USE_IFADDR
iplink: bridge: add support for IFLA_BR_MCAST_QUERIER
iplink: bridge: add support for IFLA_BR_MCAST_HASH_ELASTICITY
iplink: bridge: add support for IFLA_BR_MCAST_HASH_MAX
iplink: bridge: add support for IFLA_BR_MCAST_LAST_MEMBER_CNT
iplink: bridge: add support for IFLA_BR_MCAST_STARTUP_QUERY_CNT
iplink: bridge: add support for IFLA_BR_MCAST_LAST_MEMBER_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_MEMBERSHIP_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_QUERIER_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_QUERY_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_QUERY_RESPONSE_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_STARTUP_QUERY_INTVL
iplink: bridge: add support for netfilter call attributes
iplink: bond_slave: fix ad_actor/partner_oper_port_state output
iplink: bridge_slave: export read-only values
iplink: bridge_slave: add support for IFLA_BRPORT_PROXYARP
iplink: bridge_slave: add support for IFLA_BRPORT_PROXYARP_WIFI
iplink: bridge_slave: add support for IFLA_BRPORT_MULTICAST_ROUTER
iplink: bridge_slave: add support for IFLA_BRPORT_FAST_LEAVE
iplink: bridge: remove unnecessary returns
Paolo Abeni (1):
geneve: add support for lwt tunnel creation and dst port selection
Phil Sutter (46):
iprule: Align help text with man page synopsis
ipl2tp: Print help even on systems without l2tp support
ip: align help text with manpage
ipaddrlabel: Improve help text precision
iplink: fix help text syntax
ipneigh: add missing proxy keyword to help text
ipntable: Fix typo in help text
iproute: TYPE keyword is not optional, fix help text accordingly
iprule: add missing nat keyword to help text
man: ip-address.8: Minor syntax fixes
man: ip-link.8: minor font fix
man: ip-link.8: Fix and improve synopsis
man: ip-neighbour: Fix for missing NUD_STATE description
man: ip-netns.8: Clarify synopsis a bit
man: ip-ntable.8: Review synopsis section
man: ip-rule.8: Review synopsis section
man: ip-token.8: Review synopsis section
man: ip-tunnel.8: Document missing 6rd action
man: ip-xfrm.8: Document missing parameters
man: ip.8: Add missing flags and token subcommand description
man: ip-l2tp.8: Fix BNF syntax
man: ip-*.8: drop any reference to generic ip options
man: Add a man page for the connmark action
man: Add a man page for the csum action.
man: Add a man page for the mirred action
man: Add a man page for the nat action
man: Add a man page for the pedit action
man: Add a man page for the police action
man: Add a man page for the simple action
man: Add a man page for the skbedit action
man: Add a man page for the vlan action
man: Add a man page for the xt action
man: ship action man pages
man: tc-u32: Minor syntax fix
man: ip-link: Beef up VXLAN csum options a bit
tc: pedit: document branch control in help output
man: ip-route: Make synopsis consistent with description
doc, man: ip-rule: Remove incorrect statement about rule 0
man: ip-neighbour.8: Document all known nud states
ipneigh: List all nud states in help output
doc: Add my article about tc, filters and actions
ifstat, nstat: fix daemon mode
libnetlink: Double the dump buffer size
tc: pedit: Fix layered op parsing
tc: pedit: Fix parse_cmd()
tc: pedit: Fix retain value for ihl adjustments
Richard Alpe (1):
tipc: add peer remove functionality
Roopa Prabhu (4):
ipmonitor: match user option 'all' before 'all-nsid'
bridge: support for static fdb entries
ip route: add mpls multipath support
bridge: add support for dynamic fdb entries
Stephen Hemminger (12):
qfq: fix parse_opt dead code
include: update kernel headers
genl: make string const
monitor: fix file handle leak
lnstat: fix error handling
add coverity model file
Update to current iptables headers
update most kernel headers
Revert "tc: fix compilation with old gcc (< 4.6)"
update headers (post 4.4 merge window)
Revert "tipc: add peer remove functionality"
v4.5.0
Thomas Faivre (2):
vxlan: fix help and man text
ip-link: fix man page warnings
Zhang Shengju (1):
ip-link: remove warning message
^ permalink raw reply
* Re: [PATCH] Driver: Vmxnet3: Fix regression caused by cec0556
From: Shrikrishna Khare @ 2016-03-14 23:21 UTC (permalink / raw)
To: David Miller; +Cc: pv-drivers, netdev, linux-kernel, gyang
In-Reply-To: <20160314.152845.1840060808684295471.davem@davemloft.net>
On Mon, 14 Mar 2016, David Miller wrote:
> From: Shrikrishna Khare <skhare@vmware.com>
> Date: Fri, 11 Mar 2016 13:29:44 -0800
>
> > don't pass uninitialized flags to spin_unlock_irqrestore.
> >
> > Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> > Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
> > Signed-off-by: Guolin Yang <gyang@vmware.com>
>
> Sorry, I noticed Arnd's version of this fix first and therefore applied
> his version.
No problem. Arnd's version is same as the fix I sent.
Thanks,
Shri
^ permalink raw reply
* Re: [PATCH] smc91x: avoid self-comparison warning
From: David Miller @ 2016-03-14 23:37 UTC (permalink / raw)
To: arnd; +Cc: nico, robert.jarzmik, u.kleine-koenig, netdev, linux-kernel
In-Reply-To: <1457995535-1398186-1-git-send-email-arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 14 Mar 2016 23:45:12 +0100
> The smc91x driver defines a macro that compares its argument to
> itself, apparently to get a true result while using its argument
> to avoid a warning about unused local variables.
>
> Unfortunately, this triggers a warning with gcc-6, as the comparison
> is obviously useless:
>
> drivers/net/ethernet/smsc/smc91x.c: In function 'smc_hardware_send_pkt':
> drivers/net/ethernet/smsc/smc91x.c:563:14: error: self-comparison always evaluates to true [-Werror=tautological-compare]
> if (!smc_special_trylock(&lp->lock, flags)) {
>
> This replaces the macro with another one that behaves similarly,
> with a cast to (void) to ensure the argument is used, and using
> a literal 'true' as its value.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net] net: diag: add a scheduling point in inet_diag_dump_icsk()
From: David Miller @ 2016-03-14 23:38 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1457995200.31401.28.camel@edumazet-glaptop3.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 14 Mar 2016 15:40:00 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> On loaded TCP servers, looking at millions of sockets can hold
> cpu for many seconds, if the lookup condition is very narrow.
>
> (eg : ss dst 1.2.3.4 )
>
> Better add a cond_resched() to allow other processes to access
> the cpu.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: [PATCH nf-next v10 0/8] openvswitch: NAT support
From: Pablo Neira Ayuso @ 2016-03-15 0:01 UTC (permalink / raw)
To: Jarno Rajahalme; +Cc: netfilter-devel, netdev, dev
In-Reply-To: <1457636063-92746-1-git-send-email-jarno@ovn.org>
On Thu, Mar 10, 2016 at 10:54:15AM -0800, Jarno Rajahalme wrote:
> This series adds NAT support to openvswitch kernel module. A few
> changes are needed to the netfilter code to facilitate this (patches
> 1-2/8). Patches 3-7 make the openvswitch kernel module ready for the
> patch 8 that adds the NAT support by calling into netfilter NAT code
> from the openvswitch conntrack action.
Series applied, thanks Jarno.
^ permalink raw reply
* linux-next: manual merge of the net-next tree with Linus' tree
From: Stephen Rothwell @ 2016-03-15 0:07 UTC (permalink / raw)
To: David Miller, netdev
Cc: linux-next, linux-kernel, Thomas Petazzoni, Olof Johansson,
Gregory CLEMENT, Marcin Wojtas
Hi all,
Today's linux-next merge of the net-next tree got conflicts in:
arch/arm/boot/dts/armada-xp-db.dts
arch/arm/boot/dts/armada-xp-gp.dts
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
between commit:
d7d5a43c0d16 ("ARM: mvebu: fix overlap of Crypto SRAM with PCIe memory window")
from Linus' tree and commits:
9dd7a57e2cbf ("ARM: dts: armada-xp: enable buffer manager support on Armada XP boards")
293fdc24fcc9 ("ARM: dts: armada-xp-openblocks-ax3-4: Add BM support")
from the net-next tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell
diff --cc arch/arm/boot/dts/armada-xp-db.dts
index 45813a5526c8,30657302305d..000000000000
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@@ -76,8 -76,9 +76,9 @@@
ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000
- MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
- MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000
+ MBUS_ID(0x09, 0x09) 0 0 0xf1100000 0x10000
- MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000>;
++ MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000
+ MBUS_ID(0x0c, 0x04) 0 0 0xf1200000 0x100000>;
devbus-bootcs {
status = "okay";
@@@ -229,34 -242,10 +242,38 @@@
spi-max-frequency = <20000000>;
};
};
+
+ nand@d0000 {
+ status = "okay";
+ num-cs = <1>;
+ marvell,nand-keep-config;
+ marvell,nand-enable-arbiter;
+ nand-on-flash-bbt;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "U-Boot";
+ reg = <0 0x800000>;
+ };
+ partition@800000 {
+ label = "Linux";
+ reg = <0x800000 0x800000>;
+ };
+ partition@1000000 {
+ label = "Filesystem";
+ reg = <0x1000000 0x3f000000>;
+
+ };
+ };
+ };
};
+
+ bm-bppi {
+ status = "okay";
+ };
};
};
diff --cc arch/arm/boot/dts/armada-xp-gp.dts
index 5730b875c4f5,a1ded01d0c07..000000000000
--- a/arch/arm/boot/dts/armada-xp-gp.dts
+++ b/arch/arm/boot/dts/armada-xp-gp.dts
@@@ -95,8 -95,9 +95,9 @@@
ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000
- MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
- MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000
+ MBUS_ID(0x09, 0x09) 0 0 0xf1100000 0x10000
- MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000>;
++ MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000
+ MBUS_ID(0x0c, 0x04) 0 0 0xf1200000 0x100000>;
devbus-bootcs {
status = "okay";
diff --cc arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
index 853bd392a4fe,3aa29a91c7b8..000000000000
--- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
+++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
@@@ -65,9 -65,10 +65,10 @@@
soc {
ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
- MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x8000000
- MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
- MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000
+ MBUS_ID(0x01, 0x2f) 0 0 0xe8000000 0x8000000
+ MBUS_ID(0x09, 0x09) 0 0 0xf1100000 0x10000
- MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000>;
++ MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000
+ MBUS_ID(0x0c, 0x04) 0 0 0xd1200000 0x100000>;
devbus-bootcs {
status = "okay";
^ permalink raw reply
* Re: [PATCH] netfilter: nf_conntrack: consolidate lock/unlock into unlock_wait
From: Pablo Neira Ayuso @ 2016-03-15 0:11 UTC (permalink / raw)
To: Nicholas Mc Guire
Cc: Patrick McHardy, Jozsef Kadlecsik, David S. Miller,
netfilter-devel, coreteam, netdev, linux-kernel
In-Reply-To: <1457955542-2377-1-git-send-email-hofrat@osadl.org>
On Mon, Mar 14, 2016 at 12:39:02PM +0100, Nicholas Mc Guire wrote:
> The spin_lock()/spin_unlock() is synchronizing on the
> nf_conntrack_locks_all_lock which is equivalent to
> spin_unlock_wait() but the later should be more efficient.
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] batman-adv: Less function calls in batadv_is_ap_isolated() after error detection
From: Antonio Quartulli @ 2016-03-15 0:14 UTC (permalink / raw)
To: David Miller
Cc: elfring, b.a.t.m.a.n, netdev, mareklindner, sw, sven,
linux-kernel, kernel-janitors, julia.lawall
In-Reply-To: <20160314.152502.1823929263984045274.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 868 bytes --]
On Mon, Mar 14, 2016 at 03:25:02PM -0400, David Miller wrote:
> From: SF Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 11 Mar 2016 13:40:56 +0100
>
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Fri, 11 Mar 2016 13:10:20 +0100
> >
> > The variables "tt_local_entry" and "tt_global_entry" were eventually
> > checked again despite of a corresponding null pointer test before.
> >
> > * Avoid this double check by reordering a function call sequence
> > and the better selection of jump targets.
> >
> > * Omit the initialisation for these variables at the beginning then.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>
> I am assuming Antonio will take this in via his tree.
>
Yeah, it will go through our tree. Still under review right now.
Cheers,
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* [PATCH 0/3] net/phy: Fixes for Cavium Thunder MDIO code.
From: David Daney @ 2016-03-15 0:30 UTC (permalink / raw)
To: David S. Miller, netdev, linux-arm-kernel, Florian Fainelli,
Robert Richter, Sunil Goutham
Cc: Radha Mohan Chintakuntla, linux-kernel, David Daney
From: David Daney <david.daney@cavium.com>
Previous patch set:
commit 5fc7cf179449 ("net: thunderx: Cleanup PHY probing code.")
commit 1eefee901fca ("phy: mdio-octeon: Refactor into two files/modules")
commit 379d7ac7ca31 ("phy: mdio-thunder: Add driver for Cavium Thunder SoC MDIO buses.")
Had several problems. We try to fix them here.
David Daney (3):
phy: mdio-cavium: Add missing MODULE_* annotations.
net: cavium: For Kconfig THUNDER_NIC_BGX, select MDIO_THUNDER.
net: thunderx: Don't leak phy device references on -EPROBE_DEFER
condition.
drivers/net/ethernet/cavium/Kconfig | 2 +-
drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 26 +++++++++++++++++------
drivers/net/phy/mdio-cavium.c | 4 ++++
3 files changed, 25 insertions(+), 7 deletions(-)
--
1.7.11.7
^ permalink raw reply
* [PATCH 1/3] phy: mdio-cavium: Add missing MODULE_* annotations.
From: David Daney @ 2016-03-15 0:30 UTC (permalink / raw)
To: David S. Miller, netdev, linux-arm-kernel, Florian Fainelli,
Robert Richter, Sunil Goutham
Cc: linux-kernel, Radha Mohan Chintakuntla, David Daney
In-Reply-To: <1458001839-15993-1-git-send-email-ddaney.cavm@gmail.com>
From: David Daney <david.daney@cavium.com>
When the code was factored out of mdio-octeon.c, the
MODULE_DESCRIPTION, MODULE_AUTHOR and MODULE_LICENSE annotations were
inadvertently omitted. Restore them so that we don't get kernel taint
warnings upon module loading.
Signed-off-by: David Daney <david.daney@cavium.com>
---
drivers/net/phy/mdio-cavium.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/phy/mdio-cavium.c b/drivers/net/phy/mdio-cavium.c
index e796ee1..6df2fa7 100644
--- a/drivers/net/phy/mdio-cavium.c
+++ b/drivers/net/phy/mdio-cavium.c
@@ -147,3 +147,7 @@ int cavium_mdiobus_write(struct mii_bus *bus, int phy_id, int regnum, u16 val)
return 0;
}
EXPORT_SYMBOL(cavium_mdiobus_write);
+
+MODULE_DESCRIPTION("Common code for OCTEON and Thunder MDIO bus drivers");
+MODULE_AUTHOR("David Daney");
+MODULE_LICENSE("GPL");
--
1.7.11.7
^ permalink raw reply related
* [PATCH 2/3] net: cavium: For Kconfig THUNDER_NIC_BGX, select MDIO_THUNDER.
From: David Daney @ 2016-03-15 0:30 UTC (permalink / raw)
To: David S. Miller, netdev, linux-arm-kernel, Florian Fainelli,
Robert Richter, Sunil Goutham
Cc: linux-kernel, Radha Mohan Chintakuntla, David Daney
In-Reply-To: <1458001839-15993-1-git-send-email-ddaney.cavm@gmail.com>
From: David Daney <david.daney@cavium.com>
Previously we selected MDIO_OCTEON, which after creating the Thunder
specific MDIO bus driver is much less useful.
Signed-off-by: David Daney <david.daney@cavium.com>
---
drivers/net/ethernet/cavium/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig
index 8fb84e6..953aa40 100644
--- a/drivers/net/ethernet/cavium/Kconfig
+++ b/drivers/net/ethernet/cavium/Kconfig
@@ -35,7 +35,7 @@ config THUNDER_NIC_BGX
tristate "Thunder MAC interface driver (BGX)"
depends on 64BIT
select PHYLIB
- select MDIO_OCTEON
+ select MDIO_THUNDER
---help---
This driver supports programming and controlling of MAC
interface from NIC physical function driver.
--
1.7.11.7
^ permalink raw reply related
* [PATCH 3/3] net: thunderx: Don't leak phy device references on -EPROBE_DEFER condition.
From: David Daney @ 2016-03-15 0:30 UTC (permalink / raw)
To: David S. Miller, netdev, linux-arm-kernel, Florian Fainelli,
Robert Richter, Sunil Goutham
Cc: linux-kernel, Radha Mohan Chintakuntla, David Daney
In-Reply-To: <1458001839-15993-1-git-send-email-ddaney.cavm@gmail.com>
From: David Daney <david.daney@cavium.com>
It is possible, although unlikely, that probing will find the
phy_device for the first LMAC of a thunder BGX device, but then need
to fail with -EPROBE_DEFER on a subsequent LMAC. In this case, we
need to call put_device() on each of the phy_devices that were
obtained, but will be unused due to returning -EPROBE_DEFER.
Also, since we can break out of the probing loop early, we need to
explicitly call of_node_put() outside of the loop.
Signed-off-by: David Daney <david.daney@cavium.com>
---
drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 26 +++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index feed231..9679515 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -974,17 +974,18 @@ static int bgx_init_acpi_phy(struct bgx *bgx)
static int bgx_init_of_phy(struct bgx *bgx)
{
struct fwnode_handle *fwn;
+ struct device_node *node = NULL;
u8 lmac = 0;
- const char *mac;
device_for_each_child_node(&bgx->pdev->dev, fwn) {
struct phy_device *pd;
struct device_node *phy_np;
- struct device_node *node = to_of_node(fwn);
+ const char *mac;
/* Should always be an OF node. But if it is not, we
* cannot handle it, so exit the loop.
*/
+ node = to_of_node(fwn);
if (!node)
break;
@@ -1005,17 +1006,30 @@ static int bgx_init_of_phy(struct bgx *bgx)
/* Wait until the phy drivers are available */
pd = of_phy_find_device(phy_np);
if (!pd)
- return -EPROBE_DEFER;
+ goto defer;
bgx->lmac[lmac].phydev = pd;
}
lmac++;
- if (lmac == MAX_LMAC_PER_BGX) {
- of_node_put(node);
+ if (lmac == MAX_LMAC_PER_BGX)
break;
- }
}
+ of_node_put(node);
return 0;
+
+defer:
+ /* We are bailing out, try not to leak device reference counts
+ * for phy devices we may have already found.
+ */
+ while (lmac) {
+ if (bgx->lmac[lmac].phydev) {
+ put_device(&bgx->lmac[lmac].phydev->mdio.dev);
+ bgx->lmac[lmac].phydev = NULL;
+ }
+ lmac--;
+ }
+ of_node_put(node);
+ return -EPROBE_DEFER;
}
#else
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH][net-next] ipv6: replace write lock with read lock in addrconf_permanent_addr
From: Li RongQing @ 2016-03-15 0:36 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20160314.122534.345751583747280951.davem@davemloft.net>
On Tue, Mar 15, 2016 at 12:25 AM, David Miller <davem@davemloft.net> wrote:
>
> We need it for the modifications made by fixup_permanent_addr().
fixup_permanent_addr should be protected by ifp->lock,
not by idev->lock write lock, since ifp is modified,
-Roy
^ permalink raw reply
* Re: [PATCH v6 net-next 2/2] tcp: Add Redundant Data Bundling (RDB)
From: Bill Fink @ 2016-03-15 0:40 UTC (permalink / raw)
To: Yuchung Cheng
Cc: Bendik Rønning Opstad, David S. Miller, netdev, Eric Dumazet,
Neal Cardwell, Andreas Petlund, Carsten Griwodz,
Pål Halvorsen, Jonas Markussen, Kristian Evensen,
Kenneth Klette Jonassen
In-Reply-To: <CAK6E8=eXH1HEXEWiAnUTT65i9=M=j1W1v3MQFSxvk2xF_TNLZg@mail.gmail.com>
On Mon, 14 Mar 2016, Yuchung Cheng wrote:
> On Thu, Mar 3, 2016 at 10:06 AM, Bendik Rønning Opstad
> <bro.devel@gmail.com> wrote:
> >
> > Redundant Data Bundling (RDB) is a mechanism for TCP aimed at reducing
> > the latency for applications sending time-dependent data.
...
> > diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
> > index 6a92b15..8f3f3bf 100644
> > --- a/Documentation/networking/ip-sysctl.txt
> > +++ b/Documentation/networking/ip-sysctl.txt
> > @@ -716,6 +716,21 @@ tcp_thin_dpifl_itt_lower_bound - INTEGER
> > calculated, which is used to classify whether a stream is thin.
> > Default: 10000
> >
> > +tcp_rdb - BOOLEAN
> > + Enable RDB for all new TCP connections.
> Please describe RDB briefly, perhaps with a pointer to your paper.
> I suggest have three level of controls:
> 0: disable RDB completely
> 1: enable indiv. thin-stream conn. to use RDB via TCP_RDB socket
> options
> 2: enable RDB on all thin-stream conn. by default
>
> currently it only provides mode 1 and 2. but there may be cases where
> the administrator wants to disallow it (e.g., broken middle-boxes).
>
> > + Default: 0
A per route setting to enable or disable tcp_rdb, overriding
the global setting, could also be useful to the administrator.
Just a suggestion for potential followup work.
-Bill
^ permalink raw reply
* Re: [PATCHv3 (net.git) 2/2] stmmac: fix MDIO settings
From: Andreas Färber @ 2016-03-15 0:54 UTC (permalink / raw)
To: Giuseppe Cavallaro
Cc: netdev, gabriel.fernandez, fschaefer.oss, dinh.linux, davem,
preid
In-Reply-To: <1457703196-15008-3-git-send-email-peppe.cavallaro@st.com>
Hi Peppe,
Am 11.03.2016 um 14:33 schrieb Giuseppe Cavallaro:
> Initially the phy_bus_name was added to manipulate the
> driver name but It was recently just used to manage the
"it"
> fixed-link and then to take some decision at run-time
> inside the main (for example to skip EEE).
Word missing after "main"? ("function"?)
> So the patch uses the is_pseudo_fixed_link and removes
> removes the phy_bus_name variable not necessary anymore.
Duplicate "removes".
>
> The driver can manage the mdio registration by using phy-handle,
> dwmac-mdio and own parameter e.g. snps,phy-addr.
> This patch takes care about all these possible configurations
> and fixes the mdio registration in case of there is a real
> transceiver or a switch (that needs to be managed by using
> fixed-link).
>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Reviewed-by: Andreas Färber <afaerber@suse.de>
> Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> Cc: Gabriel Fernandez <gabriel.fernandez@linaro.org>
> Cc: Dinh Nguyen <dinh.linux@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Phil Reid <preid@electromag.com.au>
> ---
>
> V2: use is_pseudo_fixed_link
> V3: parse device-tree driver parameters to allocate PHY resources considering
> DSA case (+ fixed-link).
For next-20160314 I needed "i2c: immediately mark ourselves as
registered" plus this build fix:
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -866,9 +866,8 @@ static int stmmac_init_phy(struct net_device *dev)
}
/* If attached to a switch, there is no reason to poll phy
handler */
- if (priv->plat->phy_bus_name)
- if (!strcmp(priv->plat->phy_bus_name, "fixed"))
- phydev->irq = PHY_IGNORE_INTERRUPT;
+ if (phydev->is_pseudo_fixed_link)
+ phydev->irq = PHY_IGNORE_INTERRUPT;
pr_debug("stmmac_init_phy: %s: attached to PHY (UID 0x%x)"
" Link = %d\n", dev->name, phydev->phy_id, phydev->link);
It then fixes the PHY error on GeekBox, so for this mini-series:
Tested-by: Andreas Färber <afaerber@suse.de>
The connectivity issue still remains. Kernel log snippet:
[ +0.001117] rk_gmac-dwmac ff290000.ethernet: Looking up phy-supply
from device tree
[ +0.000028] rk808 0-001b: Looking up vcc12-supply from device tree
[ +0.000014] vcc_lan: supplied by vcc_io
[ +0.000101] rk_gmac-dwmac ff290000.ethernet: clock input or output?
(input).
[ +0.000009] rk_gmac-dwmac ff290000.ethernet: TX delay(0x30).
[ +0.000008] rk_gmac-dwmac ff290000.ethernet: RX delay(0x10).
[ +0.000014] rk_gmac-dwmac ff290000.ethernet: init for RGMII
[ +0.000104] rk_gmac-dwmac ff290000.ethernet: clock input from PHY
[ +0.005063] rk_gmac-dwmac ff290000.ethernet: no reset control found
[ +0.000007] stmmac - user ID: 0x10, Synopsys ID: 0x35
[ +0.000002] Ring mode enabled
[ +0.000006] DMA HW capability register supported
[ +0.000000] Normal descriptors
[ +0.000003] RX Checksum Offload Engine supported (type 2)
[ +0.000002] TX Checksum insertion supported
[ +0.000002] Wake-Up On Lan supported
[ +0.000053] Enable RX Mitigation via HW Watchdog Timer
[ +0.000771] of_get_named_gpiod_flags: can't parse 'snps,reset-gpio'
property of node '/ethernet@ff290000[0]'
[ +0.004250] libphy: stmmac: probed
[ +0.000009] eth0: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[ +0.000005] eth0: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
As before, reverting "stmmac: first frame prep at the end of xmit
routine" fixes it. My test cases are `ping 192.168.1.1` and `zypper up`.
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)
^ permalink raw reply
* [PATCH] netdev: Move octeon/octeon_mgmt driver to cavium directory.
From: David Daney @ 2016-03-15 0:57 UTC (permalink / raw)
To: David S. Miller, netdev; +Cc: linux-kernel, linux-mips, David Daney
From: David Daney <david.daney@cavium.com>
No code changes. Since OCTEON is a Cavium product, move the driver to
the vendor directory to unclutter things a bit.
Signed-off-by: David Daney <david.daney@cavium.com>
---
drivers/net/ethernet/Kconfig | 1 -
drivers/net/ethernet/Makefile | 1 -
drivers/net/ethernet/cavium/Kconfig | 11 +++++++++++
drivers/net/ethernet/cavium/Makefile | 1 +
drivers/net/ethernet/{ => cavium}/octeon/Makefile | 0
drivers/net/ethernet/{ => cavium}/octeon/octeon_mgmt.c | 0
drivers/net/ethernet/octeon/Kconfig | 14 --------------
7 files changed, 12 insertions(+), 16 deletions(-)
rename drivers/net/ethernet/{ => cavium}/octeon/Makefile (100%)
rename drivers/net/ethernet/{ => cavium}/octeon/octeon_mgmt.c (100%)
delete mode 100644 drivers/net/ethernet/octeon/Kconfig
diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
index be67a19..2ffd634 100644
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
@@ -139,7 +139,6 @@ config NET_NETX
source "drivers/net/ethernet/nuvoton/Kconfig"
source "drivers/net/ethernet/nvidia/Kconfig"
source "drivers/net/ethernet/nxp/Kconfig"
-source "drivers/net/ethernet/octeon/Kconfig"
source "drivers/net/ethernet/oki-semi/Kconfig"
config ETHOC
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index 6ffcc80..1d349e9 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -59,7 +59,6 @@ obj-$(CONFIG_NET_NETX) += netx-eth.o
obj-$(CONFIG_NET_VENDOR_NUVOTON) += nuvoton/
obj-$(CONFIG_NET_VENDOR_NVIDIA) += nvidia/
obj-$(CONFIG_LPC_ENET) += nxp/
-obj-$(CONFIG_OCTEON_MGMT_ETHERNET) += octeon/
obj-$(CONFIG_NET_VENDOR_OKI) += oki-semi/
obj-$(CONFIG_ETHOC) += ethoc.o
obj-$(CONFIG_NET_PACKET_ENGINE) += packetengines/
diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig
index 953aa40..0ef232d 100644
--- a/drivers/net/ethernet/cavium/Kconfig
+++ b/drivers/net/ethernet/cavium/Kconfig
@@ -53,4 +53,15 @@ config LIQUIDIO
To compile this driver as a module, choose M here: the module
will be called liquidio. This is recommended.
+config OCTEON_MGMT_ETHERNET
+ tristate "Octeon Management port ethernet driver (CN5XXX, CN6XXX)"
+ depends on CAVIUM_OCTEON_SOC
+ select PHYLIB
+ select MDIO_OCTEON
+ default y
+ help
+ Enable the ethernet driver for the management
+ port on Cavium Networks' Octeon CN57XX, CN56XX, CN55XX,
+ CN54XX, CN52XX, and CN6XXX chips.
+
endif # NET_VENDOR_CAVIUM
diff --git a/drivers/net/ethernet/cavium/Makefile b/drivers/net/ethernet/cavium/Makefile
index d22f886a..872da9f 100644
--- a/drivers/net/ethernet/cavium/Makefile
+++ b/drivers/net/ethernet/cavium/Makefile
@@ -3,3 +3,4 @@
#
obj-$(CONFIG_NET_VENDOR_CAVIUM) += thunder/
obj-$(CONFIG_NET_VENDOR_CAVIUM) += liquidio/
+obj-$(CONFIG_NET_VENDOR_CAVIUM) += octeon/
diff --git a/drivers/net/ethernet/octeon/Makefile b/drivers/net/ethernet/cavium/octeon/Makefile
similarity index 100%
rename from drivers/net/ethernet/octeon/Makefile
rename to drivers/net/ethernet/cavium/octeon/Makefile
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
similarity index 100%
rename from drivers/net/ethernet/octeon/octeon_mgmt.c
rename to drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
diff --git a/drivers/net/ethernet/octeon/Kconfig b/drivers/net/ethernet/octeon/Kconfig
deleted file mode 100644
index a7aa280..0000000
--- a/drivers/net/ethernet/octeon/Kconfig
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Cavium network device configuration
-#
-
-config OCTEON_MGMT_ETHERNET
- tristate "Octeon Management port ethernet driver (CN5XXX, CN6XXX)"
- depends on CAVIUM_OCTEON_SOC
- select PHYLIB
- select MDIO_OCTEON
- default y
- ---help---
- This option enables the ethernet driver for the management
- port on Cavium Networks' Octeon CN57XX, CN56XX, CN55XX,
- CN54XX, CN52XX, and CN6XXX chips.
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH v6 net-next 2/2] tcp: Add Redundant Data Bundling (RDB)
From: Rick Jones @ 2016-03-15 1:04 UTC (permalink / raw)
To: Eric Dumazet, Bendik Rønning Opstad
Cc: David S. Miller, netdev, Yuchung Cheng, Neal Cardwell,
Andreas Petlund, Carsten Griwodz, Pål Halvorsen,
Jonas Markussen, Kristian Evensen, Kenneth Klette Jonassen
In-Reply-To: <1457990140.31401.20.camel@edumazet-glaptop3.roam.corp.google.com>
On 03/14/2016 02:15 PM, Eric Dumazet wrote:
> On Thu, 2016-03-03 at 19:06 +0100, Bendik Rønning Opstad wrote:
>> Redundant Data Bundling (RDB) is a mechanism for TCP aimed at reducing
>> the latency for applications sending time-dependent data.
>>
>> Latency-sensitive applications or services, such as online games,
>> remote control systems, and VoIP, produce traffic with thin-stream
>> characteristics, characterized by small packets and relatively high
>> inter-transmission times (ITT). When experiencing packet loss, such
>> latency-sensitive applications are heavily penalized by the need to
>> retransmit lost packets, which increases the latency by a minimum of
>> one RTT for the lost packet. Packets coming after a lost packet are
>> held back due to head-of-line blocking, causing increased delays for
>> all data segments until the lost packet has been retransmitted.
>
> Acked-by: Eric Dumazet <edumazet@google.com>
>
> Note that RDB probably should get some SNMP counters,
> so that we get an idea of how many times a loss could be repaired.
And some idea of the duplication seen by receivers, assuming there isn't
already a counter for such a thing in Linux.
happy benchmarking,
rick jones
>
> Ideally, if the path happens to be lossless, all these pro active
> bundles are overhead. Might be useful to make RDB conditional to
> tp->total_retrans or something.
>
>
^ permalink raw reply
* [PATCH 00/18] Netfilter/IPVS/OVS updates for net-next
From: Pablo Neira Ayuso @ 2016-03-15 1:27 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev
Hi David,
The following patchset contains Netfilter/IPVS fixes and OVS NAT
support, more specifically this batch is composed of:
1) Fix a crash in ipset when performing a parallel flush/dump with
set:list type, from Jozsef Kadlecsik.
2) Make sure NFACCT_FILTER_* netlink attributes are in place before
accessing them, from Phil Turnbull.
3) Check return error code from ip_vs_fill_iph_skb_off() in IPVS SIP
helper, from Arnd Bergmann.
4) Add workaround to IPVS to reschedule existing connections to new
destination server by dropping the packet and wait for retransmission
of TCP syn packet, from Julian Anastasov.
5) Allow connection rescheduling in IPVS when in CLOSE state, also
from Julian.
6) Fix wrong offset of SIP Call-ID in IPVS helper, from Marco Angaroni.
7) Validate IPSET_ATTR_ETHER netlink attribute length, from Jozsef.
8) Check match/targetinfo netlink attribute size in nft_compat,
patch from Florian Westphal.
9) Check for integer overflow on 32-bit systems in x_tables, from
Florian Westphal.
Several patches from Jarno Rajahalme to prepare the introduction of
NAT support to OVS based on the Netfilter infrastructure:
10) Schedule IP_CT_NEW_REPLY definition for removal in
nf_conntrack_common.h.
11) Simplify checksumming recalculation in nf_nat.
12) Add comments to the openvswitch conntrack code, from Jarno.
13) Update the CT state key only after successful nf_conntrack_in()
invocation.
14) Find existing conntrack entry after upcall.
15) Handle NF_REPEAT case due to templates in nf_conntrack_in().
16) Call the conntrack helper functions once the conntrack has been
confirmed.
17) And finally, add the NAT interface to OVS.
The batch closes with:
18) Cleanup to use spin_unlock_wait() instead of
spin_lock()/spin_unlock(), from Nicholas Mc Guire.
You can pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git
Thanks!
----------------------------------------------------------------
The following changes since commit 3b8377dca1fd1974d245b2a04a708fc434761c65:
Merge branch 'variable-length-ll-headers' (2016-03-09 22:13:01 -0500)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git HEAD
for you to fetch changes up to e39365be031e37b229f745ea49db0b25e82436fa:
netfilter: nf_conntrack: consolidate lock/unlock into unlock_wait (2016-03-15 01:10:42 +0100)
----------------------------------------------------------------
Arnd Bergmann (1):
ipvs: handle ip_vs_fill_iph_skb_off failure
Florian Westphal (2):
netfilter: nft_compat: check match/targetinfo attr size
netfilter: x_tables: check for size overflow
Jarno Rajahalme (8):
netfilter: Remove IP_CT_NEW_REPLY definition.
netfilter: Allow calling into nat helper without skb_dst.
openvswitch: Add commentary to conntrack.c
openvswitch: Update the CT state key only after nf_conntrack_in().
openvswitch: Find existing conntrack entry after upcall.
openvswitch: Handle NF_REPEAT in conntrack action.
openvswitch: Delay conntrack helper call for new connections.
openvswitch: Interface with NAT.
Jozsef Kadlecsik (2):
netfilter: ipset: Fix set:list type crash when flush/dump set in parallel
netfilter: ipset: Check IPSET_ATTR_ETHER netlink attribute length
Julian Anastasov (2):
ipvs: drop first packet to redirect conntrack
ipvs: allow rescheduling after RST
Marco Angaroni (1):
ipvs: correct initial offset of Call-ID header search in SIP persistence engine
Nicholas Mc Guire (1):
netfilter: nf_conntrack: consolidate lock/unlock into unlock_wait
Pablo Neira Ayuso (2):
Merge branch 'master' of git://blackhole.kfki.hu/nf
Merge tag 'ipvs-fixes-for-v4.5' of https://git.kernel.org/.../horms/ipvs
Phil Turnbull (1):
netfilter: nfnetlink_acct: validate NFACCT_FILTER parameters
include/net/ip_vs.h | 17 +
include/uapi/linux/netfilter/nf_conntrack_common.h | 12 +-
include/uapi/linux/openvswitch.h | 49 ++
net/ipv4/netfilter/nf_nat_l3proto_ipv4.c | 30 +-
net/ipv6/netfilter/nf_nat_l3proto_ipv6.c | 30 +-
net/netfilter/ipset/ip_set_bitmap_ipmac.c | 2 +
net/netfilter/ipset/ip_set_core.c | 3 +
net/netfilter/ipset/ip_set_hash_mac.c | 3 +-
net/netfilter/ipset/ip_set_list_set.c | 55 +-
net/netfilter/ipvs/ip_vs_core.c | 38 +-
net/netfilter/ipvs/ip_vs_pe_sip.c | 6 +-
net/netfilter/nf_conntrack_core.c | 6 +-
net/netfilter/nfnetlink_acct.c | 3 +
net/netfilter/nft_compat.c | 6 +
net/netfilter/x_tables.c | 3 +
net/openvswitch/Kconfig | 3 +-
net/openvswitch/conntrack.c | 660 +++++++++++++++++++--
net/openvswitch/conntrack.h | 3 +-
18 files changed, 795 insertions(+), 134 deletions(-)
^ permalink raw reply
* [PATCH 01/18] netfilter: ipset: Fix set:list type crash when flush/dump set in parallel
From: Pablo Neira Ayuso @ 2016-03-15 1:27 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1458005282-24665-1-git-send-email-pablo@netfilter.org>
From: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Flushing/listing entries was not RCU safe, so parallel flush/dump
could lead to kernel crash. Bug reported by Deniz Eren.
Fixes netfilter bugzilla id #1050.
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
---
net/netfilter/ipset/ip_set_core.c | 3 ++
net/netfilter/ipset/ip_set_list_set.c | 55 ++++++++++++++++-------------------
2 files changed, 28 insertions(+), 30 deletions(-)
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 95db43f..7e6568c 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -985,6 +985,9 @@ static int ip_set_destroy(struct net *net, struct sock *ctnl,
if (unlikely(protocol_failed(attr)))
return -IPSET_ERR_PROTOCOL;
+ /* Must wait for flush to be really finished in list:set */
+ rcu_barrier();
+
/* Commands are serialized and references are
* protected by the ip_set_ref_lock.
* External systems (i.e. xt_set) must call
diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
index bbede95..24c6c19 100644
--- a/net/netfilter/ipset/ip_set_list_set.c
+++ b/net/netfilter/ipset/ip_set_list_set.c
@@ -30,6 +30,7 @@ MODULE_ALIAS("ip_set_list:set");
struct set_elem {
struct rcu_head rcu;
struct list_head list;
+ struct ip_set *set; /* Sigh, in order to cleanup reference */
ip_set_id_t id;
} __aligned(__alignof__(u64));
@@ -151,30 +152,29 @@ list_set_kadt(struct ip_set *set, const struct sk_buff *skb,
/* Userspace interfaces: we are protected by the nfnl mutex */
static void
-__list_set_del(struct ip_set *set, struct set_elem *e)
+__list_set_del_rcu(struct rcu_head * rcu)
{
+ struct set_elem *e = container_of(rcu, struct set_elem, rcu);
+ struct ip_set *set = e->set;
struct list_set *map = set->data;
ip_set_put_byindex(map->net, e->id);
- /* We may call it, because we don't have a to be destroyed
- * extension which is used by the kernel.
- */
ip_set_ext_destroy(set, e);
- kfree_rcu(e, rcu);
+ kfree(e);
}
static inline void
list_set_del(struct ip_set *set, struct set_elem *e)
{
list_del_rcu(&e->list);
- __list_set_del(set, e);
+ call_rcu(&e->rcu, __list_set_del_rcu);
}
static inline void
-list_set_replace(struct ip_set *set, struct set_elem *e, struct set_elem *old)
+list_set_replace(struct set_elem *e, struct set_elem *old)
{
list_replace_rcu(&old->list, &e->list);
- __list_set_del(set, old);
+ call_rcu(&old->rcu, __list_set_del_rcu);
}
static void
@@ -244,9 +244,6 @@ list_set_uadd(struct ip_set *set, void *value, const struct ip_set_ext *ext,
struct set_elem *e, *n, *prev, *next;
bool flag_exist = flags & IPSET_FLAG_EXIST;
- if (SET_WITH_TIMEOUT(set))
- set_cleanup_entries(set);
-
/* Find where to add the new entry */
n = prev = next = NULL;
list_for_each_entry(e, &map->members, list) {
@@ -301,10 +298,11 @@ list_set_uadd(struct ip_set *set, void *value, const struct ip_set_ext *ext,
if (!e)
return -ENOMEM;
e->id = d->id;
+ e->set = set;
INIT_LIST_HEAD(&e->list);
list_set_init_extensions(set, ext, e);
if (n)
- list_set_replace(set, e, n);
+ list_set_replace(e, n);
else if (next)
list_add_tail_rcu(&e->list, &next->list);
else if (prev)
@@ -431,6 +429,7 @@ list_set_destroy(struct ip_set *set)
if (SET_WITH_TIMEOUT(set))
del_timer_sync(&map->gc);
+
list_for_each_entry_safe(e, n, &map->members, list) {
list_del(&e->list);
ip_set_put_byindex(map->net, e->id);
@@ -450,8 +449,10 @@ list_set_head(struct ip_set *set, struct sk_buff *skb)
struct set_elem *e;
u32 n = 0;
- list_for_each_entry(e, &map->members, list)
+ rcu_read_lock();
+ list_for_each_entry_rcu(e, &map->members, list)
n++;
+ rcu_read_unlock();
nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
if (!nested)
@@ -483,33 +484,25 @@ list_set_list(const struct ip_set *set,
atd = ipset_nest_start(skb, IPSET_ATTR_ADT);
if (!atd)
return -EMSGSIZE;
- list_for_each_entry(e, &map->members, list) {
- if (i == first)
- break;
- i++;
- }
rcu_read_lock();
- list_for_each_entry_from(e, &map->members, list) {
- i++;
- if (SET_WITH_TIMEOUT(set) &&
- ip_set_timeout_expired(ext_timeout(e, set)))
+ list_for_each_entry_rcu(e, &map->members, list) {
+ if (i < first ||
+ (SET_WITH_TIMEOUT(set) &&
+ ip_set_timeout_expired(ext_timeout(e, set)))) {
+ i++;
continue;
+ }
nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
- if (!nested) {
- if (i == first) {
- nla_nest_cancel(skb, atd);
- ret = -EMSGSIZE;
- goto out;
- }
+ if (!nested)
goto nla_put_failure;
- }
if (nla_put_string(skb, IPSET_ATTR_NAME,
ip_set_name_byindex(map->net, e->id)))
goto nla_put_failure;
if (ip_set_put_extensions(skb, set, e, true))
goto nla_put_failure;
ipset_nest_end(skb, nested);
+ i++;
}
ipset_nest_end(skb, atd);
@@ -520,10 +513,12 @@ list_set_list(const struct ip_set *set,
nla_put_failure:
nla_nest_cancel(skb, nested);
if (unlikely(i == first)) {
+ nla_nest_cancel(skb, atd);
cb->args[IPSET_CB_ARG0] = 0;
ret = -EMSGSIZE;
+ } else {
+ cb->args[IPSET_CB_ARG0] = i;
}
- cb->args[IPSET_CB_ARG0] = i - 1;
ipset_nest_end(skb, atd);
out:
rcu_read_unlock();
--
2.1.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox