* Re: [PATCH net-next v3 00/10] net: mvpp2: phylink conversion
From: David Miller @ 2018-05-17 20:12 UTC (permalink / raw)
To: antoine.tenart
Cc: kishon, linux, gregory.clement, andrew, jason,
sebastian.hesselbarth, netdev, linux-kernel, thomas.petazzoni,
maxime.chevallier, miquel.raynal, nadavh, stefanc, ymarkman, mw,
linux-arm-kernel
In-Reply-To: <20180517082939.14598-1-antoine.tenart@bootlin.com>
From: Antoine Tenart <antoine.tenart@bootlin.com>
Date: Thu, 17 May 2018 10:29:29 +0200
> @Dave: patches 7 to 10 should go through the mvebu tree (Gregory in
> Cc.) to avoid any conflict with the other mvebu dt patches taken during
> this cycle.
>
> The series is based on today's net-next.
Ok, patches 1-6 applied to net-next, thank you.
^ permalink raw reply
* Re: pull-request: wireless-drivers-next 2018-05-17
From: David Miller @ 2018-05-17 20:10 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <87k1s2k6x9.fsf@kamboji.qca.qualcomm.com>
From: Kalle Valo <kvalo@codeaurora.org>
Date: Thu, 17 May 2018 11:44:34 +0300
> here's a pull request to net-next for 4.18. I forgot to mention in the
> signed tag was that one id is added to include/linux/mmc/sdio_ids.h but
> that was acked by Ulf.
>
> I suspect hat because of my merge of wireless-drivers into
> wireless-drivers-next the diffstat from request-pull was wrong again. I
> manually replaced that with the diffstat from my test pull to net-next.
>
> Please let me know if you have any problems.
Pulled, thank you.
^ permalink raw reply
* [PATCH net-next v3 3/3] net: phy: Allow MDIO_MOXART and MDIO_SUN4I with COMPILE_TEST
From: Florian Fainelli @ 2018-05-17 20:07 UTC (permalink / raw)
To: netdev
Cc: fugang.duan, Florian Fainelli, David S. Miller, Andrew Lunn,
open list
In-Reply-To: <20180517200745.19142-1-f.fainelli@gmail.com>
Those drivers build just fine with COMPILE_TEST, so make that possible.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 0e2305ccc91f..343989f9f9d9 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -118,7 +118,7 @@ config MDIO_I2C
config MDIO_MOXART
tristate "MOXA ART MDIO interface support"
- depends on ARCH_MOXART
+ depends on ARCH_MOXART || COMPILE_TEST
help
This driver supports the MDIO interface found in the network
interface units of the MOXA ART SoC
@@ -142,7 +142,7 @@ config MDIO_OCTEON
config MDIO_SUN4I
tristate "Allwinner sun4i MDIO interface support"
- depends on ARCH_SUNXI
+ depends on ARCH_SUNXI || COMPILE_TEST
help
This driver supports the MDIO interface found in the network
interface units of the Allwinner SoC that have an EMAC (A10,
--
2.14.1
^ permalink raw reply related
* [PATCH net-next v3 2/3] net: ethernet: freescale: Allow FEC with COMPILE_TEST
From: Florian Fainelli @ 2018-05-17 20:07 UTC (permalink / raw)
To: netdev
Cc: fugang.duan, Florian Fainelli, David S. Miller, Andrew Lunn,
open list
In-Reply-To: <20180517200745.19142-1-f.fainelli@gmail.com>
The Freescale FEC driver builds fine with COMPILE_TEST, so make that
possible.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/freescale/Kconfig | 2 +-
drivers/net/ethernet/freescale/fec.h | 2 +-
drivers/net/ethernet/freescale/fec_main.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
index 6e490fd2345d..a580a3dcbe59 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -22,7 +22,7 @@ if NET_VENDOR_FREESCALE
config FEC
tristate "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \
- ARCH_MXC || SOC_IMX28)
+ ARCH_MXC || SOC_IMX28 || COMPILE_TEST)
default ARCH_MXC || SOC_IMX28 if ARM
select PHYLIB
imply PTP_1588_CLOCK
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index e7381f8ef89d..4778b663653e 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -21,7 +21,7 @@
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
- defined(CONFIG_ARM64)
+ defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)
/*
* Just figures, Motorola would have to change the offsets for
* registers in the same peripheral device on different models
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index f3e43db0d6cb..4358f586e28f 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2107,7 +2107,7 @@ static int fec_enet_get_regs_len(struct net_device *ndev)
/* List of registers that can be safety be read to dump them with ethtool */
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
- defined(CONFIG_ARM64)
+ defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)
static u32 fec_enet_register_offset[] = {
FEC_IEVENT, FEC_IMASK, FEC_R_DES_ACTIVE_0, FEC_X_DES_ACTIVE_0,
FEC_ECNTRL, FEC_MII_DATA, FEC_MII_SPEED, FEC_MIB_CTRLSTAT, FEC_R_CNTRL,
--
2.14.1
^ permalink raw reply related
* [PATCH net-next v3 1/3] net: ethernet: ti: Allow most drivers with COMPILE_TEST
From: Florian Fainelli @ 2018-05-17 20:07 UTC (permalink / raw)
To: netdev
Cc: fugang.duan, Florian Fainelli, David S. Miller, Andrew Lunn,
open list
In-Reply-To: <20180517200745.19142-1-f.fainelli@gmail.com>
Most of the TI drivers build just fine with COMPILE_TEST, cpmac (AR7) is
the exception because it uses a header file from
arch/mips/include/asm/mach-ar7/ar7.h and keystone netcp which requires
help from drivers/soc/ti/ for queue management helpers.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/ti/Kconfig | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index 48a541eb0af2..9263d638bd6d 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -18,7 +18,7 @@ if NET_VENDOR_TI
config TI_DAVINCI_EMAC
tristate "TI DaVinci EMAC Support"
- depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 )
+ depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 ) || COMPILE_TEST
select TI_DAVINCI_MDIO
select TI_DAVINCI_CPDMA
select PHYLIB
@@ -30,7 +30,7 @@ config TI_DAVINCI_EMAC
config TI_DAVINCI_MDIO
tristate "TI DaVinci MDIO Support"
- depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || ARCH_KEYSTONE
+ depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
select PHYLIB
---help---
This driver supports TI's DaVinci MDIO module.
@@ -40,7 +40,7 @@ config TI_DAVINCI_MDIO
config TI_DAVINCI_CPDMA
tristate "TI DaVinci CPDMA Support"
- depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
+ depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
---help---
This driver supports TI's DaVinci CPDMA dma engine.
@@ -60,7 +60,7 @@ config TI_CPSW_ALE
config TI_CPSW
tristate "TI CPSW Switch Support"
- depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
+ depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
select TI_DAVINCI_CPDMA
select TI_DAVINCI_MDIO
select TI_CPSW_PHY_SEL
@@ -75,7 +75,7 @@ config TI_CPSW
config TI_CPTS
bool "TI Common Platform Time Sync (CPTS) Support"
- depends on TI_CPSW || TI_KEYSTONE_NETCP
+ depends on TI_CPSW || TI_KEYSTONE_NETCP || COMPILE_TEST
depends on POSIX_TIMERS
---help---
This driver supports the Common Platform Time Sync unit of
--
2.14.1
^ permalink raw reply related
* [PATCH net-next v3 0/3] net: Allow more drivers with COMPILE_TEST
From: Florian Fainelli @ 2018-05-17 20:07 UTC (permalink / raw)
To: netdev
Cc: fugang.duan, Florian Fainelli, David S. Miller, Andrew Lunn,
open list
Hi David,
This patch series includes more drivers to be build tested with COMPILE_TEST
enabled. This helps cover some of the issues I just ran into with missing
a driver *sigh*.
Chanves in v3:
- drop the TI Keystone NETCP driver from the COMPILE_TEST additions
Changes in v2:
- allow FEC to build outside of CONFIG_ARM/ARM64 by defining a layout of
registers, this is not meant to run, so this is not a real issue if we
are not matching the correct register layout
Florian Fainelli (3):
net: ethernet: ti: Allow most drivers with COMPILE_TEST
net: ethernet: freescale: Allow FEC with COMPILE_TEST
net: phy: Allow MDIO_MOXART and MDIO_SUN4I with COMPILE_TEST
drivers/net/ethernet/freescale/Kconfig | 2 +-
drivers/net/ethernet/freescale/fec.h | 2 +-
drivers/net/ethernet/freescale/fec_main.c | 2 +-
drivers/net/ethernet/ti/Kconfig | 12 ++++++------
drivers/net/phy/Kconfig | 4 ++--
5 files changed, 11 insertions(+), 11 deletions(-)
--
2.14.1
^ permalink raw reply
* Re: [PATCH] net: qcom/emac: Allocate buffers from local node
From: David Miller @ 2018-05-17 19:57 UTC (permalink / raw)
To: hpuranik; +Cc: netdev, linux-kernel, timur
In-Reply-To: <1526545680-21650-1-git-send-email-hpuranik@codeaurora.org>
From: Hemanth Puranik <hpuranik@codeaurora.org>
Date: Thu, 17 May 2018 13:58:00 +0530
> Currently we use non-NUMA aware allocation for TPD and RRD buffers,
> this patch modifies to use NUMA friendly allocation.
>
> Signed-off-by: Hemanth Puranik <hpuranik@codeaurora.org>
> ---
> drivers/net/ethernet/qualcomm/emac/emac-mac.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
> index 092718a..c3df86a 100644
> --- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c
> +++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
> @@ -684,9 +684,10 @@ static int emac_tx_q_desc_alloc(struct emac_adapter *adpt,
> {
> struct emac_ring_header *ring_header = &adpt->ring_header;
> size_t size;
> + int node = dev_to_node(adpt->netdev->dev.parent);
Please order local variable declarations from longest to shortest line
(ie. reverse christmas tree layout).
> @@ -725,9 +726,10 @@ static int emac_rx_descs_alloc(struct emac_adapter *adpt)
> struct emac_ring_header *ring_header = &adpt->ring_header;
> struct emac_rx_queue *rx_q = &adpt->rx_q;
> size_t size;
> + int node = dev_to_node(adpt->netdev->dev.parent);
Likewise.
^ permalink raw reply
* Re: [PATCH net-next] vmxnet3: Replace msleep(1) with usleep_range()
From: David Miller @ 2018-05-17 19:56 UTC (permalink / raw)
To: yuehaibing; +Cc: doshir, pv-drivers, netdev, linux-kernel
In-Reply-To: <20180517034641.30004-1-yuehaibing@huawei.com>
From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 17 May 2018 11:46:41 +0800
> As documented in Documentation/timers/timers-howto.txt,
> replace msleep(1) with usleep_range().
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net 7/7] net: ip6_gre: Fix ip6erspan hlen calculation
From: William Tu @ 2018-05-17 19:52 UTC (permalink / raw)
To: Petr Machata
Cc: Linux Kernel Network Developers, David Miller, Alexey Kuznetsov,
Hideaki YOSHIFUJI, Dmitry Kozlov
In-Reply-To: <c010e9a0dd4fdf31ea8c9308be04e6e93bd30c5c.1526567568.git.petrm@mellanox.com>
On Thu, May 17, 2018 at 7:36 AM, Petr Machata <petrm@mellanox.com> wrote:
> Even though ip6erspan_tap_init() sets up hlen and tun_hlen according to
> what ERSPAN needs, it goes ahead to call ip6gre_tnl_link_config() which
> overwrites these settings with GRE-specific ones.
>
> Similarly for changelink callbacks, which are handled by
> ip6gre_changelink() calls ip6gre_tnl_change() calls
> ip6gre_tnl_link_config() as well.
>
> The difference ends up being 12 vs. 20 bytes, and this is generally not
> a problem, because a 12-byte request likely ends up allocating more and
> the extra 8 bytes are thus available. However correct it is not.
>
> So replace the newlink and changelink callbacks with an ERSPAN-specific
> ones, reusing the newly-introduced _common() functions.
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
Acked-by: William Tu <u9012063@gmail.com>
Thanks, using ERSPAN-specific newlink and changelink is also on
my todo list. I'm hitting another issue related to the shared collect_md_tun
between erspan and gre, I will make my patch based on this series.
> net/ipv6/ip6_gre.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++-------
> 1 file changed, 65 insertions(+), 9 deletions(-)
>
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index c17e38b..36b1669 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -81,6 +81,7 @@ static int ip6gre_tunnel_init(struct net_device *dev);
> static void ip6gre_tunnel_setup(struct net_device *dev);
> static void ip6gre_tunnel_link(struct ip6gre_net *ign, struct ip6_tnl *t);
> static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu);
> +static void ip6erspan_tnl_link_config(struct ip6_tnl *t, int set_mtu);
>
> /* Tunnel hash table */
>
> @@ -1751,6 +1752,19 @@ static const struct net_device_ops ip6gre_tap_netdev_ops = {
> .ndo_get_iflink = ip6_tnl_get_iflink,
> };
>
> +static int ip6erspan_calc_hlen(struct ip6_tnl *tunnel)
> +{
> + int t_hlen;
> +
> + tunnel->tun_hlen = 8;
> + tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen +
> + erspan_hdr_len(tunnel->parms.erspan_ver);
> +
> + t_hlen = tunnel->hlen + sizeof(struct ipv6hdr);
> + tunnel->dev->hard_header_len = LL_MAX_HEADER + t_hlen;
> + return t_hlen;
> +}
> +
> static int ip6erspan_tap_init(struct net_device *dev)
> {
> struct ip6_tnl *tunnel;
> @@ -1774,12 +1788,7 @@ static int ip6erspan_tap_init(struct net_device *dev)
> return ret;
> }
>
> - tunnel->tun_hlen = 8;
> - tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen +
> - erspan_hdr_len(tunnel->parms.erspan_ver);
> - t_hlen = tunnel->hlen + sizeof(struct ipv6hdr);
> -
> - dev->hard_header_len = LL_MAX_HEADER + t_hlen;
> + t_hlen = ip6erspan_calc_hlen(tunnel);
> dev->mtu = ETH_DATA_LEN - t_hlen;
> if (dev->type == ARPHRD_ETHER)
> dev->mtu -= ETH_HLEN;
> @@ -1787,7 +1796,7 @@ static int ip6erspan_tap_init(struct net_device *dev)
> dev->mtu -= 8;
>
> dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
> - ip6gre_tnl_link_config(tunnel, 1);
> + ip6erspan_tnl_link_config(tunnel, 1);
>
> return 0;
> }
> @@ -2118,6 +2127,53 @@ static void ip6erspan_tap_setup(struct net_device *dev)
> netif_keep_dst(dev);
> }
>
> +static int ip6erspan_newlink(struct net *src_net, struct net_device *dev,
> + struct nlattr *tb[], struct nlattr *data[],
> + struct netlink_ext_ack *extack)
> +{
> + int err = ip6gre_newlink_common(src_net, dev, tb, data, extack);
> + struct ip6_tnl *nt = netdev_priv(dev);
> + struct net *net = dev_net(dev);
> +
> + if (!err) {
> + ip6erspan_tnl_link_config(nt, !tb[IFLA_MTU]);
> + ip6gre_tunnel_link(net_generic(net, ip6gre_net_id), nt);
> + }
> + return err;
> +}
> +
> +static void ip6erspan_tnl_link_config(struct ip6_tnl *t, int set_mtu)
> +{
> + ip6gre_tnl_link_config_common(t);
> + ip6gre_tnl_link_config_route(t, set_mtu, ip6erspan_calc_hlen(t));
> +}
> +
> +static int ip6erspan_tnl_change(struct ip6_tnl *t,
> + const struct __ip6_tnl_parm *p, int set_mtu)
> +{
> + ip6gre_tnl_copy_tnl_parm(t, p);
> + ip6erspan_tnl_link_config(t, set_mtu);
> + return 0;
> +}
> +
> +static int ip6erspan_changelink(struct net_device *dev, struct nlattr *tb[],
> + struct nlattr *data[],
> + struct netlink_ext_ack *extack)
> +{
> + struct ip6gre_net *ign = net_generic(dev_net(dev), ip6gre_net_id);
> + struct __ip6_tnl_parm p;
> + struct ip6_tnl *t;
> +
> + t = ip6gre_changelink_common(dev, tb, data, &p, extack);
> + if (IS_ERR(t))
> + return PTR_ERR(t);
> +
> + ip6gre_tunnel_unlink(ign, t);
> + ip6erspan_tnl_change(t, &p, !tb[IFLA_MTU]);
> + ip6gre_tunnel_link(ign, t);
> + return 0;
> +}
> +
> static struct rtnl_link_ops ip6gre_link_ops __read_mostly = {
> .kind = "ip6gre",
> .maxtype = IFLA_GRE_MAX,
> @@ -2154,8 +2210,8 @@ static struct rtnl_link_ops ip6erspan_tap_ops __read_mostly = {
> .priv_size = sizeof(struct ip6_tnl),
> .setup = ip6erspan_tap_setup,
> .validate = ip6erspan_tap_validate,
> - .newlink = ip6gre_newlink,
> - .changelink = ip6gre_changelink,
> + .newlink = ip6erspan_newlink,
> + .changelink = ip6erspan_changelink,
> .get_size = ip6gre_get_size,
> .fill_info = ip6gre_fill_info,
> .get_link_net = ip6_tnl_get_link_net,
> --
> 2.4.11
>
^ permalink raw reply
* Re: [PATCH] bonding: introduce link change helper
From: David Miller @ 2018-05-17 19:51 UTC (permalink / raw)
To: xiangxia.m.yue; +Cc: netdev
In-Reply-To: <1526522963-4317-1-git-send-email-xiangxia.m.yue@gmail.com>
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Wed, 16 May 2018 19:09:23 -0700
> Introduce an new common helper to avoid redundancy.
>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net 6/7] net: ip6_gre: Split up ip6gre_changelink()
From: William Tu @ 2018-05-17 19:48 UTC (permalink / raw)
To: Petr Machata
Cc: Linux Kernel Network Developers, David Miller, Alexey Kuznetsov,
Hideaki YOSHIFUJI, Dmitry Kozlov
In-Reply-To: <8cc069a772b633ee9c2ba4f7cb8564ac2e097dac.1526567568.git.petrm@mellanox.com>
On Thu, May 17, 2018 at 7:36 AM, Petr Machata <petrm@mellanox.com> wrote:
> Extract from ip6gre_changelink() a reusable function
> ip6gre_changelink_common(). This will allow introduction of
> ERSPAN-specific _changelink() function with not a lot of code
> duplication.
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
LGTM.
Acked-by: William Tu <u9012063@gmail.com>
> net/ipv6/ip6_gre.c | 33 ++++++++++++++++++++++++---------
> 1 file changed, 24 insertions(+), 9 deletions(-)
>
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index 4dfa21d..c17e38b 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -1921,37 +1921,52 @@ static int ip6gre_newlink(struct net *src_net, struct net_device *dev,
> return err;
> }
>
> -static int ip6gre_changelink(struct net_device *dev, struct nlattr *tb[],
> - struct nlattr *data[],
> - struct netlink_ext_ack *extack)
> +static struct ip6_tnl *
> +ip6gre_changelink_common(struct net_device *dev, struct nlattr *tb[],
> + struct nlattr *data[], struct __ip6_tnl_parm *p_p,
> + struct netlink_ext_ack *extack)
> {
> struct ip6_tnl *t, *nt = netdev_priv(dev);
> struct net *net = nt->net;
> struct ip6gre_net *ign = net_generic(net, ip6gre_net_id);
> - struct __ip6_tnl_parm p;
> struct ip_tunnel_encap ipencap;
>
> if (dev == ign->fb_tunnel_dev)
> - return -EINVAL;
> + return ERR_PTR(-EINVAL);
>
> if (ip6gre_netlink_encap_parms(data, &ipencap)) {
> int err = ip6_tnl_encap_setup(nt, &ipencap);
>
> if (err < 0)
> - return err;
> + return ERR_PTR(err);
> }
>
> - ip6gre_netlink_parms(data, &p);
> + ip6gre_netlink_parms(data, p_p);
>
> - t = ip6gre_tunnel_locate(net, &p, 0);
> + t = ip6gre_tunnel_locate(net, p_p, 0);
>
> if (t) {
> if (t->dev != dev)
> - return -EEXIST;
> + return ERR_PTR(-EEXIST);
> } else {
> t = nt;
> }
>
> + return t;
> +}
> +
> +static int ip6gre_changelink(struct net_device *dev, struct nlattr *tb[],
> + struct nlattr *data[],
> + struct netlink_ext_ack *extack)
> +{
> + struct ip6gre_net *ign = net_generic(dev_net(dev), ip6gre_net_id);
> + struct __ip6_tnl_parm p;
> + struct ip6_tnl *t;
> +
> + t = ip6gre_changelink_common(dev, tb, data, &p, extack);
> + if (IS_ERR(t))
> + return PTR_ERR(t);
> +
> ip6gre_tunnel_unlink(ign, t);
> ip6gre_tnl_change(t, &p, !tb[IFLA_MTU]);
> ip6gre_tunnel_link(ign, t);
> --
> 2.4.11
>
^ permalink raw reply
* Re: [PATCH net] erspan: fix invalid erspan version.
From: David Miller @ 2018-05-17 19:49 UTC (permalink / raw)
To: u9012063; +Cc: netdev, gvrose8192
In-Reply-To: <1526516672-9497-1-git-send-email-u9012063@gmail.com>
From: William Tu <u9012063@gmail.com>
Date: Wed, 16 May 2018 17:24:32 -0700
> ERSPAN only support version 1 and 2. When packets send to an
> erspan device which does not have proper version number set,
> drop the packet. In real case, we observe multicast packets
> sent to the erspan pernet device, erspan0, which does not have
> erspan version configured.
>
> Reported-by: Greg Rose <gvrose8192@gmail.com>
> Signed-off-by: William Tu <u9012063@gmail.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net 5/7] net: ip6_gre: Split up ip6gre_newlink()
From: William Tu @ 2018-05-17 19:48 UTC (permalink / raw)
To: Petr Machata
Cc: Linux Kernel Network Developers, David Miller, Alexey Kuznetsov,
Hideaki YOSHIFUJI, Dmitry Kozlov
In-Reply-To: <99e6fdf912d6ae41c884a51cbc893427153d2846.1526567568.git.petrm@mellanox.com>
On Thu, May 17, 2018 at 7:36 AM, Petr Machata <petrm@mellanox.com> wrote:
> Extract from ip6gre_newlink() a reusable function
> ip6gre_newlink_common(). The ip6gre_tnl_link_config() call needs to be
> made customizable for ERSPAN, thus reorder it with calls to
> ip6_tnl_change_mtu() and dev_hold(), and extract the whole tail to the
> caller, ip6gre_newlink(). Thus enable an ERSPAN-specific _newlink()
> function without a lot of duplicity.
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
LGTM.
Acked-by: William Tu <u9012063@gmail.com>
> net/ipv6/ip6_gre.c | 24 ++++++++++++++++++------
> 1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index 307ac6d..4dfa21d 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -1858,9 +1858,9 @@ static bool ip6gre_netlink_encap_parms(struct nlattr *data[],
> return ret;
> }
>
> -static int ip6gre_newlink(struct net *src_net, struct net_device *dev,
> - struct nlattr *tb[], struct nlattr *data[],
> - struct netlink_ext_ack *extack)
> +static int ip6gre_newlink_common(struct net *src_net, struct net_device *dev,
> + struct nlattr *tb[], struct nlattr *data[],
> + struct netlink_ext_ack *extack)
> {
> struct ip6_tnl *nt;
> struct net *net = dev_net(dev);
> @@ -1897,18 +1897,30 @@ static int ip6gre_newlink(struct net *src_net, struct net_device *dev,
> if (err)
> goto out;
>
> - ip6gre_tnl_link_config(nt, !tb[IFLA_MTU]);
> -
> if (tb[IFLA_MTU])
> ip6_tnl_change_mtu(dev, nla_get_u32(tb[IFLA_MTU]));
>
> dev_hold(dev);
> - ip6gre_tunnel_link(ign, nt);
>
> out:
> return err;
> }
>
> +static int ip6gre_newlink(struct net *src_net, struct net_device *dev,
> + struct nlattr *tb[], struct nlattr *data[],
> + struct netlink_ext_ack *extack)
> +{
> + int err = ip6gre_newlink_common(src_net, dev, tb, data, extack);
> + struct ip6_tnl *nt = netdev_priv(dev);
> + struct net *net = dev_net(dev);
> +
> + if (!err) {
> + ip6gre_tnl_link_config(nt, !tb[IFLA_MTU]);
> + ip6gre_tunnel_link(net_generic(net, ip6gre_net_id), nt);
> + }
> + return err;
> +}
> +
> static int ip6gre_changelink(struct net_device *dev, struct nlattr *tb[],
> struct nlattr *data[],
> struct netlink_ext_ack *extack)
> --
> 2.4.11
>
^ permalink raw reply
* Re: [PATCH net 4/7] net: ip6_gre: Split up ip6gre_tnl_change()
From: William Tu @ 2018-05-17 19:45 UTC (permalink / raw)
To: Petr Machata
Cc: Linux Kernel Network Developers, David Miller, Alexey Kuznetsov,
Hideaki YOSHIFUJI, Dmitry Kozlov
In-Reply-To: <1cbdc5bcb10e467eea4c9dd32b867ddc28d4a337.1526567568.git.petrm@mellanox.com>
On Thu, May 17, 2018 at 7:36 AM, Petr Machata <petrm@mellanox.com> wrote:
> Split a reusable function ip6gre_tnl_copy_tnl_parm() from
> ip6gre_tnl_change(). This will allow ERSPAN-specific code to
> reuse the common parts while customizing the behavior for ERSPAN.
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
LGTM.
Acked-by: William Tu <u9012063@gmail.com>
> net/ipv6/ip6_gre.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index 78ba6b9..307ac6d 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -1109,8 +1109,8 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
> ip6gre_tnl_link_config_route(t, set_mtu, ip6gre_calc_hlen(t));
> }
>
> -static int ip6gre_tnl_change(struct ip6_tnl *t,
> - const struct __ip6_tnl_parm *p, int set_mtu)
> +static void ip6gre_tnl_copy_tnl_parm(struct ip6_tnl *t,
> + const struct __ip6_tnl_parm *p)
> {
> t->parms.laddr = p->laddr;
> t->parms.raddr = p->raddr;
> @@ -1126,6 +1126,12 @@ static int ip6gre_tnl_change(struct ip6_tnl *t,
> t->parms.o_flags = p->o_flags;
> t->parms.fwmark = p->fwmark;
> dst_cache_reset(&t->dst_cache);
> +}
> +
> +static int ip6gre_tnl_change(struct ip6_tnl *t, const struct __ip6_tnl_parm *p,
> + int set_mtu)
> +{
> + ip6gre_tnl_copy_tnl_parm(t, p);
> ip6gre_tnl_link_config(t, set_mtu);
> return 0;
> }
> --
> 2.4.11
>
^ permalink raw reply
* Re: [PATCH net 3/7] net: ip6_gre: Split up ip6gre_tnl_link_config()
From: William Tu @ 2018-05-17 19:45 UTC (permalink / raw)
To: Petr Machata
Cc: Linux Kernel Network Developers, David Miller, Alexey Kuznetsov,
Hideaki YOSHIFUJI, Dmitry Kozlov
In-Reply-To: <470a59d0a7ee63beb6d9e00dfb419163eaa1a588.1526567568.git.petrm@mellanox.com>
On Thu, May 17, 2018 at 7:36 AM, Petr Machata <petrm@mellanox.com> wrote:
> The function ip6gre_tnl_link_config() is used for setting up
> configuration of both ip6gretap and ip6erspan tunnels. Split the
> function into the common part and the route-lookup part. The latter then
> takes the calculated header length as an argument. This split will allow
> the patches down the line to sneak in a custom header length computation
> for the ERSPAN tunnel.
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
LGTM.
Acked-by: William Tu <u9012063@gmail.com>
> net/ipv6/ip6_gre.c | 38 ++++++++++++++++++++++++++------------
> 1 file changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index 53b1531..78ba6b9 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -1022,12 +1022,11 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
> return NETDEV_TX_OK;
> }
>
> -static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
> +static void ip6gre_tnl_link_config_common(struct ip6_tnl *t)
> {
> struct net_device *dev = t->dev;
> struct __ip6_tnl_parm *p = &t->parms;
> struct flowi6 *fl6 = &t->fl.u.ip6;
> - int t_hlen;
>
> if (dev->type != ARPHRD_ETHER) {
> memcpy(dev->dev_addr, &p->laddr, sizeof(struct in6_addr));
> @@ -1054,12 +1053,13 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
> dev->flags |= IFF_POINTOPOINT;
> else
> dev->flags &= ~IFF_POINTOPOINT;
> +}
>
> - t->tun_hlen = gre_calc_hlen(t->parms.o_flags);
> -
> - t->hlen = t->encap_hlen + t->tun_hlen;
> -
> - t_hlen = t->hlen + sizeof(struct ipv6hdr);
> +static void ip6gre_tnl_link_config_route(struct ip6_tnl *t, int set_mtu,
> + int t_hlen)
> +{
> + const struct __ip6_tnl_parm *p = &t->parms;
> + struct net_device *dev = t->dev;
>
> if (p->flags & IP6_TNL_F_CAP_XMIT) {
> int strict = (ipv6_addr_type(&p->raddr) &
> @@ -1091,6 +1091,24 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
> }
> }
>
> +static int ip6gre_calc_hlen(struct ip6_tnl *tunnel)
> +{
> + int t_hlen;
> +
> + tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags);
> + tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen;
> +
> + t_hlen = tunnel->hlen + sizeof(struct ipv6hdr);
> + tunnel->dev->hard_header_len = LL_MAX_HEADER + t_hlen;
> + return t_hlen;
> +}
> +
> +static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
> +{
> + ip6gre_tnl_link_config_common(t);
> + ip6gre_tnl_link_config_route(t, set_mtu, ip6gre_calc_hlen(t));
> +}
> +
> static int ip6gre_tnl_change(struct ip6_tnl *t,
> const struct __ip6_tnl_parm *p, int set_mtu)
> {
> @@ -1384,11 +1402,7 @@ static int ip6gre_tunnel_init_common(struct net_device *dev)
> return ret;
> }
>
> - tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags);
> - tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen;
> - t_hlen = tunnel->hlen + sizeof(struct ipv6hdr);
> -
> - dev->hard_header_len = LL_MAX_HEADER + t_hlen;
> + t_hlen = ip6gre_calc_hlen(tunnel);
> dev->mtu = ETH_DATA_LEN - t_hlen;
> if (dev->type == ARPHRD_ETHER)
> dev->mtu -= ETH_HLEN;
> --
> 2.4.11
>
^ permalink raw reply
* Re: [PATCH net-next 0/8] tcp: default RACK loss recovery
From: David Miller @ 2018-05-17 19:45 UTC (permalink / raw)
To: ycheng; +Cc: netdev, edumazet, ncardwell, soheil, priyarjha
In-Reply-To: <20180516234017.172775-1-ycheng@google.com>
From: Yuchung Cheng <ycheng@google.com>
Date: Wed, 16 May 2018 16:40:09 -0700
> This patch set implements the features correspond to the
> draft-ietf-tcpm-rack-03 version of the RACK draft.
> https://datatracker.ietf.org/meeting/101/materials/slides-101-tcpm-update-on-tcp-rack-00
>
> 1. SACK: implement equivalent DUPACK threshold heuristic in RACK to
> replace existing RFC6675 recovery (tcp_mark_head_lost).
>
> 2. Non-SACK: simplify RFC6582 NewReno implementation
>
> 3. RTO: apply RACK's time-based approach to avoid spuriouly
> marking very recently sent packets lost.
>
> 4. with (1)(2)(3), make RACK the exclusive fast recovery mechanism to
> mark losses based on time on S/ACK. Tail loss probe and F-RTO remain
> enabled by default as complementary mechanisms to send probes in
> CA_Open and CA_Loss states. The probes would solicit S/ACKs to trigger
> RACK time-based loss detection.
>
> All Google web and internal servers have been running RACK-only mode
> (4) for a while now. a/b experiments indicate RACK/TLP on average
> reduces recovery latency by 10% compared to RFC6675. RFC6675
> is default-off now but can be enabled by disabling RACK (sysctl
> net.ipv4.tcp_recovery=0) for unseen issues.
Series applied.
These patches, the design of the ordering of changes in the patch series,
and the commit messages themselves were more than a pleasure to read.
Really, this patch series is a great model for others who want to
improve the quality and reviewability of their submissions.
Thank you.
^ permalink raw reply
* Re: [PATCH net-next ] net: mscc: Add SPDX identifier
From: Alexandre Belloni @ 2018-05-17 19:39 UTC (permalink / raw)
To: Joe Perches
Cc: David S . Miller, Allan Nielsen, razvan.stefanescu, po.liu,
Thomas Petazzoni, Andrew Lunn, Florian Fainelli, netdev,
linux-kernel
In-Reply-To: <53ccb8c58e4c3e224ba694c0628096d0c041ba1a.camel@perches.com>
On 17/05/2018 12:28:59-0700, Joe Perches wrote:
> On Thu, 2018-05-17 at 21:23 +0200, Alexandre Belloni wrote:
> > ocelot_qsys.h is missing the SPDX identfier, fix that.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> Only the copyright holders should ideally be modifying
> these and also removing other license content.
>
> For instance, what's the real intent here?
>
Well, if you have a look, I submitted that file this cycle and it is the
only one that doesn't have the proper SPDX identifier. This is a mistake
I'm fixing.
> > diff --git a/drivers/net/ethernet/mscc/ocelot_qsys.h b/drivers/net/ethernet/mscc/ocelot_qsys.h
> []
> > @@ -1,7 +1,7 @@
> > +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
>
> GPL 2.0+ or 2.0?
>
2.0
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply
* Re: [PATCH net 2/7] net: ip6_gre: Fix headroom request in ip6erspan_tunnel_xmit()
From: William Tu @ 2018-05-17 19:34 UTC (permalink / raw)
To: Petr Machata
Cc: Linux Kernel Network Developers, David Miller, Alexey Kuznetsov,
Hideaki YOSHIFUJI, Dmitry Kozlov
In-Reply-To: <372b4cfcba7d0a1feea1de8eedb4168d960a5f70.1526567568.git.petrm@mellanox.com>
On Thu, May 17, 2018 at 7:36 AM, Petr Machata <petrm@mellanox.com> wrote:
> dev->needed_headroom is not primed until ip6_tnl_xmit(), so it starts
> out zero. Thus the call to skb_cow_head() fails to actually make sure
> there's enough headroom to push the ERSPAN headers to. That can lead to
> the panic cited below. (Reproducer below that).
>
> Fix by requesting either needed_headroom if already primed, or just the
> bare minimum needed for the header otherwise.
>
> [ 190.703567] kernel BUG at net/core/skbuff.c:104!
> [ 190.708384] invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
> [ 190.714007] Modules linked in: act_mirred cls_matchall ip6_gre ip6_tunnel tunnel6 gre sch_ingress vrf veth x86_pkg_temp_thermal mlx_platform nfsd e1000e leds_mlxcpld
> [ 190.728975] CPU: 1 PID: 959 Comm: kworker/1:2 Not tainted 4.17.0-rc4-net_master-custom-139 #10
> [ 190.737647] Hardware name: Mellanox Technologies Ltd. "MSN2410-CB2F"/"SA000874", BIOS 4.6.5 03/08/2016
> [ 190.747006] Workqueue: ipv6_addrconf addrconf_dad_work
> [ 190.752222] RIP: 0010:skb_panic+0xc3/0x100
> [ 190.756358] RSP: 0018:ffff8801d54072f0 EFLAGS: 00010282
> [ 190.761629] RAX: 0000000000000085 RBX: ffff8801c1a8ecc0 RCX: 0000000000000000
> [ 190.768830] RDX: 0000000000000085 RSI: dffffc0000000000 RDI: ffffed003aa80e54
> [ 190.776025] RBP: ffff8801bd1ec5a0 R08: ffffed003aabce19 R09: ffffed003aabce19
> [ 190.783226] R10: 0000000000000001 R11: ffffed003aabce18 R12: ffff8801bf695dbe
> [ 190.790418] R13: 0000000000000084 R14: 00000000000006c0 R15: ffff8801bf695dc8
> [ 190.797621] FS: 0000000000000000(0000) GS:ffff8801d5400000(0000) knlGS:0000000000000000
> [ 190.805786] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 190.811582] CR2: 000055fa929aced0 CR3: 0000000003228004 CR4: 00000000001606e0
> [ 190.818790] Call Trace:
> [ 190.821264] <IRQ>
> [ 190.823314] ? ip6erspan_tunnel_xmit+0x5e4/0x1982 [ip6_gre]
> [ 190.828940] ? ip6erspan_tunnel_xmit+0x5e4/0x1982 [ip6_gre]
> [ 190.834562] skb_push+0x78/0x90
> [ 190.837749] ip6erspan_tunnel_xmit+0x5e4/0x1982 [ip6_gre]
> [ 190.843219] ? ip6gre_tunnel_ioctl+0xd90/0xd90 [ip6_gre]
> [ 190.848577] ? debug_check_no_locks_freed+0x210/0x210
> [ 190.853679] ? debug_check_no_locks_freed+0x210/0x210
> [ 190.858783] ? print_irqtrace_events+0x120/0x120
> [ 190.863451] ? sched_clock_cpu+0x18/0x210
> [ 190.867496] ? cyc2ns_read_end+0x10/0x10
> [ 190.871474] ? skb_network_protocol+0x76/0x200
> [ 190.875977] dev_hard_start_xmit+0x137/0x770
> [ 190.880317] ? do_raw_spin_trylock+0x6d/0xa0
> [ 190.884624] sch_direct_xmit+0x2ef/0x5d0
> [ 190.888589] ? pfifo_fast_dequeue+0x3fa/0x670
> [ 190.892994] ? pfifo_fast_change_tx_queue_len+0x810/0x810
> [ 190.898455] ? __lock_is_held+0xa0/0x160
> [ 190.902422] __qdisc_run+0x39e/0xfc0
> [ 190.906041] ? _raw_spin_unlock+0x29/0x40
> [ 190.910090] ? pfifo_fast_enqueue+0x24b/0x3e0
> [ 190.914501] ? sch_direct_xmit+0x5d0/0x5d0
> [ 190.918658] ? pfifo_fast_dequeue+0x670/0x670
> [ 190.923047] ? __dev_queue_xmit+0x172/0x1770
> [ 190.927365] ? preempt_count_sub+0xf/0xd0
> [ 190.931421] __dev_queue_xmit+0x410/0x1770
> [ 190.935553] ? ___slab_alloc+0x605/0x930
> [ 190.939524] ? print_irqtrace_events+0x120/0x120
> [ 190.944186] ? memcpy+0x34/0x50
> [ 190.947364] ? netdev_pick_tx+0x1c0/0x1c0
> [ 190.951428] ? __skb_clone+0x2fd/0x3d0
> [ 190.955218] ? __copy_skb_header+0x270/0x270
> [ 190.959537] ? rcu_read_lock_sched_held+0x93/0xa0
> [ 190.964282] ? kmem_cache_alloc+0x344/0x4d0
> [ 190.968520] ? cyc2ns_read_end+0x10/0x10
> [ 190.972495] ? skb_clone+0x123/0x230
> [ 190.976112] ? skb_split+0x820/0x820
> [ 190.979747] ? tcf_mirred+0x554/0x930 [act_mirred]
> [ 190.984582] tcf_mirred+0x554/0x930 [act_mirred]
> [ 190.989252] ? tcf_mirred_act_wants_ingress.part.2+0x10/0x10 [act_mirred]
> [ 190.996109] ? __lock_acquire+0x706/0x26e0
> [ 191.000239] ? sched_clock_cpu+0x18/0x210
> [ 191.004294] tcf_action_exec+0xcf/0x2a0
> [ 191.008179] tcf_classify+0xfa/0x340
> [ 191.011794] __netif_receive_skb_core+0x8e1/0x1c60
> [ 191.016630] ? debug_check_no_locks_freed+0x210/0x210
> [ 191.021732] ? nf_ingress+0x500/0x500
> [ 191.025458] ? process_backlog+0x347/0x4b0
> [ 191.029619] ? print_irqtrace_events+0x120/0x120
> [ 191.034302] ? lock_acquire+0xd8/0x320
> [ 191.038089] ? process_backlog+0x1b6/0x4b0
> [ 191.042246] ? process_backlog+0xc2/0x4b0
> [ 191.046303] process_backlog+0xc2/0x4b0
> [ 191.050189] net_rx_action+0x5cc/0x980
> [ 191.053991] ? napi_complete_done+0x2c0/0x2c0
> [ 191.058386] ? mark_lock+0x13d/0xb40
> [ 191.062001] ? clockevents_program_event+0x6b/0x1d0
> [ 191.066922] ? print_irqtrace_events+0x120/0x120
> [ 191.071593] ? __lock_is_held+0xa0/0x160
> [ 191.075566] __do_softirq+0x1d4/0x9d2
> [ 191.079282] ? ip6_finish_output2+0x524/0x1460
> [ 191.083771] do_softirq_own_stack+0x2a/0x40
> [ 191.087994] </IRQ>
> [ 191.090130] do_softirq.part.13+0x38/0x40
> [ 191.094178] __local_bh_enable_ip+0x135/0x190
> [ 191.098591] ip6_finish_output2+0x54d/0x1460
> [ 191.102916] ? ip6_forward_finish+0x2f0/0x2f0
> [ 191.107314] ? ip6_mtu+0x3c/0x2c0
> [ 191.110674] ? ip6_finish_output+0x2f8/0x650
> [ 191.114992] ? ip6_output+0x12a/0x500
> [ 191.118696] ip6_output+0x12a/0x500
> [ 191.122223] ? ip6_route_dev_notify+0x5b0/0x5b0
> [ 191.126807] ? ip6_finish_output+0x650/0x650
> [ 191.131120] ? ip6_fragment+0x1a60/0x1a60
> [ 191.135182] ? icmp6_dst_alloc+0x26e/0x470
> [ 191.139317] mld_sendpack+0x672/0x830
> [ 191.143021] ? igmp6_mcf_seq_next+0x2f0/0x2f0
> [ 191.147429] ? __local_bh_enable_ip+0x77/0x190
> [ 191.151913] ipv6_mc_dad_complete+0x47/0x90
> [ 191.156144] addrconf_dad_completed+0x561/0x720
> [ 191.160731] ? addrconf_rs_timer+0x3a0/0x3a0
> [ 191.165036] ? mark_held_locks+0xc9/0x140
> [ 191.169095] ? __local_bh_enable_ip+0x77/0x190
> [ 191.173570] ? addrconf_dad_work+0x50d/0xa20
> [ 191.177886] ? addrconf_dad_work+0x529/0xa20
> [ 191.182194] addrconf_dad_work+0x529/0xa20
> [ 191.186342] ? addrconf_dad_completed+0x720/0x720
> [ 191.191088] ? __lock_is_held+0xa0/0x160
> [ 191.195059] ? process_one_work+0x45d/0xe20
> [ 191.199302] ? process_one_work+0x51e/0xe20
> [ 191.203531] ? rcu_read_lock_sched_held+0x93/0xa0
> [ 191.208279] process_one_work+0x51e/0xe20
> [ 191.212340] ? pwq_dec_nr_in_flight+0x200/0x200
> [ 191.216912] ? get_lock_stats+0x4b/0xf0
> [ 191.220788] ? preempt_count_sub+0xf/0xd0
> [ 191.224844] ? worker_thread+0x219/0x860
> [ 191.228823] ? do_raw_spin_trylock+0x6d/0xa0
> [ 191.233142] worker_thread+0xeb/0x860
> [ 191.236848] ? process_one_work+0xe20/0xe20
> [ 191.241095] kthread+0x206/0x300
> [ 191.244352] ? process_one_work+0xe20/0xe20
> [ 191.248587] ? kthread_stop+0x570/0x570
> [ 191.252459] ret_from_fork+0x3a/0x50
> [ 191.256082] Code: 14 3e ff 8b 4b 78 55 4d 89 f9 41 56 41 55 48 c7 c7 a0 cf db 82 41 54 44 8b 44 24 2c 48 8b 54 24 30 48 8b 74 24 20 e8 16 94 13 ff <0f> 0b 48 c7 c7 60 8e 1f 85 48 83 c4 20 e8 55 ef a6 ff 89 74 24
> [ 191.275327] RIP: skb_panic+0xc3/0x100 RSP: ffff8801d54072f0
> [ 191.281024] ---[ end trace 7ea51094e099e006 ]---
> [ 191.285724] Kernel panic - not syncing: Fatal exception in interrupt
> [ 191.292168] Kernel Offset: disabled
> [ 191.295697] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
>
> Reproducer:
>
> ip link add h1 type veth peer name swp1
> ip link add h3 type veth peer name swp3
>
> ip link set dev h1 up
> ip address add 192.0.2.1/28 dev h1
>
> ip link add dev vh3 type vrf table 20
> ip link set dev h3 master vh3
> ip link set dev vh3 up
> ip link set dev h3 up
>
> ip link set dev swp3 up
> ip address add dev swp3 2001:db8:2::1/64
>
> ip link set dev swp1 up
> tc qdisc add dev swp1 clsact
>
> ip link add name gt6 type ip6erspan \
> local 2001:db8:2::1 remote 2001:db8:2::2 oseq okey 123
> ip link set dev gt6 up
>
> sleep 1
>
> tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
> action mirred egress mirror dev gt6
> ping -I h1 192.0.2.2
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
Acked-by: William Tu <u9012063@gmail.com>
> net/ipv6/ip6_gre.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index 5d93c7c..53b1531 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -911,7 +911,7 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
> truncate = true;
> }
>
> - if (skb_cow_head(skb, dev->needed_headroom))
> + if (skb_cow_head(skb, dev->needed_headroom ?: t->hlen))
> goto tx_err;
>
> t->parms.o_flags &= ~TUNNEL_KEY;
> --
> 2.4.11
>
^ permalink raw reply
* [PATCH net-next] net:sched: add action inheritdsfield to skbmod
From: Fu, Qiaobin @ 2018-05-17 19:33 UTC (permalink / raw)
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, jhs@mojatatu.com, Michel Machado
net/sched: add action inheritdsfield to skbmod
The new action inheritdsfield copies the field DS of
IPv4 and IPv6 packets into skb->prioriry. This enables
later classification of packets based on the DS field.
Original idea by Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Qiaobin Fu <qiaobinf@bu.edu>
Reviewed-by: Michel Machado <michel@digirati.com.br>
---
Note that the motivation for this patch is found in the following discussion:
https://www.spinics.net/lists/netdev/msg501061.html
---
diff --git a/include/uapi/linux/tc_act/tc_skbmod.h b/include/uapi/linux/tc_act/tc_skbmod.h
index 38c072f..0718b48 100644
--- a/include/uapi/linux/tc_act/tc_skbmod.h
+++ b/include/uapi/linux/tc_act/tc_skbmod.h
@@ -19,6 +19,7 @@
#define SKBMOD_F_SMAC 0x2
#define SKBMOD_F_ETYPE 0x4
#define SKBMOD_F_SWAPMAC 0x8
+#define SKBMOD_F_INHERITDSFIELD 0x10
struct tc_skbmod {
tc_gen;
diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c
index ad050d7..21d5bec 100644
--- a/net/sched/act_skbmod.c
+++ b/net/sched/act_skbmod.c
@@ -16,6 +16,9 @@
#include <linux/rtnetlink.h>
#include <net/netlink.h>
#include <net/pkt_sched.h>
+#include <net/ip.h>
+#include <net/ipv6.h>
+#include <net/dsfield.h>
#include <linux/tc_act/tc_skbmod.h>
#include <net/tc_act/tc_skbmod.h>
@@ -72,6 +75,25 @@ static int tcf_skbmod_run(struct sk_buff *skb, const struct tc_action *a,
ether_addr_copy(eth_hdr(skb)->h_source, (u8 *)tmpaddr);
}
+ if (flags & SKBMOD_F_INHERITDSFIELD) {
+ int wlen = skb_network_offset(skb);
+ switch (tc_skb_protocol(skb)) {
+ case htons(ETH_P_IP):
+ wlen += sizeof(struct iphdr);
+ if (!pskb_may_pull(skb, wlen))
+ return TC_ACT_SHOT;
+ skb->priority = ipv4_get_dsfield(ip_hdr(skb)) >> 2;
+ break;
+
+ case htons(ETH_P_IPV6):
+ wlen += sizeof(struct ipv6hdr);
+ if (!pskb_may_pull(skb, wlen))
+ return TC_ACT_SHOT;
+ skb->priority = ipv6_get_dsfield(ipv6_hdr(skb)) >> 2;
+ break;
+ }
+ }
+
return action;
}
@@ -127,6 +149,9 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla,
if (parm->flags & SKBMOD_F_SWAPMAC)
lflags = SKBMOD_F_SWAPMAC;
+ if (parm->flags & SKBMOD_F_INHERITDSFIELD)
+ lflags |= SKBMOD_F_INHERITDSFIELD;
+
exists = tcf_idr_check(tn, parm->index, a, bind);
if (exists && bind)
return 0;
^ permalink raw reply related
* Re: [PATCH net 1/7] net: ip6_gre: Request headroom in __gre6_xmit()
From: William Tu @ 2018-05-17 19:32 UTC (permalink / raw)
To: Petr Machata
Cc: Linux Kernel Network Developers, David Miller, Alexey Kuznetsov,
Hideaki YOSHIFUJI, Dmitry Kozlov
In-Reply-To: <eecc5c99f4feda332242407f76babc1f9b7152a8.1526567568.git.petrm@mellanox.com>
On Thu, May 17, 2018 at 7:36 AM, Petr Machata <petrm@mellanox.com> wrote:
> __gre6_xmit() pushes GRE headers before handing over to ip6_tnl_xmit()
> for generic IP-in-IP processing. However it doesn't make sure that there
> is enough headroom to push the header to. That can lead to the panic
> cited below. (Reproducer below that).
>
> Fix by requesting either needed_headroom if already primed, or just the
> bare minimum needed for the header otherwise.
>
> [ 158.576725] kernel BUG at net/core/skbuff.c:104!
> [ 158.581510] invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
> [ 158.587174] Modules linked in: act_mirred cls_matchall ip6_gre ip6_tunnel tunnel6 gre sch_ingress vrf veth x86_pkg_temp_thermal mlx_platform nfsd e1000e leds_mlxcpld
> [ 158.602268] CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 4.17.0-rc4-net_master-custom-139 #10
> [ 158.610938] Hardware name: Mellanox Technologies Ltd. "MSN2410-CB2F"/"SA000874", BIOS 4.6.5 03/08/2016
> [ 158.620426] RIP: 0010:skb_panic+0xc3/0x100
> [ 158.624586] RSP: 0018:ffff8801d3f27110 EFLAGS: 00010286
> [ 158.629882] RAX: 0000000000000082 RBX: ffff8801c02cc040 RCX: 0000000000000000
> [ 158.637127] RDX: 0000000000000082 RSI: dffffc0000000000 RDI: ffffed003a7e4e18
> [ 158.644366] RBP: ffff8801bfec8020 R08: ffffed003aabce19 R09: ffffed003aabce19
> [ 158.651574] R10: 000000000000000b R11: ffffed003aabce18 R12: ffff8801c364de66
> [ 158.658786] R13: 000000000000002c R14: 00000000000000c0 R15: ffff8801c364de68
> [ 158.666007] FS: 0000000000000000(0000) GS:ffff8801d5400000(0000) knlGS:0000000000000000
> [ 158.674212] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 158.680036] CR2: 00007f4b3702dcd0 CR3: 0000000003228002 CR4: 00000000001606e0
> [ 158.687228] Call Trace:
> [ 158.689752] ? __gre6_xmit+0x246/0xd80 [ip6_gre]
> [ 158.694475] ? __gre6_xmit+0x246/0xd80 [ip6_gre]
> [ 158.699141] skb_push+0x78/0x90
> [ 158.702344] __gre6_xmit+0x246/0xd80 [ip6_gre]
> [ 158.706872] ip6gre_tunnel_xmit+0x3bc/0x610 [ip6_gre]
> [ 158.711992] ? __gre6_xmit+0xd80/0xd80 [ip6_gre]
> [ 158.716668] ? debug_check_no_locks_freed+0x210/0x210
> [ 158.721761] ? print_irqtrace_events+0x120/0x120
> [ 158.726461] ? sched_clock_cpu+0x18/0x210
> [ 158.730572] ? sched_clock_cpu+0x18/0x210
> [ 158.734692] ? cyc2ns_read_end+0x10/0x10
> [ 158.738705] ? skb_network_protocol+0x76/0x200
> [ 158.743216] ? netif_skb_features+0x1b2/0x550
> [ 158.747648] dev_hard_start_xmit+0x137/0x770
> [ 158.752010] sch_direct_xmit+0x2ef/0x5d0
> [ 158.755992] ? pfifo_fast_dequeue+0x3fa/0x670
> [ 158.760460] ? pfifo_fast_change_tx_queue_len+0x810/0x810
> [ 158.765975] ? __lock_is_held+0xa0/0x160
> [ 158.770002] __qdisc_run+0x39e/0xfc0
> [ 158.773673] ? _raw_spin_unlock+0x29/0x40
> [ 158.777781] ? pfifo_fast_enqueue+0x24b/0x3e0
> [ 158.782191] ? sch_direct_xmit+0x5d0/0x5d0
> [ 158.786372] ? pfifo_fast_dequeue+0x670/0x670
> [ 158.790818] ? __dev_queue_xmit+0x172/0x1770
> [ 158.795195] ? preempt_count_sub+0xf/0xd0
> [ 158.799313] __dev_queue_xmit+0x410/0x1770
> [ 158.803512] ? ___slab_alloc+0x605/0x930
> [ 158.807525] ? ___slab_alloc+0x605/0x930
> [ 158.811540] ? memcpy+0x34/0x50
> [ 158.814768] ? netdev_pick_tx+0x1c0/0x1c0
> [ 158.818895] ? __skb_clone+0x2fd/0x3d0
> [ 158.822712] ? __copy_skb_header+0x270/0x270
> [ 158.827079] ? rcu_read_lock_sched_held+0x93/0xa0
> [ 158.831903] ? kmem_cache_alloc+0x344/0x4d0
> [ 158.836199] ? skb_clone+0x123/0x230
> [ 158.839869] ? skb_split+0x820/0x820
> [ 158.843521] ? tcf_mirred+0x554/0x930 [act_mirred]
> [ 158.848407] tcf_mirred+0x554/0x930 [act_mirred]
> [ 158.853104] ? tcf_mirred_act_wants_ingress.part.2+0x10/0x10 [act_mirred]
> [ 158.860005] ? __lock_acquire+0x706/0x26e0
> [ 158.864162] ? mark_lock+0x13d/0xb40
> [ 158.867832] tcf_action_exec+0xcf/0x2a0
> [ 158.871736] tcf_classify+0xfa/0x340
> [ 158.875402] __netif_receive_skb_core+0x8e1/0x1c60
> [ 158.880334] ? nf_ingress+0x500/0x500
> [ 158.884059] ? process_backlog+0x347/0x4b0
> [ 158.888241] ? lock_acquire+0xd8/0x320
> [ 158.892050] ? process_backlog+0x1b6/0x4b0
> [ 158.896228] ? process_backlog+0xc2/0x4b0
> [ 158.900291] process_backlog+0xc2/0x4b0
> [ 158.904210] net_rx_action+0x5cc/0x980
> [ 158.908047] ? napi_complete_done+0x2c0/0x2c0
> [ 158.912525] ? rcu_read_unlock+0x80/0x80
> [ 158.916534] ? __lock_is_held+0x34/0x160
> [ 158.920541] __do_softirq+0x1d4/0x9d2
> [ 158.924308] ? trace_event_raw_event_irq_handler_exit+0x140/0x140
> [ 158.930515] run_ksoftirqd+0x1d/0x40
> [ 158.934152] smpboot_thread_fn+0x32b/0x690
> [ 158.938299] ? sort_range+0x20/0x20
> [ 158.941842] ? preempt_count_sub+0xf/0xd0
> [ 158.945940] ? schedule+0x5b/0x140
> [ 158.949412] kthread+0x206/0x300
> [ 158.952689] ? sort_range+0x20/0x20
> [ 158.956249] ? kthread_stop+0x570/0x570
> [ 158.960164] ret_from_fork+0x3a/0x50
> [ 158.963823] Code: 14 3e ff 8b 4b 78 55 4d 89 f9 41 56 41 55 48 c7 c7 a0 cf db 82 41 54 44 8b 44 24 2c 48 8b 54 24 30 48 8b 74 24 20 e8 16 94 13 ff <0f> 0b 48 c7 c7 60 8e 1f 85 48 83 c4 20 e8 55 ef a6 ff 89 74 24
> [ 158.983235] RIP: skb_panic+0xc3/0x100 RSP: ffff8801d3f27110
> [ 158.988935] ---[ end trace 5af56ee845aa6cc8 ]---
> [ 158.993641] Kernel panic - not syncing: Fatal exception in interrupt
> [ 159.000176] Kernel Offset: disabled
> [ 159.003767] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
>
> Reproducer:
>
> ip link add h1 type veth peer name swp1
> ip link add h3 type veth peer name swp3
>
> ip link set dev h1 up
> ip address add 192.0.2.1/28 dev h1
>
> ip link add dev vh3 type vrf table 20
> ip link set dev h3 master vh3
> ip link set dev vh3 up
> ip link set dev h3 up
>
> ip link set dev swp3 up
> ip address add dev swp3 2001:db8:2::1/64
>
> ip link set dev swp1 up
> tc qdisc add dev swp1 clsact
>
> ip link add name gt6 type ip6gretap \
> local 2001:db8:2::1 remote 2001:db8:2::2
> ip link set dev gt6 up
>
> sleep 1
>
> tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
> action mirred egress mirror dev gt6
> ping -I h1 192.0.2.2
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
Thanks for the fix.
Acked-by: William Tu <u9012063@gmail.com>
> net/ipv6/ip6_gre.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index 69727bc..5d93c7c 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -698,6 +698,9 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
> else
> fl6->daddr = tunnel->parms.raddr;
>
> + if (skb_cow_head(skb, dev->needed_headroom ?: tunnel->hlen))
> + return -ENOMEM;
> +
> /* Push GRE header. */
> protocol = (dev->type == ARPHRD_ETHER) ? htons(ETH_P_TEB) : proto;
>
> --
> 2.4.11
>
^ permalink raw reply
* selftests: pmtu: Need pre-required configs ?
From: Naresh Kamboju @ 2018-05-17 19:32 UTC (permalink / raw)
To: open list:KERNEL SELFTEST FRAMEWORK; +Cc: netdev, sbrivio, Shuah Khan
kselftest net pmtu.sh skipped due to missing dependencies ?
This is an open issues on all devices running linux-mainline and linux-next.
[ 105.064609] test_bpf: test_skb_segment: success in skb_segment!
[ 105.648758] IPv6: ADDRCONF(NETDEV_UP): veth_a: link is not ready
[ 105.692738] IPv6: ADDRCONF(NETDEV_UP): veth_b: link is not ready
[ 105.698774] IPv6: ADDRCONF(NETDEV_CHANGE): veth_b: link becomes ready
[ 105.705256] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready
RTNETLINK answers: Operation not supported
vti6 not supported
TEST: vti6: PMTU exceptions [SKIP]
[ 106.248522] IPv6: ADDRCONF(NETDEV_UP): veth_a: link is not ready
[ 106.296914] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready
RTNETLINK answers: Operation not supported
vti4 not supported
TEST: vti4: PMTU exceptions [SKIP]
[ 106.812715] IPv6: ADDRCONF(NETDEV_UP): veth_a: link is not ready
[ 106.890709] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready
RTNETLINK answers: Operation not supported
vti4 not supported
TEST: vti4: default MTU assignment [SKIP]
[ 107.393724] IPv6: ADDRCONF(NETDEV_UP): veth_a: link is not ready
[ 107.453358] IPv6: ADDRCONF(NETDEV_UP): veth_b: link is not ready
[ 107.459380] IPv6: ADDRCONF(NETDEV_CHANGE): veth_b: link becomes ready
[ 107.465852] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready
RTNETLINK answers: Operation not supported
vti6 not supported
TEST: vti6: default MTU assignment [SKIP]
RTNETLINK answers: Operation not supported
TEST: vti4: MTU setting on link creation [SKIP]
vti not supported
RTNETLINK answers: Operation not supported
TEST: vti6: MTU setting on link creation [SKIP]
vti6 not supported
RTNETLINK answers: Operation not supported
TEST: vti6: MTU changes on link changes [SKIP]
dummy not supported
selftests: pmtu.sh [PASS]
The current config is,
http://snapshots.linaro.org/openembedded/lkft/morty/intel-core2-32/rpb/\
linux-mainline/852/config
For more details please refer this log,
https://lkft.validation.linaro.org/scheduler/job/212320#L3395
Best regards
Naresh Kamboju
^ permalink raw reply
* [PATCH net-next] vlan: Add extack messages for link create
From: David Ahern @ 2018-05-17 19:29 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
Add informative messages for error paths related to adding a
VLAN to a device.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
net/8021q/vlan.c | 11 ++++++++---
net/8021q/vlan.h | 3 ++-
net/8021q/vlan_netlink.c | 45 ++++++++++++++++++++++++++++++++++-----------
3 files changed, 44 insertions(+), 15 deletions(-)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 5505ee6ebdbe..73a65789271b 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -118,17 +118,21 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
}
int vlan_check_real_dev(struct net_device *real_dev,
- __be16 protocol, u16 vlan_id)
+ __be16 protocol, u16 vlan_id,
+ struct netlink_ext_ack *extack)
{
const char *name = real_dev->name;
if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
pr_info("VLANs not supported on %s\n", name);
+ NL_SET_ERR_MSG_MOD(extack, "VLANs not supported on device");
return -EOPNOTSUPP;
}
- if (vlan_find_dev(real_dev, protocol, vlan_id) != NULL)
+ if (vlan_find_dev(real_dev, protocol, vlan_id) != NULL) {
+ NL_SET_ERR_MSG_MOD(extack, "VLAN device already exists");
return -EEXIST;
+ }
return 0;
}
@@ -215,7 +219,8 @@ static int register_vlan_device(struct net_device *real_dev, u16 vlan_id)
if (vlan_id >= VLAN_VID_MASK)
return -ERANGE;
- err = vlan_check_real_dev(real_dev, htons(ETH_P_8021Q), vlan_id);
+ err = vlan_check_real_dev(real_dev, htons(ETH_P_8021Q), vlan_id,
+ NULL);
if (err < 0)
return err;
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h
index e23aac3e4d37..44df1c3df02d 100644
--- a/net/8021q/vlan.h
+++ b/net/8021q/vlan.h
@@ -109,7 +109,8 @@ int vlan_dev_change_flags(const struct net_device *dev, u32 flag, u32 mask);
void vlan_dev_get_realdev_name(const struct net_device *dev, char *result);
int vlan_check_real_dev(struct net_device *real_dev,
- __be16 protocol, u16 vlan_id);
+ __be16 protocol, u16 vlan_id,
+ struct netlink_ext_ack *extack);
void vlan_setup(struct net_device *dev);
int register_vlan_dev(struct net_device *dev, struct netlink_ext_ack *extack);
void unregister_vlan_dev(struct net_device *dev, struct list_head *head);
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index 6689c0b272a7..9b60c1e399e2 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -47,14 +47,20 @@ static int vlan_validate(struct nlattr *tb[], struct nlattr *data[],
int err;
if (tb[IFLA_ADDRESS]) {
- if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
+ if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN) {
+ NL_SET_ERR_MSG_MOD(extack, "Invalid link address");
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ }
+ if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS]))) {
+ NL_SET_ERR_MSG_MOD(extack, "Invalid link address");
return -EADDRNOTAVAIL;
+ }
}
- if (!data)
+ if (!data) {
+ NL_SET_ERR_MSG_MOD(extack, "VLAN properties not specified");
return -EINVAL;
+ }
if (data[IFLA_VLAN_PROTOCOL]) {
switch (nla_get_be16(data[IFLA_VLAN_PROTOCOL])) {
@@ -62,29 +68,38 @@ static int vlan_validate(struct nlattr *tb[], struct nlattr *data[],
case htons(ETH_P_8021AD):
break;
default:
+ NL_SET_ERR_MSG_MOD(extack, "Invalid VLAN protocol");
return -EPROTONOSUPPORT;
}
}
if (data[IFLA_VLAN_ID]) {
id = nla_get_u16(data[IFLA_VLAN_ID]);
- if (id >= VLAN_VID_MASK)
+ if (id >= VLAN_VID_MASK) {
+ NL_SET_ERR_MSG_MOD(extack, "Invalid VLAN id");
return -ERANGE;
+ }
}
if (data[IFLA_VLAN_FLAGS]) {
flags = nla_data(data[IFLA_VLAN_FLAGS]);
if ((flags->flags & flags->mask) &
~(VLAN_FLAG_REORDER_HDR | VLAN_FLAG_GVRP |
- VLAN_FLAG_LOOSE_BINDING | VLAN_FLAG_MVRP))
+ VLAN_FLAG_LOOSE_BINDING | VLAN_FLAG_MVRP)) {
+ NL_SET_ERR_MSG_MOD(extack, "Invalid VLAN flags");
return -EINVAL;
+ }
}
err = vlan_validate_qos_map(data[IFLA_VLAN_INGRESS_QOS]);
- if (err < 0)
+ if (err < 0) {
+ NL_SET_ERR_MSG_MOD(extack, "Invalid ingress QOS map");
return err;
+ }
err = vlan_validate_qos_map(data[IFLA_VLAN_EGRESS_QOS]);
- if (err < 0)
+ if (err < 0) {
+ NL_SET_ERR_MSG_MOD(extack, "Invalid egress QOS map");
return err;
+ }
return 0;
}
@@ -126,14 +141,21 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev,
__be16 proto;
int err;
- if (!data[IFLA_VLAN_ID])
+ if (!data[IFLA_VLAN_ID]) {
+ NL_SET_ERR_MSG_MOD(extack, "VLAN id not specified");
return -EINVAL;
+ }
- if (!tb[IFLA_LINK])
+ if (!tb[IFLA_LINK]) {
+ NL_SET_ERR_MSG_MOD(extack, "link not specified");
return -EINVAL;
+ }
+
real_dev = __dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
- if (!real_dev)
+ if (!real_dev) {
+ NL_SET_ERR_MSG_MOD(extack, "link does not exist");
return -ENODEV;
+ }
if (data[IFLA_VLAN_PROTOCOL])
proto = nla_get_be16(data[IFLA_VLAN_PROTOCOL]);
@@ -146,7 +168,8 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev,
dev->priv_flags |= (real_dev->priv_flags & IFF_XMIT_DST_RELEASE);
vlan->flags = VLAN_FLAG_REORDER_HDR;
- err = vlan_check_real_dev(real_dev, vlan->vlan_proto, vlan->vlan_id);
+ err = vlan_check_real_dev(real_dev, vlan->vlan_proto, vlan->vlan_id,
+ extack);
if (err < 0)
return err;
--
2.11.0
^ permalink raw reply related
* Re: [PATCH net-next ] net: mscc: Add SPDX identifier
From: Joe Perches @ 2018-05-17 19:28 UTC (permalink / raw)
To: Alexandre Belloni, David S . Miller
Cc: Allan Nielsen, razvan.stefanescu, po.liu, Thomas Petazzoni,
Andrew Lunn, Florian Fainelli, netdev, linux-kernel
In-Reply-To: <20180517192305.17517-1-alexandre.belloni@bootlin.com>
On Thu, 2018-05-17 at 21:23 +0200, Alexandre Belloni wrote:
> ocelot_qsys.h is missing the SPDX identfier, fix that.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Only the copyright holders should ideally be modifying
these and also removing other license content.
For instance, what's the real intent here?
> diff --git a/drivers/net/ethernet/mscc/ocelot_qsys.h b/drivers/net/ethernet/mscc/ocelot_qsys.h
[]
> @@ -1,7 +1,7 @@
> +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
GPL 2.0+ or 2.0?
> /*
> * Microsemi Ocelot Switch driver
> *
> - * License: Dual MIT/GPL
> * Copyright (c) 2017 Microsemi Corporation
> */
>
^ permalink raw reply
* [PATCH net-next ] net: mscc: Add SPDX identifier
From: Alexandre Belloni @ 2018-05-17 19:23 UTC (permalink / raw)
To: David S . Miller
Cc: Allan Nielsen, razvan.stefanescu, po.liu, Thomas Petazzoni,
Andrew Lunn, Florian Fainelli, netdev, linux-kernel,
Alexandre Belloni
ocelot_qsys.h is missing the SPDX identfier, fix that.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/net/ethernet/mscc/ocelot_qsys.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mscc/ocelot_qsys.h b/drivers/net/ethernet/mscc/ocelot_qsys.h
index aa7267d5ca77..d8c63aa761be 100644
--- a/drivers/net/ethernet/mscc/ocelot_qsys.h
+++ b/drivers/net/ethernet/mscc/ocelot_qsys.h
@@ -1,7 +1,7 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
/*
* Microsemi Ocelot Switch driver
*
- * License: Dual MIT/GPL
* Copyright (c) 2017 Microsemi Corporation
*/
--
2.17.0
^ permalink raw reply related
* Re: [patch net-next RFC 04/12] dsa: set devlink port attrs for dsa ports
From: Florian Fainelli @ 2018-05-17 19:14 UTC (permalink / raw)
To: Jiri Pirko
Cc: Andrew Lunn, netdev, davem, idosch, jakub.kicinski, mlxsw,
vivien.didelot, michael.chan, ganeshgr, saeedm, simon.horman,
pieter.jansenvanvuuren, john.hurley, dirk.vandermerwe,
alexander.h.duyck, ogerlitz, dsahern, vijaya.guvva,
satananda.burla, raghu.vatsavayi, felix.manlunas, gospo,
sathya.perla, vasundhara-v.volam, tariqt, eranbe,
jeffrey.t.kirsher
In-Reply-To: <20180517173907.GW1972@nanopsycho>
On 05/17/2018 10:39 AM, Jiri Pirko wrote:
>>> That is compiled inside "fixed_phy", isn't it?
>>
>> It matches what CONFIG_FIXED_PHY is, so if it's built-in it also becomes
>> built-in, if is modular, it is also modular, this was fixed with
>> 40013ff20b1beed31184935fc0aea6a859d4d4ef ("net: dsa: Fix functional
>> dsa-loop dependency on FIXED_PHY")
>
> Now I have it compiled as module, and after modprobe dsa_loop I see:
> [ 1168.129202] libphy: Fixed MDIO Bus: probed
> [ 1168.222716] dsa-loop fixed-0:1f: DSA mockup driver: 0x1f
>
> This messages I did not see when I had fixed_phy compiled as buildin.
>
> But I still see no netdevs :/
The platform data assumes there is a network device named "eth0" as the
parent device, yes I know this is terrible, but unfortunately we don't
have anything better at this point, though that could certainly change
that to take a proper struct device reference in the future.
I am assuming that you don't have such a network device named "eth0" in
your system? You can also look at the less than 360 LOCs of the driver
and find out where your problem is, this is not mlxsw :)
--
Florian
^ 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