* [PATCH 1/4 v2 net-next] net: phy: aquantia: Shorten name space prefix to aqr_
From: Heiner Kallweit @ 2019-02-03 20:16 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <d613dfb1-a9c3-daf3-1324-546b87b83e29@gmail.com>
From: Andrew Lunn <andrew@lunn.ch>
aquantia_ as a name space prefix is rather long, resulting in lots of
lines needing wrapping, reducing readability. Use the prefix aqr_
instead, which fits with the vendor naming there devices aqr107, for
example.
v2:
- add SoB from Heiner
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/aquantia.c | 64 +++++++++++++++++++-------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index 0578fe75d..880ec4bba 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -22,7 +22,7 @@
#define PHY_ID_AQR107 0x03a1b4e0
#define PHY_ID_AQR405 0x03a1b4b0
-static int aquantia_config_aneg(struct phy_device *phydev)
+static int aqr_config_aneg(struct phy_device *phydev)
{
linkmode_copy(phydev->supported, phy_10gbit_features);
linkmode_copy(phydev->advertising, phydev->supported);
@@ -30,7 +30,7 @@ static int aquantia_config_aneg(struct phy_device *phydev)
return 0;
}
-static int aquantia_config_intr(struct phy_device *phydev)
+static int aqr_config_intr(struct phy_device *phydev)
{
int err;
@@ -59,7 +59,7 @@ static int aquantia_config_intr(struct phy_device *phydev)
return err;
}
-static int aquantia_ack_interrupt(struct phy_device *phydev)
+static int aqr_ack_interrupt(struct phy_device *phydev)
{
int reg;
@@ -67,7 +67,7 @@ static int aquantia_ack_interrupt(struct phy_device *phydev)
return (reg < 0) ? reg : 0;
}
-static int aquantia_read_status(struct phy_device *phydev)
+static int aqr_read_status(struct phy_device *phydev)
{
int reg;
@@ -102,17 +102,17 @@ static int aquantia_read_status(struct phy_device *phydev)
return 0;
}
-static struct phy_driver aquantia_driver[] = {
+static struct phy_driver aqr_driver[] = {
{
.phy_id = PHY_ID_AQ1202,
.phy_id_mask = 0xfffffff0,
.name = "Aquantia AQ1202",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
- .config_aneg = aquantia_config_aneg,
- .config_intr = aquantia_config_intr,
- .ack_interrupt = aquantia_ack_interrupt,
- .read_status = aquantia_read_status,
+ .config_aneg = aqr_config_aneg,
+ .config_intr = aqr_config_intr,
+ .ack_interrupt = aqr_ack_interrupt,
+ .read_status = aqr_read_status,
},
{
.phy_id = PHY_ID_AQ2104,
@@ -120,10 +120,10 @@ static struct phy_driver aquantia_driver[] = {
.name = "Aquantia AQ2104",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
- .config_aneg = aquantia_config_aneg,
- .config_intr = aquantia_config_intr,
- .ack_interrupt = aquantia_ack_interrupt,
- .read_status = aquantia_read_status,
+ .config_aneg = aqr_config_aneg,
+ .config_intr = aqr_config_intr,
+ .ack_interrupt = aqr_ack_interrupt,
+ .read_status = aqr_read_status,
},
{
.phy_id = PHY_ID_AQR105,
@@ -131,10 +131,10 @@ static struct phy_driver aquantia_driver[] = {
.name = "Aquantia AQR105",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
- .config_aneg = aquantia_config_aneg,
- .config_intr = aquantia_config_intr,
- .ack_interrupt = aquantia_ack_interrupt,
- .read_status = aquantia_read_status,
+ .config_aneg = aqr_config_aneg,
+ .config_intr = aqr_config_intr,
+ .ack_interrupt = aqr_ack_interrupt,
+ .read_status = aqr_read_status,
},
{
.phy_id = PHY_ID_AQR106,
@@ -142,10 +142,10 @@ static struct phy_driver aquantia_driver[] = {
.name = "Aquantia AQR106",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
- .config_aneg = aquantia_config_aneg,
- .config_intr = aquantia_config_intr,
- .ack_interrupt = aquantia_ack_interrupt,
- .read_status = aquantia_read_status,
+ .config_aneg = aqr_config_aneg,
+ .config_intr = aqr_config_intr,
+ .ack_interrupt = aqr_ack_interrupt,
+ .read_status = aqr_read_status,
},
{
.phy_id = PHY_ID_AQR107,
@@ -153,10 +153,10 @@ static struct phy_driver aquantia_driver[] = {
.name = "Aquantia AQR107",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
- .config_aneg = aquantia_config_aneg,
- .config_intr = aquantia_config_intr,
- .ack_interrupt = aquantia_ack_interrupt,
- .read_status = aquantia_read_status,
+ .config_aneg = aqr_config_aneg,
+ .config_intr = aqr_config_intr,
+ .ack_interrupt = aqr_ack_interrupt,
+ .read_status = aqr_read_status,
},
{
.phy_id = PHY_ID_AQR405,
@@ -164,16 +164,16 @@ static struct phy_driver aquantia_driver[] = {
.name = "Aquantia AQR405",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
- .config_aneg = aquantia_config_aneg,
- .config_intr = aquantia_config_intr,
- .ack_interrupt = aquantia_ack_interrupt,
- .read_status = aquantia_read_status,
+ .config_aneg = aqr_config_aneg,
+ .config_intr = aqr_config_intr,
+ .ack_interrupt = aqr_ack_interrupt,
+ .read_status = aqr_read_status,
},
};
-module_phy_driver(aquantia_driver);
+module_phy_driver(aqr_driver);
-static struct mdio_device_id __maybe_unused aquantia_tbl[] = {
+static struct mdio_device_id __maybe_unused aqr_tbl[] = {
{ PHY_ID_AQ1202, 0xfffffff0 },
{ PHY_ID_AQ2104, 0xfffffff0 },
{ PHY_ID_AQR105, 0xfffffff0 },
@@ -183,7 +183,7 @@ static struct mdio_device_id __maybe_unused aquantia_tbl[] = {
{ }
};
-MODULE_DEVICE_TABLE(mdio, aquantia_tbl);
+MODULE_DEVICE_TABLE(mdio, aqr_tbl);
MODULE_DESCRIPTION("Aquantia PHY driver");
MODULE_AUTHOR("Shaohui Xie <Shaohui.Xie@freescale.com>");
--
2.20.1
^ permalink raw reply related
* [PATCH 2/4 v2 net-next] net: phy: aquantia: remove unneeded includes
From: Heiner Kallweit @ 2019-02-03 20:17 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <d613dfb1-a9c3-daf3-1324-546b87b83e29@gmail.com>
Remove unneeded header includes.
v2:
- leave kernel.h in
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/aquantia.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index 880ec4bba..2b349de1d 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -10,10 +10,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
-#include <linux/mii.h>
-#include <linux/ethtool.h>
#include <linux/phy.h>
-#include <linux/mdio.h>
#define PHY_ID_AQ1202 0x03a1b445
#define PHY_ID_AQ2104 0x03a1b460
--
2.20.1
^ permalink raw reply related
* [PATCH 3/4 v2 net-next] net: phy: aquantia: use macro PHY_ID_MATCH_MODEL
From: Heiner Kallweit @ 2019-02-03 20:18 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <d613dfb1-a9c3-daf3-1324-546b87b83e29@gmail.com>
Make use of macro PHY_ID_MATCH_MODEL to simplify the code.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/phy/aquantia.c | 30 ++++++++++++------------------
1 file changed, 12 insertions(+), 18 deletions(-)
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index 2b349de1d..fde437506 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -101,8 +101,7 @@ static int aqr_read_status(struct phy_device *phydev)
static struct phy_driver aqr_driver[] = {
{
- .phy_id = PHY_ID_AQ1202,
- .phy_id_mask = 0xfffffff0,
+ PHY_ID_MATCH_MODEL(PHY_ID_AQ1202),
.name = "Aquantia AQ1202",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
@@ -112,8 +111,7 @@ static struct phy_driver aqr_driver[] = {
.read_status = aqr_read_status,
},
{
- .phy_id = PHY_ID_AQ2104,
- .phy_id_mask = 0xfffffff0,
+ PHY_ID_MATCH_MODEL(PHY_ID_AQ2104),
.name = "Aquantia AQ2104",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
@@ -123,8 +121,7 @@ static struct phy_driver aqr_driver[] = {
.read_status = aqr_read_status,
},
{
- .phy_id = PHY_ID_AQR105,
- .phy_id_mask = 0xfffffff0,
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR105),
.name = "Aquantia AQR105",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
@@ -134,8 +131,7 @@ static struct phy_driver aqr_driver[] = {
.read_status = aqr_read_status,
},
{
- .phy_id = PHY_ID_AQR106,
- .phy_id_mask = 0xfffffff0,
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR106),
.name = "Aquantia AQR106",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
@@ -145,8 +141,7 @@ static struct phy_driver aqr_driver[] = {
.read_status = aqr_read_status,
},
{
- .phy_id = PHY_ID_AQR107,
- .phy_id_mask = 0xfffffff0,
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR107),
.name = "Aquantia AQR107",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
@@ -156,8 +151,7 @@ static struct phy_driver aqr_driver[] = {
.read_status = aqr_read_status,
},
{
- .phy_id = PHY_ID_AQR405,
- .phy_id_mask = 0xfffffff0,
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR405),
.name = "Aquantia AQR405",
.features = PHY_10GBIT_FULL_FEATURES,
.aneg_done = genphy_c45_aneg_done,
@@ -171,12 +165,12 @@ static struct phy_driver aqr_driver[] = {
module_phy_driver(aqr_driver);
static struct mdio_device_id __maybe_unused aqr_tbl[] = {
- { PHY_ID_AQ1202, 0xfffffff0 },
- { PHY_ID_AQ2104, 0xfffffff0 },
- { PHY_ID_AQR105, 0xfffffff0 },
- { PHY_ID_AQR106, 0xfffffff0 },
- { PHY_ID_AQR107, 0xfffffff0 },
- { PHY_ID_AQR405, 0xfffffff0 },
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQ1202) },
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQ2104) },
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR105) },
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR106) },
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) },
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
{ }
};
--
2.20.1
^ permalink raw reply related
* [PATCH 4/4 v2 net-next] net: phy: aquantia: replace magic numbers with constants
From: Heiner Kallweit @ 2019-02-03 20:19 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <d613dfb1-a9c3-daf3-1324-546b87b83e29@gmail.com>
Replace magic numbers with proper constants. The original patch is
from Andrew, I extended / adjusted certain parts:
- Use decimal bit numbers. The datasheet uses hex bit numbers 0 .. F.
- Order defines from highest to lowest bit numbers
- correct some typos
- add constant MDIO_AN_TX_VEND_INT_MASK2_LINK
- Remove few functional improvements from the patch, they will come as
a separate patch.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/phy/aquantia.c | 80 +++++++++++++++++++++++++++++++-------
1 file changed, 66 insertions(+), 14 deletions(-)
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index fde437506..482004efa 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -19,6 +19,48 @@
#define PHY_ID_AQR107 0x03a1b4e0
#define PHY_ID_AQR405 0x03a1b4b0
+#define MDIO_AN_TX_VEND_STATUS1 0xc800
+#define MDIO_AN_TX_VEND_STATUS1_10BASET (0x0 << 1)
+#define MDIO_AN_TX_VEND_STATUS1_100BASETX (0x1 << 1)
+#define MDIO_AN_TX_VEND_STATUS1_1000BASET (0x2 << 1)
+#define MDIO_AN_TX_VEND_STATUS1_10GBASET (0x3 << 1)
+#define MDIO_AN_TX_VEND_STATUS1_2500BASET (0x4 << 1)
+#define MDIO_AN_TX_VEND_STATUS1_5000BASET (0x5 << 1)
+#define MDIO_AN_TX_VEND_STATUS1_RATE_MASK (0x7 << 1)
+#define MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX BIT(0)
+
+#define MDIO_AN_TX_VEND_INT_STATUS2 0xcc01
+
+#define MDIO_AN_TX_VEND_INT_MASK2 0xd401
+#define MDIO_AN_TX_VEND_INT_MASK2_LINK BIT(0)
+
+/* Vendor specific 1, MDIO_MMD_VEND1 */
+#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00
+#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01
+
+#define VEND1_GLOBAL_INT_STD_MASK 0xff00
+#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15)
+#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14)
+#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13)
+#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12)
+#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11)
+#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10)
+#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9)
+#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8)
+#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7)
+#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6)
+#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0)
+
+#define VEND1_GLOBAL_INT_VEND_MASK 0xff01
+#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15)
+#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14)
+#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13)
+#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12)
+#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11)
+#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2)
+#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1)
+#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0)
+
static int aqr_config_aneg(struct phy_device *phydev)
{
linkmode_copy(phydev->supported, phy_10gbit_features);
@@ -32,25 +74,35 @@ static int aqr_config_intr(struct phy_device *phydev)
int err;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
- err = phy_write_mmd(phydev, MDIO_MMD_AN, 0xd401, 1);
+ err = phy_write_mmd(phydev, MDIO_MMD_AN,
+ MDIO_AN_TX_VEND_INT_MASK2,
+ MDIO_AN_TX_VEND_INT_MASK2_LINK);
if (err < 0)
return err;
- err = phy_write_mmd(phydev, MDIO_MMD_VEND1, 0xff00, 1);
+ err = phy_write_mmd(phydev, MDIO_MMD_VEND1,
+ VEND1_GLOBAL_INT_STD_MASK,
+ VEND1_GLOBAL_INT_STD_MASK_ALL);
if (err < 0)
return err;
- err = phy_write_mmd(phydev, MDIO_MMD_VEND1, 0xff01, 0x1001);
+ err = phy_write_mmd(phydev, MDIO_MMD_VEND1,
+ VEND1_GLOBAL_INT_VEND_MASK,
+ VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 |
+ VEND1_GLOBAL_INT_VEND_MASK_AN);
} else {
- err = phy_write_mmd(phydev, MDIO_MMD_AN, 0xd401, 0);
+ err = phy_write_mmd(phydev, MDIO_MMD_AN,
+ MDIO_AN_TX_VEND_INT_MASK2, 0);
if (err < 0)
return err;
- err = phy_write_mmd(phydev, MDIO_MMD_VEND1, 0xff00, 0);
+ err = phy_write_mmd(phydev, MDIO_MMD_VEND1,
+ VEND1_GLOBAL_INT_STD_MASK, 0);
if (err < 0)
return err;
- err = phy_write_mmd(phydev, MDIO_MMD_VEND1, 0xff01, 0);
+ err = phy_write_mmd(phydev, MDIO_MMD_VEND1,
+ VEND1_GLOBAL_INT_VEND_MASK, 0);
}
return err;
@@ -60,7 +112,8 @@ static int aqr_ack_interrupt(struct phy_device *phydev)
{
int reg;
- reg = phy_read_mmd(phydev, MDIO_MMD_AN, 0xcc01);
+ reg = phy_read_mmd(phydev, MDIO_MMD_AN,
+ MDIO_AN_TX_VEND_INT_STATUS2);
return (reg < 0) ? reg : 0;
}
@@ -75,21 +128,20 @@ static int aqr_read_status(struct phy_device *phydev)
else
phydev->link = 0;
- reg = phy_read_mmd(phydev, MDIO_MMD_AN, 0xc800);
+ reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_STATUS1);
mdelay(10);
- reg = phy_read_mmd(phydev, MDIO_MMD_AN, 0xc800);
+ reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_STATUS1);
- switch (reg) {
- case 0x9:
+ switch (reg & MDIO_AN_TX_VEND_STATUS1_RATE_MASK) {
+ case MDIO_AN_TX_VEND_STATUS1_2500BASET:
phydev->speed = SPEED_2500;
break;
- case 0x5:
+ case MDIO_AN_TX_VEND_STATUS1_1000BASET:
phydev->speed = SPEED_1000;
break;
- case 0x3:
+ case MDIO_AN_TX_VEND_STATUS1_100BASETX:
phydev->speed = SPEED_100;
break;
- case 0x7:
default:
phydev->speed = SPEED_10000;
break;
--
2.20.1
^ permalink raw reply related
* Linux kernel and RFC 7217 support
From: Carsten Strotmann @ 2019-02-03 21:31 UTC (permalink / raw)
To: davem, kuznet, yoshfuji, netdev, fgont
Hi,
I'm testing IPv6 stable-secret identifiers SII under Linux RFC 7217.
<https://tools.ietf.org/html/rfc7217>
One important feature of RFC 7217 is to deliver stable IPv6 addresses
for server addressing use that will not change in case of new network
hardware (changed hardware address). Besides other benefits of SII, this
is an important feature compared with EUI64 IPv6 addresses.
However during my testing, the SII addresses were always changing when
changing the network hardware address. After investigating into
NetworkManager (Red Hat), wicked (SUSE) and disabling all these, working
with the kernel alone and sysctl values, the issue was still showing.
I'm not a C programmer, but I took a look into the source code and in
linux-4.20.6/net/ipv6/addrconf.c
I found:
[...]
sha_init(digest);
memset(&data, 0, sizeof(data));
memset(workspace, 0, sizeof(workspace));
---> memcpy(data.hwaddr, idev->dev->perm_addr, idev->dev->addr_len);
data.prefix[0] = address->s6_addr32[0];
data.prefix[1] = address->s6_addr32[1];
data.secret = secret;
data.dad_count = dad_count;
sha_transform(digest, data.__data, workspace);
temp = *address;
temp.s6_addr32[2] = (__force __be32)digest[0];
temp.s6_addr32[3] = (__force __be32)digest[1];
[...]
The marked line looks to me as if the interface hardware address is
mixed into the SHA hash that will generate the SII address.
Is this an correct observation?
If yes, what is the rationale for this?
If my suspected behavior of the Linux kernel is the true, it does really
reduce the usefulness of IPv6 SII addresses in datacenter/enterprise
environments.
Best regards
Carsten Strotmann
^ permalink raw reply
* Re: [PATCHv3 net] sctp: check and update stream->out_curr when allocating stream_out
From: Neil Horman @ 2019-02-03 22:16 UTC (permalink / raw)
To: Xin Long
Cc: linux-kernel, network dev, linux-sctp, davem,
Marcelo Ricardo Leitner
In-Reply-To: <91ab89c95836cfcacbe823f4bc0ecd2568bad113.1549222078.git.lucien.xin@gmail.com>
On Mon, Feb 04, 2019 at 03:27:58AM +0800, Xin Long wrote:
> Now when using stream reconfig to add out streams, stream->out
> will get re-allocated, and all old streams' information will
> be copied to the new ones and the old ones will be freed.
>
> So without stream->out_curr updated, next time when trying to
> send from stream->out_curr stream, a panic would be caused.
>
> This patch is to check and update stream->out_curr when
> allocating stream_out.
>
> v1->v2:
> - define fa_index() to get elem index from stream->out_curr.
> v2->v3:
> - repost with no change.
>
> Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations")
> Reported-by: Ying Xu <yinxu@redhat.com>
> Reported-by: syzbot+e33a3a138267ca119c7d@syzkaller.appspotmail.com
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
> net/sctp/stream.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> index 80e0ae5..f246331 100644
> --- a/net/sctp/stream.c
> +++ b/net/sctp/stream.c
> @@ -84,6 +84,19 @@ static void fa_zero(struct flex_array *fa, size_t index, size_t count)
> }
> }
>
> +static size_t fa_index(struct flex_array *fa, void *elem, size_t count)
> +{
> + size_t index = 0;
> +
> + while (count--) {
> + if (elem == flex_array_get(fa, index))
> + break;
> + index++;
> + }
> +
> + return index;
> +}
> +
> /* Migrates chunks from stream queues to new stream queues if needed,
> * but not across associations. Also, removes those chunks to streams
> * higher than the new max.
> @@ -147,6 +160,13 @@ static int sctp_stream_alloc_out(struct sctp_stream *stream, __u16 outcnt,
>
> if (stream->out) {
> fa_copy(out, stream->out, 0, min(outcnt, stream->outcnt));
> + if (stream->out_curr) {
> + size_t index = fa_index(stream->out, stream->out_curr,
> + stream->outcnt);
> +
> + BUG_ON(index == stream->outcnt);
> + stream->out_curr = flex_array_get(out, index);
> + }
> fa_free(stream->out);
> }
>
> --
> 2.1.0
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* Re: [PATCH 0/4 v2 net-next] net: phy: aquantia: number of improvements
From: David Miller @ 2019-02-03 22:31 UTC (permalink / raw)
To: hkallweit1; +Cc: andrew, f.fainelli, netdev
In-Reply-To: <d613dfb1-a9c3-daf3-1324-546b87b83e29@gmail.com>
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun, 3 Feb 2019 21:15:19 +0100
> This patch series is based on work from Andrew. I adjusted and added
> certain parts. The series improves few aspects of driver, no functional
> change intended.
>
> v2:
> - add my SoB to patch 1
> - leave kernel.h in in patch 2
I think this looks good now.
Series applied, thanks.
^ permalink raw reply
* Re: [PATCHv3 net] sctp: check and update stream->out_curr when allocating stream_out
From: David Miller @ 2019-02-03 22:31 UTC (permalink / raw)
To: lucien.xin; +Cc: linux-kernel, netdev, linux-sctp, marcelo.leitner, nhorman
In-Reply-To: <91ab89c95836cfcacbe823f4bc0ecd2568bad113.1549222078.git.lucien.xin@gmail.com>
From: Xin Long <lucien.xin@gmail.com>
Date: Mon, 4 Feb 2019 03:27:58 +0800
> Now when using stream reconfig to add out streams, stream->out
> will get re-allocated, and all old streams' information will
> be copied to the new ones and the old ones will be freed.
>
> So without stream->out_curr updated, next time when trying to
> send from stream->out_curr stream, a panic would be caused.
>
> This patch is to check and update stream->out_curr when
> allocating stream_out.
>
> v1->v2:
> - define fa_index() to get elem index from stream->out_curr.
> v2->v3:
> - repost with no change.
>
> Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations")
> Reported-by: Ying Xu <yinxu@redhat.com>
> Reported-by: syzbot+e33a3a138267ca119c7d@syzkaller.appspotmail.com
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Applied and queued up for -stable.
Thanks!
^ permalink raw reply
* Re: [PATCH bpf-next] bpf: support SO_DEBUG in bpf_setsockopt()
From: Y Song @ 2019-02-03 23:36 UTC (permalink / raw)
To: Yafang Shao
Cc: Martin KaFai Lau, brakmo, Alexei Starovoitov, Daniel Borkmann,
netdev, shaoyafang
In-Reply-To: <1549181707-16864-1-git-send-email-laoar.shao@gmail.com>
On Sun, Feb 3, 2019 at 12:18 AM Yafang Shao <laoar.shao@gmail.com> wrote:
>
> Then we can enable/disable socket debugging without modifying user code.
> That is more convenient for debugging.
>
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Yonghong Song <yhs@fb.com>
> ---
> include/net/sock.h | 8 ++++++++
> net/core/filter.c | 3 +++
> net/core/sock.c | 8 --------
> 3 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 2b229f7..8decee9 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -1935,6 +1935,14 @@ static inline void sock_confirm_neigh(struct sk_buff *skb, struct neighbour *n)
> }
> }
>
> +static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool)
> +{
> + if (valbool)
> + sock_set_flag(sk, bit);
> + else
> + sock_reset_flag(sk, bit);
> +}
> +
> bool sk_mc_loop(struct sock *sk);
>
> static inline bool sk_can_gso(const struct sock *sk)
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 3a49f68..ce5da57 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -4111,6 +4111,9 @@ static unsigned long bpf_xdp_copy(void *dst_buff, const void *src_buff,
>
> /* Only some socketops are supported */
> switch (optname) {
> + case SO_DEBUG:
> + sock_valbool_flag(sk, SOCK_DBG, val);
> + break;
> case SO_RCVBUF:
> sk->sk_userlocks |= SOCK_RCVBUF_LOCK;
> sk->sk_rcvbuf = max_t(int, val * 2, SOCK_MIN_RCVBUF);
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 900e8a9..5ef6daa 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -638,14 +638,6 @@ static int sock_getbindtodevice(struct sock *sk, char __user *optval,
> return ret;
> }
>
> -static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool)
> -{
> - if (valbool)
> - sock_set_flag(sk, bit);
> - else
> - sock_reset_flag(sk, bit);
> -}
> -
> bool sk_mc_loop(struct sock *sk)
> {
> if (dev_recursion_level())
> --
> 1.8.3.1
>
^ permalink raw reply
* Re: [PATCH bpf-next] bpf: support SO_DEBUG in bpf_setsockopt()
From: Lawrence Brakmo @ 2019-02-03 23:37 UTC (permalink / raw)
To: Yafang Shao, Martin Lau, ast@kernel.org, daniel@iogearbox.net
Cc: netdev@vger.kernel.org, shaoyafang@didiglobal.com
In-Reply-To: <1549181707-16864-1-git-send-email-laoar.shao@gmail.com>
On 2/3/19, 12:15 AM, "Yafang Shao" <laoar.shao@gmail.com> wrote:
Then we can enable/disable socket debugging without modifying user code.
That is more convenient for debugging.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Lawrence Brakmo <brakmo@fb.com>
---
include/net/sock.h | 8 ++++++++
net/core/filter.c | 3 +++
net/core/sock.c | 8 --------
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 2b229f7..8decee9 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1935,6 +1935,14 @@ static inline void sock_confirm_neigh(struct sk_buff *skb, struct neighbour *n)
}
}
+static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool)
+{
+ if (valbool)
+ sock_set_flag(sk, bit);
+ else
+ sock_reset_flag(sk, bit);
+}
+
bool sk_mc_loop(struct sock *sk);
static inline bool sk_can_gso(const struct sock *sk)
diff --git a/net/core/filter.c b/net/core/filter.c
index 3a49f68..ce5da57 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -4111,6 +4111,9 @@ static unsigned long bpf_xdp_copy(void *dst_buff, const void *src_buff,
/* Only some socketops are supported */
switch (optname) {
+ case SO_DEBUG:
+ sock_valbool_flag(sk, SOCK_DBG, val);
+ break;
case SO_RCVBUF:
sk->sk_userlocks |= SOCK_RCVBUF_LOCK;
sk->sk_rcvbuf = max_t(int, val * 2, SOCK_MIN_RCVBUF);
diff --git a/net/core/sock.c b/net/core/sock.c
index 900e8a9..5ef6daa 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -638,14 +638,6 @@ static int sock_getbindtodevice(struct sock *sk, char __user *optval,
return ret;
}
-static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool)
-{
- if (valbool)
- sock_set_flag(sk, bit);
- else
- sock_reset_flag(sk, bit);
-}
-
bool sk_mc_loop(struct sock *sk)
{
if (dev_recursion_level())
--
1.8.3.1
^ permalink raw reply
* linux-next: build warning after merge of the net-next tree
From: Stephen Rothwell @ 2019-02-03 23:44 UTC (permalink / raw)
To: David Miller, Networking
Cc: Linux Next Mailing List, Linux Kernel Mailing List,
Deepa Dinamani, Gustavo A. R. Silva, Kees Cook
[-- Attachment #1: Type: text/plain, Size: 801 bytes --]
Hi all,
After merging the net-next tree, today's linux-next build (arm
multi_v7_defconfig) produced this warning:
net/core/sock.c: In function 'sock_setsockopt':
net/core/sock.c:914:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
sock_set_flag(sk, SOCK_TSTAMP_NEW);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/sock.c:915:2: note: here
case SO_TIMESTAMPING_OLD:
^~~~
Introduced by commit
9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
I get this warning because I am building with -Wimplicit-fallthrough
in attempt to catch new additions early. The gcc warning can be turned
off by adding a /* fall through */ comment at the point the fall through
happens (assuming that the fall through is intentional).
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* [PATCH iproute2-next v2] devlink: add info subcommand
From: Jakub Kicinski @ 2019-02-04 0:54 UTC (permalink / raw)
To: jiri, dsahern; +Cc: stephen, netdev, oss-drivers, Jakub Kicinski
Add support for reading the device serial number, driver name
and various versions. Example:
$ devlink dev info pci/0000:05:00.0
pci/0000:05:00.0:
driver nfp
serial_number 16240145
versions:
fixed:
board.id AMDA0099-0001
board.rev 07
board.vendor SMA
board.model carbon
running:
fw.mgmt: 010156.010156.010156
fw.cpld: 0x44
fw.app: sriov-2.1.16
stored:
fw.mgmt: 010158.010158.010158
fw.cpld: 0x44
fw.app: sriov-2.1.20
v2 (Jiri):
- remove filtering;
- add example in the commit message.
RFCv2:
- make info subcommand of dev.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
devlink/devlink.c | 169 +++++++++++++++++++++++++++++++++++++++++
man/man8/devlink-dev.8 | 26 +++++++
2 files changed, 195 insertions(+)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 3651e90c1159..fc4b18d1b613 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -383,6 +383,13 @@ static const enum mnl_attr_data_type devlink_policy[DEVLINK_ATTR_MAX + 1] = {
[DEVLINK_ATTR_REGION_CHUNK_DATA] = MNL_TYPE_BINARY,
[DEVLINK_ATTR_REGION_CHUNK_ADDR] = MNL_TYPE_U64,
[DEVLINK_ATTR_REGION_CHUNK_LEN] = MNL_TYPE_U64,
+ [DEVLINK_ATTR_INFO_DRIVER_NAME] = MNL_TYPE_STRING,
+ [DEVLINK_ATTR_INFO_SERIAL_NUMBER] = MNL_TYPE_STRING,
+ [DEVLINK_ATTR_INFO_VERSION_FIXED] = MNL_TYPE_NESTED,
+ [DEVLINK_ATTR_INFO_VERSION_RUNNING] = MNL_TYPE_NESTED,
+ [DEVLINK_ATTR_INFO_VERSION_STORED] = MNL_TYPE_NESTED,
+ [DEVLINK_ATTR_INFO_VERSION_NAME] = MNL_TYPE_STRING,
+ [DEVLINK_ATTR_INFO_VERSION_VALUE] = MNL_TYPE_STRING,
};
static int attr_cb(const struct nlattr *attr, void *data)
@@ -1443,6 +1450,7 @@ static void cmd_dev_help(void)
pr_err(" devlink dev param set DEV name PARAMETER value VALUE cmode { permanent | driverinit | runtime }\n");
pr_err(" devlink dev param show [DEV name PARAMETER]\n");
pr_err(" devlink dev reload DEV\n");
+ pr_err(" devlink dev info [ DEV ]\n");
}
static bool cmp_arr_last_handle(struct dl *dl, const char *bus_name,
@@ -1775,6 +1783,30 @@ static void pr_out_array_end(struct dl *dl)
}
}
+static void pr_out_object_start(struct dl *dl, const char *name)
+{
+ if (dl->json_output) {
+ jsonw_name(dl->jw, name);
+ jsonw_start_object(dl->jw);
+ } else {
+ __pr_out_indent_inc();
+ __pr_out_newline();
+ pr_out("%s:", name);
+ __pr_out_indent_inc();
+ __pr_out_newline();
+ }
+}
+
+static void pr_out_object_end(struct dl *dl)
+{
+ if (dl->json_output) {
+ jsonw_end_object(dl->jw);
+ } else {
+ __pr_out_indent_dec();
+ __pr_out_indent_dec();
+ }
+}
+
static void pr_out_entry_start(struct dl *dl)
{
if (dl->json_output)
@@ -2415,6 +2447,140 @@ static int cmd_dev_reload(struct dl *dl)
return _mnlg_socket_sndrcv(dl->nlg, nlh, NULL, NULL);
}
+static void pr_out_versions_single(struct dl *dl, const struct nlmsghdr *nlh,
+ const char *name, int type)
+{
+ struct nlattr *version;
+
+ mnl_attr_for_each(version, nlh, sizeof(struct genlmsghdr)) {
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ const char *ver_value;
+ const char *ver_name;
+ int err;
+
+ if (mnl_attr_get_type(version) != type)
+ continue;
+
+ err = mnl_attr_parse_nested(version, attr_cb, tb);
+ if (err != MNL_CB_OK)
+ continue;
+
+ if (!tb[DEVLINK_ATTR_INFO_VERSION_NAME] ||
+ !tb[DEVLINK_ATTR_INFO_VERSION_VALUE])
+ continue;
+
+ if (name) {
+ pr_out_object_start(dl, name);
+ name = NULL;
+ }
+
+ ver_name = mnl_attr_get_str(tb[DEVLINK_ATTR_INFO_VERSION_NAME]);
+ ver_value = mnl_attr_get_str(tb[DEVLINK_ATTR_INFO_VERSION_VALUE]);
+
+ pr_out_str(dl, ver_name, ver_value);
+ if (!dl->json_output)
+ __pr_out_newline();
+ }
+
+ if (!name)
+ pr_out_object_end(dl);
+}
+
+static void pr_out_info(struct dl *dl, const struct nlmsghdr *nlh,
+ struct nlattr **tb, bool has_versions)
+{
+ __pr_out_handle_start(dl, tb, true, false);
+
+ __pr_out_indent_inc();
+ if (tb[DEVLINK_ATTR_INFO_DRIVER_NAME]) {
+ struct nlattr *nla_drv = tb[DEVLINK_ATTR_INFO_DRIVER_NAME];
+
+ __pr_out_newline();
+ pr_out_str(dl, "driver", mnl_attr_get_str(nla_drv));
+ }
+
+ if (tb[DEVLINK_ATTR_INFO_SERIAL_NUMBER]) {
+ struct nlattr *nla_sn = tb[DEVLINK_ATTR_INFO_SERIAL_NUMBER];
+
+ __pr_out_newline();
+ pr_out_str(dl, "serial_number", mnl_attr_get_str(nla_sn));
+ }
+ __pr_out_indent_dec();
+
+ if (has_versions) {
+ pr_out_object_start(dl, "versions");
+
+ pr_out_versions_single(dl, nlh, "fixed",
+ DEVLINK_ATTR_INFO_VERSION_FIXED);
+ pr_out_versions_single(dl, nlh, "running",
+ DEVLINK_ATTR_INFO_VERSION_RUNNING);
+ pr_out_versions_single(dl, nlh, "stored",
+ DEVLINK_ATTR_INFO_VERSION_STORED);
+
+ pr_out_object_end(dl);
+ }
+
+ pr_out_handle_end(dl);
+}
+
+static int cmd_versions_show_cb(const struct nlmsghdr *nlh, void *data)
+{
+ struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ bool has_versions, has_info;
+ struct dl *dl = data;
+
+ mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
+
+ if (!tb[DEVLINK_ATTR_BUS_NAME] || !tb[DEVLINK_ATTR_DEV_NAME])
+ return MNL_CB_ERROR;
+
+ has_versions = tb[DEVLINK_ATTR_INFO_VERSION_FIXED] ||
+ tb[DEVLINK_ATTR_INFO_VERSION_RUNNING] ||
+ tb[DEVLINK_ATTR_INFO_VERSION_STORED];
+ has_info = tb[DEVLINK_ATTR_INFO_DRIVER_NAME] ||
+ tb[DEVLINK_ATTR_INFO_SERIAL_NUMBER] ||
+ has_versions;
+
+ if (has_info)
+ pr_out_info(dl, nlh, tb, has_versions);
+
+ return MNL_CB_OK;
+}
+
+static void cmd_dev_info_help(void)
+{
+ pr_err("Usage: devlink dev info [ DEV ]\n");
+}
+
+static int cmd_dev_info(struct dl *dl)
+{
+ struct nlmsghdr *nlh;
+ uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
+ int err;
+
+ if (dl_argv_match(dl, "help")) {
+ cmd_dev_info_help();
+ return 0;
+ }
+
+ if (dl_argc(dl) == 0)
+ flags |= NLM_F_DUMP;
+
+ nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_INFO_GET, flags);
+
+ if (dl_argc(dl) > 0) {
+ err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE, 0);
+ if (err)
+ return err;
+ }
+
+ pr_out_section_start(dl, "info");
+ err = _mnlg_socket_sndrcv(dl->nlg, nlh, cmd_versions_show_cb, dl);
+ pr_out_section_end(dl);
+ return err;
+}
+
static int cmd_dev(struct dl *dl)
{
if (dl_argv_match(dl, "help")) {
@@ -2433,6 +2599,9 @@ static int cmd_dev(struct dl *dl)
} else if (dl_argv_match(dl, "param")) {
dl_arg_inc(dl);
return cmd_dev_param(dl);
+ } else if (dl_argv_match(dl, "info")) {
+ dl_arg_inc(dl);
+ return cmd_dev_info(dl);
}
pr_err("Command \"%s\" not found\n", dl_argv(dl));
return -ENOENT;
diff --git a/man/man8/devlink-dev.8 b/man/man8/devlink-dev.8
index d985da172aa0..47838371fecd 100644
--- a/man/man8/devlink-dev.8
+++ b/man/man8/devlink-dev.8
@@ -63,6 +63,12 @@ devlink-dev \- devlink device configuration
.BR "devlink dev reload"
.IR DEV
+.ti -8
+.BR "devlink dev info"
+.RI "[ "
+.IR DEV
+.RI "]"
+
.SH "DESCRIPTION"
.SS devlink dev show - display devlink device attributes
@@ -151,6 +157,26 @@ If this argument is omitted all parameters supported by devlink devices are list
.I "DEV"
- Specifies the devlink device to reload.
+.SS devlink dev info - display device information.
+Display device information provided by the driver. This command can be used
+to query versions of the hardware components or device components which
+can't be updated (
+.I fixed
+) as well as device firmware which can be updated. For firmware components
+.I running
+displays the versions of firmware currently loaded into the device, while
+.I stored
+reports the versions in device's flash.
+.I Running
+and
+.I stored
+versions may differ after flash has been updated, but before reboot.
+
+.PP
+.I "DEV"
+- specifies the devlink device to show.
+If this argument is omitted all devices are listed.
+
.SH "EXAMPLES"
.PP
devlink dev show
--
2.20.1
^ permalink raw reply related
* [PATCH iproute2-next] devlink: report cell size
From: Jakub Kicinski @ 2019-02-04 1:39 UTC (permalink / raw)
To: idosch, jiri, dsahern; +Cc: stephen, oss-drivers, netdev, Jakub Kicinski
Print the value of DEVLINK_ATTR_SB_POOL_CELL_SIZE, if reported.
Example:
pci/0000:82:00.0:
sb 1 pool 0 type egress size 40945664 thtype static cell_size 2048
sb 2 pool 0 type egress size 258867200 thtype static cell_size 10240
...
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
---
devlink/devlink.c | 3 +++
man/man8/devlink-sb.8 | 10 ++++++++++
2 files changed, 13 insertions(+)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index fc4b18d1b613..40f6105af109 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -2891,6 +2891,9 @@ static void pr_out_sb_pool(struct dl *dl, struct nlattr **tb)
mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_POOL_SIZE]));
pr_out_str(dl, "thtype",
threshold_type_name(mnl_attr_get_u8(tb[DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE])));
+ if (tb[DEVLINK_ATTR_SB_POOL_CELL_SIZE])
+ pr_out_uint(dl, "cell_size",
+ mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_POOL_CELL_SIZE]));
pr_out_handle_end(dl);
}
diff --git a/man/man8/devlink-sb.8 b/man/man8/devlink-sb.8
index 1882833a3fa7..767c932dd4c1 100644
--- a/man/man8/devlink-sb.8
+++ b/man/man8/devlink-sb.8
@@ -128,6 +128,16 @@ Behaviour of this argument it the same for every command.
- specifies the devlink device to show pools.
If this argument is omitted all pools of all devices are listed.
+Display available pools listing their
+.B type, size, thtype
+and
+.B cell_size. cell_size
+is the allocation granularity of memory within the shared buffer. Drivers
+may round up, round down or reject
+.B size
+passed to the set command if its not multiple of
+.B cell_size.
+
.SS devlink sb pool set - set attributes of pool
.PP
--
2.19.2
^ permalink raw reply related
* Re: [Patch net-next] net_sched: add performance counters for basic filter
From: Eric Dumazet @ 2019-02-04 3:27 UTC (permalink / raw)
To: Cong Wang; +Cc: Linux Kernel Network Developers, Jamal Hadi Salim, Jiri Pirko
In-Reply-To: <CAM_iQpX2zTa0E9sJkhyyq3_1NmdqhPXfk8L=skU6TfKTwvBYhg@mail.gmail.com>
On 02/03/2019 11:35 AM, Cong Wang wrote:
> On Sun, Feb 3, 2019 at 10:35 AM Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>> + for_each_possible_cpu(cpu) {
>>> + struct tc_basic_pcnt *pf = per_cpu_ptr(f->pf, cpu);
>>> +
>>> + gpf.rcnt += pf->rcnt;
>>> + gpf.rhit += pf->rhit;
>>> + }
>>>
>> This looks missing some synchronization of some sort for 32bit kernels ?
>
> I don't know, u32 filter has literally same code:
>
> for_each_possible_cpu(cpu) {
> int i;
> struct tc_u32_pcnt *pf = per_cpu_ptr(n->pf, cpu);
>
> gpf->rcnt += pf->rcnt;
> gpf->rhit += pf->rhit;
> for (i = 0; i < n->sel.nkeys; i++)
> gpf->kcnts[i] += pf->kcnts[i];
> }
>
> which has been there for years...
>
Then u32 (or at least CONFIG_CLS_U32_PERF) was also broken.
^ permalink raw reply
* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
From: David Miller @ 2019-02-04 4:13 UTC (permalink / raw)
To: yamada.masahiro
Cc: ast, daniel, netdev, mcroce, linux-kernel, jakub.kicinski,
labbott, ast, yuehaibing
In-Reply-To: <1548904535-9853-1-git-send-email-yamada.masahiro@socionext.com>
From: Masahiro Yamada <yamada.masahiro@socionext.com>
Date: Thu, 31 Jan 2019 12:15:35 +0900
> Currently, the header search paths -Itools/include and
> -Itools/include/uapi are not used. Let's drop the unused code.
>
> We can remove -I. too by fixing up one C file.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
I guess I'm ok with this, applied to net-next.
Thanks for explaining things.
^ permalink raw reply
* Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames
From: David Miller @ 2019-02-04 4:18 UTC (permalink / raw)
To: makita.toshiaki; +Cc: mst, jasowang, netdev, virtualization, dsahern
In-Reply-To: <1548934830-2389-1-git-send-email-makita.toshiaki@lab.ntt.co.jp>
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Thu, 31 Jan 2019 20:40:30 +0900
> Previously virtnet_xdp_xmit() did not account for device tx counters,
> which caused confusions.
> To be consistent with SKBs, account them on freeing xdp_frames.
>
> Reported-by: David Ahern <dsahern@gmail.com>
> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Applied, thank you.
^ permalink raw reply
* Re: linux-next: build warning after merge of the net-next tree
From: David Miller @ 2019-02-04 4:26 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, deepa.kernel, gustavo, keescook
In-Reply-To: <20190204104427.0c0da12d@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 4 Feb 2019 10:44:27 +1100
> After merging the net-next tree, today's linux-next build (arm
> multi_v7_defconfig) produced this warning:
>
> net/core/sock.c: In function 'sock_setsockopt':
> net/core/sock.c:914:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> sock_set_flag(sk, SOCK_TSTAMP_NEW);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> net/core/sock.c:915:2: note: here
> case SO_TIMESTAMPING_OLD:
> ^~~~
>
> Introduced by commit
>
> 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
Thanks, I just pushed the following:
====================
[PATCH] net: Fix fall through warning in y2038 tstamp changes.
net/core/sock.c: In function 'sock_setsockopt':
net/core/sock.c:914:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
sock_set_flag(sk, SOCK_TSTAMP_NEW);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/sock.c:915:2: note: here
case SO_TIMESTAMPING_OLD:
^~~~
Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/core/sock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/sock.c b/net/core/sock.c
index a8904ae40713..71ded4d8025c 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -912,6 +912,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
case SO_TIMESTAMPING_NEW:
sock_set_flag(sk, SOCK_TSTAMP_NEW);
+ /* fall through */
case SO_TIMESTAMPING_OLD:
if (val & ~SOF_TIMESTAMPING_MASK) {
ret = -EINVAL;
--
2.20.1
^ permalink raw reply related
* Re: [PATCH] netdevice.h: Add __cold to netdev_<level> logging functions
From: David Miller @ 2019-02-04 4:28 UTC (permalink / raw)
To: joe; +Cc: netdev, linux-kernel
In-Reply-To: <bf397da97e7ed127a838126bb6600a82d63f32f9.camel@perches.com>
From: Joe Perches <joe@perches.com>
Date: Sat, 02 Feb 2019 19:47:25 -0800
> Add __cold to the netdev_<level> logging functions similar to
> the use of __cold in the generic printk function.
>
> Using __cold moves all the netdev_<level> logging functions
> out-of-line possibly improving code locality and runtime
> performance.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Sure, let's give this a try.
I'll push this out to net-next when my build testing completes.
Thanks.
^ permalink raw reply
* Re: linux-next: build warning after merge of the net-next tree
From: Stephen Rothwell @ 2019-02-04 4:32 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-next, linux-kernel, deepa.kernel, gustavo, keescook
In-Reply-To: <20190203.202606.1052226767975507689.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]
Hi Dave,
On Sun, 03 Feb 2019 20:26:06 -0800 (PST) David Miller <davem@davemloft.net> wrote:
>
> Thanks, I just pushed the following:
>
> ====================
> [PATCH] net: Fix fall through warning in y2038 tstamp changes.
>
> net/core/sock.c: In function 'sock_setsockopt':
> net/core/sock.c:914:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> sock_set_flag(sk, SOCK_TSTAMP_NEW);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> net/core/sock.c:915:2: note: here
> case SO_TIMESTAMPING_OLD:
> ^~~~
>
> Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> net/core/sock.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/core/sock.c b/net/core/sock.c
> index a8904ae40713..71ded4d8025c 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -912,6 +912,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
>
> case SO_TIMESTAMPING_NEW:
> sock_set_flag(sk, SOCK_TSTAMP_NEW);
> + /* fall through */
> case SO_TIMESTAMPING_OLD:
> if (val & ~SOF_TIMESTAMPING_MASK) {
> ret = -EINVAL;
Looks good, thanks.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* linux-next: build failure after merge of the net-next tree
From: Stephen Rothwell @ 2019-02-04 4:34 UTC (permalink / raw)
To: David Miller, Networking
Cc: Linux Next Mailing List, Linux Kernel Mailing List,
Deepa Dinamani
[-- Attachment #1: Type: text/plain, Size: 1786 bytes --]
Hi all,
After merging the net-next tree, today's linux-next build (sparc64
defconfig) failed like this:
/home/sfr/next/next/net/core/sock.c: In function 'sock_setsockopt':
/home/sfr/next/next/net/core/sock.c:1146:2: error: duplicate case value
case SO_BINDTOIFINDEX:
^~~~
/home/sfr/next/next/net/core/sock.c:891:2: note: previously used here
case SO_TIMESTAMP_NEW:
^~~~
/home/sfr/next/next/net/core/sock.c: In function 'sock_getsockopt':
/home/sfr/next/next/net/core/sock.c:1493:2: error: duplicate case value
case SO_BINDTOIFINDEX:
^~~~
/home/sfr/next/next/net/core/sock.c:1293:2: note: previously used here
case SO_TIMESTAMP_NEW:
^~~~
Caused by commit
887feae36aee ("socket: Add SO_TIMESTAMP[NS]_NEW")
I applied the following fix patch (I just update the clashing id rather
than update them all, but the latter may be better).
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 4 Feb 2019 15:24:11 +1100
Subject: [PATCH] socket: fix for Add SO_TIMESTAMP[NS]_NEW
Fixes: 887feae36aee ("socket: Add SO_TIMESTAMP[NS]_NEW")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/sparc/include/uapi/asm/socket.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index 8c9f74a66b55..88fe4f978aca 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -108,7 +108,7 @@
#define SO_TIMESTAMPNS_OLD 0x0021
#define SO_TIMESTAMPING_OLD 0x0023
-#define SO_TIMESTAMP_NEW 0x0041
+#define SO_TIMESTAMP_NEW 0x0046
#define SO_TIMESTAMPNS_NEW 0x0042
#define SO_TIMESTAMPING_NEW 0x0043
--
2.20.1
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related
* Re: linux-next: build failure after merge of the net-next tree
From: David Miller @ 2019-02-04 4:36 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, deepa.kernel
In-Reply-To: <20190204153446.03ffb5e4@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 4 Feb 2019 15:34:46 +1100
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 4 Feb 2019 15:24:11 +1100
> Subject: [PATCH] socket: fix for Add SO_TIMESTAMP[NS]_NEW
>
> Fixes: 887feae36aee ("socket: Add SO_TIMESTAMP[NS]_NEW")
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Thanks for fixing this.
Applied.
^ permalink raw reply
* Re: general protection fault in rose_send_frame
From: syzbot @ 2019-02-04 5:43 UTC (permalink / raw)
To: davem, linux-hams, linux-kernel, netdev, ralf, syzkaller-bugs
In-Reply-To: <00000000000089904d057f1e0ae0@google.com>
syzbot has found a reproducer for the following crash on:
HEAD commit: 9fb20801dab4 net: Fix ip_mc_{dec,inc}_group allocation con..
git tree: net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17530a0f400000
kernel config: https://syzkaller.appspot.com/x/.config?x=33ad02b9305759c3
dashboard link: https://syzkaller.appspot.com/bug?extid=7078ae989d857fe17988
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=148b35f8c00000
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+7078ae989d857fe17988@syzkaller.appspotmail.com
8021q: adding VLAN 0 to HW filter on device batadv0
device rose0 entered promiscuous mode
IPv6: ADDRCONF(NETDEV_CHANGE): rose0: link becomes ready
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 7801 Comm: udevd Not tainted 5.0.0-rc4+ #44
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:rose_send_frame+0x1a8/0x280 net/rose/rose_link.c:104
Code: c1 ea 03 80 3c 02 00 0f 85 8d 00 00 00 48 b8 00 00 00 00 00 fc ff df
4c 8b 63 20 49 8d bc 24 58 03 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75
7e 49 8b 94 24 58 03 00 00 e9 b8 fe ff ff e8 60 cd
RSP: 0000:ffff8880ae907ae8 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff88809a954500 RCX: ffffffff86360ccb
RDX: 000000000000006b RSI: ffffffff86360dfc RDI: 0000000000000358
RBP: ffff8880ae907b18 R08: ffff888094b50080 R09: ffffed10146ad41d
R10: ffffed10146ad41c R11: ffff8880a356a0e3 R12: 0000000000000000
R13: 0000000000000078 R14: 0000000000000005 R15: ffff8880a886acc0
FS: 00007f75710e57a0(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7570790590 CR3: 000000009fb95000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<IRQ>
rose_transmit_clear_request+0x1de/0x2a0 net/rose/rose_link.c:258
rose_rx_call_request+0x4ea/0x1990 net/rose/af_rose.c:999
rose_loopback_timer+0x26a/0x3f0 net/rose/rose_loopback.c:100
call_timer_fn+0x190/0x720 kernel/time/timer.c:1325
expire_timers kernel/time/timer.c:1362 [inline]
__run_timers kernel/time/timer.c:1681 [inline]
__run_timers kernel/time/timer.c:1649 [inline]
run_timer_softirq+0x652/0x1700 kernel/time/timer.c:1694
__do_softirq+0x266/0x95a kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x180/0x1d0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x14a/0x570 arch/x86/kernel/apic/apic.c:1062
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
</IRQ>
RIP: 0010:__sanitizer_cov_trace_const_cmp1+0x1/0x20 kernel/kcov.c:174
Code: c3 0f 1f 84 00 00 00 00 00 55 48 89 f2 48 89 fe bf 06 00 00 00 48 89
e5 48 8b 4d 08 e8 18 ff ff ff 5d c3 66 0f 1f 44 00 00 55 <40> 0f b6 d6 40
0f b6 f7 bf 01 00 00 00 48 89 e5 48 8b 4d 08 e8 f6
RSP: 0000:ffff8880a806fb90 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: ffff888094b50080 RBX: ffff8880a806fca8 RCX: ffffffff818a7cde
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff8880a806fcd0 R08: ffff888094b50080 R09: 0000000000000004
R10: ffffed1015d25bc7 R11: ffff8880ae92de3b R12: ffffea000025f980
R13: ffff88809b8a87b8 R14: 0000000000000001 R15: 0000000000000084
do_fault_around mm/memory.c:3391 [inline]
do_read_fault mm/memory.c:3425 [inline]
do_fault mm/memory.c:3556 [inline]
handle_pte_fault mm/memory.c:3787 [inline]
__handle_mm_fault+0x3226/0x3f20 mm/memory.c:3911
handle_mm_fault+0x43f/0xb30 mm/memory.c:3948
do_user_addr_fault arch/x86/mm/fault.c:1475 [inline]
__do_page_fault+0x5da/0xd60 arch/x86/mm/fault.c:1541
do_page_fault+0x71/0x581 arch/x86/mm/fault.c:1572
page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1143
RIP: 0033:0x7f7570790590
Code: 00 74 0f f0 ff 0d ac 41 31 00 0f 85 d3 6b 00 00 eb 0c ff 0d 9e 41 31
00 0f 85 c5 6b 00 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 <8b> 0d 4e 1b 31
00 85 c9 7e 6c 48 8b 15 97 41 31 00 48 8b 05 78 17
RSP: 002b:00007ffec2e21978 EFLAGS: 00010206
RAX: 00007f7570aa4740 RBX: 00007ffec2e219a0 RCX: 00007f75705162a0
RDX: 00007f7570790590 RSI: 00007f7570512240 RDI: 00007f7570aa26c0
RBP: 00007ffec2e219e0 R08: 0000000000001ce4 R09: 0000000000001ce4
R10: 00007f7570512240 R11: 00007f75710e57a0 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f75710f0040 R15: 0000000000000005
Modules linked in:
---[ end trace 19f243a97b44aa5b ]---
RIP: 0010:rose_send_frame+0x1a8/0x280 net/rose/rose_link.c:104
Code: c1 ea 03 80 3c 02 00 0f 85 8d 00 00 00 48 b8 00 00 00 00 00 fc ff df
4c 8b 63 20 49 8d bc 24 58 03 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75
7e 49 8b 94 24 58 03 00 00 e9 b8 fe ff ff e8 60 cd
RSP: 0000:ffff8880ae907ae8 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff88809a954500 RCX: ffffffff86360ccb
RDX: 000000000000006b RSI: ffffffff86360dfc RDI: 0000000000000358
RBP: ffff8880ae907b18 R08: ffff888094b50080 R09: ffffed10146ad41d
R10: ffffed10146ad41c R11: ffff8880a356a0e3 R12: 0000000000000000
R13: 0000000000000078 R14: 0000000000000005 R15: ffff8880a886acc0
FS: 00007f75710e57a0(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7570790590 CR3: 000000009fb95000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
^ permalink raw reply
* Re: [PATCH net-next V2 1/1] openvswitch: Declare ovs key structures using macros
From: Pravin Shelar @ 2019-02-04 5:55 UTC (permalink / raw)
To: Linux Kernel Network Developers
In-Reply-To: <20190203091217.8459-1-elibr@mellanox.com>
On Sun, Feb 3, 2019 at 1:12 AM Eli Britstein <elibr@mellanox.com> wrote:
>
> Declare ovs key structures using macros as a pre-step towards to
> enable retrieving fields information, as a work done in proposed
> commit in the OVS tree https://patchwork.ozlabs.org/patch/1023406/
> ("odp-util: Do not rewrite fields with the same values as matched"),
> with no functional change.
>
> Signed-off-by: Eli Britstein <elibr@mellanox.com>
> Reviewed-by: Roi Dayan <roid@mellanox.com>
Thanks.
Acked-by: Pravin B Shelar <pshelar@ovn.org>
^ permalink raw reply
* Re: [PATCH net-next v7 0/8] devlink: Add configuration parameters support for devlink_port
From: Vasundhara Volam @ 2019-02-04 6:55 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Michal Kubecek, Netdev, David Miller, michael.chan@broadcom.com,
Jiri Pirko
In-Reply-To: <20190122141842.26908b27@cakuba.netronome.com>
On Wed, Jan 23, 2019 at 3:48 AM Jakub Kicinski
<jakub.kicinski@netronome.com> wrote:
>
> On Fri, 18 Jan 2019 15:33:19 +0100, Michal Kubecek wrote:
> > On Fri, Jan 18, 2019 at 12:39:37PM +0530, Vasundhara Volam wrote:
> > > There is difference of opinion on adding WOL parameter to devlink, between
> > > Jakub Kicinski and Michael Chan.
> > >
> > > Quote from Jakud Kicinski:
> > > ********
> > > As explained previously I think it's a very bad idea to add existing
> > > configuration options to devlink, just because devlink has the ability
> > > to persist the setting in NVM. Especially that for WoL you have to get
> > > the link up so you potentially have all link config stuff as well. And
> > > that n-tuple filters are one of the WoL options, meaning we'd need the
> > > ability to persist n-tuple filters via devlink.
> > >
> > > The effort would be far better spent helping with migrating ethtool to
> > > netlink, and allowing persisting there.
> > >
> > > I have not heard any reason why devlink is a better fit. I can imagine
> > > you're just doing it here because it's less effort for you since
> > > ethtool is not yet migrated.
> > > ********
> > >
> > > Quote from Michael Chan:
> > > ********
> > > The devlink's WoL parameter is a persistent WoL parameter stored in the
> > > NIC's NVRAM. It is different from ethtool's WoL parameter in a number of
> > > ways. ethtool WoL is not persistent over AC power cycle and is considered
> > > OS-present WoL. As such, ethtool WoL can use a more sophisticated pattern
> > > including n-tuple with IP address in addition to the more basic types
> > > (e.g. magic packet). Whereas OS-absent power up WoL should only include
> > > magic packet and other simple types.
> >
> > If I understand correctly, it's that way now. I'm not sure there is a
> > technical reason preventing more complex WoL types in the OS-absent case
> > in the future. Also, even with traditional ethtool WoL setting, most
> > NICs only support some of the types (I'm not sure if there is a NIC
> > which would support all of them.)
> >
> > > The devlink WoL setting does not have to match the ethtool WoL
> > > setting.
> >
> > IMHO this is not really a problem. We can either use an additional flag
> > telling kernel/driver if we are setting runtime or persistent WoL mask
> > or we can pass (up to) two bitmaps.
Jakub, I will add another two bitmask parameters for WoL named as
wake_on_lan_runtime
and wake_on_lan_persistent. This will give information about what
types are runtime and
what types are persistent, does the device support for any given WoL types.
Does that sound good?
>
> I think reusing new netlink ethtool with a special flag would be a nice,
> complete solution. We could also address link settings this way (which
> are a pre-requisite for WoL).
>
> I have no strong preference on the mechanism, but for ease of setting
> as well as dumping would it be workable to use a nesting, like this:
>
> Run time settings:
> [ETHTOOL_SETTINGS_BLA]
> [ETHTOOL_BLA_VAL_1]
> [ETHTOOL_BLA_VAL_2]
> ...
>
> Persistent:
> [ETHTOOL_PERSISTENT]
> [ETHTOOL_SETTINGS_BLA]
> [ETHTOOL_BLA_VAL_1]
> [ETHTOOL_BLA_VAL_2]
>
> IOW encapsulate settings into a "persistent" attribute?
>
> How does that look to you, Michal?
>
> > > The card will autoneg up to the speed supported by Vaux so no special
> > > devlink link setting is needed.
> > > ********
> >
> > Like Jakub, I'm not convinced there is a strong technical reason to have
> > each of the WoL settings handled through a different interface. I don't
> > say, though, that ethtool is necessarily the right one. If there is
> > a consensus that it better fits into devlink, I can imagine that both
> > could be accessible through devlink (for start, in drivers which choose
> > so, e.g. because they want to implement the persistent setting).
> >
> > Michal Kubecek
^ permalink raw reply
* Re: [PATCH iproute2-next v2] devlink: add info subcommand
From: Jiri Pirko @ 2019-02-04 7:10 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: dsahern, stephen, netdev, oss-drivers
In-Reply-To: <20190204005456.22912-1-jakub.kicinski@netronome.com>
Mon, Feb 04, 2019 at 01:54:56AM CET, jakub.kicinski@netronome.com wrote:
>Add support for reading the device serial number, driver name
>and various versions. Example:
>
>$ devlink dev info pci/0000:05:00.0
>pci/0000:05:00.0:
> driver nfp
> serial_number 16240145
> versions:
> fixed:
> board.id AMDA0099-0001
> board.rev 07
> board.vendor SMA
> board.model carbon
> running:
> fw.mgmt: 010156.010156.010156
Sometimes you have "x: y" and sometimes you have "x y". Please be
consistent.
Please also include json output here.
Thanks!
> fw.cpld: 0x44
> fw.app: sriov-2.1.16
> stored:
> fw.mgmt: 010158.010158.010158
> fw.cpld: 0x44
> fw.app: sriov-2.1.20
>
>v2 (Jiri):
> - remove filtering;
> - add example in the commit message.
>RFCv2:
> - make info subcommand of dev.
>
[...]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox