Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next] net/sched: act_tunnel_key: Add dst_cache support
From: David Miller @ 2019-02-25  5:52 UTC (permalink / raw)
  To: wenxu; +Cc: jhs, netdev
In-Reply-To: <1550822292-14980-1-git-send-email-wenxu@ucloud.cn>

From: wenxu@ucloud.cn
Date: Fri, 22 Feb 2019 15:58:12 +0800

> From: wenxu <wenxu@ucloud.cn>
> 
> The metadata_dst is not init the dst_cache which make the
> ip_md_tunnel_xmit can't use the dst_cache. It will lookup
> route table every packets.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Applied.

^ permalink raw reply

* Re: [PATCH] ila: Fix uninitialised return value in ila_xlat_nl_cmd_flush
From: David Miller @ 2019-02-25  5:55 UTC (permalink / raw)
  To: herbert
  Cc: dan.carpenter, kbuild, kbuild-all, linux-wireless, johannes.berg,
	netdev
In-Reply-To: <20190223053047.tiwcuvs6tcg2htie@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Sat, 23 Feb 2019 13:30:47 +0800

> This patch fixes an uninitialised return value error in
> ila_xlat_nl_cmd_flush.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: 6c4128f65857 ("rhashtable: Remove obsolete...")
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied, thanks Herbert.

^ permalink raw reply

* Re: [PATCH net-next v2 0/3] ipv4/v6: icmp: small cleanup and update
From: David Miller @ 2019-02-25  5:57 UTC (permalink / raw)
  To: wangkefeng.wang; +Cc: netdev, eric.dumazet
In-Reply-To: <20190223072828.159975-1-wangkefeng.wang@huawei.com>

From: Kefeng Wang <wangkefeng.wang@huawei.com>
Date: Sat, 23 Feb 2019 15:28:25 +0800

> v2:
> - Add cover letter and user proper patch subject-prefix suggested-by Eric Dumazet
> 
> This patch series contains some small cleanup and update,
> 1) use icmp/v6_sk_exit when icmp_sk_init fails instead of open-code
> 2) use new percpu allocation interface for the ipv6.icmp_sk

Series applied, thanks.

^ permalink raw reply

* Re: [PATCHv3 net-next] tls: Return type of non-data records retrieved using MSG_PEEK in recvmsg
From: David Miller @ 2019-02-25  5:59 UTC (permalink / raw)
  To: vakul.garg; +Cc: netdev, borisp, aviadye, davejwatson, doronrk
In-Reply-To: <20190223084010.17021-1-vakul.garg@nxp.com>

From: Vakul Garg <vakul.garg@nxp.com>
Date: Sat, 23 Feb 2019 08:42:37 +0000

