From: Jakub Kicinski Date: Sat, 19 Jun 2021 02:47:02 +0000 (-0700) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=adc2e56ebe6377f5c032d96aee0feac30a640453;p=linux.git Merge git://git./linux/kernel/git/netdev/net Trivial conflicts in net/can/isotp.c and tools/testing/selftests/net/mptcp/mptcp_connect.sh scaled_ppm_to_ppb() was moved from drivers/ptp/ptp_clock.c to include/linux/ptp_clock_kernel.h in -next so re-apply the fix there. Signed-off-by: Jakub Kicinski --- adc2e56ebe6377f5c032d96aee0feac30a640453 diff --cc include/linux/ptp_clock_kernel.h index a311bddd9e859,51d7f1b8b32aa..aba237c0b3a21 --- a/include/linux/ptp_clock_kernel.h +++ b/include/linux/ptp_clock_kernel.h @@@ -186,32 -186,6 +186,32 @@@ struct ptp_clock_event }; }; +/** + * scaled_ppm_to_ppb() - convert scaled ppm to ppb + * + * @ppm: Parts per million, but with a 16 bit binary fractional field + */ - static inline s32 scaled_ppm_to_ppb(long ppm) ++static inline long scaled_ppm_to_ppb(long ppm) +{ + /* + * The 'freq' field in the 'struct timex' is in parts per + * million, but with a 16 bit binary fractional field. + * + * We want to calculate + * + * ppb = scaled_ppm * 1000 / 2^16 + * + * which simplifies to + * + * ppb = scaled_ppm * 125 / 2^13 + */ + s64 ppb = 1 + ppm; + + ppb *= 125; + ppb >>= 13; - return (s32)ppb; ++ return (long)ppb; +} + #if IS_REACHABLE(CONFIG_PTP_1588_CLOCK) /** diff --cc net/can/isotp.c index f995eaef5d7b5,be6183f8ca110..bd49299319a13 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@@ -1452,7 -1482,9 +1484,9 @@@ static __init int isotp_module_init(voi err = can_proto_register(&isotp_can_proto); if (err < 0) - pr_err("can: registration of isotp protocol failed\n"); + pr_err("can: registration of isotp protocol failed %pe\n", ERR_PTR(err)); + else + register_netdevice_notifier(&canisotp_notifier); return err; } diff --cc net/mptcp/protocol.c index 42fc7187beeef,632350018fb66..b5f2f504b85bb --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@@ -286,15 -280,15 +286,17 @@@ static bool __mptcp_move_skb(struct mpt /* try to fetch required memory from subflow */ if (!sk_rmem_schedule(sk, skb, skb->truesize)) { - if (ssk->sk_forward_alloc < skb->truesize) - goto drop; - __sk_mem_reclaim(ssk, skb->truesize); - if (!sk_rmem_schedule(sk, skb, skb->truesize)) + int amount = sk_mem_pages(skb->truesize) << SK_MEM_QUANTUM_SHIFT; + + if (ssk->sk_forward_alloc < amount) goto drop; + + ssk->sk_forward_alloc -= amount; + sk->sk_forward_alloc += amount; } + has_rxtstamp = TCP_SKB_CB(skb)->has_rxtstamp; + /* the skb map_seq accounts for the skb offset: * mptcp_subflow_get_mapped_dsn() is based on the current tp->copied_seq * value diff --cc tools/testing/selftests/net/mptcp/mptcp_connect.sh index 69351c3eb68c5,2b495dc8d78ec..2484fb6a9a8df --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@@ -202,15 -197,6 +202,12 @@@ ip -net "$ns4" link set ns4eth3 u ip -net "$ns4" route add default via 10.0.3.2 ip -net "$ns4" route add default via dead:beef:3::2 - # use TCP syn cookies, even if no flooding was detected. - ip netns exec "$ns2" sysctl -q net.ipv4.tcp_syncookies=2 - +if $checksum; then + for i in "$ns1" "$ns2" "$ns3" "$ns4";do + ip netns exec $i sysctl -q net.mptcp.checksum_enabled=1 + done +fi + set_ethtool_flags() { local ns="$1" local dev="$2"