Netdev List
 help / color / mirror / Atom feed
* [PATCH 4/7] net: phy: icplus: use the BIT macro where possible
From: Martin Blumenstingl @ 2018-11-17 18:20 UTC (permalink / raw)
  To: netdev, devicetree, f.fainelli, andrew, mark.rutland, robh+dt,
	davem
  Cc: linux-kernel, Martin Blumenstingl
In-Reply-To: <20181117182007.14791-1-martin.blumenstingl@googlemail.com>

This makes the code consistent by using the BIT() macro instead of
manual bit-shifting for some of the fields. No functional changes.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/net/phy/icplus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index 3d3e9134c762..3ec470adde3d 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -36,11 +36,11 @@ MODULE_LICENSE("GPL");
 
 /* IP101A/G - IP1001 */
 #define IP10XX_SPEC_CTRL_STATUS		16	/* Spec. Control Register */
-#define IP1001_RXPHASE_SEL		(1<<0)	/* Add delay on RX_CLK */
-#define IP1001_TXPHASE_SEL		(1<<1)	/* Add delay on TX_CLK */
+#define IP1001_RXPHASE_SEL		BIT(0)	/* Add delay on RX_CLK */
+#define IP1001_TXPHASE_SEL		BIT(1)	/* Add delay on TX_CLK */
 #define IP1001_SPEC_CTRL_STATUS_2	20	/* IP1001 Spec. Control Reg 2 */
 #define IP1001_APS_ON			11	/* IP1001 APS Mode  bit */
-#define IP101A_G_APS_ON			2	/* IP101A/G APS Mode bit */
+#define IP101A_G_APS_ON			BIT(1)	/* IP101A/G APS Mode bit */
 #define IP101A_G_IRQ_CONF_STATUS	0x11	/* Conf Info IRQ & Status Reg */
 #define	IP101A_G_IRQ_PIN_USED		BIT(15) /* INTR pin used */
 #define	IP101A_G_NO_IRQ			BIT(11) /* IRQ's inactive */
-- 
2.19.1

^ permalink raw reply related

* [PATCH 5/7] net: phy: icplus: rename IP101A_G_NO_IRQ to IP101A_G_IRQ_ALL_MASK
From: Martin Blumenstingl @ 2018-11-17 18:20 UTC (permalink / raw)
  To: netdev, devicetree, f.fainelli, andrew, mark.rutland, robh+dt,
	davem
  Cc: linux-kernel, Martin Blumenstingl
In-Reply-To: <20181117182007.14791-1-martin.blumenstingl@googlemail.com>

The datasheet uses the name "All Mask" for this bit. Change the name of
our #define to be consistent with the datasheet. While here also replace
the tab between the #define and IP101A_G_IRQ_ALL_MASK with a space.
No functional changes.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/net/phy/icplus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index 3ec470adde3d..c9489ec77cef 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
 #define IP101A_G_APS_ON			BIT(1)	/* IP101A/G APS Mode bit */
 #define IP101A_G_IRQ_CONF_STATUS	0x11	/* Conf Info IRQ & Status Reg */
 #define	IP101A_G_IRQ_PIN_USED		BIT(15) /* INTR pin used */
-#define	IP101A_G_NO_IRQ			BIT(11) /* IRQ's inactive */
+#define IP101A_G_IRQ_ALL_MASK		BIT(11) /* IRQ's inactive */
 
 static int ip175c_config_init(struct phy_device *phydev)
 {
@@ -204,7 +204,7 @@ static int ip101a_g_config_intr(struct phy_device *phydev)
 		/* INTR pin used: Speed/link/duplex will cause an interrupt */
 		val = IP101A_G_IRQ_PIN_USED;
 	else
-		val = IP101A_G_NO_IRQ;
+		val = IP101A_G_IRQ_ALL_MASK;
 
 	return phy_write(phydev, IP101A_G_IRQ_CONF_STATUS, val);
 }
-- 
2.19.1

^ permalink raw reply related

* [PATCH 6/7] net: phy: icplus: implement .did_interrupt for IP101A/G
From: Martin Blumenstingl @ 2018-11-17 18:20 UTC (permalink / raw)
  To: netdev, devicetree, f.fainelli, andrew, mark.rutland, robh+dt,
	davem
  Cc: linux-kernel, Martin Blumenstingl
In-Reply-To: <20181117182007.14791-1-martin.blumenstingl@googlemail.com>

The IP101A_G_IRQ_CONF_STATUS register has bits to detect which
interrupts have fired. Implement the .did_interrupt callback to let the
PHY core know whether the interrupt was for this specific PHY.

This is useful for debugging interrupt problems with 32-pin IP101GR PHYs
where the interrupt line is shared with the RX_ERR (receive error
status) signal. The default values are:
- RX_ERR is enabled by default (LOW means that there is no receive
  error)
- the PHY's interrupt line is configured "active low" by default

Without any additional changes there is a flood of interrupts if the
RX_ERR/INTR32 signal is configured in RX_ERR mode (which is the
default). Having a did_interrupt ensures that the PHY core returns
IRQ_NONE instead of endlessly triggering the PHY state machine.
Additionally the kernel will report this after a while:
  irq 28: nobody cared (try booting with the "irqpoll" option)

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/net/phy/icplus.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index c9489ec77cef..3dc8bbbe746b 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -44,6 +44,9 @@ MODULE_LICENSE("GPL");
 #define IP101A_G_IRQ_CONF_STATUS	0x11	/* Conf Info IRQ & Status Reg */
 #define	IP101A_G_IRQ_PIN_USED		BIT(15) /* INTR pin used */
 #define IP101A_G_IRQ_ALL_MASK		BIT(11) /* IRQ's inactive */
+#define IP101A_G_IRQ_SPEED_CHANGE	BIT(2)
+#define IP101A_G_IRQ_DUPLEX_CHANGE	BIT(1)
+#define IP101A_G_IRQ_LINK_CHANGE	BIT(0)
 
 static int ip175c_config_init(struct phy_device *phydev)
 {
@@ -209,6 +212,18 @@ static int ip101a_g_config_intr(struct phy_device *phydev)
 	return phy_write(phydev, IP101A_G_IRQ_CONF_STATUS, val);
 }
 