> The patch enables returning 'type' in msghdr for records that are
> retrieved with MSG_PEEK in recvmsg. Further it prevents records peeked
> from socket from getting clubbed with any other record of different
> type when records are subsequently dequeued from strparser.
> 
> For each record, we now retain its type in sk_buff's control buffer
> cb[]. Inside control buffer, record's full length and offset are already
> stored by strparser in 'struct strp_msg'. We store record type after
> 'struct strp_msg' inside 'struct tls_msg'. For tls1.2, the type is
> stored just after record dequeue. For tls1.3, the type is stored after
> record has been decrypted.
> 
> Inside process_rx_list(), before processing a non-data record, we check
> that we must be able to return back the record type to the user
> application. If not, the decrypted records in tls context's rx_list is
> left there without consuming any data.
> 
> Fixes: 692d7b5d1f912 ("tls: Fix recvmsg() to be able to peek across
> multiple records")
> Signed-off-by: Vakul Garg <vakul.garg@nxp.com>

Applied, but please don't break up long Fixes: lines into multiple lines.
Always keep it all on one single line.

^ permalink raw reply

* RE: [PATCHv3 net-next] tls: Return type of non-data records retrieved using MSG_PEEK in recvmsg
From: Vakul Garg @ 2019-02-25  6:02 UTC (permalink / raw)
  To: David Miller
  Cc: netdev@vger.kernel.org, borisp@mellanox.com, aviadye@mellanox.com,
	davejwatson@fb.com, doronrk@fb.com
In-Reply-To: <20190224.215904.2270271071160812988.davem@davemloft.net>



> -----Original Message-----
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> Behalf Of David Miller
> Sent: Monday, February 25, 2019 11:29 AM
> To: Vakul Garg <vakul.garg@nxp.com>
> Cc: netdev@vger.kernel.org; borisp@mellanox.com;
> aviadye@mellanox.com; davejwatson@fb.com; doronrk@fb.com
> Subject: Re: [PATCHv3 net-next] tls: Return type of non-data records
> retrieved using MSG_PEEK in recvmsg
> 
> From: Vakul Garg <vakul.garg@nxp.com>
> Date: Sat, 23 Feb 2019 08:42:37 +0000
> 
> > The patch enables returning 'type' in msghdr for records that are
> > retrieved with MSG_PEEK in recvmsg. Further it prevents records peeked
> > from socket from getting clubbed with any other record of different
> > type when records are subsequently dequeued from strparser.
> >
> > For each record, we now retain its type in sk_buff's control buffer
> > cb[]. Inside control buffer, record's full length and offset are
> > already stored by strparser in 'struct strp_msg'. We store record type
> > after 'struct strp_msg' inside 'struct tls_msg'. For tls1.2, the type
> > is stored just after record dequeue. For tls1.3, the type is stored
> > after record has been decrypted.
> >
> > Inside process_rx_list(), before processing a non-data record, we
> > check that we must be able to return back the record type to the user
> > application. If not, the decrypted records in tls context's rx_list is
> > left there without consuming any data.
> >
> > Fixes: 692d7b5d1f912 ("tls: Fix recvmsg() to be able to peek across
> > multiple records")
> > Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
> 
> Applied, but please don't break up long Fixes: lines into multiple lines.
> Always keep it all on one single line.
 
I am sorry.
Since I fixed this problem in v3 patch, did you still find it?
I am confused.


^ permalink raw reply

* Re: [PATCH 0/3] soc: fsl: dpio: enable and configure cache stashing
From: David Miller @ 2019-02-25  6:06 UTC (permalink / raw)
  To: ioana.ciornei
  Cc: leoyang.li, roy.pledge, ruxandra.radulescu, laurentiu.tudor,
	horia.geanta, brouer, netdev, linux-kernel
In-Reply-To: <20190223084816.28985-1-ioana.ciornei@nxp.com>

From: Ioana Ciornei <ioana.ciornei@nxp.com>
Date: Sat, 23 Feb 2019 08:48:42 +0000

> The first two patches enable cache stashing and configure the core cluster
> destination per software portal while the third patch is the one
> configuring the amount of stashing on a queue.

Should I merge this series in via my networking tree?

Thanks.

^ permalink raw reply

* Re: [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver
From: David Miller @ 2019-02-25  6:10 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm
In-Reply-To: <1550913739-13232-1-git-send-email-tanhuazhong@huawei.com>

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sat, 23 Feb 2019 17:22:07 +0800

> This patchset includes bugfixes and code optimizations for
> the HNS3 ethernet controller driver.

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH] tun: fix blocking read
From: David Miller @ 2019-02-25  6:12 UTC (permalink / raw)
  To: mail; +Cc: netdev, linux-kernel
In-Reply-To: <20190223115313.15064-1-mail@timurcelik.de>

From: Timur Celik <mail@timurcelik.de>
Date: Sat, 23 Feb 2019 12:53:13 +0100

> This patch moves setting of the current state into the loop. Otherwise
> the task may end up in a busy wait loop if none of the break conditions
> are met.
> 
> Signed-off-by: Timur Celik <mail@timurcelik.de>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH net-next v4] ip_tunnel: Add dst_cache support in lwtunnel_state of ip tunnel
From: David Miller @ 2019-02-25  6:14 UTC (permalink / raw)
  To: wenxu; +Cc: netdev
In-Reply-To: <1550928774-20575-1-git-send-email-wenxu@ucloud.cn>

From: wenxu@ucloud.cn
Date: Sat, 23 Feb 2019 21:32:54 +0800

> From: wenxu <wenxu@ucloud.cn>
> 
> The lwtunnel_state is not init the dst_cache Which make the
> ip_md_tunnel_xmit can't use the dst_cache. It will lookup
> route table every packets.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Applied.

^ permalink raw reply

* [PATCH v3 2/2] drivers: net: phy: mdio-mux: Add support for Generic Mux controls
From: Pankaj Bansal @ 2019-02-25  6:16 UTC (permalink / raw)
  To: Leo Li, Peter Rosin, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit
  Cc: Pankaj Bansal, netdev@vger.kernel.org
In-Reply-To: <20190225114121.7878-1-pankaj.bansal@nxp.com>

Add support for Generic Mux controls, when Mdio mux node is a consumer
of mux produced by some other device.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
---

Notes:
    V3:
    - Avoid recast from platform_get_drvdata
    - Check mux_control_deselect output in switch_fn
    - rearrange swithc_fn code to reduce code indentation by one tab
    - Add do_deselect boolean in driver data to indicate that mux_control_deselect
      has to be called, becuase mux_control_select has been called once.
    V2:
    - Moved the changes from mdio-mux module to new module mdio-mux-multiplexer
    - defined new CONFIG
    - using new compatible "mdio-mux-multiplexer"

 drivers/net/phy/Kconfig                |  12 +++
 drivers/net/phy/Makefile               |   1 +
 drivers/net/phy/mdio-mux-multiplexer.c | 122 +++++++++++++++++++++++
 3 files changed, 135 insertions(+)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 3d187cd50eb0..7f66af446ec7 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -87,6 +87,18 @@ config MDIO_BUS_MUX_MMIOREG
 
 	  Currently, only 8/16/32 bits registers are supported.
 
+config MDIO_BUS_MUX_MULTIPLEXER
+	tristate "MDIO bus multiplexer using kernel multiplexer subsystem"
+	depends on OF
+	select MULTIPLEXER
+	select MDIO_BUS_MUX
+	help
+	  This module provides a driver for MDIO bus multiplexer
+	  that is controlled via the kernel multiplexer subsystem. The
+	  bus multiplexer connects one of several child MDIO busses to
+	  a parent bus.  Child bus selection is under the control of
+	  the kernel multiplexer subsystem.
+
 config MDIO_CAVIUM
 	tristate
 
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 5805c0b7d60e..766106237a90 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_MDIO_BUS_MUX)	+= mdio-mux.o
 obj-$(CONFIG_MDIO_BUS_MUX_BCM_IPROC)	+= mdio-mux-bcm-iproc.o
 obj-$(CONFIG_MDIO_BUS_MUX_GPIO)	+= mdio-mux-gpio.o
 obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) += mdio-mux-mmioreg.o
