Netdev List
 help / color / mirror / Atom feed
* [net-next, PATCH v2] net: stmmac: use correct define to get rx timestamp on GMAC4
From: Alexandre Torgue @ 2019-02-14 16:03 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Jose Abreu, davem
  Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel,
	Alexandre Torgue

In dwmac4_wrback_get_rx_timestamp_status we looking for a RX timestamp.
For that receive descriptors are handled and so we should use defines
related to receive descriptors. It'll no change the functional behavior
as RDES3_RDES1_VALID=TDES3_RS1V=BIT(26) but it makes code easier to read.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

---

changes since v1:
 *use le32_to_cpu to handle endianess

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index 20299f6..90045ff 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -268,7 +268,7 @@ static int dwmac4_wrback_get_rx_timestamp_status(void *desc, void *next_desc,
 	int ret = -EINVAL;
 
 	/* Get the status from normal w/b descriptor */
-	if (likely(p->des3 & TDES3_RS1V)) {
+	if (likely(le32_to_cpu(p->des3) & RDES3_RDES1_VALID)) {
 		if (likely(le32_to_cpu(p->des1) & RDES1_TIMESTAMP_AVAILABLE)) {
 			int i = 0;
 
-- 
2.7.4


^ permalink raw reply related

* [PATCH] net: ethernet: freescale: set FEC ethtool regs version
From: Vivien Didelot @ 2019-02-14 16:15 UTC (permalink / raw)
  To: netdev; +Cc: Vivien Didelot, Fugang Duan, David S. Miller, Vivien Didelot

From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Currently the ethtool_regs version is set to 0 for FEC devices.

Use this field to store the register dump version exposed by the
kernel. The choosen version 2 corresponds to the kernel compile test:

        #if defined(CONFIG_M523x) || defined(CONFIG_M527x)
        || defined(CONFIG_M528x) || defined(CONFIG_M520x)
        || defined(CONFIG_M532x) || defined(CONFIG_ARM)
        || defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)

and version 1 corresponds to the opposite. Binaries of ethtool unaware
of this version will dump the whole set as usual.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 2370dc204202..697c2427f2b7 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2098,6 +2098,7 @@ static int fec_enet_get_regs_len(struct net_device *ndev)
 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
 	defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
 	defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)
+static __u32 fec_enet_register_version = 2;
 static u32 fec_enet_register_offset[] = {
 	FEC_IEVENT, FEC_IMASK, FEC_R_DES_ACTIVE_0, FEC_X_DES_ACTIVE_0,
 	FEC_ECNTRL, FEC_MII_DATA, FEC_MII_SPEED, FEC_MIB_CTRLSTAT, FEC_R_CNTRL,
@@ -2128,6 +2129,7 @@ static u32 fec_enet_register_offset[] = {
 	IEEE_R_FDXFC, IEEE_R_OCTETS_OK
 };
 #else
+static __u32 fec_enet_register_version = 1;
 static u32 fec_enet_register_offset[] = {
 	FEC_ECNTRL, FEC_IEVENT, FEC_IMASK, FEC_IVEC, FEC_R_DES_ACTIVE_0,
 	FEC_R_DES_ACTIVE_1, FEC_R_DES_ACTIVE_2, FEC_X_DES_ACTIVE_0,
@@ -2149,6 +2151,8 @@ static void fec_enet_get_regs(struct net_device *ndev,
 	u32 *buf = (u32 *)regbuf;
 	u32 i, off;
 
+	regs->version = fec_enet_register_version;
+
 	memset(buf, 0, regs->len);
 
 	for (i = 0; i < ARRAY_SIZE(fec_enet_register_offset); i++) {
-- 
2.20.1


^ permalink raw reply related

* [PATCH] ethtool: fec: add pretty dump
From: Vivien Didelot @ 2019-02-14 16:15 UTC (permalink / raw)
  To: netdev; +Cc: Vivien Didelot, John W . Linville
In-Reply-To: <20190214161536.19646-1-vivien.didelot@gmail.com>

Add pretty dump for the port registers of the "fec" kernel driver. Only
offsets exposed by the driver are dumped by ethtool.

Both register dump versions are supported, version 2 which corresponds
to the kernel compilation test:

    #if defined(CONFIG_M523x) || defined(CONFIG_M527x)
    || defined(CONFIG_M528x) || defined(CONFIG_M520x)
    || defined(CONFIG_M532x) || defined(CONFIG_ARM)
    || defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)

and version 1 which corresponds to the opposite test. At the same time,
detail a few interesting registers of version 2.

Kernels not patched for setting this version will cause ethtool to
dump the whole set of registers as it already does today.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
---
 Makefile.am |   2 +-
 ethtool.c   |   1 +
 fec.c       | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 internal.h  |   3 +
 4 files changed, 224 insertions(+), 1 deletion(-)
 create mode 100644 fec.c

diff --git a/Makefile.am b/Makefile.am
index 468eed1fd..0a2fd2917 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,7 +10,7 @@ ethtool_SOURCES = ethtool.c ethtool-copy.h internal.h net_tstamp-copy.h \
 if ETHTOOL_ENABLE_PRETTY_DUMP
 ethtool_SOURCES += \
 		  amd8111e.c de2104x.c dsa.c e100.c e1000.c et131x.c igb.c	\
-		  fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c	\
+		  fec.c fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c	\
 		  pcnet32.c realtek.c tg3.c marvell.c vioc.c	\
 		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
 		  sff-common.c sff-common.h sfpid.c sfpdiag.c	\
diff --git a/ethtool.c b/ethtool.c
index fb4c0886c..96953ceae 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1167,6 +1167,7 @@ static const struct {
 	{ "fjes", fjes_dump_regs },
 	{ "lan78xx", lan78xx_dump_regs },
 	{ "dsa", dsa_dump_regs },
+	{ "fec", fec_dump_regs },
 #endif
 };
 
diff --git a/fec.c b/fec.c
new file mode 100644
index 000000000..01b1d34cc
--- /dev/null
+++ b/fec.c
@@ -0,0 +1,219 @@
+#include <stdio.h>
+#include <string.h>
+
+#include "internal.h"
+
+/* Macros and dump functions for the 32-bit "fec" driver registers */
+
+#define REG(_reg, _name, _val) \
+	printf("0x%.03x: %-44.44s 0x%.8x\n", _reg, _name, _val)
+
+#define FIELD(_name, _fmt, ...) \
+	printf("    %-47.47s " _fmt "\n", _name, ##__VA_ARGS__)
+
+static void fec_dump_reg_v1(int reg, u32 val)
+{
+	switch (reg) {
+	case 0x000: /* FEC_ECNTRL */
+	case 0x004: /* FEC_IEVENT */
+	case 0x008: /* FEC_IMASK */
+	case 0x00c: /* FEC_IVEC */
+	case 0x010: /* FEC_R_DES_ACTIVE_0 */
+	case 0x014: /* FEC_X_DES_ACTIVE_0 */
+	case 0x040: /* FEC_MII_DATA */
+	case 0x044: /* FEC_MII_SPEED */
+	case 0x08c: /* FEC_R_BOUND */
+	case 0x090: /* FEC_R_FSTART */
+	case 0x0a4: /* FEC_X_WMRK */
+	case 0x0ac: /* FEC_X_FSTART */
+	case 0x104: /* FEC_R_CNTRL */
+	case 0x108: /* FEC_MAX_FRM_LEN */
+	case 0x144: /* FEC_X_CNTRL */
+	case 0x3c0: /* FEC_ADDR_LOW */
+	case 0x3c4: /* FEC_ADDR_HIGH */
+	case 0x3c8: /* FEC_GRP_HASH_TABLE_HIGH */
+	case 0x3cc: /* FEC_GRP_HASH_TABLE_LOW */
+	case 0x3d0: /* FEC_R_DES_START_0 */
+	case 0x3d4: /* FEC_X_DES_START_0 */
+	case 0x3d8: /* FEC_R_BUFF_SIZE_0 */
+		REG(reg, "", val);
+		break;
+	}
+}
+
+static void fec_dump_reg_v2(int reg, u32 val)
+{
+	switch (reg) {
+	case 0x084: /* FEC_R_CNTRL */
+		REG(reg, "RCR (Receive Control Register)", val);
+		FIELD("MAX_FL (Maximum frame length)", "%u", (val & 0x07ff0000) >> 16);
+		FIELD("FCE (Flow control enable)", "%u", !!(val & 0x00000020));
+		FIELD("BC_REJ (Broadcast frame reject)", "%u", !!(val & 0x00000010));
+		FIELD("PROM (Promiscuous mode)", "%u", !!(val & 0x00000008));
+		FIELD("DRT (Disable receive on transmit)", "%u", !!(val & 0x00000002));
+		FIELD("LOOP (Internal loopback)", "%u", !!(val & 0x00000001));
+		break;
+	case 0x0c4: /* FEC_X_CNTRL */
+		REG(reg, "TCR (Transmit Control Register)", val);
+		FIELD("RFC_PAUSE (Receive frame control pause)", "%u", !!(val & 0x00000010));
+		FIELD("TFC_PAUSE (Transmit frame control pause)", "%u", !!(val & 0x00000008));
+		FIELD("FDEN (Full duplex enable)", "%u", !!(val & 0x00000004));
+		FIELD("HBC (Heartbeat control)", "%u", !!(val & 0x00000002));
+		FIELD("GTS (Graceful transmit stop)", "%u", !!(val & 0x00000001));
+		break;
+	case 0x118: /* FEC_HASH_TABLE_HIGH */
+		REG(reg, "IAUR (Individual Address Upper Register)", val);
+		FIELD("IADDR1", "0x%.16llx", (u64)((u64)val) << 32);
+		break;
+	case 0x11c: /* FEC_HASH_TABLE_LOW */
+		REG(reg, "IALR (Individual Address Lower Register)", val);
+		FIELD("IADDR2", "0x%.16x", val);
+		break;
+	case 0x120: /* FEC_GRP_HASH_TABLE_HIGH */
+		REG(reg, "GAUR (Group Address Upper Register)", val);
+		FIELD("GADDR1", "0x%.16llx", (u64)((u64)val) << 32);
+		break;
+	case 0x124: /* FEC_GRP_HASH_TABLE_LOW */
+		REG(reg, "GALR (Group Address Lower Register)", val);
+		FIELD("GADDR2", "0x%.16x", val);
+		break;
+	case 0x144: /* FEC_X_WMRK */
+		REG(reg, "TFWR (Transmit FIFO Watermark Register)", val);
+		FIELD("X_WMRK", "%s",
+			(val & 0x00000003) == 0x00000000 ? "64 bytes" :
+			(val & 0x00000003) == 0x00000002 ? "128 bytes" :
+			(val & 0x00000003) == 0x00000003 ? "192 bytes" : "?");
+		break;
+	case 0x14c: /* FEC_R_BOUND */
+		REG(reg, "FRBR (FIFO Receive Bound Register)", val);
+		FIELD("R_BOUND (Highest valid FIFO RAM address)", "0x%.2x", (val & 0x000003fc) >> 2);
+		break;
+	case 0x188: /* FEC_R_BUFF_SIZE_0 */
+		REG(reg, "EMRBR (Maximum Receive Buffer Size)", val);
+		FIELD("R_BUF_SIZE (Receive buffer size)", "%u", (val & 0x000007f0) >> 4);
+		break;
+	case 0x004: /* FEC_IEVENT */
+	case 0x008: /* FEC_IMASK */
+	case 0x010: /* FEC_R_DES_ACTIVE_0 */
+	case 0x014: /* FEC_X_DES_ACTIVE_0 */
+	case 0x024: /* FEC_ECNTRL */
+	case 0x040: /* FEC_MII_DATA */
+	case 0x044: /* FEC_MII_SPEED */
+	case 0x064: /* FEC_MIB_CTRLSTAT */
+	case 0x0e4: /* FEC_ADDR_LOW */
+	case 0x0e8: /* FEC_ADDR_HIGH */
+	case 0x0ec: /* FEC_OPD */
+	case 0x0f0: /* FEC_TXIC0 */
+	case 0x0f4: /* FEC_TXIC1 */
+	case 0x0f8: /* FEC_TXIC2 */
+	case 0x100: /* FEC_RXIC0 */
+	case 0x104: /* FEC_RXIC1 */
+	case 0x108: /* FEC_RXIC2 */
+	case 0x150: /* FEC_R_FSTART */
+	case 0x160: /* FEC_R_DES_START_1 */
+	case 0x164: /* FEC_X_DES_START_1 */
+	case 0x168: /* FEC_R_BUFF_SIZE_1 */
+	case 0x16c: /* FEC_R_DES_START_2 */
+	case 0x170: /* FEC_X_DES_START_2 */
+	case 0x174: /* FEC_R_BUFF_SIZE_2 */
+	case 0x180: /* FEC_R_DES_START_0 */
+	case 0x184: /* FEC_X_DES_START_0 */
+	case 0x190: /* FEC_R_FIFO_RSFL */
+	case 0x194: /* FEC_R_FIFO_RSEM */
+	case 0x198: /* FEC_R_FIFO_RAEM */
+	case 0x19c: /* FEC_R_FIFO_RAFL */
+	case 0x1c4: /* FEC_RACC */
+	case 0x1c8: /* FEC_RCMR_1 */
+	case 0x1cc: /* FEC_RCMR_2 */
+	case 0x1d8: /* FEC_DMA_CFG_1 */
+	case 0x1dc: /* FEC_DMA_CFG_2 */
+	case 0x1e0: /* FEC_R_DES_ACTIVE_1 */
+	case 0x1e4: /* FEC_X_DES_ACTIVE_1 */
+	case 0x1e8: /* FEC_R_DES_ACTIVE_2 */
+	case 0x1ec: /* FEC_X_DES_ACTIVE_2 */
+	case 0x1f0: /* FEC_QOS_SCHEME */
+	case 0x200: /* RMON_T_DROP */
+	case 0x204: /* RMON_T_PACKETS */
+	case 0x208: /* RMON_T_BC_PKT */
+	case 0x20c: /* RMON_T_MC_PKT */
+	case 0x210: /* RMON_T_CRC_ALIGN */
+	case 0x214: /* RMON_T_UNDERSIZE */
+	case 0x218: /* RMON_T_OVERSIZE */
+	case 0x21c: /* RMON_T_FRAG */
+	case 0x220: /* RMON_T_JAB */
+	case 0x224: /* RMON_T_COL */
+	case 0x228: /* RMON_T_P64 */
+	case 0x22c: /* RMON_T_P65TO127 */
+	case 0x230: /* RMON_T_P128TO255 */
+	case 0x234: /* RMON_T_P256TO511 */
+	case 0x238: /* RMON_T_P512TO1023 */
+	case 0x23c: /* RMON_T_P1024TO2047 */
+	case 0x240: /* RMON_T_P_GTE2048 */
+	case 0x244: /* RMON_T_OCTETS */
+	case 0x248: /* IEEE_T_DROP */
+	case 0x24c: /* IEEE_T_FRAME_OK */
+	case 0x250: /* IEEE_T_1COL */
+	case 0x254: /* IEEE_T_MCOL */
+	case 0x258: /* IEEE_T_DEF */
+	case 0x25c: /* IEEE_T_LCOL */
+	case 0x260: /* IEEE_T_EXCOL */
+	case 0x264: /* IEEE_T_MACERR */
+	case 0x268: /* IEEE_T_CSERR */
+	case 0x26c: /* IEEE_T_SQE */
+	case 0x270: /* IEEE_T_FDXFC */
+	case 0x274: /* IEEE_T_OCTETS_OK */
+	case 0x284: /* RMON_R_PACKETS */
+	case 0x288: /* RMON_R_BC_PKT */
+	case 0x28c: /* RMON_R_MC_PKT */
+	case 0x290: /* RMON_R_CRC_ALIGN */
+	case 0x294: /* RMON_R_UNDERSIZE */
+	case 0x298: /* RMON_R_OVERSIZE */
+	case 0x29c: /* RMON_R_FRAG */
+	case 0x2a0: /* RMON_R_JAB */
+	case 0x2a4: /* RMON_R_RESVD_O */
+	case 0x2a8: /* RMON_R_P64 */
+	case 0x2ac: /* RMON_R_P65TO127 */
+	case 0x2b0: /* RMON_R_P128TO255 */
+	case 0x2b4: /* RMON_R_P256TO511 */
+	case 0x2b8: /* RMON_R_P512TO1023 */
+	case 0x2bc: /* RMON_R_P1024TO2047 */
+	case 0x2c0: /* RMON_R_P_GTE2048 */
+	case 0x2c4: /* RMON_R_OCTETS */
+	case 0x2c8: /* IEEE_R_DROP */
+	case 0x2cc: /* IEEE_R_FRAME_OK */
+	case 0x2d0: /* IEEE_R_CRC */
+	case 0x2d4: /* IEEE_R_ALIGN */
+	case 0x2d8: /* IEEE_R_MACERR */
+	case 0x2dc: /* IEEE_R_FDXFC */
+	case 0x2e0: /* IEEE_R_OCTETS_OK */
+		REG(reg, "", val);
+		break;
+	}
+}
+
+#undef FIELD
+#undef REG
+
+int fec_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
+{
+	const u32 *data = (u32 *)regs->data;
+	int offset;
+	u32 val;
+
+	for (offset = 0; offset < regs->len; offset += 4) {
+		val = data[offset / 4];
+
+		switch (regs->version) {
+		case 1:
+			fec_dump_reg_v1(offset, val);
+			break;
+		case 2:
+			fec_dump_reg_v2(offset, val);
+			break;
+		default:
+			return 1;
+		}
+	}
+
+	return 0;
+}
diff --git a/internal.h b/internal.h
index 84b0f9cef..aecf1ce60 100644
--- a/internal.h
+++ b/internal.h
@@ -357,4 +357,7 @@ int lan78xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
 /* Distributed Switch Architecture */
 int dsa_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
 
+/* i.MX Fast Ethernet Controller */
+int fec_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
+
 #endif /* ETHTOOL_INTERNAL_H__ */
-- 
2.20.1


^ permalink raw reply related

* Re: [PATCH net-next 2/3] arm64: dts: fsl: ls1028a-rdb: Add ENETC external eth ports for the LS1028A RDB board
From: Andrew Lunn @ 2019-02-14 16:27 UTC (permalink / raw)
  To: Claudiu Manoil
  Cc: Shawn Guo, Leo Li, David S . Miller, devicetree@vger.kernel.org,
	Alexandru Marginean, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org
In-Reply-To: <VI1PR04MB4880C9EF6C9EBFCAA2209DD596670@VI1PR04MB4880.eurprd04.prod.outlook.com>

> Hi Andrew,
> 
> The extra node for mdio seems to complicate things somewhat. 
> Just adding this node seems not enough.  How to find out easily if a child 
> of a enetc port node is a mdio node?

You copy somebody else code :-)

https://elixir.bootlin.com/linux/v5.0-rc6/source/drivers/net/dsa/mv88e6xxx/chip.c#L2765

	Andrew

^ permalink raw reply

* Re: [PATCH iproute2] iplink: document XDP subcommand to force the XDP mode.
From: Stephen Hemminger @ 2019-02-14 16:29 UTC (permalink / raw)
  To: Matteo Croce; +Cc: netdev, David Ahern, Stephen Hemminger, Jakub Kicinski
In-Reply-To: <CAGnkfhyYVN0_hqzrQQWb_+CW9PUr_C4JMa6GGx9Fh0qfu=Qx-A@mail.gmail.com>

On Thu, 14 Feb 2019 15:01:26 +0100
Matteo Croce <mcroce@redhat.com> wrote:

> On Wed, Feb 13, 2019 at 11:04 PM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > On Wed, 13 Feb 2019 15:40:30 +0100
> > Matteo Croce <mcroce@redhat.com> wrote:
> >  
> > > When attaching an eBPF program to a device, ip link can force the XDP mode
> > > by using the xdp{generic,drv,offload} keyword instead of just 'xdp'.
> > > Document this behaviour also in the help output.
> > >
> > > Signed-off-by: Matteo Croce <mcroce@redhat.com>
> > > Fixes: 14683814 ("bpf: add xdpdrv for requesting XDP driver mode")
> > > Fixes: 1b5e8094 ("bpf: allow requesting XDP HW offload")  
> >
> > Applied, thanks.
> > The man page already has this as well.
> >  
> 
> Yes, I found it just after I made the patch. However, it could be nice
> to have the generic "xdp" and a command like "type" or "mode" to
> specify the XDP mode, eg.
> ip link set dev eth0 xdp mode [ auto | generic | drv | offload ]
> I was trying to add it, but unfortunately it seems that the arguments
> aren't parsed in a loop, and are required to be in the exact order.
> Would this change make sense?
> 
> Regards,
> 
> --
> Matteo Croce
> per aspera ad upstream

It would have made sense to start with, but the syntax is more or less fixed
by now.

^ permalink raw reply

* Re: [PATCH net-next v2] bonding: check slave set command firstly
From: David Miller @ 2019-02-14 16:36 UTC (permalink / raw)
  To: xiangxia.m.yue; +Cc: netdev
In-Reply-To: <1549910988-40999-1-git-send-email-xiangxia.m.yue@gmail.com>

From: xiangxia.m.yue@gmail.com
Date: Mon, 11 Feb 2019 10:49:48 -0800

> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> 
> This patch is a little improvement. If user use the
> command shown as below, we should print the info [1]
> instead of [2]. The eth0 exists actually, and it may
> confuse user.
> 
> $ echo "eth0" > /sys/class/net/bond4/bonding/slaves
> 
> [1] "bond4: no command found in slaves file - use +ifname or -ifname"
> [2] "write error: No such device"
> 
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>

Applied, but would you please fix the dates on your submissions?

Because the dates in your patch postings are in the past, patchwork
puts your work at the tail of my patch queue instead of the front.

Thank you.

^ permalink raw reply

* Re: [PATCH] net: phy: at803x: disable delay only for RGMII mode
From: David Miller @ 2019-02-14 16:38 UTC (permalink / raw)
  To: vkoul
  Cc: linux-arm-msm, bjorn.andersson, netdev, niklas.cassel, andrew,
	f.fainelli, nsekhar, peter.ujfalusi, marc.w.gonzalez
In-Reply-To: <20190212141922.12849-1-vkoul@kernel.org>

From: Vinod Koul <vkoul@kernel.org>
Date: Tue, 12 Feb 2019 19:49:22 +0530

> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index 8ff12938ab47..7b54b54e3316 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -110,6 +110,18 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
>  	return phy_write(phydev, AT803X_DEBUG_DATA, val);
>  }
>  
> +static inline int at803x_enable_rx_delay(struct phy_device *phydev)
> +{
> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
> +				     AT803X_DEBUG_RX_CLK_DLY_EN);
> +}
> +
> +static inline int at803x_enable_tx_delay(struct phy_device *phydev)
> +{
> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
> +				     AT803X_DEBUG_TX_CLK_DLY_EN);
> +}
> +

Please do not use the inline directive in foo.c files, let the compiler
decide.

Thank you.

^ permalink raw reply

* Re: [PATCH] NETWORKING: avoid use IPCB in cipso_v4_error
From: David Miller @ 2019-02-14 16:43 UTC (permalink / raw)
  To: s-nazarov; +Cc: netdev, linux-security-module, kuznet, yoshfuji, paul
In-Reply-To: <6691891549984203@myt5-a323eb993ef7.qloud-c.yandex.net>

From: Nazarov Sergey <s-nazarov@yandex.ru>
Date: Tue, 12 Feb 2019 18:10:03 +0300

> Since cipso_v4_error might be called from different network stack layers, we can't safely use icmp_send there.
> icmp_send copies IP options with ip_option_echo, which uses IPCB to take access to IP header compiled data.
> But after commit 971f10ec ("tcp: better TCP_SKB_CB layout to reduce cache line misses"), IPCB can't be used
> above IP layer.
> This patch fixes the problem by creating in cipso_v4_error a local copy of compiled IP options and using it with
> introduced __icmp_send function. This looks some overloaded, but in quite rare error conditions only.
> 
> The original discussion is here:
> https://lore.kernel.org/linux-security-module/16659801547571984@sas1-890ba5c2334a.qloud-c.yandex.net/
> 
> Signed-off-by: Sergey Nazarov <s-nazarov@yandex.ru>

This problem is not unique to Cipso, net/atm/clip.c's error handler
has the same exact issue.

I didn't scan more of the tree, there are probably a couple more
locations as well.

^ permalink raw reply

* Re: [PATCHv2 net-next 0/2] devlink: 2 fixes for devlink region read
From: David Miller @ 2019-02-14 16:46 UTC (permalink / raw)
  To: parav; +Cc: jiri, netdev
In-Reply-To: <1550002970-28893-1-git-send-email-parav@mellanox.com>

From: Parav Pandit <parav@mellanox.com>
Date: Tue, 12 Feb 2019 14:22:50 -0600

> This 2 patches consist of fixes for devlink region read handling.
> 
> Signed-off-by: Parav Pandit <parav@mellanox.com>

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH] net: phy: at803x: disable delay only for RGMII mode
From: Marc Gonzalez @ 2019-02-14 16:46 UTC (permalink / raw)
  To: David Miller, vkoul
  Cc: linux-arm-msm, bjorn.andersson, netdev, niklas.cassel, andrew,
	f.fainelli, nsekhar, peter.ujfalusi
In-Reply-To: <20190214.083828.206479765039661735.davem@davemloft.net>

On 14/02/2019 17:38, David Miller wrote:

> From: Vinod Koul <vkoul@kernel.org>
> Date: Tue, 12 Feb 2019 19:49:22 +0530
> 
>> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
>> index 8ff12938ab47..7b54b54e3316 100644
>> --- a/drivers/net/phy/at803x.c
>> +++ b/drivers/net/phy/at803x.c
>> @@ -110,6 +110,18 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
>>  	return phy_write(phydev, AT803X_DEBUG_DATA, val);
>>  }
>>  
>> +static inline int at803x_enable_rx_delay(struct phy_device *phydev)
>> +{
>> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
>> +				     AT803X_DEBUG_RX_CLK_DLY_EN);
>> +}
>> +
>> +static inline int at803x_enable_tx_delay(struct phy_device *phydev)
>> +{
>> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
>> +				     AT803X_DEBUG_TX_CLK_DLY_EN);
>> +}
>> +
> 
> Please do not use the inline directive in foo.c files, let the compiler
> decide.