+static int ip101a_g_did_interrupt(struct phy_device *phydev)
+{
+	int val = phy_read(phydev, IP101A_G_IRQ_CONF_STATUS);
+
+	if (val < 0)
+		return 0;
+
+	return val & (IP101A_G_IRQ_SPEED_CHANGE |
+		      IP101A_G_IRQ_DUPLEX_CHANGE |
+		      IP101A_G_IRQ_LINK_CHANGE);
+}
+
 static int ip101a_g_ack_interrupt(struct phy_device *phydev)
 {
 	int err = phy_read(phydev, IP101A_G_IRQ_CONF_STATUS);
@@ -243,6 +258,7 @@ static struct phy_driver icplus_driver[] = {
 	.phy_id_mask	= 0x0ffffff0,
 	.features	= PHY_BASIC_FEATURES,
 	.config_intr	= ip101a_g_config_intr,
+	.did_interrupt	= ip101a_g_did_interrupt,
 	.ack_interrupt	= ip101a_g_ack_interrupt,
 	.config_init	= &ip101a_g_config_init,
 	.suspend	= genphy_suspend,
-- 
2.19.1

^ permalink raw reply related

* [PATCH 7/7] net: phy: icplus: allow configuring the interrupt function on IP101GR
From: Martin Blumenstingl @ 2018-11-17 18:20 UTC (permalink / raw)
  To: netdev, devicetree, f.fainelli, andrew, mark.rutland, robh+dt,
	davem
  Cc: linux-kernel, Martin Blumenstingl
In-Reply-To: <20181117182007.14791-1-martin.blumenstingl@googlemail.com>

The IP101GR is a 32-pin QFN package variant of the IP101G/IP101GA
Ethernet PHY. Due to it's limited amount of pins the RXER (receive
error) and INTR32 (interrupt) functions share pin 21.
By default the PHY is configured to output the "receive error" status on
pin 21. Depending on the board layout and requirements we may want to
re-configure the PHY to output the interrupt signal there.

The mode of pin 21 can be configured in the "Digital I/O Specific
Control Register" (register 29), bit 2:
- 0 = RXER function
- 1 = INTR(32) function

Depending on the devicetree configuration we will now:
- change the mode to either ther RXER or INTR32 function
- keep the SEL_INTR32 value set by the bootloader (default) if no
  configuration is provided (to ensure that we're not breaking existing
  boards)

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/net/phy/icplus.c | 71 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 70 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index 3dc8bbbe746b..a27e15cb3366 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -25,6 +25,7 @@
 #include <linux/mii.h>
 #include <linux/ethtool.h>
 #include <linux/phy.h>
+#include <linux/property.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -48,6 +49,23 @@ MODULE_LICENSE("GPL");
 #define IP101A_G_IRQ_DUPLEX_CHANGE	BIT(1)
 #define IP101A_G_IRQ_LINK_CHANGE	BIT(0)
 
+#define IP101G_DIGITAL_IO_SPEC_CTRL			0x1d
+#define IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32		BIT(2)
+
+/* The 32-pin IP101GR package can re-configure the mode of the RXER/INTR_32 pin
+ * (pin number 21). The hardware default is RXER (receive error) mode. But it
+ * can be configured to interrupt mode manually.
+ */
+enum ip101gr_sel_intr32 {
+	IP101GR_SEL_INTR32_KEEP,
+	IP101GR_SEL_INTR32_INTR,
+	IP101GR_SEL_INTR32_RXER,
+};
+
+struct ip101a_g_phy_priv {
+	enum ip101gr_sel_intr32 sel_intr32;
+};
+
 static int ip175c_config_init(struct phy_device *phydev)
 {
 	int err, i;
@@ -184,14 +202,64 @@ static int ip175c_config_aneg(struct phy_device *phydev)
 	return 0;
 }
 
+static int ip101a_g_probe(struct phy_device *phydev)
+{
+	struct device *dev = &phydev->mdio.dev;
+	struct ip101a_g_phy_priv *priv;
+
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	if (device_property_read_bool(dev, "icplus,select-rx-error"))
+		priv->sel_intr32 = IP101GR_SEL_INTR32_RXER;
+	else if (device_property_read_bool(dev, "icplus,select-interrupt"))
+		priv->sel_intr32 = IP101GR_SEL_INTR32_INTR;
+	else
+		priv->sel_intr32 = IP101GR_SEL_INTR32_KEEP;
+
+	phydev->priv = priv;
+
+	return 0;
+}
+
 static int ip101a_g_config_init(struct phy_device *phydev)
 {
-	int c;
+	struct ip101a_g_phy_priv *priv = phydev->priv;
+	int err, c;
 
 	c = ip1xx_reset(phydev);
 	if (c < 0)
 		return c;
 
+	/* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */
+	switch (priv->sel_intr32) {
+	case IP101GR_SEL_INTR32_RXER:
+		err = phy_modify(phydev, IP101G_DIGITAL_IO_SPEC_CTRL,
+				 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32, 0);
+		if (err < 0)
+			return err;
+		break;
+
+	case IP101GR_SEL_INTR32_INTR:
+		err = phy_modify(phydev, IP101G_DIGITAL_IO_SPEC_CTRL,
+				 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32,
+				 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32);
+		if (err < 0)
+			return err;
+		break;
+
+	default:
+		/* Don't touch IP101G_DIGITAL_IO_SPEC_CTRL because it's not
+		 * documented on IP101A and it's not clear whether this would
+		 * cause problems.
+		 * For the 32-pin IP101GR we simply keep the SEL_INTR32
+		 * configuration as set by the bootloader when not configured
+		 * to one of the special functions.
+		 */
+		break;
+	}
+
 	/* Enable Auto Power Saving mode */
 	c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
 	c |= IP101A_G_APS_ON;
@@ -257,6 +325,7 @@ static struct phy_driver icplus_driver[] = {
 	.name		= "ICPlus IP101A/G",
 	.phy_id_mask	= 0x0ffffff0,
 	.features	= PHY_BASIC_FEATURES,
+	.probe		= ip101a_g_probe,
 	.config_intr	= ip101a_g_config_intr,
 	.did_interrupt	= ip101a_g_did_interrupt,
 	.ack_interrupt	= ip101a_g_ack_interrupt,
-- 
2.19.1

^ permalink raw reply related

* [PATCH 0/4] bpf: permit JIT allocations to be served outside the module region
From: Ard Biesheuvel @ 2018-11-17 18:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ard Biesheuvel, Daniel Borkmann, Alexei Starovoitov,
	Rick Edgecombe, Eric Dumazet, Jann Horn, Kees Cook, Jessica Yu,
	Arnd Bergmann, Catalin Marinas, Will Deacon, Mark Rutland,
	Ralf Baechle, Paul Burton, James Hogan, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller,
	linux-arm-kernel

On arm64, modules are allocated from a 128 MB window which is close to
the core kernel, so that relative direct branches are guaranteed to be
in range (except in some KASLR configurations). Also, module_alloc()
is in charge of allocating KASAN shadow memory when running with KASAN
enabled.

This means that the way BPF reuses module_alloc()/module_memfree() is
undesirable on arm64 (and potentially other architectures as well),
and so this series refactors BPF's use of those functions to permit
architectures to change this behavior.

Patch #1 fixes a bug introduced during the merge window, where the new
alloc/free tracking does not account for memory that is freed by some
arch code.

Patch #2 refactors the freeing path so that architectures can switch to
something other than module_memfree().

Patch #3 does the same for module_alloc().

Patch #4 implements the new alloc/free overrides for arm64

Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jann Horn <jannh@google.com>
Cc: Kees Cook <keescook@chromium.org>

Cc: Jessica Yu <jeyu@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: sparclinux@vger.kernel.org
Cc: netdev@vger.kernel.org

Ard Biesheuvel (4):
  bpf: account for freed JIT allocations in arch code
  net/bpf: refactor freeing of executable allocations
  bpf: add __weak hook for allocating executable memory
  arm64/bpf: don't allocate BPF JIT programs in module memory

 arch/arm64/net/bpf_jit_comp.c     | 11 ++++++++++
 arch/mips/net/bpf_jit.c           |  7 ++-----
 arch/powerpc/net/bpf_jit_comp.c   |  7 ++-----
 arch/powerpc/net/bpf_jit_comp64.c | 12 +++--------
 arch/sparc/net/bpf_jit_comp_32.c  |  7 ++-----
 kernel/bpf/core.c                 | 22 ++++++++++----------
 6 files changed, 31 insertions(+), 35 deletions(-)

-- 
2.17.1

^ permalink raw reply

* [PATCH 2/4] net/bpf: refactor freeing of executable allocations
From: Ard Biesheuvel @ 2018-11-17 18:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ard Biesheuvel, Daniel Borkmann, Alexei Starovoitov,
	Rick Edgecombe, Eric Dumazet, Jann Horn, Kees Cook, Jessica Yu,
	Arnd Bergmann, Catalin Marinas, Will Deacon, Mark Rutland,
	Ralf Baechle, Paul Burton, James Hogan, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller,
	linux-arm-kernel
In-Reply-To: <20181117185715.25198-1-ard.biesheuvel@linaro.org>

All arch overrides of the __weak bpf_jit_free() amount to the same
thing: the allocated memory was never mapped read-only, and so
it does not have to be remapped to read-write before being freed.

So in preparation of permitting arches to serve allocations for BPF
JIT programs from other regions than the module region, refactor
the existing bpf_jit_free() implementations to use the shared code
where possible, and only specialize the remap and free operations.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/mips/net/bpf_jit.c           |  7 ++-----
 arch/powerpc/net/bpf_jit_comp.c   |  7 ++-----
 arch/powerpc/net/bpf_jit_comp64.c |  9 +++------
 arch/sparc/net/bpf_jit_comp_32.c  |  7 ++-----
 kernel/bpf/core.c                 | 15 +++++----------
 5 files changed, 14 insertions(+), 31 deletions(-)

diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 1b69897274a1..5696bd7dccc7 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -1261,10 +1261,7 @@ void bpf_jit_compile(struct bpf_prog *fp)
 	kfree(ctx.offsets);
 }
 
-void bpf_jit_free(struct bpf_prog *fp)
+void bpf_jit_binary_free(struct bpf_binary_header *hdr)
 {
-	if (fp->jited)
-		bpf_jit_binary_free(bpf_jit_binary_hdr(fp));
-
-	bpf_prog_unlock_free(fp);
+	module_memfree(hdr);
 }
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index a1ea1ea6b40d..5b5ce4a1b44b 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -680,10 +680,7 @@ void bpf_jit_compile(struct bpf_prog *fp)
 	return;
 }
 
-void bpf_jit_free(struct bpf_prog *fp)
+void bpf_jit_binary_free(struct bpf_binary_header *hdr)
 {
-	if (fp->jited)
-		bpf_jit_binary_free(bpf_jit_binary_hdr(fp));
-
-	bpf_prog_unlock_free(fp);
+	module_memfree(hdr);
 }
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index 84c8f013a6c6..f64f1294bd62 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -1021,11 +1021,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 	return fp;
 }
 