+obj-$(CONFIG_MDIO_BUS_MUX_MULTIPLEXER) += mdio-mux-multiplexer.o
 obj-$(CONFIG_MDIO_CAVIUM)	+= mdio-cavium.o
 obj-$(CONFIG_MDIO_GPIO)		+= mdio-gpio.o
 obj-$(CONFIG_MDIO_HISI_FEMAC)	+= mdio-hisi-femac.o
diff --git a/drivers/net/phy/mdio-mux-multiplexer.c b/drivers/net/phy/mdio-mux-multiplexer.c
new file mode 100644
index 000000000000..d6564381aa3e
--- /dev/null
+++ b/drivers/net/phy/mdio-mux-multiplexer.c
@@ -0,0 +1,122 @@
+// SPDX-License-Identifier: GPL-2.0+
+/* MDIO bus multiplexer using kernel multiplexer subsystem
+ *
+ * Copyright 2019 NXP
+ */
+
+#include <linux/platform_device.h>
+#include <linux/mdio-mux.h>
+#include <linux/module.h>
+#include <linux/mux/consumer.h>
+
+struct mdio_mux_multiplexer_state {
+	struct mux_control *muxc;
+	bool do_deselect;
+	void *mux_handle;
+};
+
+/**
+ * mdio_mux_multiplexer_switch_fn - This function is called by the mdio-mux
+ *                                  layer when it thinks the mdio bus
+ *                                  multiplexer needs to switch.
+ * @current_child:  current value of the mux register.
+ * @desired_child: value of the 'reg' property of the target child MDIO node.
+ * @data: Private data used by this switch_fn passed to mdio_mux_init function
+ *        via mdio_mux_init(.., .., .., .., data, ..).
+ *
+ * The first time this function is called, current_child == -1.
+ * If current_child == desired_child, then the mux is already set to the
+ * correct bus.
+ */
+static int mdio_mux_multiplexer_switch_fn(int current_child, int desired_child,
+					  void *data)
+{
+	struct platform_device *pdev;
+	struct mdio_mux_multiplexer_state *s;
+	int ret = 0;
+
+	pdev = (struct platform_device *)data;
+	s = platform_get_drvdata(pdev);
+
+	if (!(current_child ^ desired_child))
+		return 0;
+
+	if (s->do_deselect)
+		ret = mux_control_deselect(s->muxc);
+	if (ret) {
+		dev_err(&pdev->dev, "mux_control_deselect failed in %s: %d\n",
+			__func__, ret);
+		return ret;
+	}
+
+	ret =  mux_control_select(s->muxc, desired_child);
+	if (!ret) {
+		dev_dbg(&pdev->dev, "%s %d -> %d\n", __func__, current_child,
+			desired_child);
+		s->do_deselect = true;
+	} else {
+		s->do_deselect = false;
+	}
+
+	return ret;
+}
+
+static int mdio_mux_multiplexer_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct mdio_mux_multiplexer_state *s;
+	int ret = 0;
+
+	s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL);
+	if (!s)
+		return -ENOMEM;
+
+	s->muxc = devm_mux_control_get(dev, NULL);
+	if (IS_ERR(s->muxc)) {
+		ret = PTR_ERR(s->muxc);
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Failed to get mux: %d\n", ret);
+		return ret;
+	}
+
+	platform_set_drvdata(pdev, s);
+
+	ret = mdio_mux_init(&pdev->dev, pdev->dev.of_node,
+			    mdio_mux_multiplexer_switch_fn, &s->mux_handle,
+			    pdev, NULL);
+
+	return ret;
+}
+
+static int mdio_mux_multiplexer_remove(struct platform_device *pdev)
+{
+	struct mdio_mux_multiplexer_state *s = platform_get_drvdata(pdev);
+
+	mdio_mux_uninit(s->mux_handle);
+
+	if (s->do_deselect)
+		mux_control_deselect(s->muxc);
+
+	return 0;
+}
+
+static const struct of_device_id mdio_mux_multiplexer_match[] = {
+	{ .compatible = "mdio-mux-multiplexer", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mdio_mux_multiplexer_match);
+
+static struct platform_driver mdio_mux_multiplexer_driver = {
+	.driver = {
+		.name		= "mdio-mux-multiplexer",
+		.of_match_table	= mdio_mux_multiplexer_match,
+	},
+	.probe		= mdio_mux_multiplexer_probe,
+	.remove		= mdio_mux_multiplexer_remove,
+};
+
+module_platform_driver(mdio_mux_multiplexer_driver);
+
+MODULE_DESCRIPTION("MDIO bus multiplexer using kernel multiplexer subsystem");
+MODULE_AUTHOR("Pankaj Bansal <pankaj.bansal@nxp.com>");
+MODULE_LICENSE("GPL");
-- 
2.17.1


^ permalink raw reply related

* [PATCH v3 1/2] dt-bindings: net:  Add bindings for mdio mux consumers
From: Pankaj Bansal @ 2019-02-25  6:16 UTC (permalink / raw)
  To: Leo Li, Peter Rosin, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, Rob Herring, Mark Rutland
  Cc: Pankaj Bansal, devicetree@vger.kernel.org, netdev@vger.kernel.org

When we use the bindings defined in Documentation/devicetree/bindings/mux
to define mdio mux in producer and consumer terms, it results in two
devices. one is mux producer and other is mux consumer.

Add the bindings needed for Mdio mux consumer devices.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
---

Notes:
    V3:
    - No Change
    V2:
    - moved the bindings from mdio-mux.txt to new file mdio-mux-multiplexer.txt
    - changed compatible to mdio-mux-multiplexer

 .../bindings/net/mdio-mux-multiplexer.txt    | 83 ++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt b/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
new file mode 100644
index 000000000000..9d5384849929
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
@@ -0,0 +1,83 @@
+Properties for an MDIO bus multiplexer consumer device
+
+This is a special case of MDIO mux  when MDIO mux is defined as a consumer
+of a mux producer device. The mux producer can be of any type like mmio mux
+producer, gpio mux producer or generic register based mux producer.
+
+Required properties in addition to the MDIO Bus multiplexer properties:
+
+- compatible : should be "mmio-mux-multiplexer"
+- mux-controls : mux controller node to use for operating the mux
+- mdio-parent-bus : phandle to the parent MDIO bus.
+
+each child node of mdio bus multiplexer consumer device represent a mdio
+bus.
+
+for more information please refer
+Documentation/devicetree/bindings/mux/mux-controller.txt
+and Documentation/devicetree/bindings/net/mdio-mux.txt
+
+Example:
+In below example the Mux producer and consumer are separate nodes.
+
+&i2c0 {
+	fpga@66 { // fpga connected to i2c
+		compatible = "fsl,lx2160aqds-fpga", "fsl,fpga-qixis-i2c",
+			     "simple-mfd";
+		reg = <0x66>;
+
+		mux: mux-controller { // Mux Producer
+			compatible = "reg-mux";
+			#mux-control-cells = <1>;
+			mux-reg-masks = <0x54 0xf8>, /* 0: reg 0x54, bits 7:3 */
+					<0x54 0x07>; /* 1: reg 0x54, bits 2:0 */
+		};
+	};
+};
+
+mdio-mux-1 { // Mux consumer
+	compatible = "mdio-mux-multiplexer";
+	mux-controls = <&mux 0>;
+	mdio-parent-bus = <&emdio1>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	mdio@0 {
+		reg = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	mdio@8 {
+		reg = <0x8>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	..
+	..
+};
+
+mdio-mux-2 { // Mux consumer
+	compatible = "mdio-mux-multiplexer";
+	mux-controls = <&mux 1>;
+	mdio-parent-bus = <&emdio2>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	mdio@0 {
+		reg = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	mdio@1 {
+		reg = <0x1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	..
+	..
+};
+
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH net-next 0/2] mv88e6xxx: Avoid false positive Lockdep splats
From: David Miller @ 2019-02-25  6:21 UTC (permalink / raw)
  To: andrew; +Cc: vivien.didelot, rmk+kernel, netdev
In-Reply-To: <20190223164357.17284-1-andrew@lunn.ch>

From: Andrew Lunn <andrew@lunn.ch>
Date: Sat, 23 Feb 2019 17:43:55 +0100

> When acquiring the GPIO interrupt line for the switch, it is possible
> to trigger lockdep splats. These are false positives, the mutex is in
> a different IRQ descriptor. But fix it anyway, since it could mask
> real locking issues.

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next v3] ip_tunnel: Add ip tunnel tun_info type dst_cache in ip_tunnel_xmit
From: David Miller @ 2019-02-25  6:25 UTC (permalink / raw)
  To: wenxu; +Cc: netdev
In-Reply-To: <1550967885-18628-1-git-send-email-wenxu@ucloud.cn>

From: wenxu@ucloud.cn
Date: Sun, 24 Feb 2019 08:24:45 +0800

> From: wenxu <wenxu@ucloud.cn>
> 
> ip l add dev tun type gretap key 1000
> 
> Non-tunnel-dst ip tunnel device can send packet through lwtunnel
> This patch provide the tun_inf dst cache support for this mode.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: fix double-free in bpf_lwt_xmit_reroute
From: David Miller @ 2019-02-25  6:25 UTC (permalink / raw)
  To: posk; +Cc: netdev, posk
In-Reply-To: <20190224022501.71889-1-posk@google.com>

From: Peter Oskolkov <posk@google.com>
Date: Sat, 23 Feb 2019 18:25:01 -0800

> dst_output() frees skb when it fails (see, for example,
> ip_finish_output2), so it must not be freed in this case.
> 
> Fixes: 3bd0b15281af ("bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c")
> Signed-off-by: Peter Oskolkov <posk@google.com>

Applied.

^ permalink raw reply

* Re: [PATCH] ip_tunnel: Add ip tunnel tunnel_info dst_cache in ip_tunnel_xmit
From: Dan Carpenter @ 2019-02-25  6:27 UTC (permalink / raw)
  To: kbuild, wenxu; +Cc: kbuild-all, netdev, davem
In-Reply-To: <1550750930-27138-1-git-send-email-wenxu@ucloud.cn>

Hi wenxu,

Thank you for the patch! Perhaps something to improve:

url:    https://github.com/0day-ci/linux/commits/wenxu-ucloud-cn/ip_tunnel-Add-ip-tunnel-tunnel_info-dst_cache-in-ip_tunnel_xmit/20190224-065214

smatch warnings:
net/ipv4/ip_tunnel.c:734 ip_tunnel_xmit() error: uninitialized symbol 'rt'.

# https://github.com/0day-ci/linux/commit/fb0c8c40052c62033bf5f92559eabe4e7a98851e
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout fb0c8c40052c62033bf5f92559eabe4e7a98851e
vim +/rt +734 net/ipv4/ip_tunnel.c

7d442fab0 Tom Herbert        2014-01-02  717  
b0066da52 Petr Machata       2018-02-27  718  	ip_tunnel_init_flow(&fl4, protocol, dst, tnl_params->saddr,
9830ad4c6 Craig Gallek       2017-04-19  719  			    tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link,
9830ad4c6 Craig Gallek       2017-04-19  720  			    tunnel->fwmark);
7d442fab0 Tom Herbert        2014-01-02  721  
563284865 Tom Herbert        2014-09-17  722  	if (ip_tunnel_encap(skb, tunnel, &protocol, &fl4) < 0)
563284865 Tom Herbert        2014-09-17  723  		goto tx_error;
563284865 Tom Herbert        2014-09-17  724  
fb0c8c400 wenxu              2019-02-21  725  	if (connected && md) {
fb0c8c400 wenxu              2019-02-21  726  		use_cache = ip_tunnel_dst_cache_usable(skb, tun_info);
fb0c8c400 wenxu              2019-02-21  727  		if (use_cache)
fb0c8c400 wenxu              2019-02-21  728  			rt = dst_cache_get_ip4(&tun_info->dst_cache, &fl4.saddr);

What about if "use_cache" is false?  "rt" is potentially not set.

fb0c8c400 wenxu              2019-02-21  729  	} else {
e09acddf8 Paolo Abeni        2016-02-12  730  		rt = connected ? dst_cache_get_ip4(&tunnel->dst_cache, &fl4.saddr) :
e09acddf8 Paolo Abeni        2016-02-12  731  			 NULL;
fb0c8c400 wenxu              2019-02-21  732  	}
7d442fab0 Tom Herbert        2014-01-02  733  
7d442fab0 Tom Herbert        2014-01-02 @734  	if (!rt) {
                                                    ^^^

7d442fab0 Tom Herbert        2014-01-02  735  		rt = ip_route_output_key(tunnel->net, &fl4);
c54419321 Pravin B Shelar    2013-03-25  736  
c54419321 Pravin B Shelar    2013-03-25  737  		if (IS_ERR(rt)) {
c54419321 Pravin B Shelar    2013-03-25  738  			dev->stats.tx_carrier_errors++;
c54419321 Pravin B Shelar    2013-03-25  739  			goto tx_error;
c54419321 Pravin B Shelar    2013-03-25  740  		}
fb0c8c400 wenxu              2019-02-21  741  		if (use_cache)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply

* Re: pull request: bluetooth-next 2019-02-24
From: David Miller @ 2019-02-25  6:27 UTC (permalink / raw)
  To: johan.hedberg; +Cc: netdev, linux-bluetooth
In-Reply-To: <20190224083634.GA82295@jhedberg-mac01.home>

From: Johan Hedberg <johan.hedberg@gmail.com>
Date: Sun, 24 Feb 2019 10:36:34 +0200

> Here's the main bluetooth-next pull request for the 5.1 kernel.
> 
>  - Fixes & improvements to mediatek, hci_qca, btrtl, and btmrvl HCI drivers
>  - Fixes to parsing invalid L2CAP config option sizes
>  - Locking fix to bt_accept_enqueue()
>  - Add support for new Marvel sd8977 chipset
>  - Various other smaller fixes & cleanups
> 
> Please let me know if there are any issues pulling. Thanks.

Pulled, thanks Johan.

^ permalink raw reply

* Re: [PATCH net-next] net: phy: improve auto-neg emulation in swphy
From: David Miller @ 2019-02-25  6:28 UTC (permalink / raw)
  To: hkallweit1; +Cc: andrew, f.fainelli, linux, netdev
In-Reply-To: <a290442f-fdae-26da-6073-3675bf635af1@gmail.com>

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun, 24 Feb 2019 17:41:47 +0100

> Auto-neg emulation currently doesn't set bit BMCR_ANENABLE in BMCR,
> add this. Users will ignore speed and duplex settings in BMCR because
> we're emulating auto-neg, therefore we can remove related code.
> See also following discussion [0].
> 
> [0] https://marc.info/?t=155041784900002&r=1&w=2
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied, thanks Heiner.

^ permalink raw reply

* Re: [PATCH net] net: phy: fix reading fixed phy status
From: David Miller @ 2019-02-25  6:29 UTC (permalink / raw)
  To: hkallweit1; +Cc: andrew, f.fainelli, netdev
In-Reply-To: <7ab8732d-bcc1-cc49-4bc8-34826e78038b@gmail.com>

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun, 24 Feb 2019 18:01:18 +0100

> With the switch to phy_resolve_aneg_linkmode() we don't read from the
> chip any longer what is advertised but use phydev->advertising directly.
> For a fixed phy however this bitmap is empty so far, what results in
> no common mode being found. This breaks DSA. Fix this by advertising
> everything that is supported. For a normal phy this done by phy_probe().
> 
> Fixes: 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied to net-next.

Let me know if I got this wrong.

^ permalink raw reply

* Re: [PATCH net-next] dsa: Remove phydev parameter from disable_port call
From: David Miller @ 2019-02-25  6:30 UTC (permalink / raw)
  To: andrew
  Cc: netdev, f.fainelli, vivien.didelot, hauke, Woojung.Huh, sean.wang,
	linus.walleij
In-Reply-To: <20190224194443.20693-1-andrew@lunn.ch>

From: Andrew Lunn <andrew@lunn.ch>
Date: Sun, 24 Feb 2019 20:44:43 +0100

> No current DSA driver makes use of the phydev parameter passed to the
> disable_port call. Remove it.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Applied to net-next, with some fuzz...

^ permalink raw reply

* Re: [PATCH net-next] switchdev: Complete removal of switchdev_port_attr_get()
From: David Miller @ 2019-02-25  6:32 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, idosch, jiri, ivecera, linux-kernel
In-Reply-To: <20190225023902.18894-1-f.fainelli@gmail.com>

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Sun, 24 Feb 2019 18:39:02 -0800

> We have no more in tree users of switchdev_port_attr_get() after
> d0e698d57a94 ("Merge branch 'net-Get-rid-of-switchdev_port_attr_get'")
> so completely remove the function signature and body.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks.

^ permalink raw reply

* [PATCH mlx5-next] net/mlx5: ODP support for XRC transport is not enabled by default in FW
From: Leon Romanovsky @ 2019-02-25  6:54 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Moni Shoua, RDMA mailing list, Saeed Mahameed, linux-netdev,
	Leon Romanovsky

From: Moni Shoua <monis@mellanox.com>

ODP support for XRC transport is not enabled by default in FW,
so we need separate ODP checks to enable/disable it.

While that, rewrite the set of ODP SRQ support capabilities in way
that tests each field separately for clearness, which is not needed
for current FW, but better to have it separated.

Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 .../net/ethernet/mellanox/mlx5/core/main.c    | 38 +++++++++++--------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index af67c3f3b165..58b48474147f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -465,6 +465,7 @@ static int handle_hca_cap_odp(struct mlx5_core_dev *dev)
 	void *set_hca_cap;
 	void *set_ctx;
 	int set_sz;
+	bool do_set = false;
 	int err;

 	if (!IS_ENABLED(CONFIG_INFINIBAND_ON_DEMAND_PAGING) ||
@@ -475,11 +476,6 @@ static int handle_hca_cap_odp(struct mlx5_core_dev *dev)
 	if (err)
 		return err;

-	if (!(MLX5_CAP_ODP_MAX(dev, ud_odp_caps.srq_receive) ||
-	      MLX5_CAP_ODP_MAX(dev, rc_odp_caps.srq_receive) ||
-	      MLX5_CAP_ODP_MAX(dev, xrc_odp_caps.srq_receive)))
-		return 0;
-
 	set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in);
 	set_ctx = kzalloc(set_sz, GFP_KERNEL);
 	if (!set_ctx)
@@ -489,19 +485,29 @@ static int handle_hca_cap_odp(struct mlx5_core_dev *dev)
 	memcpy(set_hca_cap, dev->caps.hca_cur[MLX5_CAP_ODP],
 	       MLX5_ST_SZ_BYTES(odp_cap));

-	/* set ODP SRQ support for RC/UD and XRC transports */
-	MLX5_SET(odp_cap, set_hca_cap, ud_odp_caps.srq_receive,
-		 MLX5_CAP_ODP_MAX(dev, ud_odp_caps.srq_receive));
-
-	MLX5_SET(odp_cap, set_hca_cap, rc_odp_caps.srq_receive,
-		 MLX5_CAP_ODP_MAX(dev, rc_odp_caps.srq_receive));
-
-	MLX5_SET(odp_cap, set_hca_cap, xrc_odp_caps.srq_receive,
-		 MLX5_CAP_ODP_MAX(dev, xrc_odp_caps.srq_receive));
-
-	err = set_caps(dev, set_ctx, set_sz, MLX5_SET_HCA_CAP_OP_MOD_ODP);
+#define ODP_CAP_SET_MAX(dev, field) do {			\
+	u32 _res = MLX5_CAP_ODP_MAX(dev, field);		\
+	if (_res) {						\
+		do_set = true;					\
+		MLX5_SET(odp_cap, set_hca_cap, field, _res);	\
+	}							\
+} while (0)
+
+	ODP_CAP_SET_MAX(dev, ud_odp_caps.srq_receive);
+	ODP_CAP_SET_MAX(dev, rc_odp_caps.srq_receive);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.srq_receive);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.send);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.receive);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.write);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.read);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.atomic);
+
+	if (do_set)
+		err = set_caps(dev, set_ctx, set_sz,
+			       MLX5_SET_HCA_CAP_OP_MOD_ODP);

 	kfree(set_ctx);
