* [PATCH v3 net-next 05/11] net: dsa: microchip: Rename ksz_spi.c to ksz9477_spi.c
From: Tristram.Ha @ 2018-10-23 2:26 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Pavel Machek
Cc: Tristram Ha, Ruediger Schmitt, UNGLinuxDriver, netdev
In-Reply-To: <1540261575-1889-1-git-send-email-Tristram.Ha@microchip.com>
From: Tristram Ha <Tristram.Ha@microchip.com>
Rename ksz_spi.c to ksz9477_spi.c and update Kconfig in preparation to add
more KSZ switch drivers.
Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com>
Reviewed-by: Woojung Huh <Woojung.Huh@microchip.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/dsa/microchip/Kconfig | 12 ++++++------
drivers/net/dsa/microchip/Makefile | 4 ++--
drivers/net/dsa/microchip/{ksz_spi.c => ksz9477_spi.c} | 0
3 files changed, 8 insertions(+), 8 deletions(-)
rename drivers/net/dsa/microchip/{ksz_spi.c => ksz9477_spi.c} (100%)
diff --git a/drivers/net/dsa/microchip/Kconfig b/drivers/net/dsa/microchip/Kconfig
index a8b8f59..4e25fe4 100644
--- a/drivers/net/dsa/microchip/Kconfig
+++ b/drivers/net/dsa/microchip/Kconfig
@@ -1,12 +1,12 @@
-menuconfig MICROCHIP_KSZ
- tristate "Microchip KSZ series switch support"
+menuconfig NET_DSA_MICROCHIP_KSZ9477
+ tristate "Microchip KSZ9477 series switch support"
depends on NET_DSA
select NET_DSA_TAG_KSZ
help
- This driver adds support for Microchip KSZ switch chips.
+ This driver adds support for Microchip KSZ9477 switch chips.
-config MICROCHIP_KSZ_SPI_DRIVER
- tristate "KSZ series SPI connected switch driver"
- depends on MICROCHIP_KSZ && SPI
+config NET_DSA_MICROCHIP_KSZ9477_SPI
+ tristate "KSZ9477 series SPI connected switch driver"
+ depends on NET_DSA_MICROCHIP_KSZ9477 && SPI
help
Select to enable support for registering switches configured through SPI.
diff --git a/drivers/net/dsa/microchip/Makefile b/drivers/net/dsa/microchip/Makefile
index ed335e2..9393e73 100644
--- a/drivers/net/dsa/microchip/Makefile
+++ b/drivers/net/dsa/microchip/Makefile
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MICROCHIP_KSZ) += ksz_common.o
-obj-$(CONFIG_MICROCHIP_KSZ_SPI_DRIVER) += ksz_spi.o
+obj-$(CONFIG_NET_DSA_MICROCHIP_KSZ9477) += ksz_common.o
+obj-$(CONFIG_NET_DSA_MICROCHIP_KSZ9477_SPI) += ksz9477_spi.o
diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz9477_spi.c
similarity index 100%
rename from drivers/net/dsa/microchip/ksz_spi.c
rename to drivers/net/dsa/microchip/ksz9477_spi.c
--
1.9.1
^ permalink raw reply related
* [PATCH v3 net-next 04/11] net: dsa: microchip: Rename some functions with ksz9477 prefix
From: Tristram.Ha @ 2018-10-23 2:26 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Pavel Machek
Cc: Tristram Ha, Ruediger Schmitt, UNGLinuxDriver, netdev
In-Reply-To: <1540261575-1889-1-git-send-email-Tristram.Ha@microchip.com>
From: Tristram Ha <Tristram.Ha@microchip.com>
Rename some functions with ksz9477 prefix to separate chip specific code
from common code.
Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com>
Reviewed-by: Woojung Huh <Woojung.Huh@microchip.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/dsa/microchip/ksz_common.c | 116 +++++++++++++++++----------------
1 file changed, 59 insertions(+), 57 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 88e8d2a..8475907 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -265,9 +265,8 @@ static int wait_alu_sta_ready(struct ksz_device *dev, u32 waiton, int timeout)
return 0;
}
-static int ksz_reset_switch(struct dsa_switch *ds)
+static int ksz9477_reset_switch(struct ksz_device *dev)
{
- struct ksz_device *dev = ds->priv;
u8 data8;
u16 data16;
u32 data32;
@@ -300,7 +299,7 @@ static int ksz_reset_switch(struct dsa_switch *ds)
return 0;
}
-static void port_setup(struct ksz_device *dev, int port, bool cpu_port)
+static void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port)
{
u8 data8;
u16 data16;
@@ -346,7 +345,7 @@ static void port_setup(struct ksz_device *dev, int port, bool cpu_port)
ksz_pread16(dev, port, REG_PORT_PHY_INT_ENABLE, &data16);
}
-static void ksz_config_cpu_port(struct dsa_switch *ds)
+static void ksz9477_config_cpu_port(struct dsa_switch *ds)
{
struct ksz_device *dev = ds->priv;
int i;
@@ -358,12 +357,12 @@ static void ksz_config_cpu_port(struct dsa_switch *ds)
dev->cpu_port = i;
/* enable cpu port */
- port_setup(dev, i, true);
+ ksz9477_port_setup(dev, i, true);
}
}
}
-static int ksz_setup(struct dsa_switch *ds)
+static int ksz9477_setup(struct dsa_switch *ds)
{
struct ksz_device *dev = ds->priv;
int ret = 0;
@@ -373,7 +372,7 @@ static int ksz_setup(struct dsa_switch *ds)
if (!dev->vlan_cache)
return -ENOMEM;
- ret = ksz_reset_switch(ds);
+ ret = ksz9477_reset_switch(dev);
if (ret) {
dev_err(ds->dev, "failed to reset switch\n");
return ret;
@@ -382,7 +381,7 @@ static int ksz_setup(struct dsa_switch *ds)
/* accept packet up to 2000bytes */
ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_LEGAL_PACKET_DISABLE, true);
- ksz_config_cpu_port(ds);
+ ksz9477_config_cpu_port(ds);
ksz_cfg(dev, REG_SW_MAC_CTRL_1, MULTICAST_STORM_DISABLE, true);
@@ -395,13 +394,13 @@ static int ksz_setup(struct dsa_switch *ds)
return 0;
}
-static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds,
- int port)
+static enum dsa_tag_protocol ksz9477_get_tag_protocol(struct dsa_switch *ds,
+ int port)
{
return DSA_TAG_PROTO_KSZ;
}
-static int ksz_phy_read16(struct dsa_switch *ds, int addr, int reg)
+static int ksz9477_phy_read16(struct dsa_switch *ds, int addr, int reg)
{
struct ksz_device *dev = ds->priv;
u16 val = 0;
@@ -411,7 +410,8 @@ static int ksz_phy_read16(struct dsa_switch *ds, int addr, int reg)
return val;
}
-static int ksz_phy_write16(struct dsa_switch *ds, int addr, int reg, u16 val)
+static int ksz9477_phy_write16(struct dsa_switch *ds, int addr, int reg,
+ u16 val)
{
struct ksz_device *dev = ds->priv;
@@ -426,7 +426,7 @@ static int ksz_enable_port(struct dsa_switch *ds, int port,
struct ksz_device *dev = ds->priv;
/* setup slave port */
- port_setup(dev, port, false);
+ ksz9477_port_setup(dev, port, false);
return 0;
}
@@ -448,8 +448,8 @@ static int ksz_sset_count(struct dsa_switch *ds, int port, int sset)
return TOTAL_SWITCH_COUNTER_NUM;
}
-static void ksz_get_strings(struct dsa_switch *ds, int port,
- u32 stringset, uint8_t *buf)
+static void ksz9477_get_strings(struct dsa_switch *ds, int port,
+ u32 stringset, uint8_t *buf)
{
int i;
@@ -502,7 +502,8 @@ static void ksz_get_ethtool_stats(struct dsa_switch *ds, int port,
mutex_unlock(&dev->stats_mutex);
}
-static void ksz_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
+static void ksz9477_port_stp_state_set(struct dsa_switch *ds, int port,
+ u8 state)
{
struct ksz_device *dev = ds->priv;
u8 data;
@@ -547,7 +548,8 @@ static void ksz_port_fast_age(struct dsa_switch *ds, int port)
ksz_write8(dev, REG_SW_LUE_CTRL_1, data8);
}
-static int ksz_port_vlan_filtering(struct dsa_switch *ds, int port, bool flag)
+static int ksz9477_port_vlan_filtering(struct dsa_switch *ds, int port,
+ bool flag)
{
struct ksz_device *dev = ds->priv;
@@ -574,8 +576,8 @@ static int ksz_port_vlan_prepare(struct dsa_switch *ds, int port,
return 0;
}
-static void ksz_port_vlan_add(struct dsa_switch *ds, int port,
- const struct switchdev_obj_port_vlan *vlan)
+static void ksz9477_port_vlan_add(struct dsa_switch *ds, int port,
+ const struct switchdev_obj_port_vlan *vlan)
{
struct ksz_device *dev = ds->priv;
u32 vlan_table[3];
@@ -608,8 +610,8 @@ static void ksz_port_vlan_add(struct dsa_switch *ds, int port,
}
}
-static int ksz_port_vlan_del(struct dsa_switch *ds, int port,
- const struct switchdev_obj_port_vlan *vlan)
+static int ksz9477_port_vlan_del(struct dsa_switch *ds, int port,
+ const struct switchdev_obj_port_vlan *vlan)
{
struct ksz_device *dev = ds->priv;
bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
@@ -664,8 +666,8 @@ struct alu_struct {
u8 mac[ETH_ALEN];
};
-static int ksz_port_fdb_add(struct dsa_switch *ds, int port,
- const unsigned char *addr, u16 vid)
+static int ksz9477_port_fdb_add(struct dsa_switch *ds, int port,
+ const unsigned char *addr, u16 vid)
{
struct ksz_device *dev = ds->priv;
u32 alu_table[4];
@@ -721,8 +723,8 @@ static int ksz_port_fdb_add(struct dsa_switch *ds, int port,
return ret;
}
-static int ksz_port_fdb_del(struct dsa_switch *ds, int port,
- const unsigned char *addr, u16 vid)
+static int ksz9477_port_fdb_del(struct dsa_switch *ds, int port,
+ const unsigned char *addr, u16 vid)
{
struct ksz_device *dev = ds->priv;
u32 alu_table[4];
@@ -811,8 +813,8 @@ static void convert_alu(struct alu_struct *alu, u32 *alu_table)
alu->mac[5] = alu_table[3] & 0xFF;
}
-static int ksz_port_fdb_dump(struct dsa_switch *ds, int port,
- dsa_fdb_dump_cb_t *cb, void *data)
+static int ksz9477_port_fdb_dump(struct dsa_switch *ds, int port,
+ dsa_fdb_dump_cb_t *cb, void *data)
{
struct ksz_device *dev = ds->priv;
int ret = 0;
@@ -870,8 +872,8 @@ static int ksz_port_mdb_prepare(struct dsa_switch *ds, int port,
return 0;
}
-static void ksz_port_mdb_add(struct dsa_switch *ds, int port,
- const struct switchdev_obj_port_mdb *mdb)
+static void ksz9477_port_mdb_add(struct dsa_switch *ds, int port,
+ const struct switchdev_obj_port_mdb *mdb)
{
struct ksz_device *dev = ds->priv;
u32 static_table[4];
@@ -940,8 +942,8 @@ static void ksz_port_mdb_add(struct dsa_switch *ds, int port,
mutex_unlock(&dev->alu_mutex);
}
-static int ksz_port_mdb_del(struct dsa_switch *ds, int port,
- const struct switchdev_obj_port_mdb *mdb)
+static int ksz9477_port_mdb_del(struct dsa_switch *ds, int port,
+ const struct switchdev_obj_port_mdb *mdb)
{
struct ksz_device *dev = ds->priv;
u32 static_table[4];
@@ -1017,9 +1019,9 @@ static int ksz_port_mdb_del(struct dsa_switch *ds, int port,
return ret;
}
-static int ksz_port_mirror_add(struct dsa_switch *ds, int port,
- struct dsa_mall_mirror_tc_entry *mirror,
- bool ingress)
+static int ksz9477_port_mirror_add(struct dsa_switch *ds, int port,
+ struct dsa_mall_mirror_tc_entry *mirror,
+ bool ingress)
{
struct ksz_device *dev = ds->priv;
@@ -1039,8 +1041,8 @@ static int ksz_port_mirror_add(struct dsa_switch *ds, int port,
return 0;
}
-static void ksz_port_mirror_del(struct dsa_switch *ds, int port,
- struct dsa_mall_mirror_tc_entry *mirror)
+static void ksz9477_port_mirror_del(struct dsa_switch *ds, int port,
+ struct dsa_mall_mirror_tc_entry *mirror)
{
struct ksz_device *dev = ds->priv;
u8 data;
@@ -1058,29 +1060,29 @@ static void ksz_port_mirror_del(struct dsa_switch *ds, int port,
}
static const struct dsa_switch_ops ksz_switch_ops = {
- .get_tag_protocol = ksz_get_tag_protocol,
- .setup = ksz_setup,
- .phy_read = ksz_phy_read16,
- .phy_write = ksz_phy_write16,
+ .get_tag_protocol = ksz9477_get_tag_protocol,
+ .setup = ksz9477_setup,
+ .phy_read = ksz9477_phy_read16,
+ .phy_write = ksz9477_phy_write16,
.port_enable = ksz_enable_port,
.port_disable = ksz_disable_port,
- .get_strings = ksz_get_strings,
+ .get_strings = ksz9477_get_strings,
.get_ethtool_stats = ksz_get_ethtool_stats,
.get_sset_count = ksz_sset_count,
- .port_stp_state_set = ksz_port_stp_state_set,
+ .port_stp_state_set = ksz9477_port_stp_state_set,
.port_fast_age = ksz_port_fast_age,
- .port_vlan_filtering = ksz_port_vlan_filtering,
+ .port_vlan_filtering = ksz9477_port_vlan_filtering,
.port_vlan_prepare = ksz_port_vlan_prepare,
- .port_vlan_add = ksz_port_vlan_add,
- .port_vlan_del = ksz_port_vlan_del,
- .port_fdb_dump = ksz_port_fdb_dump,
- .port_fdb_add = ksz_port_fdb_add,
- .port_fdb_del = ksz_port_fdb_del,
+ .port_vlan_add = ksz9477_port_vlan_add,
+ .port_vlan_del = ksz9477_port_vlan_del,
+ .port_fdb_dump = ksz9477_port_fdb_dump,
+ .port_fdb_add = ksz9477_port_fdb_add,
+ .port_fdb_del = ksz9477_port_fdb_del,
.port_mdb_prepare = ksz_port_mdb_prepare,
- .port_mdb_add = ksz_port_mdb_add,
- .port_mdb_del = ksz_port_mdb_del,
- .port_mirror_add = ksz_port_mirror_add,
- .port_mirror_del = ksz_port_mirror_del,
+ .port_mdb_add = ksz9477_port_mdb_add,
+ .port_mdb_del = ksz9477_port_mdb_del,
+ .port_mirror_add = ksz9477_port_mirror_add,
+ .port_mirror_del = ksz9477_port_mirror_del,
};
struct ksz_chip_data {
@@ -1093,7 +1095,7 @@ struct ksz_chip_data {
int port_cnt;
};
-static const struct ksz_chip_data ksz_switch_chips[] = {
+static const struct ksz_chip_data ksz9477_switch_chips[] = {
{
.chip_id = 0x00947700,
.dev_name = "KSZ9477",
@@ -1114,7 +1116,7 @@ struct ksz_chip_data {
},
};
-static int ksz_switch_init(struct ksz_device *dev)
+static int ksz9477_switch_init(struct ksz_device *dev)
{
int i;
@@ -1124,8 +1126,8 @@ static int ksz_switch_init(struct ksz_device *dev)
dev->ds->ops = &ksz_switch_ops;
- for (i = 0; i < ARRAY_SIZE(ksz_switch_chips); i++) {
- const struct ksz_chip_data *chip = &ksz_switch_chips[i];
+ for (i = 0; i < ARRAY_SIZE(ksz9477_switch_chips); i++) {
+ const struct ksz_chip_data *chip = &ksz9477_switch_chips[i];
if (dev->chip_id == chip->chip_id) {
dev->name = chip->dev_name;
@@ -1212,7 +1214,7 @@ int ksz_switch_register(struct ksz_device *dev)
if (ksz_switch_detect(dev))
return -EINVAL;
- ret = ksz_switch_init(dev);
+ ret = ksz9477_switch_init(dev);
if (ret)
return ret;
--
1.9.1
^ permalink raw reply related
* [PATCH v3 net-next 03/11] net: dsa: microchip: Initialize mutex before use
From: Tristram.Ha @ 2018-10-23 2:26 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Pavel Machek, Ruediger Schmitt
Cc: Tristram Ha, Arkadi Sharshevsky, UNGLinuxDriver, netdev
In-Reply-To: <1540261575-1889-1-git-send-email-Tristram.Ha@microchip.com>
From: Tristram Ha <Tristram.Ha@microchip.com>
Initialize mutex before use.
Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com>
---
drivers/net/dsa/microchip/ksz_common.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 8c5853e..88e8d2a 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -1118,7 +1118,6 @@ static int ksz_switch_init(struct ksz_device *dev)
{
int i;
- mutex_init(&dev->reg_mutex);
mutex_init(&dev->stats_mutex);
mutex_init(&dev->alu_mutex);
mutex_init(&dev->vlan_mutex);
@@ -1207,6 +1206,9 @@ int ksz_switch_register(struct ksz_device *dev)
if (dev->pdata)
dev->chip_id = dev->pdata->chip_id;
+ /* mutex is used in next function call. */
+ mutex_init(&dev->reg_mutex);
+
if (ksz_switch_detect(dev))
return -EINVAL;
--
1.9.1
^ permalink raw reply related
* [PATCH v3 net-next 01/11] net: dsa: microchip: Replace license with GPL
From: Tristram.Ha @ 2018-10-23 2:26 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Pavel Machek
Cc: Tristram Ha, Ruediger Schmitt, UNGLinuxDriver, netdev
In-Reply-To: <1540261575-1889-1-git-send-email-Tristram.Ha@microchip.com>
From: Tristram Ha <Tristram.Ha@microchip.com>
Replace license with GPL.
Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com>
Reviewed-by: Woojung Huh <Woojung.Huh@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/dsa/microchip/ksz_9477_reg.h | 23 ++++++++++++-----------
drivers/net/dsa/microchip/ksz_common.c | 23 ++++++++++++-----------
drivers/net/dsa/microchip/ksz_priv.h | 23 ++++++++++++-----------
drivers/net/dsa/microchip/ksz_spi.c | 23 ++++++++++++-----------
4 files changed, 48 insertions(+), 44 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz_9477_reg.h b/drivers/net/dsa/microchip/ksz_9477_reg.h
index 6aa6752..6d63442 100644
--- a/drivers/net/dsa/microchip/ksz_9477_reg.h
+++ b/drivers/net/dsa/microchip/ksz_9477_reg.h
@@ -1,19 +1,20 @@
/*
* Microchip KSZ9477 register definitions
*
- * Copyright (C) 2017
+ * Copyright (C) 2017-2018 Microchip Technology Inc.
*
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __KSZ9477_REGS_H
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 54e0ca6..fe95b9f 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -1,19 +1,20 @@
/*
* Microchip switch driver main logic
*
- * Copyright (C) 2017
+ * Copyright (C) 2017-2018 Microchip Technology Inc.
*
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/delay.h>
diff --git a/drivers/net/dsa/microchip/ksz_priv.h b/drivers/net/dsa/microchip/ksz_priv.h
index 2a98dbd..824ed57 100644
--- a/drivers/net/dsa/microchip/ksz_priv.h
+++ b/drivers/net/dsa/microchip/ksz_priv.h
@@ -1,19 +1,20 @@
/*
* Microchip KSZ series switch common definitions
*
- * Copyright (C) 2017
+ * Copyright (C) 2017-2018 Microchip Technology Inc.
*
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __KSZ_PRIV_H
diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c
index 8c1778b..49ca88d 100644
--- a/drivers/net/dsa/microchip/ksz_spi.c
+++ b/drivers/net/dsa/microchip/ksz_spi.c
@@ -1,19 +1,20 @@
/*
* Microchip KSZ series register access through SPI
*
- * Copyright (C) 2017
+ * Copyright (C) 2017-2018 Microchip Technology Inc.
*
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <asm/unaligned.h>
--
1.9.1
^ permalink raw reply related
* [PATCH v3 net-next 00/11] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers
From: Tristram.Ha @ 2018-10-23 2:26 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Pavel Machek
Cc: Tristram Ha, Ruediger Schmitt, UNGLinuxDriver, netdev
From: Tristram Ha <Tristram.Ha@microchip.com>
This series of patches is to modify the original KSZ9477 DSA driver so
that other KSZ switch drivers can be added and use the common code.
There are several steps to accomplish this achievement. First is to
rename some function names with a prefix to indicate chip specific
function. Second is to move common code into header that can be shared.
Last is to modify tag_ksz.c so that it can handle many tail tag formats
used by different KSZ switch drivers.
ksz_common.c will contain the common code used by all KSZ switch drivers.
ksz9477.c will contain KSZ9477 code from the original ksz_common.c.
ksz9477_spi.c is renamed from ksz_spi.c.
ksz9477_reg.h is renamed from ksz_9477_reg.h.
ksz_common.h is added to provide common code access to KSZ switch
drivers.
ksz_spi.h is added to provide common SPI access functions to KSZ SPI
drivers.
v3
- The phy_device structure is used to hold port link information
- A structure is passed in ksz_xmit and ksz_rcv instead of function pointer
- Switch offload forwarding is supported
v2
- Initialize reg_mutex before use
- The alu_mutex is only used inside chip specific functions
v1
- Each patch in the set is self-contained
- Use ksz9477 prefix to indicate KSZ9477 specific code
Tristram Ha (11):
Replace license with GPL.
Clean up code according to patch check suggestions.
Initialize mutex before use.
Rename some functions with ksz9477 prefix to separate chip specific
code from common code.
Rename ksz_spi.c to ksz9477_spi.c and update Kconfig in preparation to
add more KSZ switch drivers.
Break KSZ9477 DSA driver into two files in preparation to add more KSZ
switch drivers. Add common functions in ksz_common.h so that
other KSZ switch drivers can access code in ksz_common.c.
Add ksz_spi.h for common functions used by KSZ switch SPI drivers.
Prepare PHY for proper advertisement and get link status for the port.
Rename ksz_9477_reg.h to ksz9477_reg.h for consistency as the product
name is always KSZ####.
Add MIB counter reading support.
Modify tag_ksz.c so that tail tag code can be used by other KSZ switch
drivers.
Add switch offload forwarding support.
drivers/net/dsa/microchip/Kconfig | 18 +-
drivers/net/dsa/microchip/Makefile | 5 +-
drivers/net/dsa/microchip/ksz9477.c | 1387 ++++++++++++++++++++
.../microchip/{ksz_9477_reg.h => ksz9477_reg.h} | 23 +-
drivers/net/dsa/microchip/ksz9477_spi.c | 189 +++
drivers/net/dsa/microchip/ksz_common.c | 1253 ++++--------------
drivers/net/dsa/microchip/ksz_common.h | 231 ++++
drivers/net/dsa/microchip/ksz_priv.h | 256 ++--
drivers/net/dsa/microchip/ksz_spi.c | 217 ---
drivers/net/dsa/microchip/ksz_spi.h | 82 ++
include/net/dsa.h | 2 +-
net/dsa/Kconfig | 4 +
net/dsa/dsa.c | 8 +-
net/dsa/dsa_priv.h | 2 +-
net/dsa/tag_ksz.c | 101 +-
15 files changed, 2354 insertions(+), 1424 deletions(-)
create mode 100644 drivers/net/dsa/microchip/ksz9477.c
rename drivers/net/dsa/microchip/{ksz_9477_reg.h => ksz9477_reg.h} (98%)
create mode 100644 drivers/net/dsa/microchip/ksz9477_spi.c
create mode 100644 drivers/net/dsa/microchip/ksz_common.h
delete mode 100644 drivers/net/dsa/microchip/ksz_spi.c
create mode 100644 drivers/net/dsa/microchip/ksz_spi.h
--
1.9.1
^ permalink raw reply
* Re: [PATCH] tipc: use destination length for copy string
From: David Miller @ 2018-10-23 2:25 UTC (permalink / raw)
To: gqjiang; +Cc: jon.maloy, ying.xue, netdev, tipc-discussion
In-Reply-To: <20181019040822.15961-1-gqjiang@suse.com>
From: Guoqing Jiang <gqjiang@suse.com>
Date: Fri, 19 Oct 2018 12:08:22 +0800
> Got below warning with gcc 8.2 compiler.
>
> net/tipc/topsrv.c: In function ‘tipc_topsrv_start’:
> net/tipc/topsrv.c:660:2: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
> strncpy(srv->name, name, strlen(name) + 1);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> net/tipc/topsrv.c:660:27: note: length computed here
> strncpy(srv->name, name, strlen(name) + 1);
> ^~~~~~~~~~~~
> So change it to correct length and use strscpy.
>
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Applied.
^ permalink raw reply
* Re: [PATCH v3] isdn: hfc_{pci,sx}: Avoid empty body if statements
From: David Miller @ 2018-10-23 2:25 UTC (permalink / raw)
To: natechancellor; +Cc: isdn, netdev, linux-kernel, yamada.masahiro
In-Reply-To: <20181019011103.32087-1-natechancellor@gmail.com>
From: Nathan Chancellor <natechancellor@gmail.com>
Date: Thu, 18 Oct 2018 18:11:04 -0700
> Clang warns:
>
> drivers/isdn/hisax/hfc_pci.c:131:34: error: if statement has empty body
> [-Werror,-Wempty-body]
> if (Read_hfc(cs, HFCPCI_INT_S1));
> ^
> drivers/isdn/hisax/hfc_pci.c:131:34: note: put the semicolon on a
> separate line to silence this warning
>
> In my attempt to hide the warnings because I thought they didn't serve
> any purpose[1], Masahiro Yamada pointed out that {Read,Write}_hfc in
> hci_pci.c should be using a standard register access method; otherwise,
> the compiler will just remove the if statements.
>
> For hfc_pci, use the versions of {Read,Write}_hfc found in
> drivers/isdn/hardware/mISDN/hfc_pCI.h while converting pci_io to be
> 'void __iomem *' (and clean up ioremap) then remove the empty if
> statements.
>
> For hfc_sx, {Read,Write}_hfc are already use a proper register accessor
> (inb, outb) so just remove the unnecessary if statements.
>
> [1]: https://lore.kernel.org/lkml/20181016021454.11953-1-natechancellor@gmail.com/
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/66
> Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Applied.
^ permalink raw reply
* [PATCH net] net/ipv6: Add anycast addresses to a global hashtable
From: Jeff Barnhill @ 2018-10-23 2:12 UTC (permalink / raw)
To: netdev; +Cc: davem, kuznet, yoshfuji, Jeff Barnhill
icmp6_send() function is expensive on systems with a large number of
interfaces. Every time it’s called, it has to verify that the source
address does not correspond to an existing anycast address by looping
through every device and every anycast address on the device. This can
result in significant delays for a CPU when there are a large number of
neighbors and ND timers are frequently timing out and calling
neigh_invalidate().
Add anycast addresses to a global hashtable to allow quick searching for
matching anycast addresses. This is based on inet6_addr_lst in addrconf.c.
Signed-off-by: Jeff Barnhill <0xeffeff@gmail.com>
---
include/net/addrconf.h | 2 +
include/net/if_inet6.h | 8 ++++
net/ipv6/af_inet6.c | 5 ++
net/ipv6/anycast.c | 122 ++++++++++++++++++++++++++++++++++++++++++++++++-
4 files changed, 135 insertions(+), 2 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 6def0351bcc3..0cee3f99c41d 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -312,6 +312,8 @@ bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
const struct in6_addr *addr);
bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev,
const struct in6_addr *addr);
+int anycast_init(void);
+void anycast_cleanup(void);
/* Device notifier */
int register_inet6addr_notifier(struct notifier_block *nb);
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index d7578cf49c3a..ac02b2cf2ba1 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -142,6 +142,14 @@ struct ipv6_ac_socklist {
struct ipv6_ac_socklist *acl_next;
};
+struct ipv6_ac_addrlist {
+ struct in6_addr acal_addr;
+ int acal_ifindex; /* net */
+ int acal_users;
+ struct hlist_node acal_lst; /* inet6_acaddr_lst */
+ struct rcu_head rcu;
+};
+
struct ifacaddr6 {
struct in6_addr aca_addr;
struct fib6_info *aca_rt;
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 9a4261e50272..971a05fdd3bd 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -1001,6 +1001,9 @@ static int __init inet6_init(void)
err = ip6_flowlabel_init();
if (err)
goto ip6_flowlabel_fail;
+ err = anycast_init();
+ if (err)
+ goto anycast_fail;
err = addrconf_init();
if (err)
goto addrconf_fail;
@@ -1091,6 +1094,8 @@ static int __init inet6_init(void)
ipv6_exthdrs_fail:
addrconf_cleanup();
addrconf_fail:
+ anycast_cleanup();
+anycast_fail:
ip6_flowlabel_cleanup();
ip6_flowlabel_fail:
ndisc_late_cleanup();
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 4e0ff7031edd..58d31e0980aa 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -44,8 +44,22 @@
#include <net/checksum.h>
+#define IN6_ADDR_HSIZE_SHIFT 8
+#define IN6_ADDR_HSIZE BIT(IN6_ADDR_HSIZE_SHIFT)
+/* anycast address hash table
+ */
+static struct hlist_head inet6_acaddr_lst[IN6_ADDR_HSIZE];
+static DEFINE_SPINLOCK(acaddr_hash_lock);
+
static int ipv6_dev_ac_dec(struct net_device *dev, const struct in6_addr *addr);
+static u32 inet6_acaddr_hash(struct net *net, const struct in6_addr *addr)
+{
+ u32 val = ipv6_addr_hash(addr) ^ net_hash_mix(net);
+
+ return hash_32(val, IN6_ADDR_HSIZE_SHIFT);
+}
+
/*
* socket join an anycast group
*/
@@ -204,6 +218,73 @@ void ipv6_sock_ac_close(struct sock *sk)
rtnl_unlock();
}
+static struct ipv6_ac_addrlist *acal_alloc(int ifindex,
+ const struct in6_addr *addr)
+{
+ struct ipv6_ac_addrlist *acal;
+
+ acal = kzalloc(sizeof(*acal), GFP_ATOMIC);
+ if (!acal)
+ return NULL;
+
+ acal->acal_addr = *addr;
+ acal->acal_ifindex = ifindex;
+ acal->acal_users = 1;
+ INIT_HLIST_NODE(&acal->acal_lst);
+
+ return acal;
+}
+
+static int ipv6_add_acaddr_hash(struct net *net, const struct in6_addr *addr)
+{
+ unsigned int hash = inet6_acaddr_hash(net, addr);
+ struct ipv6_ac_addrlist *acal;
+ int err = 0;
+
+ spin_lock(&acaddr_hash_lock);
+ hlist_for_each_entry(acal, &inet6_acaddr_lst[hash], acal_lst) {
+ if (acal->acal_ifindex != net->ifindex)
+ continue;
+ if (ipv6_addr_equal(&acal->acal_addr, addr)) {
+ acal->acal_users++;
+ goto out;
+ }
+ }
+
+ acal = acal_alloc(net->ifindex, addr);
+ if (!acal) {
+ err = -ENOMEM;
+ goto out;
+ }
+
+ hlist_add_head_rcu(&acal->acal_lst, &inet6_acaddr_lst[hash]);
+
+out:
+ spin_unlock(&acaddr_hash_lock);
+ return err;
+}
+
+static void ipv6_del_acaddr_hash(struct net *net, const struct in6_addr *addr)
+{
+ unsigned int hash = inet6_acaddr_hash(net, addr);
+ struct ipv6_ac_addrlist *acal;
+
+ spin_lock(&acaddr_hash_lock);
+ hlist_for_each_entry(acal, &inet6_acaddr_lst[hash], acal_lst) {
+ if (acal->acal_ifindex != net->ifindex)
+ continue;
+ if (ipv6_addr_equal(&acal->acal_addr, addr)) {
+ if (--acal->acal_users < 1) {
+ hlist_del_init_rcu(&acal->acal_lst);
+ kfree_rcu(acal, rcu);
+ }
+ spin_unlock(&acaddr_hash_lock);
+ return;
+ }
+ }
+ spin_unlock(&acaddr_hash_lock);
+}
+
static void aca_get(struct ifacaddr6 *aca)
{
refcount_inc(&aca->aca_refcnt);
@@ -275,6 +356,13 @@ int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr)
err = -ENOMEM;
goto out;
}
+ err = ipv6_add_acaddr_hash(dev_net(idev->dev), addr);
+ if (err) {
+ fib6_info_release(f6i);
+ fib6_info_release(f6i);
+ kfree(aca);
+ goto out;
+ }
aca->aca_next = idev->ac_list;
idev->ac_list = aca;
@@ -324,6 +412,7 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr)
prev_aca->aca_next = aca->aca_next;
else
idev->ac_list = aca->aca_next;
+ ipv6_del_acaddr_hash(dev_net(idev->dev), &aca->aca_addr);
write_unlock_bh(&idev->lock);
addrconf_leave_solict(idev, &aca->aca_addr);
@@ -350,6 +439,8 @@ void ipv6_ac_destroy_dev(struct inet6_dev *idev)
write_lock_bh(&idev->lock);
while ((aca = idev->ac_list) != NULL) {
idev->ac_list = aca->aca_next;
+ ipv6_del_acaddr_hash(dev_net(idev->dev), &aca->aca_addr);
+
write_unlock_bh(&idev->lock);
addrconf_leave_solict(idev, &aca->aca_addr);
@@ -391,16 +482,22 @@ bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
const struct in6_addr *addr)
{
bool found = false;
+ unsigned int hash = inet6_acaddr_hash(net, addr);
+ struct ipv6_ac_addrlist *acal;
rcu_read_lock();
if (dev)
found = ipv6_chk_acast_dev(dev, addr);
else
- for_each_netdev_rcu(net, dev)
- if (ipv6_chk_acast_dev(dev, addr)) {
+ hlist_for_each_entry_rcu(acal, &inet6_acaddr_lst[hash],
+ acal_lst) {
+ if (acal->acal_ifindex != net->ifindex)
+ continue;
+ if (ipv6_addr_equal(&acal->acal_addr, addr)) {
found = true;
break;
}
+ }
rcu_read_unlock();
return found;
}
@@ -539,4 +636,25 @@ void ac6_proc_exit(struct net *net)
{
remove_proc_entry("anycast6", net->proc_net);
}
+
+/* Init / cleanup code
+ */
+int __init anycast_init(void)
+{
+ int i;
+
+ for (i = 0; i < IN6_ADDR_HSIZE; i++)
+ INIT_HLIST_HEAD(&inet6_acaddr_lst[i]);
+ return 0;
+}
+
+void anycast_cleanup(void)
+{
+ int i;
+
+ spin_lock(&acaddr_hash_lock);
+ for (i = 0; i < IN6_ADDR_HSIZE; i++)
+ WARN_ON(!hlist_empty(&inet6_acaddr_lst[i]));
+ spin_unlock(&acaddr_hash_lock);
+}
#endif
--
2.14.1
^ permalink raw reply related
* KASAN: use-after-free Read in sctp_outq_select_transport
From: syzbot @ 2018-10-23 10:13 UTC (permalink / raw)
To: davem, linux-kernel, linux-sctp, marcelo.leitner, netdev, nhorman,
syzkaller-bugs, vyasevich
Hello,
syzbot found the following crash on:
HEAD commit: 23469de647c4 Merge git://git.kernel.org/pub/scm/linux/kern..
git tree: net
console output: https://syzkaller.appspot.com/x/log.txt?x=13580ce5400000
kernel config: https://syzkaller.appspot.com/x/.config?x=b3f55cb3dfcc6c33
dashboard link: https://syzkaller.appspot.com/bug?extid=56a40ceee5fb35932f4d
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
Unfortunately, I don't have any reproducer for this crash yet.
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+56a40ceee5fb35932f4d@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: use-after-free in sctp_outq_select_transport+0x77e/0x9a0
net/sctp/outqueue.c:840
Read of size 4 at addr ffff8801c5ff2614 by task syz-executor5/8275
CPU: 0 PID: 8275 Comm: syz-executor5 Not tainted 4.19.0-rc8+ #152
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1c4/0x2b6 lib/dump_stack.c:113
print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432
sctp_outq_select_transport+0x77e/0x9a0 net/sctp/outqueue.c:840
sctp_outq_flush_data net/sctp/outqueue.c:1100 [inline]
sctp_outq_flush+0x14f7/0x34f0 net/sctp/outqueue.c:1209
sctp_outq_uncork+0x6a/0x80 net/sctp/outqueue.c:776
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1820 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1220 [inline]
sctp_do_sm+0x608/0x7190 net/sctp/sm_sideeffect.c:1191
sctp_assoc_bh_rcv+0x346/0x670 net/sctp/associola.c:1067
sctp_inq_push+0x280/0x370 net/sctp/inqueue.c:95
sctp_rcv+0x2d93/0x3c00 net/sctp/input.c:268
sctp6_rcv+0x15/0x30 net/sctp/ipv6.c:1061
ip6_input_finish+0x3fc/0x1aa0 net/ipv6/ip6_input.c:383
NF_HOOK include/linux/netfilter.h:289 [inline]
ip6_input+0xe9/0x600 net/ipv6/ip6_input.c:426
dst_input include/net/dst.h:450 [inline]
ip6_rcv_finish+0x17a/0x330 net/ipv6/ip6_input.c:76
NF_HOOK include/linux/netfilter.h:289 [inline]
ipv6_rcv+0x120/0x640 net/ipv6/ip6_input.c:271
__netif_receive_skb_one_core+0x14d/0x200 net/core/dev.c:4913
__netif_receive_skb+0x2c/0x1e0 net/core/dev.c:5023
process_backlog+0x218/0x6f0 net/core/dev.c:5829
napi_poll net/core/dev.c:6249 [inline]
net_rx_action+0x7c5/0x1950 net/core/dev.c:6315
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
__do_softirq+0x30c/0xb03 kernel/softirq.c:292
do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1047
</IRQ>
do_softirq.part.13+0x126/0x160 kernel/softirq.c:336
do_softirq kernel/softirq.c:328 [inline]
__local_bh_enable_ip+0x21d/0x260 kernel/softirq.c:189
local_bh_enable include/linux/bottom_half.h:32 [inline]
rcu_read_unlock_bh include/linux/rcupdate.h:723 [inline]
ip6_finish_output2+0xce4/0x27a0 net/ipv6/ip6_output.c:121
ip6_finish_output+0x58c/0xc60 net/ipv6/ip6_output.c:154
NF_HOOK_COND include/linux/netfilter.h:278 [inline]
ip6_output+0x232/0x9d0 net/ipv6/ip6_output.c:171
dst_output include/net/dst.h:444 [inline]
NF_HOOK include/linux/netfilter.h:289 [inline]
ip6_xmit+0xf69/0x2420 net/ipv6/ip6_output.c:275
sctp_v6_xmit+0x3b2/0x790 net/sctp/ipv6.c:230
sctp_packet_transmit+0x298e/0x3db0 net/sctp/output.c:656
sctp_packet_singleton net/sctp/outqueue.c:791 [inline]
sctp_outq_flush_ctrl.constprop.11+0x7a9/0xe50 net/sctp/outqueue.c:922
sctp_outq_flush+0x310/0x34f0 net/sctp/outqueue.c:1204
sctp_outq_uncork+0x6a/0x80 net/sctp/outqueue.c:776
kobject: 'rfkill9' (0000000067be229d): fill_kobj_path: path
= '/devices/virtual/mac80211_hwsim/hwsim7/ieee80211/phy7/rfkill9'
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1349 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1220 [inline]
sctp_do_sm+0x4f25/0x7190 net/sctp/sm_sideeffect.c:1191
ieee80211 phy7: Selected rate control algorithm 'minstrel_ht'
kobject: 'net' (00000000cdd117dc): kobject_add_internal: parent: 'hwsim7',
set: '(null)'
sctp_endpoint_bh_rcv+0x465/0x960 net/sctp/endpointola.c:456
kobject: 'wlan0' (00000000c9d333fc): kobject_add_internal: parent: 'net',
set: 'devices'
sctp_inq_push+0x280/0x370 net/sctp/inqueue.c:95
sctp_backlog_rcv+0x1a8/0xd50 net/sctp/input.c:351
kobject: 'wlan0' (00000000c9d333fc): kobject_uevent_env
kobject: 'wlan0' (00000000c9d333fc): fill_kobj_path: path
= '/devices/virtual/mac80211_hwsim/hwsim7/net/wlan0'
sk_backlog_rcv include/net/sock.h:931 [inline]
__release_sock+0x12f/0x3a0 net/core/sock.c:2336
kobject: 'queues' (00000000c5d009e9): kobject_add_internal:
parent: 'wlan0', set: '<NULL>'
release_sock+0xad/0x2c0 net/core/sock.c:2849
sock_setsockopt+0x60d/0x2280 net/core/sock.c:1054
kobject: 'queues' (00000000c5d009e9): kobject_uevent_env
kobject: 'queues' (00000000c5d009e9): kobject_uevent_env: filter function
caused the event to drop!
__sys_setsockopt+0x304/0x3c0 net/socket.c:1898
kobject: 'rx-0' (000000007736ba36): kobject_add_internal: parent: 'queues',
set: 'queues'
__do_sys_setsockopt net/socket.c:1913 [inline]
__se_sys_setsockopt net/socket.c:1910 [inline]
__x64_sys_setsockopt+0xbe/0x150 net/socket.c:1910
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
kobject: 'rx-0' (000000007736ba36): kobject_uevent_env
entry_SYSCALL_64_after_hwframe+0x49/0xbe
kobject: 'rx-0' (000000007736ba36): fill_kobj_path: path
= '/devices/virtual/mac80211_hwsim/hwsim7/net/wlan0/queues/rx-0'
RIP: 0033:0x457569
Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7
48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff
ff 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f0613beec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000457569
RDX: 000000000000001a RSI: 0000000000000001 RDI: 0000000000000003
RBP: 000000000072c040 R08: 0000000000000010 R09: 0000000000000000
R10: 00000000200000c0 R11: 0000000000000246 R12: 00007f0613bef6d4
R13: 00000000004c3b61 R14: 00000000004d5c88 R15: 00000000ffffffff
Allocated by task 8261:
save_stack+0x43/0xd0 mm/kasan/kasan.c:448
kobject: 'tx-0' (000000008f0eae4c): kobject_add_internal: parent: 'queues',
set: 'queues'
set_track mm/kasan/kasan.c:460 [inline]
kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553
kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620
kmalloc include/linux/slab.h:513 [inline]
kzalloc include/linux/slab.h:707 [inline]
sctp_transport_new+0x10a/0x880 net/sctp/transport.c:111
sctp_assoc_add_peer+0x2de/0x10d0 net/sctp/associola.c:630
sctp_process_param net/sctp/sm_make_chunk.c:2540 [inline]
sctp_process_init+0xfc0/0x29e0 net/sctp/sm_make_chunk.c:2356
sctp_cmd_process_init net/sctp/sm_sideeffect.c:682 [inline]
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1410 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1220 [inline]
sctp_do_sm+0x13b9/0x7190 net/sctp/sm_sideeffect.c:1191
sctp_assoc_bh_rcv+0x346/0x670 net/sctp/associola.c:1067
sctp_inq_push+0x280/0x370 net/sctp/inqueue.c:95
sctp_backlog_rcv+0x1a8/0xd50 net/sctp/input.c:351
sk_backlog_rcv include/net/sock.h:931 [inline]
__release_sock+0x12f/0x3a0 net/core/sock.c:2336
kobject: 'tx-0' (000000008f0eae4c): kobject_uevent_env
release_sock+0xad/0x2c0 net/core/sock.c:2849
sctp_wait_for_connect+0x391/0x640 net/sctp/socket.c:8667
sctp_sendmsg_to_asoc+0x1d0f/0x2230 net/sctp/socket.c:1985
sctp_sendmsg+0x13c2/0x1da0 net/sctp/socket.c:2131
inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798
sock_sendmsg_nosec net/socket.c:621 [inline]
sock_sendmsg+0xd5/0x120 net/socket.c:631
__sys_sendto+0x3d7/0x670 net/socket.c:1788
__do_sys_sendto net/socket.c:1800 [inline]
__se_sys_sendto net/socket.c:1796 [inline]
__x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
kobject: 'tx-0' (000000008f0eae4c): fill_kobj_path: path
= '/devices/virtual/mac80211_hwsim/hwsim7/net/wlan0/queues/tx-0'
Freed by task 9:
save_stack+0x43/0xd0 mm/kasan/kasan.c:448
set_track mm/kasan/kasan.c:460 [inline]
__kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
__cache_free mm/slab.c:3498 [inline]
kfree+0xcf/0x230 mm/slab.c:3813
sctp_transport_destroy_rcu+0x4a/0x60 net/sctp/transport.c:163
__rcu_reclaim kernel/rcu/rcu.h:236 [inline]
rcu_do_batch kernel/rcu/tree.c:2576 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2880 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2847 [inline]
rcu_process_callbacks+0xf23/0x2670 kernel/rcu/tree.c:2864
__do_softirq+0x30c/0xb03 kernel/softirq.c:292
kobject: 'tx-1' (000000009aaee194): kobject_add_internal: parent: 'queues',
set: 'queues'
The buggy address belongs to the object at ffff8801c5ff24c0
which belongs to the cache kmalloc-1024 of size 1024
The buggy address is located 340 bytes inside of
1024-byte region [ffff8801c5ff24c0, ffff8801c5ff28c0)
The buggy address belongs to the page:
page:ffffea000717fc80 count:1 mapcount:0 mapping:ffff8801da800ac0 index:0x0
compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffffea00070ed808 ffffea00071b2488 ffff8801da800ac0
raw: 0000000000000000 ffff8801c5ff2040 0000000100000007 0000000000000000
kobject: 'tx-1' (000000009aaee194): kobject_uevent_env
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8801c5ff2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8801c5ff2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff8801c5ff2600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8801c5ff2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8801c5ff2700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.
^ permalink raw reply
* Re: [PATCH] rtlwifi: btcoex: remove set but not used variable 'ppsc'
From: Pkshih @ 2018-10-23 1:24 UTC (permalink / raw)
To: yuehaibing@huawei.com, kvalo@codeaurora.org,
colin.king@canonical.com, Larry.Finger@lwfinger.net,
natechancellor@gmail.com
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
In-Reply-To: <1540194675-65562-1-git-send-email-yuehaibing@huawei.com>
On Mon, 2018-10-22 at 07:51 +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c: In function
> 'halbtc_leave_lps':
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:295:21: warning:
> variable 'ppsc' set but not used [-Wunused-but-set-variable]
>
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c: In function
> 'halbtc_enter_lps':
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:318:21: warning:
> variable 'ppsc' set but not used [-Wunused-but-set-variable]
>
> It never used since introduction in
> commit aa45a673b291 ("rtlwifi: btcoexist: Add new mini driver")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
^ permalink raw reply
* Re: [PATCH v2] rtlwifi: remove set but not used variable 'radiob_array_table' and 'radiob_arraylen'
From: Pkshih @ 2018-10-23 9:35 UTC (permalink / raw)
To: zhongjiang@huawei.com, kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org, davem@davemloft.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <1540283282-9772-1-git-send-email-zhongjiang@huawei.com>
On Tue, 2018-10-23 at 16:28 +0800, zhong jiang wrote:
> radiob_array_table' and 'radiob_arraylen' are not used after setting its
> value.
> It is safe to remove the unused variable. Meanwhile, radio B radio should be
> removed as well. because it will no longer be referenced.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Thank you
^ permalink raw reply
* Re: [PATCH] rtlwifi: remove set but not used variable 'radiob_array_table' and 'radiob_arraylen'
From: zhong jiang @ 2018-10-23 8:23 UTC (permalink / raw)
To: Pkshih
Cc: kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
In-Reply-To: <1540281873.25715.2.camel@realtek.com>
On 2018/10/23 16:05, Pkshih wrote:
> On Tue, 2018-10-23 at 13:47 +0800, zhong jiang wrote:
>> 'radiob_array_table' and 'radiob_arraylen' is not used after setting its
>> value.
>> It is safe to remove the unused variable.
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>> drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
>> b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
>> index 5cf29f5..3f33278 100644
>> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
>> @@ -509,13 +509,10 @@ bool rtl8723e_phy_config_rf_with_headerfile(struct
>> ieee80211_hw *hw,
>> int i;
>> bool rtstatus = true;
>> u32 *radioa_array_table;
>> - u32 *radiob_array_table;
>> - u16 radioa_arraylen, radiob_arraylen;
>> + u16 radioa_arraylen;
>>
>> radioa_arraylen = RTL8723ERADIOA_1TARRAYLENGTH;
>> radioa_array_table = RTL8723E_RADIOA_1TARRAY;
>> - radiob_arraylen = RTL8723E_RADIOB_1TARRAYLENGTH;
>> - radiob_array_table = RTL8723E_RADIOB_1TARRAY;
>>
>> rtstatus = true;
>>
> I think 8723ae has only one antenna, so you can remove radio B array as well.
>
Yep, Will do.
Thanks,
zhong jiang
^ permalink raw reply
* Re: [PATCH] rtlwifi: remove set but not used variable 'radiob_array_table' and 'radiob_arraylen'
From: Pkshih @ 2018-10-23 8:05 UTC (permalink / raw)
To: zhongjiang@huawei.com, kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org, davem@davemloft.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <1540273651-64688-1-git-send-email-zhongjiang@huawei.com>
On Tue, 2018-10-23 at 13:47 +0800, zhong jiang wrote:
> 'radiob_array_table' and 'radiob_arraylen' is not used after setting its
> value.
> It is safe to remove the unused variable.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> index 5cf29f5..3f33278 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> @@ -509,13 +509,10 @@ bool rtl8723e_phy_config_rf_with_headerfile(struct
> ieee80211_hw *hw,
> int i;
> bool rtstatus = true;
> u32 *radioa_array_table;
> - u32 *radiob_array_table;
> - u16 radioa_arraylen, radiob_arraylen;
> + u16 radioa_arraylen;
>
> radioa_arraylen = RTL8723ERADIOA_1TARRAYLENGTH;
> radioa_array_table = RTL8723E_RADIOA_1TARRAY;
> - radiob_arraylen = RTL8723E_RADIOB_1TARRAYLENGTH;
> - radiob_array_table = RTL8723E_RADIOB_1TARRAY;
>
> rtstatus = true;
>
I think 8723ae has only one antenna, so you can remove radio B array as well.
^ permalink raw reply
* Re: Improving accuracy of PHC readings
From: Richard Cochran @ 2018-10-22 22:48 UTC (permalink / raw)
To: Keller, Jacob E; +Cc: Miroslav Lichvar, netdev@vger.kernel.org
In-Reply-To: <02874ECE860811409154E81DA85FBB5884CDD9F4@ORSMSX115.amr.corp.intel.com>
On Fri, Oct 19, 2018 at 04:52:13PM +0000, Keller, Jacob E wrote:
> Nice! I think this is good. I'd love to see some data to back it up, but it makes sense to me.
+1
^ permalink raw reply
* Re: Improving accuracy of PHC readings
From: Richard Cochran @ 2018-10-22 22:48 UTC (permalink / raw)
To: Miroslav Lichvar; +Cc: netdev, Keller, Jacob E
In-Reply-To: <20181019095137.GG4407@localhost>
On Fri, Oct 19, 2018 at 11:51:37AM +0200, Miroslav Lichvar wrote:
> A solution to this would be a new driver function that wraps the
> latching register read with readings of the system clock and return
> three timestamps instead of one. For example:
>
> ktime_get_real_ts64(&sys_ts1);
> IXGBE_READ_REG(hw, IXGBE_SYSTIMR);
> ktime_get_real_ts64(&sys_ts2);
> phc_ts.tv_nsec = IXGBE_READ_REG(hw, IXGBE_SYSTIML);
> phc_ts.tv_sec = IXGBE_READ_REG(hw, IXGBE_SYSTIMH);
Makes sense...
> The extra timestamp doesn't fit the API of the PTP_SYS_OFFSET ioctl,
> so it would need to shift the timestamp it returns by the missing
> intervals (assuming the frequency offset between the PHC and system
> clock is small), or a new ioctl could be introduced that would return
> all timestamps in an array looking like this:
>
> [sys, phc, sys, sys, phc, sys, ...]
How about a new ioctl with number of trials as input and single offset
as output?
Then it would be up to the driver to implement the device-specific
loop.
Thanks,
Richard
^ permalink raw reply
* Re: [PATCH v2] wireless: mark expected switch fall-throughs
From: Johannes Berg @ 2018-10-23 7:01 UTC (permalink / raw)
To: Gustavo A. R. Silva, David S. Miller
Cc: linux-wireless, netdev, linux-kernel, Kees Cook
In-Reply-To: <20181023001308.GA4150@embeddedor.com>
On Tue, 2018-10-23 at 02:13 +0200, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> This code was not tested and GCC 7.2.0 was used to compile it.
Look, I'm not going to make this any clearer: I'm not applying patches
like that where you've invested no effort whatsoever on verifying that
they're correct.
johannes
^ permalink raw reply
* Re: CRC errors between mvneta and macb
From: Richard Genoud @ 2018-10-23 6:58 UTC (permalink / raw)
To: Andrew Lunn
Cc: Willy Tarreau, linux-kernel, Thomas Petazzoni, Antoine Tenart,
Gregory CLEMENT, Yelena Krivosheev, Maxime Chevallier,
Nicolas Ferre, netdev
In-Reply-To: <20181022181918.GF24112@lunn.ch>
Le 22/10/2018 à 20:19, Andrew Lunn a écrit :
>> I dug more on the subject, and I think I found what Marvell's PHY/MAC
>> doesn't like.
>
> Hi Richard
>
> What PHY is being used?
>
88E1512-NNP2
>> After analyzing the ethernet frame on the Davicom PHY's output (pin
>> TX+), I find out that the FCS errors occurs when the ethernet preamble
>> is longer than 56bits. (something like 58 or 60 bits)
>
> Some Marvell PHYs have a register bit which might be of interest: Page
> 2, register 16, bit 6.
>
> 0 = Pad odd nibble preambles in copper receive packets.
> 1 = Pass as is and do not pad odd nibble preambles in
>
> Andrew
>
Thanks, I'll look into that.
Richard
^ permalink raw reply
* [net-next:master 451/481] drivers/net/ethernet/amazon/ena/ena_com.h:1104:2: error: implicit declaration of function 'prefetchw'
From: kbuild test robot @ 2018-10-22 22:35 UTC (permalink / raw)
To: Netanel Belgazal; +Cc: kbuild-all, netdev
[-- Attachment #1: Type: text/plain, Size: 2922 bytes --]
Hi Netanel,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head: 21ea1d36f6dfcb1d59184937c672022d5d01902a
commit: 8c590f9776386b8f697fd0b7ed6142ae6e3de79e [451/481] net: ena: Fix Kconfig dependency on X86
config: microblaze-allmodconfig (attached as .config)
compiler: microblaze-linux-gcc (GCC) 8.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 8c590f9776386b8f697fd0b7ed6142ae6e3de79e
# save the attached .config to linux build tree
GCC_VERSION=8.1.0 make.cross ARCH=microblaze
All errors (new ones prefixed by >>):
In file included from drivers/net/ethernet/amazon/ena/ena_com.c:33:
drivers/net/ethernet/amazon/ena/ena_com.h: In function 'ena_com_get_next_bounce_buffer':
>> drivers/net/ethernet/amazon/ena/ena_com.h:1104:2: error: implicit declaration of function 'prefetchw' [-Werror=implicit-function-declaration]
prefetchw(bounce_buf_ctrl->base_buffer +
^~~~~~~~~
cc1: some warnings being treated as errors
vim +/prefetchw +1104 drivers/net/ethernet/amazon/ena/ena_com.h
1738cd3e Netanel Belgazal 2016-08-10 1092
689b2bda Arthur Kiyanovski 2018-10-11 1093 static inline u8 *ena_com_get_next_bounce_buffer(struct ena_com_io_bounce_buffer_control *bounce_buf_ctrl)
689b2bda Arthur Kiyanovski 2018-10-11 1094 {
689b2bda Arthur Kiyanovski 2018-10-11 1095 u16 size, buffers_num;
689b2bda Arthur Kiyanovski 2018-10-11 1096 u8 *buf;
689b2bda Arthur Kiyanovski 2018-10-11 1097
689b2bda Arthur Kiyanovski 2018-10-11 1098 size = bounce_buf_ctrl->buffer_size;
689b2bda Arthur Kiyanovski 2018-10-11 1099 buffers_num = bounce_buf_ctrl->buffers_num;
689b2bda Arthur Kiyanovski 2018-10-11 1100
689b2bda Arthur Kiyanovski 2018-10-11 1101 buf = bounce_buf_ctrl->base_buffer +
689b2bda Arthur Kiyanovski 2018-10-11 1102 (bounce_buf_ctrl->next_to_use++ & (buffers_num - 1)) * size;
689b2bda Arthur Kiyanovski 2018-10-11 1103
689b2bda Arthur Kiyanovski 2018-10-11 @1104 prefetchw(bounce_buf_ctrl->base_buffer +
689b2bda Arthur Kiyanovski 2018-10-11 1105 (bounce_buf_ctrl->next_to_use & (buffers_num - 1)) * size);
689b2bda Arthur Kiyanovski 2018-10-11 1106
689b2bda Arthur Kiyanovski 2018-10-11 1107 return buf;
689b2bda Arthur Kiyanovski 2018-10-11 1108 }
689b2bda Arthur Kiyanovski 2018-10-11 1109
:::::: The code at line 1104 was first introduced by commit
:::::: 689b2bdaaa1480ad2c14bdc4c6eaf38284549022 net: ena: add functions for handling Low Latency Queues in ena_com
:::::: TO: Arthur Kiyanovski <akiyano@amazon.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 54668 bytes --]
^ permalink raw reply
* Re: CRC errors between mvneta and macb
From: Richard Genoud @ 2018-10-23 6:56 UTC (permalink / raw)
To: Willy Tarreau, Richard Genoud
Cc: linux-kernel, Thomas Petazzoni, Antoine Tenart, Gregory CLEMENT,
Yelena Krivosheev, Maxime Chevallier, Nicolas Ferre, netdev,
Andrew Lunn
In-Reply-To: <20181022163429.GA22826@1wt.eu>
Le 22/10/2018 à 18:34, Willy Tarreau a écrit :
> On Mon, Oct 22, 2018 at 05:15:21PM +0200, Richard Genoud wrote:
>> After analyzing the ethernet frame on the Davicom PHY's output (pin
>> TX+), I find out that the FCS errors occurs when the ethernet preamble
>> is longer than 56bits. (something like 58 or 60 bits)
>>
>> To say this in another way, instead of having 28 times 1-0 followed by
>> the SFD (10101011), I see 29 or 30 times 1-0 followed by the SFD.
>> (sometimes 29, sometimes 30)
>>
>>
>> Should a longer preamble be considered as an FCS error ? It seems a
>> little harsh since the point of the preamble is to synchronize the frame.
>
> That indeed seems a bit strange considering that you're not supposed to
> know what is before the preamble so it would very well contain random
> noise looking a lot like alteranted bits.
>
>> I don't know what the 802.3 standard says about that.
>
> Just found it :-)
>
> https://www.trincoll.edu/Academics/MajorsAndMinors/Engineering/Documents/IEEE%20Standard%20for%20Ethernet.pdf
>
> Page 132, #7.2.3.2 :
>
> The DTE is required to supply at least 56 bits of preamble in
> order to satisfy system requirements. System components consume
> preamble bits in order to perform their functions. The number
> of preamble bits sourced ensures an adequate number of bits are
> provided to each system component to correctly implement its
> function.
>
> So that totally makes sense since the purpose is to enable signal
> detection at the hardware leve, hence the problem definitely is on
> the receiver in your case.
>
> Willy
>
Great ! Thanks !
I'll check on the Marvell side
Richard
^ permalink raw reply
* Re: Some suggestions for tc-tests
From: Lucas Bates @ 2018-10-22 21:54 UTC (permalink / raw)
To: Cong Wang; +Cc: Roman Mashak, Jamal Hadi Salim, Linux Kernel Network Developers
In-Reply-To: <CAM_iQpUHoq4Z8rqZvwkY2E8SqJDB_GdVCOcbG8eTJHAbxy-hcA@mail.gmail.com>
Hi Cong,
>
> 1. Create veth pair devices by its own. The most important thing for
> tc-tests is to automate everything, it is not friendly for users to
> create their own veth pair named v0p0 to just run the tests. tc-tests
> should be able to create a veth pair with random names and clean up
> them once it is finished.
You can actually do this automatically in two steps: first, create a
symlink to plugin-lib/nsPlugin.py in the plugins/ directory. Then,
when running tdc, always invoke the '-n' option. This will execute
all the commands inside a namespace *and* automatically create the
veth pair that get used in the testing.
It's referenced in the readme, but if you think it's useful to make it
a default setup I could add an installation/setup script to tdc to
create the symlink.
> 2. Test iproute2 version or capability. Apparently my iproute2 doesn't
> support tc filter chain yet, this makes many tests failed. Ideally,
> each test should be able to check if the iproute2 supports the thing
> it wants to test, if not just skip it, at least by default.
So is this a version you compile yourself, or is it just the default
/sbin/tc? Because you can specify the tc executable you want to use
in tdc_config.py... But yes, we're looking at ways to make sure the
support is there before running tests. We're hoping to send some patches soon.
> 3. Is there anything in the tests that can be done only with Python3?
> If we could lower the requirement to Python2, then it would be easier
> to setup and run these tests.
I'd have to go back and re-check to see what python 3-specific
features I'm using, but there *are* some.
Do you maybe have the ability to run a VM or Docker container on your
system to run python 3?
Thanks!
^ permalink raw reply
* [PATCH] rtlwifi: remove set but not used variable 'radiob_array_table' and 'radiob_arraylen'
From: zhong jiang @ 2018-10-23 5:47 UTC (permalink / raw)
To: kvalo; +Cc: pkshih, davem, linux-wireless, netdev, linux-kernel
'radiob_array_table' and 'radiob_arraylen' is not used after setting its value.
It is safe to remove the unused variable.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
index 5cf29f5..3f33278 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
@@ -509,13 +509,10 @@ bool rtl8723e_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
int i;
bool rtstatus = true;
u32 *radioa_array_table;
- u32 *radiob_array_table;
- u16 radioa_arraylen, radiob_arraylen;
+ u16 radioa_arraylen;
radioa_arraylen = RTL8723ERADIOA_1TARRAYLENGTH;
radioa_array_table = RTL8723E_RADIOA_1TARRAY;
- radiob_arraylen = RTL8723E_RADIOB_1TARRAYLENGTH;
- radiob_array_table = RTL8723E_RADIOB_1TARRAY;
rtstatus = true;
--
1.7.12.4
^ permalink raw reply related
* Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.
From: Huang, Ying @ 2018-10-23 5:37 UTC (permalink / raw)
To: Arun KS
Cc: Mike Snitzer, Benjamin Herrenschmidt, Kemi Wang,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, J. Bruce Fields,
linux-sctp-u79uwXL29TY76Z2rM5mHXA, Paul Mackerras, Pavel Machek,
Christoph Lameter, K. Y. Srinivasan, Sumit Semwal,
David (ChunMing) Zhou, Petr Tesarik, Michael Ellerman,
ceph-devel-u79uwXL29TY76Z2rM5mHXA, James E.J. Bottomley,
kasan-dev-/JYPxA39Uh5TLH3MbocFFw, Marcos Paulo de Souza,
Steven J. Hill, David Rientjes, Anthony Yznaga, Daniel Vacek,
Roman Gushchin, Len Brown <len.
In-Reply-To: <1540229092-25207-1-git-send-email-arunks-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Arun KS <arunks-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> writes:
> Remove managed_page_count_lock spinlock and instead use atomic
> variables.
>
> Suggested-by: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
> Suggested-by: Vlastimil Babka <vbabka-AlSwsSmVLrQ@public.gmane.org>
> Signed-off-by: Arun KS <arunks-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
>
> ---
> As discussed here,
> https://patchwork.kernel.org/patch/10627521/#22261253
My 2 cents. I think you should include at least part of the discussion
in the patch description to make it more readable by itself.
Best Regards,
Huang, Ying
^ permalink raw reply
* Re: [PATCH net 2/4] net/sched: act_police: disallow 'goto chain' on fallback control action
From: Jiri Pirko @ 2018-10-22 20:57 UTC (permalink / raw)
To: Davide Caratti; +Cc: Cong Wang, Jamal Hadi Salim, David S. Miller, netdev
In-Reply-To: <c2f076b0758b8cd997574b45c2abe064e28aca74.1540070509.git.dcaratti@redhat.com>
Sat, Oct 20, 2018 at 11:33:08PM CEST, dcaratti@redhat.com wrote:
>in the following command:
>
> # tc action add action police rate <r> burst <b> conform-exceed <c1>/<c2>
>
>'goto chain x' is allowed only for c1: setting it for c2 makes the kernel
>crash with NULL pointer dereference, since TC core doesn't initialize the
>chain handle.
>
>Signed-off-by: Davide Caratti <dcaratti@redhat.com>
>---
> net/sched/act_police.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
>diff --git a/net/sched/act_police.c b/net/sched/act_police.c
>index 5d8bfa878477..3b793393efd1 100644
>--- a/net/sched/act_police.c
>+++ b/net/sched/act_police.c
>@@ -150,6 +150,16 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
> goto failure;
> }
>
>+ if (tb[TCA_POLICE_RESULT]) {
>+ police->tcfp_result = nla_get_u32(tb[TCA_POLICE_RESULT]);
>+ if (TC_ACT_EXT_CMP(police->tcfp_result, TC_ACT_GOTO_CHAIN)) {
>+ NL_SET_ERR_MSG(extack,
>+ "goto chain not allowed on fallback");
Also, no need for line-wrap
Acked-by: Jiri Pirko <jiri@mellanox.com>
>+ err = -EINVAL;
>+ goto failure;
>+ }
>+ }
>+
> spin_lock_bh(&police->tcf_lock);
> /* No failure allowed after this point */
> police->tcfp_mtu = parm->mtu;
>@@ -173,8 +183,6 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
> police->peak_present = false;
> }
>
>- if (tb[TCA_POLICE_RESULT])
>- police->tcfp_result = nla_get_u32(tb[TCA_POLICE_RESULT]);
> police->tcfp_burst = PSCHED_TICKS2NS(parm->burst);
> police->tcfp_toks = police->tcfp_burst;
> if (police->peak_present) {
>--
>2.17.1
>
^ permalink raw reply
* Re: [PATCH net 1/4] net/sched: act_gact: disallow 'goto chain' on fallback control action
From: Jiri Pirko @ 2018-10-22 20:55 UTC (permalink / raw)
To: Davide Caratti; +Cc: Cong Wang, Jamal Hadi Salim, David S. Miller, netdev
In-Reply-To: <02f04ade8a0087781778d02fbb645b1d72f9d777.1540070509.git.dcaratti@redhat.com>
Sat, Oct 20, 2018 at 11:33:07PM CEST, dcaratti@redhat.com wrote:
>in the following command:
>
> # tc action add action <c1> random <rand_type> <c2> <rand_param>
>
>'goto chain x' is allowed only for c1: setting it for c2 makes the kernel
>crash with NULL pointer dereference, since TC core doesn't initialize the
>chain handle.
>
>Signed-off-by: Davide Caratti <dcaratti@redhat.com>
>---
> net/sched/act_gact.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
>index cd1d9bd32ef9..505138047e5c 100644
>--- a/net/sched/act_gact.c
>+++ b/net/sched/act_gact.c
>@@ -88,6 +88,11 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla,
> p_parm = nla_data(tb[TCA_GACT_PROB]);
> if (p_parm->ptype >= MAX_RAND)
> return -EINVAL;
>+ if (TC_ACT_EXT_CMP(p_parm->paction, TC_ACT_GOTO_CHAIN)) {
>+ NL_SET_ERR_MSG(extack,
>+ "goto chain not allowed on fallback");
No need for a line-wrap. Otherwise
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply
* [PATCH 17/20] rt2x00: rt61pci: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-10-22 20:46 UTC (permalink / raw)
To: Stanislaw Gruszka, Helmut Schaa
Cc: Kalle Valo, linux-wireless, David S. Miller, netdev, linux-kernel,
Gustavo A. R. Silva
In-Reply-To: <cover.1540239684.git.gustavo@embeddedor.com>
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/wireless/ralink/rt2x00/rt61pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt61pci.c b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
index cb0e119..4c5de8f 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
@@ -2226,7 +2226,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
break;
case 6: /* Failure, excessive retries */
__set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags);
- /* Don't break, this is a failed frame! */
+ /* Fall through - this is a failed frame! */
default: /* Failure */
__set_bit(TXDONE_FAILURE, &txdesc.flags);
}
--
2.7.4
^ permalink raw reply related
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