-/* Overriding bpf_jit_free() as we don't set images read-only. */
-void bpf_jit_free(struct bpf_prog *fp)
+/* Overriding bpf_jit_binary_free() as we don't set images read-only. */
+void bpf_jit_binary_free(struct bpf_binary_header *hdr)
 {
-	if (fp->jited)
-		bpf_jit_binary_free(bpf_jit_binary_hdr(fp));
-
-	bpf_prog_unlock_free(fp);
+	module_memfree(hdr);
 }
diff --git a/arch/sparc/net/bpf_jit_comp_32.c b/arch/sparc/net/bpf_jit_comp_32.c
index 01bda6bc9e7f..589950d152cc 100644
--- a/arch/sparc/net/bpf_jit_comp_32.c
+++ b/arch/sparc/net/bpf_jit_comp_32.c
@@ -756,10 +756,7 @@ cond_branch:			f_offset = addrs[i + filter[i].jf];
 	return;
 }
 
-void bpf_jit_free(struct bpf_prog *fp)
+void bpf_jit_binary_free(struct bpf_binary_header *hdr)
 {
-	if (fp->jited)
-		bpf_jit_binary_free(bpf_jit_binary_hdr(fp));
-
-	bpf_prog_unlock_free(fp);
+	module_memfree(hdr);
 }
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 1a796e0799ec..29f766dac203 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -646,25 +646,20 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
 	return hdr;
 }
 
-void bpf_jit_binary_free(struct bpf_binary_header *hdr)
+void __weak bpf_jit_binary_free(struct bpf_binary_header *hdr)
 {
-	u32 pages = hdr->pages;
-
+	bpf_jit_binary_unlock_ro(hdr);
 	module_memfree(hdr);
-	bpf_jit_uncharge_modmem(pages);
 }
 
-/* This symbol is only overridden by archs that have different
- * requirements than the usual eBPF JITs, f.e. when they only
- * implement cBPF JIT, do not set images read-only, etc.
- */
-void __weak bpf_jit_free(struct bpf_prog *fp)
+void bpf_jit_free(struct bpf_prog *fp)
 {
 	if (fp->jited) {
 		struct bpf_binary_header *hdr = bpf_jit_binary_hdr(fp);
+		u32 pages = hdr->pages;
 
-		bpf_jit_binary_unlock_ro(hdr);
 		bpf_jit_binary_free(hdr);
+		bpf_jit_uncharge_modmem(pages);
 
 		WARN_ON_ONCE(!bpf_prog_kallsyms_verify_off(fp));
 	}
-- 
2.17.1

^ permalink raw reply related

* [PATCH 3/4] bpf: add __weak hook for allocating executable memory
From: Ard Biesheuvel @ 2018-11-17 18:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ard Biesheuvel, Daniel Borkmann, Alexei Starovoitov,
	Rick Edgecombe, Eric Dumazet, Jann Horn, Kees Cook, Jessica Yu,
	Arnd Bergmann, Catalin Marinas, Will Deacon, Mark Rutland,
	Ralf Baechle, Paul Burton, James Hogan, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller,
	linux-arm-kernel
In-Reply-To: <20181117185715.25198-1-ard.biesheuvel@linaro.org>

By default, BPF uses module_alloc() to allocate executable memory,
but this is not necessary on all arches and potentially undesirable
on some of them.

So break out the module_alloc() call into a __weak function to allow
it to be overridden in arch code.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 kernel/bpf/core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 29f766dac203..156d6b96ac6c 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -609,6 +609,11 @@ static void bpf_jit_uncharge_modmem(u32 pages)
 	atomic_long_sub(pages, &bpf_jit_current);
 }
 
+void *__weak bpf_jit_alloc_exec(unsigned long size)
+{
+	return module_alloc(size);
+}
+
 struct bpf_binary_header *
 bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
 		     unsigned int alignment,
