* Re: [PATCH net-next 0/3] rxrpc: Fixes
From: David Miller @ 2017-11-30 15:08 UTC (permalink / raw)
To: dhowells; +Cc: netdev, linux-afs, linux-kernel
In-Reply-To: <151196962346.18702.5358430553616328740.stgit@warthog.procyon.org.uk>
From: David Howells <dhowells@redhat.com>
Date: Wed, 29 Nov 2017 15:33:43 +0000
> Here are three patches for AF_RXRPC. One removes some whitespace, one
> fixes terminal ACK generation and the third makes a couple of places
> actually use the timeout value just determined rather than ignoring it.
>
> The patches can be found here also:
>
> http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
>
> Tagged thusly:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
> rxrpc-fixes-20171129
Pulled into 'net', thanks David.
^ permalink raw reply
* Re: [PATCH v3 00/11] net: Significantly shrink the size of routes.
From: David Miller @ 2017-11-30 14:54 UTC (permalink / raw)
To: netdev
In-Reply-To: <20171128.153948.322422012075134809.davem@davemloft.net>
This is being committed to net-next.
^ permalink raw reply
* [PATCH net-next] net/reuseport: drop legacy code
From: Paolo Abeni @ 2017-11-30 14:39 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Craig Gallek
Since commit e32ea7e74727 ("soreuseport: fast reuseport UDP socket
selection") and commit c125e80b8868 ("soreuseport: fast reuseport
TCP socket selection") the relevant reuseport socket matching the current
packet is selected by the reuseport_select_sock() call. The only
exceptions are invalid BPF filters/filters returning out-of-range
indices.
In the latter case the code implicitly falls back to using the hash
demultiplexing, but instead of selecting the socket inside the
reuseport_select_sock() function, it relies on the hash selection
logic introduced with the early soreuseport implementation.
With this patch, in case of a BPF filter returning a bad socket
index value, we fall back to hash-based selection inside the
reuseport_select_sock() body, so that we can drop some duplicate
code in the ipv4 and ipv6 stack.
This also allows faster lookup in the above scenario and will allow
us to avoid computing the hash value for successful, BPF based
demultiplexing - in a later patch.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/core/sock_reuseport.c | 4 +++-
net/ipv4/inet_hashtables.c | 11 ++---------
net/ipv4/udp.c | 22 ++++------------------
net/ipv6/inet6_hashtables.c | 11 ++---------
net/ipv6/udp.c | 22 ++++------------------
5 files changed, 15 insertions(+), 55 deletions(-)
diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c
index 5eeb1d20cc38..c5bb52bc73a1 100644
--- a/net/core/sock_reuseport.c
+++ b/net/core/sock_reuseport.c
@@ -235,7 +235,9 @@ struct sock *reuseport_select_sock(struct sock *sk,
if (prog && skb)
sk2 = run_bpf(reuse, socks, prog, skb, hdr_len);
- else
+
+ /* no bpf or invalid bpf result: fall back to hash usage */
+ if (!sk2)
sk2 = reuse->socks[reciprocal_scale(hash, socks)];
}
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index e7d15fb0d94d..427b705d7c64 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -216,32 +216,25 @@ struct sock *__inet_lookup_listener(struct net *net,
{
unsigned int hash = inet_lhashfn(net, hnum);
struct inet_listen_hashbucket *ilb = &hashinfo->listening_hash[hash];
- int score, hiscore = 0, matches = 0, reuseport = 0;
bool exact_dif = inet_exact_dif_match(net, skb);
struct sock *sk, *result = NULL;
+ int score, hiscore = 0;
u32 phash = 0;
sk_for_each_rcu(sk, &ilb->head) {
score = compute_score(sk, net, hnum, daddr,
dif, sdif, exact_dif);
if (score > hiscore) {
- reuseport = sk->sk_reuseport;
- if (reuseport) {
+ if (sk->sk_reuseport) {
phash = inet_ehashfn(net, daddr, hnum,
saddr, sport);
result = reuseport_select_sock(sk, phash,
skb, doff);
if (result)
return result;
- matches = 1;
}
result = sk;
hiscore = score;
- } else if (score == hiscore && reuseport) {
- matches++;
- if (reciprocal_scale(phash, matches) == 0)
- result = sk;
- phash = next_pseudo_random32(phash);
}
}
return result;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index e4ff25c947c5..36f857c87fe2 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -445,7 +445,7 @@ static struct sock *udp4_lib_lookup2(struct net *net,
struct sk_buff *skb)
{
struct sock *sk, *result;
- int score, badness, matches = 0, reuseport = 0;
+ int score, badness;
u32 hash = 0;
result = NULL;
@@ -454,23 +454,16 @@ static struct sock *udp4_lib_lookup2(struct net *net,
score = compute_score(sk, net, saddr, sport,
daddr, hnum, dif, sdif, exact_dif);
if (score > badness) {
- reuseport = sk->sk_reuseport;
- if (reuseport) {
+ if (sk->sk_reuseport) {
hash = udp_ehashfn(net, daddr, hnum,
saddr, sport);
result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
if (result)
return result;
- matches = 1;
}
badness = score;
result = sk;
- } else if (score == badness && reuseport) {
- matches++;
- if (reciprocal_scale(hash, matches) == 0)
- result = sk;
- hash = next_pseudo_random32(hash);
}
}
return result;
@@ -488,7 +481,7 @@ struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr,
unsigned int hash2, slot2, slot = udp_hashfn(net, hnum, udptable->mask);
struct udp_hslot *hslot2, *hslot = &udptable->hash[slot];
bool exact_dif = udp_lib_exact_dif_match(net, skb);
- int score, badness, matches = 0, reuseport = 0;
+ int score, badness;
u32 hash = 0;
if (hslot->count > 10) {
@@ -526,23 +519,16 @@ struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr,
score = compute_score(sk, net, saddr, sport,
daddr, hnum, dif, sdif, exact_dif);
if (score > badness) {
- reuseport = sk->sk_reuseport;
- if (reuseport) {
+ if (sk->sk_reuseport) {
hash = udp_ehashfn(net, daddr, hnum,
saddr, sport);
result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
if (result)
return result;
- matches = 1;
}
result = sk;
badness = score;
- } else if (score == badness && reuseport) {
- matches++;
- if (reciprocal_scale(hash, matches) == 0)
- result = sk;
- hash = next_pseudo_random32(hash);
}
}
return result;
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index b01858f5deb1..0d1451381f5c 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -134,31 +134,24 @@ struct sock *inet6_lookup_listener(struct net *net,
{
unsigned int hash = inet_lhashfn(net, hnum);
struct inet_listen_hashbucket *ilb = &hashinfo->listening_hash[hash];
- int score, hiscore = 0, matches = 0, reuseport = 0;
bool exact_dif = inet6_exact_dif_match(net, skb);
struct sock *sk, *result = NULL;
+ int score, hiscore = 0;
u32 phash = 0;
sk_for_each(sk, &ilb->head) {
score = compute_score(sk, net, hnum, daddr, dif, sdif, exact_dif);
if (score > hiscore) {
- reuseport = sk->sk_reuseport;
- if (reuseport) {
+ if (sk->sk_reuseport) {
phash = inet6_ehashfn(net, daddr, hnum,
saddr, sport);
result = reuseport_select_sock(sk, phash,
skb, doff);
if (result)
return result;
- matches = 1;
}
result = sk;
hiscore = score;
- } else if (score == hiscore && reuseport) {
- matches++;
- if (reciprocal_scale(phash, matches) == 0)
- result = sk;
- phash = next_pseudo_random32(phash);
}
}
return result;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 3f30fa313bf2..c9f91c28b81d 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -184,7 +184,7 @@ static struct sock *udp6_lib_lookup2(struct net *net,
struct udp_hslot *hslot2, struct sk_buff *skb)
{
struct sock *sk, *result;
- int score, badness, matches = 0, reuseport = 0;
+ int score, badness;
u32 hash = 0;
result = NULL;
@@ -193,8 +193,7 @@ static struct sock *udp6_lib_lookup2(struct net *net,
score = compute_score(sk, net, saddr, sport,
daddr, hnum, dif, sdif, exact_dif);
if (score > badness) {
- reuseport = sk->sk_reuseport;
- if (reuseport) {
+ if (sk->sk_reuseport) {
hash = udp6_ehashfn(net, daddr, hnum,
saddr, sport);
@@ -202,15 +201,9 @@ static struct sock *udp6_lib_lookup2(struct net *net,
sizeof(struct udphdr));
if (result)
return result;
- matches = 1;
}
result = sk;
badness = score;
- } else if (score == badness && reuseport) {
- matches++;
- if (reciprocal_scale(hash, matches) == 0)
- result = sk;
- hash = next_pseudo_random32(hash);
}
}
return result;
@@ -228,7 +221,7 @@ struct sock *__udp6_lib_lookup(struct net *net,
unsigned int hash2, slot2, slot = udp_hashfn(net, hnum, udptable->mask);
struct udp_hslot *hslot2, *hslot = &udptable->hash[slot];
bool exact_dif = udp6_lib_exact_dif_match(net, skb);
- int score, badness, matches = 0, reuseport = 0;
+ int score, badness;
u32 hash = 0;
if (hslot->count > 10) {
@@ -267,23 +260,16 @@ struct sock *__udp6_lib_lookup(struct net *net,
score = compute_score(sk, net, saddr, sport, daddr, hnum, dif,
sdif, exact_dif);
if (score > badness) {
- reuseport = sk->sk_reuseport;
- if (reuseport) {
+ if (sk->sk_reuseport) {
hash = udp6_ehashfn(net, daddr, hnum,
saddr, sport);
result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
if (result)
return result;
- matches = 1;
}
result = sk;
badness = score;
- } else if (score == badness && reuseport) {
- matches++;
- if (reciprocal_scale(hash, matches) == 0)
- result = sk;
- hash = next_pseudo_random32(hash);
}
}
return result;
--
2.13.6
^ permalink raw reply related
* Re: [PATCH] net: stmmac: dwmac-sun8i: fix allwinner,leds-active-low handling
From: David Miller @ 2017-11-30 14:45 UTC (permalink / raw)
To: clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w
Cc: alexandre.torgue-qxv4g6HH51o,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
peppe.cavallaro-qxv4g6HH51o, wens-jdAy2FN1RRM,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <20171128164822.29218-1-clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: Corentin Labbe <clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Tue, 28 Nov 2017 17:48:22 +0100
> The driver expect "allwinner,leds-active-low" to be in PHY node, but
> the binding doc expect it to be in MAC node.
>
> Since all board DT use it also in MAC node, the driver need to search
> allwinner,leds-active-low in MAC node.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
I've read over this discussion and I think the thing to do is for me
to simply apply this to 'net' for now.
Thanks.
^ permalink raw reply
* [PATCH net-next] openvswitch: do not propagate headroom updates to internal port
From: Paolo Abeni @ 2017-11-30 14:35 UTC (permalink / raw)
To: netdev; +Cc: Pravin Shelar, David S. Miller
After commit 3a927bc7cf9d ("ovs: propagate per dp max headroom to
all vports") the need_headroom for the internal vport is updated
accordingly to the max needed headroom in its datapath.
That avoids the pskb_expand_head() costs when sending/forwarding
packets towards tunnel devices, at least for some scenarios.
We still require such copy when using the ovs-preferred configuration
for vxlan tunnels:
br_int
/ \
tap vxlan
(remote_ip:X)
br_phy
\
NIC
where the route towards the IP 'X' is via 'br_phy'.
When forwarding traffic from the tap towards the vxlan device, we
will call pskb_expand_head() in vxlan_build_skb() because
br-phy->needed_headroom is equal to tun->needed_headroom.
With this change we avoid updating the internal vport needed_headroom,
so that in the above scenario no head copy is needed, giving 5%
performance improvement in UDP throughput test.
As a trade-off, packets sent from the internal port towards a tunnel
device will now experience the head copy overhead. The rationale is
that the latter use-case is less relevant performance-wise.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/openvswitch/vport-internal_dev.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 04a3128adcf0..3e7747549f90 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -126,18 +126,12 @@ internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
}
}
-static void internal_set_rx_headroom(struct net_device *dev, int new_hr)
-{
- dev->needed_headroom = new_hr < 0 ? 0 : new_hr;
-}
-
static const struct net_device_ops internal_dev_netdev_ops = {
.ndo_open = internal_dev_open,
.ndo_stop = internal_dev_stop,
.ndo_start_xmit = internal_dev_xmit,
.ndo_set_mac_address = eth_mac_addr,
.ndo_get_stats64 = internal_get_stats,
- .ndo_set_rx_headroom = internal_set_rx_headroom,
};
static struct rtnl_link_ops internal_dev_link_ops __read_mostly = {
@@ -154,7 +148,7 @@ static void do_setup(struct net_device *netdev)
netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_OPENVSWITCH |
- IFF_PHONY_HEADROOM | IFF_NO_QUEUE;
+ IFF_NO_QUEUE;
netdev->needs_free_netdev = true;
netdev->priv_destructor = internal_dev_destructor;
netdev->ethtool_ops = &internal_dev_ethtool_ops;
@@ -195,7 +189,6 @@ static struct vport *internal_dev_create(const struct vport_parms *parms)
err = -ENOMEM;
goto error_free_netdev;
}
- vport->dev->needed_headroom = vport->dp->max_headroom;
dev_net_set(vport->dev, ovs_dp_get_net(vport->dp));
internal_dev = internal_dev_priv(vport->dev);
--
2.13.6
^ permalink raw reply related
* Re: [PATCH net] sit: update frag_off info
From: Hangbin Liu @ 2017-11-30 14:35 UTC (permalink / raw)
To: Nicolas Dichtel; +Cc: netdev, David Miller
In-Reply-To: <164eac37-3c3f-8cdf-ecee-05ffd7a44222@6wind.com>
On Thu, Nov 30, 2017 at 03:08:51PM +0100, Nicolas Dichtel wrote:
> Le 30/11/2017 à 03:41, Hangbin Liu a écrit :
> > After parsing the sit netlink change info, we forget to update frag_off in
> > ipip6_tunnel_update(). Fix it by assigning frag_off with new value.
> >
> > Fixes: f37234160233 ("sit: add support of link creation via rtnl")
> I think it's older than this patch (before git ages), but it probably doesn't
> matter.
Yeah..It really took me some time to consider whether add the fixes tag or
not. David, please feel free to remove it if you think it's unnecessary.
Thanks
Hangbin
>
>
> > Reported-by: Jianlin Shi <jishi@redhat.com>
> > Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
^ permalink raw reply
* Re: [PATCH net-next 1/1] forcedeth: optimize the xmit with unlikely
From: David Miller @ 2017-11-30 14:35 UTC (permalink / raw)
To: yanjun.zhu; +Cc: netdev, tremyfr
In-Reply-To: <1511851342-5532-1-git-send-email-yanjun.zhu@oracle.com>
From: Zhu Yanjun <yanjun.zhu@oracle.com>
Date: Tue, 28 Nov 2017 01:42:22 -0500
> In xmit, it is very impossible that TX_ERROR occurs. So using
> unlikely optimizes the xmit process.
>
> CC: Srinivas Eeda <srinivas.eeda@oracle.com>
> CC: Joe Jin <joe.jin@oracle.com>
> CC: Junxiao Bi <junxiao.bi@oracle.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Applied.
^ permalink raw reply
* Re: [BUG] kernel stack corruption during/after Netlabel error
From: Casey Schaufler @ 2017-11-30 14:33 UTC (permalink / raw)
To: Eric Dumazet, James Morris
Cc: Paul Moore, netdev, Stephen Smalley, selinux, LSM
In-Reply-To: <1512039044.19682.12.camel@gmail.com>
On 11/30/2017 2:50 AM, Eric Dumazet wrote:
> On Wed, 2017-11-29 at 19:16 -0800, Casey Schaufler wrote:
>> On 11/29/2017 4:31 PM, James Morris wrote:
>>> On Wed, 29 Nov 2017, Casey Schaufler wrote:
>>>
>>>> I see that there is a proposed fix later in the thread, but I
>>>> don't see
>>>> the patch. Could you send it to me, so I can try it on my
>>>> problem?
>>> Forwarded off-list.
>> The patch does fix the problem I was seeing in Smack.
> Can you guys test the following more complete patch ?
Building now. I should have results soon.
>
> It should cover IPv4 and IPv6, and also the corner cases.
>
> ( Note that I squashed ipv6 fix in https://patchwork.ozlabs.org/patch/8
> 42844/ that I spotted while cooking this patch )
>
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index c6bc0c4d19c624888b0d0b5a4246c7183edf63f5..77ea45da0fe9c746907a312989658af3ad3b198d 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1591,6 +1591,34 @@ int tcp_filter(struct sock *sk, struct sk_buff *skb)
> }
> EXPORT_SYMBOL(tcp_filter);
>
> +static void tcp_v4_restore_cb(struct sk_buff *skb)
> +{
> + memmove(IPCB(skb), &TCP_SKB_CB(skb)->header.h4,
> + sizeof(struct inet_skb_parm));
> +}
> +
> +static void tcp_v4_fill_cb(struct sk_buff *skb, const struct iphdr *iph,
> + const struct tcphdr *th)
> +{
> + /* This is tricky : We move IPCB at its correct location into TCP_SKB_CB()
> + * barrier() makes sure compiler wont play fool^Waliasing games.
> + */
> + memmove(&TCP_SKB_CB(skb)->header.h4, IPCB(skb),
> + sizeof(struct inet_skb_parm));
> + barrier();
> +
> + TCP_SKB_CB(skb)->seq = ntohl(th->seq);
> + TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin +
> + skb->len - th->doff * 4);
> + TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq);
> + TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th);
> + TCP_SKB_CB(skb)->tcp_tw_isn = 0;
> + TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph);
> + TCP_SKB_CB(skb)->sacked = 0;
> + TCP_SKB_CB(skb)->has_rxtstamp =
> + skb->tstamp || skb_hwtstamps(skb)->hwtstamp;
> +}
> +
> /*
> * From tcp_input.c
> */
> @@ -1631,24 +1659,6 @@ int tcp_v4_rcv(struct sk_buff *skb)
>
> th = (const struct tcphdr *)skb->data;
> iph = ip_hdr(skb);
> - /* This is tricky : We move IPCB at its correct location into TCP_SKB_CB()
> - * barrier() makes sure compiler wont play fool^Waliasing games.
> - */
> - memmove(&TCP_SKB_CB(skb)->header.h4, IPCB(skb),
> - sizeof(struct inet_skb_parm));
> - barrier();
> -
> - TCP_SKB_CB(skb)->seq = ntohl(th->seq);
> - TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin +
> - skb->len - th->doff * 4);
> - TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq);
> - TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th);
> - TCP_SKB_CB(skb)->tcp_tw_isn = 0;
> - TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph);
> - TCP_SKB_CB(skb)->sacked = 0;
> - TCP_SKB_CB(skb)->has_rxtstamp =
> - skb->tstamp || skb_hwtstamps(skb)->hwtstamp;
> -
> lookup:
> sk = __inet_lookup_skb(&tcp_hashinfo, skb, __tcp_hdrlen(th), th->source,
> th->dest, sdif, &refcounted);
> @@ -1679,14 +1689,19 @@ int tcp_v4_rcv(struct sk_buff *skb)
> sock_hold(sk);
> refcounted = true;
> nsk = NULL;
> - if (!tcp_filter(sk, skb))
> + if (!tcp_filter(sk, skb)) {
> + th = (const struct tcphdr *)skb->data;
> + iph = ip_hdr(skb);
> + tcp_v4_fill_cb(skb, iph, th);
> nsk = tcp_check_req(sk, skb, req, false);
> + }
> if (!nsk) {
> reqsk_put(req);
> goto discard_and_relse;
> }
> if (nsk == sk) {
> reqsk_put(req);
> + tcp_v4_restore_cb(skb);
> } else if (tcp_child_process(sk, nsk, skb)) {
> tcp_v4_send_reset(nsk, skb);
> goto discard_and_relse;
> @@ -1712,6 +1727,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
> goto discard_and_relse;
> th = (const struct tcphdr *)skb->data;
> iph = ip_hdr(skb);
> + tcp_v4_fill_cb(skb, iph, th);
>
> skb->dev = NULL;
>
> @@ -1742,6 +1758,8 @@ int tcp_v4_rcv(struct sk_buff *skb)
> if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
> goto discard_it;
>
> + tcp_v4_fill_cb(skb, iph, th);
> +
> if (tcp_checksum_complete(skb)) {
> csum_error:
> __TCP_INC_STATS(net, TCP_MIB_CSUMERRORS);
> @@ -1768,6 +1786,8 @@ int tcp_v4_rcv(struct sk_buff *skb)
> goto discard_it;
> }
>
> + tcp_v4_fill_cb(skb, iph, th);
> +
> if (tcp_checksum_complete(skb)) {
> inet_twsk_put(inet_twsk(sk));
> goto csum_error;
> @@ -1784,6 +1804,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
> if (sk2) {
> inet_twsk_deschedule_put(inet_twsk(sk));
> sk = sk2;
> + tcp_v4_restore_cb(skb);
> refcounted = false;
> goto process;
> }
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 6bb98c93edfe2ed2f16fe5229605f8108cfc7f9a..1f04ec0e4a7aa2c11b8ee27cbdd4067b5bcf32e5 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -1454,7 +1454,6 @@ static int tcp_v6_rcv(struct sk_buff *skb)
> struct sock *nsk;
>
> sk = req->rsk_listener;
> - tcp_v6_fill_cb(skb, hdr, th);
> if (tcp_v6_inbound_md5_hash(sk, skb)) {
> sk_drops_add(sk, skb);
> reqsk_put(req);
> @@ -1467,8 +1466,12 @@ static int tcp_v6_rcv(struct sk_buff *skb)
> sock_hold(sk);
> refcounted = true;
> nsk = NULL;
> - if (!tcp_filter(sk, skb))
> + if (!tcp_filter(sk, skb)) {
> + th = (const struct tcphdr *)skb->data;
> + hdr = ipv6_hdr(skb);
> + tcp_v6_fill_cb(skb, hdr, th);
> nsk = tcp_check_req(sk, skb, req, false);
> + }
> if (!nsk) {
> reqsk_put(req);
> goto discard_and_relse;
> @@ -1492,8 +1495,6 @@ static int tcp_v6_rcv(struct sk_buff *skb)
> if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb))
> goto discard_and_relse;
>
> - tcp_v6_fill_cb(skb, hdr, th);
> -
> if (tcp_v6_inbound_md5_hash(sk, skb))
> goto discard_and_relse;
>
> @@ -1501,6 +1502,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
> goto discard_and_relse;
> th = (const struct tcphdr *)skb->data;
> hdr = ipv6_hdr(skb);
> + tcp_v6_fill_cb(skb, hdr, th);
>
> skb->dev = NULL;
>
> @@ -1590,7 +1592,6 @@ static int tcp_v6_rcv(struct sk_buff *skb)
> tcp_v6_timewait_ack(sk, skb);
> break;
> case TCP_TW_RST:
> - tcp_v6_restore_cb(skb);
> tcp_v6_send_reset(sk, skb);
> inet_twsk_deschedule_put(inet_twsk(sk));
> goto discard_it;
>
>
>
>
^ permalink raw reply
* Re: [PATCH] atm: lanai: use setup_timer instead of init_timer
From: Colin Ian King @ 2017-11-30 14:30 UTC (permalink / raw)
To: David Miller
Cc: 3chas3, linux-atm-general, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20171130.092337.1169504726284026440.davem@davemloft.net>
On 30/11/17 14:23, David Miller wrote:
> From: Colin King <colin.king@canonical.com>
> Date: Fri, 24 Nov 2017 13:27:12 +0000
>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Use setup_timer function instead of initializing timer with the
>> function and data fields.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> setup_timer() == -ENOEXIST.
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Apologies. My bad.
Colin
^ permalink raw reply
* net-next is OPEN....
From: David Miller @ 2017-11-30 14:29 UTC (permalink / raw)
To: netdev
I know you can crush me with your barrage of patches, let's do it!
^ permalink raw reply
* Re: [PATCH] atm: mpoa: remove 32-bit timekeeping
From: David Miller @ 2017-11-30 14:27 UTC (permalink / raw)
To: arnd
Cc: y2038, 3chas3, linux-atm-general, ruchandani.tina, netdev,
linux-kernel
In-Reply-To: <20171127140337.3622068-1-arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 27 Nov 2017 15:02:17 +0100
> From: Tina Ruchandani <ruchandani.tina@gmail.com>
>
> net/atm/mpoa_* files use 'struct timeval' to store event
> timestamps. struct timeval uses a 32-bit seconds field which will
> overflow in the year 2038 and beyond. Morever, the timestamps are being
> compared only to get seconds elapsed, so struct timeval which stores
> a seconds and microseconds field is an overkill. This patch replaces
> the use of struct timeval with time64_t to store a 64-bit seconds field.
>
> Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied.
^ permalink raw reply
* Re: [PATCH] atm: eni: fix several indentation issues
From: David Miller @ 2017-11-30 14:27 UTC (permalink / raw)
To: colin.king
Cc: 3chas3, linux-atm-general, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20171127131510.10500-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Mon, 27 Nov 2017 13:15:10 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> There are several statements that have incorrect indentation. Fix
> these.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply
* Re: [PATCH] openvswitch: use ktime_get_ts64() instead of ktime_get_ts()
From: David Miller @ 2017-11-30 14:27 UTC (permalink / raw)
To: arnd-r2nGTMty4D4
Cc: dev-yBygre7rU0TnMu66kgdUjQ, willemb-hpIqsD4AKlfQT0dZR+AlfA,
y2038-cunTk1MwBs8s++Sfvej+rw, netdev-u79uwXL29TY76Z2rM5mHXA,
jbenc-H+wXaHxf7aLQT0dZR+AlfA, pshelar-l0M0P4e3n4LQT0dZR+AlfA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20171127114159.2528123-1-arnd-r2nGTMty4D4@public.gmane.org>
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Date: Mon, 27 Nov 2017 12:41:38 +0100
> timespec is deprecated because of the y2038 overflow, so let's convert
> this one to ktime_get_ts64(). The code is already safe even on 32-bit
> architectures, since it uses monotonic times. On 64-bit architectures,
> nothing changes, while on 32-bit architectures this avoids one
> type conversion.
>
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Applied.
^ permalink raw reply
* Re: [PATCH] netxen: remove timespec usage
From: David Miller @ 2017-11-30 14:27 UTC (permalink / raw)
To: arnd
Cc: manish.chopra, rahul.verma, Dept-GELinuxNICDev, y2038, netdev,
linux-kernel
In-Reply-To: <20171127114008.2467872-1-arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 27 Nov 2017 12:39:57 +0100
> netxen_collect_minidump() evidently just wants to get a monotonic
> timestamp. Using jiffies_to_timespec(jiffies, &ts) is not
> appropriate here, since it will overflow after 2^32 jiffies,
> which may be as short as 49 days of uptime.
>
> ktime_get_seconds() is the correct interface here.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied.
^ permalink raw reply
* Re: [PATCH RESEND] net: phy: harmonize phy_id{,_mask} data type
From: David Miller @ 2017-11-30 14:26 UTC (permalink / raw)
To: dev; +Cc: f.fainelli, andrew, netdev, linux-kernel, richard.leitner
In-Reply-To: <20171127071645.27077-1-dev@g0hl1n.net>
From: Richard Leitner <dev@g0hl1n.net>
Date: Mon, 27 Nov 2017 08:16:45 +0100
> From: Richard Leitner <richard.leitner@skidata.com>
>
> Previously phy_id was u32 and phy_id_mask was unsigned int. As the
> phy_id_mask defines the important bits of the phy_id (and is therefore
> the same size) these two variables should be the same data type.
>
> Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Applied.
^ permalink raw reply
* Re: [PATCH] net: ethernet: davinci_emac: Deduplicate bus_find_device() by name matching
From: David Miller @ 2017-11-30 14:24 UTC (permalink / raw)
To: lukas; +Cc: grygorii.strashko, linux-omap, netdev
In-Reply-To: <4cc7d22afdb1d511cef489b3c6b498270bd5caff.1511608500.git.lukas@wunner.de>
From: Lukas Wunner <lukas@wunner.de>
Date: Sat, 25 Nov 2017 12:18:19 +0100
> No need to reinvent the wheel, we have bus_find_device_by_name().
>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: thunderx: Set max queue count taking XDP_TX into account
From: David Miller @ 2017-11-30 14:24 UTC (permalink / raw)
To: aleksey.makarov
Cc: netdev, linux-kernel, Sunil.Goutham, rric, cjacob, sgoutham,
linux-arm-kernel
In-Reply-To: <20171124120411.7660-1-aleksey.makarov@cavium.com>
From: Aleksey Makarov <aleksey.makarov@cavium.com>
Date: Fri, 24 Nov 2017 15:04:03 +0300
> From: Sunil Goutham <sgoutham@cavium.com>
>
> on T81 there are only 4 cores, hence setting max queue count to 4
> would leave nothing for XDP_TX. This patch fixes this by doubling
> max queue count in above scenarios.
>
> Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
> Signed-off-by: cjacob <cjacob@caviumnetworks.com>
> Signed-off-by: Aleksey Makarov <aleksey.makarov@cavium.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: thunderx: Add support for xdp redirect
From: David Miller @ 2017-11-30 14:24 UTC (permalink / raw)
To: aleksey.makarov
Cc: netdev, linux-kernel, Sunil.Goutham, rric, cjacob, sgoutham,
linux-arm-kernel
In-Reply-To: <20171124120328.7600-1-aleksey.makarov@cavium.com>
From: Aleksey Makarov <aleksey.makarov@cavium.com>
Date: Fri, 24 Nov 2017 15:03:26 +0300
> From: Sunil Goutham <sgoutham@cavium.com>
>
> This patch adds support for XDP_REDIRECT. Flush is not
> yet supported.
>
> Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
> Signed-off-by: cjacob <cjacob@caviumnetworks.com>
> Signed-off-by: Aleksey Makarov <aleksey.makarov@cavium.com>
Applied.
^ permalink raw reply
* Re: [PATCH] atm: lanai: use setup_timer instead of init_timer
From: David Miller @ 2017-11-30 14:23 UTC (permalink / raw)
To: colin.king
Cc: 3chas3, linux-atm-general, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20171124132712.31882-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Fri, 24 Nov 2017 13:27:12 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> Use setup_timer function instead of initializing timer with the
> function and data fields.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
setup_timer() == -ENOEXIST.
^ permalink raw reply
* Re: [PATCH] atm: firestream: use setup_timer instead of init_timer
From: David Miller @ 2017-11-30 14:23 UTC (permalink / raw)
To: colin.king
Cc: 3chas3, linux-atm-general, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20171124131345.31421-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Fri, 24 Nov 2017 13:13:45 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> Use setup_timer function instead of initializing timer with the
> function and data fields.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Likewise about setup_timer() no longer existing.
^ permalink raw reply
* Re: [PATCH] atm: nicstar: use the setup_timer helper
From: David Miller @ 2017-11-30 14:23 UTC (permalink / raw)
To: colin.king
Cc: 3chas3, linux-atm-general, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20171124085925.25967-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Fri, 24 Nov 2017 08:59:25 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> Replace init_timer and two explicit assignments with the setup_timer
> helper.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
setup_timer() no longer even exists in the tree.
^ permalink raw reply
* Re: [PATCH/trivial] skbuff: Grammar s/are can/can/, s/change/changes/
From: David Miller @ 2017-11-30 14:19 UTC (permalink / raw)
To: geert+renesas; +Cc: trivial, netdev, linux-kernel
In-Reply-To: <1512048836-18578-1-git-send-email-geert+renesas@glider.be>
From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Thu, 30 Nov 2017 14:33:56 +0100
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Applied, thanks Geert.
^ permalink raw reply
* Re: [PATCH net] net: mvpp2: allocate zeroed tx descriptors
From: David Miller @ 2017-11-30 14:14 UTC (permalink / raw)
To: antoine.tenart
Cc: ymarkman, gregory.clement, thomas.petazzoni, miquel.raynal,
nadavh, mw, stefanc, netdev, linux-kernel
In-Reply-To: <20171130094946.26647-1-antoine.tenart@free-electrons.com>
From: Antoine Tenart <antoine.tenart@free-electrons.com>
Date: Thu, 30 Nov 2017 10:49:46 +0100
> From: Yan Markman <ymarkman@marvell.com>
>
> Reserved and unused fields in the Tx descriptors should be 0. The PPv2
> driver doesn't clear them at run-time (for performance reasons) but
> these descriptors aren't zeroed when allocated, which can lead to
> unpredictable behaviors. This patch fixes this by using
> dma_zalloc_coherent instead of dma_alloc_coherent.
>
> Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
> Signed-off-by: Yan Markman <ymarkman@marvell.com>
> [Antoine: commit message]
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Applied, thank you.
^ permalink raw reply
* Re: [RFC] virtio-net: help live migrate SR-IOV devices
From: Michael S. Tsirkin @ 2017-11-30 14:14 UTC (permalink / raw)
To: Jason Wang
Cc: Jesse Brandeburg, virtualization, Jakub Kicinski,
Sridhar Samudrala, Achiad, Peter Waskiewicz Jr, Singhai, Anjali,
Andy Gospodarek, Or Gerlitz, Hannes Frederic Sowa, netdev
In-Reply-To: <0fb552d4-1bfc-e130-4fc1-87b83873916d@redhat.com>
On Thu, Nov 30, 2017 at 11:29:56AM +0800, Jason Wang wrote:
> If my understanding is correct there's no need to for any extension of
> virtio spec.
There appears to be a concern that some existing configurations
might use same MAC for an unrelated reason. Not sure what
that could be, but for sure, we could add a feature flag.
That needs to be approved by the virtio TC, but it's
just a single line in the spec no big deal, we can help here.
> If this is true, maybe you can start to prepare the patch?
Yes, please do. We can add a safeguard of a feature bit on top.
--
MST
^ permalink raw reply
* Re: [RFC] virtio-net: help live migrate SR-IOV devices
From: Michael S. Tsirkin @ 2017-11-30 14:11 UTC (permalink / raw)
To: achiad shochat
Cc: Jason Wang, Jesse Brandeburg, virtualization, Jakub Kicinski,
Sridhar Samudrala, Achiad, Peter Waskiewicz Jr, Singhai, Anjali,
Andy Gospodarek, Or Gerlitz, Hannes Frederic Sowa, netdev
In-Reply-To: <CAEHy93LneRXNWo64uyN2dfyDX6t18WN+YwVF2RXXLRnr0=Jhww@mail.gmail.com>
On Thu, Nov 30, 2017 at 10:08:45AM +0200, achiad shochat wrote:
> Re. problem #2:
> Indeed the best way to address it seems to be to enslave the VF driver
> netdev under a persistent anchor netdev.
> And it's indeed desired to allow (but not enforce) PV netdev and VF
> netdev to work in conjunction.
> And it's indeed desired that this enslavement logic work out-of-the box.
> But in case of PV+VF some configurable policies must be in place (and
> they'd better be generic rather than differ per PV technology).
> For example - based on which characteristics should the PV+VF coupling
> be done? netvsc uses MAC address, but that might not always be the
> desire.
It's a policy but not guest userspace policy.
The hypervisor certainly knows.
Are you concerned that someone might want to create two devices with the
same MAC for an unrelated reason? If so, hypervisor could easily set a
flag in the virtio device to say "this is a backup, use MAC to find
another device".
> Another example - when to use PV and when to use VF? One may want to
> use PV only if VF is gone/down, while others may want to use PV also
> when VF is up, e.g for multicasting.
There are a bunch of configurations where these two devices share
the same physical backend. In that case there is no point
in multicasting through both devices, in fact, PV might
not even work at all when passthrough is active.
IMHO these cases are what's worth handling in the kernel.
When there are two separate backends, we are getting into policy and
it's best to leave this to userspace (and it's unlikely network manager
will automatically do the right thing here, either).
> I think the right way to address it is to have a new dedicated module
> for this purpose.
> Have it automatically enslave PV and VF netdevs according to user
> configured policy. Enslave the VF even if there is no PV device at
> all.
>
> This way we get:
> 1) Optimal migration performance
This remains to be proved.
> 2) A PV agnostic (VM may be migrated even from one PV technology to
> another)
Yes - in theory kvm could expose both a virtio and a hyperv device. But what
would be the point? Just do the abstraction in the hypervisor.
> and HW device agnostic solution
That's useful but I don't think we need to involve userspace for that.
HW abstraction is kernel's job.
> A dedicated generic module will also enforce a lower common
> denominator of guest netdev features, preventing migration dependency
> on source/guest machine capabilities.
If all we are discussing is where this code should live, then I
do not really care. Let's implement it in virtio, then if we
find we have a lot of common we can factor it out.
> 3) Out-of-the box solution yet with generic methods for policy setting
>
>
> Thanks
There's no real policy that guest can set though. All setting happens
on the hypervisor side.
--
MST
^ permalink raw reply
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