+
 	return err;
 }

--
2.19.1


^ permalink raw reply related

* RE: [PATCH 0/3] soc: fsl: dpio: enable and configure cache stashing
From: Ioana Ciornei @ 2019-02-25  7:00 UTC (permalink / raw)
  To: David Miller
  Cc: Leo Li, Roy Pledge, Ioana Ciocoi Radulescu, Laurentiu Tudor,
	Horia Geanta, brouer@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <20190224.220653.256212672271785631.davem@davemloft.net>

> Subject: Re: [PATCH 0/3] soc: fsl: dpio: enable and configure cache stashing
> 
> From: Ioana Ciornei <ioana.ciornei@nxp.com>
> Date: Sat, 23 Feb 2019 08:48:42 +0000
> 
> > The first two patches enable cache stashing and configure the core
> > cluster destination per software portal while the third patch is the
> > one configuring the amount of stashing on a queue.
> 
> Should I merge this series in via my networking tree?

Even though it would be really good to have this on the networking tree as soon as possible, I am afraid that patch 2/3 is not going to apply cleanly because it touches the same areas of code that some other patches on Leo's tree are.

Thanks,
Ioana C



^ permalink raw reply

* [PATCH v2] net: dsa: fix a leaked reference by adding missing of_node_put
From: Wen Yang @ 2019-02-25  7:22 UTC (permalink / raw)
  To: andrew
  Cc: vivien.didelot, f.fainelli, davem, netdev, linux-kernel,
	wang.yi59, Wen Yang