Isn't the compiler free to ignore the "inline" hint?

Regards.

^ permalink raw reply

* Re: [PATCH net-next 0/2] uapi: Add a new header for time types
From: David Miller @ 2019-02-14 16:52 UTC (permalink / raw)
  To: deepa.kernel; +Cc: linux-kernel, netdev, willemb, tglx, arnd, y2038
In-Reply-To: <20190213032604.2655-1-deepa.kernel@gmail.com>

From: Deepa Dinamani <deepa.kernel@gmail.com>
Date: Tue, 12 Feb 2019 19:26:02 -0800

> The series aims at adding a new time header: time_types.h.  This header
> is what will eventually hold all the uapi time types that we plan to
> leave across the interfaces after the y2038 cleanup.
> 
> The series was discussed with Arnd Bergmann.
> 
> The second patch fixes the errqueue.h header, which has a dependency on
> these types.
> 
> Note that there may be a trivial merge conflict with linux-next
> c70a772fda11 ("y2038: remove struct definition redirects").

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH iproute2] ss: Render buffer to output every time a number of chunks are allocated
From: Eric Dumazet @ 2019-02-14 16:55 UTC (permalink / raw)
  To: Stefano Brivio, Stephen Hemminger
  Cc: Phil Sutter, David Ahern, Sabrina Dubroca, netdev