@@ -626,7 +631,7 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
 
 	if (bpf_jit_charge_modmem(pages))
 		return NULL;
-	hdr = module_alloc(size);
+	hdr = bpf_jit_alloc_exec(size);
 	if (!hdr) {
 		bpf_jit_uncharge_modmem(pages);
 		return NULL;
-- 
2.17.1

^ permalink raw reply related

* [PATCH 4/4] arm64/bpf: don't allocate BPF JIT programs in module memory
From: Ard Biesheuvel @ 2018-11-17 18:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ard Biesheuvel, Daniel Borkmann, Alexei Starovoitov,
	Rick Edgecombe, Eric Dumazet, Jann Horn, Kees Cook, Jessica Yu,
	Arnd Bergmann, Catalin Marinas, Will Deacon, Mark Rutland,
	Ralf Baechle, Paul Burton, James Hogan, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller,
	linux-arm-kernel
In-Reply-To: <20181117185715.25198-1-ard.biesheuvel@linaro.org>

The arm64 module region is a 128 MB region that is kept close to
the core kernel, in order to ensure that relative branches are
always in range. So using the same region for programs that do
not have this restriction is wasteful, and preferably avoided.

Now that the core BPF JIT code permits the alloc/free routines to
be overridden, implement them by simple vmalloc_exec()/vfree()
calls, which can be served from anywere. This also solves an
issue under KASAN, where shadow memory is needlessly allocated for
all BPF programs (which don't require KASAN shadow pages since
they are not KASAN instrumented)

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm64/net/bpf_jit_comp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index a6fdaea07c63..e0c702c2f682 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -940,3 +940,14 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 					   tmp : orig_prog);
 	return prog;
 }
+
+void *bpf_jit_alloc_exec(unsigned long size)
+{
+	return vmalloc_exec(size);
+}
+
+void bpf_jit_binary_free(struct bpf_binary_header *hdr)
+{
+	bpf_jit_binary_unlock_ro(hdr);
+	vfree(hdr);
+}
-- 
2.17.1

^ permalink raw reply related

* Shipping documents
From: MAERSK SHIPPING LTD @ 2018-11-16  9:52 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

Dear Sir/Madam,

We got an instruction from our client to contact you base on the  above
subject.

Kindly check and confirm the information on the shipping documents
in the attached and be sure that every detailed information is alright
including the consignee.

NOTE: We kindly ask you to reconfirmed the details on the shipping
documents to avoid delay as the shipment has already sailed

Kind Regards,


Petrarch Yang Jae-geol

Special Dispatch Team
Maersk Korea Limited,
18F, Twin City Namsan Building,
366, Hangang-daero, Yongsan-gu,
Seoul, 04323, Korea
Mobile: +82-10-8814-5215
Email: hwi.kang@maersk.com
WEB: www.maerskline.com


