* Re: [PATCH net-next v3 5/7] MIPS: mscc: Add switch to ocelot
From: Andrew Lunn @ 2018-05-14 20:49 UTC (permalink / raw)
To: Alexandre Belloni
Cc: David S . Miller, Allan Nielsen, razvan.stefanescu, po.liu,
Thomas Petazzoni, Florian Fainelli, netdev, linux-kernel,
linux-mips, James Hogan
In-Reply-To: <20180514200500.2953-6-alexandre.belloni@bootlin.com>
On Mon, May 14, 2018 at 10:04:58PM +0200, Alexandre Belloni wrote:
> Ocelot has an integrated switch, add support for it.
>
> Cc: James Hogan <jhogan@kernel.org>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* Re: [PATCH net-next v3 3/7] dt-bindings: net: add DT bindings for Microsemi Ocelot Switch
From: Andrew Lunn @ 2018-05-14 20:49 UTC (permalink / raw)
To: Alexandre Belloni
Cc: David S . Miller, Allan Nielsen, razvan.stefanescu, po.liu,
Thomas Petazzoni, Florian Fainelli, netdev, linux-kernel,
linux-mips
In-Reply-To: <20180514200500.2953-4-alexandre.belloni@bootlin.com>
On Mon, May 14, 2018 at 10:04:56PM +0200, Alexandre Belloni wrote:
> DT bindings for the Ethernet switch found on Microsemi Ocelot platforms.
>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* Re: [PATCH net-next v3 1/7] dt-bindings: net: add DT bindings for Microsemi MIIM
From: Andrew Lunn @ 2018-05-14 20:47 UTC (permalink / raw)
To: Alexandre Belloni
Cc: David S . Miller, Allan Nielsen, razvan.stefanescu, po.liu,
Thomas Petazzoni, Florian Fainelli, netdev, linux-kernel,
linux-mips
In-Reply-To: <20180514200500.2953-2-alexandre.belloni@bootlin.com>
On Mon, May 14, 2018 at 10:04:54PM +0200, Alexandre Belloni wrote:
> DT bindings for the Microsemi MII Management Controller found on Microsemi
> SoCs
>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* Re: [PATCH bpf-next 3/4] samples: bpf: fix build after move to compiling full libbpf.a
From: Jakub Kicinski @ 2018-05-14 20:47 UTC (permalink / raw)
To: Y Song
Cc: Alexei Starovoitov, Daniel Borkmann, oss-drivers, netdev,
Björn Töpel
In-Reply-To: <CAH3MdRW5160A5pN1ZndMHxiK142aaQF1xxk022HyrhGTsRjUxA@mail.gmail.com>
On Mon, 14 May 2018 12:12:05 -0700, Y Song wrote:
> On Fri, May 11, 2018 at 5:17 PM, Jakub Kicinski
> <jakub.kicinski@netronome.com> wrote:
> > There are many ways users may compile samples, some of them got
> > broken by commit 5f9380572b4b ("samples: bpf: compile and link
> > against full libbpf"). Improve path resolution and make libbpf
> > building a dependency of source files to force its build.
> >
> > Samples should now again build with any of:
> > cd samples/bpf; make
> > make samples/bpf
> > make -C samples/bpf
> > cd samples/bpf; make O=builddir
> > make samples/bpf O=builddir
> > make -C samples/bpf O=builddir
>
> I typically built samples/bpf/ this way:
> export KBUILD_OUTPUT=/home/yhs/linux-bld
> at linux source directory:
> make defconfig
> in /home/yhs/linux-bld,
> make -j100 && make headers_install && make samples/bpf/
Thanks Yonghong! I will add this to my tests.
> With this patch, the build for samples/bpf/ still failed.
>
> -bash-4.2$ make samples/bpf/
> CHK include/config/kernel.release
> Using /data/users/yhs/work/net-next as source for kernel
> GEN ./Makefile
> CHK include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> CHK include/generated/bounds.h
> CHK include/generated/timeconst.h
> CHK include/generated/asm-offsets.h
> CALL /data/users/yhs/work/net-next/scripts/checksyscalls.sh
> DESCEND objtool
> CHK scripts/mod/devicetable-offsets.h
> scripts/Makefile.host:106: target
> `samples/bpf//data/users/yhs/work/net-next/samples/bpf/../../tools/lib/bpf/libbpf.a'
> doesn't match the target pattern
> make -C /data/users/yhs/work/net-next/samples/bpf/../../tools/lib/bpf/
> O= srctree=/data/users/yhs/work/net-next/samples/bpf/../../
>
> Auto-detecting system features:
> ... libelf: [ OFF ]
> ... bpf: [ OFF ]
>
> No libelf found
The problem now is that feature detection gets confused about where
its output directory is, I think. This is very similar to what Björn
reported.
> make[4]: *** [elfdep] Error 1
> make[3]: *** [/data/users/yhs/work/net-next/samples/bpf/../../tools/lib/bpf/libbpf.a]
> Error 2
> make[2]: *** [samples/bpf/] Error 2
> make[1]: *** [sub-make] Error 2
> make: *** [__sub-make] Error 2
> -bash-4.2$
>
> I noticied that I might use BPF_SAMPLES_PATH variable to tell where is
> the samples/bpf source.
> Below is what I did:
> -bash-4.2$ BPF_SAMPLES_PATH=../../../net-next/samples/bpf make
> samples/bpf/
> CHK include/config/kernel.release
> Using /data/users/yhs/work/net-next as source for kernel
> GEN ./Makefile
> CHK include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> CHK include/generated/bounds.h
> CHK include/generated/timeconst.h
> CHK include/generated/asm-offsets.h
> CALL /data/users/yhs/work/net-next/scripts/checksyscalls.sh
> DESCEND objtool
> CHK scripts/mod/devicetable-offsets.h
> scripts/Makefile.host:106: target
> `samples/bpf/../../../net-next/samples/bpf/../../tools/lib/bpf/libbpf.a'
> doesn't match the target pattern
> CHK samples/bpf/syscall_nrs.h
> HOSTCC samples/bpf/../../../net-next/samples/bpf/../../tools/lib/bpf/libbpf.a
> gcc: fatal error: no input files
> compilation terminated.
> make[3]: *** [samples/bpf/../../../net-next/samples/bpf/../../tools/lib/bpf/libbpf.a]
> Error 4
> make[2]: *** [samples/bpf/] Error 2
> make[1]: *** [sub-make] Error 2
> make: *** [__sub-make] Error 2
> -bash-4.2$
>
> -bash-4.2$ pwd
> /home/yhs/work
> -bash-4.2$ ls
> linux-bld net-next
> -bash-4.2$
^ permalink raw reply
* Re: [PATCH net-next] sched: cls: enable verbose logging
From: Marcelo Ricardo Leitner @ 2018-05-14 20:47 UTC (permalink / raw)
To: Cong Wang
Cc: Linux Kernel Network Developers, Jakub Kicinski, David Ahern,
Stephen Hemminger, Jiri Pirko, Alexander Aring, Jamal Hadi Salim
In-Reply-To: <CAM_iQpXhmp3Hfj0c0Ryiw=md+ZVb6+it1=fL5ZKhY1m8aq44Qg@mail.gmail.com>
On Mon, May 14, 2018 at 01:30:53PM -0700, Cong Wang wrote:
> On Sun, May 13, 2018 at 1:44 PM, Marcelo Ricardo Leitner
> <marcelo.leitner@gmail.com> wrote:
> > Currently, when the rule is not to be exclusively executed by the
> > hardware, extack is not passed along and offloading failures don't
> > get logged. The idea was that hardware failures are okay because the
> > rule will get executed in software then and this way it doesn't confuse
> > unware users.
> >
> > But this is not helpful in case one needs to understand why a certain
> > rule failed to get offloaded. Considering it may have been a temporary
> > failure, like resources exceeded or so, reproducing it later and knowing
> > that it is triggering the same reason may be challenging.
>
> I fail to understand why you need a flag here, IOW, why not just pass
> extack unconditionally?
Because (as discussed in the RFC[1], should have linked it here) it
could confuse users that are not aware of offloading and, in other
cases, it can be just noise (like it would be right now for ebpf,
which is mostly used in sw-path).
1.https://www.mail-archive.com/netdev@vger.kernel.org/msg223016.html
^ permalink raw reply
* Re: [PATCH 00/14] Modify action API for implementing lockless actions
From: Vlad Buslov @ 2018-05-14 20:46 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: netdev, davem, xiyou.wangcong, jiri, pablo, kadlec, fw, ast,
daniel, edumazet, keescook, linux-kernel, netfilter-devel,
coreteam, kliteyn
In-Reply-To: <23f37e5a-dd30-0ad3-a5ab-df22bf0ad7f9@mojatatu.com>
On Mon 14 May 2018 at 18:03, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> On 14/05/18 10:27 AM, Vlad Buslov wrote:
>> Currently, all netlink protocol handlers for updating rules, actions and
>> qdiscs are protected with single global rtnl lock which removes any
>> possibility for parallelism. This patch set is a first step to remove
>> rtnl lock dependency from TC rules update path. It updates act API to
>> use atomic operations, rcu and spinlocks for fine-grained locking. It
>> also extend API with functions that are needed to update existing
>> actions for parallel execution.
>>
>> Outline of changes:
>> - Change tc action to use atomic reference and bind counters, rcu
>> mechanism for cookie update.
>> - Extend action ops API with 'delete' function and 'unlocked' flag.
>> - Change action API to work with actions in lockless manner based on
>> primitives implemented in previous patches.
>> - Extend action API with new functions necessary to implement unlocked
>> actions.
>
> Please run all the tdc tests with these changes. This area has almost
> good test coverage at this point. If you need help just ping me.
>
> cheers,
> jamal
Hello Jamal,
I'm trying to run tdc, but keep getting following error even on clean
branch without my patches:
Test d190: Add police action with maximum index
-----> teardown stage *** Could not execute: "$TC actions flush action mirred"
-----> teardown stage *** Error message: "RTNETLINK answers: Invalid argument
We have an error flushing
"
-----> teardown stage *** Aborting test run.
<_io.BufferedReader name=3> *** stdout ***
<_io.BufferedReader name=5> *** stderr ***
"-----> teardown stage" did not complete successfully
Exception <class '__main__.PluginMgrTestFail'> ('teardown', 'RTNETLINK answers: Invalid argument\nWe have an error talking to the kernel\nCommand "action" is unknown, try "tc actions help".\n', '"-----> teardown stage" did not complete suc
cessfully') (caught in test_runner, running test 54 d190 Add police action with maximum index stage teardown)
---------------
traceback
File "./tdc.py", line 293, in test_runner
tap += run_one_test(pm, args, index, tidx)
File "./tdc.py", line 229, in run_one_test
prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout)
File "./tdc.py", line 177, in prepare_env
'"{}" did not complete successfully'.format(prefix))
---------------
accumulated output for this test:
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
Command "action" is unknown, try "tc actions help".
---------------
I've updated both iproute2 and kernel to latest master and net-next
respectively, but error persists. Am I missing something? Maybe I should
you some specific "blessed" version of TC?
Thanks,
Vlad
^ permalink raw reply
* Re: [PATCH net-next] cxgb4: do not fail vf instatiation in slave mode
From: David Miller @ 2018-05-14 20:45 UTC (permalink / raw)
To: ganeshgr; +Cc: netdev, nirranjan, indranil, venkatesh, arjun, leedom
In-Reply-To: <1526284483-10431-1-git-send-email-ganeshgr@chelsio.com>
From: Ganesh Goudar <ganeshgr@chelsio.com>
Date: Mon, 14 May 2018 13:24:43 +0530
> From: Arjun Vynipadath <arjun@chelsio.com>
>
> We no longer require a check for cxgb4 to be MASTER
> when configuring SRIOV, It was required when we had
> module parameter to instantiate vf.
>
> Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
> Signed-off-by: Casey Leedom <leedom@chelsio.com>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] mlxsw: spectrum_span: Support LAG under mirror-to-gretap
From: David Miller @ 2018-05-14 20:45 UTC (permalink / raw)
To: idosch; +Cc: netdev, jiri, petrm, mlxsw
In-Reply-To: <20180514064044.17820-1-idosch@mellanox.com>
From: Ido Schimmel <idosch@mellanox.com>
Date: Mon, 14 May 2018 09:40:44 +0300
> From: Petr Machata <petrm@mellanox.com>
>
> When resolving a path that the packet will take after being encapsulated
> in mirror-to-gretap scenarios, one of the devices en route could be a
> LAG. In that case, mirror to first up slave that corresponds to a front
> panel port.
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Applied.
^ permalink raw reply
* Re: linux-next: manual merge of the bpf-next tree with the bpf tree
From: Jakub Kicinski @ 2018-05-14 20:41 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Daniel Borkmann, Alexei Starovoitov, Networking,
Linux-Next Mailing List, Linux Kernel Mailing List
In-Reply-To: <20180514115700.0faadd6f@canb.auug.org.au>
On Mon, 14 May 2018 11:57:00 +1000, Stephen Rothwell wrote:
> diff --cc tools/lib/bpf/libbpf.c
> index 8da4eeb101a6,df54c4c9e48a..000000000000
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@@ -2163,9 -2193,12 +2193,12 @@@ int bpf_prog_load_xattr(const struct bp
>
> if (!attr)
> return -EINVAL;
> + if (!attr->file)
> + return -EINVAL;
>
> - obj = bpf_object__open(attr->file);
> + obj = __bpf_object__open(attr->file, NULL, 0,
> + bpf_prog_type__needs_kver(attr->prog_type));
> - if (IS_ERR(obj))
> + if (IS_ERR_OR_NULL(obj))
> return -ENOENT;
This is okay, thanks. The OR_NULL is unnecessary just using the
bpf-next code is a better merge IMO.
^ permalink raw reply
* Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
From: Jason Gunthorpe @ 2018-05-14 20:41 UTC (permalink / raw)
To: Steve Wise; +Cc: dsahern, leon, stephen, netdev, linux-rdma
In-Reply-To: <1a0d146dffb17449aa6d8a6b6d06e865e69226de.1525709213.git.swise@opengridcomputing.com>
On Mon, May 07, 2018 at 08:53:16AM -0700, Steve Wise wrote:
> This enhancement allows printing rdma device-specific state, if provided
> by the kernel. This is done in a generic manner, so rdma tool doesn't
> need to know about the details of every type of rdma device.
>
> Driver attributes for a rdma resource are in the form of <key,
> [print_type], value> tuples, where the key is a string and the value can
> be any supported driver attribute. The print_type attribute, if present,
> provides a print format to use vs the standard print format for the type.
> For example, the default print type for a PROVIDER_S32 value is "%d ",
> but "0x%x " if the print_type of PRINT_TYPE_HEX is included inthe tuple.
>
> Driver resources are only printed when the -dd flag is present.
> If -p is present, then the output is formatted to not exceed 80 columns,
> otherwise it is printed as a single row to be grep/awk friendly.
>
> Example output:
>
> # rdma resource show qp lqpn 1028 -dd -p
> link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma]
> sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0
> size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00
> rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408 idx 40 wr_id 0xffff881057c033f0
Hey some of these look like kernel pointers.. That is a no-no.. What
is up there?
The wr_id often contains a pointer, right? So we cannot just pass it
to user space..
Jason
^ permalink raw reply
* Re: [PATCH] net/smc: check for missing nlattrs in SMC_PNETID messages
From: David Miller @ 2018-05-14 20:41 UTC (permalink / raw)
To: ebiggers3
Cc: ubraun, tmricht, linux-s390, netdev, syzkaller-bugs, linux-kernel,
ebiggers
In-Reply-To: <20180514000130.13780-1-ebiggers3@gmail.com>
From: Eric Biggers <ebiggers3@gmail.com>
Date: Sun, 13 May 2018 17:01:30 -0700
> From: Eric Biggers <ebiggers@google.com>
>
> It's possible to crash the kernel in several different ways by sending
> messages to the SMC_PNETID generic netlink family that are missing the
> expected attributes:
>
> - Missing SMC_PNETID_NAME => null pointer dereference when comparing
> names.
> - Missing SMC_PNETID_ETHNAME => null pointer dereference accessing
> smc_pnetentry::ndev.
> - Missing SMC_PNETID_IBNAME => null pointer dereference accessing
> smc_pnetentry::smcibdev.
> - Missing SMC_PNETID_IBPORT => out of bounds array access to
> smc_ib_device::pattr[-1].
>
> Fix it by validating that all expected attributes are present and that
> SMC_PNETID_IBPORT is nonzero.
>
> Reported-by: syzbot+5cd61039dc9b8bfa6e47@syzkaller.appspotmail.com
> Fixes: 6812baabf24d ("smc: establish pnet table management")
> Cc: <stable@vger.kernel.org> # v4.11+
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH net-next] sched: cls: enable verbose logging
From: David Miller @ 2018-05-14 20:40 UTC (permalink / raw)
To: xiyou.wangcong
Cc: marcelo.leitner, netdev, kubakici, dsahern, stephen, jiri, aring,
jhs
In-Reply-To: <CAM_iQpXhmp3Hfj0c0Ryiw=md+ZVb6+it1=fL5ZKhY1m8aq44Qg@mail.gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Mon, 14 May 2018 13:30:53 -0700
> I fail to understand why you need a flag here, IOW, why not just pass
> extack unconditionally?
It will confuse users, so isn't passed up by default.
^ permalink raw reply
* Re: [PATCH net-next] sched: cls: enable verbose logging
From: Cong Wang @ 2018-05-14 20:30 UTC (permalink / raw)
To: Marcelo Ricardo Leitner
Cc: Linux Kernel Network Developers, Jakub Kicinski, David Ahern,
Stephen Hemminger, Jiri Pirko, Alexander Aring, Jamal Hadi Salim
In-Reply-To: <763cd60ed7addf605daf8b77c8639c5c08ada219.1526243501.git.marcelo.leitner@gmail.com>
On Sun, May 13, 2018 at 1:44 PM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
> Currently, when the rule is not to be exclusively executed by the
> hardware, extack is not passed along and offloading failures don't
> get logged. The idea was that hardware failures are okay because the
> rule will get executed in software then and this way it doesn't confuse
> unware users.
>
> But this is not helpful in case one needs to understand why a certain
> rule failed to get offloaded. Considering it may have been a temporary
> failure, like resources exceeded or so, reproducing it later and knowing
> that it is triggering the same reason may be challenging.
I fail to understand why you need a flag here, IOW, why not just pass
extack unconditionally?
^ permalink raw reply
* Re: [PATCH v2] net/mlx4_core: Fix error handling in mlx4_init_port_info.
From: David Miller @ 2018-05-14 20:29 UTC (permalink / raw)
To: tarick; +Cc: tariqt, gthelen, netdev, linux-rdma, linux-kernel
In-Reply-To: <20180513233845.135290-1-tarick@google.com>
From: Tarick Bedeir <tarick@google.com>
Date: Sun, 13 May 2018 16:38:45 -0700
> Avoid exiting the function with a lingering sysfs file (if the first
> call to device_create_file() fails while the second succeeds), and avoid
> calling devlink_port_unregister() twice.
>
> In other words, either mlx4_init_port_info() succeeds and returns zero, or
> it fails, returns non-zero, and requires no cleanup.
>
> Fixes: 096335b3f983 ("mlx4_core: Allow dynamic MTU configuration for IB
> ports")
> Signed-off-by: Tarick Bedeir <tarick@google.com>
> ---
> v1 -> v2: Added "Fixes" tag.
Applied and queued up for -stable.
^ permalink raw reply
* Re: [PATCH] net: ethernet: ti: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
From: David Miller @ 2018-05-14 20:28 UTC (permalink / raw)
To: hernan; +Cc: grygorii.strashko, richardcochran, netdev, linux-kernel
In-Reply-To: <1526254429-4276-1-git-send-email-hernan@vanguardiasur.com.ar>
From: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Date: Sun, 13 May 2018 20:33:49 -0300
> Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)).
>
> drivers/net/ethernet/ti/cpts.c:567:9-16: WARNING: ERR_CAST can be used with cpts->refclk
> Generated by: scripts/coccinelle/api/err_cast.cocci
>
> Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Applied to net-next, thank you.
^ permalink raw reply
* Re: [PATCH net-next] sched: cls: enable verbose logging
From: David Miller @ 2018-05-14 20:27 UTC (permalink / raw)
To: marcelo.leitner
Cc: netdev, kubakici, dsahern, stephen, jiri, aring, jhs,
xiyou.wangcong
In-Reply-To: <763cd60ed7addf605daf8b77c8639c5c08ada219.1526243501.git.marcelo.leitner@gmail.com>
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Sun, 13 May 2018 17:44:27 -0300
> Currently, when the rule is not to be exclusively executed by the
> hardware, extack is not passed along and offloading failures don't
> get logged. The idea was that hardware failures are okay because the
> rule will get executed in software then and this way it doesn't confuse
> unware users.
>
> But this is not helpful in case one needs to understand why a certain
> rule failed to get offloaded. Considering it may have been a temporary
> failure, like resources exceeded or so, reproducing it later and knowing
> that it is triggering the same reason may be challenging.
>
> The ultimate goal is to improve Open vSwitch debuggability when using
> flower offloading.
>
> This patch adds a new flag to enable verbose logging. With the flag set,
> extack will be passed to the driver, which will be able to log the
> error. As the operation itself probably won't fail (not because of this,
> at least), current iproute will already log it as a Warning.
>
> The flag is generic, so it can be reused later. No need to restrict it
> just for HW offloading. The command line will follow the syntax that
> tc-ebpf already uses, tc ... [ verbose ] ... , and extend its meaning.
>
> For example:
> # ./tc qdisc add dev p7p1 ingress
> # ./tc filter add dev p7p1 parent ffff: protocol ip prio 1 \
> flower verbose \
> src_mac ed:13:db:00:00:00 dst_mac 01:80:c2:00:00:d0 \
> src_ip 56.0.0.0 dst_ip 55.0.0.0 action drop
> Warning: TC offload is disabled on net device.
> # echo $?
> 0
> # ./tc filter add dev p7p1 parent ffff: protocol ip prio 1 \
> flower \
> src_mac ff:13:db:00:00:00 dst_mac 01:80:c2:00:00:d0 \
> src_ip 56.0.0.0 dst_ip 55.0.0.0 action drop
> # echo $?
> 0
>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Applied, thank you.
^ permalink raw reply
* Re: iproute2 - modifying routes in place
From: David Ahern @ 2018-05-14 20:20 UTC (permalink / raw)
To: Ryan Whelan; +Cc: netdev
In-Reply-To: <CAM3m09SGxsBhxeQoM8GNjMCryUjpMPqon3OYrdO3_FKmp91z3Q@mail.gmail.com>
On 5/14/18 2:10 PM, Ryan Whelan wrote:
> On Mon, May 14, 2018 at 2:49 PM David Ahern <dsahern@gmail.com> wrote:
>
>> On 5/14/18 12:40 PM, Ryan Whelan wrote:
>>> Same behavior:
>>>
>>>
>>> root@rwhelan-linux ~
>>> # ip -6 route
>>> ::1 dev lo proto kernel metric 256 pref medium
>>> fd9b:caee:ff93:ceef:3431:3831:3930:3031 dev internal0 proto kernel
> metric
>>> 256 pref medium
>>> fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 src
>>> fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 1024 pref medium
>>> fe80::/64 dev enp0s3 proto kernel metric 256 pref medium
>>> fe80::/64 dev enp0s8 proto kernel metric 256 pref medium
>>> fe80::/64 dev internal0 proto kernel metric 256 pref medium
>>>
>>> root@rwhelan-linux ~
>>> # ip -6 route change fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev
> internal0
>>> src fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 10
>>> RTNETLINK answers: No such file or directory
>
>> 'change' only sets NLM_F_REPLACE. Since NLM_F_CREATE is not set ('ip ro
>> replace') it does not add a new route and expects one to exist. Your
>> table above shows the prefix with metric 256 not metric 10 so the route
>> does not match. You should be seeing a message in dmesg to this effect.
>
>
> Is there a syntax for changing a route in-place? Specifically, i'm
> interesting in changing the metric of currently existing routes.
>
No. Metric is one of the keys. You will need to insert and delete.
^ permalink raw reply
* Re: [PATCH ghak81 RFC V2 2/5] audit: convert sessionid unset to a macro
From: Paul Moore @ 2018-05-14 20:15 UTC (permalink / raw)
To: Richard Guy Briggs
Cc: Linux-Audit Mailing List, LKML,
Linux NetDev Upstream Mailing List, Netfilter Devel List,
Linux Security Module list, Integrity Measurement Architecture,
SElinux list, Eric Paris, Steve Grubb, Ingo Molnar, David Howells
In-Reply-To: <d9b6713caf339af2346eacc1324280b180a519e1.1526173613.git.rgb@redhat.com>
On Sat, May 12, 2018 at 9:58 PM, Richard Guy Briggs <rgb@redhat.com> wrote:
> Use a macro, "AUDIT_SID_UNSET", to replace each instance of
> initialization and comparison to an audit session ID.
>
> Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> ---
> include/linux/audit.h | 2 +-
> include/net/xfrm.h | 2 +-
> include/uapi/linux/audit.h | 1 +
> init/init_task.c | 3 ++-
> kernel/auditsc.c | 4 ++--
> 5 files changed, 7 insertions(+), 5 deletions(-)
Merged, thanks.
> diff --git a/include/linux/audit.h b/include/linux/audit.h
> index 75d5b03..5f86f7c 100644
> --- a/include/linux/audit.h
> +++ b/include/linux/audit.h
> @@ -513,7 +513,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
> }
> static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
> {
> - return -1;
> + return AUDIT_SID_UNSET;
> }
> static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
> { }
> diff --git a/include/net/xfrm.h b/include/net/xfrm.h
> index a872379..fcce8ee 100644
> --- a/include/net/xfrm.h
> +++ b/include/net/xfrm.h
> @@ -751,7 +751,7 @@ static inline void xfrm_audit_helper_usrinfo(bool task_valid,
> audit_get_loginuid(current) :
> INVALID_UID);
> const unsigned int ses = task_valid ? audit_get_sessionid(current) :
> - (unsigned int) -1;
> + AUDIT_SID_UNSET;
>
> audit_log_format(audit_buf, " auid=%u ses=%u", auid, ses);
> audit_log_task_context(audit_buf);
> diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
> index 4e61a9e..04f9bd2 100644
> --- a/include/uapi/linux/audit.h
> +++ b/include/uapi/linux/audit.h
> @@ -465,6 +465,7 @@ struct audit_tty_status {
> };
>
> #define AUDIT_UID_UNSET (unsigned int)-1
> +#define AUDIT_SID_UNSET ((unsigned int)-1)
>
> /* audit_rule_data supports filter rules with both integer and string
> * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
> diff --git a/init/init_task.c b/init/init_task.c
> index 3ac6e75..74f60ba 100644
> --- a/init/init_task.c
> +++ b/init/init_task.c
> @@ -9,6 +9,7 @@
> #include <linux/init.h>
> #include <linux/fs.h>
> #include <linux/mm.h>
> +#include <linux/audit.h>
>
> #include <asm/pgtable.h>
> #include <linux/uaccess.h>
> @@ -119,7 +120,7 @@ struct task_struct init_task
> .thread_node = LIST_HEAD_INIT(init_signals.thread_head),
> #ifdef CONFIG_AUDITSYSCALL
> .loginuid = INVALID_UID,
> - .sessionid = (unsigned int)-1,
> + .sessionid = AUDIT_SID_UNSET,
> #endif
> #ifdef CONFIG_PERF_EVENTS
> .perf_event_mutex = __MUTEX_INITIALIZER(init_task.perf_event_mutex),
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index 0d4e269..e157595 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -2050,7 +2050,7 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid,
> int audit_set_loginuid(kuid_t loginuid)
> {
> struct task_struct *task = current;
> - unsigned int oldsessionid, sessionid = (unsigned int)-1;
> + unsigned int oldsessionid, sessionid = AUDIT_SID_UNSET;
> kuid_t oldloginuid;
> int rc;
>
> @@ -2064,7 +2064,7 @@ int audit_set_loginuid(kuid_t loginuid)
> /* are we setting or clearing? */
> if (uid_valid(loginuid)) {
> sessionid = (unsigned int)atomic_inc_return(&session_id);
> - if (unlikely(sessionid == (unsigned int)-1))
> + if (unlikely(sessionid == AUDIT_SID_UNSET))
> sessionid = (unsigned int)atomic_inc_return(&session_id);
> }
>
> --
> 1.8.3.1
>
--
paul moore
www.paul-moore.com
^ permalink raw reply
* Re: iproute2 - modifying routes in place
From: Ryan Whelan @ 2018-05-14 20:10 UTC (permalink / raw)
To: David Ahern; +Cc: netdev
In-Reply-To: <7b4fac83-210f-2e91-5e56-6a381bd2a5ba@gmail.com>
On Mon, May 14, 2018 at 2:49 PM David Ahern <dsahern@gmail.com> wrote:
> On 5/14/18 12:40 PM, Ryan Whelan wrote:
> > Same behavior:
> >
> >
> > root@rwhelan-linux ~
> > # ip -6 route
> > ::1 dev lo proto kernel metric 256 pref medium
> > fd9b:caee:ff93:ceef:3431:3831:3930:3031 dev internal0 proto kernel
metric
> > 256 pref medium
> > fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 src
> > fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 1024 pref medium
> > fe80::/64 dev enp0s3 proto kernel metric 256 pref medium
> > fe80::/64 dev enp0s8 proto kernel metric 256 pref medium
> > fe80::/64 dev internal0 proto kernel metric 256 pref medium
> >
> > root@rwhelan-linux ~
> > # ip -6 route change fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev
internal0
> > src fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 10
> > RTNETLINK answers: No such file or directory
> 'change' only sets NLM_F_REPLACE. Since NLM_F_CREATE is not set ('ip ro
> replace') it does not add a new route and expects one to exist. Your
> table above shows the prefix with metric 256 not metric 10 so the route
> does not match. You should be seeing a message in dmesg to this effect.
Is there a syntax for changing a route in-place? Specifically, i'm
interesting in changing the metric of currently existing routes.
^ permalink raw reply
* [PATCH net-next 2/3] net: qualcomm: rmnet: Add support for ethtool private stats
From: Subash Abhinov Kasiviswanathan @ 2018-05-14 20:08 UTC (permalink / raw)
To: davem, netdev; +Cc: Subash Abhinov Kasiviswanathan
In-Reply-To: <1526328527-20026-1-git-send-email-subashab@codeaurora.org>
Add ethtool private stats handler to debug the handling of packets
with checksum offload header / trailer. This allows to keep track of
the number of packets for which hardware computes the checksum and
counts and reasons where checksum computation was skipped in hardware
and was done in the network stack.
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h | 13 +++++
.../net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 59 +++++++++++++++++-----
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c | 51 +++++++++++++++++++
3 files changed, 109 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
index 0b5b5da..34ac45a 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
@@ -54,11 +54,24 @@ struct rmnet_pcpu_stats {
struct u64_stats_sync syncp;
};
+struct rmnet_priv_stats {
+ u64 csum_ok;
+ u64 csum_valid_unset;
+ u64 csum_validation_failed;
+ u64 csum_err_bad_buffer;
+ u64 csum_err_invalid_ip_version;
+ u64 csum_err_invalid_transport;
+ u64 csum_fragmented_pkt;
+ u64 csum_skipped;
+ u64 csum_sw;
+};
+
struct rmnet_priv {
u8 mux_id;
struct net_device *real_dev;
struct rmnet_pcpu_stats __percpu *pcpu_stats;
struct gro_cells gro_cells;
+ struct rmnet_priv_stats stats;
};
struct rmnet_port *rmnet_get_port(struct net_device *real_dev);
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
index a6ea094..3453b66 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
@@ -48,7 +48,8 @@ static __sum16 *rmnet_map_get_csum_field(unsigned char protocol,
static int
rmnet_map_ipv4_dl_csum_trailer(struct sk_buff *skb,
- struct rmnet_map_dl_csum_trailer *csum_trailer)
+ struct rmnet_map_dl_csum_trailer *csum_trailer,
+ struct rmnet_priv *priv)
{
__sum16 *csum_field, csum_temp, pseudo_csum, hdr_csum, ip_payload_csum;
u16 csum_value, csum_value_final;
@@ -58,19 +59,25 @@ static __sum16 *rmnet_map_get_csum_field(unsigned char protocol,
ip4h = (struct iphdr *)(skb->data);
if ((ntohs(ip4h->frag_off) & IP_MF) ||
- ((ntohs(ip4h->frag_off) & IP_OFFSET) > 0))
+ ((ntohs(ip4h->frag_off) & IP_OFFSET) > 0)) {
+ priv->stats.csum_fragmented_pkt++;
return -EOPNOTSUPP;
+ }
txporthdr = skb->data + ip4h->ihl * 4;
csum_field = rmnet_map_get_csum_field(ip4h->protocol, txporthdr);
- if (!csum_field)
+ if (!csum_field) {
+ priv->stats.csum_err_invalid_transport++;
return -EPROTONOSUPPORT;
+ }
/* RFC 768 - Skip IPv4 UDP packets where sender checksum field is 0 */
- if (*csum_field == 0 && ip4h->protocol == IPPROTO_UDP)
+ if (*csum_field == 0 && ip4h->protocol == IPPROTO_UDP) {
+ priv->stats.csum_skipped++;
return 0;
+ }
csum_value = ~ntohs(csum_trailer->csum_value);
hdr_csum = ~ip_fast_csum(ip4h, (int)ip4h->ihl);
@@ -102,16 +109,20 @@ static __sum16 *rmnet_map_get_csum_field(unsigned char protocol,
}
}
- if (csum_value_final == ntohs((__force __be16)*csum_field))
+ if (csum_value_final == ntohs((__force __be16)*csum_field)) {
+ priv->stats.csum_ok++;
return 0;
- else
+ } else {
+ priv->stats.csum_validation_failed++;
return -EINVAL;
+ }
}
#if IS_ENABLED(CONFIG_IPV6)
static int
rmnet_map_ipv6_dl_csum_trailer(struct sk_buff *skb,
- struct rmnet_map_dl_csum_trailer *csum_trailer)
+ struct rmnet_map_dl_csum_trailer *csum_trailer,
+ struct rmnet_priv *priv)
{
__sum16 *csum_field, ip6_payload_csum, pseudo_csum, csum_temp;
u16 csum_value, csum_value_final;
@@ -125,8 +136,10 @@ static __sum16 *rmnet_map_get_csum_field(unsigned char protocol,
txporthdr = skb->data + sizeof(struct ipv6hdr);
csum_field = rmnet_map_get_csum_field(ip6h->nexthdr, txporthdr);
- if (!csum_field)
+ if (!csum_field) {
+ priv->stats.csum_err_invalid_transport++;
return -EPROTONOSUPPORT;
+ }
csum_value = ~ntohs(csum_trailer->csum_value);
ip6_hdr_csum = (__force __be16)
@@ -164,10 +177,13 @@ static __sum16 *rmnet_map_get_csum_field(unsigned char protocol,
}
}
- if (csum_value_final == ntohs((__force __be16)*csum_field))
+ if (csum_value_final == ntohs((__force __be16)*csum_field)) {
+ priv->stats.csum_ok++;
return 0;
- else
+ } else {
+ priv->stats.csum_validation_failed++;
return -EINVAL;
+ }
}
#endif
@@ -339,24 +355,33 @@ struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,
*/
int rmnet_map_checksum_downlink_packet(struct sk_buff *skb, u16 len)
{
+ struct rmnet_priv *priv = netdev_priv(skb->dev);
struct rmnet_map_dl_csum_trailer *csum_trailer;
- if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM)))
+ if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM))) {
+ priv->stats.csum_sw++;
return -EOPNOTSUPP;
+ }
csum_trailer = (struct rmnet_map_dl_csum_trailer *)(skb->data + len);
- if (!csum_trailer->valid)
+ if (!csum_trailer->valid) {
+ priv->stats.csum_valid_unset++;
return -EINVAL;
+ }
if (skb->protocol == htons(ETH_P_IP))
- return rmnet_map_ipv4_dl_csum_trailer(skb, csum_trailer);
+ return rmnet_map_ipv4_dl_csum_trailer(skb, csum_trailer, priv);
else if (skb->protocol == htons(ETH_P_IPV6))
#if IS_ENABLED(CONFIG_IPV6)
- return rmnet_map_ipv6_dl_csum_trailer(skb, csum_trailer);
+ return rmnet_map_ipv6_dl_csum_trailer(skb, csum_trailer, priv);
#else
+ priv->stats.csum_err_invalid_ip_version++;
return -EPROTONOSUPPORT;
#endif
+ else
+ priv->stats.csum_err_invalid_ip_version++;
+ return -EPROTONOSUPPORT;
return 0;
}
@@ -367,6 +392,7 @@ int rmnet_map_checksum_downlink_packet(struct sk_buff *skb, u16 len)
void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,
struct net_device *orig_dev)
{
+ struct rmnet_priv *priv = netdev_priv(orig_dev);
struct rmnet_map_ul_csum_header *ul_header;
void *iphdr;
@@ -389,8 +415,11 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,
rmnet_map_ipv6_ul_csum_header(iphdr, ul_header, skb);
return;
#else
+ priv->stats.csum_err_invalid_ip_version++;
goto sw_csum;
#endif
+ } else {
+ priv->stats.csum_err_invalid_ip_version++;
}
}
@@ -399,4 +428,6 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,
ul_header->csum_insert_offset = 0;
ul_header->csum_enabled = 0;
ul_header->udp_ip4_ind = 0;
+
+ priv->stats.csum_sw++;
}
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
index 2ea16a0..4c04482 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
@@ -152,6 +152,56 @@ static void rmnet_get_stats64(struct net_device *dev,
.ndo_get_stats64 = rmnet_get_stats64,
};
+static const char rmnet_gstrings_stats[][ETH_GSTRING_LEN] = {
+ "Checksum ok",
+ "Checksum valid bit not set",
+ "Checksum validation failed",
+ "Checksum error bad buffer",
+ "Checksum error bad ip version",
+ "Checksum error bad transport",
+ "Checksum skipped on ip fragment",
+ "Checksum skipped",
+ "Checksum computed in software",
+};
+
+static void rmnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
+{
+ switch (stringset) {
+ case ETH_SS_STATS:
+ memcpy(buf, &rmnet_gstrings_stats,
+ sizeof(rmnet_gstrings_stats));
+ break;
+ }
+}
+
+static int rmnet_get_sset_count(struct net_device *dev, int sset)
+{
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(rmnet_gstrings_stats);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
+static void rmnet_get_ethtool_stats(struct net_device *dev,
+ struct ethtool_stats *stats, u64 *data)
+{
+ struct rmnet_priv *priv = netdev_priv(dev);
+ struct rmnet_priv_stats *st = &priv->stats;
+
+ if (!data)
+ return;
+
+ memcpy(data, st, ARRAY_SIZE(rmnet_gstrings_stats) * sizeof(u64));
+}
+
+const struct ethtool_ops rmnet_ethtool_ops = {
+ .get_ethtool_stats = rmnet_get_ethtool_stats,
+ .get_strings = rmnet_get_strings,
+ .get_sset_count = rmnet_get_sset_count,
+};
+
/* Called by kernel whenever a new rmnet<n> device is created. Sets MTU,
* flags, ARP type, needed headroom, etc...
*/
@@ -170,6 +220,7 @@ void rmnet_vnd_setup(struct net_device *rmnet_dev)
rmnet_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
rmnet_dev->needs_free_netdev = true;
+ rmnet_dev->ethtool_ops = &rmnet_ethtool_ops;
}
/* Exposed API */
--
1.9.1
^ permalink raw reply related
* [PATCH net-next 3/3] net: qualcomm: rmnet: Remove redundant command check
From: Subash Abhinov Kasiviswanathan @ 2018-05-14 20:08 UTC (permalink / raw)
To: davem, netdev; +Cc: Subash Abhinov Kasiviswanathan
In-Reply-To: <1526328527-20026-1-git-send-email-subashab@codeaurora.org>
The command packet size is already checked once in
rmnet_map_deaggregate() for the header, packet and trailer size, so
this additional check is not needed.
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
index 78fdad0..56a93df 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
@@ -69,17 +69,9 @@ static void rmnet_map_send_ack(struct sk_buff *skb,
struct rmnet_map_control_command *cmd;
int xmit_status;
- if (port->data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV4) {
- if (skb->len < sizeof(struct rmnet_map_header) +
- RMNET_MAP_GET_LENGTH(skb) +
- sizeof(struct rmnet_map_dl_csum_trailer)) {
- kfree_skb(skb);
- return;
- }
-
- skb_trim(skb, skb->len -
- sizeof(struct rmnet_map_dl_csum_trailer));
- }
+ if (port->data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV4)
+ skb_trim(skb,
+ skb->len - sizeof(struct rmnet_map_dl_csum_trailer));
skb->protocol = htons(ETH_P_MAP);
--
1.9.1
^ permalink raw reply related
* [PATCH net-next 1/3] net: qualcomm: rmnet: Capture all drops in transmit path
From: Subash Abhinov Kasiviswanathan @ 2018-05-14 20:08 UTC (permalink / raw)
To: davem, netdev; +Cc: Subash Abhinov Kasiviswanathan
In-Reply-To: <1526328527-20026-1-git-send-email-subashab@codeaurora.org>
Packets in transmit path could potentially be dropped if there were
errors while adding the MAP header or the checksum header.
Increment the tx_drops stats in these cases.
Additionally, refactor the code to free the packet and increment
the tx_drops stat under a single label.
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
.../net/ethernet/qualcomm/rmnet/rmnet_handlers.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
index 6fcd586..7fd86d4 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
@@ -148,7 +148,7 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
if (skb_headroom(skb) < required_headroom) {
if (pskb_expand_head(skb, required_headroom, 0, GFP_KERNEL))
- goto fail;
+ return -ENOMEM;
}
if (port->data_format & RMNET_FLAGS_EGRESS_MAP_CKSUMV4)
@@ -156,17 +156,13 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
map_header = rmnet_map_add_map_header(skb, additional_header_len, 0);
if (!map_header)
- goto fail;
+ return -ENOMEM;
map_header->mux_id = mux_id;
skb->protocol = htons(ETH_P_MAP);
return 0;
-
-fail:
- kfree_skb(skb);
- return -ENOMEM;
}
static void
@@ -228,15 +224,18 @@ void rmnet_egress_handler(struct sk_buff *skb)
mux_id = priv->mux_id;
port = rmnet_get_port(skb->dev);
- if (!port) {
- kfree_skb(skb);
- return;
- }
+ if (!port)
+ goto drop;
if (rmnet_map_egress_handler(skb, port, mux_id, orig_dev))
- return;
+ goto drop;
rmnet_vnd_tx_fixup(skb, orig_dev);
dev_queue_xmit(skb);
+ return;
+
+drop:
+ this_cpu_inc(priv->pcpu_stats->stats.tx_drops);
+ kfree_skb(skb);
}
--
1.9.1
^ permalink raw reply related
* [PATCH net-next 0/3] net: qualcomm: rmnet: Updates 2018-05-14
From: Subash Abhinov Kasiviswanathan @ 2018-05-14 20:08 UTC (permalink / raw)
To: davem, netdev; +Cc: Subash Abhinov Kasiviswanathan
This series contains some minor updates for rmnet driver.
Patch 1 adds tx_drops counter to more places.
Patch 2 adds ethtool private stats support to make it easy to debug
the checksum offload path.
Patch 3 is a cleanup in command packet processing path.
Subash Abhinov Kasiviswanathan (3):
net: qualcomm: rmnet: Capture all drops in transmit path
net: qualcomm: rmnet: Add support for ethtool private stats
net: qualcomm: rmnet: Remove redundant command check
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h | 13 +++++
.../net/ethernet/qualcomm/rmnet/rmnet_handlers.c | 21 ++++----
.../ethernet/qualcomm/rmnet/rmnet_map_command.c | 14 ++---
.../net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 59 +++++++++++++++++-----
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c | 51 +++++++++++++++++++
5 files changed, 122 insertions(+), 36 deletions(-)
--
1.9.1
^ permalink raw reply
* [PATCH net-next v3 1/7] dt-bindings: net: add DT bindings for Microsemi MIIM
From: Alexandre Belloni @ 2018-05-14 20:04 UTC (permalink / raw)
To: David S . Miller
Cc: Allan Nielsen, razvan.stefanescu, po.liu, Thomas Petazzoni,
Andrew Lunn, Florian Fainelli, netdev, linux-kernel, linux-mips,
Alexandre Belloni
In-Reply-To: <20180514200500.2953-1-alexandre.belloni@bootlin.com>
DT bindings for the Microsemi MII Management Controller found on Microsemi
SoCs
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
.../devicetree/bindings/net/mscc-miim.txt | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/mscc-miim.txt
diff --git a/Documentation/devicetree/bindings/net/mscc-miim.txt b/Documentation/devicetree/bindings/net/mscc-miim.txt
new file mode 100644
index 000000000000..7104679cf59d
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mscc-miim.txt
@@ -0,0 +1,26 @@
+Microsemi MII Management Controller (MIIM) / MDIO
+=================================================
+
+Properties:
+- compatible: must be "mscc,ocelot-miim"
+- reg: The base address of the MDIO bus controller register bank. Optionally, a
+ second register bank can be defined if there is an associated reset register
+ for internal PHYs
+- #address-cells: Must be <1>.
+- #size-cells: Must be <0>. MDIO addresses have no size component.
+- interrupts: interrupt specifier (refer to the interrupt binding)
+
+Typically an MDIO bus might have several children.
+
+Example:
+ mdio@107009c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "mscc,ocelot-miim";
+ reg = <0x107009c 0x36>, <0x10700f0 0x8>;
+ interrupts = <14>;
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+ };
--
2.17.0
^ permalink raw reply related
* [PATCH net-next v3 7/7] MAINTAINERS: Add entry for Microsemi Ethernet switches
From: Alexandre Belloni @ 2018-05-14 20:05 UTC (permalink / raw)
To: David S . Miller
Cc: Allan Nielsen, razvan.stefanescu, po.liu, Thomas Petazzoni,
Andrew Lunn, Florian Fainelli, netdev, linux-kernel, linux-mips,
Alexandre Belloni
In-Reply-To: <20180514200500.2953-1-alexandre.belloni@bootlin.com>
Add myself as a maintainer for the Microsemi Ethernet switches.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
MAINTAINERS | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 0a1410d5a621..b632deb3f503 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9280,6 +9280,12 @@ F: include/linux/cciss*.h
F: include/uapi/linux/cciss*.h
F: Documentation/scsi/smartpqi.txt
+MICROSEMI ETHERNET SWITCH DRIVER
+M: Alexandre Belloni <alexandre.belloni@bootlin.com>
+L: netdev@vger.kernel.org
+S: Supported
+F: drivers/net/ethernet/mscc/
+
MICROSOFT SURFACE PRO 3 BUTTON DRIVER
M: Chen Yu <yu.c.chen@intel.com>
L: platform-driver-x86@vger.kernel.org
--
2.17.0
^ permalink raw reply related
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