In-Reply-To: <03dd56e5161a3c1270a21c4ba3f6e695793dbb74.1550105375.git.sbrivio@redhat.com>



On 02/13/2019 04:58 PM, Stefano Brivio wrote:
> Eric reported that, with 10 million sockets, ss -emoi (about 1000 bytes
> output per socket) can easily lead to OOM (buffer would grow to 10GB of
> memory).
> 
> Limit the maximum size of the buffer to five chunks, 1M each. Render and
> flush buffers whenever we reach that.
> 
> This might make the resulting blocks slightly unaligned between them, with
> occasional loss of readability on lines occurring every 5k to 50k sockets
> approximately. Something like (from ss -tu):
> 
> [...]
> CLOSE-WAIT   32       0           192.168.1.50:35232           10.0.0.1:https
> ESTAB        0        0           192.168.1.50:53820           10.0.0.1:https
> ESTAB       0        0           192.168.1.50:46924            10.0.0.1:https
> CLOSE-WAIT  32       0           192.168.1.50:35228            10.0.0.1:https
> [...]
> 
> However, I don't actually expect any human user to scroll through that
> amount of sockets, so readability should be preserved when it matters.
> 
> The bulk of the diffstat comes from moving field_next() around, as we now
> call render() from it. Functionally, this is implemented by six lines of
> code, most of them in field_next().
> 
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> Fixes: 691bd854bf4a ("ss: Buffer raw fields first, then render them as a table")
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---
> Eric, it would be nice if you could test this with your bazillion sockets,
> I checked this with -emoi and "only" 500,000 sockets.

Thanks, this seems reasonable enough to me.

# /usr/bin/time misc/ss -t |head -1
State       Recv-Q   Send-Q       Local Address:Port        Peer Address:Port   
Command terminated by signal 13
0.05user 0.00system 0:00.05elapsed 100%CPU (0avgtext+0avgdata 5836maxresident)k
0inputs+0outputs (0major+1121minor)pagefaults 0swaps



^ permalink raw reply

* Re: [PATCH net] net: dlink: sundance: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
From: David Miller @ 2019-02-14 16:56 UTC (permalink / raw)
  To: albin_yang; +Cc: netdev, kda, yang.wei9
In-Reply-To: <1550070722-4539-1-git-send-email-albin_yang@163.com>

From: Yang Wei <albin_yang@163.com>
Date: Wed, 13 Feb 2019 23:12:02 +0800

> From: Yang Wei <yang.wei9@zte.com.cn>
> 
> dev_consume_skb_irq() should be called in intr_handler() when skb
> xmit done. It makes drop profiles(dropwatch, perf) more friendly.
> 
> Remove a redundant blank line in intr_handler().
> 
> Signed-off-by: Yang Wei <yang.wei9@zte.com.cn>

Applied.

^ permalink raw reply

* Re: [PATCH net] net: amd: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
From: David Miller @ 2019-02-14 16:57 UTC (permalink / raw)
  To: albin_yang; +Cc: netdev, yang.wei9