[-- Attachment #2: BL DRAFT DOCUMENTS.doc --]
[-- Type: application/msword, Size: 271814 bytes --]

^ permalink raw reply

* [net-next:master 353/376] htmldocs: include/linux/skbuff.h:870: warning: Function parameter or member '__pkt_vlan_present_offset' not described in 'sk_buff'
From: kbuild test robot @ 2018-11-17  9:05 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: kbuild-all, netdev

[-- Attachment #1: Type: text/plain, Size: 22470 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   9c549a6b057386df478e4307902cbc84f1eee058
commit: 0c4b2d370514cb4f3454dd3b18f031d2651fab73 [353/376] net: remove VLAN_TAG_PRESENT
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_retries' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.ack_signal_filled' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.avg_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.msdu' not described in 'sta_info'
   kernel/rcu/tree.c:685: warning: Excess function parameter 'irq' description in 'rcu_nmi_exit'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf'
   include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array'
   include/linux/gpio/driver.h:375: warning: Function parameter or member 'init_valid_mask' not described in 'gpio_chip'
   include/linux/iio/hw-consumer.h:1: warning: no structured comments found
   include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry'
   include/linux/regulator/driver.h:227: warning: Function parameter or member 'resume' not described in 'regulator_ops'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb'
   drivers/slimbus/stream.c:1: warning: no structured comments found
   include/linux/spi/spi.h:177: warning: Function parameter or member 'driver_override' not described in 'spi_device'
   drivers/target/target_core_device.c:1: warning: no structured comments found
   drivers/usb/typec/bus.c:1: warning: no structured comments found
   drivers/usb/typec/class.c:1: warning: no structured comments found
   include/linux/w1.h:281: warning: Function parameter or member 'of_match_table' not described in 'w1_family'
   fs/direct-io.c:257: warning: Excess function parameter 'offset' description in 'dio_complete'
   fs/file_table.c:1: warning: no structured comments found
   fs/libfs.c:477: warning: Excess function parameter 'available' description in 'simple_write_end'
   fs/posix_acl.c:646: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode'
   fs/posix_acl.c:646: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode'
   fs/posix_acl.c:646: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:183: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:254: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_invalidate_range_start_gfx'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:302: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_invalidate_range_start_hsa'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:382: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:383: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'start' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'end' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'entry' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:848: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'level' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3096: warning: Function parameter or member 'pasid' not described in 'amdgpu_vm_make_compute'
   include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver'
   include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver'
   include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver'
   include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver'
   include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver'
   include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver'
   include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver'
   include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver'
   include/drm/drm_mode_config.h:869: warning: Function parameter or member 'quirk_addfb_prefer_xbgr_30bpp' not described in 'drm_mode_config'
   drivers/gpu/drm/drm_fourcc.c:112: warning: Function parameter or member 'dev' not described in 'drm_driver_legacy_fb_format'
   drivers/gpu/drm/drm_fourcc.c:112: warning: Excess function parameter 'native' description in 'drm_driver_legacy_fb_format'
   drivers/gpu/drm/i915/i915_vma.h:49: warning: cannot understand function prototype: 'struct i915_vma '
   drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found
   drivers/gpu/drm/i915/intel_guc_fwif.h:554: warning: cannot understand function prototype: 'struct guc_log_buffer_state '
   drivers/gpu/drm/i915/i915_trace.h:1: warning: no structured comments found
   include/linux/skbuff.h:870: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'list' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'head_frag' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'encapsulation' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'csum_valid' not described in 'sk_buff'
>> include/linux/skbuff.h:870: warning: Function parameter or member '__pkt_vlan_present_offset' not described in 'sk_buff'
>> include/linux/skbuff.h:870: warning: Function parameter or member 'vlan_present' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'csum_level' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'offload_fwd_mark' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'offload_mr_fwd_mark' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff'
   include/linux/skbuff.h:870: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff'
   include/net/sock.h:238: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_portpair' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_cookie' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_listener' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common'
   include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock'
   include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.len' not described in 'sock'
   include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.head' not described in 'sock'
   include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.tail' not described in 'sock'
   include/net/sock.h:509: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
   include/net/sock.h:509: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock'
   include/net/sock.h:509: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock'
   include/net/sock.h:509: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock'
   include/net/sock.h:509: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'adj_list.upper' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'adj_list.lower' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'gso_partial_features' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'switchdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'name_assign_type' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'mpls_ptr' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'xdp_prog' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'qdisc_hash' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device'
   include/linux/netdevice.h:2053: warning: Function parameter or member 'xps_rxqs_map' not described in 'net_device'
   include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state'
   include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state'
   Documentation/admin-guide/cgroup-v2.rst:1507: WARNING: Block quote ends without a blank line; unexpected unindent.
   Documentation/admin-guide/cgroup-v2.rst:1509: WARNING: Block quote ends without a blank line; unexpected unindent.
   Documentation/admin-guide/cgroup-v2.rst:1510: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/net/mac80211.h:1211: ERROR: Unexpected indentation.
   include/net/mac80211.h:1218: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/wait.h:110: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/wait.h:113: ERROR: Unexpected indentation.
   include/linux/wait.h:115: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/time/hrtimer.c:1129: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/signal.c:344: WARNING: Inline literal start-string without end-string.
   include/linux/kernel.h:137: WARNING: Inline interpreted text or phrase reference start-string without end-string.
   include/uapi/linux/firewire-cdev.h:312: WARNING: Inline literal start-string without end-string.
   Documentation/driver-api/gpio/board.rst:209: ERROR: Unexpected indentation.
   drivers/ata/libata-core.c:5958: ERROR: Unknown target name: "hw".
   drivers/message/fusion/mptbase.c:5057: WARNING: Definition list ends without a blank line; unexpected unindent.
   drivers/tty/serial/serial_core.c:1938: WARNING: Definition list ends without a blank line; unexpected unindent.
   include/linux/mtd/rawnand.h:1189: WARNING: Inline strong start-string without end-string.
   include/linux/mtd/rawnand.h:1191: WARNING: Inline strong start-string without end-string.
   include/linux/regulator/driver.h:286: ERROR: Unknown target name: "regulator_regmap_x_voltage".
   Documentation/driver-api/soundwire/locking.rst:50: ERROR: Inconsistent literal block quoting.
   Documentation/driver-api/soundwire/locking.rst:51: WARNING: Line block ends without a blank line.
   Documentation/driver-api/soundwire/locking.rst:55: WARNING: Inline substitution_reference start-string without end-string.
   Documentation/driver-api/soundwire/locking.rst:56: WARNING: Line block ends without a blank line.
   include/linux/spi/spi.h:365: ERROR: Unexpected indentation.
   Documentation/driver-api/usb/typec_bus.rst:76: WARNING: Definition list ends without a blank line; unexpected unindent.
   block/bio.c:882: WARNING: Inline emphasis start-string without end-string.
   fs/posix_acl.c:635: WARNING: Inline emphasis start-string without end-string.
   drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:1573: WARNING: Inline emphasis start-string without end-string.
   drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:1575: WARNING: Inline emphasis start-string without end-string.
   include/drm/drm_drv.h:656: ERROR: Unknown target name: "driver".
   Documentation/laptops/lg-laptop.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.
   Documentation/laptops/lg-laptop.rst:16: ERROR: Unexpected indentation.
   Documentation/laptops/lg-laptop.rst:17: WARNING: Block quote ends without a blank line; unexpected unindent.
   Documentation/misc-devices/ibmvmc.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.
   Documentation/networking/dpaa2/dpio-driver.rst:30: ERROR: Unexpected indentation.
   Documentation/networking/dpaa2/dpio-driver.rst:42: WARNING: Definition list ends without a blank line; unexpected unindent.
   Documentation/networking/dpaa2/dpio-driver.rst:62: ERROR: Unexpected indentation.
   Documentation/networking/dpaa2/dpio-driver.rst:143: ERROR: Unexpected indentation.
   include/linux/netdevice.h:3453: WARNING: Inline emphasis start-string without end-string.
   include/linux/netdevice.h:3453: WARNING: Inline emphasis start-string without end-string.
   net/core/dev.c:4956: ERROR: Unknown target name: "page_is".
   Documentation/networking/snmp_counter.rst:1: WARNING: Title overline too short.

vim +870 include/linux/skbuff.h

^1da177e Linus Torvalds 2005-04-16 @870  

:::::: The code at line 870 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6597 bytes --]

^ permalink raw reply

* Re: [PATCH net-next 2/2] net: bcmgenet: abort suspend on error
From: Florian Fainelli @ 2018-11-17 19:52 UTC (permalink / raw)
  To: Doug Berger, David S. Miller; +Cc: netdev, linux-kernel, YueHaibing
In-Reply-To: <1542420022-30251-3-git-send-email-opendmb@gmail.com>



On 16/11/2018 18:00, Doug Berger wrote:
> If an error occurs during suspension of the driver the driver should
> restore the hardware configuration and return an error to force the
> system to resume.
> 
> Fixes: 0db55093b566 ("net: bcmgenet: return correct value 'ret' from bcmgenet_power_down")
> Signed-off-by: Doug Berger <opendmb@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH v6] net: phy: mdio-gpio: Fix working over slow can_sleep GPIOs
From: Florian Fainelli @ 2018-11-17 19:52 UTC (permalink / raw)
  To: Martin Schiller, andrew, sergei.shtylyov; +Cc: davem, netdev, linux-kernel
In-Reply-To: <20181116073836.6013-1-ms@dev.tdt.de>



On 15/11/2018 23:38, Martin Schiller wrote:
> Up until commit 7e5fbd1e0700 ("net: mdio-gpio: Convert to use gpiod
> functions where possible"), the _cansleep variants of the gpio_ API was
> used. After that commit and the change to gpiod_ API, the _cansleep()
> was dropped. This then results in WARN_ON() when used with GPIO
> devices which do sleep. Add back the _cansleep() to avoid this.
> 
> Fixes: 7e5fbd1e0700 ("net: mdio-gpio: Convert to use gpiod functions where possible")
> Signed-off-by: Martin Schiller <ms@dev.tdt.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks Martin!
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next 1/2] vhost_net: mitigate page reference counting during page frag refill
From: David Miller @ 2018-11-17 20:01 UTC (permalink / raw)
  To: jasowang; +Cc: netdev, virtualization, linux-kernel, kvm, mst
In-Reply-To: <20181115094310.17307-1-jasowang@redhat.com>

From: Jason Wang <jasowang@redhat.com>
Date: Thu, 15 Nov 2018 17:43:09 +0800

> We do a get_page() which involves a atomic operation. This patch tries
> to mitigate a per packet atomic operation by maintaining a reference
> bias which is initially USHRT_MAX. Each time a page is got, instead of
> calling get_page() we decrease the bias and when we find it's time to
> use a new page we will decrease the bias at one time through
> __page_cache_drain_cache().
> 
> Testpmd(virtio_user + vhost_net) + XDP_DROP on TAP shows about 1.6%
> improvement.
> 
> Before: 4.63Mpps
> After:  4.71Mpps
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 2/2] tuntap: free XDP dropped packets in a batch
From: David Miller @ 2018-11-17 20:01 UTC (permalink / raw)
  To: jasowang; +Cc: mst, kvm, virtualization, netdev, linux-kernel