The call to of_parse_phandle returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.

Detected by coccinelle with the following warnings:
./net/dsa/port.c:294:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 284, but without a corresponding object release within this function.
./net/dsa/dsa2.c:627:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
./net/dsa/dsa2.c:630:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
./net/dsa/dsa2.c:636:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
./net/dsa/dsa2.c:639:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
v2->v1: preserve the reverse christmas tree ordering of variables.

 net/dsa/dsa2.c | 16 ++++++++++------
 net/dsa/port.c |  1 +
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 8c431e0..c00ee464 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -612,8 +612,8 @@ static int dsa_switch_parse_ports_of(struct dsa_switch *ds,
 {
 	struct device_node *ports, *port;
 	struct dsa_port *dp;
+	int err = 0;
 	u32 reg;
-	int err;
 
 	ports = of_get_child_by_name(dn, "ports");
 	if (!ports) {
@@ -624,19 +624,23 @@ static int dsa_switch_parse_ports_of(struct dsa_switch *ds,
 	for_each_available_child_of_node(ports, port) {
 		err = of_property_read_u32(port, "reg", &reg);
 		if (err)
-			return err;
+			goto out_put_node;
 
-		if (reg >= ds->num_ports)
-			return -EINVAL;
+		if (reg >= ds->num_ports) {
+			err = -EINVAL;
+			goto out_put_node;
+		}
 
 		dp = &ds->ports[reg];
 
 		err = dsa_port_parse_of(dp, port);
 		if (err)
-			return err;
+			goto out_put_node;
 	}
 
-	return 0;
+out_put_node:
+	of_node_put(ports);
+	return err;
 }
 
 static int dsa_switch_parse_member_of(struct dsa_switch *ds,
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 2d7e01b..a6d9a04 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -291,6 +291,7 @@ static struct phy_device *dsa_port_get_phy_device(struct dsa_port *dp)
 		return ERR_PTR(-EPROBE_DEFER);
 	}
 
+	of_node_put(phy_dn);
 	return phydev;
 }
 
-- 
2.9.5


^ permalink raw reply related

* Re: [PATCH net-next v2 2/2] net: phy: aquantia: add hwmon support
From: Heiner Kallweit @ 2019-02-25  7:34 UTC (permalink / raw)
  To: Florian Fainelli, Andrew Lunn, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <5e9c1d9f-4c9f-10fd-439e-26f7f2cc467e@gmail.com>

On 25.02.2019 03:17, Florian Fainelli wrote:
> Le 2/24/19 à 1:36 PM, Heiner Kallweit a écrit :
>> This adds HWMON support for the temperature sensor and the related
>> alarms on the 107/108/109 chips. This patch is based on work from
>> Nikita and Andrew. I added:
>> - support for changing alarm thresholds via sysfs
>> - move HWMON code to a separate source file to improve maintainability
>> - smaller changes like using IS_REACHABLE instead of ifdef
>>   (avoids problems if PHY driver is built in and HWMON is a module)
>>
>> v2:
>> - remove struct aqr_priv
>> - rename header file to aquantia.h
>>
>> Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
> 
> Should not Nikita be the author for that patch? Some minor nits below:
> 
>> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/net/phy/Makefile         |   2 +-
>>  drivers/net/phy/aquantia.h       |  16 ++
>>  drivers/net/phy/aquantia_hwmon.c | 245 +++++++++++++++++++++++++++++++
>>  drivers/net/phy/aquantia_main.c  |   4 +
>>  4 files changed, 266 insertions(+), 1 deletion(-)
>>  create mode 100644 drivers/net/phy/aquantia.h
>>  create mode 100644 drivers/net/phy/aquantia_hwmon.c
>>
>> diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
>> index b0845adaf..c48596626 100644
>> --- a/drivers/net/phy/Makefile
>> +++ b/drivers/net/phy/Makefile
>> @@ -45,7 +45,7 @@ sfp-obj-$(CONFIG_SFP)		+= sfp-bus.o
>>  obj-y				+= $(sfp-obj-y) $(sfp-obj-m)
>>  
>>  obj-$(CONFIG_AMD_PHY)		+= amd.o
>> -aquantia-objs			+= aquantia_main.o
>> +aquantia-objs			+= aquantia_main.o aquantia_hwmon.o
> 
> Since you are adding a stub if CONFIG_HWMON is not reachable, does not
> that mean you would want to do something like:
> 
> ifdef CONFIG_HWMON
> aquanti-objs	+= aquantia_hwmon.o
> endif
> 
> in this makefile?
> 
Yepp, this should be changed as suggested by you.

> [snip]
> 
>> +static int aqr_hwmon_get(struct phy_device *phydev, int reg, long *value)
>> +{
>> +	int temp = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg);
>> +
>> +	if (temp < 0)
>> +		return temp;
>> +
>> +	/* register value is 2's complement with LSB = 1/256th degree Celsius */
>> +	if (temp > 0x8000)
>> +		temp -= 0x10000;
> 
> Would decimal or BIT() notation be easier to use/read here?
> 
For the comparison I agree, we can write it as: if (temp & BIT(15))
And yes, the offset we could write decimal.

An alternative could be to write: temp = (s16)temp;
I tested it and it works, but I'm not sure whether this is covered
by C standard and works with all supported compilers.

>> +
>> +	*value = temp * 1000 / 256;
>> +
>> +	return 0;
>> +}
>> +
>> +static int aqr_hwmon_set(struct phy_device *phydev, int reg, long value)
>> +{
>> +	int temp;
>> +
>> +	if (value >= 128000 || value < -128000)
>> +		return -ERANGE;
>> +
>> +	temp = value * 256 / 1000;
>> +
>> +	if (temp < 0)
>> +		temp += 0x10000;
> 
> Likewise
> 
>> +
>> +	return phy_write_mmd(phydev, MDIO_MMD_VEND1, reg, temp);
>> +}
>> +
>> +static int aqr_hwmon_status1(struct phy_device *phydev, int bit, long *value)
>> +{
>> +	int reg = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GENERAL_STAT1);
>> +
>> +	if (reg < 0)
>> +		return reg;
>> +
>> +	*value = !!(reg & bit);
>> +
>> +	return 0;
>> +}
> 
> Can you also make this function take a register offset as parameter such
> that you can eliminate open coding that in the case hwmon_temp_input below?
> 
OK

