The following commit has been merged in the master branch: commit 32848c71f0bf18a8478453e6566467843e2fd58a Merge: 72bb42a2e1bd5aad7ea0e87ab8396d894c72857e cddaf02bcb7313a23b06e46683a1381b85840687 Author: Stephen Rothwell sfr@canb.auug.org.au Date: Mon Nov 19 11:27:15 2018 +1100
Merge remote-tracking branch 'net-next/master'
diff --combined MAINTAINERS index d0c567d39f3b,3bd775ba51ce..6a79dc9f3502 --- a/MAINTAINERS +++ b/MAINTAINERS @@@ -717,7 -717,7 +717,7 @@@ F: include/linux/mfd/altera-a10sr. F: include/dt-bindings/reset/altr,rst-mgr-a10sr.h
ALTERA TRIPLE SPEED ETHERNET DRIVER -M: Vince Bridgers vbridger@opensource.altera.com +M: Thor Thayer thor.thayer@linux.intel.com L: netdev@vger.kernel.org L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers) S: Maintained @@@ -2869,6 -2869,7 +2869,6 @@@ F: arch/mips/include/asm/mach-bcm47xx/ BROADCOM BCM5301X ARM ARCHITECTURE M: Hauke Mehrtens hauke@hauke-m.de M: Rafał Miłecki zajec5@gmail.com -M: Jon Mason jonmason@broadcom.com M: bcm-kernel-feedback-list@broadcom.com L: linux-arm-kernel@lists.infradead.org S: Maintained @@@ -3014,6 -3015,7 +3014,6 @@@ F: drivers/net/ethernet/broadcom/genet BROADCOM IPROC ARM ARCHITECTURE M: Ray Jui rjui@broadcom.com M: Scott Branden sbranden@broadcom.com -M: Jon Mason jonmason@broadcom.com M: bcm-kernel-feedback-list@broadcom.com L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) T: git git://github.com/broadcom/cygnus-linux.git @@@ -3274,12 -3276,6 +3274,12 @@@ F: include/uapi/linux/caif F: include/net/caif/ F: net/caif/
+CAKE QDISC +M: Toke Høiland-Jørgensen toke@toke.dk +L: cake@lists.bufferbloat.net (moderated for non-subscribers) +S: Maintained +F: net/sched/sch_cake.c + CALGARY x86-64 IOMMU M: Muli Ben-Yehuda mulix@mulix.org M: Jon Mason jdmason@kudzu.us @@@ -6193,7 -6189,6 +6193,7 @@@ T: git git://git.kernel.org/pub/scm/lin S: Supported F: drivers/phy/ F: include/linux/phy/ +F: Documentation/devicetree/bindings/phy/
GENERIC PINCTRL I2C DEMULTIPLEXER DRIVER M: Wolfram Sang wsa+renesas@sang-engineering.com @@@ -6994,23 -6989,6 +6994,23 @@@ L: linux-i2c@vger.kernel.or S: Maintained F: drivers/i2c/i2c-stub.c
+I3C SUBSYSTEM +M: Boris Brezillon boris.brezillon@bootlin.com +T: git git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux.git +S: Maintained +F: Documentation/ABI/testing/sysfs-bus-i3c +F: Documentation/devicetree/bindings/i3c/ +F: Documentation/driver-api/i3c +F: drivers/i3c/ +F: include/linux/i3c/ +F: include/dt-bindings/i3c/ + +I3C DRIVER FOR SYNOPSYS DESIGNWARE +M: Vitor Soares vitor.soares@synopsys.com +S: Maintained +F: Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt +F: drivers/i3c/master/dw* + IA64 (Itanium) PLATFORM M: Tony Luck tony.luck@intel.com M: Fenghua Yu fenghua.yu@intel.com @@@ -7872,13 -7850,6 +7872,6 @@@ F: include/linux/isdn F: include/uapi/linux/isdn.h F: include/uapi/linux/isdn/
- ISDN SUBSYSTEM (Eicon active card driver) - M: Armin Schindler mac@melware.de - L: isdn4linux@listserv.isdn4linux.de (subscribers-only) - W: http://www.melware.de - S: Maintained - F: drivers/isdn/hardware/eicon/ - IT87 HARDWARE MONITORING DRIVER M: Jean Delvare jdelvare@suse.com L: linux-hwmon@vger.kernel.org @@@ -10708,6 -10679,14 +10701,14 @@@ L: linux-nfc@lists.01.org (moderated fo S: Supported F: drivers/nfc/nxp-nci
+ OBJAGG + M: Jiri Pirko jiri@mellanox.com + L: netdev@vger.kernel.org + S: Supported + F: lib/objagg.c + F: lib/test_objagg.c + F: include/linux/objagg.h + OBJTOOL M: Josh Poimboeuf jpoimboe@redhat.com M: Peter Zijlstra peterz@infradead.org @@@ -10830,9 -10809,9 +10831,9 @@@ F: drivers/media/platform/omap3isp F: drivers/staging/media/omap4iss/
OMAP MMC SUPPORT -M: Jarkko Lavinen jarkko.lavinen@nokia.com +M: Aaro Koskinen aaro.koskinen@iki.fi L: linux-omap@vger.kernel.org -S: Maintained +S: Odd Fixes F: drivers/mmc/host/omap.c
OMAP POWER MANAGEMENT SUPPORT @@@ -11767,7 -11746,6 +11768,7 @@@ F: Documentation/devicetree/bindings/pi PIN CONTROLLER - INTEL M: Mika Westerberg mika.westerberg@linux.intel.com M: Andy Shevchenko andriy.shevchenko@linux.intel.com +T: git git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git S: Maintained F: drivers/pinctrl/intel/
@@@ -12397,13 -12375,6 +12398,13 @@@ L: linux-arm-msm@vger.kernel.or S: Maintained F: drivers/iommu/qcom_iommu.c
+QUALCOMM TSENS THERMAL DRIVER +M: Amit Kucheria amit.kucheria@linaro.org +L: linux-pm@vger.kernel.org +L: linux-arm-msm@vger.kernel.org +S: Maintained +F: drivers/thermal/qcom/ + QUALCOMM VENUS VIDEO ACCELERATOR DRIVER M: Stanimir Varbanov stanimir.varbanov@linaro.org L: linux-media@vger.kernel.org @@@ -13868,14 -13839,6 +13869,14 @@@ S: Maintaine F: drivers/ssb/ F: include/linux/ssb/
+SONY IMX214 SENSOR DRIVER +M: Ricardo Ribalda ricardo.ribalda@gmail.com +L: linux-media@vger.kernel.org +T: git git://linuxtv.org/media_tree.git +S: Maintained +F: drivers/media/i2c/imx214.c +F: Documentation/devicetree/bindings/media/i2c/sony,imx214.txt + SONY IMX258 SENSOR DRIVER M: Sakari Ailus sakari.ailus@linux.intel.com L: linux-media@vger.kernel.org diff --combined drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index d49db46254cd,956e708c777d..649bf7c586c1 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@@ -2295,6 -2295,8 +2295,8 @@@ static int cxgb_up(struct adapter *adap
static void cxgb_down(struct adapter *adapter) { + struct hash_mac_addr *entry, *tmp; + cancel_work_sync(&adapter->tid_release_task); cancel_work_sync(&adapter->db_full_task); cancel_work_sync(&adapter->db_drop_task); @@@ -2303,6 -2305,12 +2305,12 @@@
t4_sge_stop(adapter); t4_free_sge_resources(adapter); + + list_for_each_entry_safe(entry, tmp, &adapter->mac_hlist, list) { + list_del(&entry->list); + kfree(entry); + } + adapter->flags &= ~FULL_INIT_DONE; }
@@@ -5863,7 -5871,7 +5871,7 @@@ fw_attach_fail if (!is_t4(adapter->params.chip)) cxgb4_ptp_init(adapter);
- if (IS_ENABLED(CONFIG_THERMAL) && + if (IS_REACHABLE(CONFIG_THERMAL) && !is_t4(adapter->params.chip) && (adapter->flags & FW_OK)) cxgb4_thermal_init(adapter);
@@@ -5932,7 -5940,7 +5940,7 @@@ static void remove_one(struct pci_dev *
if (!is_t4(adapter->params.chip)) cxgb4_ptp_stop(adapter); - if (IS_ENABLED(CONFIG_THERMAL)) + if (IS_REACHABLE(CONFIG_THERMAL)) cxgb4_thermal_remove(adapter);
/* If we allocated filters, free up state associated with any diff --combined lib/Kconfig.debug index 60750a72cbe2,b3c91b9e32f8..f27f20e45547 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@@ -211,23 -211,6 +211,23 @@@ config GDB_SCRIPT instance. See Documentation/dev-tools/gdb-kernel-debugging.rst for further details.
+config NO_AUTO_INLINE + bool "Disable compiler auto-inline optimizations" + help + This will prevent the compiler from optimizing the kernel by + auto-inlining functions not marked with the inline keyword. + With this option, only functions explicitly marked with + "inline" will be inlined. This will allow the function tracer + to trace more functions because it only traces functions that + the compiler has not inlined. + + Enabling this function can help debugging a kernel if using + the function tracer. But it can also change how the kernel + works, because inlining functions may change the timing, + which could make it difficult while debugging race conditions. + + If unsure, select N. + config ENABLE_MUST_CHECK bool "Enable __must_check logic" default y @@@ -1993,6 -1976,16 +1993,16 @@@ config TEST_MEMCAT_
If unsure, say N.
+ config TEST_OBJAGG + tristate "Perform selftest on object aggreration manager" + default n + depends on OBJAGG + help + Enable this option to test object aggregation manager on boot + (or module load). + + If unsure, say N. + endif # RUNTIME_TESTING_MENU
config MEMTEST diff --combined net/bridge/br_private.h index 04c19a37e500,67105c66584a..bc2653738fc3 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@@ -102,18 -102,12 +102,18 @@@ struct br_tunnel_info struct metadata_dst *tunnel_dst; };
+/* private vlan flags */ +enum { + BR_VLFLAG_PER_PORT_STATS = BIT(0), +}; + /** * struct net_bridge_vlan - per-vlan entry * * @vnode: rhashtable member * @vid: VLAN id * @flags: bridge vlan flags + * @priv_flags: private (in-kernel) bridge vlan flags * @stats: per-cpu VLAN statistics * @br: if MASTER flag set, this points to a bridge struct * @port: if MASTER flag unset, this points to a port struct @@@ -133,7 -127,6 +133,7 @@@ struct net_bridge_vlan struct rhash_head tnode; u16 vid; u16 flags; + u16 priv_flags; struct br_vlan_stats __percpu *stats; union { struct net_bridge *br; @@@ -912,7 -905,7 +912,7 @@@ static inline int br_vlan_get_tag(cons int err = 0;
if (skb_vlan_tag_present(skb)) { - *vid = skb_vlan_tag_get(skb) & VLAN_VID_MASK; + *vid = skb_vlan_tag_get_id(skb); } else { *vid = 0; err = -EINVAL; diff --combined net/bridge/br_vlan.c index e84be08b8285,a7e869da21bf..b21838b51220 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@@ -197,7 -197,7 +197,7 @@@ static void nbp_vlan_rcu_free(struct rc v = container_of(rcu, struct net_bridge_vlan, rcu); WARN_ON(br_vlan_is_master(v)); /* if we had per-port stats configured then free them here */ - if (v->brvlan->stats != v->stats) + if (v->priv_flags & BR_VLFLAG_PER_PORT_STATS) free_percpu(v->stats); v->stats = NULL; kfree(v); @@@ -264,7 -264,6 +264,7 @@@ static int __vlan_add(struct net_bridge err = -ENOMEM; goto out_filt; } + v->priv_flags |= BR_VLFLAG_PER_PORT_STATS; } else { v->stats = masterv->stats; } @@@ -421,7 -420,7 +421,7 @@@ struct sk_buff *br_handle_vlan(struct n }
if (v->flags & BRIDGE_VLAN_INFO_UNTAGGED) - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb);
if (p && (p->flags & BR_VLAN_TUNNEL) && br_handle_egress_vlan_tunnel(skb, v)) { @@@ -494,8 -493,8 +494,8 @@@ static bool __allowed_ingress(const str __vlan_hwaccel_put_tag(skb, br->vlan_proto, pvid); else /* Priority-tagged Frame. - * At this point, We know that skb->vlan_tci had - * VLAN_TAG_PRESENT bit and its VID field was 0x000. + * At this point, we know that skb->vlan_tci VID + * field was 0. * We update only VID field and preserve PCP field. */ skb->vlan_tci |= pvid; diff --combined net/core/dev.c index 066aa902d85c,5927f6a7c301..f2bfd2eda7b2 --- a/net/core/dev.c +++ b/net/core/dev.c @@@ -3091,10 -3091,17 +3091,17 @@@ EXPORT_SYMBOL(__skb_gso_segment)
/* Take action when hardware reception checksum errors are detected. */ #ifdef CONFIG_BUG - void netdev_rx_csum_fault(struct net_device *dev) + void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb) { if (net_ratelimit()) { pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>"); + if (dev) + pr_err("dev features: %pNF\n", &dev->features); + pr_err("skb len=%u data_len=%u pkt_type=%u gso_size=%u gso_type=%u nr_frags=%u ip_summed=%u csum=%x csum_complete_sw=%d csum_valid=%d csum_level=%u\n", + skb->len, skb->data_len, skb->pkt_type, + skb_shinfo(skb)->gso_size, skb_shinfo(skb)->gso_type, + skb_shinfo(skb)->nr_frags, skb->ip_summed, skb->csum, + skb->csum_complete_sw, skb->csum_valid, skb->csum_level); dump_stack(); } } @@@ -4889,7 -4896,7 +4896,7 @@@ skip_classify * and set skb->priority like in vlan_do_receive() * For the time being, just ignore Priority Code Point */ - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb); }
type = skb->protocol; @@@ -5386,7 -5393,9 +5393,9 @@@ static struct list_head *gro_list_prepa }
diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev; - diffs |= p->vlan_tci ^ skb->vlan_tci; + diffs |= skb_vlan_tag_present(p) ^ skb_vlan_tag_present(skb); + if (skb_vlan_tag_present(p)) + diffs |= p->vlan_tci ^ skb->vlan_tci; diffs |= skb_metadata_dst_cmp(p, skb); diffs |= skb_metadata_differs(p, skb); if (maclen == ETH_HLEN) @@@ -5652,13 -5661,9 +5661,13 @@@ static void napi_reuse_skb(struct napi_ __skb_pull(skb, skb_headlen(skb)); /* restore the reserve we had after netdev_alloc_skb_ip_align() */ skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb)); - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb); skb->dev = napi->dev; skb->skb_iif = 0; + + /* eth_type_trans() assumes pkt_type is PACKET_HOST */ + skb->pkt_type = PACKET_HOST; + skb->encapsulation = 0; skb_shinfo(skb)->gso_type = 0; skb->truesize = SKB_TRUESIZE(skb_end_offset(skb)); @@@ -5783,7 -5788,7 +5792,7 @@@ __sum16 __skb_gro_checksum_complete(str if (likely(!sum)) { if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE) && !skb->csum_complete_sw) - netdev_rx_csum_fault(skb->dev); + netdev_rx_csum_fault(skb->dev, skb); }
NAPI_GRO_CB(skb)->csum = wsum; diff --combined net/core/filter.c index 9a1327eb25fa,10acbc00ff6c..e462da7235e4 --- a/net/core/filter.c +++ b/net/core/filter.c @@@ -296,22 -296,18 +296,18 @@@ static u32 convert_skb_access(int skb_f break;
case SKF_AD_VLAN_TAG: - case SKF_AD_VLAN_TAG_PRESENT: BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2); - BUILD_BUG_ON(VLAN_TAG_PRESENT != 0x1000);
/* dst_reg = *(u16 *) (src_reg + offsetof(vlan_tci)) */ *insn++ = BPF_LDX_MEM(BPF_H, dst_reg, src_reg, offsetof(struct sk_buff, vlan_tci)); - if (skb_field == SKF_AD_VLAN_TAG) { - *insn++ = BPF_ALU32_IMM(BPF_AND, dst_reg, - ~VLAN_TAG_PRESENT); - } else { - /* dst_reg >>= 12 */ - *insn++ = BPF_ALU32_IMM(BPF_RSH, dst_reg, 12); - /* dst_reg &= 1 */ + break; + case SKF_AD_VLAN_TAG_PRESENT: + *insn++ = BPF_LDX_MEM(BPF_B, dst_reg, src_reg, PKT_VLAN_PRESENT_OFFSET()); + if (PKT_VLAN_PRESENT_BIT) + *insn++ = BPF_ALU32_IMM(BPF_RSH, dst_reg, PKT_VLAN_PRESENT_BIT); + if (PKT_VLAN_PRESENT_BIT < 7) *insn++ = BPF_ALU32_IMM(BPF_AND, dst_reg, 1); - } break; }
@@@ -4852,17 -4848,18 +4848,17 @@@ static struct sock *sk_lookup(struct ne } else { struct in6_addr *src6 = (struct in6_addr *)&tuple->ipv6.saddr; struct in6_addr *dst6 = (struct in6_addr *)&tuple->ipv6.daddr; - u16 hnum = ntohs(tuple->ipv6.dport); int sdif = inet6_sdif(skb);
if (proto == IPPROTO_TCP) sk = __inet6_lookup(net, &tcp_hashinfo, skb, 0, src6, tuple->ipv6.sport, - dst6, hnum, + dst6, ntohs(tuple->ipv6.dport), dif, sdif, &refcounted); else if (likely(ipv6_bpf_stub)) sk = ipv6_bpf_stub->udp6_lib_lookup(net, src6, tuple->ipv6.sport, - dst6, hnum, + dst6, tuple->ipv6.dport, dif, sdif, &udp_table, skb); #endif @@@ -6139,19 -6136,19 +6135,19 @@@ static u32 bpf_convert_ctx_access(enum break;
case offsetof(struct __sk_buff, vlan_present): - case offsetof(struct __sk_buff, vlan_tci): - BUILD_BUG_ON(VLAN_TAG_PRESENT != 0x1000); + *target_size = 1; + *insn++ = BPF_LDX_MEM(BPF_B, si->dst_reg, si->src_reg, + PKT_VLAN_PRESENT_OFFSET()); + if (PKT_VLAN_PRESENT_BIT) + *insn++ = BPF_ALU32_IMM(BPF_RSH, si->dst_reg, PKT_VLAN_PRESENT_BIT); + if (PKT_VLAN_PRESENT_BIT < 7) + *insn++ = BPF_ALU32_IMM(BPF_AND, si->dst_reg, 1); + break;
+ case offsetof(struct __sk_buff, vlan_tci): *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->src_reg, bpf_target_off(struct sk_buff, vlan_tci, 2, target_size)); - if (si->off == offsetof(struct __sk_buff, vlan_tci)) { - *insn++ = BPF_ALU32_IMM(BPF_AND, si->dst_reg, - ~VLAN_TAG_PRESENT); - } else { - *insn++ = BPF_ALU32_IMM(BPF_RSH, si->dst_reg, 12); - *insn++ = BPF_ALU32_IMM(BPF_AND, si->dst_reg, 1); - } break;
case offsetof(struct __sk_buff, cb[0]) ... diff --combined net/ipv4/ip_tunnel_core.c index c248e0dccbe1,f45b96d715f0..c857ec6b9784 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c @@@ -80,7 -80,7 +80,7 @@@ void iptunnel_xmit(struct sock *sk, str
iph->version = 4; iph->ihl = sizeof(struct iphdr) >> 2; - iph->frag_off = df; + iph->frag_off = ip_mtu_locked(&rt->dst) ? 0 : df; iph->protocol = proto; iph->tos = tos; iph->daddr = dst; @@@ -120,7 -120,7 +120,7 @@@ int __iptunnel_pull_header(struct sk_bu }
skb_clear_hash_if_not_l4(skb); - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb); skb_set_queue_mapping(skb, 0); skb_scrub_packet(skb, xnet);
diff --combined net/ipv6/route.c index 14b422f35504,b2447b7c7303..30706fc8d42a --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@@ -2232,7 -2232,8 +2232,7 @@@ static void ip6_link_failure(struct sk_ if (rt) { rcu_read_lock(); if (rt->rt6i_flags & RTF_CACHE) { - if (dst_hold_safe(&rt->dst)) - rt6_remove_exception_rt(rt); + rt6_remove_exception_rt(rt); } else { struct fib6_info *from; struct fib6_node *fn; @@@ -2974,7 -2975,8 +2974,8 @@@ static struct fib6_info *ip6_route_info if (!rt) goto out;
- rt->fib6_metrics = ip_fib_metrics_init(net, cfg->fc_mx, cfg->fc_mx_len); + rt->fib6_metrics = ip_fib_metrics_init(net, cfg->fc_mx, cfg->fc_mx_len, + extack); if (IS_ERR(rt->fib6_metrics)) { err = PTR_ERR(rt->fib6_metrics); /* Do not leave garbage there. */ @@@ -3213,8 -3215,8 +3214,8 @@@ static int ip6_del_cached_rt(struct rt6 if (cfg->fc_flags & RTF_GATEWAY && !ipv6_addr_equal(&cfg->fc_gateway, &rt->rt6i_gateway)) goto out; - if (dst_hold_safe(&rt->dst)) - rc = rt6_remove_exception_rt(rt); + + rc = rt6_remove_exception_rt(rt); out: return rc; } @@@ -3707,7 -3709,7 +3708,7 @@@ struct fib6_info *addrconf_f6i_alloc(st if (!f6i) return ERR_PTR(-ENOMEM);
- f6i->fib6_metrics = ip_fib_metrics_init(net, NULL, 0); + f6i->fib6_metrics = ip_fib_metrics_init(net, NULL, 0, NULL); f6i->dst_nocount = true; f6i->dst_host = true; f6i->fib6_protocol = RTPROT_KERNEL; diff --combined net/sched/sch_fq.c index 25a7cf6d380f,3671eab91107..1da8864502d4 --- a/net/sched/sch_fq.c +++ b/net/sched/sch_fq.c @@@ -94,6 -94,7 +94,7 @@@ struct fq_sched_data u32 flow_refill_delay; u32 flow_plimit; /* max packets per flow */ unsigned long flow_max_rate; /* optional max rate per flow */ + u64 ce_threshold; u32 orphan_mask; /* mask for orphaned skb */ u32 low_rate_threshold; struct rb_root *fq_root; @@@ -107,6 -108,7 +108,7 @@@ u64 stat_gc_flows; u64 stat_internal_packets; u64 stat_throttled; + u64 stat_ce_mark; u64 stat_flows_plimit; u64 stat_pkts_too_long; u64 stat_allocation_errors; @@@ -454,6 -456,11 +456,11 @@@ begin fq_flow_set_throttled(q, f); goto begin; } + if (time_next_packet && + (s64)(now - time_next_packet - q->ce_threshold) > 0) { + INET_ECN_set_ce(skb); + q->stat_ce_mark++; + } }
skb = fq_dequeue_head(sch, f); @@@ -469,29 -476,22 +476,29 @@@ goto begin; } prefetch(&skb->end); - f->credit -= qdisc_pkt_len(skb); + plen = qdisc_pkt_len(skb); + f->credit -= plen;
- if (ktime_to_ns(skb->tstamp) || !q->rate_enable) + if (!q->rate_enable) goto out;
rate = q->flow_max_rate; - if (skb->sk) - rate = min(skb->sk->sk_pacing_rate, rate); - - if (rate <= q->low_rate_threshold) { - f->credit = 0; - plen = qdisc_pkt_len(skb); - } else { - plen = max(qdisc_pkt_len(skb), q->quantum); - if (f->credit > 0) - goto out; + + /* If EDT time was provided for this skb, we need to + * update f->time_next_packet only if this qdisc enforces + * a flow max rate. + */ + if (!skb->tstamp) { + if (skb->sk) + rate = min(skb->sk->sk_pacing_rate, rate); + + if (rate <= q->low_rate_threshold) { + f->credit = 0; + } else { + plen = max(plen, q->quantum); + if (f->credit > 0) + goto out; + } } if (rate != ~0UL) { u64 len = (u64)plen * NSEC_PER_SEC; @@@ -657,6 -657,7 +664,7 @@@ static const struct nla_policy fq_polic [TCA_FQ_BUCKETS_LOG] = { .type = NLA_U32 }, [TCA_FQ_FLOW_REFILL_DELAY] = { .type = NLA_U32 }, [TCA_FQ_LOW_RATE_THRESHOLD] = { .type = NLA_U32 }, + [TCA_FQ_CE_THRESHOLD] = { .type = NLA_U32 }, };
static int fq_change(struct Qdisc *sch, struct nlattr *opt, @@@ -736,6 -737,10 +744,10 @@@ if (tb[TCA_FQ_ORPHAN_MASK]) q->orphan_mask = nla_get_u32(tb[TCA_FQ_ORPHAN_MASK]);
+ if (tb[TCA_FQ_CE_THRESHOLD]) + q->ce_threshold = (u64)NSEC_PER_USEC * + nla_get_u32(tb[TCA_FQ_CE_THRESHOLD]); + if (!err) { sch_tree_unlock(sch); err = fq_resize(sch, fq_log); @@@ -786,6 -791,10 +798,10 @@@ static int fq_init(struct Qdisc *sch, s q->fq_trees_log = ilog2(1024); q->orphan_mask = 1024 - 1; q->low_rate_threshold = 550000 / 8; + + /* Default ce_threshold of 4294 seconds */ + q->ce_threshold = (u64)NSEC_PER_USEC * ~0U; + qdisc_watchdog_init_clockid(&q->watchdog, sch, CLOCK_MONOTONIC);
if (opt) @@@ -799,6 -808,7 +815,7 @@@ static int fq_dump(struct Qdisc *sch, struct sk_buff *skb) { struct fq_sched_data *q = qdisc_priv(sch); + u64 ce_threshold = q->ce_threshold; struct nlattr *opts;
opts = nla_nest_start(skb, TCA_OPTIONS); @@@ -807,6 -817,8 +824,8 @@@
/* TCA_FQ_FLOW_DEFAULT_RATE is not used anymore */
+ do_div(ce_threshold, NSEC_PER_USEC); + if (nla_put_u32(skb, TCA_FQ_PLIMIT, sch->limit) || nla_put_u32(skb, TCA_FQ_FLOW_PLIMIT, q->flow_plimit) || nla_put_u32(skb, TCA_FQ_QUANTUM, q->quantum) || @@@ -819,6 -831,7 +838,7 @@@ nla_put_u32(skb, TCA_FQ_ORPHAN_MASK, q->orphan_mask) || nla_put_u32(skb, TCA_FQ_LOW_RATE_THRESHOLD, q->low_rate_threshold) || + nla_put_u32(skb, TCA_FQ_CE_THRESHOLD, (u32)ce_threshold) || nla_put_u32(skb, TCA_FQ_BUCKETS_LOG, q->fq_trees_log)) goto nla_put_failure;
@@@ -848,6 -861,7 +868,7 @@@ static int fq_dump_stats(struct Qdisc * st.throttled_flows = q->throttled_flows; st.unthrottle_latency_ns = min_t(unsigned long, q->unthrottle_latency_ns, ~0U); + st.ce_mark = q->stat_ce_mark; sch_tree_unlock(sch);
return gnet_stats_copy_app(d, &st, sizeof(st));
linux-merge@lists.open-mesh.org