In-Reply-To: <20181115094310.17307-2-jasowang@redhat.com>

From: Jason Wang <jasowang@redhat.com>
Date: Thu, 15 Nov 2018 17:43:10 +0800

> Thanks to the batched XDP buffs through msg_control. Instead of
> calling put_page() for each page which involves a atomic operation,
> let's batch them by record the last page that needs to be freed and
> its refcnt count and free them in a batch.
> 
> Testpmd(virtio-user + vhost_net) + XDP_DROP shows 3.8% improvement.
> 
> Before: 4.71Mpps
> After : 4.89Mpps
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 1/4] enetc: Introduce basic PF and VF ENETC ethernet drivers
From: David Miller @ 2018-11-17 20:08 UTC (permalink / raw)
  To: claudiu.manoil
  Cc: netdev, linux-kernel, alexandru.marginean, catalin.horghidan
In-Reply-To: <1542298436-23422-2-git-send-email-claudiu.manoil@nxp.com>

From: Claudiu Manoil <claudiu.manoil@nxp.com>
Date: Thu, 15 Nov 2018 18:13:53 +0200

> +	if (!nr_frags && !(flags & ENETC_TXBD_FLAGS_EX))
> +		flags |= ENETC_TXBD_FLAGS_F;
> +
> +	txbd->flags = flags;
> +
> +	if (flags & ENETC_TXBD_FLAGS_EX) {
 ...
> +		if (!nr_frags)
 ...
> +	}
> +
> +	frag = &skb_shinfo(skb)->frags[0];
> +	for (f = 0; f < nr_frags; f++, frag++) {
 ...
> +	}
> +
> +	if (nr_frags)
> +		/* last BD needs 'F' bit set */
> +		txbd->flags = ENETC_TXBD_FLAGS_F;

Isn't it so much simpler to just have an unconditional:

	txbd->flags |= ENETC_TXBD_FLAGS_F;

at the end of this code segment?

Then all of this code conditional on nr_frags can go away.

^ permalink raw reply

* Re: [PATCH 2/3] net-next/hinic:performance improvement for HiNIC
From: David Miller @ 2018-11-17 20:22 UTC (permalink / raw)
  To: xuechaojing
  Cc: linux-kernel, netdev, wulike1, chiqijun, fy.wang, tony.qu,
	luoshaokai
In-Reply-To: <20181115200548.5326-2-xuechaojing@huawei.com>

From: Xue Chaojing <xuechaojing@huawei.com>
Date: Thu, 15 Nov 2018 20:05:47 +0000

> In order to improve performance, this patch adds rx checksum offload
> for the HiNIC driver and optimizes the code. Performance test(Iperf) 
> shows more than 95% improvement in TCP streams.
> 
> Signed-off-by: Xue Chaojing <xuechaojing@huawei.com>

What kind of "optimizes the code" is being done here?  Be explicit.

And such unrelated changes to supporting checksum offload should be
split into another patch.

> +	csum_err = HINIC_RQ_CQE_STATUS_GET(status, CSUM_ERR);
> +
> +	if (!(netdev->features & NETIF_F_RXCSUM))
> +		return;
> +
> +	if (!csum_err)
> +		skb->ip_summed = CHECKSUM_UNNECESSARY;
> +	else
> +		skb->ip_summed = CHECKSUM_NONE;

Does the CQE status word provide more information?  Like the checksum
computed over the packet?  That's more useful than a binary "csum correct"
state.

> +#define BIT(nr)			(1UL << (nr))

This is unnecessary, please include linux/bits.h and use the definition from
there.

^ permalink raw reply

* [PATCH nf] netfilter: nfnetlink_cttimeout: fetch timeouts for udplite and gre, too
From: Florian Westphal @ 2018-11-17 10:32 UTC (permalink / raw)
  To: netfilter-devel; +Cc: syzkaller-bugs, netdev, Florian Westphal
In-Reply-To: <0000000000004f5883057acf6af2@google.com>

syzbot was able to trigger the WARN in cttimeout_default_get() by
passing UDPLITE as l4protocol.  Alias UDPLITE to UDP, both use
same timeout values.

Furthermore, also fetch GRE timeouts.  GRE is a bit more complicated,
as it still can be a module and its netns_proto_gre struct layout isn't
visible outside of the gre module.

Work around this by forcing the timeouts to be the first structure
member, then use plain net_generic().

A followup nf-next patch could make gre tracker be built-in as well
if needed, its not that large.

Last, make the WARN() mention the missing protocol value in case
anything else is missing.

Reported-by: syzbot+2fae8fa157dd92618cae@syzkaller.appspotmail.com
Fixes: 8866df9264a3 ("netfilter: nfnetlink_cttimeout: pass default timeout policy to obj_to_nlattr")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/netfilter/nf_conntrack_proto_gre.c |  4 +++-
 net/netfilter/nfnetlink_cttimeout.c    | 11 +++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c
