* Re: [RFC PATCH 2/2] Documentation: devictree: Add macb mdio bindings
From: Florian Fainelli @ 2016-12-03 22:40 UTC (permalink / raw)
To: Rob Herring, Harini Katakam
Cc: nicolas.ferre, davem, pawel.moll, mark.rutland, ijc+devicetree,
galak, boris.brezillon, alexandre.belloni, harinikatakamlinux,
netdev, linux-kernel, devicetree, harinik, michals
In-Reply-To: <20161203213553.f3agwvaseufglnq6@rob-hp-laptop>
Le 12/03/16 à 13:35, Rob Herring a écrit :
> On Mon, Nov 28, 2016 at 03:19:27PM +0530, Harini Katakam wrote:
>> Add documentations for macb mdio driver.
>
> Bindings document h/w, not drivers.
>
>>
>> Signed-off-by: Harini Katakam <harinik@xilinx.com>
>> ---
>> .../devicetree/bindings/net/macb-mdio.txt | 31 ++++++++++++++++++++++
>> 1 file changed, 31 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/net/macb-mdio.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/macb-mdio.txt b/Documentation/devicetree/bindings/net/macb-mdio.txt
>> new file mode 100644
>> index 0000000..014cedf
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/macb-mdio.txt
>> @@ -0,0 +1,31 @@
>> +* Cadence MACB MDIO controller
>> +
>> +Required properties:
>> +- compatible: Should be "cdns,macb-mdio"
>
> Only one version ever? This needs more specific compatible strings.
>
>> +- reg: Address and length of the register set of MAC to be used
>> +- clock-names: Tuple listing input clock names.
>> + Required elements: 'pclk', 'hclk'
>> + Optional elements: 'tx_clk'
>> +- clocks: Phandles to input clocks.
You are also missing mandatory properties:
#address-cells = <1> and #size-cells = <0>
Where is patch 1? Can you make sure you have the same recipient list for
both patches in this series so we can review both the binding and driver?
Thanks!
--
Florian
^ permalink raw reply
* Re: [PATCH net-next] net_sched: gen_estimator: account for timer drifts
From: Eric Dumazet @ 2016-12-03 21:54 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20161203.161234.605773166761239343.davem@davemloft.net>
On Sat, 2016-12-03 at 16:12 -0500, David Miller wrote:
> Applied.
Thanks David.
I also have to get rid of the WRITE_ONCE() done in est_timer(), since it
does not work properly on 32bit kernels.
It will target net-next, since it is not a very serious problem.
^ permalink raw reply
* Re: [RFC PATCH 2/2] Documentation: devictree: Add macb mdio bindings
From: Rob Herring @ 2016-12-03 21:35 UTC (permalink / raw)
To: Harini Katakam
Cc: nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ,
boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
harinikatakamlinux-Re5JQEeQqe8AvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, harinik-gjFFaj9aHVfQT0dZR+AlfA,
michals-gjFFaj9aHVfQT0dZR+AlfA
In-Reply-To: <1480326567-6132-1-git-send-email-harinik-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
On Mon, Nov 28, 2016 at 03:19:27PM +0530, Harini Katakam wrote:
> Add documentations for macb mdio driver.
Bindings document h/w, not drivers.
>
> Signed-off-by: Harini Katakam <harinik-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
> ---
> .../devicetree/bindings/net/macb-mdio.txt | 31 ++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/macb-mdio.txt
>
> diff --git a/Documentation/devicetree/bindings/net/macb-mdio.txt b/Documentation/devicetree/bindings/net/macb-mdio.txt
> new file mode 100644
> index 0000000..014cedf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/macb-mdio.txt
> @@ -0,0 +1,31 @@
> +* Cadence MACB MDIO controller
> +
> +Required properties:
> +- compatible: Should be "cdns,macb-mdio"
Only one version ever? This needs more specific compatible strings.
> +- reg: Address and length of the register set of MAC to be used
> +- clock-names: Tuple listing input clock names.
> + Required elements: 'pclk', 'hclk'
> + Optional elements: 'tx_clk'
> +- clocks: Phandles to input clocks.
> +
> +Examples:
> +
> + mdio {
> + compatible = "cdns,macb-mdio";
> + reg = <0x0 0xff0b0000 0x0 0x1000>;
> + clocks = <&clk125>, <&clk125>, <&clk125>;
> + clock-names = "pclk", "hclk", "tx_clk";
> + ethernet_phyC: ethernet-phy@C {
lowercase hex for unit addresses please
> + reg = <0xC>;
> + };
> + ethernet_phy7: ethernet-phy@7 {
> + reg = <0x7>;
> + };
> + ethernet_phy3: ethernet-phy@3 {
> + reg = <0x3>;
> + };
> + ethernet_phy8: ethernet-phy@8 {
> + reg = <0x8>;
> + };
> + };
> +
> --
> 2.7.4
>
> --
> 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
--
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 net-next] net_sched: gen_estimator: account for timer drifts
From: David Miller @ 2016-12-03 21:12 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1480695060.18162.363.camel@edumazet-glaptop3.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 02 Dec 2016 08:11:00 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> Under heavy stress, timer used in estimators tend to slowly be delayed
> by a few jiffies, leading to inaccuracies.
>
> Lets remember what was the last scheduled jiffies so that we get more
> precise estimations, without having to add a multiply/divide in the loop
> to account for the drifts.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] sfc: remove EFX_BUG_ON_PARANOID, use EFX_WARN_ON_[ONCE_]PARANOID instead
From: David Miller @ 2016-12-03 21:11 UTC (permalink / raw)
To: ecree; +Cc: linux-net-drivers, bkenward, netdev
In-Reply-To: <9435baa4-b9b5-955e-eac2-3106feb87136@solarflare.com>
From: Edward Cree <ecree@solarflare.com>
Date: Fri, 2 Dec 2016 15:51:33 +0000
> Logically, EFX_BUG_ON_PARANOID can never be correct. For, BUG_ON should
> only be used if it is not possible to continue without potential harm;
> and since the non-DEBUG driver will continue regardless (as the BUG_ON is
> compiled out), clearly the BUG_ON cannot be needed in the DEBUG driver.
> So, replace every EFX_BUG_ON_PARANOID with either an EFX_WARN_ON_PARANOID
> or the newly defined EFX_WARN_ON_ONCE_PARANOID.
>
> Signed-off-by: Edward Cree <ecree@solarflare.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] udp: be less conservative with sock rmem accounting
From: David Miller @ 2016-12-03 21:15 UTC (permalink / raw)
To: pabeni; +Cc: netdev, brouer
In-Reply-To: <d13b9808dad5f6e3fe3808bae3b4f64dfcee07fe.1480696423.git.pabeni@redhat.com>
From: Paolo Abeni <pabeni@redhat.com>
Date: Fri, 2 Dec 2016 17:35:49 +0100
> Before commit 850cbaddb52d ("udp: use it's own memory accounting
> schema"), the udp protocol allowed sk_rmem_alloc to grow beyond
> the rcvbuf by the whole current packet's truesize. After said commit
> we allow sk_rmem_alloc to exceed the rcvbuf only if the receive queue
> is empty. As reported by Jesper this cause a performance regression
> for some (small) values of rcvbuf.
>
> This commit is intended to fix the regression restoring the old
> handling of the rcvbuf limit.
>
> Reported-by: Jesper Dangaard Brouer <brouer@redhat.com>
> Fixes: 850cbaddb52d ("udp: use it's own memory accounting schema")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH] pull request for net: batman-adv 2016-12-02
From: David Miller @ 2016-12-03 21:14 UTC (permalink / raw)
To: sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <20161202161323.5990-1-sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>
From: Simon Wunderlich <sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>
Date: Fri, 2 Dec 2016 17:13:22 +0100
> here is another bugfix which we would like to see integrated into net,
> if this is possible now.
>
> Please pull or let me know of any problem!
Pulled, thanks.
^ permalink raw reply
* Re: [PATCH 1/6] net: stmmac: return error if no DMA configuration is found
From: David Miller @ 2016-12-03 21:10 UTC (permalink / raw)
To: niklas.cassel
Cc: peppe.cavallaro, alexandre.torgue, niklass, netdev, linux-kernel
In-Reply-To: <1480687910-9690-1-git-send-email-niklass@axis.com>
When you post a series of related changes as a patch set, you must
provide a proper "[PATCH 0/N] ..." posting which explains what
the series is doing at a high level, how it is doing it, and why
it is doing it that way.
Please repost this entire series with a proper header posting
included.
Thank you.
^ permalink raw reply
* Re: [PATCH net-next 0/2] samples, bpf: Refactor; Add automated tests for cgroups
From: David Miller @ 2016-12-03 21:08 UTC (permalink / raw)
To: sargun; +Cc: netdev, daniel, ast
In-Reply-To: <20161202104201.GA9217@ircssh.c.rugged-nimbus-611.internal>
From: Sargun Dhillon <sargun@sargun.me>
Date: Fri, 2 Dec 2016 02:42:03 -0800
> These two patches are around refactoring out some old, reusable code from the
> existing test_current_task_under_cgroup_user test, and adding a new, automated
> test.
>
> There is some generic cgroupsv2 setup & cleanup code, given that most
> environment still don't have it setup by default. With this code, we're able
> to pretty easily add an automated test for future cgroupsv2 functionality.
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/1] net: caif: fix ineffective error check
From: Sergei Shtylyov @ 2016-12-03 21:05 UTC (permalink / raw)
To: PanBian, Dmitry Tarnyagin, David S. Miller; +Cc: netdev, linux-kernel
In-Reply-To: <20161203153535.GA7976@bp>
On 12/03/2016 06:38 PM, Pan Bian wrote:
>>> In function caif_sktinit_module(), the check of the return value of
>>> sock_register() seems ineffective. This patch fixes it.
>>>
>>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188751
>>>
>>> Signed-off-by: Pan Bian <bianpan2016@163.com>
>>> ---
>>> net/caif/caif_socket.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
>>> index aa209b1..2a689a3 100644
>>> --- a/net/caif/caif_socket.c
>>> +++ b/net/caif/caif_socket.c
>>> @@ -1108,7 +1108,7 @@ static int caif_create(struct net *net, struct socket *sock, int protocol,
>>> static int __init caif_sktinit_module(void)
>>> {
>>> int err = sock_register(&caif_family_ops);
>>> - if (!err)
>>> + if (err)
>>> return err;
>>
>> Why not just:
>>
>> return sock_register(&caif_family_ops);
>>
> Your solution looks much cleaner.
>
> But I am not really sure whether it is the author's intention to
> return 0 anyway. Do you have any idea?
I don't think so, the error check seems to have a typo.
[...]
> Best regards,
> Pan
MBR, Sergei
^ permalink raw reply
* Re: [PATCH net-next] samples/bpf: silence compiler warnings
From: David Miller @ 2016-12-03 21:01 UTC (permalink / raw)
To: ast; +Cc: daniel, netdev
In-Reply-To: <1480645872-999847-1-git-send-email-ast@fb.com>
From: Alexei Starovoitov <ast@fb.com>
Date: Thu, 1 Dec 2016 18:31:12 -0800
> silence some of the clang compiler warnings like:
> include/linux/fs.h:2693:9: warning: comparison of unsigned enum expression < 0 is always false
> arch/x86/include/asm/processor.h:491:30: warning: taking address of packed member 'sp0' of class or structure 'x86_hw_tss' may result in an unaligned pointer value
> include/linux/cgroup-defs.h:326:16: warning: field 'cgrp' with variable sized type 'struct cgroup' not at the end of a struct or class is a GNU extension
> since they add too much noise to samples/bpf/ build.
>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Applied.
^ permalink raw reply
* Re: [PATCH 1/3] netns: publish net_generic correctly
From: David Miller @ 2016-12-03 21:00 UTC (permalink / raw)
To: adobriyan; +Cc: netdev, xemul
In-Reply-To: <20161202011134.GB31170@avx2>
All 3 patches applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH] netlink: 2-clause nla_ok()
From: David Miller @ 2016-12-03 20:54 UTC (permalink / raw)
To: adobriyan; +Cc: netdev
In-Reply-To: <20161202005906.GA31170@avx2>
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Fri, 2 Dec 2016 03:59:06 +0300
> nla_ok() consists of 3 clauses:
>
> 1) int rem >= (int)sizeof(struct nlattr)
>
> 2) u16 nla_len >= sizeof(struct nlattr)
>
> 3) u16 nla_len <= int rem
>
> The statement is that clause (1) is redundant.
>
> What it does is ensuring that "rem" is a positive number,
> so that in clause (3) positive number will be compared to positive number
> with no problems.
>
> However, "u16" fully fits into "int" and integers do not change value
> when upcasting even to signed type. Negative integers will be rejected
> by clause (3) just fine. Small positive integers will be rejected
> by transitivity of comparison operator.
>
> NOTE: all of the above DOES NOT apply to nlmsg_ok() where ->nlmsg_len is
> u32(!), so 3 clauses AND A CAST TO INT are necessary.
>
> Obligatory space savings report: -1.6 KB
...
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Looks fine, applied to net-next, thanks.
^ permalink raw reply
* Re: [net-next 0/5] use reset to set headers
From: David Miller @ 2016-12-03 20:49 UTC (permalink / raw)
To: zhangshengju; +Cc: netdev
In-Reply-To: <1480643467-4420-1-git-send-email-zhangshengju@cmss.chinamobile.com>
From: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Date: Fri, 2 Dec 2016 09:51:02 +0800
> This patch serial replace 'set' function to 'reset', since the
> offset is zero. It's not necessary to use set, reset function is
> straightforward, and will remove the unnecessary add operation in
> set function.
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/8] drivers: net: xgene: Add Jumbo and Pause frame support
From: David Miller @ 2016-12-03 20:47 UTC (permalink / raw)
To: isubramanian; +Cc: netdev, linux-arm-kernel, patches
In-Reply-To: <1480639304-18757-1-git-send-email-isubramanian@apm.com>
From: Iyappan Subramanian <isubramanian@apm.com>
Date: Thu, 1 Dec 2016 16:41:36 -0800
> This patch set adds,
>
> 1. Jumbo frame support
> 2. Pause frame based flow control
>
> and fixes RSS for non-TCP/UDP packets.
>
> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/2] net: stmmac: avoid Camelcase naming
From: David Miller @ 2016-12-03 20:24 UTC (permalink / raw)
To: clabbe.montjoie; +Cc: peppe.cavallaro, alexandre.torgue, netdev, linux-kernel
In-Reply-To: <1480605581-13350-1-git-send-email-clabbe.montjoie@gmail.com>
From: Corentin Labbe <clabbe.montjoie@gmail.com>
Date: Thu, 1 Dec 2016 16:19:40 +0100
> This patch simply rename regValue to value, like it was named in other
> mdio functions.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/7] net: ethernet: ti: cpdma: am437x: allow descs to be plased in ddr
From: David Miller @ 2016-12-03 20:34 UTC (permalink / raw)
To: grygorii.strashko
Cc: netdev, mugunthanvnm, nsekhar, linux-kernel, linux-omap,
ivan.khoronzhuk
In-Reply-To: <20161201233432.6182-2-grygorii.strashko@ti.com>
From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Thu, 1 Dec 2016 17:34:26 -0600
> @@ -167,10 +167,10 @@ static struct cpdma_control_info controls[] = {
>
> /* various accessors */
> #define dma_reg_read(ctlr, ofs) __raw_readl((ctlr)->dmaregs + (ofs))
> -#define chan_read(chan, fld) __raw_readl((chan)->fld)
> +#define chan_read(chan, fld) readl((chan)->fld)
> #define desc_read(desc, fld) __raw_readl(&(desc)->fld)
> #define dma_reg_write(ctlr, ofs, v) __raw_writel(v, (ctlr)->dmaregs + (ofs))
> -#define chan_write(chan, fld, v) __raw_writel(v, (chan)->fld)
> +#define chan_write(chan, fld, v) writel(v, (chan)->fld)
> #define desc_write(desc, fld, v) __raw_writel((u32)(v), &(desc)->fld)
Unless you want to keep running into subtle errors all over the
place wrt. register vs. memory write ordering, I strong suggest
you use strongly ordered readl/writel for all register accesses.
I see no tangible, worthwhile, advantage to using these relaxed
ordering primitives. The only result is potential bugs.
People who use the relaxed ordering primitives properly are only
doing so in extremely carefully coded sequences where a series
of writes has no dependency on main memory operations and is
explicitly completed with a barrier operation such as a read
back of a register in the same device.
That's not at all what is going on here, instead the driver is wildly
using relaxed ordered register accesses for basically everything.
This is extremely unwise and it's why you ran into this bug in the
first place.
Therefore, I absolutely require that you fix this by eliminating
any and all usese of relaxed ordering I/O accessors in this driver.
Thank you.
^ permalink raw reply
* [PATCH net-next] bpf: Preserve const register type on const OR alu ops
From: Alexei Starovoitov @ 2016-12-03 20:31 UTC (permalink / raw)
To: David S . Miller; +Cc: Daniel Borkmann, Gianluca Borello, netdev
From: Gianluca Borello <g.borello@gmail.com>
Occasionally, clang (e.g. version 3.8.1) translates a sum between two
constant operands using a BPF_OR instead of a BPF_ADD. The verifier is
currently not handling this scenario, and the destination register type
becomes UNKNOWN_VALUE even if it's still storing a constant. As a result,
the destination register cannot be used as argument to a helper function
expecting a ARG_CONST_STACK_*, limiting some use cases.
Modify the verifier to handle this case, and add a few tests to make sure
all combinations are supported, and stack boundaries are still verified
even with BPF_OR.
Signed-off-by: Gianluca Borello <g.borello@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
kernel/bpf/verifier.c | 9 ++++-
tools/testing/selftests/bpf/.gitignore | 1 +
tools/testing/selftests/bpf/test_verifier.c | 60 +++++++++++++++++++++++++++++
3 files changed, 68 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 0e742210750e..38d05da84a49 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1481,14 +1481,19 @@ static int evaluate_reg_imm_alu(struct bpf_verifier_env *env,
struct bpf_reg_state *src_reg = ®s[insn->src_reg];
u8 opcode = BPF_OP(insn->code);
- /* dst_reg->type == CONST_IMM here, simulate execution of 'add' insn.
- * Don't care about overflow or negative values, just add them
+ /* dst_reg->type == CONST_IMM here, simulate execution of 'add'/'or'
+ * insn. Don't care about overflow or negative values, just add them
*/
if (opcode == BPF_ADD && BPF_SRC(insn->code) == BPF_K)
dst_reg->imm += insn->imm;
else if (opcode == BPF_ADD && BPF_SRC(insn->code) == BPF_X &&
src_reg->type == CONST_IMM)
dst_reg->imm += src_reg->imm;
+ else if (opcode == BPF_OR && BPF_SRC(insn->code) == BPF_K)
+ dst_reg->imm |= insn->imm;
+ else if (opcode == BPF_OR && BPF_SRC(insn->code) == BPF_X &&
+ src_reg->type == CONST_IMM)
+ dst_reg->imm |= src_reg->imm;
else
mark_reg_unknown_value(regs, insn->dst_reg);
return 0;
diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore
index 3c59f96e3ed8..071431bedde8 100644
--- a/tools/testing/selftests/bpf/.gitignore
+++ b/tools/testing/selftests/bpf/.gitignore
@@ -1,2 +1,3 @@
test_verifier
test_maps
+test_lru_map
diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
index 5da2e9d7689c..8d71e44b319d 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -2683,6 +2683,66 @@ static struct bpf_test tests[] = {
.errstr_unpriv = "R0 pointer arithmetic prohibited",
.result_unpriv = REJECT,
},
+ {
+ "constant register |= constant should keep constant type",
+ .insns = {
+ BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -48),
+ BPF_MOV64_IMM(BPF_REG_2, 34),
+ BPF_ALU64_IMM(BPF_OR, BPF_REG_2, 13),
+ BPF_MOV64_IMM(BPF_REG_3, 0),
+ BPF_EMIT_CALL(BPF_FUNC_probe_read),
+ BPF_EXIT_INSN(),
+ },
+ .result = ACCEPT,
+ .prog_type = BPF_PROG_TYPE_TRACEPOINT,
+ },
+ {
+ "constant register |= constant should not bypass stack boundary checks",
+ .insns = {
+ BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -48),
+ BPF_MOV64_IMM(BPF_REG_2, 34),
+ BPF_ALU64_IMM(BPF_OR, BPF_REG_2, 24),
+ BPF_MOV64_IMM(BPF_REG_3, 0),
+ BPF_EMIT_CALL(BPF_FUNC_probe_read),
+ BPF_EXIT_INSN(),
+ },
+ .errstr = "invalid stack type R1 off=-48 access_size=58",
+ .result = REJECT,
+ .prog_type = BPF_PROG_TYPE_TRACEPOINT,
+ },
+ {
+ "constant register |= constant register should keep constant type",
+ .insns = {
+ BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -48),
+ BPF_MOV64_IMM(BPF_REG_2, 34),
+ BPF_MOV64_IMM(BPF_REG_4, 13),
+ BPF_ALU64_REG(BPF_OR, BPF_REG_2, BPF_REG_4),
+ BPF_MOV64_IMM(BPF_REG_3, 0),
+ BPF_EMIT_CALL(BPF_FUNC_probe_read),
+ BPF_EXIT_INSN(),
+ },
+ .result = ACCEPT,
+ .prog_type = BPF_PROG_TYPE_TRACEPOINT,
+ },
+ {
+ "constant register |= constant register should not bypass stack boundary checks",
+ .insns = {
+ BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
+ BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -48),
+ BPF_MOV64_IMM(BPF_REG_2, 34),
+ BPF_MOV64_IMM(BPF_REG_4, 24),
+ BPF_ALU64_REG(BPF_OR, BPF_REG_2, BPF_REG_4),
+ BPF_MOV64_IMM(BPF_REG_3, 0),
+ BPF_EMIT_CALL(BPF_FUNC_probe_read),
+ BPF_EXIT_INSN(),
+ },
+ .errstr = "invalid stack type R1 off=-48 access_size=58",
+ .result = REJECT,
+ .prog_type = BPF_PROG_TYPE_TRACEPOINT,
+ },
};
static int probe_filter_length(const struct bpf_insn *fp)
--
2.8.0
^ permalink raw reply related
* Re: [PATCH -next] net: ethernet: ti: davinci_cpdma: add missing EXPORTs
From: David Miller @ 2016-12-03 20:27 UTC (permalink / raw)
To: paul.gortmaker
Cc: ivan.khoronzhuk, mugunthanvnm, grygorii.strashko, linux-omap,
netdev
In-Reply-To: <20161201202528.12531-1-paul.gortmaker@windriver.com>
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Thu, 1 Dec 2016 15:25:28 -0500
> As of commit 8f32b90981dcdb355516fb95953133f8d4e6b11d
> ("net: ethernet: ti: davinci_cpdma: add set rate for a channel") the
> ARM allmodconfig builds would fail modpost with:
>
> ERROR: "cpdma_chan_set_weight" [drivers/net/ethernet/ti/ti_cpsw.ko] undefined!
> ERROR: "cpdma_chan_get_rate" [drivers/net/ethernet/ti/ti_cpsw.ko] undefined!
> ERROR: "cpdma_chan_get_min_rate" [drivers/net/ethernet/ti/ti_cpsw.ko] undefined!
> ERROR: "cpdma_chan_set_rate" [drivers/net/ethernet/ti/ti_cpsw.ko] undefined!
>
> Since these weren't declared as static, it is assumed they were
> meant to be shared outside the file, and that modular build testing
> was simply overlooked.
>
> Fixes: 8f32b90981dc ("net: ethernet: ti: davinci_cpdma: add set rate for a channel")
> Cc: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> Cc: Mugunthan V N <mugunthanvnm@ti.com>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Cc: linux-omap@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Applied.
^ permalink raw reply
* Re: pull-request: can-next 2016-12-01,pull-request: can-next 2016-12-01
From: David Miller @ 2016-12-03 20:27 UTC (permalink / raw)
To: mkl; +Cc: netdev, kernel, linux-can
In-Reply-To: <de63a1d8-2822-2d98-973c-c1b2f8c493cf@pengutronix.de>
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Thu, 1 Dec 2016 21:21:44 +0100
> this is a pull request of 4 patches for net-next/master.
>
> There are two patches by Chris Paterson for the rcar_can and rcar_canfd
> device tree binding documentation. And a patch by Geert Uytterhoeven
> that corrects the order of interrupt specifiers.
>
> The fourth patch by Colin Ian King fixes a spelling error in the
> kvaser_usb driver.
Pulled, thanks.
^ permalink raw reply
* Re: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX checksum flag to stack
From: David Miller @ 2016-12-03 20:25 UTC (permalink / raw)
To: salil.mehta; +Cc: yisen.zhuang, mehta.salil.lnk, netdev, linux-kernel, linuxarm
In-Reply-To: <F4CC6FACFEB3C54C9141D49AD221F7F91A7D5EF1@lhreml503-mbx>
From: Salil Mehta <salil.mehta@huawei.com>
Date: Thu, 1 Dec 2016 16:59:14 +0000
> It looks to me the cumbersome check in the PATCH V2 should
> be retained.
I really want something simpler with small checks that are
done in logical pieces in a straigtforward progression.
The code in V2 is completely unreadable.
^ permalink raw reply
* Re: [PATCH 2/2] net: stmmac: unify mdio functions
From: David Miller @ 2016-12-03 20:24 UTC (permalink / raw)
To: clabbe.montjoie; +Cc: peppe.cavallaro, alexandre.torgue, netdev, linux-kernel
In-Reply-To: <1480605581-13350-2-git-send-email-clabbe.montjoie@gmail.com>
From: Corentin Labbe <clabbe.montjoie@gmail.com>
Date: Thu, 1 Dec 2016 16:19:41 +0100
> stmmac_mdio_{read|write} and stmmac_mdio_{read|write}_gmac4 are not
> enought different for being split.
> The only differences between thoses two functions are shift/mask for
> addr/reg/clk_csr.
>
> This patch introduce a per platform set of variable for setting thoses
> shift/mask and unify mdio read and write functions.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog
From: Daniel Borkmann @ 2016-12-03 20:21 UTC (permalink / raw)
To: Martin KaFai Lau, Jesper Dangaard Brouer
Cc: netdev, Alexei Starovoitov, Brenden Blanco, David Miller,
Saeed Mahameed, Tariq Toukan, Kernel Team
In-Reply-To: <20161203193249.GC70461@kafai-mba.local>
On 12/03/2016 08:32 PM, Martin KaFai Lau wrote:
> On Sat, Dec 03, 2016 at 04:24:13PM +0100, Jesper Dangaard Brouer wrote:
>> On Fri, 2 Dec 2016 15:23:30 -0800
>> Martin KaFai Lau <kafai@fb.com> wrote:
>>
>>> -bool bpf_helper_changes_skb_data(void *func)
>>> +BPF_CALL_2(bpf_xdp_adjust_head, struct xdp_buff *, xdp, int, offset)
>>> +{
>>> + /* Both mlx4 and mlx5 driver align each packet to PAGE_SIZE when
>>> + * XDP prog is set.
>>> + * If the above is not true for the other drivers to support
>>> + * bpf_xdp_adjust_head, struct xdp_buff can be extended.
>>> + */
>>> + void *head = (void *)((unsigned long)xdp->data & PAGE_MASK);
>>> + void *new_data = xdp->data + offset;
>>> +
>>> + if (new_data < head || new_data >= xdp->data_end)
>>> + /* The packet length must be >=1 */
>>> + return -EINVAL;
>>> +
>>> + xdp->data = new_data;
>>> +
>>> + return 0;
>>> +}
>>
>> First time I read this code, I was about to complain about you didn't
>> use XDP_PACKET_HEADROOM in your boundary check. But then I noticed the
>> PAGE_MASK. If you rename "head" to "page_boundary" or "page_start"
>> then IMHO the code would be more readable.
> bpf_xdp_adjust_head() could be called multiple times. Hence,
> XDP_PACKET_HEADROOM is not used in the boundary check.
>
> My thinking is "head" here can closely resemble the meaning of
> skb->head as a boundary. I think missing the info on
> what head it is could be the confusing part.
>
> Instead of skb boundary (there is no skb here) or
> page boundary (other future XDP driver may not align like mlx4/5),
> I think may be "pkt_head" can give more clarity here and also
> for furture XDP-capble driver?
I think as-is with head is also fine with me, but if it should be
something better readable (?), perhaps as such (modulo the min len
part):
BPF_CALL_2(bpf_xdp_adjust_head, struct xdp_buff *, xdp, int, offset)
{
unsigned long addr = (unsigned long)xdp->data & PAGE_MASK;
void *data_hard_start = (void *)addr;
void *data = xdp->data + offset;
if (unlikely(data < data_hard_start || data >= xdp->data_end))
return -EINVAL;
xdp->data = data;
return 0;
}
Thanks,
Daniel
^ permalink raw reply
* Re: [PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog
From: Martin KaFai Lau @ 2016-12-03 19:32 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: netdev, Alexei Starovoitov, Brenden Blanco, Daniel Borkmann,
David Miller, Saeed Mahameed, Tariq Toukan, Kernel Team
In-Reply-To: <20161203162413.5f305f9f@redhat.com>
On Sat, Dec 03, 2016 at 04:24:13PM +0100, Jesper Dangaard Brouer wrote:
> On Fri, 2 Dec 2016 15:23:30 -0800
> Martin KaFai Lau <kafai@fb.com> wrote:
>
> > -bool bpf_helper_changes_skb_data(void *func)
> > +BPF_CALL_2(bpf_xdp_adjust_head, struct xdp_buff *, xdp, int, offset)
> > +{
> > + /* Both mlx4 and mlx5 driver align each packet to PAGE_SIZE when
> > + * XDP prog is set.
> > + * If the above is not true for the other drivers to support
> > + * bpf_xdp_adjust_head, struct xdp_buff can be extended.
> > + */
> > + void *head = (void *)((unsigned long)xdp->data & PAGE_MASK);
> > + void *new_data = xdp->data + offset;
> > +
> > + if (new_data < head || new_data >= xdp->data_end)
> > + /* The packet length must be >=1 */
> > + return -EINVAL;
> > +
> > + xdp->data = new_data;
> > +
> > + return 0;
> > +}
>
> First time I read this code, I was about to complain about you didn't
> use XDP_PACKET_HEADROOM in your boundary check. But then I noticed the
> PAGE_MASK. If you rename "head" to "page_boundary" or "page_start"
> then IMHO the code would be more readable.
bpf_xdp_adjust_head() could be called multiple times. Hence,
XDP_PACKET_HEADROOM is not used in the boundary check.
My thinking is "head" here can closely resemble the meaning of
skb->head as a boundary. I think missing the info on
what head it is could be the confusing part.
Instead of skb boundary (there is no skb here) or
page boundary (other future XDP driver may not align like mlx4/5),
I think may be "pkt_head" can give more clarity here and also
for furture XDP-capble driver?
^ permalink raw reply
* Re: [PATCH] irda: w83977af_ir: fix damaged whitespace
From: David Miller @ 2016-12-03 20:09 UTC (permalink / raw)
To: arnd; +Cc: samuel, netdev, linux-kernel
In-Reply-To: <20161128141951.2674778-1-arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 28 Nov 2016 15:19:43 +0100
> As David Miller pointed out for for the previous patch, the whitespace
> in some functions looks rather odd. This was caused by commit 6329da5f258a
> ("obsolete config in kernel source: USE_INTERNAL_TIMER"), which removed
> some conditions but did not reindent the code.
>
> This fixes the indentation in the file and removes extraneous whitespace
> at the end of the lines and before tabs.
>
> There are many other minor coding style problems in the driver, but I'm
> not touching those here.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks Arnd.
^ 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