* Re: [PATCH net-next 1/1] sched: Use __qdisc_drop instead of kfree_skb in sch_prio and sch_qfq
From: David Miller @ 2017-09-07 4:20 UTC (permalink / raw)
To: gfree.wind; +Cc: jhs, xiyou.wangcong, jiri, edumazet, netdev
In-Reply-To: <1504506072-46207-1-git-send-email-gfree.wind@vip.163.com>
From: gfree.wind@vip.163.com
Date: Mon, 4 Sep 2017 14:21:12 +0800
> From: Gao Feng <gfree.wind@vip.163.com>
>
> The commit 520ac30f4551 ("net_sched: drop packets after root qdisc lock
> is released) made a big change of tc for performance. There are two points
> left in sch_prio and sch_qfq which are not changed with that commit. Now
> enhance them now with __qdisc_drop.
>
> Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
Thanks for catching these missed cases, applied.
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2017-09-09 5:06 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
The iwlwifi firmware compat fix is in here as well as some other
stuff:
1) Fix request socket leak introduced by BPF deadlock fix, from Eric
Dumazet.
2) Fix VLAN handling with TXQs in mac80211, from Johannes Berg.
3) Missing __qdisc_drop conversions in prio and qfq schedulers, from
Gao Feng.
4) Use after free in netlink nlk groups handling, from Xin Long.
5) Handle MTU update properly in ipv6 gre tunnels, from Xin Long.
6) Fix leak of ipv6 fib tables on netns teardown, from Sabrina Dubroca
with follow-on fix from Eric Dumazet.
7) Need RCU and preemption disabled during generic XDP data patch, from
John Fastabend.
Please pull, thanks a lot!
The following changes since commit 80cee03bf1d626db0278271b505d7f5febb37bba:
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 (2017-09-06 15:17:17 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
for you to fetch changes up to 9beb8bedb05c5f3a353dba62b8fa7cbbb9ec685e:
bpf: make error reporting in bpf_warn_invalid_xdp_action more clear (2017-09-08 21:13:09 -0700)
----------------------------------------------------------------
Arnd Bergmann (1):
isdn: isdnloop: fix logic error in isdnloop_sendbuf
Avraham Stern (1):
mac80211: flush hw_roc_start work before cancelling the ROC
Baruch Siach (5):
dt-binding: phy: don't confuse with Ethernet phy properties
dt-bindings: net: don't confuse with generic PHY property
dt-bindings: add SFF vendor prefix
dt-binding: net: sfp binding documentation
net: phy: sfp: rename dt properties to match the binding
Beni Lev (1):
mac80211_hwsim: Use proper TX power
Chunho Lee (1):
mac80211: Fix null pointer dereference with iTXQ support
Daniel Borkmann (2):
bpf: don't select potentially stale ri->map from buggy xdp progs
bpf: make error reporting in bpf_warn_invalid_xdp_action more clear
David S. Miller (4):
Merge tag 'mac80211-for-davem-2017-09-07' of git://git.kernel.org/.../jberg/mac80211
Merge tag 'wireless-drivers-for-davem-2017-09-08' of git://git.kernel.org/.../kvalo/wireless-drivers
Merge git://git.kernel.org/.../pablo/nf
Merge branch 'xdp-bpf-fixes'
Emmanuel Grumbach (1):
cfg80211: honor NL80211_RRF_NO_HT40{MINUS,PLUS}
Eric Dumazet (2):
tcp: fix a request socket leak
ipv6: fix typo in fib6_net_exit()
Florian Fainelli (1):
Revert "mdio_bus: Remove unneeded gpiod NULL check"
Florian Westphal (5):
netfilter: nf_nat: don't bug when mapping already exists
netfilter: xtables: add scheduling opportunity in get_counters
netfilter: nat: Revert "netfilter: nat: convert nat bysrc hash to rhashtable"
netfilter: nat: use keyed locks
netfilter: core: remove erroneous warn_on
Gao Feng (1):
sched: Use __qdisc_drop instead of kfree_skb in sch_prio and sch_qfq
Haishuang Yan (2):
ip_tunnel: fix setting ttl and tos value in collect_md mode
ip6_tunnel: fix setting hop_limit value for ipv6 tunnel
Håkon Bugge (1):
rds: Fix incorrect statistics counting
Ian W MORRISON (1):
brcmfmac: feature check for multi-scheduled scan fails on bcm4345 devices
Igor Mitsyanko (1):
nl80211: look for HT/VHT capabilities in beacon's tail
Ilan peer (1):
mac80211: Complete ampdu work schedule during session tear down
Ivan Khoronzhuk (1):
net: ethernet: ti: netcp_core: no need in netif_napi_del
Jiri Pirko (1):
net: sched: fix memleak for chain zero
Johannes Berg (3):
mac80211: fix VLAN handling with TXQs
mac80211: agg-tx: call drv_wake_tx_queue in proper context
mac80211: fix deadlock in driver-managed RX BA session start
John Fastabend (3):
net: rcu lock and preempt disable missing around generic xdp
bpf: add support for sockmap detach programs
bpf: devmap, use cond_resched instead of cpu_relax
Kees Cook (1):
net: tulip: Constify tulip_tbl
Kleber Sacilotto de Souza (1):
tipc: remove unnecessary call to dev_net()
Larry Finger (2):
rtlwifi: btcoexist: Fix breakage of ant_sel for rtl8723be
rtlwifi: btcoexist: Fix antenna selection code
Liad Kaufman (1):
mac80211: add MESH IE in the correct order
Luca Coelho (1):
iwlwifi: mvm: only send LEDS_CMD when the FW supports it
Marcelo Ricardo Leitner (1):
sctp: fix missing wake ups in some situations
Mathieu Malaterre (1):
davicom: Display proper debug level up to 6
Paolo Abeni (1):
udp: drop head states only when all skb references are gone
Sabrina Dubroca (1):
ipv6: fix memory leak with multiple tables during netns destruction
Sharon Dvir (1):
mac80211: shorten debug prints using ht_dbg() to avoid warning
Simon Dinkin (1):
mac80211: fix incorrect assignment of reassoc value
Vishwanath Pai (1):
netfilter: xt_hashlimit: fix build error caused by 64bit division
Xin Long (5):
netlink: fix an use-after-free issue for nlk groups
netlink: access nlk groups safely in netlink bind and getname
ip6_gre: update mtu properly in ip6gre_err
netfilter: ipvs: fix the issue that sctp_conn_schedule drops non-INIT packet
netfilter: ipvs: do not create conn for ABORT packet in sctp_conn_schedule
Zhizhou Tian (1):
netfilter: xt_hashlimit: alloc hashtable with right size
Documentation/devicetree/bindings/net/ethernet.txt | 4 +++
Documentation/devicetree/bindings/net/sff,sfp.txt | 76 ++++++++++++++++++++++++++++++++++++++++++++++
Documentation/devicetree/bindings/phy/phy-bindings.txt | 4 ++-
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
drivers/isdn/isdnloop/isdnloop.c | 2 +-
drivers/net/ethernet/davicom/dm9000.c | 2 +-
drivers/net/ethernet/dec/tulip/tulip.h | 2 +-
drivers/net/ethernet/dec/tulip/tulip_core.c | 2 +-
drivers/net/ethernet/ti/netcp_core.c | 1 -
drivers/net/phy/mdio_bus.c | 6 ++--
drivers/net/phy/sfp.c | 4 +--
drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 3 +-
drivers/net/wireless/intel/iwlwifi/fw/file.h | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/led.c | 3 +-
drivers/net/wireless/mac80211_hwsim.c | 2 --
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c | 5 +++-
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 23 +++++++++-----
include/linux/bpf.h | 8 ++---
include/linux/skbuff.h | 2 +-
include/net/mac80211.h | 15 ++--------
include/net/netfilter/nf_conntrack.h | 3 +-
include/net/netfilter/nf_nat.h | 1 -
include/uapi/linux/bpf.h | 4 +--
kernel/bpf/devmap.c | 2 +-
kernel/bpf/sockmap.c | 2 +-
kernel/bpf/syscall.c | 27 ++++++++++-------
kernel/bpf/verifier.c | 16 ++++++++++
net/core/dev.c | 25 ++++++++++------
net/core/filter.c | 27 +++++++++++++++--
net/core/skbuff.c | 9 ++----
net/ipv4/ip_tunnel.c | 4 +--
net/ipv4/netfilter/arp_tables.c | 1 +
net/ipv4/netfilter/ip_tables.c | 1 +
net/ipv4/tcp_ipv4.c | 6 ++--
net/ipv4/udp.c | 5 +++-
net/ipv6/ip6_fib.c | 25 ++++++++++++----
net/ipv6/ip6_gre.c | 4 ++-
net/ipv6/ip6_tunnel.c | 1 +
net/ipv6/netfilter/ip6_tables.c | 1 +
net/ipv6/tcp_ipv6.c | 6 ++--
net/mac80211/agg-rx.c | 32 +++++++++++++-------
net/mac80211/agg-tx.c | 8 +++--
net/mac80211/ht.c | 24 +++++++++++++--
net/mac80211/ieee80211_i.h | 4 +++
net/mac80211/iface.c | 20 +++++++++++--
net/mac80211/mlme.c | 2 +-
net/mac80211/offchannel.c | 2 ++
net/mac80211/tx.c | 36 +++++++++++++++++-----
net/mac80211/util.c | 2 +-
net/netfilter/core.c | 2 +-
net/netfilter/ipvs/ip_vs_proto_sctp.c | 8 +++--
net/netfilter/nf_nat_core.c | 146 +++++++++++++++++++++++++++++++++++++++++------------------------------------------------
net/netfilter/xt_hashlimit.c | 16 +++++-----
net/netlink/af_netlink.c | 22 +++++++++-----
net/rds/send.c | 10 +++++--
net/sched/cls_api.c | 18 +++++------
net/sched/sch_prio.c | 2 +-
net/sched/sch_qfq.c | 2 +-
net/sctp/ulpqueue.c | 3 +-
net/tipc/bearer.c | 2 +-
net/wireless/nl80211.c | 4 +--
net/wireless/reg.c | 20 +++++++++++--
tools/testing/selftests/bpf/test_maps.c | 51 ++++++++++++++++++++++++++++++-
63 files changed, 537 insertions(+), 235 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/sff,sfp.txt
^ permalink raw reply
* Re: [PATCH] ipv4: Namespaceify tcp_max_orphans knob
From: Cong Wang @ 2017-09-09 4:35 UTC (permalink / raw)
To: 严海双
Cc: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
Eric Dumazet, Linux Kernel Network Developers, LKML
In-Reply-To: <798CA25A-CA09-4D06-A9B6-7C5791A6EEC1@cmss.chinamobile.com>
On Fri, Sep 8, 2017 at 6:25 PM, 严海双 <yanhaishuang@cmss.chinamobile.com> wrote:
>
>
>> On 2017年9月9日, at 上午6:13, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>>
>> On Wed, Sep 6, 2017 at 8:10 PM, Haishuang Yan
>> <yanhaishuang@cmss.chinamobile.com> wrote:
>>> Different namespace application might require different maximal number
>>> of TCP sockets independently of the host.
>>
>> So after your patch we could have N * net->ipv4.sysctl_tcp_max_orphans
>> in a whole system, right? This just makes OOM easier to trigger.
>>
>
> From my understanding, before the patch, we had N * net->ipv4.sysctl_tcp_max_orphans,
> and after the patch, we could have ns1.sysctl_tcp_max_orphans + ns2.sysctl_tcp_max_orphans
> + ns3.sysctl_tcp_max_orphans, is that right? Thanks for your reviewing.
Nope, by N I mean the number of containers. Before your patch, the limit
is global, after your patch it is per container.
^ permalink raw reply
* Re: [PATCH net] bpf: make error reporting in bpf_warn_invalid_xdp_action more clear
From: David Miller @ 2017-09-09 4:13 UTC (permalink / raw)
To: daniel; +Cc: ast, john.fastabend, netdev
In-Reply-To: <a89dbb43f7196f6ba8c5fd1f07c7e4bcc97726c3.1504913751.git.daniel@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Sat, 9 Sep 2017 01:40:35 +0200
> Differ between illegal XDP action code and just driver
> unsupported one to provide better feedback when we throw
> a one-time warning here. Reason is that with 814abfabef3c
> ("xdp: add bpf_redirect helper function") not all drivers
> support the new XDP return code yet and thus they will
> fall into their 'default' case when checking for return
> codes after program return, which then triggers a
> bpf_warn_invalid_xdp_action() stating that the return
> code is illegal, but from XDP perspective it's not.
>
> I decided not to place something like a XDP_ACT_MAX define
> into uapi i) given we don't have this either for all other
> program types, ii) future action codes could have further
> encoding there, which would render such define unsuitable
> and we wouldn't be able to rip it out again, and iii) we
> rarely add new action codes.
>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Acked-by: Alexei Starovoitov <ast@kernel.org>
Applied.
^ permalink raw reply
* Re: [PATCH net] Revert "mdio_bus: Remove unneeded gpiod NULL check"
From: David Miller @ 2017-09-09 4:13 UTC (permalink / raw)
To: f.fainelli
Cc: netdev, linus.walleij, andrew, festevam, sergei.shtylyov,
fabio.estevam, Bryan.Whitehead
In-Reply-To: <20170908223807.6015-1-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 8 Sep 2017 15:38:07 -0700
> This reverts commit 95b80bf3db03c2bf572a357cf74b9a6aefef0a4a ("mdio_bus:
> Remove unneeded gpiod NULL check"), this commit assumed that GPIOLIB
> checks for NULL descriptors, so it's safe to drop them, but it is not
> when CONFIG_GPIOLIB is disabled in the kernel. If we do call
> gpiod_set_value_cansleep() on a GPIO descriptor we will issue warnings
> coming from the inline stubs declared in include/linux/gpio/consumer.h.
>
> Fixes: 95b80bf3db03 ("mdio_bus: Remove unneeded gpiod NULL check")
> Reported-by: Woojung Huh <Woojung.Huh@microchip.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Applied.
^ permalink raw reply
* Re: [net PATCH 0/3] Fixes for XDP/BPF
From: David Miller @ 2017-09-09 4:11 UTC (permalink / raw)
To: john.fastabend; +Cc: netdev, daniel, ast
In-Reply-To: <150490397545.11590.1409723973253492363.stgit@john-XPS-13-9360>
From: John Fastabend <john.fastabend@gmail.com>
Date: Fri, 08 Sep 2017 14:00:05 -0700
> The following fixes, UAPI updates, and small improvement,
>
> i. XDP needs to be called inside RCU with preempt disabled.
>
> ii. Not strictly a bug fix but we have an attach command in the
> sockmap UAPI already to avoid having a single kernel released with
> only the attach and not the detach I'm pushing this into net branch.
> Its early in the RC cycle so I think this is OK (not ideal but better
> than supporting a UAPI with a missing detach forever).
>
> iii. Final patch replace cpu_relax with cond_resched in devmap.
Series applied, thanks John.
^ permalink raw reply
* Re: [PATCH net] phy: mvebu-cp110: checking for NULL instead of IS_ERR()
From: David Miller @ 2017-09-09 4:09 UTC (permalink / raw)
To: dan.carpenter
Cc: kishon, antoine.tenart, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20170908103137.zck6bw66sge4fhua@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 8 Sep 2017 13:31:37 +0300
> devm_ioremap_resource() never returns NULL, it only returns error
> pointers so this test needs to be changed.
>
> Fixes: d0438bd6aa09 ("phy: add the mvebu cp110 comphy driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This driver apparently is going through the net tree, but netdev isn't
> listed as handling it in MAINTAINERS. Kishon, do you know what's up
> with that?
Yeah let's sort this out before I apply this fix to my tree.
^ permalink raw reply
* Re: [V2 PATCH net-next 0/2] Fixes for XDP_REDIRECT map
From: David Miller @ 2017-09-09 3:54 UTC (permalink / raw)
To: brouer; +Cc: netdev, borkmann, john.fastabend, andy
In-Reply-To: <150478756604.28665.6915020425359475729.stgit@firesoul>
From: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Thu, 07 Sep 2017 14:33:08 +0200
> This my V2 of catching XDP_REDIRECT and bpf_redirect_map() API usage
> that can potentially crash the kernel. Addressed Daniels feedback in
> patch01, and added patch02 which catch and cleanup dangling map
> pointers.
>
> I know John and Daniel are working on a more long-term solution, of
> recording the bpf_prog pointer together with the map pointer. I just
> wanted to propose these fixes as a stop-gap to the potential crashes.
Jesper if these are still relevant, please resubmit against the 'net'
tree, thanks!
^ permalink raw reply
* Re: [PATCH] net: tulip: Constify tulip_tbl
From: David Miller @ 2017-09-09 3:54 UTC (permalink / raw)
To: keescook; +Cc: netdev, jarod, gustavo, linux-parisc, linux-kernel
In-Reply-To: <20170907193514.GA114400@beast>
From: Kees Cook <keescook@chromium.org>
Date: Thu, 7 Sep 2017 12:35:14 -0700
> It looks like all users of tulip_tbl are reads, so mark this table
> as read-only.
>
> $ git grep tulip_tbl # edited to avoid line-wraps...
> interrupt.c: iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ...
> interrupt.c: iowrite32(tulip_tbl[tp->chip_id].valid_intrs&~RxPollInt, ...
> interrupt.c: iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ...
> interrupt.c: iowrite32(tulip_tbl[tp->chip_id].valid_intrs | TimerInt,
> pnic.c: iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7);
> tulip.h: extern struct tulip_chip_table tulip_tbl[];
> tulip_core.c:struct tulip_chip_table tulip_tbl[] = {
> tulip_core.c:iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR5);
> tulip_core.c:iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7);
> tulip_core.c:setup_timer(&tp->timer, tulip_tbl[tp->chip_id].media_timer,
> tulip_core.c:const char *chip_name = tulip_tbl[chip_idx].chip_name;
> tulip_core.c:if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size)
> tulip_core.c:ioaddr = pci_iomap(..., tulip_tbl[chip_idx].io_size);
> tulip_core.c:tp->flags = tulip_tbl[chip_idx].flags;
> tulip_core.c:setup_timer(&tp->timer, tulip_tbl[tp->chip_id].media_timer,
> tulip_core.c:INIT_WORK(&tp->media_work, tulip_tbl[tp->chip_id].media_task);
>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jarod Wilson <jarod@redhat.com>
> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-parisc@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
Applied.
^ permalink raw reply
* Re: [PATCH] net: ethernet: ti: netcp_core: no need in netif_napi_del
From: David Miller @ 2017-09-09 3:54 UTC (permalink / raw)
To: ivan.khoronzhuk
Cc: w-kwok2, m-karicheri2, netdev, linux-kernel, grygorii.strashko
In-Reply-To: <1504798350-790-1-git-send-email-ivan.khoronzhuk@linaro.org>
From: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Date: Thu, 7 Sep 2017 18:32:30 +0300
> Don't remove rx_napi specifically just before free_netdev(),
> it's supposed to be done in it and is confusing w/o tx_napi deletion.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Applied.
^ permalink raw reply
* Re: [PATCH] drivers: net: Display proper debug level up to 6
From: David Miller @ 2017-09-09 3:53 UTC (permalink / raw)
To: malat; +Cc: tremyfr, johannes.berg, jarod, netdev, linux-kernel
In-Reply-To: <20170907112422.26570-1-malat@debian.org>
From: Mathieu Malaterre <malat@debian.org>
Date: Thu, 7 Sep 2017 13:24:20 +0200
> This will make it explicit some messages are of the form:
> dm9000_dbg(db, 5, ...
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
Applied.
^ permalink raw reply
* Re: [PATCH net v4 3/3] net: phy: sfp: rename dt properties to match the binding
From: David Miller @ 2017-09-09 3:51 UTC (permalink / raw)
To: baruch
Cc: robh+dt, mark.rutland, andrew, f.fainelli, rmk+kernel, netdev,
devicetree, sergei.shtylyov, antoine.tenart
In-Reply-To: <720bdc3383214231cd6e25d2e1980262c68863ac.1504776350.git.baruch@tkos.co.il>
From: Baruch Siach <baruch@tkos.co.il>
Date: Thu, 7 Sep 2017 12:25:50 +0300
> Make the Rx rate select control gpio property name match the documented
> binding. This would make the addition of 'rate-select1-gpios' for SFP+
> support more natural.
>
> Also, make the MOD-DEF0 gpio property name match the documentation.
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Applied.
^ permalink raw reply
* Re: [PATCH net v4 2/3] dt-binding: net: sfp binding documentation
From: David Miller @ 2017-09-09 3:51 UTC (permalink / raw)
To: baruch
Cc: robh+dt, mark.rutland, andrew, f.fainelli, rmk+kernel, netdev,
devicetree, sergei.shtylyov, antoine.tenart
In-Reply-To: <5b46343b543ad1d2ebbc5be9871def7f92c4dbd8.1504776350.git.baruch@tkos.co.il>
From: Baruch Siach <baruch@tkos.co.il>
Date: Thu, 7 Sep 2017 12:25:49 +0300
> Add device-tree binding documentation SFP transceivers. Support for SFP
> transceivers has been recently introduced (drivers/net/phy/sfp.c).
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Applied.
^ permalink raw reply
* Re: [PATCH net v4 1/3] dt-bindings: add SFF vendor prefix
From: David Miller @ 2017-09-09 3:51 UTC (permalink / raw)
To: baruch-NswTu9S1W3P6gbPvEgmw2w
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
andrew-g2DYL2Zd6BY, f.fainelli-Re5JQEeQqe8AvxtiuMwx3w,
rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ, netdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8,
antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8
In-Reply-To: <b98ac3e8cde5c99489e8dcee9a1d5b8a19face8d.1504776350.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
From: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
Date: Thu, 7 Sep 2017 12:25:48 +0300
> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] dt-bindings: net: don't confuse with generic PHY property
From: David Miller @ 2017-09-09 3:50 UTC (permalink / raw)
To: baruch; +Cc: robh+dt, mark.rutland, netdev, devicetree
In-Reply-To: <2e201cc1cff4fad372f589c83c4c438b3dccbadf.1504771799.git.baruch@tkos.co.il>
From: Baruch Siach <baruch@tkos.co.il>
Date: Thu, 7 Sep 2017 11:09:59 +0300
> This complements commit 9a94b3a4bd (dt-binding: phy: don't confuse with
> Ethernet phy properties).
>
> The generic PHY 'phys' property sometime appears in the same node with
> the Ethernet PHY 'phy' or 'phy-handle' properties. Add a warning in
> ethernet.txt to reduce confusion.
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Applied.
^ permalink raw reply
* Re: [PATCH 2/2] ip6_tunnel: fix setting hop_limit value for ipv6 tunnel
From: David Miller @ 2017-09-09 3:48 UTC (permalink / raw)
To: yanhaishuang; +Cc: kuznet, yoshfuji, netdev, linux-kernel
In-Reply-To: <1504764515-13536-2-git-send-email-yanhaishuang@cmss.chinamobile.com>
From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Date: Thu, 7 Sep 2017 14:08:35 +0800
> Similar to vxlan/geneve tunnel, if hop_limit is zero, it should fall
> back to ip6_dst_hoplimt().
>
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] ip_tunnel: fix setting ttl and tos value in collect_md mode
From: David Miller @ 2017-09-09 3:47 UTC (permalink / raw)
To: yanhaishuang; +Cc: kuznet, yoshfuji, netdev, linux-kernel, ast
In-Reply-To: <1504764515-13536-1-git-send-email-yanhaishuang@cmss.chinamobile.com>
From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Date: Thu, 7 Sep 2017 14:08:34 +0800
> ttl and tos variables are declared and assigned, but are not used in
> iptunnel_xmit() function.
>
> Fixes: cfc7381b3002 ("ip_tunnel: add collect_md mode to IPIP tunnel")
> Cc: Alexei Starovoitov <ast@fb.com>
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 3/3] net: phy: realtek: add RTL8201F phy-id and functions
From: Jassi Brar @ 2017-09-09 3:33 UTC (permalink / raw)
To: Florian Fainelli
Cc: Kunihiko Hayashi, netdev-u79uwXL29TY76Z2rM5mHXA, David S. Miller,
Andrew Lunn, Rob Herring, Mark Rutland,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
lkml, Devicetree List, Masahiro Yamada, Masami Hiramatsu,
Jongsung Kim
In-Reply-To: <4173a876-3cff-205a-ce87-ce049f419aa0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 9 September 2017 at 00:21, Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 09/08/2017 06:02 AM, Kunihiko Hayashi wrote:
>> From: Jassi Brar <jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>>
>> Add RTL8201F phy-id and the related functions to the driver.
>>
>> The original patch is as follows:
>> https://patchwork.kernel.org/patch/2538341/
>>
>> Signed-off-by: Jongsung Kim <neidhard.kim-Hm3cg6mZ9cc@public.gmane.org>
>> Signed-off-by: Jassi Brar <jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
>> ---
>> drivers/net/phy/realtek.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 45 insertions(+)
>>
>> diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
>> index 9cbe645..d9974ce 100644
>> --- a/drivers/net/phy/realtek.c
>> +++ b/drivers/net/phy/realtek.c
>> @@ -29,10 +29,23 @@
>> #define RTL8211F_PAGE_SELECT 0x1f
>> #define RTL8211F_TX_DELAY 0x100
>>
>> +#define RTL8201F_ISR 0x1e
>> +#define RTL8201F_PAGE_SELECT 0x1f
>
> We have a page select register define for the RTL8211F right above, so
> surely we can make that a common definition?
>
That is just for the sake of consistency.
I mean RTL8211 wouldn't look neat among everything else RTL8201.
Also the page-select offsets just _happen_ to be same value...
RTL8211E_INER_LINK_STATUS and RTL8211F_INER_LINK_STATUS are very
different.
>> +#define RTL8201F_IER 0x13
>> +
>> MODULE_DESCRIPTION("Realtek PHY driver");
>> MODULE_AUTHOR("Johnson Leung");
>> MODULE_LICENSE("GPL");
>>
>> +static int rtl8201_ack_interrupt(struct phy_device *phydev)
>> +{
>> + int err;
>> +
>> + err = phy_read(phydev, RTL8201F_ISR);
>> +
>> + return (err < 0) ? err : 0;
>> +}
>> +
>> static int rtl821x_ack_interrupt(struct phy_device *phydev)
>> {
>> int err;
>> @@ -54,6 +67,25 @@ static int rtl8211f_ack_interrupt(struct phy_device *phydev)
>> return (err < 0) ? err : 0;
>> }
>>
>> +static int rtl8201_config_intr(struct phy_device *phydev)
>> +{
>> + int err;
>> +
>> + /* switch to page 7 */
>> + phy_write(phydev, RTL8201F_PAGE_SELECT, 0x7);
>> +
>> + if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
>> + err = phy_write(phydev, RTL8201F_IER,
>> + BIT(13) | BIT(12) | BIT(11));
>
> Can you detail what bits 11, 12 and 13 do? Do they correspond to link,
> duplex and pause changes by any chance?
>
Sorry no idea. The datasheet would say, and other functions too use
such magic values.
>> + else
>> + err = phy_write(phydev, RTL8201F_IER, 0);
>> +
>> + /* restore to default page 0 */
>> + phy_write(phydev, RTL8201F_PAGE_SELECT, 0x0);
>> +
>> + return err;
>> +}
>> +
>
> Other than that, LGTM:
>
> Reviewed-by: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
Thank you.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 1/2] ip_tunnel: fix setting ttl and tos value in collect_md mode
From: Alexei Starovoitov @ 2017-09-09 1:54 UTC (permalink / raw)
To: Haishuang Yan, David S. Miller; +Cc: netdev, linux-kernel
In-Reply-To: <1504764515-13536-1-git-send-email-yanhaishuang@cmss.chinamobile.com>
On 9/6/17 11:08 PM, Haishuang Yan wrote:
> ttl and tos variables are declared and assigned, but are not used in
> iptunnel_xmit() function.
>
> Fixes: cfc7381b3002 ("ip_tunnel: add collect_md mode to IPIP tunnel")
> Cc: Alexei Starovoitov <ast@fb.com>
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
> ---
> net/ipv4/ip_tunnel.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
> index 129d1a3..e1856bf 100644
> --- a/net/ipv4/ip_tunnel.c
> +++ b/net/ipv4/ip_tunnel.c
> @@ -618,8 +618,8 @@ void ip_md_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, u8 proto)
> ip_rt_put(rt);
> goto tx_dropped;
> }
> - iptunnel_xmit(NULL, rt, skb, fl4.saddr, fl4.daddr, proto, key->tos,
> - key->ttl, df, !net_eq(tunnel->net, dev_net(dev)));
> + iptunnel_xmit(NULL, rt, skb, fl4.saddr, fl4.daddr, proto, tos, ttl,
> + df, !net_eq(tunnel->net, dev_net(dev)));
indeed. good catch. thanks
Acked-by: Alexei Starovoitov <ast@kernel.org>
^ permalink raw reply
* RE: [PATCH RFC 3/5] Add KSZ8795 switch driver
From: Tristram.Ha @ 2017-09-09 1:44 UTC (permalink / raw)
To: pavel
Cc: andrew, muvarov, nathan.leigh.conrad, vivien.didelot, f.fainelli,
netdev, linux-kernel, Woojung.Huh
In-Reply-To: <20170908215735.GF27428@amd>
> -----Original Message-----
> From: Pavel Machek [mailto:pavel@ucw.cz]
> Sent: Friday, September 08, 2017 2:58 PM
> To: Tristram Ha - C24268
> Cc: andrew@lunn.ch; muvarov@gmail.com; nathan.leigh.conrad@gmail.com;
> vivien.didelot@savoirfairelinux.com; f.fainelli@gmail.com;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh -
> C21699
> Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver
>
> Hi!
>
> > > > + default:
> > > > + processed = false;
> > > > + break;
> > > > + }
> > > > + if (processed)
> > > > + *val = data;
> > > > +}
> > >
> > > Similar code will be needed by other drivers, right?
> >
> > Although KSZ8795 and KSZ8895 may use the same code, the other
> > chips will have different code.
>
> Ok, please make sure code is shared between these two.
The exact function probably cannot be shared between KSZ8795
and KSZ8895 drivers because although the register constants look
the same but their exact locations are different in the 2 chips.
^ permalink raw reply
* Re: [PATCH] ipv4: Namespaceify tcp_max_orphans knob
From: 严海双 @ 2017-09-09 1:25 UTC (permalink / raw)
To: Cong Wang
Cc: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
Eric Dumazet, Linux Kernel Network Developers, LKML
In-Reply-To: <CAM_iQpV4gRwhT4VXPtJft38ixG6xE3PF9z4gB7HHJEUsqbCtOw@mail.gmail.com>
> On 2017年9月9日, at 上午6:13, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>
> On Wed, Sep 6, 2017 at 8:10 PM, Haishuang Yan
> <yanhaishuang@cmss.chinamobile.com> wrote:
>> Different namespace application might require different maximal number
>> of TCP sockets independently of the host.
>
> So after your patch we could have N * net->ipv4.sysctl_tcp_max_orphans
> in a whole system, right? This just makes OOM easier to trigger.
>
>From my understanding, before the patch, we had N * net->ipv4.sysctl_tcp_max_orphans,
and after the patch, we could have ns1.sysctl_tcp_max_orphans + ns2.sysctl_tcp_max_orphans
+ ns3.sysctl_tcp_max_orphans, is that right? Thanks for your reviewing.
^ permalink raw reply
* RE: [PATCH RFC 0/6] Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers.
From: Tristram.Ha @ 2017-09-09 1:10 UTC (permalink / raw)
To: pavel
Cc: andrew, muvarov, nathan.leigh.conrad, vivien.didelot, f.fainelli,
netdev, linux-kernel, Woojung.Huh
In-Reply-To: <20170908085405.GB16834@amd>
> -----Original Message-----
> From: Pavel Machek [mailto:pavel@ucw.cz]
> Sent: Friday, September 08, 2017 1:54 AM
> To: Tristram Ha - C24268
> Cc: andrew@lunn.ch; muvarov@gmail.com; nathan.leigh.conrad@gmail.com;
> vivien.didelot@savoirfairelinux.com; f.fainelli@gmail.com;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh -
> C21699
> Subject: Re: [PATCH RFC 0/6] Modify KSZ9477 DSA driver in preparation to
> add other KSZ switch drivers.
>
> Hi!
>
> > From: Tristram Ha <Tristram.Ha@microchip.com>
> >
> > This series of patches is to modify the original KSZ9477 DSA driver so that
> other KSZ switch drivers can be added and use the common code.
> >
>
> Please wrap the lines from time to time...
>
>
> > This patch set is against net-next.
> >
> > drivers/net/dsa/microchip/Makefile | 2 +-
> > drivers/net/dsa/microchip/ksz9477.c | 1317
> ++++++++++++++++++++++++++++++++
>
> We already have ksz_9477_reg.h. So should this be ksz_9477.c for
> consistency?
The product name is KSZ9477 and other switches are also like KSZ####,
so I would prefer to have no separation between KSZ and the product
number. I think the file ksz_9477_reg.h was named that way because
the other files were named ksz_common.c and ksz_spi.c. If need to
we can change the file name.
^ permalink raw reply
* Re: [PATCH] net: bonding: Fix transmit load balancing in balance-alb mode if specified by sysfs
From: Mahesh Bandewar (महेश बंडेवार) @ 2017-09-08 23:54 UTC (permalink / raw)
To: Nikolay Aleksandrov
Cc: Kosuke Tatsukawa, Jay Vosburgh, Veaceslav Falico, Andy Gospodarek,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Reinis Rozitis
In-Reply-To: <03b61877-053b-2f0e-dc35-8fe31cc90c08@cumulusnetworks.com>
On Fri, Sep 8, 2017 at 7:30 AM, Nikolay Aleksandrov
<nikolay@cumulusnetworks.com> wrote:
> On 08/09/17 17:17, Kosuke Tatsukawa wrote:
>> Hi,
>>
>>> On 08/09/17 13:10, Nikolay Aleksandrov wrote:
>>>> On 08/09/17 05:06, Kosuke Tatsukawa wrote:
>>>>> Hi,
>>>>>
>>>>>> On 7.09.2017 01:47, Kosuke Tatsukawa wrote:
>>>>>>> Commit cbf5ecb30560 ("net: bonding: Fix transmit load balancing in
>>>>>>> balance-alb mode") tried to fix transmit dynamic load balancing in
>>>>>>> balance-alb mode, which wasn't working after commit 8b426dc54cf4
>>>>>>> ("bonding: remove hardcoded value").
>>>>>>>
>>>>>>> It turned out that my previous patch only fixed the case when
>>>>>>> balance-alb was specified as bonding module parameter, and not when
>>>>>>> balance-alb mode was set using /sys/class/net/*/bonding/mode (the most
>>>>>>> common usage). In the latter case, tlb_dynamic_lb was set up according
>>>>>>> to the default mode of the bonding interface, which happens to be
>>>>>>> balance-rr.
>>>>>>>
>>>>>>> This additional patch addresses this issue by setting up tlb_dynamic_lb
>>>>>>> to 1 if "mode" is set to balance-alb through the sysfs interface.
>>>>>>>
>>>>>>> I didn't add code to change tlb_balance_lb back to the default value for
>>>>>>> other modes, because "mode" is usually set up only once during
>>>>>>> initialization, and it's not worthwhile to change the static variable
>>>>>>> bonding_defaults in bond_main.c to a global variable just for this
>>>>>>> purpose.
>>>>>>>
>>>>>>> Commit 8b426dc54cf4 also changes the value of tlb_dynamic_lb for
>>>>>>> balance-tlb mode if it is set up using the sysfs interface. I didn't
>>>>>>> change that behavior, because the value of tlb_balance_lb can be changed
>>>>>>> using the sysfs interface for balance-tlb, and I didn't like changing
>>>>>>> the default value back and forth for balance-tlb.
>>>>>>>
>>>>>>> As for balance-alb, /sys/class/net/*/bonding/tlb_balance_lb cannot be
>>>>>>> written to. However, I think balance-alb with tlb_dynamic_lb set to 0
>>>>>>> is not an intended usage, so there is little use making it writable at
>>>>>>> this moment.
>>>>>>>
>>>>>>> Fixes: 8b426dc54cf4 ("bonding: remove hardcoded value")
>>>>>>> Reported-by: Reinis Rozitis <r@roze.lv>
>>>>>>> Signed-off-by: Kosuke Tatsukawa <tatsu@ab.jp.nec.com>
>>>>>>> Cc: stable@vger.kernel.org # v4.12+
>>>>>>> ---
>>>>>>> drivers/net/bonding/bond_options.c | 3 +++
>>>>>>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>>>>>>
>>>>>>
>>>>>> I don't believe this to be the right solution, hardcoding it like this
>>>>>> changes user-visible behaviour. The issue is that if someone configured
>>>>>> it to be 0 in tlb mode, suddenly it will become 1 and will silently
>>>>>> override their config if they switch the mode to alb. Also it robs users
>>>>>> from their choice.
>>>>>>
>>>>>> If you think this should be settable in ALB mode, then IMO you should
>>>>>> edit tlb_dynamic_lb option's unsuppmodes and allow it to be set in ALB.
>>>>>> That would also be consistent with how it's handled in TLB mode.
>>>>>
>>>>> No, I don't think tlb_dynamic_lb should be settable in balance-alb at
>>>>> this point. All the current commits regarding tlb_dynamic_lb are for
>>>>> balance-tlb mode, so I don't think balance-alb with tlb_dynamic_lb set
>>>>> to 0 is an intended usage.
>>>>>
>>>>>
>>>>>> Going back and looking at your previous fix I'd argue that it is also
>>>>>> wrong, you should've removed the mode check altogether to return the
>>>>>> original behaviour where the dynamic_lb is set to 1 (enabled) by
>>>>>> default and then ALB mode would've had it, of course that would've left
>>>>>> the case of setting it to 0 in TLB mode and switching to ALB, but that
>>>>>> is a different issue.
>>>>>
>>>>> Maybe balance-alb shouldn't be dependent on tlb_dynamic_lb.
>>>>> tlb_dynamic_lb is referenced in the following functions.
>>>>>
>>>>> + bond_do_alb_xmit() -- Used by both balance-tlb and balance-alb
>>>>> + bond_tlb_xmit() -- Only used by balance-tlb
>>>>> + bond_open() -- Used by both balance-tlb and balance-alb
>>>>> + bond_check_params() -- Used during module initialization
>>>>> + bond_fill_info() -- Used to get/set value
>>>>> + bond_option_tlb_dynamic_lb_set() -- Used to get/set value
>>>>> + bonding_show_tlb_dynamic_lb() -- Used to get/set value
>>>>> + bond_is_nondyn_tlb() -- Only referenced if balance-tlb mode
>>>>>
>>>>> The following untested patch adds code to make balance-alb work as if
>>>>> tlb_dynamic_lb==1 for the functions which affect balance-alb mode. It
>>>>> also reverts my previous patch.
>>>>>
>>>>> What do you think about this approach?
>>>>> ---
>>>>> Kosuke TATSUKAWA | 1st Platform Software Division
>>>>> | NEC Solution Innovators
>>>>> | tatsu@ab.jp.nec.com
>>>>>
>>>>
>>>> Logically the approach looks good, that being said it adds unnecessary tests in
>>>> the fast path, why not just something like the patch below ? That only leaves the
>>>> problem if it is zeroed in TLB and switched to ALB mode, and that is a one line
>>>> fix to unsuppmodes just allow it to be set for that specific case. The below
>>>> returns the default behaviour before the commit in your Fixes tag.
>>>>
>>>>
>>>
>>> Actually I'm fine with your approach, too. It will fix this regardless of the
>>> value of tlb_dynamic_lb which sounds good to me for the price of a test in
>>> the fast path.
>>
>> If you're concerned about the additional test in the fast path, how
>> about the patch below. I've added an arguemnt to bond_do_alb_xmit()
>> to handle both balance-tlb and balance-alb similary.
>>
>
> Even better, looks great! 1 question below though.
>
>> I'm not sure if this causes any problem if tlb_dynamic_lb is changed
>> while calling bond_do_alb_xmit() in balance-tlb mode.
>
> The option has the ifdown flag, you shouldn't be able to change it while
> the bond dev is up, but even if you could I don't think it will be an issue
> for the xmit.
>
>> ---
>> Kosuke TATSUKAWA | 1st Platform Software Division
>> | NEC Solution Innovators
>> | tatsu@ab.jp.nec.com
>>
>> ------------------------------------------------------------------------
>> drivers/net/bonding/bond_alb.c | 11 ++++++-----
>> drivers/net/bonding/bond_main.c | 5 +++--
>> 2 files changed, 9 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
>> index c02cc81..7710f20 100644
>> --- a/drivers/net/bonding/bond_alb.c
>> +++ b/drivers/net/bonding/bond_alb.c
>> @@ -1317,7 +1317,7 @@ void bond_alb_deinitialize(struct bonding *bond)
>> }
>>
>> static int bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
>> - struct slave *tx_slave)
>> + struct slave *tx_slave, int tlb_dynamic_lb)
>> {
>> struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
>> struct ethhdr *eth_data = eth_hdr(skb);
>> @@ -1325,7 +1325,7 @@ static int bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
>> if (!tx_slave) {
>> /* unbalanced or unassigned, send through primary */
>> tx_slave = rcu_dereference(bond->curr_active_slave);
>> - if (bond->params.tlb_dynamic_lb)
>> + if (tlb_dynamic_lb)
>> bond_info->unbalanced_load += skb->len;
>> }
>>
>> @@ -1339,7 +1339,7 @@ static int bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
>> goto out;
>> }
>>
>> - if (tx_slave && bond->params.tlb_dynamic_lb) {
>> + if (tx_slave && tlb_dynamic_lb) {
>> spin_lock(&bond->mode_lock);
>> __tlb_clear_slave(bond, tx_slave, 0);
>> spin_unlock(&bond->mode_lock);
>> @@ -1386,7 +1386,8 @@ int bond_tlb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
>> break;
>> }
>> }
>> - return bond_do_alb_xmit(skb, bond, tx_slave);
>> + return bond_do_alb_xmit(skb, bond, tx_slave,
>> + bond->params.tlb_dynamic_lb);
>> }
>>
>> int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
>> @@ -1483,7 +1484,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
>> tx_slave = tlb_choose_channel(bond, hash_index, skb->len);
>> }
>>
>> - return bond_do_alb_xmit(skb, bond, tx_slave);
>> + return bond_do_alb_xmit(skb, bond, tx_slave, 1);
>> }
>>
>> void bond_alb_monitor(struct work_struct *work)
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index fc63992..bcb71e7 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -3305,7 +3305,8 @@ static int bond_open(struct net_device *bond_dev)
>> */
>> if (bond_alb_initialize(bond, (BOND_MODE(bond) == BOND_MODE_ALB)))
>> return -ENOMEM;
>> - if (bond->params.tlb_dynamic_lb)
>> + if (bond->params.tlb_dynamic_lb ||
>> + (BOND_MODE(bond) == BOND_MODE_TLB))
>
> mode == tlb ? shouldn't this check be for alb ?
>
Actually this is not needed since this is already inside if
(bond_is_lb()) condition.
>> queue_delayed_work(bond->wq, &bond->alb_work, 0);
>> }
>>
>> @@ -4601,7 +4602,7 @@ static int bond_check_params(struct bond_params *params)
>> }
>> ad_user_port_key = valptr->value;
>>
>> - if ((bond_mode == BOND_MODE_TLB) || (bond_mode == BOND_MODE_ALB)) {
>> + if (bond_mode == BOND_MODE_TLB) {
>> bond_opt_initstr(&newval, "default");
>> valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB),
>> &newval);
>>
>
I think the underlying issue is that tlb_dynamic_lb should be set to 1
for all modes which was not the case when it was getting initialized
only forTLB mode. So from that perspective I prefer Nik's patch with a
small variation that guards the case when mode transitions from TLB to
ALB. The reason why I like that patch is because it's simple and
avoids complications.
Here is what I meant -
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index fc63992ab0e0..c99dc59d729b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4289,7 +4289,7 @@ static int bond_check_params(struct bond_params *params)
int bond_mode = BOND_MODE_ROUNDROBIN;
int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;
int lacp_fast = 0;
- int tlb_dynamic_lb = 0;
+ int tlb_dynamic_lb;
/* Convert string parameters. */
if (mode) {
@@ -4601,16 +4601,13 @@ static int bond_check_params(struct bond_params *params)
}
ad_user_port_key = valptr->value;
- if ((bond_mode == BOND_MODE_TLB) || (bond_mode == BOND_MODE_ALB)) {
- bond_opt_initstr(&newval, "default");
- valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB),
- &newval);
- if (!valptr) {
- pr_err("Error: No tlb_dynamic_lb default value");
- return -EINVAL;
- }
- tlb_dynamic_lb = valptr->value;
+ bond_opt_initstr(&newval, "default");
+ valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB), &newval);
+ if (!valptr) {
+ pr_err("Error: No tlb_dynamic_lb default value");
+ return -EINVAL;
}
+ tlb_dynamic_lb = valptr->value;
if (lp_interval == 0) {
pr_warn("Warning: ip_interval must be between 1 and
%d, so it was reset to %d\n",
diff --git a/drivers/net/bonding/bond_options.c
b/drivers/net/bonding/bond_options.c
index a12d603d41c6..7feacd262182 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -754,6 +754,12 @@ static int bond_option_mode_set(struct bonding *bond,
bond->params.miimon);
}
+ /* Guard against transition TLB/tlb_dynamic_lb=0 -> ALB mode.
+ * In ALB mode, tlb_dynamic_lb must be set to 1.
+ */
+ if (newval->value == BOND_MODE_ALB && bond->params.tlb_dynamic_lb != 1)
+ bond->params.tlb_dynamic_lb = 1;
+
/* don't cache arp_validate between modes */
bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
bond->params.mode = newval->value;
^ permalink raw reply related
* [PATCH net] bpf: make error reporting in bpf_warn_invalid_xdp_action more clear
From: Daniel Borkmann @ 2017-09-08 23:40 UTC (permalink / raw)
To: davem; +Cc: ast, john.fastabend, netdev, Daniel Borkmann
Differ between illegal XDP action code and just driver
unsupported one to provide better feedback when we throw
a one-time warning here. Reason is that with 814abfabef3c
("xdp: add bpf_redirect helper function") not all drivers
support the new XDP return code yet and thus they will
fall into their 'default' case when checking for return
codes after program return, which then triggers a
bpf_warn_invalid_xdp_action() stating that the return
code is illegal, but from XDP perspective it's not.
I decided not to place something like a XDP_ACT_MAX define
into uapi i) given we don't have this either for all other
program types, ii) future action codes could have further
encoding there, which would render such define unsuitable
and we wouldn't be able to rip it out again, and iii) we
rarely add new action codes.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
---
include/uapi/linux/bpf.h | 4 ++--
net/core/filter.c | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index ba848b7..43ab5c4 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -766,8 +766,8 @@ struct bpf_sock {
/* User return codes for XDP prog type.
* A valid XDP program must return one of these defined values. All other
- * return codes are reserved for future use. Unknown return codes will result
- * in packet drop.
+ * return codes are reserved for future use. Unknown return codes will
+ * result in packet drops and a warning via bpf_warn_invalid_xdp_action().
*/
enum xdp_action {
XDP_ABORTED = 0,
diff --git a/net/core/filter.c b/net/core/filter.c
index 0848df2..adac4eb 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3609,7 +3609,11 @@ static bool xdp_is_valid_access(int off, int size,
void bpf_warn_invalid_xdp_action(u32 act)
{
- WARN_ONCE(1, "Illegal XDP return value %u, expect packet loss\n", act);
+ const u32 act_max = XDP_REDIRECT;
+
+ WARN_ONCE(1, "%s XDP return value %u, expect packet loss!\n",
+ act > act_max ? "Illegal" : "Driver unsupported",
+ act);
}
EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
--
1.9.3
^ permalink raw reply related
* Re: [PATCH net] Revert "mdio_bus: Remove unneeded gpiod NULL check"
From: Linus Walleij @ 2017-09-08 23:24 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev@vger.kernel.org, David S. Miller, Andrew Lunn,
Fabio Estevam, Sergei Shtylyov, Fabio Estevam, Bryan.Whitehead
In-Reply-To: <fe6846be-afc3-1025-d78a-96674e1b2a35@gmail.com>
On Sat, Sep 9, 2017 at 1:18 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> On 09/08/2017 04:13 PM, Linus Walleij wrote:
>> On Sat, Sep 9, 2017 at 12:38 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>>> This reverts commit 95b80bf3db03c2bf572a357cf74b9a6aefef0a4a ("mdio_bus:
>>> Remove unneeded gpiod NULL check"), this commit assumed that GPIOLIB
>>> checks for NULL descriptors, so it's safe to drop them, but it is not
>>> when CONFIG_GPIOLIB is disabled in the kernel. If we do call
>>> gpiod_set_value_cansleep() on a GPIO descriptor we will issue warnings
>>> coming from the inline stubs declared in include/linux/gpio/consumer.h.
>>>
>>> Fixes: 95b80bf3db03 ("mdio_bus: Remove unneeded gpiod NULL check")
>>> Reported-by: Woojung Huh <Woojung.Huh@microchip.com>
>>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>>
>> Yeah I guess you don't wanna have these messages spewing
>> in the console. :/
>>
>> But what about simply doing this:
>
> That would create another dependency which really does not need to be
> there as it really prevents you from testing more configurations,
> including but not limited to having CONFIG_GPIOLIB=n w/
> CONFIG_MDIO_DEVICE=[ym].
>
> The GPIOLIB=n inline stubs have a "contract" with the code calling them
> that is fairly clear, which is what this revert is leveraging.
Ayeah the contract is something like "you can call us if compiled out,
but then you get warnings".
Yeah NULL checks does the trick as well as #ifdef:in in that sense.
It's no big deal so if you prefer this:
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ 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