index 9b48dc8b4b88..dd8db7fbc437 100644
--- a/net/netfilter/nf_conntrack_proto_gre.c
+++ b/net/netfilter/nf_conntrack_proto_gre.c
@@ -56,10 +56,10 @@ static const unsigned int gre_timeouts[GRE_CT_MAX] = {
 
 static unsigned int proto_gre_net_id __read_mostly;
 struct netns_proto_gre {
+	unsigned int		gre_timeouts[GRE_CT_MAX];
 	struct nf_proto_net	nf;
 	rwlock_t		keymap_lock;
 	struct list_head	keymap_list;
-	unsigned int		gre_timeouts[GRE_CT_MAX];
 };
 
 static inline struct netns_proto_gre *gre_pernet(struct net *net)
@@ -402,6 +402,8 @@ static int __init nf_ct_proto_gre_init(void)
 {
 	int ret;
 
+	BUILD_BUG_ON(offsetof(struct netns_proto_gre, gre_timeouts));
+
 	ret = register_pernet_subsys(&proto_gre_net_ops);
 	if (ret < 0)
 		goto out_pernet;
diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c
index a518eb162344..1643faa35f56 100644
--- a/net/netfilter/nfnetlink_cttimeout.c
+++ b/net/netfilter/nfnetlink_cttimeout.c
@@ -455,7 +455,8 @@ static int cttimeout_default_get(struct net *net, struct sock *ctnl,
 	case IPPROTO_TCP:
 		timeouts = nf_tcp_pernet(net)->timeouts;
 		break;
-	case IPPROTO_UDP:
+	case IPPROTO_UDP: /* fallthrough */
+	case IPPROTO_UDPLITE:
 		timeouts = nf_udp_pernet(net)->timeouts;
 		break;
 	case IPPROTO_DCCP:
@@ -469,13 +470,19 @@ static int cttimeout_default_get(struct net *net, struct sock *ctnl,
 	case IPPROTO_SCTP:
 #ifdef CONFIG_NF_CT_PROTO_SCTP
 		timeouts = nf_sctp_pernet(net)->timeouts;
+#endif
+		break;
+	case IPPROTO_GRE:
+#ifdef CONFIG_NF_CT_PROTO_GRE
+		if (l4proto->net_id)
+			timeouts = net_generic(net, *l4proto->net_id);
 #endif
 		break;
 	case 255:
 		timeouts = &nf_generic_pernet(net)->timeout;
 		break;
 	default:
-		WARN_ON_ONCE(1);
+		WARN_ONCE(1, "Missing timeouts for proto %d", l4proto->l4proto);
 		break;
 	}
 
-- 
2.18.1

^ permalink raw reply related

* Re: [PATCH] mt76: fix potential NULL pointer dereference in mt76_stop_tx_queues
From: Kalle Valo @ 2018-11-17 11:13 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: nbd, linux-wireless, netdev
In-Reply-To: <98cf4a8f8a7f7840803b91b7c9078d8b61febee9.1542384797.git.lorenzo.bianconi@redhat.com>

Lorenzo Bianconi <lorenzo.bianconi@redhat.com> writes:

> Starting from mac80211 commit adf8ed01e4fd ("mac80211: add an optional
> TXQ for other PS-buffered frames") and commit 0eeb2b674f05 ("mac80211:
> add an option for station management TXQ") a new per-sta queue has been
> introduced for bufferable management frames.
> sta->txq[IEEE80211_NUM_TIDS] is initialized just if the driver reports
> the following hw flags:
> - IEEE80211_HW_STA_MMPDU_TXQ
> - IEEE80211_HW_BUFF_MMPDU_TXQ
> This can produce a NULL pointer dereference in mt76_stop_tx_queues
> since mt76 iterates on all available sta tx queues assuming they are
> initialized by mac80211. This issue has been spotted analyzing the code
> (it has not triggered any crash yet)
>
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

A very good commit log, thanks for that!

> This patch is for 4.20

Ok, I'll wait for review comments and then queue this for 4.20.

BTW, it would make my patch sorting easier if you could add a release
label in the subject:

[PATCH 4.20] mt76: fix potential NULL pointer dereference in mt76_stop_tx_queues

More info:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#tree_labels

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCHv2 net] ipvs: call ip_vs_dst_notifier earlier than ipv6_dev_notf
From: Pablo Neira Ayuso @ 2018-11-17 11:15 UTC (permalink / raw)
  To: Simon Horman
  Cc: Julian Anastasov, Xin Long, network dev, netfilter-devel,
	David S. Miller, Hans Schillstrom
In-Reply-To: <20181116143711.wwskkrcpqhrybwpq@verge.net.au>

On Fri, Nov 16, 2018 at 06:37:19AM -0800, Simon Horman wrote:
> On Fri, Nov 16, 2018 at 09:10:16AM +0200, Julian Anastasov wrote:
> > 
> > 	Hello,
> > 
> > On Thu, 15 Nov 2018, Xin Long wrote:
> > 
> > > ip_vs_dst_event is supposed to clean up all dst used in ipvs'
> > > destinations when a net dev is going down. But it works only
> > > when the dst's dev is the same as the dev from the event.
> > > 
> > > Now with the same priority but late registration,
> > > ip_vs_dst_notifier is always called later than ipv6_dev_notf
> > > where the dst's dev is set to lo for NETDEV_DOWN event.
> > > 
> > > As the dst's dev lo is not the same as the dev from the event
> > > in ip_vs_dst_event, ip_vs_dst_notifier doesn't actually work.
> > > Also as these dst have to wait for dest_trash_timer to clean
> > > them up. It would cause some non-permanent kernel warnings:
> > > 
> > >   unregister_netdevice: waiting for br0 to become free. Usage count = 3
> > > 
> > > To fix it, call ip_vs_dst_notifier earlier than ipv6_dev_notf
> > > by increasing its priority to ADDRCONF_NOTIFY_PRIORITY + 5.
> > > 
> > > Note that for ipv4 route fib_netdev_notifier doesn't set dst's
> > > dev to lo in NETDEV_DOWN event, so this fix is only needed when
> > > IP_VS_IPV6 is defined.
> > > 
> > > v1->v2:
> > >   - apply it only when CONFIG_IP_VS_IPV6 is defined.
> > > 
> > > Fixes: 7a4f0761fce3 ("IPVS: init and cleanup restructuring")
> > > Reported-by: Li Shuang <shuali@redhat.com>
> > > Signed-off-by: Xin Long <lucien.xin@gmail.com>
> > 
> > Acked-by: Julian Anastasov <ja@ssi.bg>
> 
> Thanks,
> 
> Pablo, could you consider this for nf?
> 
> Acked-by: Simon Horman <horms@verge.net.au>

Applied, thanks Simon.

^ permalink raw reply

* Re: [PATCH nf] netfilter: nfnetlink_cttimeout: fetch timeouts for udplite and gre, too
From: Pablo Neira Ayuso @ 2018-11-17 11:17 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel, syzkaller-bugs, netdev
In-Reply-To: <20181117103229.24678-1-fw@strlen.de>

On Sat, Nov 17, 2018 at 11:32:29AM +0100, Florian Westphal wrote:
> syzbot was able to trigger the WARN in cttimeout_default_get() by
> passing UDPLITE as l4protocol.  Alias UDPLITE to UDP, both use
> same timeout values.
> 
> Furthermore, also fetch GRE timeouts.  GRE is a bit more complicated,
> as it still can be a module and its netns_proto_gre struct layout isn't
> visible outside of the gre module.
> 
> Work around this by forcing the timeouts to be the first structure
> member, then use plain net_generic().
> 
> A followup nf-next patch could make gre tracker be built-in as well
> if needed, its not that large.
> 
> Last, make the WARN() mention the missing protocol value in case
> anything else is missing.

Applied, thanks Florian.

^ permalink raw reply

* Re: [PATCHv2 net] ipvs: call ip_vs_dst_notifier earlier than ipv6_dev_notf
From: Xin Long @ 2018-11-17 12:19 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Simon Horman, Julian Anastasov, network dev, netfilter-devel,
	davem, Hans Schillstrom
In-Reply-To: <20181117111540.ztvaxhoxrpd2h7zv@salvia>

On Sat, Nov 17, 2018 at 8:15 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>
> On Fri, Nov 16, 2018 at 06:37:19AM -0800, Simon Horman wrote:
> > On Fri, Nov 16, 2018 at 09:10:16AM +0200, Julian Anastasov wrote:
> > >
> > >     Hello,
> > >
> > > On Thu, 15 Nov 2018, Xin Long wrote:
> > >
> > > > ip_vs_dst_event is supposed to clean up all dst used in ipvs'
> > > > destinations when a net dev is going down. But it works only
> > > > when the dst's dev is the same as the dev from the event.
> > > >
> > > > Now with the same priority but late registration,
> > > > ip_vs_dst_notifier is always called later than ipv6_dev_notf
> > > > where the dst's dev is set to lo for NETDEV_DOWN event.
> > > >
> > > > As the dst's dev lo is not the same as the dev from the event
> > > > in ip_vs_dst_event, ip_vs_dst_notifier doesn't actually work.
> > > > Also as these dst have to wait for dest_trash_timer to clean
> > > > them up. It would cause some non-permanent kernel warnings:
> > > >
> > > >   unregister_netdevice: waiting for br0 to become free. Usage count = 3
> > > >
> > > > To fix it, call ip_vs_dst_notifier earlier than ipv6_dev_notf
> > > > by increasing its priority to ADDRCONF_NOTIFY_PRIORITY + 5.
> > > >
> > > > Note that for ipv4 route fib_netdev_notifier doesn't set dst's
> > > > dev to lo in NETDEV_DOWN event, so this fix is only needed when
> > > > IP_VS_IPV6 is defined.
> > > >
> > > > v1->v2:
> > > >   - apply it only when CONFIG_IP_VS_IPV6 is defined.
> > > >
> > > > Fixes: 7a4f0761fce3 ("IPVS: init and cleanup restructuring")
> > > > Reported-by: Li Shuang <shuali@redhat.com>
> > > > Signed-off-by: Xin Long <lucien.xin@gmail.com>
> > >
> > > Acked-by: Julian Anastasov <ja@ssi.bg>
> >
> > Thanks,
> >
> > Pablo, could you consider this for nf?
> >
> > Acked-by: Simon Horman <horms@verge.net.au>
>
> Applied, thanks Simon.
Hi Pablo,

The one you just applied is the v1, I'm afraid you need
to revert and apply the v2, which fixed a build error
when IPv6 is disabled.

^ permalink raw reply

* Re: [PATCH V3 2/7] net: lorawan: Add LoRaWAN socket module
From: Jian-Hong Pan @ 2018-11-17 14:54 UTC (permalink / raw)
  To: David S. Miller
  Cc: Andreas Färber, netdev,
	<linux-arm-kernel@lists.infradead.org\,
	linux-kernel@vger.kernel.org>,, Marcel Holtmann, Dollar Chen,
	Ken Yu, linux-wpan - ML, Stefan Schmidt
In-Reply-To: <20181116.203200.1638720313402188457.davem@davemloft.net>

David Miller <davem@davemloft.net> 於 2018年11月17日 週六 下午12:32寫道:
>
> From: Jian-Hong Pan <starnight@g.ncu.edu.tw>
> Date: Thu, 15 Nov 2018 00:01:23 +0800
>
> > +#define      lrw_get_mac_cb(skb)     ((struct lrw_mac_cb *)skb->cb)
>
> Please make this a static inline function.  If the identifier is all lowercase
> programmers expect it to be real code not a CPP macro.

Okay!  Sure

> > +#define      LORAWAN_MODULE_NAME     "lorawan"
> > +
> > +#define      LRW_DBG_STR(fmt)        LORAWAN_MODULE_NAME": "fmt
> > +#define      lrw_info(fmt, ...)      (pr_info(LRW_DBG_STR(fmt), ##__VA_ARGS__))
> > +#define      lrw_dbg(fmt, ...)       (pr_debug(LRW_DBG_STR(fmt), ##__VA_ARGS__))
>
> Just define "pr_fmt()" appropriately and you don't need to play these kinds
> of games.
>
> Set pr_fmt() and call pr_info() and pr_debug() directly.

After checking printk.h again, I get the idea of the comment.
"pr_fmt()" is more convenient!

Thanks for the reviewing.  I will make new patches.

Jian-Hong Pan

^ permalink raw reply

* Re: [PATCH net-next 1/8] net: eth: altera: tse_start_xmit ignores tx_buffer call response
From: Westergreen, Dalon @ 2018-11-17 15:29 UTC (permalink / raw)
  To: davem@davemloft.net
  Cc: netdev@vger.kernel.org, dinguyen@kernel.org,
	thor.thayer@linux.intel.com
In-Reply-To: <20181116.203800.1372283941971325282.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

On Fri, 2018-11-16 at 20:38 -0800, David Miller wrote:
> From: Dalon Westergreen <dwesterg@gmail.com>
> Date: Wed, 14 Nov 2018 16:50:40 -0800
> 
> > @@ -202,7 +204,7 @@ int sgdma_tx_buffer(struct altera_tse_private *priv,
> struct tse_buffer *buffer)
> >       /* enqueue the request to the pending transmit queue */
> >       queue_tx(priv, buffer);
> >  
> > -     return 1;
> > +     return 0;
> 
> NETDEV_TX_OK.
> 
> And now you can make all of these functions properly return netdev_tx_t
> instead of int.

sure thing.

--dalon

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3282 bytes --]

^ permalink raw reply

* Re: [PATCH v2 12/25] of: net: kill of_get_nvmem_mac_address()
From: Rob Herring @ 2018-11-17 15:45 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Sekhar Nori, Kevin Hilman, Russell King, Arnd Bergmann,
	Greg Kroah-Hartman, David Woodhouse, Brian Norris,
	Boris Brezillon, Marek Vasut, Richard Weinberger, Nicolas Ferre,
	David S . Miller, Grygorii Strashko, Srinivas Kandagatla,
	Andrew Lunn, Florian Fainelli, Frank Rowand, Wolfram Sang,
	linux-kernel, linux-arm-ke
In-Reply-To: <20181113140133.17385-13-brgl@bgdev.pl>

On Tue, 13 Nov 2018 15:01:20 +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> We've switched all users to nvmem_get_mac_address(). Remove the now
> dead code.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  drivers/of/of_net.c    | 39 ---------------------------------------
>  include/linux/of_net.h |  6 ------
>  2 files changed, 45 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply

* Re: [PATCH v2 04/21] octeontx2-af: Relax resource lock into mutex
From: Sunil Kovvuri @ 2018-11-17 16:12 UTC (permalink / raw)
  To: David S. Miller
  Cc: Linux Netdev List, Arnd Bergmann, linux-soc, Stanislaw Kardach,
	Sunil Goutham
In-Reply-To: <20181116.232029.1020305436916652001.davem@davemloft.net>

On Sat, Nov 17, 2018 at 12:50 PM David Miller <davem@davemloft.net> wrote:
>
> From: sunil.kovvuri@gmail.com
> Date: Thu, 15 Nov 2018 16:29:29 +0530
>
> > From: Stanislaw Kardach <skardach@marvell.com>
> >
> > The resource locks does not need to be a spinlock as they are not
> > used in any interrupt handling routines (only in bottom halves).
> > Therefore relax them into a mutex so that later on we may use them
> > in routines that might sleep.
> >
> > Signed-off-by: Stanislaw Kardach <skardach@marvell.com>
> > Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
>
> This is confusing because software interrupts are often called bottom
> halves, and in which sleeping and thus mutexes are not allowed.

Mailbox message interrupt handler schedules workqueue and exits.
Message handling happens in workqueue context, hence moving from
spinlock to mutex.
Hope this clarifies.

Thanks,
Sunil.

^ permalink raw reply


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