>> +
>> +static int aqr_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
>> +			  u32 attr, int channel, long *value)
>> +{
>> +	struct phy_device *phydev = dev_get_drvdata(dev);
>> +	int reg;
>> +
>> +	if (type != hwmon_temp)
>> +		return -EOPNOTSUPP;
>> +
>> +	switch (attr) {
>> +	case hwmon_temp_input:
>> +		reg = phy_read_mmd(phydev, MDIO_MMD_VEND1,
>> +				   VEND1_THERMAL_STAT2);
>> +		if (reg < 0)
>> +			return reg;
>> +		if (!(reg & VEND1_THERMAL_STAT2_VALID))
>> +			return -EIO;
> 
> And use that helper here.
> 
>> +
>> +		return aqr_hwmon_get(phydev, VEND1_THERMAL_STAT1, value);
>> +
> 
> [snip]
> 
>> +	hwmon_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL);
>> +	if (!hwmon_name)
>> +		return -ENOMEM;
>> +
>> +	for (i = j = 0; hwmon_name[i]; i++) {
>> +		if (isalnum(hwmon_name[i])) {
>> +			if (i != j)
>> +				hwmon_name[j] = hwmon_name[i];
>> +			j++;
>> +		}
>> +	}
>> +	hwmon_name[j] = '\0';
> 
> I am always baffled that drivers need to take care of these details...
> but that seems to be the way to go.
> 
IIRC we still have a similar construction site in phylib.
If a PHY driver name includes e.g. a slash then sysfs is broken.
There should be a general helper e.g. in lib/string.c, because we have
this across subsystems wherever a device name is used in a sysfs path.

^ permalink raw reply

* [PATCH net] ipv4: Add ICMPv6 support when parse route ipproto
From: Hangbin Liu @ 2019-02-25  7:47 UTC (permalink / raw)
  To: netdev; +Cc: Roopa Prabhu, David S . Miller, Hangbin Liu

For ip rules, we need to use 'ipproto ipv6-icmp' to match ICMPv6 headers.
But for ip -6 route, currently we only support tcp, udp and icmp.

Add ICMPv6 support so we can match ipv6-icmp rules for route lookup.

Reported-by: Jianlin Shi <jishi@redhat.com>
Fixes: eacb9384a3fe ("ipv6: support sport, dport and ip_proto in RTM_GETROUTE")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/ipv4/netlink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/netlink.c b/net/ipv4/netlink.c
index f86bb4f06609..95601237521f 100644
--- a/net/ipv4/netlink.c
+++ b/net/ipv4/netlink.c
@@ -3,6 +3,7 @@
 #include <linux/types.h>
 #include <net/net_namespace.h>
 #include <net/netlink.h>
+#include <linux/in6.h>
 #include <net/ip.h>
 
 int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto,
@@ -14,6 +15,7 @@ int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto,
 	case IPPROTO_TCP:
 	case IPPROTO_UDP:
 	case IPPROTO_ICMP:
+	case IPPROTO_ICMPV6:
 		return 0;
 	default:
 		NL_SET_ERR_MSG(extack, "Unsupported ip proto");
-- 
2.19.2


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox