* [PATCH net-next 2/3] net: dsa: mv88e6xxx: rename PHY PPU accessors
From: Vivien Didelot @ 2017-05-26 22:03 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
Andrew Lunn, Vivien Didelot
In-Reply-To: <20170526220307.23503-1-vivien.didelot@savoirfairelinux.com>
Make it clear that mv88e6xxx_phy_ppu_{read,write} are an implementation
of the .phy_{read,write} operations, by renaming them with the mv88e6185
prefix, since 88E6185 it is the reference switch model supported in an
upstream board (ZII Dev Rev B), which makes use of them.
Distinguish the signatures of implementation specific and generic PHY
functions in the phy.h header.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 16 ++++++++--------
drivers/net/dsa/mv88e6xxx/phy.c | 4 ++--
drivers/net/dsa/mv88e6xxx/phy.h | 11 +++++++----
3 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 7f5f44f89389..070e82ac6132 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2371,8 +2371,8 @@ static int mv88e6xxx_set_eeprom(struct dsa_switch *ds,
static const struct mv88e6xxx_ops mv88e6085_ops = {
/* MV88E6XXX_FAMILY_6097 */
.set_switch_mac = mv88e6xxx_g1_set_switch_mac,
- .phy_read = mv88e6xxx_phy_ppu_read,
- .phy_write = mv88e6xxx_phy_ppu_write,
+ .phy_read = mv88e6185_phy_ppu_read,
+ .phy_write = mv88e6185_phy_ppu_write,
.port_set_link = mv88e6xxx_port_set_link,
.port_set_duplex = mv88e6xxx_port_set_duplex,
.port_set_speed = mv88e6185_port_set_speed,
@@ -2402,8 +2402,8 @@ static const struct mv88e6xxx_ops mv88e6085_ops = {
static const struct mv88e6xxx_ops mv88e6095_ops = {
/* MV88E6XXX_FAMILY_6095 */
.set_switch_mac = mv88e6xxx_g1_set_switch_mac,
- .phy_read = mv88e6xxx_phy_ppu_read,
- .phy_write = mv88e6xxx_phy_ppu_write,
+ .phy_read = mv88e6185_phy_ppu_read,
+ .phy_write = mv88e6185_phy_ppu_write,
.port_set_link = mv88e6xxx_port_set_link,
.port_set_duplex = mv88e6xxx_port_set_duplex,
.port_set_speed = mv88e6185_port_set_speed,
@@ -2480,8 +2480,8 @@ static const struct mv88e6xxx_ops mv88e6123_ops = {
static const struct mv88e6xxx_ops mv88e6131_ops = {
/* MV88E6XXX_FAMILY_6185 */
.set_switch_mac = mv88e6xxx_g1_set_switch_mac,
- .phy_read = mv88e6xxx_phy_ppu_read,
- .phy_write = mv88e6xxx_phy_ppu_write,
+ .phy_read = mv88e6185_phy_ppu_read,
+ .phy_write = mv88e6185_phy_ppu_write,
.port_set_link = mv88e6xxx_port_set_link,
.port_set_duplex = mv88e6xxx_port_set_duplex,
.port_set_speed = mv88e6185_port_set_speed,
@@ -2727,8 +2727,8 @@ static const struct mv88e6xxx_ops mv88e6176_ops = {
static const struct mv88e6xxx_ops mv88e6185_ops = {
/* MV88E6XXX_FAMILY_6185 */
.set_switch_mac = mv88e6xxx_g1_set_switch_mac,
- .phy_read = mv88e6xxx_phy_ppu_read,
- .phy_write = mv88e6xxx_phy_ppu_write,
+ .phy_read = mv88e6185_phy_ppu_read,
+ .phy_write = mv88e6185_phy_ppu_write,
.port_set_link = mv88e6xxx_port_set_link,
.port_set_duplex = mv88e6xxx_port_set_duplex,
.port_set_speed = mv88e6185_port_set_speed,
diff --git a/drivers/net/dsa/mv88e6xxx/phy.c b/drivers/net/dsa/mv88e6xxx/phy.c
index b865b1e2b103..19e0128257e5 100644
--- a/drivers/net/dsa/mv88e6xxx/phy.c
+++ b/drivers/net/dsa/mv88e6xxx/phy.c
@@ -202,7 +202,7 @@ static void mv88e6xxx_ppu_state_destroy(struct mv88e6xxx_chip *chip)
del_timer_sync(&chip->ppu_timer);
}
-int mv88e6xxx_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
+int mv88e6185_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
int addr, int reg, u16 *val)
{
int err;
@@ -216,7 +216,7 @@ int mv88e6xxx_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
return err;
}
-int mv88e6xxx_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
+int mv88e6185_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
int addr, int reg, u16 val)
{
int err;
diff --git a/drivers/net/dsa/mv88e6xxx/phy.h b/drivers/net/dsa/mv88e6xxx/phy.h
index dfa98549dfcd..91fe3c3e9aea 100644
--- a/drivers/net/dsa/mv88e6xxx/phy.h
+++ b/drivers/net/dsa/mv88e6xxx/phy.h
@@ -14,10 +14,17 @@
#ifndef _MV88E6XXX_PHY_H
#define _MV88E6XXX_PHY_H
+/* PHY Registers accesses implementations */
int mv88e6165_phy_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
int addr, int reg, u16 *val);
int mv88e6165_phy_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
int addr, int reg, u16 val);
+int mv88e6185_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
+ int addr, int reg, u16 *val);
+int mv88e6185_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
+ int addr, int reg, u16 val);
+
+/* Generic PHY operations */
int mv88e6xxx_phy_read(struct mv88e6xxx_chip *chip, int phy,
int reg, u16 *val);
int mv88e6xxx_phy_write(struct mv88e6xxx_chip *chip, int phy,
@@ -26,10 +33,6 @@ int mv88e6xxx_phy_page_read(struct mv88e6xxx_chip *chip, int phy,
u8 page, int reg, u16 *val);
int mv88e6xxx_phy_page_write(struct mv88e6xxx_chip *chip, int phy,
u8 page, int reg, u16 val);
-int mv88e6xxx_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
- int addr, int reg, u16 *val);
-int mv88e6xxx_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
- int addr, int reg, u16 val);
void mv88e6xxx_phy_init(struct mv88e6xxx_chip *chip);
void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip);
int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip);
--
2.13.0
^ permalink raw reply related
* [PATCH net-next 3/3] net: dsa: mv88e6xxx: rename PHY PPU functions
From: Vivien Didelot @ 2017-05-26 22:03 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
Andrew Lunn, Vivien Didelot
In-Reply-To: <20170526220307.23503-1-vivien.didelot@savoirfairelinux.com>
Respect the implicit naming convention used in all register sets
specific files, by renaming the mv88e6xxx_ppu_* functions with the
mv88e6xxx_phy_* prefix.
This is simply a s/xxx_ppu/xxx_phy_ppu/ substitution.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/phy.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/phy.c b/drivers/net/dsa/mv88e6xxx/phy.c
index 19e0128257e5..d47a6e08d88c 100644
--- a/drivers/net/dsa/mv88e6xxx/phy.c
+++ b/drivers/net/dsa/mv88e6xxx/phy.c
@@ -116,7 +116,7 @@ int mv88e6xxx_phy_page_write(struct mv88e6xxx_chip *chip, int phy,
return err;
}
-static int mv88e6xxx_ppu_disable(struct mv88e6xxx_chip *chip)
+static int mv88e6xxx_phy_ppu_disable(struct mv88e6xxx_chip *chip)
{
if (!chip->info->ops->ppu_disable)
return 0;
@@ -124,7 +124,7 @@ static int mv88e6xxx_ppu_disable(struct mv88e6xxx_chip *chip)
return chip->info->ops->ppu_disable(chip);
}
-static int mv88e6xxx_ppu_enable(struct mv88e6xxx_chip *chip)
+static int mv88e6xxx_phy_ppu_enable(struct mv88e6xxx_chip *chip)
{
if (!chip->info->ops->ppu_enable)
return 0;
@@ -132,7 +132,7 @@ static int mv88e6xxx_ppu_enable(struct mv88e6xxx_chip *chip)
return chip->info->ops->ppu_enable(chip);
}
-static void mv88e6xxx_ppu_reenable_work(struct work_struct *ugly)
+static void mv88e6xxx_phy_ppu_reenable_work(struct work_struct *ugly)
{
struct mv88e6xxx_chip *chip;
@@ -141,7 +141,7 @@ static void mv88e6xxx_ppu_reenable_work(struct work_struct *ugly)
mutex_lock(&chip->reg_lock);
if (mutex_trylock(&chip->ppu_mutex)) {
- if (mv88e6xxx_ppu_enable(chip) == 0)
+ if (mv88e6xxx_phy_ppu_enable(chip) == 0)
chip->ppu_disabled = 0;
mutex_unlock(&chip->ppu_mutex);
}
@@ -149,14 +149,14 @@ static void mv88e6xxx_ppu_reenable_work(struct work_struct *ugly)
mutex_unlock(&chip->reg_lock);
}
-static void mv88e6xxx_ppu_reenable_timer(unsigned long _ps)
+static void mv88e6xxx_phy_ppu_reenable_timer(unsigned long _ps)
{
struct mv88e6xxx_chip *chip = (void *)_ps;
schedule_work(&chip->ppu_work);
}
-static int mv88e6xxx_ppu_access_get(struct mv88e6xxx_chip *chip)
+static int mv88e6xxx_phy_ppu_access_get(struct mv88e6xxx_chip *chip)
{
int ret;
@@ -168,7 +168,7 @@ static int mv88e6xxx_ppu_access_get(struct mv88e6xxx_chip *chip)
* it.
*/
if (!chip->ppu_disabled) {
- ret = mv88e6xxx_ppu_disable(chip);
+ ret = mv88e6xxx_phy_ppu_disable(chip);
if (ret < 0) {
mutex_unlock(&chip->ppu_mutex);
return ret;
@@ -182,22 +182,22 @@ static int mv88e6xxx_ppu_access_get(struct mv88e6xxx_chip *chip)
return ret;
}
-static void mv88e6xxx_ppu_access_put(struct mv88e6xxx_chip *chip)
+static void mv88e6xxx_phy_ppu_access_put(struct mv88e6xxx_chip *chip)
{
/* Schedule a timer to re-enable the PHY polling unit. */
mod_timer(&chip->ppu_timer, jiffies + msecs_to_jiffies(10));
mutex_unlock(&chip->ppu_mutex);
}
-static void mv88e6xxx_ppu_state_init(struct mv88e6xxx_chip *chip)
+static void mv88e6xxx_phy_ppu_state_init(struct mv88e6xxx_chip *chip)
{
mutex_init(&chip->ppu_mutex);
- INIT_WORK(&chip->ppu_work, mv88e6xxx_ppu_reenable_work);
- setup_timer(&chip->ppu_timer, mv88e6xxx_ppu_reenable_timer,
+ INIT_WORK(&chip->ppu_work, mv88e6xxx_phy_ppu_reenable_work);
+ setup_timer(&chip->ppu_timer, mv88e6xxx_phy_ppu_reenable_timer,
(unsigned long)chip);
}
-static void mv88e6xxx_ppu_state_destroy(struct mv88e6xxx_chip *chip)
+static void mv88e6xxx_phy_ppu_state_destroy(struct mv88e6xxx_chip *chip)
{
del_timer_sync(&chip->ppu_timer);
}
@@ -207,10 +207,10 @@ int mv88e6185_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
{
int err;
- err = mv88e6xxx_ppu_access_get(chip);
+ err = mv88e6xxx_phy_ppu_access_get(chip);
if (!err) {
err = mv88e6xxx_read(chip, addr, reg, val);
- mv88e6xxx_ppu_access_put(chip);
+ mv88e6xxx_phy_ppu_access_put(chip);
}
return err;
@@ -221,10 +221,10 @@ int mv88e6185_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
{
int err;
- err = mv88e6xxx_ppu_access_get(chip);
+ err = mv88e6xxx_phy_ppu_access_get(chip);
if (!err) {
err = mv88e6xxx_write(chip, addr, reg, val);
- mv88e6xxx_ppu_access_put(chip);
+ mv88e6xxx_phy_ppu_access_put(chip);
}
return err;
@@ -233,16 +233,16 @@ int mv88e6185_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
void mv88e6xxx_phy_init(struct mv88e6xxx_chip *chip)
{
if (chip->info->ops->ppu_enable && chip->info->ops->ppu_disable)
- mv88e6xxx_ppu_state_init(chip);
+ mv88e6xxx_phy_ppu_state_init(chip);
}
void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip)
{
if (chip->info->ops->ppu_enable && chip->info->ops->ppu_disable)
- mv88e6xxx_ppu_state_destroy(chip);
+ mv88e6xxx_phy_ppu_state_destroy(chip);
}
int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip)
{
- return mv88e6xxx_ppu_enable(chip);
+ return mv88e6xxx_phy_ppu_enable(chip);
}
--
2.13.0
^ permalink raw reply related
* [PATCH net-next 1/3] net: dsa: mv88e6xxx: provide a PHY setup helper
From: Vivien Didelot @ 2017-05-26 22:03 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
Andrew Lunn, Vivien Didelot
In-Reply-To: <20170526220307.23503-1-vivien.didelot@savoirfairelinux.com>
Similarly to the VTU, PVT and ATU setup, provide a mv88e6xxx_phy_setup
helper which wraps mv88e6xxx_ppu_enable, so that no more PPU-related
functions are exposed outside of phy.c.
Thus make mv88e6xxx_ppu_enable static.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 11 ++++-------
drivers/net/dsa/mv88e6xxx/phy.c | 7 ++++++-
drivers/net/dsa/mv88e6xxx/phy.h | 2 +-
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 742c0eae7fa3..7f5f44f89389 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2034,13 +2034,6 @@ static int mv88e6xxx_g1_setup(struct mv88e6xxx_chip *chip)
u32 upstream_port = dsa_upstream_port(ds);
int err;
- /* Enable the PHY Polling Unit if present, don't discard any packets,
- * and mask all interrupt sources.
- */
- err = mv88e6xxx_ppu_enable(chip);
- if (err)
- return err;
-
if (chip->info->ops->g1_set_cpu_port) {
err = chip->info->ops->g1_set_cpu_port(chip, upstream_port);
if (err)
@@ -2140,6 +2133,10 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
goto unlock;
}
+ err = mv88e6xxx_phy_setup(chip);
+ if (err)
+ goto unlock;
+
err = mv88e6xxx_vtu_setup(chip);
if (err)
goto unlock;
diff --git a/drivers/net/dsa/mv88e6xxx/phy.c b/drivers/net/dsa/mv88e6xxx/phy.c
index 0d3e8aaedf50..b865b1e2b103 100644
--- a/drivers/net/dsa/mv88e6xxx/phy.c
+++ b/drivers/net/dsa/mv88e6xxx/phy.c
@@ -124,7 +124,7 @@ static int mv88e6xxx_ppu_disable(struct mv88e6xxx_chip *chip)
return chip->info->ops->ppu_disable(chip);
}
-int mv88e6xxx_ppu_enable(struct mv88e6xxx_chip *chip)
+static int mv88e6xxx_ppu_enable(struct mv88e6xxx_chip *chip)
{
if (!chip->info->ops->ppu_enable)
return 0;
@@ -241,3 +241,8 @@ void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip)
if (chip->info->ops->ppu_enable && chip->info->ops->ppu_disable)
mv88e6xxx_ppu_state_destroy(chip);
}
+
+int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip)
+{
+ return mv88e6xxx_ppu_enable(chip);
+}
diff --git a/drivers/net/dsa/mv88e6xxx/phy.h b/drivers/net/dsa/mv88e6xxx/phy.h
index 0961d781b726..dfa98549dfcd 100644
--- a/drivers/net/dsa/mv88e6xxx/phy.h
+++ b/drivers/net/dsa/mv88e6xxx/phy.h
@@ -30,8 +30,8 @@ int mv88e6xxx_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
int addr, int reg, u16 *val);
int mv88e6xxx_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
int addr, int reg, u16 val);
-int mv88e6xxx_ppu_enable(struct mv88e6xxx_chip *chip);
void mv88e6xxx_phy_init(struct mv88e6xxx_chip *chip);
void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip);
+int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip);
#endif /*_MV88E6XXX_PHY_H */
--
2.13.0
^ permalink raw reply related
* [PATCH net-next 0/3] net: dsa: mv88e6xxx: PHY nitpicks
From: Vivien Didelot @ 2017-05-26 22:03 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
Andrew Lunn, Vivien Didelot
This patchset isolates more PPU code into phy.c and makes distinction
between PHY Registers read and write implementations vs. generic PHY
routines.
Vivien Didelot (3):
net: dsa: mv88e6xxx: provide a PHY setup helper
net: dsa: mv88e6xxx: rename PHY PPU accessors
net: dsa: mv88e6xxx: rename PHY PPU functions
drivers/net/dsa/mv88e6xxx/chip.c | 27 +++++++++++-------------
drivers/net/dsa/mv88e6xxx/phy.c | 45 ++++++++++++++++++++++------------------
drivers/net/dsa/mv88e6xxx/phy.h | 13 +++++++-----
3 files changed, 45 insertions(+), 40 deletions(-)
--
2.13.0
^ permalink raw reply
* [PATCH net-next] net: dsa: mv88e6xxx: handle SERDES error appropriately
From: Vivien Didelot @ 2017-05-26 22:02 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
Andrew Lunn, Vivien Didelot
mv88e6xxx_serdes_power returns an error, so no need to print an error
message inside of it. Rather print it in its caller when the error is
ignored, which is in the mv88e6xxx_port_disable void function.
Catch and return its error in the counterpart mv88e6xxx_port_enable.
Fixes: 04aca9938255 ("dsa: mv88e6xxx: Enable/Disable SERDES on port enable/disable")
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index c2f38f6770aa..742c0eae7fa3 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1806,16 +1806,10 @@ static int mv88e6xxx_setup_egress_floods(struct mv88e6xxx_chip *chip, int port)
static int mv88e6xxx_serdes_power(struct mv88e6xxx_chip *chip, int port,
bool on)
{
- int err = 0;
+ if (chip->info->ops->serdes_power)
+ return chip->info->ops->serdes_power(chip, port, on);
- if (chip->info->ops->serdes_power) {
- err = chip->info->ops->serdes_power(chip, port, on);
- if (err)
- dev_err(chip->dev,
- "Failed to change SERDES power: %d\n", err);
- }
-
- return err;
+ return 0;
}
static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
@@ -1982,10 +1976,10 @@ static int mv88e6xxx_port_enable(struct dsa_switch *ds, int port,
struct phy_device *phydev)
{
struct mv88e6xxx_chip *chip = ds->priv;
- int err = 0;
+ int err;
mutex_lock(&chip->reg_lock);
- mv88e6xxx_serdes_power(chip, port, true);
+ err = mv88e6xxx_serdes_power(chip, port, true);
mutex_unlock(&chip->reg_lock);
return err;
@@ -1997,7 +1991,8 @@ static void mv88e6xxx_port_disable(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv;
mutex_lock(&chip->reg_lock);
- mv88e6xxx_serdes_power(chip, port, false);
+ if (mv88e6xxx_serdes_power(chip, port, false))
+ dev_err(chip->dev, "failed to power off SERDES\n");
mutex_unlock(&chip->reg_lock);
}
--
2.13.0
^ permalink raw reply related
* [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()
From: yuan linyu @ 2017-05-26 22:00 UTC (permalink / raw)
To: netdev; +Cc: David S . Miller, Joe Perches, David Ahern, yuan linyu
From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
---
net/ipv6/ndisc.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index d310dc4..414e929 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -148,17 +148,18 @@ void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data,
opt[0] = type;
opt[1] = space>>3;
+ opt += 2;
+ space -= 2;
- memset(opt + 2, 0, pad);
+ memset(opt, 0, pad);
opt += pad;
space -= pad;
- memcpy(opt+2, data, data_len);
- data_len += 2;
+ memcpy(opt, data, data_len);
opt += data_len;
space -= data_len;
- if (space > 0)
- memset(opt, 0, space);
+
+ memset(opt, 0, space);
}
EXPORT_SYMBOL_GPL(__ndisc_fill_addr_option);
--
2.7.4
^ permalink raw reply related
* Re: [for-next 5/6] net/mlx5: Bump driver version
From: Jakub Kicinski @ 2017-05-26 21:53 UTC (permalink / raw)
To: Dennis Dalessandro
Cc: Saeed Mahameed, Saeed Mahameed, David S. Miller, Doug Ledford,
Linux Netdev List, linux-rdma, Ilan Tayari, Tariq Toukan
In-Reply-To: <ee23ad82-4a2e-8546-d41b-11f979b127bb@intel.com>
On Fri, 26 May 2017 12:55:22 -0400, Dennis Dalessandro wrote:
> >> I realize Dave has already pulled this and I'm not asking for it to be
> >> reverted but maybe some discussion will help guide future patch submissions
> >> which do this stuff.
> >>
> >
> > Sure, although i don't think we are going to use those version fields
> > in the future,
> > please allow me to ask, how do you do your driver versioning ? how do
> > you track things ?
> > and what is your future vision regarding ethool->drv_version ?
>
> That's just the thing, we don't do anything with it either really. I'm
> trying to justify its existence to myself and if you folks had some whiz
> bang idea for a driver version I was interested in hearing what it was.
FWIW I put VERMAGIC_STRING in drv_version:
# ethtool -i p4p1
driver: nfp
version: 4.12.0-rc2-perf-00282-gc42dfc79
...
I think I got that idea from Felix Fietkau. The backport-ified version
of the driver [1] uses git hash and "o-o-t" sting:
# ethtool -i p4p1
driver: nfp
version: 49e5c6abf5b2 (o-o-t)
...
So it's pretty easy to tell which driver the customer is using. I
could probably throw in the output of $(git rev-list --count HEAD) to
have an automatic monotonically increasing "version" when built
out-of-tree, hm...
[1] https://github.com/Netronome/nfp-drv-kmods
^ permalink raw reply
* [PATCH 7/7] mlx5: Do not build eswitch_offloads if CONFIG_MLX5_EN_ESWITCH_OFFLOADS is set
From: Jes Sorensen @ 2017-05-26 21:16 UTC (permalink / raw)
To: netdev; +Cc: kernel-team, saeedm, ilant, Jes Sorensen
In-Reply-To: <20170526211624.23133-1-jsorensen@fb.com>
This gets rid of the temporary #ifdef spaghetti and allows the code to
compile without offload support enabled.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/Makefile | 4 +++-
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 9 ---------
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
index 9e64461..5967b97 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
@@ -5,11 +5,13 @@ mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
mad.o transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
fs_counters.o rl.o lag.o dev.o
-mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o eswitch.o eswitch_offloads.o \
+mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o eswitch.o \
en_main.o en_common.o en_fs.o en_ethtool.o en_tx.o \
en_rx.o en_rx_am.o en_txrx.o en_clock.o vxlan.o \
en_tc.o en_arfs.o en_rep.o en_fs_ethtool.o en_selftest.o
mlx5_core-$(CONFIG_MLX5_CORE_EN_DCB) += en_dcbnl.o
+mlx5_core-$(CONFIG_MLX5_EN_ESWITCH_OFFLOADS) += en_eswitch_offloads.o
+
mlx5_core-$(CONFIG_MLX5_CORE_IPOIB) += ipoib.o
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 638b84f..320d1c5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -43,7 +43,6 @@ enum {
FDB_SLOW_PATH
};
-#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
struct mlx5_flow_handle *
mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
struct mlx5_flow_spec *spec,
@@ -426,7 +425,6 @@ static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw)
kvfree(spec);
return err;
}
-#endif
#define ESW_OFFLOADS_NUM_GROUPS 4
@@ -477,7 +475,6 @@ static void esw_destroy_offloads_fast_fdb_table(struct mlx5_eswitch *esw)
#define MAX_PF_SQ 256
-#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw, int nvports)
{
int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
@@ -737,7 +734,6 @@ static int esw_offloads_start(struct mlx5_eswitch *esw)
return err;
}
-#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
int esw_offloads_init(struct mlx5_eswitch *esw, int nvports)
{
struct mlx5_eswitch_rep *rep;
@@ -796,7 +792,6 @@ int esw_offloads_init(struct mlx5_eswitch *esw, int nvports)
return err;
}
-#endif
static int esw_offloads_stop(struct mlx5_eswitch *esw)
{
@@ -819,7 +814,6 @@ static int esw_offloads_stop(struct mlx5_eswitch *esw)
return err;
}
-#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
void esw_offloads_cleanup(struct mlx5_eswitch *esw, int nvports)
{
struct mlx5_eswitch_rep *rep;
@@ -836,7 +830,6 @@ void esw_offloads_cleanup(struct mlx5_eswitch *esw, int nvports)
esw_destroy_offloads_table(esw);
esw_destroy_offloads_fdb_tables(esw);
}
-#endif
static int esw_mode_from_devlink(u16 mode, u16 *mlx5_mode)
{
@@ -1124,7 +1117,6 @@ int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8 *encap)
return 0;
}
-#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
void mlx5_eswitch_register_vport_rep(struct mlx5_eswitch *esw,
int vport_index,
struct mlx5_eswitch_rep *__rep)
@@ -1169,4 +1161,3 @@ struct net_device *mlx5_eswitch_get_uplink_netdev(struct mlx5_eswitch *esw)
rep = &offloads->vport_reps[UPLINK_REP_INDEX];
return rep->netdev;
}
-#endif
--
2.9.4
^ permalink raw reply related
* [PATCH 6/7] mlx5: Stub out sqs2vport functions
From: Jes Sorensen @ 2017-05-26 21:16 UTC (permalink / raw)
To: netdev; +Cc: kernel-team, saeedm, ilant, Jes Sorensen
In-Reply-To: <20170526211624.23133-1-jsorensen@fb.com>
These aren't called if CONFIG_MLX5_EN_ESWITCH_OFFLOADS isn't enabled,
so do not build them.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 14 ++++++++++++++
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 --
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 9a395f3..f1a597b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -340,11 +340,25 @@ struct mlx5_esw_flow_attr {
struct mlx5e_tc_flow_parse_attr *parse_attr;
};
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
int mlx5_eswitch_sqs2vport_start(struct mlx5_eswitch *esw,
struct mlx5_eswitch_rep *rep,
u16 *sqns_array, int sqns_num);
void mlx5_eswitch_sqs2vport_stop(struct mlx5_eswitch *esw,
struct mlx5_eswitch_rep *rep);
+#else
+static inline int mlx5_eswitch_sqs2vport_start(struct mlx5_eswitch *esw,
+ struct mlx5_eswitch_rep *rep,
+ u16 *sqns_array, int sqns_num)
+{
+ return -EOPNOTSUPP;
+}
+static inline void mlx5_eswitch_sqs2vport_stop(struct mlx5_eswitch *esw,
+ struct mlx5_eswitch_rep *rep)
+{
+ return;
+}
+#endif
int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode);
int mlx5_devlink_eswitch_mode_get(struct devlink *devlink, u16 *mode);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 2bda8f5..638b84f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -302,7 +302,6 @@ int mlx5_eswitch_del_vlan_action(struct mlx5_eswitch *esw,
out:
return err;
}
-#endif
static struct mlx5_flow_handle *
mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, int vport, u32 sqn)
@@ -395,7 +394,6 @@ int mlx5_eswitch_sqs2vport_start(struct mlx5_eswitch *esw,
return err;
}
-#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw)
{
struct mlx5_flow_act flow_act = {0};
--
2.9.4
^ permalink raw reply related
* [PATCH 5/7] mlx5: Stub out create_vport_rx_rule when eswitch_offloads disabled
From: Jes Sorensen @ 2017-05-26 21:16 UTC (permalink / raw)
To: netdev; +Cc: kernel-team, saeedm, ilant, Jes Sorensen
In-Reply-To: <20170526211624.23133-1-jsorensen@fb.com>
One more vport related function to disable.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 11 ++++++++---
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 6397384..9a395f3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -295,6 +295,9 @@ void
mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
struct mlx5_flow_handle *rule,
struct mlx5_esw_flow_attr *attr);
+struct mlx5_flow_handle *
+mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn);
+
#else
static inline struct mlx5_flow_handle *
mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
@@ -310,11 +313,13 @@ mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
{
return;
}
+static inline struct mlx5_flow_handle *
+mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
#endif
-struct mlx5_flow_handle *
-mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn);
-
enum {
SET_VLAN_STRIP = BIT(0),
SET_VLAN_INSERT = BIT(1)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 9278a33..2bda8f5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -670,7 +670,6 @@ static void esw_destroy_vport_rx_group(struct mlx5_eswitch *esw)
{
mlx5_destroy_flow_group(esw->offloads.vport_rx_group);
}
-#endif
struct mlx5_flow_handle *
mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn)
@@ -710,6 +709,7 @@ mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn)
kvfree(spec);
return flow_rule;
}
+#endif
static int esw_offloads_start(struct mlx5_eswitch *esw)
{
--
2.9.4
^ permalink raw reply related
* [PATCH 4/7] mlx5: Stub out eswitch offload vport functions
From: Jes Sorensen @ 2017-05-26 21:16 UTC (permalink / raw)
To: netdev; +Cc: kernel-team, saeedm, ilant, Jes Sorensen
In-Reply-To: <20170526211624.23133-1-jsorensen@fb.com>
This code isn't called if CONFIG_MLX5_EN_ESWITCH_OFFLOADS isn't enabled
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 20 +++++++++++++++++++-
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 ++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index c2b0c02..6397384 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -348,6 +348,7 @@ int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8 *mode);
int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int nvfs, u8 *mode);
int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8 encap);
int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8 *encap);
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
void mlx5_eswitch_register_vport_rep(struct mlx5_eswitch *esw,
int vport_index,
struct mlx5_eswitch_rep *rep);
@@ -355,12 +356,29 @@ void mlx5_eswitch_unregister_vport_rep(struct mlx5_eswitch *esw,
int vport_index);
struct net_device *mlx5_eswitch_get_uplink_netdev(struct mlx5_eswitch *esw);
-#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw,
struct mlx5_esw_flow_attr *attr);
int mlx5_eswitch_del_vlan_action(struct mlx5_eswitch *esw,
struct mlx5_esw_flow_attr *attr);
#else
+static inline void
+mlx5_eswitch_register_vport_rep(struct mlx5_eswitch *esw, int vport_index,
+ struct mlx5_eswitch_rep *rep)
+{
+ return;
+}
+static inline void
+mlx5_eswitch_unregister_vport_rep(struct mlx5_eswitch *esw, int vport_index)
+{
+ return;
+}
+
+static inline struct net_device *
+mlx5_eswitch_get_uplink_netdev(struct mlx5_eswitch *esw)
+{
+ return NULL;
+}
+
static inline int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw,
struct mlx5_esw_flow_attr *attr)
{
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 12505ba..9278a33 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -1126,6 +1126,7 @@ int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8 *encap)
return 0;
}
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
void mlx5_eswitch_register_vport_rep(struct mlx5_eswitch *esw,
int vport_index,
struct mlx5_eswitch_rep *__rep)
@@ -1170,3 +1171,4 @@ struct net_device *mlx5_eswitch_get_uplink_netdev(struct mlx5_eswitch *esw)
rep = &offloads->vport_reps[UPLINK_REP_INDEX];
return rep->netdev;
}
+#endif
--
2.9.4
^ permalink raw reply related
* [PATCH 1/7] mlx5: Allow support for eswitch offloads to be disabled
From: Jes Sorensen @ 2017-05-26 21:16 UTC (permalink / raw)
To: netdev; +Cc: kernel-team, saeedm, ilant, Jes Sorensen
In-Reply-To: <20170526211624.23133-1-jsorensen@fb.com>
This allows users to disable eswitch offloads. Follow-on patches will
clean up how the eswitch_offloads code is being called and get rid of all
the #ifdefs.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 10 ++++++++++
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 11 +++++++++++
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 8 ++++++++
drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 +-
4 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index 27251a7..27b409e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -32,6 +32,16 @@ config MLX5_CORE_EN_DCB
If unsure, set to Y
+config MLX5_CORE_EN_ESWITCH_OFFLOADS
+ bool "Enable support for Mellanox ESwitch Offload Support"
+ default y
+ depends on MLX5_CORE_EN
+ ---help---
+ Say Y here if you want to use Mellanox ESwitch offload support.
+ If set to N, the driver will use the kernel's software implementation.
+
+ If unsure, set to Y
+
config MLX5_CORE_IPOIB
bool "Mellanox Technologies ConnectX-4 IPoIB offloads support"
depends on MLX5_CORE_EN
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index b746f62..de4e5e8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -243,8 +243,19 @@ struct mlx5_eswitch {
int mode;
};
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
void esw_offloads_cleanup(struct mlx5_eswitch *esw, int nvports);
int esw_offloads_init(struct mlx5_eswitch *esw, int nvports);
+#else
+static inline void esw_offloads_cleanup(struct mlx5_eswitch *esw, int nvports)
+{
+ return;
+}
+static inline int esw_offloads_init(struct mlx5_eswitch *esw, int nvports)
+{
+ return -EOPNOTSUPP;
+}
+#endif
/* E-Switch API */
int mlx5_eswitch_init(struct mlx5_core_dev *dev);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index f991f66..e78dec1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -393,6 +393,7 @@ int mlx5_eswitch_sqs2vport_start(struct mlx5_eswitch *esw,
return err;
}
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw)
{
struct mlx5_flow_act flow_act = {0};
@@ -425,6 +426,7 @@ static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw)
kvfree(spec);
return err;
}
+#endif
#define ESW_OFFLOADS_NUM_GROUPS 4
@@ -475,6 +477,7 @@ static void esw_destroy_offloads_fast_fdb_table(struct mlx5_eswitch *esw)
#define MAX_PF_SQ 256
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw, int nvports)
{
int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
@@ -665,6 +668,7 @@ static void esw_destroy_vport_rx_group(struct mlx5_eswitch *esw)
{
mlx5_destroy_flow_group(esw->offloads.vport_rx_group);
}
+#endif
struct mlx5_flow_handle *
mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn)
@@ -733,6 +737,7 @@ static int esw_offloads_start(struct mlx5_eswitch *esw)
return err;
}
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
int esw_offloads_init(struct mlx5_eswitch *esw, int nvports)
{
struct mlx5_eswitch_rep *rep;
@@ -791,6 +796,7 @@ int esw_offloads_init(struct mlx5_eswitch *esw, int nvports)
return err;
}
+#endif
static int esw_offloads_stop(struct mlx5_eswitch *esw)
{
@@ -813,6 +819,7 @@ static int esw_offloads_stop(struct mlx5_eswitch *esw)
return err;
}
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
void esw_offloads_cleanup(struct mlx5_eswitch *esw, int nvports)
{
struct mlx5_eswitch_rep *rep;
@@ -829,6 +836,7 @@ void esw_offloads_cleanup(struct mlx5_eswitch *esw, int nvports)
esw_destroy_offloads_table(esw);
esw_destroy_offloads_fdb_tables(esw);
}
+#endif
static int esw_mode_from_devlink(u16 mode, u16 *mlx5_mode)
{
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 0c123d5..3d8a41a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1275,7 +1275,7 @@ struct mlx5_core_event_handler {
};
static const struct devlink_ops mlx5_devlink_ops = {
-#ifdef CONFIG_MLX5_CORE_EN
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
.eswitch_mode_set = mlx5_devlink_eswitch_mode_set,
.eswitch_mode_get = mlx5_devlink_eswitch_mode_get,
.eswitch_inline_mode_set = mlx5_devlink_eswitch_inline_mode_set,
--
2.9.4
^ permalink raw reply related
* [PATCH 2/7] mlx5: eswitch vlan functionality is only called if SRIOV_OFFLOADS is set
From: Jes Sorensen @ 2017-05-26 21:16 UTC (permalink / raw)
To: netdev; +Cc: kernel-team, saeedm, ilant, Jes Sorensen
In-Reply-To: <20170526211624.23133-1-jsorensen@fb.com>
This allows not compiling this code if eswitch offloads are disabled.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 13 +++++++++++++
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 ++
2 files changed, 15 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index de4e5e8..2bf5299 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -338,10 +338,23 @@ void mlx5_eswitch_unregister_vport_rep(struct mlx5_eswitch *esw,
int vport_index);
struct net_device *mlx5_eswitch_get_uplink_netdev(struct mlx5_eswitch *esw);
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw,
struct mlx5_esw_flow_attr *attr);
int mlx5_eswitch_del_vlan_action(struct mlx5_eswitch *esw,
struct mlx5_esw_flow_attr *attr);
+#else
+static inline int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw,
+ struct mlx5_esw_flow_attr *attr)
+{
+ return -EOPNOTSUPP;
+}
+static inline int mlx5_eswitch_del_vlan_action(struct mlx5_eswitch *esw,
+ struct mlx5_esw_flow_attr *attr)
+{
+ return -EOPNOTSUPP;
+}
+#endif
int __mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,
int vport, u16 vlan, u8 qos, u8 set_flags);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index e78dec1..8d0af1f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -122,6 +122,7 @@ mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
esw->offloads.num_flows--;
}
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
static int esw_set_global_vlan_pop(struct mlx5_eswitch *esw, u8 val)
{
struct mlx5_eswitch_rep *rep;
@@ -301,6 +302,7 @@ int mlx5_eswitch_del_vlan_action(struct mlx5_eswitch *esw,
out:
return err;
}
+#endif
static struct mlx5_flow_handle *
mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, int vport, u32 sqn)
--
2.9.4
^ permalink raw reply related
* [PATCH 0/7] mlx5: Make eswitch_offloads a compile option
From: Jes Sorensen @ 2017-05-26 21:16 UTC (permalink / raw)
To: netdev; +Cc: kernel-team, saeedm, ilant, Jes Sorensen
Hi,
This changes the code to allow for eswitch_offloads to be compile time
option, reducing the size of the driver module for those who do not
need it.
The patches do it step by step by introducing stubs and then finally
gets rid of all the #ifdefs once the code can compile and link without
including eswitch_offloads.o
Unlike the patches that were discussed on the list back in January,
this does not try to remove eswitch support. It simply allows the
offloads to be disabled.
Cheers,
Jes
Jes Sorensen (7):
mlx5: Allow support for eswitch offloads to be disabled
mlx5: eswitch vlan functionality is only called if SRIOV_OFFLOADS is
set
mlx5: Disable {add,del}_offloaded_rule() code if eswitch offloads are
disabled
mlx5: Stub out eswitch offload vport functions
mlx5: Stub out create_vport_rx_rule when eswitch_offloads disabled
mlx5: Stub out sqs2vport functions
mlx5: Do not build eswitch_offloads if CONFIG_MLX5_EN_ESWITCH_OFFLOADS
is set
drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 10 +++
drivers/net/ethernet/mellanox/mlx5/core/Makefile | 4 +-
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 80 +++++++++++++++++++++-
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 +-
5 files changed, 94 insertions(+), 3 deletions(-)
--
2.9.4
^ permalink raw reply
* [PATCH 3/7] mlx5: Disable {add,del}_offloaded_rule() code if eswitch offloads are disabled
From: Jes Sorensen @ 2017-05-26 21:16 UTC (permalink / raw)
To: netdev; +Cc: kernel-team, saeedm, ilant, Jes Sorensen
In-Reply-To: <20170526211624.23133-1-jsorensen@fb.com>
This code will not be called if CONFIG_MLX5_EN_ESWITCH_OFFLOADS is disabled.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 17 +++++++++++++++++
.../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 2bf5299..c2b0c02 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -286,6 +286,7 @@ int mlx5_eswitch_get_vport_stats(struct mlx5_eswitch *esw,
struct mlx5_flow_spec;
struct mlx5_esw_flow_attr;
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
struct mlx5_flow_handle *
mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
struct mlx5_flow_spec *spec,
@@ -294,6 +295,22 @@ void
mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
struct mlx5_flow_handle *rule,
struct mlx5_esw_flow_attr *attr);
+#else
+static inline struct mlx5_flow_handle *
+mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
+ struct mlx5_flow_spec *spec,
+ struct mlx5_esw_flow_attr *attr)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+static inline void
+mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
+ struct mlx5_flow_handle *rule,
+ struct mlx5_esw_flow_attr *attr)
+{
+ return;
+}
+#endif
struct mlx5_flow_handle *
mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 8d0af1f..12505ba 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -43,6 +43,7 @@ enum {
FDB_SLOW_PATH
};
+#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
struct mlx5_flow_handle *
mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
struct mlx5_flow_spec *spec,
@@ -122,7 +123,6 @@ mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
esw->offloads.num_flows--;
}
-#ifdef CONFIG_MLX5_EN_ESWITCH_OFFLOADS
static int esw_set_global_vlan_pop(struct mlx5_eswitch *esw, u8 val)
{
struct mlx5_eswitch_rep *rep;
--
2.9.4
^ permalink raw reply related
* Re: [PATCH V5 1/2] rtnl: Add support for netdev event to link messages
From: David Ahern @ 2017-05-26 20:04 UTC (permalink / raw)
To: vyasevic, Vladislav Yasevich, netdev; +Cc: roopa, jiri, vfalico, andy
In-Reply-To: <9e56d973-450e-7dfe-5a33-23922d449cd5@redhat.com>
On 5/26/17 2:01 PM, Vlad Yasevich wrote:
>> Also, generically the IFLA_EVENT attribute should be considered
>> independent of NETDEV_ events.
>>
>> For example, userspace should be notified if the speed / duplex for a
>> device changes, so we could have another one of these -- e.g.,
>> IFLA_EVENT_SPEED -- that does not correlate to NETDEV_SPEED since
>> nothing internal to the network stack cares about speed changes, or
>> perhaps more generically it is IFLA_EVENT_LINK_SETTING.
>>
>
> Ok. We could do a translation between netdev event and IFLA_EVENT attribute value
> earlier (say in rtnetlink_event) and pass that along. This would allow calls
> from other places, assuming proper IFLA_EVENT attribute value and translation
> is defined.
>
> Would that address your concerns?
yes. that code re-factoring can be done when it is needed.
^ permalink raw reply
* Re: [PATCH V5 1/2] rtnl: Add support for netdev event to link messages
From: Vlad Yasevich @ 2017-05-26 20:01 UTC (permalink / raw)
To: David Ahern, Vladislav Yasevich, netdev; +Cc: roopa, jiri, vfalico, andy
In-Reply-To: <0d252e48-cbd0-5d5d-1e30-9c7e79ea9d01@gmail.com>
On 05/26/2017 03:40 PM, David Ahern wrote:
> On 5/25/17 9:31 AM, Vladislav Yasevich wrote:
>> @@ -911,4 +912,14 @@ enum {
>>
>> #define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
>>
>> +enum {
>> + IFLA_EVENT_UNSPEC,
>> + IFLA_EVENT_REBOOT,
>> + IFLA_EVENT_FEAT_CHANGE,
>> + IFLA_EVENT_BONDING_FAILOVER,
>> + IFLA_EVENT_NOTIFY_PEERS,
>> + IFLA_EVENT_RESEND_IGMP,
>> + IFLA_EVENT_CHANGE_INFO_DATA,
>> +};
>> +
>> #endif /* _UAPI_LINUX_IF_LINK_H */
>
> I agree these are unique events that userspace might care about.
>
> I'd prefer better names for the userspace api for a couple of those
> along with a description in the header file so userspace knows why the
> event was generated.
>
> How about something like this:
>
> enum {
> IFLA_EVENT_NONE,
> IFLA_EVENT_REBOOT, /* internal reset / reboot */
> IFLA_EVENT_FEATURES, /* change in offload features */
> IFLA_EVENT_BONDING_FAILOVER, /* change in active slave */
> IFLA_EVENT_NOTIFY_PEERS, /* re-sent grat. arp/ndisc */
> IFLA_EVENT_IGMP_RESEND, /* re-sent IGMP JOIN */
> IFLA_EVENT_BONDING_OPTIONS, /* change in bonding options */
> };
>
Ok. I'll change and re-submit.
> Also, generically the IFLA_EVENT attribute should be considered
> independent of NETDEV_ events.
>
> For example, userspace should be notified if the speed / duplex for a
> device changes, so we could have another one of these -- e.g.,
> IFLA_EVENT_SPEED -- that does not correlate to NETDEV_SPEED since
> nothing internal to the network stack cares about speed changes, or
> perhaps more generically it is IFLA_EVENT_LINK_SETTING.
>
Ok. We could do a translation between netdev event and IFLA_EVENT attribute value
earlier (say in rtnetlink_event) and pass that along. This would allow calls
from other places, assuming proper IFLA_EVENT attribute value and translation
is defined.
Would that address your concerns?
> The rest of the patch looks ok to me.
>
Thanks
-vlad
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2017-05-26 19:50 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) Fix state pruning in bpf verifier wrt. alignment, from Daniel
Borkmann.
2) Handle non-linear SKBs properly in SCTP ICMP parsing, from
Davide Caratti.
3) Fix bit field definitions for rss_hash_type of descriptors in
mlx5 driver, from Jesper Brouer.
4) Defer slave->link updates until bonding is ready to do a full
commit to the new settings, from Nithin Sujir.
5) Properly reference count ipv4 FIB metrics to avoid use after
free situations, from Eric Dumazet and several others including
Cong Wang and Julian Anastasov.
6) Fix races in llc_ui_bind(), from Lin Zhang.
7) Fix regression of ESP UDP encapsulation for TCP packets, from
Steffen Klassert.
8) Fix mdio-octeon driver Kconfig deps, from Randy Dunlap.
9) Fix regression in setting DSCP on ipv6/GRE encapsulation, from
Peter Dawson.
Please pull, thanks a lot!
The following changes since commit fadd2ce5a3680fb265694f573cbfb8bcb7d6c9d5:
Merge tag 'pstore-v4.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux (2017-05-22 19:31:07 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
for you to fetch changes up to 3fb07daff8e99243366a081e5129560734de4ada:
ipv4: add reference counting to metrics (2017-05-26 14:57:07 -0400)
----------------------------------------------------------------
Alexander Potapenko (1):
net: rtnetlink: bail out from rtnl_fdb_dump() on parse error
Andrew Lunn (1):
net: phy: marvell: Limit errata to 88m1101
Antony Antony (1):
xfrm: fix state migration copy replay sequence numbers
Arend Van Spriel (1):
cfg80211: make cfg80211_sched_scan_results() work from atomic context
Daniel Borkmann (5):
bpf: fix incorrect pruning decision when alignment must be tracked
bpf: properly reset caller saved regs after helper call and ld_abs/ind
bpf: add bpf_clone_redirect to bpf_helper_changes_pkt_data
bpf: fix wrong exposure of map_flags into fdinfo for lpm
bpf: add various verifier test cases
David Daney (1):
test_bpf: Add a couple of tests for BPF_JSGE.
David S. Miller (6):
Merge branch 'master' of git://git.kernel.org/.../klassert/ipsec
Merge branch 'sctp-dupcookie-fixes'
Merge tag 'mac80211-for-davem-2017-05-23' of git://git.kernel.org/.../jberg/mac80211
Merge tag 'mlx5-fixes-2017-05-23' of git://git.kernel.org/.../saeed/linux
Merge branch 'q-in-q-checksums'
Merge branch 'bpf-fixes'
Davide Caratti (1):
sctp: fix ICMP processing if skb is non-linear
Erez Shitrit (1):
net/mlx5e: IPoIB, handle RX packet correctly
Eric Dumazet (1):
ipv4: add reference counting to metrics
Eric Garver (1):
geneve: fix fill_info when using collect_metadata
Gustavo A. R. Silva (1):
net: fix potential null pointer dereference
Ihar Hrachyshka (1):
arp: fixed -Wuninitialized compiler warning
Ilan Tayari (1):
xfrm: Fix NETDEV_DOWN with IPSec offload
Jesper Dangaard Brouer (1):
mlx5: fix bug reading rss_hash_type from CQE
Mohamad Haj Yahia (1):
net/mlx5: Avoid using pending command interface slots
Nithin Sujir (1):
bonding: Don't update slave->link until ready to commit
Oliver Neukum (1):
cdc-ether: divorce initialisation with a filter reset and a generic method
Or Gerlitz (5):
net/mlx5e: Use the correct delete call on offloaded TC encap entry detach
net/sched: act_csum: Add accessors for offloading drivers
net/mlx5e: Allow TC csum offload if applied together with pedit action
net/mlx5e: Properly enforce disallowing of partial field re-write offload
net/mlx5e: Fix warnings around parsing of TC pedit actions
Peter Dawson (1):
ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets
Quentin Schulz (1):
net: fec: add post PHY reset delay DT property
Rajkumar Manoharan (1):
mac80211: strictly check mesh address extension mode
Randy Dunlap (1):
net/phy: fix mdio-octeon dependency and build
Roman Kapl (1):
net: move somaxconn init from sysctl code
Sabrina Dubroca (1):
xfrm: fix stack access out of bounds with CONFIG_XFRM_SUB_POLICY
Steffen Klassert (2):
esp4: Fix udpencap for local TCP packets.
af_key: Fix slab-out-of-bounds in pfkey_compile_policy.
Tariq Toukan (1):
net/mlx5: Tolerate irq_set_affinity_hint() failures
Uwe Kleine-König (1):
net: ethernet: ax88796: don't call free_irq without request_irq first
Vlad Yasevich (3):
vlan: Fix tcp checksum offloads in Q-in-Q vlans
be2net: Fix offload features for Q-in-Q packets
virtio-net: enable TSO/checksum offloads for Q-in-Q vlans
Wei Wang (1):
tcp: avoid fastopen API to be used on AF_UNSPEC
Xin Long (2):
sctp: fix stream update when processing dupcookie
sctp: set new_asoc temp when processing dupcookie
linzhang (1):
net: llc: add lock_sock in llc_ui_bind to avoid a race condition
Documentation/devicetree/bindings/net/fsl-fec.txt | 4 ++
drivers/net/bonding/bond_main.c | 11 ++++-
drivers/net/ethernet/8390/ax88796.c | 7 +---
drivers/net/ethernet/emulex/benet/be_main.c | 4 +-
drivers/net/ethernet/freescale/fec_main.c | 16 ++++++-
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 41 +++++++++++++++---
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 8 +++-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 60 ++++++++++++++++++++++-----
drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 15 ++-----
drivers/net/geneve.c | 8 ++--
drivers/net/gtp.c | 2 +-
drivers/net/phy/Kconfig | 2 +-
drivers/net/phy/marvell.c | 66 ++++++++++++++++-------------
drivers/net/usb/cdc_ether.c | 31 ++++++++++----
drivers/net/virtio_net.c | 1 +
include/linux/filter.h | 10 +++++
include/linux/if_vlan.h | 18 ++++----
include/linux/mlx5/device.h | 10 ++++-
include/linux/mlx5/driver.h | 7 +++-
include/linux/usb/usbnet.h | 1 +
include/net/dst.h | 8 +++-
include/net/ip_fib.h | 10 ++---
include/net/tc_act/tc_csum.h | 15 +++++++
include/net/xfrm.h | 10 -----
kernel/bpf/arraymap.c | 1 +
kernel/bpf/lpm_trie.c | 1 +
kernel/bpf/stackmap.c | 1 +
kernel/bpf/verifier.c | 56 ++++++++++++-------------
lib/test_bpf.c | 38 +++++++++++++++++
net/core/dst.c | 23 +++++++----
net/core/filter.c | 1 +
net/core/net_namespace.c | 19 +++++++++
net/core/rtnetlink.c | 7 +++-
net/core/sysctl_net_core.c | 2 -
net/ipv4/arp.c | 2 +-
net/ipv4/esp4.c | 5 ++-
net/ipv4/fib_semantics.c | 17 ++++----
net/ipv4/route.c | 10 ++++-
net/ipv4/tcp.c | 7 +++-
net/ipv6/ip6_gre.c | 13 +++---
net/ipv6/ip6_tunnel.c | 21 ++++++----
net/key/af_key.c | 2 +-
net/llc/af_llc.c | 3 ++
net/mac80211/rx.c | 3 +-
net/sctp/associola.c | 4 +-
net/sctp/input.c | 16 +++----
net/sctp/sm_make_chunk.c | 13 ++----
net/sctp/sm_statefuns.c | 3 ++
net/wireless/scan.c | 8 ++--
net/wireless/util.c | 10 +++--
net/xfrm/xfrm_device.c | 2 +-
net/xfrm/xfrm_policy.c | 47 ---------------------
net/xfrm/xfrm_state.c | 2 +
tools/include/linux/filter.h | 10 +++++
tools/testing/selftests/bpf/test_verifier.c | 239 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
57 files changed, 701 insertions(+), 254 deletions(-)
^ permalink raw reply
* Re: [patch iproute2 v2 repost 1/3] tc_filter: add support for chain index
From: Daniel Borkmann @ 2017-05-26 19:48 UTC (permalink / raw)
To: Jiri Pirko, Stephen Hemminger
Cc: netdev, davem, jhs, xiyou.wangcong, dsa, edumazet,
alexander.h.duyck, simon.horman, mlxsw
In-Reply-To: <20170523134042.GC1829@nanopsycho>
On 05/23/2017 03:40 PM, Jiri Pirko wrote:
> Mon, May 22, 2017 at 10:33:15PM CEST, stephen@networkplumber.org wrote:
[...]
>> Applied to net-next branch of iproute2
>
> Looks like you missed the uapi part:
>
> CC tc_filter.o
> tc_filter.c: In function ‘tc_filter_modify’:
> tc_filter.c:159:34: error: ‘TCA_CHAIN’ undeclared (first use in this function)
> addattr32(&req.n, sizeof(req), TCA_CHAIN, chain_index);
> ^~~~~~~~~
Looks like still unresolved in the iproute2 -net-next branch ...
^ permalink raw reply
* Re: [PATCH V5 2/2] bonding: Prevent duplicate userspace notification
From: David Ahern @ 2017-05-26 19:46 UTC (permalink / raw)
To: Vladislav Yasevich, netdev; +Cc: roopa, jiri, vfalico, andy, Vladislav Yasevich
In-Reply-To: <1495726316-27626-3-git-send-email-vyasevic@redhat.com>
On 5/25/17 9:31 AM, Vladislav Yasevich wrote:
> Whenever a user changes bonding options, a NETDEV_CHANGEINFODATA
> notificatin is generated which results in a rtnelink message to
> be sent. While runnig 'ip monitor', we can actually see 2 messages,
> one a result of the event, and the other a result of state change
> that is generated bo netdev_state_change(). However, this is not
> always the case. If bonding changes were done via sysfs or ifenslave
> (old ioctl interface), then only 1 message is seen.
>
> This patch removes duplicate messages in the case of using netlink
> to configure bonding. It introduceds a separte function that
> triggers a netdev event and uses that function in the syfs and ioctl
> cases.
>
> This was discovered while auditing all the different envents and
> continues the effort of cleaning up duplicated netlink messages.
>
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> ---
> drivers/net/bonding/bond_main.c | 3 ++-
> drivers/net/bonding/bond_options.c | 27 +++++++++++++++++++++++++--
> include/net/bond_options.h | 2 ++
> 3 files changed, 29 insertions(+), 3 deletions(-)
LGTM
Acked-by: David Ahern <dsahern@gmail.com>
^ permalink raw reply
* Re: [PATCH V5 1/2] rtnl: Add support for netdev event to link messages
From: David Ahern @ 2017-05-26 19:40 UTC (permalink / raw)
To: Vladislav Yasevich, netdev; +Cc: roopa, jiri, vfalico, andy, Vladislav Yasevich
In-Reply-To: <1495726316-27626-2-git-send-email-vyasevic@redhat.com>
On 5/25/17 9:31 AM, Vladislav Yasevich wrote:
> @@ -911,4 +912,14 @@ enum {
>
> #define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
>
> +enum {
> + IFLA_EVENT_UNSPEC,
> + IFLA_EVENT_REBOOT,
> + IFLA_EVENT_FEAT_CHANGE,
> + IFLA_EVENT_BONDING_FAILOVER,
> + IFLA_EVENT_NOTIFY_PEERS,
> + IFLA_EVENT_RESEND_IGMP,
> + IFLA_EVENT_CHANGE_INFO_DATA,
> +};
> +
> #endif /* _UAPI_LINUX_IF_LINK_H */
I agree these are unique events that userspace might care about.
I'd prefer better names for the userspace api for a couple of those
along with a description in the header file so userspace knows why the
event was generated.
How about something like this:
enum {
IFLA_EVENT_NONE,
IFLA_EVENT_REBOOT, /* internal reset / reboot */
IFLA_EVENT_FEATURES, /* change in offload features */
IFLA_EVENT_BONDING_FAILOVER, /* change in active slave */
IFLA_EVENT_NOTIFY_PEERS, /* re-sent grat. arp/ndisc */
IFLA_EVENT_IGMP_RESEND, /* re-sent IGMP JOIN */
IFLA_EVENT_BONDING_OPTIONS, /* change in bonding options */
};
Also, generically the IFLA_EVENT attribute should be considered
independent of NETDEV_ events.
For example, userspace should be notified if the speed / duplex for a
device changes, so we could have another one of these -- e.g.,
IFLA_EVENT_SPEED -- that does not correlate to NETDEV_SPEED since
nothing internal to the network stack cares about speed changes, or
perhaps more generically it is IFLA_EVENT_LINK_SETTING.
The rest of the patch looks ok to me.
^ permalink raw reply
* Re: [PATCH net-next v3] ibmvnic: Enable TSO support
From: David Miller @ 2017-05-26 19:35 UTC (permalink / raw)
To: tlfalcon; +Cc: netdev, nfont, jallen
In-Reply-To: <1495815346-5638-1-git-send-email-tlfalcon@linux.vnet.ibm.com>
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Fri, 26 May 2017 11:15:46 -0500
> Enable TSO in the ibmvnic driver. Scatter-gather is also enabled,
> though there currently is no support for scatter-gather in
> vNIC-compatible hardware, resulting in forced linearization
> of all fragmented SKB's. Though not ideal, given the throughput
> improvement gained by enabling TSO, it has been decided
> that this is an acceptable tradeoff.
>
> The feature is also enabled by a module parameter.
> This parameter is necessary because TSO can not easily be
> enabled or disabled in firmware without reinitializing the driver.
>
> CC: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> CC: John Allen <jallen@linux.vnet.ibm.com>
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
> ---
> v3: Remove module parameter, TSO will be set through ethtool
> include ibmvnic_fix_features to manage scatter-gather
> v2: Fix kbuild robot warning from module parameter init
You're only dealing with half of my feedback.
I stated, explicitly, that you're only probably getting a performance
increase with TSO even though it is being software split up before
being sent by the device, because you don't implement xmit_more.
It makes zero sense, to have the networking stack do such an enormous
amount of wasted work putting the TSO segments together just to then
split them apart and linearize the whole packet before transmit.
That should have been a huge red flag for you, and caused you to
inspect further what the true reason is why performance still
increases with all of that happening.
Please look into this further, because I am quite convinced that
you have TX doorbell and VM exit overhead issues at hand, which
would be more properly and suitable dealt with by xmit_more which
is designed _specifically_ to target that apsect of virtual
networking driver performance.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next 00/11] ibmvnic: Driver updates
From: David Miller @ 2017-05-26 19:33 UTC (permalink / raw)
To: nfont; +Cc: netdev, tlfalcon, jallen
In-Reply-To: <20170526142523.63648.62938.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com>
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Date: Fri, 26 May 2017 10:30:07 -0400
> This set of patches implements several updates to the ibmvnic driver
> to fix issues that have been found in testing. Most of the updates
> invovle updating queue handling during driver close and reset
> operations.
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH 5/5] MIPS: Add support for eBPF JIT.
From: Daniel Borkmann @ 2017-05-26 19:22 UTC (permalink / raw)
To: David Daney, David Daney, Alexei Starovoitov, netdev,
linux-kernel, linux-mips, ralf
Cc: Markos Chandras
In-Reply-To: <9fcd54f8-ab2f-84aa-7db4-2165b746d7c3@caviumnetworks.com>
On 05/26/2017 09:20 PM, David Daney wrote:
> On 05/26/2017 12:09 PM, Daniel Borkmann wrote:
>> On 05/26/2017 05:39 PM, David Daney wrote:
>>> On 05/26/2017 08:14 AM, Daniel Borkmann wrote:
>>>> On 05/26/2017 02:38 AM, David Daney wrote:
>>>>> Since the eBPF machine has 64-bit registers, we only support this in
>>>>> 64-bit kernels. As of the writing of this commit log test-bpf is showing:
>>>>>
>>>>> test_bpf: Summary: 316 PASSED, 0 FAILED, [308/308 JIT'ed]
>>>>>
>>>>> All current test cases are successfully compiled.
>>>>>
>>>>> Signed-off-by: David Daney <david.daney@cavium.com>
>>>>
>>>> Awesome work!
>>>>
>>>> Did you also manage to run tools/testing/selftests/bpf/ fine with
>>>> the JIT enabled?
>>>
>>> I haven't done that yet, I will before the next revision.
>>>
>>>> [...]
>>>>> +struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
>>>>> +{
>>>>> + struct jit_ctx ctx;
>>>>> + unsigned int alloc_size;
>>>>> +
>>>>> + /* Only 64-bit kernel supports eBPF */
>>>>> + if (!IS_ENABLED(CONFIG_64BIT) || !bpf_jit_enable)
>>>>
>>>> Isn't this already reflected by the following?
>>>>
>>>> select HAVE_EBPF_JIT if (64BIT && !CPU_MICROMIPS)
>>>
>>> Not exactly. The eBPF JIT is in the same file as the classic-BPF JIT, so when HAVE_EBPF_JIT is false this will indeed never be called. But the kernel would otherwise contain all the JIT code.
>>>
>>> By putting in !IS_ENABLED(CONFIG_64BIT) we allow gcc to eliminate all the dead code when compiling the JITs.
>>
>> Side-effect would still be that for cBPF you go through the cBPF
>> JIT instead of letting the kernel convert all cBPF to eBPF and
>> later on go through your eBPF JIT. If you still prefer to have
>> everything in one single file and let gcc eliminate dead code
>> then you can just do single line change ...
>>
>> void bpf_jit_compile(struct bpf_prog *fp)
>> {
>> struct jit_ctx ctx;
>> unsigned int alloc_size, tmp_idx;
>>
>> if (IS_ENABLED(CONFIG_HAVE_EBPF_JIT) || !bpf_jit_enable)
>> return;
>
> Yes. In fact I did that for testing.
>
> The cBPF JIT generates smaller code for:
>
> test_bpf: #274 BPF_MAXINSNS: ld_abs+get_processor_id jited:1 44128 PASS
>
> When we attempt to use the eBPF JIT for this, some of the MIPS branch instructions cannot reach their targets (+- 32K instructions). I didn't feel like fixing the code generation quite yet to handle branches that span more than 32K instructions, so I left the cBPF in place so I could claim that all of the test cases were JITed :-)
>
> For the next revision of the patch I will revisit this.
Okay, sounds good!
^ permalink raw reply
* Re: [patch net-next 00/18] mlxsw: Improve extensibility
From: David Miller @ 2017-05-26 19:21 UTC (permalink / raw)
To: jiri; +Cc: netdev, idosch, mlxsw, stephen, nikolay
In-Reply-To: <20170526.152035.708896761272676930.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Fri, 26 May 2017 15:20:35 -0400 (EDT)
> Nice cleanups and consolidation, but like Nikolay I'm not so sure
> about all the exports.
>
> It might even be cleaner (believe it or not) to have the bridge
> structure (or at least a subset of it) be something public that
> drivers can query using inline helpers.
Just to be clear I did apply this series, and the above is about
future considerations.
Thanks.
^ 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