In-Reply-To: <1550070894-4602-1-git-send-email-albin_yang@163.com>

From: Yang Wei <albin_yang@163.com>
Date: Wed, 13 Feb 2019 23:14:54 +0800

> From: Yang Wei <yang.wei9@zte.com.cn>
> 
> dev_consume_skb_irq() should be called when skb xmit done. It makes
> drop profiles(dropwatch, perf) more friendly.
> 
> Signed-off-by: Yang Wei <yang.wei9@zte.com.cn>

Applied.

^ permalink raw reply

* Re: [PATCH net] net: myri10ge: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
From: David Miller @ 2019-02-14 16:57 UTC (permalink / raw)
  To: albin_yang; +Cc: netdev, christopher.lee, yang.wei9
In-Reply-To: <1550070943-4653-1-git-send-email-albin_yang@163.com>

From: Yang Wei <albin_yang@163.com>
Date: Wed, 13 Feb 2019 23:15:43 +0800

> From: Yang Wei <yang.wei9@zte.com.cn>
> 
> dev_consume_skb_irq() should be called in myri10ge_tx_done() when
> skb xmit done. It makes drop profiles(dropwatch, perf) more friendly.
> 
> Signed-off-by: Yang Wei <yang.wei9@zte.com.cn>

Applied.

^ permalink raw reply

* Re: [PATCH net] net: sgi: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
From: David Miller @ 2019-02-14 16:57 UTC (permalink / raw)
  To: albin_yang; +Cc: netdev, ralf, yang.wei9
In-Reply-To: <1550071026-4723-1-git-send-email-albin_yang@163.com>

From: Yang Wei <albin_yang@163.com>
Date: Wed, 13 Feb 2019 23:17:06 +0800

> From: Yang Wei <yang.wei9@zte.com.cn>
> 
> dev_consume_skb_irq() should be called when skb xmit done. It makes
> drop profiles(dropwatch, perf) more friendly.
> 
> Signed-off-by: Yang Wei <yang.wei9@zte.com.cn>

Applied.

^ permalink raw reply

* Re: [PATCH net] net: micrel: ks8695net: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
From: David Miller @ 2019-02-14 16:57 UTC (permalink / raw)
  To: albin_yang; +Cc: netdev, yang.wei9
In-Reply-To: <1550071089-4776-1-git-send-email-albin_yang@163.com>

From: Yang Wei <albin_yang@163.com>
Date: Wed, 13 Feb 2019 23:18:09 +0800

> From: Yang Wei <yang.wei9@zte.com.cn>
> 
> dev_consume_skb_irq() should be called in ks8695_tx_irq() when skb
> xmit done. It makes drop profiles(dropwatch, perf) more friendly.
> 
> Signed-off-by: Yang Wei <yang.wei9@zte.com.cn>

Applied.

^ permalink raw reply

* Re: [PATCH net] net: natsemi: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
From: David Miller @ 2019-02-14 16:57 UTC (permalink / raw)
  To: albin_yang; +Cc: netdev, tsbogend, yang.wei9
In-Reply-To: <1550071154-4834-1-git-send-email-albin_yang@163.com>

From: Yang Wei <albin_yang@163.com>
Date: Wed, 13 Feb 2019 23:19:14 +0800

> From: Yang Wei <yang.wei9@zte.com.cn>
> 
> dev_consume_skb_irq() should be called when skb xmit done. It makes
> drop profiles(dropwatch, perf) more friendly.
> 
> Signed-off-by: Yang Wei <yang.wei9@zte.com.cn>

Applied.

^ permalink raw reply

* Re: [PATCH net] net: nuvoton: w90p910_ether: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
From: David Miller @ 2019-02-14 16:57 UTC (permalink / raw)
  To: albin_yang; +Cc: netdev, linux-arm-kernel, mcuos.com, yang.wei9
In-Reply-To: <1550071262-4889-1-git-send-email-albin_yang@163.com>

From: Yang Wei <albin_yang@163.com>
Date: Wed, 13 Feb 2019 23:21:02 +0800

> From: Yang Wei <yang.wei9@zte.com.cn>
> 
> dev_consume_skb_irq() should be called in w90p910_ether_start_xmit()
> when skb xmit done. It makes drop profiles(dropwatch, perf) more
> friendly.
> 
> Signed-off-by: Yang Wei <yang.wei9@zte.com.cn>

Applied.

^ permalink raw reply

* Re: [PATCH -next] net: ipvlan_l3s: fix kconfig dependency warning
From: David Miller @ 2019-02-14 16:59 UTC (permalink / raw)
  To: rdunlap; +Cc: netdev, maheshb, daniel
In-Reply-To: <204a7785-a1d2-e714-653e-2cb19e36f279@infradead.org>

From: Randy Dunlap <rdunlap@infradead.org>
Date: Wed, 13 Feb 2019 08:55:02 -0800

> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix the kconfig warning in IPVLAN_L3S when neither INET nor IPV6
> is enabled:
> 
> WARNING: unmet direct dependencies detected for NET_L3_MASTER_DEV
>   Depends on [n]: NET [=y] && (INET [=n] || IPV6 [=n])
>   Selected by [y]:
>   - IPVLAN_L3S [=y] && NETDEVICES [=y] && NET_CORE [=y] && NETFILTER [=y]
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Mahesh Bandewar <maheshb@google.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> ---
> v2: simplify the dependency to IPVLAN

Applied, thanks Randy.

^ permalink raw reply

* RE: [PATCH net-next 2/3] arm64: dts: fsl: ls1028a-rdb: Add ENETC external eth ports for the LS1028A RDB board
From: Claudiu Manoil @ 2019-02-14 17:00 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Shawn Guo, Leo Li, David S . Miller, devicetree@vger.kernel.org,
	Alexandru Marginean, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org
In-Reply-To: <20190214162746.GI708@lunn.ch>

>-----Original Message-----
>From: Andrew Lunn <andrew@lunn.ch>
>Sent: Thursday, February 14, 2019 6:28 PM
>To: Claudiu Manoil <claudiu.manoil@nxp.com>
>Cc: Shawn Guo <shawnguo@kernel.org>; Leo Li <leoyang.li@nxp.com>; David S .
>Miller <davem@davemloft.net>; devicetree@vger.kernel.org; Alexandru
>Marginean <alexandru.marginean@nxp.com>; linux-kernel@vger.kernel.org;
>linux-arm-kernel@lists.infradead.org; netdev@vger.kernel.org
>Subject: Re: [PATCH net-next 2/3] arm64: dts: fsl: ls1028a-rdb: Add ENETC
>external eth ports for the LS1028A RDB board
>
>> Hi Andrew,
>>
>> The extra node for mdio seems to complicate things somewhat.
>> Just adding this node seems not enough.  How to find out easily if a
>> child of a enetc port node is a mdio node?
>
>You copy somebody else code :-)
>

Provided you find the right thing to copy : ) . Thanks for the hint.

^ permalink raw reply

* Re: [PATCH net] net: stmmac: Fix NAPI poll in TX path when in multi-queue
From: David Miller @ 2019-02-14 17:01 UTC (permalink / raw)
  To: jose.abreu
  Cc: netdev, linux-kernel, joao.pinto, peppe.cavallaro,
	alexandre.torgue
In-Reply-To: <a264c48823687434e4d18aeb5830707e00c64250.1550077162.git.joabreu@synopsys.com>

From: Jose Abreu <jose.abreu@synopsys.com>
Date: Wed, 13 Feb 2019 18:00:43 +0100

> Commit 8fce33317023 introduced the concept of NAPI per-channel and
> independent cleaning of TX path.
> 
> This is currently breaking performance in some cases. The scenario
> happens when all packets are being received in Queue 0 but the TX is
> performed in Queue != 0.
> 
> I didn't look very deep but it seems that NAPI for Queue 0 will clean
> the RX path but as TX is in different NAPI, this last one is called at a
> slower rate which kills performance in TX. I suspect this is due to TX
> cleaning takes much longer than RX and because NAPI will get canceled
> once we return with 0 budget consumed (e.g. when TX is still not done it
> will return 0 budget).
> 
> Fix this by looking at all TX channels in NAPI poll function.
> 
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Fixes: 8fce33317023 ("net: stmmac: Rework coalesce timer and fix multi-queue races")

No this isn't right.

The TX interrupt events for Queue != 0 should clean up the TX packets
on those queues.

Furthermore you are breaking the locality of the TX processing.

I'm not applying this, sorry.

^ permalink raw reply

* Re: [PATCH 5/9] perf, bpf: save bpf_prog_info in a rbtree in perf_env
From: Song Liu @ 2019-02-14 17:01 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Netdev, linux-kernel@vger.kernel.org, ast@kernel.org,
	daniel@iogearbox.net, Kernel Team, peterz@infradead.org,
	acme@redhat.com
In-Reply-To: <20190214122638.GD26714@krava>



> On Feb 14, 2019, at 4:26 AM, Jiri Olsa <jolsa@redhat.com> wrote:
> 
> On Fri, Feb 08, 2019 at 05:17:01PM -0800, Song Liu wrote:
> 
> SNIP
> 
>> diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
>> index d01b8355f4ca..5894a177b7cf 100644
>> --- a/tools/perf/util/env.h
>> +++ b/tools/perf/util/env.h
>> @@ -3,7 +3,10 @@
>> #define __PERF_ENV_H
>> 
>> #include <linux/types.h>
>> +#include <linux/rbtree.h>
>> #include "cpumap.h"
>> +#include "rwsem.h"
>> +#include "bpf-event.h"
>> 
>> struct cpu_topology_map {
>> 	int	socket_id;
>> @@ -64,6 +67,8 @@ struct perf_env {
>> 	struct memory_node	*memory_nodes;
>> 	unsigned long long	 memory_bsize;
>> 	u64                     clockid_res_ns;
>> +	struct rw_semaphore	bpf_info_lock;
> 
> why's the lock needed?
> 
> jirka

It protects the retries for bpf_prog_info and btf. For perf-top, 
we will have one thread writing to the trees, while the main 
thread reading from them. 

Let me add comments to clarify. 

Thanks,
Song

^ permalink raw reply

* Re: [PATCH net] selftests: fix timestamping Makefile
From: David Miller @ 2019-02-14 17:03 UTC (permalink / raw)
  To: deepa.kernel; +Cc: shuah, willemb, netdev, linux-kselftest
In-Reply-To: <20190213170914.11991-1-deepa.kernel@gmail.com>

From: Deepa Dinamani <deepa.kernel@gmail.com>
Date: Wed, 13 Feb 2019 09:09:13 -0800

> The clean target in the makefile conflicts with the generic
> kselftests lib.mk, and fails to properly remove the compiled
> test programs.
> 
> Remove the redundant rule, the TEST_GEN_FILES will be already
> removed by the CLEAN macro in lib.mk.
> 
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH 5/9] perf, bpf: save bpf_prog_info in a rbtree in perf_env
From: Song Liu @ 2019-02-14 17:03 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Netdev, linux-kernel, ast@kernel.org, daniel@iogearbox.net,
	Kernel Team, peterz@infradead.org, acme@redhat.com
In-Reply-To: <20190214123311.GA7465@krava>



> On Feb 14, 2019, at 4:33 AM, Jiri Olsa <jolsa@redhat.com> wrote:
> 
> On Fri, Feb 08, 2019 at 05:17:01PM -0800, Song Liu wrote:
>> bpf_prog_info contains information necessary to annotate bpf programs.
>> This patch saves bpf_prog_info for bpf programs loaded in the system.
>> 
>> perf-record saves bpf_prog_info information as headers to perf.data.
>> A new header type HEADER_BPF_PROG_INFO is introduced for this data.
> 
> please move those 2 changes into separate patches then

Do you mean one patch to save data in rbtree, then a separate patch 
to save data in perf.data file?

Thanks,
Song

> 
> it's hard to make comments when I don't see the rest of
> the patches on the list please resend the patchset
> 
> thanks,
> jirka


^ 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