* Re: [PATCH 2/2 net-next] hns3pf: Fix some harmless copy and paste bugs
From: David Miller @ 2017-08-11 21:32 UTC (permalink / raw)
To: dan.carpenter
Cc: yisen.zhuang, salil.mehta, jiri, jhs, huangdaode, xavier.huwei,
netdev, kernel-janitors
In-Reply-To: <20170810095549.jxkthoyym5gn5oh3@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 10 Aug 2017 12:56:14 +0300
> These were copy and paste bugs, but I believe they are harmless.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/3] net: Export tcpv6_prot
From: David Miller @ 2017-08-11 21:34 UTC (permalink / raw)
To: ilyal; +Cc: netdev, davejwatson, aviadye, borisp
In-Reply-To: <1502361196-127278-3-git-send-email-ilyal@mellanox.com>
From: Ilya Lesokhin <ilyal@mellanox.com>
Date: Thu, 10 Aug 2017 13:33:15 +0300
> From: Boris Pismenny <borisp@mellanox.com>
>
> Want to be able to use these in TLS.
>
> Signed-off-by: Boris Pismenny <borisp@mellanox.com>
> ---
> net/ipv6/tcp_ipv6.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 2521690..e3a44a5 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -1944,6 +1944,7 @@ struct proto tcpv6_prot = {
> #endif
> .diag_destroy = tcp_abort,
> };
> +EXPORT_SYMBOL(tcpv6_prot);
EXPORT_SYMBOL_GPL() please.
^ permalink raw reply
* Re: [PATCH 3/3] tls: Use correct sk->sk_prot for IPV6
From: David Miller @ 2017-08-11 21:36 UTC (permalink / raw)
To: ilyal; +Cc: netdev, davejwatson, aviadye, borisp
In-Reply-To: <1502361196-127278-4-git-send-email-ilyal@mellanox.com>
From: Ilya Lesokhin <ilyal@mellanox.com>
Date: Thu, 10 Aug 2017 13:33:16 +0300
> +#if IS_ENABLED(CONFIG_IPV6)
> + build_protos(tls_prots[TLSV6], &tcpv6_prot);
> +#endif
>
Have you tested this with CONFIG_TLS=m and CONFIG_IPV6=m?
I bet it doesn't link.
How about CONFIG_IPV6=m and CONFIG_TLS=y? That won't
work either.
In fact TLS has no Kconfig dependency whatsoever on IPV6.
^ permalink raw reply
* Re: [PATCH net-next] fsl/fman: implement several errata workarounds
From: David Miller @ 2017-08-11 21:37 UTC (permalink / raw)
To: florinel.iordache; +Cc: netdev, madalin.bucur, linux-kernel, linuxppc-dev
In-Reply-To: <1502372824-30180-1-git-send-email-florinel.iordache@nxp.com>
From: Florinel Iordache <florinel.iordache@nxp.com>
Date: Thu, 10 Aug 2017 16:47:04 +0300
> Implemented workarounds for the following dTSEC Erratum:
> A002, A004, A0012, A0014, A004839 on several operations
> that involve MAC CFG register changes: adjust link,
> rx pause frames, modify MAC address.
>
> Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH v3] net: stmmac: Use the right logging function in stmmac_mdio_register
From: David Miller @ 2017-08-11 21:39 UTC (permalink / raw)
To: romain.perier
Cc: peppe.cavallaro, alexandre.torgue, andrew, netdev, linux-kernel
In-Reply-To: <20170810145605.27048-1-romain.perier@collabora.com>
From: Romain Perier <romain.perier@collabora.com>
Date: Thu, 10 Aug 2017 16:56:05 +0200
> Currently, the function stmmac_mdio_register() is only used by
> stmmac_dvr_probe() from stmmac_main.c, in order to register the MDIO bus
> and probe information about the PHY. As this function is called before
> calling register_netdev(), all messages logged from stmmac_mdio_register
> are prefixed by "(unnamed net_device)". The goal of netdev_info or
> netdev_err is to dump useful infos about a net_device, when this data
> structure is partially initialized, there is no point for using these
> functions.
>
> This commit fixes the issue by replacing all netdev_*() by the
> corresponding dev_*() function for logging. The last netdev_info is
> replaced by phy_attached_info(), as a valid phydev can be used at this
> point.
>
> Signed-off-by: Romain Perier <romain.perier@collabora.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] net/sched: reset block pointer in tcf_block_put()
From: Cong Wang @ 2017-08-11 21:38 UTC (permalink / raw)
To: Konstantin Khlebnikov
Cc: Linux Kernel Network Developers, Jiri Pirko, David S. Miller,
Jamal Hadi Salim
In-Reply-To: <ad81a570-dff5-7c74-170e-70e764778cba@yandex-team.ru>
On Fri, Aug 11, 2017 at 1:36 PM, Konstantin Khlebnikov
<khlebnikov@yandex-team.ru> wrote:
>
>
> On 11.08.2017 23:18, Cong Wang wrote:
>>
>> On Thu, Aug 10, 2017 at 2:31 AM, Konstantin Khlebnikov
>> <khlebnikov@yandex-team.ru> wrote:
>>>
>>> In previous API tcf_destroy_chain() could be called several times and
>>> some schedulers like hfsc and atm use that. In new API tcf_block_put()
>>> frees block but leaves stale pointer, second call will free it once
>>> again.
>>
>>
>> Which call path do we call tcf_block_put() for multiple times on
>> the same block? Please be specific, it is not obvious.
>>
>
> For example in hfsc_destroy_qdisc() since
> a4aebb83cf0da0363684f1c339f7e6149a3e74c1
> second time in hfsc_destroy_class() called from it.
>
> Actually, I see the same pattern in all classy qdiscs.
Good find! But that means we can just move it up??
Something like (PoC only, not even compile):
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index b52f74610dc7..c7db8060e8ef 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1099,7 +1099,6 @@ hfsc_destroy_class(struct Qdisc *sch, struct
hfsc_class *cl)
{
struct hfsc_sched *q = qdisc_priv(sch);
- tcf_block_put(cl->block);
qdisc_destroy(cl->qdisc);
gen_kill_estimator(&cl->rate_est);
if (cl != &q->root)
@@ -1243,8 +1242,10 @@ hfsc_put_class(struct Qdisc *sch, unsigned long arg)
{
struct hfsc_class *cl = (struct hfsc_class *)arg;
- if (--cl->refcnt == 0)
+ if (--cl->refcnt == 0) {
+ tcf_block_put(cl->block);
hfsc_destroy_class(sch, cl);
+ }
}
static unsigned long
^ permalink raw reply related
* Re: [PATCH net-next] net: ipv4: set orig_oif based on fib result for local traffic
From: David Miller @ 2017-08-11 21:41 UTC (permalink / raw)
To: dsahern; +Cc: netdev
In-Reply-To: <1502398150-4220-1-git-send-email-dsahern@gmail.com>
From: David Ahern <dsahern@gmail.com>
Date: Thu, 10 Aug 2017 13:49:10 -0700
> Attempts to connect to a local address with a socket bound
> to a device with the local address hangs if there is no listener:
>
> $ ip addr sh dev eth1
> 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
> link/ether 02:e0:f9:1c:00:37 brd ff:ff:ff:ff:ff:ff
> inet 10.100.1.4/24 scope global eth1
> valid_lft forever preferred_lft forever
> inet6 2001:db8:1::4/120 scope global
> valid_lft forever preferred_lft forever
> inet6 fe80::e0:f9ff:fe1c:37/64 scope link
> valid_lft forever preferred_lft forever
>
> $ vrf-test -I eth1 -r 10.100.1.4
> <hangs when there is no server>
>
> (don't let the command name fool you; vrf-test works without vrfs.)
>
> The problem is that the original intended device, eth1 in this case, is
> lost when the tcp reset is sent, so the socket lookup does not find a
> match for the reset and the connect attempt hangs. Fix by adjusting
> orig_oif for local traffic to the device from the fib lookup result.
>
> With this patch you get the more user friendly:
> $ vrf-test -I eth1 -r 10.100.1.4
> connect failed: 111: Connection refused
>
> orig_oif is saved to the newly created rtable as rt_iif and when set
> it is used as the dif for socket lookups. It is set based on flowi4_oif
> passed in to ip_route_output_key_hash_rcu and will be set to either
> the loopback device, an l3mdev device, nothing (flowi4_oif = 0 which
> is the case in the example above) or a netdev index depending on the
> lookup path. In each case, resetting orig_oif to the device in the fib
> result for the RTN_LOCAL case allows the actual device to be preserved
> as the skb tx and rx is done over the loopback or VRF device.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
> ---
> As far as I can tell the current behavior goes back to the 2.6 days
> at least. Not sure it is worth adding to stable branches.
Applied, thanks David.
^ permalink raw reply
* Re: [PATCH v3 net-next 1/2] wan: dscc4: add checks for dma mapping errors
From: David Miller @ 2017-08-11 21:42 UTC (permalink / raw)
To: khoroshilov; +Cc: romieu, netdev, linux-kernel, ldv-project
In-Reply-To: <1502405721-27738-1-git-send-email-khoroshilov@ispras.ru>
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Fri, 11 Aug 2017 01:55:20 +0300
> The driver does not check if mapping dma memory succeed.
> The patch adds the checks and failure handling.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Applied.
^ permalink raw reply
* Re: [PATCH v3 net-next 2/2] wan: dscc4: convert to plain DMA API
From: David Miller @ 2017-08-11 21:42 UTC (permalink / raw)
To: khoroshilov; +Cc: romieu, netdev, linux-kernel, ldv-project
In-Reply-To: <1502405721-27738-2-git-send-email-khoroshilov@ispras.ru>
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Fri, 11 Aug 2017 01:55:21 +0300
> Make use the dma_*() interfaces rather than the pci_*() interfaces.
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Applied.
^ permalink raw reply
* Re: [PATCH v3 net-next 2/2] wan: dscc4: convert to plain DMA API
From: Francois Romieu @ 2017-08-11 21:45 UTC (permalink / raw)
To: Alexey Khoroshilov; +Cc: David S. Miller, netdev, linux-kernel, ldv-project
In-Reply-To: <1502405721-27738-2-git-send-email-khoroshilov@ispras.ru>
Alexey Khoroshilov <khoroshilov@ispras.ru> :
[...]
> diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
> index 8480dbf..a043fb1 100644
> --- a/drivers/net/wan/dscc4.c
> +++ b/drivers/net/wan/dscc4.c
[...]
> @@ -506,8 +506,9 @@ static void dscc4_release_ring(struct dscc4_dev_priv *dpriv)
> skbuff = dpriv->rx_skbuff;
> for (i = 0; i < RX_RING_SIZE; i++) {
> if (*skbuff) {
> - pci_unmap_single(pdev, le32_to_cpu(rx_fd->data),
> - RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE);
> + dma_unmap_single(d, le32_to_cpu(rx_fd->data),
> + RX_MAX(HDLC_MAX_MRU),
> + DMA_FROM_DEVICE);
RX_MAX(HDLC_MAX_MRU), DMA_FROM_DEVICE);
[...]
> @@ -664,8 +665,8 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv,
> goto refill;
> }
> pkt_len = TO_SIZE(le32_to_cpu(rx_fd->state2));
> - pci_unmap_single(pdev, le32_to_cpu(rx_fd->data),
> - RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE);
> + dma_unmap_single(d, le32_to_cpu(rx_fd->data),
> + RX_MAX(HDLC_MAX_MRU), DMA_FROM_DEVICE);
dma_unmap_single(d, le32_to_cpu(rx_fd->data), RX_MAX(HDLC_MAX_MRU),
DMA_FROM_DEVICE);
[...]
> @@ -782,8 +783,8 @@ static int dscc4_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>
> rc = -ENOMEM;
>
> - priv->iqcfg = (__le32 *) pci_alloc_consistent(pdev,
> - IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma);
> + priv->iqcfg = (__le32 *)dma_alloc_coherent(&pdev->dev,
> + IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma, GFP_KERNEL);
- the cast can go away
- please replace &pdev->dev with a local variable
priv->iqcfg = dma_alloc_coherent(d, IRQ_RING_SIZE*sizeof(__le32),
&priv->iqcfg_dma, GFP_KERNEL);
Same thing for iqtx and iqrx (beware of copy&paste + tx/rx mismatch).
Thanks.
--
Ueimor
^ permalink raw reply
* Re: [PATCH net-next] net: skb_needs_check() removes CHECKSUM_UNNECESSARY check for tx.
From: David Miller @ 2017-08-11 21:46 UTC (permalink / raw)
To: xiangxia.m.yue; +Cc: netdev, willemb
In-Reply-To: <1502421389-20152-1-git-send-email-xiangxia.m.yue@gmail.com>
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Thu, 10 Aug 2017 20:16:29 -0700
> Because we remove the UFO support, we will also remove the
> CHECKSUM_UNNECESSARY check in skb_needs_check().
>
> Cc: Willem de Bruijn <willemb@google.com>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH 0/3] NCSI VLAN Filtering Support
From: David Miller @ 2017-08-11 21:48 UTC (permalink / raw)
To: sam; +Cc: netdev, linux-kernel, openbmc, joel, benh, gwshan, ratagupt
In-Reply-To: <20170811061648.19661-1-sam@mendozajonas.com>
From: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Date: Fri, 11 Aug 2017 16:16:45 +1000
> This series (mainly patch 3) adds VLAN filtering to the NCSI implementation.
> A fair amount of code already exists in the NCSI stack for VLAN filtering but
> none of it is actually hooked up. This goes the final mile and fixes a few
> bugs in the existing code found along the way (patch 2).
>
> Patch 1 adds the appropriate flag to the ftgmac100 driver to enable filtering
> as it's a large consumer of NCSI (and what I've been testing on).
This patch series does not apply cleanly to net-next, you need to respin.
^ permalink raw reply
* Re: [PATCH v3 net-next 2/2] wan: dscc4: convert to plain DMA API
From: David Miller @ 2017-08-11 21:49 UTC (permalink / raw)
To: romieu; +Cc: khoroshilov, netdev, linux-kernel, ldv-project
In-Reply-To: <20170811214549.GA8187@electric-eye.fr.zoreil.com>
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Fri, 11 Aug 2017 23:45:49 +0200
> Alexey Khoroshilov <khoroshilov@ispras.ru> :
> [...]
>> diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
>> index 8480dbf..a043fb1 100644
>> --- a/drivers/net/wan/dscc4.c
>> +++ b/drivers/net/wan/dscc4.c
> [...]
>> @@ -506,8 +506,9 @@ static void dscc4_release_ring(struct dscc4_dev_priv *dpriv)
>> skbuff = dpriv->rx_skbuff;
>> for (i = 0; i < RX_RING_SIZE; i++) {
>> if (*skbuff) {
>> - pci_unmap_single(pdev, le32_to_cpu(rx_fd->data),
>> - RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE);
>> + dma_unmap_single(d, le32_to_cpu(rx_fd->data),
>> + RX_MAX(HDLC_MAX_MRU),
>> + DMA_FROM_DEVICE);
>
> RX_MAX(HDLC_MAX_MRU), DMA_FROM_DEVICE);
...
>> @@ -782,8 +783,8 @@ static int dscc4_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>>
>> rc = -ENOMEM;
>>
>> - priv->iqcfg = (__le32 *) pci_alloc_consistent(pdev,
>> - IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma);
>> + priv->iqcfg = (__le32 *)dma_alloc_coherent(&pdev->dev,
>> + IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma, GFP_KERNEL);
>
> - the cast can go away
> - please replace &pdev->dev with a local variable
>
> priv->iqcfg = dma_alloc_coherent(d, IRQ_RING_SIZE*sizeof(__le32),
> &priv->iqcfg_dma, GFP_KERNEL);
>
> Same thing for iqtx and iqrx (beware of copy&paste + tx/rx mismatch).
Oops, this will need to be sent as a relative fixup as I've applied these
two patches to net-next, sorry Francois.
^ permalink raw reply
* Re: [PATCH net repost] nfp: do not update MTU from BH in flower app
From: David Miller @ 2017-08-11 21:51 UTC (permalink / raw)
To: simon.horman; +Cc: jakub.kicinski, netdev, oss-drivers
In-Reply-To: <1502439500-16047-1-git-send-email-simon.horman@netronome.com>
From: Simon Horman <simon.horman@netronome.com>
Date: Fri, 11 Aug 2017 10:18:20 +0200
> The Flower app may receive a request to update the MTU of a representor
> netdev upon receipt of a control message from the firmware. This requires
> the RTNL lock which needs to be taken outside of the packet processing
> path.
>
> As a handling of this correctly seems a little to invasive for a fix simply
> skip setting the MTU for now.
>
> Relevant backtrace:
...
> Fixes: 948faa46c05b ("nfp: add support for control messages for flower app")
> Signed-off-by: Simon Horman <simon.horman@netronome.com>
> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] nfp: send control message when MAC representors are created
From: David Miller @ 2017-08-11 21:51 UTC (permalink / raw)
To: simon.horman; +Cc: jakub.kicinski, netdev, oss-drivers
In-Reply-To: <1502439944-18910-1-git-send-email-simon.horman@netronome.com>
From: Simon Horman <simon.horman@netronome.com>
Date: Fri, 11 Aug 2017 10:25:44 +0200
> The firmware expects a MAC_REPR control message when a MAC representor
> is created. The driver should expect a PORTMOD message to follow which
> will provide the link states of the physical port associated with the MAC
> representor.
>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>
> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Also applied, thanks Simon.
^ permalink raw reply
* Re: [PATCH] openvswitch: Remove unnecessary newlines from OVS_NLERR uses
From: David Miller @ 2017-08-11 21:52 UTC (permalink / raw)
To: joe-6d6DIl74uiNBDgjK7y7TUQ
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <72f936a314a54a7957afdeb19e3d019c8c1dabea.1502450609.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
From: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Date: Fri, 11 Aug 2017 04:26:26 -0700
> OVS_NLERR already adds a newline so these just add blank
> lines to the logging.
>
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Applied to net-next.
^ permalink raw reply
* Re: [PATCH] mISDN: Fix null pointer dereference at mISDN_FsmNew
From: David Miller @ 2017-08-11 21:56 UTC (permalink / raw)
To: vasilyev
Cc: isdn, geliangtang, johannes.berg, stephen, netdev, linux-kernel,
ldv-project
In-Reply-To: <1502456242-1695-1-git-send-email-vasilyev@ispras.ru>
From: Anton Vasilyev <vasilyev@ispras.ru>
Date: Fri, 11 Aug 2017 15:57:22 +0300
> If mISDN_FsmNew() fails to allocate memory for jumpmatrix
> then null pointer dereference will occur on any write to
> jumpmatrix.
>
> The patch adds check on successful allocation and
> corresponding error handling.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH] mlxsw: make mlxsw_config_profile const
From: David Miller @ 2017-08-11 21:57 UTC (permalink / raw)
To: bhumirks; +Cc: julia.lawall, jiri, idosch, netdev, linux-kernel
In-Reply-To: <1502458842-31516-1-git-send-email-bhumirks@gmail.com>
From: Bhumika Goyal <bhumirks@gmail.com>
Date: Fri, 11 Aug 2017 19:10:42 +0530
> Make these structures const as they only stored in the profile field of
> a mlxsw_driver structure, which is of type const.
> Done using Coccinelle.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Applied to net-next.
^ permalink raw reply
* Re: [PATCHv2 net-next] selftests: bpf: add check for ip XDP redirect
From: David Miller @ 2017-08-11 21:57 UTC (permalink / raw)
To: u9012063; +Cc: netdev, john.fastabend
In-Reply-To: <1502459199-6442-1-git-send-email-u9012063@gmail.com>
From: William Tu <u9012063@gmail.com>
Date: Fri, 11 Aug 2017 06:46:39 -0700
> Kernel test robot reports error when running test_xdp_redirect.sh.
> Check if ip tool supports xdpgeneric, if not, skip the test.
>
> Signed-off-by: William Tu <u9012063@gmail.com>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Applied, thank you.
^ permalink raw reply
* Re: Driver profiles RFC
From: Jakub Kicinski @ 2017-08-11 21:57 UTC (permalink / raw)
To: Arkadi Sharshevsky
Cc: netdev, David Miller, ivecera, roopa, Florian Fainelli,
Vivien Didelot, john.fastabend, Andrew Lunn, Jiri Pirko, mlxsw
In-Reply-To: <6d8560fa-8346-0c43-272d-d39be65ea82f@mellanox.com>
On Tue, 8 Aug 2017 16:15:41 +0300, Arkadi Sharshevsky wrote:
> Driver <--> Devlink API
> =======================
> Each driver will register his resources with default values at init in
> a similar way to DPIPE table registration. In case those resources already
> exist the default values are discarded. The user will be able to dump and
> update the resources. In order for the changes to take place the user will
> need to re-initiate the driver by a specific devlink knob.
What seems missing from the examples is the ability to dump the
different states - the "pending" configuration and the currently
applied one.
> The above described procedure will require extra reload of the driver.
> This can be improved as a future optimization.
I'm a bit lost, this says driver reload is required...
> UAPI
> ====
> The user will be able to update the resources on a per resource basis:
>
> $devlink dpipe resource set pci/0000:03:00.0 Mem_Linear 2M
>
> For some resources the size is fixed, for example the size of the internal
> memory cannot be changed. It is provided merely in order to reflect the
> nested structure of the resource and to imply the user that Mem = Linear +
> Hash, thus a set operation on it will fail.
>
> The user can dump the current resource configuration:
>
> #devlink dpipe resource dump tree pci/0000:03:00.0 Mem
>
> The user can specify 'tree' in order to show all the nested resources under
> the specified one. In case no 'resource name' is specified the TOP hierarchy
> will be dumped.
>
> After successful resource update the drivers hould be re-instantiated in
> order for the changes to take place:
>
> $devlink reload pci/0000:03:00.0
... but this shows a devlink reload tigger, so no driver reload? Were
you describing two possible solutions? One with persistent kernel
database of configs (persistent across driver reloads) and one with no
persistence and the driver is managing reinit internally when triggered
via devlink?
Another thing that comes to mind is - in case HW/FW reinit takes long
would it make sense to incorporate some form of pre-population of those
defaults somehow? If user knows exactly the config they want upon
boot, it would seem cleaner if the reconfig did not have to happen and
devices started out in the right mode.
^ permalink raw reply
* Re: [PATCH net 0/2] Minor fix in bpf_convert_ctx_access
From: David Miller @ 2017-08-11 21:59 UTC (permalink / raw)
To: daniel; +Cc: ast, netdev
In-Reply-To: <cover.1502468639.git.daniel@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Fri, 11 Aug 2017 18:31:23 +0200
> First one was found while trying to compile the kernel
> with !CONFIG_NET_RX_BUSY_POLL.
Series applied, thanks Daniel.
^ permalink raw reply
* Re: [PATCH net] udp: harden copy_linear_skb()
From: David Miller @ 2017-08-11 22:01 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, pabeni
In-Reply-To: <1502473733.4936.17.camel@edumazet-glaptop3.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 11 Aug 2017 10:48:53 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> syzkaller got crashes with CONFIG_HARDENED_USERCOPY=y configs.
>
> Issue here is that recvfrom() can be used with user buffer of Z bytes,
> and SO_PEEK_OFF of X bytes, from a skb with Y bytes, and following
> condition :
>
> Z < X < Y
>
> kernel BUG at mm/usercopy.c:72!
> invalid opcode: 0000 [#1] SMP KASAN
> Dumping ftrace buffer:
> (ftrace buffer empty)
> Modules linked in:
> CPU: 0 PID: 2917 Comm: syzkaller842281 Not tainted 4.13.0-rc3+ #16
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011
> task: ffff8801d2fa40c0 task.stack: ffff8801d1fe8000
> RIP: 0010:report_usercopy mm/usercopy.c:64 [inline]
> RIP: 0010:__check_object_size+0x3ad/0x500 mm/usercopy.c:264
> RSP: 0018:ffff8801d1fef8a8 EFLAGS: 00010286
> RAX: 0000000000000078 RBX: ffffffff847102c0 RCX: 0000000000000000
> RDX: 0000000000000078 RSI: 1ffff1003a3fded5 RDI: ffffed003a3fdf09
> RBP: ffff8801d1fef998 R08: 0000000000000001 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801d1ea480e
> R13: fffffffffffffffa R14: ffffffff84710280 R15: dffffc0000000000
> FS: 0000000001360880(0000) GS:ffff8801dc000000(0000)
> knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00000000202ecfe4 CR3: 00000001d1ff8000 CR4: 00000000001406f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
> check_object_size include/linux/thread_info.h:108 [inline]
> check_copy_size include/linux/thread_info.h:139 [inline]
> copy_to_iter include/linux/uio.h:105 [inline]
> copy_linear_skb include/net/udp.h:371 [inline]
> udpv6_recvmsg+0x1040/0x1af0 net/ipv6/udp.c:395
> inet_recvmsg+0x14c/0x5f0 net/ipv4/af_inet.c:793
> sock_recvmsg_nosec net/socket.c:792 [inline]
> sock_recvmsg+0xc9/0x110 net/socket.c:799
> SYSC_recvfrom+0x2d6/0x570 net/socket.c:1788
> SyS_recvfrom+0x40/0x50 net/socket.c:1760
> entry_SYSCALL_64_fastpath+0x1f/0xbe
>
>
> Fixes: b65ac44674dd ("udp: try to avoid 2 cache miss on dequeue")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: [PATCH net-next] liquidio: moved ptp_enable to octeon_device structure
From: David Miller @ 2017-08-11 22:03 UTC (permalink / raw)
To: felix.manlunas
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
intiyaz.basha
In-Reply-To: <20170811182209.GA1570@felix-thinkpad.cavium.com>
From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Fri, 11 Aug 2017 11:22:09 -0700
> From: Intiyaz Basha <intiyaz.basha@cavium.com>
>
> ptp_enable was a global static variable. Moved this global variable to
> octeon_device structure and removed extra device id check.
>
> Signed-off-by: Intiyaz Basha <intiyaz.basha@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/3] Add LAN743X driver
From: David Miller @ 2017-08-11 22:12 UTC (permalink / raw)
To: Bryan.Whitehead; +Cc: netdev, UNGLinuxDriver
In-Reply-To: <90A7E81AE28BAE4CBDDB3B35F187D264406F603F@CHN-SV-EXMX02.mchp-main.com>
From: <Bryan.Whitehead@microchip.com>
Date: Fri, 11 Aug 2017 19:47:57 +0000
> +static int lan743x_pci_init(struct lan743x_adapter *adapter,
> + struct pci_dev *pdev)
> +{
> + int ret = -ENODEV;
> + int bars = 0;
> + struct lan743x_pci *pci = &adapter->pci;
Please always order local variable declarations from longest to shortest
line (reverse christmas tree format).
> + pci_set_master(pdev);
> +
> +clean_up:
> + if (ret) {
It is more intuitive to structure this like:
return 0;
clean_up:
...
> +static u8 __iomem *lan743x_pci_get_bar_address(struct lan743x_adapter *adapter,
> + int bar_index)
> +{
> + u8 __iomem *result = NULL;
> + struct lan743x_pci *pci = &adapter->pci;
Reverse christmas tree ordering please.
> +static int lan743x_csr_light_reset(struct lan743x_adapter *adapter)
> +{
> + int result = -EIO;
> + u32 data;
> + unsigned long timeout;
Likewise.
> +static inline void lan743x_csr_write(
> + struct lan743x_adapter *adapter, int offset, u32 data)
Don't do the argument formatting like this please, it looks terrible.
This:
static inline void lan743x_csr_write(struct lan743x_adapter *adapter,
int offset, u32 data)
works much better.
> +static void lan743x_intr_union_isr(void *context, u32 int_sts)
> +{
> + struct lan743x_adapter *adapter = (struct lan743x_adapter *)context;
Casts from void pointers are never necessary, that's the whole point of
void pointers. Please remove this cast.
> +static irqreturn_t lan743x_vector_isr(int irq, void *ptr)
> +{
> + irqreturn_t result = IRQ_NONE;
> + struct lan743x_vector *vector = (struct lan743x_vector *)ptr;
> + struct lan743x_adapter *adapter = NULL;
> + u32 int_sts;
> + u32 mask;
Reverse christmas tree ordering please.
> +static int lan743x_intr_open(struct lan743x_adapter *adapter)
> +{
> + int ret = -ENODEV;
> + struct lan743x_intr *intr = &adapter->intr;
> + int index = 0;
Likewise.
> +static int lan743x_dp_wait_till_not_busy(struct lan743x_adapter *adapter)
> +{
> + int i;
> + u32 dp_sel = 0;
Likewise.
> +static int lan743x_dp_write(struct lan743x_adapter *adapter,
> + u32 select, u32 addr, u32 length, u32 *buf)
> +{
> + struct lan743x_dp *dp = &adapter->dp;
> + int ret = -EIO;
> + int i;
> + u32 dp_sel;
Likewise.
> +#ifdef CONFIG_PTP_1588_CLOCK
> +static int lan743x_gpio_reserve_ptp_output(struct lan743x_adapter *adapter,
> + int bit, int ptp_channel)
> +{
> + struct lan743x_gpio *gpio = &adapter->gpio;
> + int ret = -EBUSY;
> + unsigned long irq_flags = 0;
> + int bit_mask = BIT(bit);
Likewise.
> +#ifdef CONFIG_PTP_1588_CLOCK
> +static int lan743x_ptpci_adjfreq(struct ptp_clock_info *ptpci, s32 delta_ppb)
> +{
> + u32 u32_delta = 0;
> + u64 u64_delta = 0;
> + u32 lan743x_rate_adj = 0;
> + bool positive = true;
> + struct lan743x_ptp *ptp = LAN743X_PTPCI_TO_PTP;
> + struct lan743x_adapter *adapter = LAN743X_PTP_TO_ADAPTER;
Likewise.
> +#ifdef CONFIG_PTP_1588_CLOCK
> +static int lan743x_ptpci_adjtime(struct ptp_clock_info *ptpci, s64 delta)
> +{
> + struct lan743x_ptp *ptp = LAN743X_PTPCI_TO_PTP;
> + struct lan743x_adapter *adapter = LAN743X_PTP_TO_ADAPTER;
Likewise.
> +#ifdef CONFIG_PTP_1588_CLOCK
> +static int lan743x_ptpci_gettime64(struct ptp_clock_info *ptpci,
> + struct timespec64 *ts)
> +{
> + struct lan743x_ptp *ptp = LAN743X_PTPCI_TO_PTP;
> + struct lan743x_adapter *adapter = LAN743X_PTP_TO_ADAPTER;
Likewise.
> +#ifdef CONFIG_PTP_1588_CLOCK
> +static int lan743x_ptpci_settime64(struct ptp_clock_info *ptpci,
> + const struct timespec64 *ts)
> +{
> + struct lan743x_ptp *ptp = LAN743X_PTPCI_TO_PTP;
> + struct lan743x_adapter *adapter = LAN743X_PTP_TO_ADAPTER;
Likewise.
Also, these X_TO_Y macros are terrible. If you aren an accessor like
that, make it a nice inline function declared in a header file with
lowercase letter which actually does type checking on the pointer
variable which is dereferenced.
> + if (ts) {
> + u32 seconds = 0;
> + u32 nano_seconds = 0;
Reverse christmas tree ordering please.
> +#ifdef CONFIG_PTP_1588_CLOCK
> +static int lan743x_ptp_enable_pps(struct lan743x_adapter *adapter)
> +{
> + struct lan743x_ptp *ptp = &adapter->ptp;
> + int result = -ENODEV;
> + u32 current_seconds = 0;
> + u32 target_seconds = 0;
> + u32 general_config = 0;
Likewise.
> +static void lan743x_ptp_isr(void *context)
> +{
> + int enable_flag = 1;
> + u32 ptp_int_sts = 0;
> + struct lan743x_adapter *adapter = (struct lan743x_adapter *)context;
> + struct lan743x_ptp *ptp = NULL;
Likewise. And again please remove the void pointer cast.
> +#ifdef CONFIG_PTP_1588_CLOCK
> +static int lan743x_ptp_reserve_event_ch(struct lan743x_adapter *adapter)
> +{
> + struct lan743x_ptp *ptp = &adapter->ptp;
> + int index = 0;
> + int result = -ENODEV;
Likewise.
> +#ifdef CONFIG_PTP_1588_CLOCK
> +static void lan743x_ptp_clock_step(struct lan743x_adapter *adapter,
> + s64 time_step_ns)
> +{
> + struct lan743x_ptp *ptp = &adapter->ptp;
> + u64 abs_time_step_ns = 0;
> + s32 seconds = 0;
> + u32 nano_seconds = 0;
Likewise.
This thing is huge, I'm not reviewing any more of this enormous submission.
^ permalink raw reply
* Re: [PATCH 1/4] MIPS/seccomp: Fix indirect syscall args
From: Kees Cook @ 2017-08-11 22:17 UTC (permalink / raw)
To: James Hogan
Cc: Linux MIPS Mailing List, LKML, Ralf Baechle, David Daney,
Andy Lutomirski, Will Drewry, Oleg Nesterov, Alexei Starovoitov,
Daniel Borkmann, Network Development
In-Reply-To: <20170811205653.21873-2-james.hogan@imgtec.com>
On Fri, Aug 11, 2017 at 1:56 PM, James Hogan <james.hogan@imgtec.com> wrote:
> Since commit 669c4092225f ("MIPS: Give __secure_computing() access to
> syscall arguments."), upon syscall entry when seccomp is enabled,
> syscall_trace_enter() passes a carefully prepared struct seccomp_data
> containing syscall arguments to __secure_computing(). Unfortunately it
> directly uses mips_get_syscall_arg() and fails to take into account the
> indirect O32 system calls (i.e. syscall(2)) which put the system call
> number in a0 and have the arguments shifted up by one entry.
>
> We can't just revert that commit as samples/bpf/tracex5 would break
> again, so use syscall_get_arguments() which already takes indirect
> syscalls into account instead of directly using mips_get_syscall_arg(),
> similar to what populate_seccomp_data() does.
>
> This also removes the redundant error checking of the
> mips_get_syscall_arg() return value (get_user() already zeroes the
> result if an argument from the stack can't be loaded).
>
> Reported-by: James Cowgill <James.Cowgill@imgtec.com>
> Fixes: 669c4092225f ("MIPS: Give __secure_computing() access to syscall arguments.")
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: David Daney <david.daney@cavium.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Andy Lutomirski <luto@amacapital.net>
> Cc: Will Drewry <wad@chromium.org>
> Cc: Oleg Nesterov <oleg@redhat.com>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mips@linux-mips.org
> ---
> It would have been much simpler for MIPS arch code to just pass a NULL
> seccomp_data to secure_computing() so populate_seccomp_data() would take
> care of fetching arguments, as it did for MIPS prior to commit
> 669c4092225f ("MIPS: Give __secure_computing() access to syscall
> arguments."), but as that commit mentions it breaks samples/bpf/tracex5,
> which relies on sd being non-NULL at entry to __seccomp_filter().
>
> Arguably the samples/bpf/tracex5 test is flawed, at least for every arch
> except x86 (and now MIPS).
Weird. Yeah, that sample is broken. Allowing NULL sd is totally fine.
The point is that seccomp will use syscall_get_arguments() when it's
NULL (which is effectively what this is doing...)
The reason sd can be _non_-NULL is when an architecture has access to
the args in some way that might be faster than calling
syscall_get_arguments().
Regardless, I'm fine with this change. It should either be this or
reverting 669c4092225f, but it looks like kprobes of
__seccomp_filter() is desired on MIPS...
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> arch/mips/kernel/ptrace.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
> index 6dd13641a418..1395654cfc8d 100644
> --- a/arch/mips/kernel/ptrace.c
> +++ b/arch/mips/kernel/ptrace.c
> @@ -872,15 +872,13 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
> if (unlikely(test_thread_flag(TIF_SECCOMP))) {
> int ret, i;
> struct seccomp_data sd;
> + unsigned long args[6];
>
> sd.nr = syscall;
> sd.arch = syscall_get_arch();
> - for (i = 0; i < 6; i++) {
> - unsigned long v, r;
> -
> - r = mips_get_syscall_arg(&v, current, regs, i);
> - sd.args[i] = r ? 0 : v;
> - }
> + syscall_get_arguments(current, regs, 0, 6, args);
> + for (i = 0; i < 6; i++)
> + sd.args[i] = args[i];
> sd.instruction_pointer = KSTK_EIP(current);
>
> ret = __secure_computing(&sd);
> --
> 2.13.2
>
--
Kees Cook
Pixel Security
^ 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