* Re: [PATCH net-next v10 1/4] net netlink: Add new type NLA_FLAG_BITS
From: Jamal Hadi Salim @ 2017-06-12 13:51 UTC (permalink / raw)
To: Jiri Pirko; +Cc: davem, netdev, xiyou.wangcong, eric.dumazet, simon.horman, mrv
In-Reply-To: <20170612114345.GB1993@nanopsycho>
On 17-06-12 07:43 AM, Jiri Pirko wrote:
> Mon, Jun 12, 2017 at 01:10:56PM CEST, jhs@mojatatu.com wrote:
>> On 17-06-12 06:34 AM, Jiri Pirko wrote:
>>> Sun, Jun 11, 2017 at 08:37:25PM CEST, jhs@mojatatu.com wrote:
>>>> On 17-06-11 01:38 PM, Jamal Hadi Salim wrote:
>>>>> On 17-06-11 09:49 AM, Jiri Pirko wrote:
>>>>>> Sun, Jun 11, 2017 at 01:53:43PM CEST, jhs@mojatatu.com wrote:
>>>>>>> From: Jamal Hadi Salim <jhs@mojatatu.com>
>>>>>
>>>>>
>>>>>>> This patch also provides an extra feature: a validation callback
>>>>>>> that could be speaciliazed for other types.
>>>>>>
>>>>>> s/speaciliazed/speciliazed/
>>>>>>
>>>>>
>>>>> Will fix.
>>>>>
>>>>>
>>>>>>>
>>>>>>> [ATTR_GOO] = { .type = MYTYPE,
>>>>>>> .validation_data = &myvalidation_data,
>>>>>>> .validate_content = mycontent_validator },
>>>>>>
>>>>>> Indent is wrong. (Does not matter really in desc, but anyway)
>>>>>>
>>>>>
>>>>> I cant find out how it got indented that way; my source
>>>>> or email dont show it as such (but really doesnt matter).
>>>>>
>>>>>
>>>>>> Suggested-by: Jiri Pirko <jiri@mellanox.com>
>>>>>>
>>>>>
>>>>> Will add.
>>>>>
>>>>>>
>>> I believe that this struct should go into:
>>> include/uapi/linux/netlink.h
>>>
>>> struct nla_flag_bits {
>>> __u32 nla_flag_bits_values;
>>> __u32 nla_flag_bits_selector;
>>> };
>>>
>>> Then you can use it from userspace and everywhere in kernel.
>>>
>> That file seems to be very out of place for this stuff.
>
> Howcome? It is a common netlink api.
>
Take a look at that file's content. It talks about what goes in
the netlink header. Adding types in it seems out of place.
>> NLA_XXX are kernel side types. They are part of net/netlink.h which is
>> not uapi accessible.
>> David Ahern has submitted a patch to move all those defines to iproute2.
>> Will make sense to move these to a uapi/linux/netlink-types.h but that
>> is waay beyond the scope of this patch set.
>
> Well, I don't think so :)
>
> The thing is, struct nla_flag_bits is tightly coupled with NLA_FLAG_BITS
> enum value. They should be in the same uapi file. That makes sense to me.
>
Sure - they should be in the same file. But is it uapi/linux/netlink.h?
cheers,
jamal
^ permalink raw reply
* Re: [PATCH net] proc: snmp6: Use correct type in memset
From: David Miller @ 2017-06-12 13:53 UTC (permalink / raw)
To: christian.perle; +Cc: netdev, hejianet
In-Reply-To: <20170612080657.GB1536@cell>
From: Christian Perle <christian.perle@secunet.com>
Date: Mon, 12 Jun 2017 10:06:57 +0200
> Reading /proc/net/snmp6 yields bogus values on 32 bit kernels.
> Use "u64" instead of "unsigned long" in sizeof().
>
> Fixes: 4a4857b ("proc: Reduce cache miss in snmp6_seq_show")
Please use 12 significant digits of SHA1-ID in Fixes: tags, I fixed
it up for you this time.
> Signed-off-by: Christian Perle <christian.perle@secunet.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH net-next v10 3/4] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Jamal Hadi Salim @ 2017-06-12 13:57 UTC (permalink / raw)
To: Jiri Pirko; +Cc: davem, netdev, xiyou.wangcong, eric.dumazet, simon.horman, mrv
In-Reply-To: <20170612114751.GC1993@nanopsycho>
On 17-06-12 07:47 AM, Jiri Pirko wrote:
> Mon, Jun 12, 2017 at 01:16:05PM CEST, jhs@mojatatu.com wrote:
>> On 17-06-11 10:13 AM, Jiri Pirko wrote:
>> This also is not useful.
>> It happens to be ok for this use case but not for the
>> general case. i.e.
>> We need to get the whole struct not just the values
>> and use the selector to pick what bits are affected.
>> Example if bit X is set to 1 in selector and bit X in value
>> is 0, then we set the kernel's bit X to 0.
>
> Sure, have another helper for selector then.
> Or, you can have:
>
> struct nla_flag_bits *fb;
> fb = nla_get_flag_bits(tb[TCA_ROOT_FLAGS]);
>
> Or all 3 helpers. My point is, it is a specific netlink attribute with
> specific format, it should have get/put helpers.
>
I did try nla_get_flag_bits(tb[TCA_ROOT_FLAGS], &fb) so i dont have
to do alloc/free - it ended being a single line function which
does a memcpy.
Is this really necessary?
The user of this structure better know it to make use of it.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH v3] sh_eth: add support for changing MTU
From: David Miller @ 2017-06-12 13:58 UTC (permalink / raw)
To: niklas.soderlund+renesas; +Cc: sergei.shtylyov, netdev, linux-renesas-soc
In-Reply-To: <20170612083903.1584-1-niklas.soderlund+renesas@ragnatech.se>
From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Date: Mon, 12 Jun 2017 10:39:03 +0200
> The hardware supports the MTU to be changed and the driver it self is
> somewhat prepared to support this. This patch hooks up the callbacks to
> be able to change the MTU from user-space.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next v3 0/3] udp: reduce cache pressure
From: David Miller @ 2017-06-12 14:01 UTC (permalink / raw)
To: pabeni; +Cc: netdev, edumazet
In-Reply-To: <cover.1497026892.git.pabeni@redhat.com>
From: Paolo Abeni <pabeni@redhat.com>
Date: Mon, 12 Jun 2017 11:23:40 +0200
> In the most common use case, many skb fields are not used by recvmsg(), and
> the few ones actually accessed lays on cold cachelines, which leads to several
> cache miss per packet.
>
> This patch series attempts to reduce such misses with different strategies:
> * caching the interesting fields in the scratched space
> * avoid accessing at all uninteresting fields
> * prefetching
>
> Tested using the udp_sink program by Jesper[1] as the receiver, an h/w l4 rx
> hash on the ingress nic, so that the number of ingress nic rx queues hit by the
> udp traffic could be controlled via ethtool -L.
>
> The udp_sink program was bound to the first idle cpu, to get more
> stable numbers.
>
> On a single numa node receiver:
>
> nic rx queues vanilla patched kernel delta
> 1 1850 kpps 1850 kpps 0%
> 2 2370 kpps 2700 kpps 13.9%
> 16 2000 kpps 2220 kpps 11%
>
> [1] https://github.com/netoptimizer/network-testing/blob/master/src/udp_sink.c
Series applied, thank you.
^ permalink raw reply
* [PATCH net-next] net: mvpp2: enable basic 10G support
From: Antoine Tenart @ 2017-06-12 14:01 UTC (permalink / raw)
To: davem
Cc: Antoine Tenart, gregory.clement, thomas.petazzoni, nadavh,
stefanc, mw, linux, netdev
On GOP port 0 two MAC modes are available: GMAC and XLG. The XLG MAC is
used for 10G connectivity. This patch adds a basic 10G support by
allowing to use the XLG MAC on port 0 and by reworking the
port_enable/disable functions so that the XLG MAC is configured when
using 10G.
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
drivers/net/ethernet/marvell/mvpp2.c | 49 ++++++++++++++++++++++++++++++------
1 file changed, 41 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 33c901622ed5..ca4b55c60682 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -345,9 +345,15 @@
/* Per-port XGMAC registers. PPv2.2 only, only for GOP port 0,
* relative to port->base.
*/
+#define MVPP22_XLG_CTRL0_REG 0x100
+#define MVPP22_XLG_CTRL0_PORT_EN BIT(0)
+#define MVPP22_XLG_CTRL0_MAC_RESET_DIS BIT(1)
+#define MVPP22_XLG_CTRL0_MIB_CNT_DIS BIT(14)
+
#define MVPP22_XLG_CTRL3_REG 0x11c
#define MVPP22_XLG_CTRL3_MACMODESELECT_MASK (7 << 13)
#define MVPP22_XLG_CTRL3_MACMODESELECT_GMAC (0 << 13)
+#define MVPP22_XLG_CTRL3_MACMODESELECT_10G (1 << 13)
/* SMI registers. PPv2.2 only, relative to priv->iface_base. */
#define MVPP22_SMI_MISC_CFG_REG 0x1204
@@ -4186,7 +4192,13 @@ static void mvpp22_port_mii_set(struct mvpp2_port *port)
if (port->gop_id == 0) {
val = readl(port->base + MVPP22_XLG_CTRL3_REG);
val &= ~MVPP22_XLG_CTRL3_MACMODESELECT_MASK;
- val |= MVPP22_XLG_CTRL3_MACMODESELECT_GMAC;
+
+ if (port->phy_interface == PHY_INTERFACE_MODE_XAUI ||
+ port->phy_interface == PHY_INTERFACE_MODE_10GKR)
+ val |= MVPP22_XLG_CTRL3_MACMODESELECT_10G;
+ else
+ val |= MVPP22_XLG_CTRL3_MACMODESELECT_GMAC;
+
writel(val, port->base + MVPP22_XLG_CTRL3_REG);
}
@@ -4236,19 +4248,40 @@ static void mvpp2_port_enable(struct mvpp2_port *port)
{
u32 val;
- val = readl(port->base + MVPP2_GMAC_CTRL_0_REG);
- val |= MVPP2_GMAC_PORT_EN_MASK;
- val |= MVPP2_GMAC_MIB_CNTR_EN_MASK;
- writel(val, port->base + MVPP2_GMAC_CTRL_0_REG);
+ /* Only GOP port 0 has an XLG MAC */
+ if (port->gop_id == 0 &&
+ (port->phy_interface == PHY_INTERFACE_MODE_XAUI ||
+ port->phy_interface == PHY_INTERFACE_MODE_10GKR)) {
+ val = readl(port->base + MVPP22_XLG_CTRL0_REG);
+ val |= MVPP22_XLG_CTRL0_PORT_EN |
+ MVPP22_XLG_CTRL0_MAC_RESET_DIS;
+ val &= ~MVPP22_XLG_CTRL0_MIB_CNT_DIS;
+ writel(val, port->base + MVPP22_XLG_CTRL0_REG);
+ } else {
+ val = readl(port->base + MVPP2_GMAC_CTRL_0_REG);
+ val |= MVPP2_GMAC_PORT_EN_MASK;
+ val |= MVPP2_GMAC_MIB_CNTR_EN_MASK;
+ writel(val, port->base + MVPP2_GMAC_CTRL_0_REG);
+ }
}
static void mvpp2_port_disable(struct mvpp2_port *port)
{
u32 val;
- val = readl(port->base + MVPP2_GMAC_CTRL_0_REG);
- val &= ~(MVPP2_GMAC_PORT_EN_MASK);
- writel(val, port->base + MVPP2_GMAC_CTRL_0_REG);
+ /* Only GOP port 0 has an XLG MAC */
+ if (port->gop_id == 0 &&
+ (port->phy_interface == PHY_INTERFACE_MODE_XAUI ||
+ port->phy_interface == PHY_INTERFACE_MODE_10GKR)) {
+ val = readl(port->base + MVPP22_XLG_CTRL0_REG);
+ val &= ~(MVPP22_XLG_CTRL0_PORT_EN |
+ MVPP22_XLG_CTRL0_MAC_RESET_DIS);
+ writel(val, port->base + MVPP22_XLG_CTRL0_REG);
+ } else {
+ val = readl(port->base + MVPP2_GMAC_CTRL_0_REG);
+ val &= ~(MVPP2_GMAC_PORT_EN_MASK);
+ writel(val, port->base + MVPP2_GMAC_CTRL_0_REG);
+ }
}
/* Set IEEE 802.3x Flow Control Xon Packet Transmission Mode */
--
2.9.4
^ permalink raw reply related
* Re: [PATCH net 0/9] Bugs fixes in ena ethernet driver
From: Belgazal, Netanel @ 2017-06-12 14:09 UTC (permalink / raw)
To: David Miller
Cc: netdev@vger.kernel.org, Woodhouse, David, Machulsky, Zorik,
Matushevsky, Alexander, BSHARA, Said, Wilson, Matt,
Liguori, Anthony, Bshara, Nafea, Schmeilin, Evgeny
In-Reply-To: <20170611.163807.1473229146636819355.davem@davemloft.net>
Thank you David,
Do you might have an ETA when do you plan to merge net branch into net-next? I plan to base my new patchset to net-next on top of this one.
Regards,
Netanel
________________________________________
From: David Miller <davem@davemloft.net>
Sent: Sunday, June 11, 2017 11:38 PM
To: Belgazal, Netanel
Cc: netdev@vger.kernel.org; Woodhouse, David; Machulsky, Zorik; Matushevsky, Alexander; BSHARA, Said; Wilson, Matt; Liguori, Anthony; Bshara, Nafea; Schmeilin, Evgeny
Subject: Re: [PATCH net 0/9] Bugs fixes in ena ethernet driver
From: <netanel@amazon.com>
Date: Sun, 11 Jun 2017 15:42:42 +0300
> This patchset contains fixes for the bugs that were discovered so far.
Series applied.
^ permalink raw reply
* Re: [PATCH net-next v10 1/4] net netlink: Add new type NLA_FLAG_BITS
From: Jiri Pirko @ 2017-06-12 14:14 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: davem, netdev, xiyou.wangcong, eric.dumazet, simon.horman, mrv,
dsahern
In-Reply-To: <22f33fa9-1759-57b7-6aea-898f89c9f61f@mojatatu.com>
Mon, Jun 12, 2017 at 03:51:19PM CEST, jhs@mojatatu.com wrote:
>On 17-06-12 07:43 AM, Jiri Pirko wrote:
>> Mon, Jun 12, 2017 at 01:10:56PM CEST, jhs@mojatatu.com wrote:
>> > On 17-06-12 06:34 AM, Jiri Pirko wrote:
>> > > Sun, Jun 11, 2017 at 08:37:25PM CEST, jhs@mojatatu.com wrote:
>> > > > On 17-06-11 01:38 PM, Jamal Hadi Salim wrote:
>> > > > > On 17-06-11 09:49 AM, Jiri Pirko wrote:
>> > > > > > Sun, Jun 11, 2017 at 01:53:43PM CEST, jhs@mojatatu.com wrote:
>> > > > > > > From: Jamal Hadi Salim <jhs@mojatatu.com>
>> > > > >
>> > > > >
>> > > > > > > This patch also provides an extra feature: a validation callback
>> > > > > > > that could be speaciliazed for other types.
>> > > > > >
>> > > > > > s/speaciliazed/speciliazed/
>> > > > > >
>> > > > >
>> > > > > Will fix.
>> > > > >
>> > > > >
>> > > > > > >
>> > > > > > > [ATTR_GOO] = { .type = MYTYPE,
>> > > > > > > .validation_data = &myvalidation_data,
>> > > > > > > .validate_content = mycontent_validator },
>> > > > > >
>> > > > > > Indent is wrong. (Does not matter really in desc, but anyway)
>> > > > > >
>> > > > >
>> > > > > I cant find out how it got indented that way; my source
>> > > > > or email dont show it as such (but really doesnt matter).
>> > > > >
>> > > > >
>> > > > > > Suggested-by: Jiri Pirko <jiri@mellanox.com>
>> > > > > >
>> > > > >
>> > > > > Will add.
>> > > > >
>> > > > > >
>
>> > > I believe that this struct should go into:
>> > > include/uapi/linux/netlink.h
>> > >
>> > > struct nla_flag_bits {
>> > > __u32 nla_flag_bits_values;
>> > > __u32 nla_flag_bits_selector;
>> > > };
>> > >
>> > > Then you can use it from userspace and everywhere in kernel.
>> > >
>> > That file seems to be very out of place for this stuff.
>>
>> Howcome? It is a common netlink api.
>>
>
>Take a look at that file's content. It talks about what goes in
>the netlink header. Adding types in it seems out of place.
Bit less than rtnetlink.h. But I agree it is not optimal. Re optimal,
please see below.
>
>
>> > NLA_XXX are kernel side types. They are part of net/netlink.h which is
>> > not uapi accessible.
>> > David Ahern has submitted a patch to move all those defines to iproute2.
>> > Will make sense to move these to a uapi/linux/netlink-types.h but that
>> > is waay beyond the scope of this patch set.
>>
>> Well, I don't think so :)
>>
>> The thing is, struct nla_flag_bits is tightly coupled with NLA_FLAG_BITS
>> enum value. They should be in the same uapi file. That makes sense to me.
>>
>
>Sure - they should be in the same file. But is it uapi/linux/netlink.h?
Might be the netlink-types.h you mentioned above.
ccing DavidA.
^ permalink raw reply
* [PATCH v2] net: phy: Make phy_ethtool_ksettings_get return void
From: Yuval Shaia @ 2017-06-12 14:15 UTC (permalink / raw)
To: michael.chan, f.fainelli, siva.kallam, prashant, madalin.bucur,
leoli, sebastian.hesselbarth, sergei.shtylyov, grygorii.strashko,
w-kwok2, m-karicheri2, andrew, woojung.huh, UNGLinuxDriver,
vivien.didelot, davem, arnd, tremyfr, jarod, yuval.shaia,
horms+renesas, kazuya.mizuguchi.ks, dan.carpenter,
niklas.soderlund+renesas, johan, masaru.nagai.vx, geert+renesas,
laurent.pinchart, chris.brandt, ivan.khoronzhuk, mugunthanvnm,
netdev, linux-arm-kernel, linuxppc-dev
Make return value void since function never return meaningfull value
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
v0 ->v1:
* These files were missing in v0
* drivers/net/ethernet/renesas/ravb_main.c
* drivers/net/ethernet/renesas/sh_eth.c
* drivers/net/ethernet/ti/netcp_ethss.c
* Add Acked-by: Sergei Shtylyov
v1 -> v2:
* Adjust to net-next tree
---
drivers/net/ethernet/broadcom/b44.c | 3 ++-
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +++-
drivers/net/ethernet/broadcom/tg3.c | 4 +++-
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 6 ++----
drivers/net/ethernet/freescale/ucc_geth_ethtool.c | 4 +++-
drivers/net/ethernet/marvell/mv643xx_eth.c | 5 ++---
drivers/net/ethernet/renesas/ravb_main.c | 14 +++++++-------
drivers/net/ethernet/renesas/sh_eth.c | 5 ++---
drivers/net/ethernet/ti/cpsw.c | 9 +++++----
drivers/net/ethernet/ti/netcp_ethss.c | 8 +++-----
drivers/net/phy/phy.c | 10 +++++-----
drivers/net/usb/lan78xx.c | 2 +-
include/linux/phy.h | 4 ++--
net/dsa/slave.c | 9 +++++----
15 files changed, 47 insertions(+), 43 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 5b95bb4..9873d2d 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -1836,7 +1836,8 @@ static int b44_get_link_ksettings(struct net_device *dev,
if (bp->flags & B44_FLAG_EXTERNAL_PHY) {
BUG_ON(!dev->phydev);
- return phy_ethtool_ksettings_get(dev->phydev, cmd);
+ phy_ethtool_ksettings_get(dev->phydev, cmd);
+ return 0;
}
supported = (SUPPORTED_Autoneg);
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 50d88d3..34ebb40 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1453,7 +1453,8 @@ static int bcm_enet_get_link_ksettings(struct net_device *dev,
if (priv->has_phy) {
if (!dev->phydev)
return -ENODEV;
- return phy_ethtool_ksettings_get(dev->phydev, cmd);
+ phy_ethtool_ksettings_get(dev->phydev, cmd);
+ return 0;
} else {
cmd->base.autoneg = 0;
cmd->base.speed = (priv->force_speed_100) ?
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index a205a9f..daca1c9 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -477,7 +477,9 @@ static int bcmgenet_get_link_ksettings(struct net_device *dev,
if (!priv->phydev)
return -ENODEV;
- return phy_ethtool_ksettings_get(priv->phydev, cmd);
+ phy_ethtool_ksettings_get(priv->phydev, cmd);
+
+ return 0;
}
static int bcmgenet_set_link_ksettings(struct net_device *dev,
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 537d571..d600c41 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -12097,7 +12097,9 @@ static int tg3_get_link_ksettings(struct net_device *dev,
if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
return -EAGAIN;
phydev = mdiobus_get_phy(tp->mdio_bus, tp->phy_addr);
- return phy_ethtool_ksettings_get(phydev, cmd);
+ phy_ethtool_ksettings_get(phydev, cmd);
+
+ return 0;
}
supported = (SUPPORTED_Autoneg);
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
index 15571e2..aad825088 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
@@ -75,16 +75,14 @@ static char dpaa_stats_global[][ETH_GSTRING_LEN] = {
static int dpaa_get_link_ksettings(struct net_device *net_dev,
struct ethtool_link_ksettings *cmd)
{
- int err;
-
if (!net_dev->phydev) {
netdev_dbg(net_dev, "phy device not initialized\n");
return 0;
}
- err = phy_ethtool_ksettings_get(net_dev->phydev, cmd);
+ phy_ethtool_ksettings_get(net_dev->phydev, cmd);
- return err;
+ return 0;
}
static int dpaa_set_link_ksettings(struct net_device *net_dev,
diff --git a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
index b642990..4df282e 100644
--- a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
+++ b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
@@ -113,7 +113,9 @@ uec_get_ksettings(struct net_device *netdev, struct ethtool_link_ksettings *cmd)
if (!phydev)
return -ENODEV;
- return phy_ethtool_ksettings_get(phydev, cmd);
+ phy_ethtool_ksettings_get(phydev, cmd);
+
+ return 0;
}
static int
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 25642de..5794d98 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -1501,10 +1501,9 @@ mv643xx_eth_get_link_ksettings_phy(struct mv643xx_eth_private *mp,
struct ethtool_link_ksettings *cmd)
{
struct net_device *dev = mp->dev;
- int err;
u32 supported, advertising;
- err = phy_ethtool_ksettings_get(dev->phydev, cmd);
+ phy_ethtool_ksettings_get(dev->phydev, cmd);
/*
* The MAC does not support 1000baseT_Half.
@@ -1520,7 +1519,7 @@ mv643xx_eth_get_link_ksettings_phy(struct mv643xx_eth_private *mp,
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
advertising);
- return err;
+ return 0;
}
static int
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 784782d..5931e85 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1076,16 +1076,16 @@ static int ravb_get_link_ksettings(struct net_device *ndev,
struct ethtool_link_ksettings *cmd)
{
struct ravb_private *priv = netdev_priv(ndev);
- int error = -ENODEV;
unsigned long flags;
- if (ndev->phydev) {
- spin_lock_irqsave(&priv->lock, flags);
- error = phy_ethtool_ksettings_get(ndev->phydev, cmd);
- spin_unlock_irqrestore(&priv->lock, flags);
- }
+ if (!ndev->phydev)
+ return -ENODEV;
- return error;
+ spin_lock_irqsave(&priv->lock, flags);
+ phy_ethtool_ksettings_get(ndev->phydev, cmd);
+ spin_unlock_irqrestore(&priv->lock, flags);
+
+ return 0;
}
static int ravb_set_link_ksettings(struct net_device *ndev,
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 2d686cc..b2f0cea 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1915,16 +1915,15 @@ static int sh_eth_get_link_ksettings(struct net_device *ndev,
{
struct sh_eth_private *mdp = netdev_priv(ndev);
unsigned long flags;
- int ret;
if (!ndev->phydev)
return -ENODEV;
spin_lock_irqsave(&mdp->lock, flags);
- ret = phy_ethtool_ksettings_get(ndev->phydev, cmd);
+ phy_ethtool_ksettings_get(ndev->phydev, cmd);
spin_unlock_irqrestore(&mdp->lock, flags);
- return ret;
+ return 0;
}
static int sh_eth_set_link_ksettings(struct net_device *ndev,
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index b6a0d92..f72742d 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2170,11 +2170,12 @@ static int cpsw_get_link_ksettings(struct net_device *ndev,
struct cpsw_common *cpsw = priv->cpsw;
int slave_no = cpsw_slave_index(cpsw, priv);
- if (cpsw->slaves[slave_no].phy)
- return phy_ethtool_ksettings_get(cpsw->slaves[slave_no].phy,
- ecmd);
- else
+ if (cpsw->slaves[slave_no].phy) {
+ phy_ethtool_ksettings_get(cpsw->slaves[slave_no].phy, ecmd);
+ return 0;
+ } else {
return -EOPNOTSUPP;
+ }
}
static int cpsw_set_link_ksettings(struct net_device *ndev,
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index dd92950..0847a8f 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -1927,7 +1927,6 @@ static int keystone_get_link_ksettings(struct net_device *ndev,
struct netcp_intf *netcp = netdev_priv(ndev);
struct phy_device *phy = ndev->phydev;
struct gbe_intf *gbe_intf;
- int ret;
if (!phy)
return -EINVAL;
@@ -1939,11 +1938,10 @@ static int keystone_get_link_ksettings(struct net_device *ndev,
if (!gbe_intf->slave)
return -EINVAL;
- ret = phy_ethtool_ksettings_get(phy, cmd);
- if (!ret)
- cmd->base.port = gbe_intf->slave->phy_port_t;
+ phy_ethtool_ksettings_get(phy, cmd);
+ cmd->base.port = gbe_intf->slave->phy_port_t;
- return ret;
+ return 0;
}
static int keystone_set_link_ksettings(struct net_device *ndev,
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 14fc5bc..edcdf0d 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -509,8 +509,8 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
}
EXPORT_SYMBOL(phy_ethtool_ksettings_set);
-int phy_ethtool_ksettings_get(struct phy_device *phydev,
- struct ethtool_link_ksettings *cmd)
+void phy_ethtool_ksettings_get(struct phy_device *phydev,
+ struct ethtool_link_ksettings *cmd)
{
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
phydev->supported);
@@ -532,8 +532,6 @@ int phy_ethtool_ksettings_get(struct phy_device *phydev,
cmd->base.autoneg = phydev->autoneg;
cmd->base.eth_tp_mdix_ctrl = phydev->mdix_ctrl;
cmd->base.eth_tp_mdix = phydev->mdix;
-
- return 0;
}
EXPORT_SYMBOL(phy_ethtool_ksettings_get);
@@ -1449,7 +1447,9 @@ int phy_ethtool_get_link_ksettings(struct net_device *ndev,
if (!phydev)
return -ENODEV;
- return phy_ethtool_ksettings_get(phydev, cmd);
+ phy_ethtool_ksettings_get(phydev, cmd);
+
+ return 0;
}
EXPORT_SYMBOL(phy_ethtool_get_link_ksettings);
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 9eff97a..5833f7e 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -1490,7 +1490,7 @@ static int lan78xx_get_link_ksettings(struct net_device *net,
if (ret < 0)
return ret;
- ret = phy_ethtool_ksettings_get(phydev, cmd);
+ phy_ethtool_ksettings_get(phydev, cmd);
usb_autopm_put_interface(dev->intf);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 4142422..e70360a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -874,8 +874,8 @@ void phy_start_machine(struct phy_device *phydev);
void phy_stop_machine(struct phy_device *phydev);
void phy_trigger_machine(struct phy_device *phydev, bool sync);
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
-int phy_ethtool_ksettings_get(struct phy_device *phydev,
- struct ethtool_link_ksettings *cmd);
+void phy_ethtool_ksettings_get(struct phy_device *phydev,
+ struct ethtool_link_ksettings *cmd);
int phy_ethtool_ksettings_set(struct phy_device *phydev,
const struct ethtool_link_ksettings *cmd);
int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 5f3caee..5e45ae5 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -387,12 +387,13 @@ dsa_slave_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct dsa_slave_priv *p = netdev_priv(dev);
- int err = -EOPNOTSUPP;
- if (p->phy != NULL)
- err = phy_ethtool_ksettings_get(p->phy, cmd);
+ if (!p->phy)
+ return -EOPNOTSUPP;
- return err;
+ phy_ethtool_ksettings_get(p->phy, cmd);
+
+ return 0;
}
static int
--
2.9.4
^ permalink raw reply related
* patch "net: ehea: convert to use DRIVER_ATTR_RO" added to driver-core-testing
From: gregkh @ 2017-06-12 14:15 UTC (permalink / raw)
To: gregkh, davem, dougmill, netdev
This is a note to let you know that I've just added the patch titled
net: ehea: convert to use DRIVER_ATTR_RO
to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-testing branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will be merged to the driver-core-next branch sometime soon,
after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
>From ce8e0cd892c66be110613876dded547acc66da13 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Fri, 9 Jun 2017 11:03:09 +0200
Subject: net: ehea: convert to use DRIVER_ATTR_RO
We are trying to get rid of DRIVER_ATTR(), and the ehea driver's
attribute can be trivially changed to use DRIVER_ATTR_RO().
Cc: Douglas Miller <dougmill@linux.vnet.ibm.com>
Cc: <netdev@vger.kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 1e53d7a82675..b9d310f20bcc 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -3553,14 +3553,12 @@ static int check_module_parm(void)
return ret;
}
-static ssize_t ehea_show_capabilities(struct device_driver *drv,
- char *buf)
+static ssize_t capabilities_show(struct device_driver *drv, char *buf)
{
return sprintf(buf, "%d", EHEA_CAPABILITIES);
}
-static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH,
- ehea_show_capabilities, NULL);
+static DRIVER_ATTR_RO(capabilities);
static int __init ehea_module_init(void)
{
--
2.13.1
^ permalink raw reply related
* patch "net: caif: convert to use DRIVER_ATTR_RO" added to driver-core-testing
From: gregkh @ 2017-06-12 14:15 UTC (permalink / raw)
To: gregkh, davem, dmitry.tarnyagin, netdev
This is a note to let you know that I've just added the patch titled
net: caif: convert to use DRIVER_ATTR_RO
to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-testing branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will be merged to the driver-core-next branch sometime soon,
after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
>From f85205c42eb0423e05c91d0276bfc86b136d42f6 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Fri, 9 Jun 2017 11:03:08 +0200
Subject: net: caif: convert to use DRIVER_ATTR_RO
We are trying to get rid of DRIVER_ATTR(), and the caif driver's
attributes can be trivially changed to use DRIVER_ATTR_RO().
Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
Cc: <netdev@vger.kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/caif/caif_spi.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 3a529fbe539f..3281a3e0c144 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -289,44 +289,44 @@ static LIST_HEAD(cfspi_list);
static spinlock_t cfspi_list_lock;
/* SPI uplink head alignment. */
-static ssize_t show_up_head_align(struct device_driver *driver, char *buf)
+static ssize_t up_head_align_show(struct device_driver *driver, char *buf)
{
return sprintf(buf, "%d\n", spi_up_head_align);
}
-static DRIVER_ATTR(up_head_align, S_IRUSR, show_up_head_align, NULL);
+static DRIVER_ATTR_RO(up_head_align);
/* SPI uplink tail alignment. */
-static ssize_t show_up_tail_align(struct device_driver *driver, char *buf)
+static ssize_t up_tail_align_show(struct device_driver *driver, char *buf)
{
return sprintf(buf, "%d\n", spi_up_tail_align);
}
-static DRIVER_ATTR(up_tail_align, S_IRUSR, show_up_tail_align, NULL);
+static DRIVER_ATTR_RO(up_tail_align);
/* SPI downlink head alignment. */
-static ssize_t show_down_head_align(struct device_driver *driver, char *buf)
+static ssize_t down_head_align_show(struct device_driver *driver, char *buf)
{
return sprintf(buf, "%d\n", spi_down_head_align);
}
-static DRIVER_ATTR(down_head_align, S_IRUSR, show_down_head_align, NULL);
+static DRIVER_ATTR_RO(down_head_align);
/* SPI downlink tail alignment. */
-static ssize_t show_down_tail_align(struct device_driver *driver, char *buf)
+static ssize_t down_tail_align_show(struct device_driver *driver, char *buf)
{
return sprintf(buf, "%d\n", spi_down_tail_align);
}
-static DRIVER_ATTR(down_tail_align, S_IRUSR, show_down_tail_align, NULL);
+static DRIVER_ATTR_RO(down_tail_align);
/* SPI frame alignment. */
-static ssize_t show_frame_align(struct device_driver *driver, char *buf)
+static ssize_t frame_align_show(struct device_driver *driver, char *buf)
{
return sprintf(buf, "%d\n", spi_frm_align);
}
-static DRIVER_ATTR(frame_align, S_IRUSR, show_frame_align, NULL);
+static DRIVER_ATTR_RO(frame_align);
int cfspi_xmitfrm(struct cfspi *cfspi, u8 *buf, size_t len)
{
--
2.13.1
^ permalink raw reply related
* patch "wireless: ipw2x00: convert to use DRIVER_ATTR_RW" added to driver-core-testing
From: gregkh @ 2017-06-12 14:15 UTC (permalink / raw)
To: gregkh, kvalo, linux-wireless, netdev, stas.yakovlev
This is a note to let you know that I've just added the patch titled
wireless: ipw2x00: convert to use DRIVER_ATTR_RW
to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-testing branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will be merged to the driver-core-next branch sometime soon,
after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
>From 0457e1ae0f4b88676b0cea30ef6acff24febbbc0 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Fri, 9 Jun 2017 11:03:10 +0200
Subject: wireless: ipw2x00: convert to use DRIVER_ATTR_RW
We are trying to get rid of DRIVER_ATTR(), and the ipw2x00 driver's
attributes can be trivially changed to use DRIVER_ATTR_RW().
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: <linux-wireless@vger.kernel.org>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/intel/ipw2x00/ipw2100.c | 8 +++-----
drivers/net/wireless/intel/ipw2x00/ipw2200.c | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
index f922859acf40..aaaca4d08e2b 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
@@ -4160,12 +4160,12 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr,
static DEVICE_ATTR(bssinfo, S_IRUGO, show_bssinfo, NULL);
#ifdef CONFIG_IPW2100_DEBUG
-static ssize_t show_debug_level(struct device_driver *d, char *buf)
+static ssize_t debug_level_show(struct device_driver *d, char *buf)
{
return sprintf(buf, "0x%08X\n", ipw2100_debug_level);
}
-static ssize_t store_debug_level(struct device_driver *d,
+static ssize_t debug_level_store(struct device_driver *d,
const char *buf, size_t count)
{
u32 val;
@@ -4179,9 +4179,7 @@ static ssize_t store_debug_level(struct device_driver *d,
return strnlen(buf, count);
}
-
-static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, show_debug_level,
- store_debug_level);
+static DRIVER_ATTR_RW(debug_level);
#endif /* CONFIG_IPW2100_DEBUG */
static ssize_t show_fatal_error(struct device *d,
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index bbc579b647b6..5b79e2ec3a16 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -1195,12 +1195,12 @@ static void ipw_led_shutdown(struct ipw_priv *priv)
*
* See the level definitions in ipw for details.
*/
-static ssize_t show_debug_level(struct device_driver *d, char *buf)
+static ssize_t debug_level_show(struct device_driver *d, char *buf)
{
return sprintf(buf, "0x%08X\n", ipw_debug_level);
}
-static ssize_t store_debug_level(struct device_driver *d, const char *buf,
+static ssize_t debug_level_store(struct device_driver *d, const char *buf,
size_t count)
{
char *p = (char *)buf;
@@ -1221,9 +1221,7 @@ static ssize_t store_debug_level(struct device_driver *d, const char *buf,
return strnlen(buf, count);
}
-
-static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO,
- show_debug_level, store_debug_level);
+static DRIVER_ATTR_RW(debug_level);
static inline u32 ipw_get_event_log_len(struct ipw_priv *priv)
{
--
2.13.1
^ permalink raw reply related
* Re: pull-request: wireless-drivers-next 2017-06-12
From: David Miller @ 2017-06-12 14:15 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <87poe98h90.fsf@kamboji.qca.qualcomm.com>
From: Kalle Valo <kvalo@codeaurora.org>
Date: Mon, 12 Jun 2017 16:31:23 +0300
> here's a pull request to net-next, more info in the tag below. But do
> note that Stephen reported qtnfmac will fail to build with the net tree
> due to the changes in netdev destructor:
>
> https://lkml.kernel.org/r/20170608122759.7ffda0c3@canb.auug.org.au
>
> So once you pull these changes AND your net tree to net-next you need to
> apply Stephen's patch above. As of this writing there is no build
> breakage (yet).
>
> Please let me know if there are any problems.
Yep, I'll have to deal with that in the merge commit next time I pull
net into net-next, thanks for reminding me.
Pulled, thanks.
^ permalink raw reply
* Re: [PATCH net-next v10 3/4] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Jiri Pirko @ 2017-06-12 14:16 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: davem, netdev, xiyou.wangcong, eric.dumazet, simon.horman, mrv
In-Reply-To: <8d63d734-1c44-824f-a5b2-ba8c12e6f05b@mojatatu.com>
Mon, Jun 12, 2017 at 03:57:05PM CEST, jhs@mojatatu.com wrote:
>On 17-06-12 07:47 AM, Jiri Pirko wrote:
>> Mon, Jun 12, 2017 at 01:16:05PM CEST, jhs@mojatatu.com wrote:
>> > On 17-06-11 10:13 AM, Jiri Pirko wrote:
>
>> > This also is not useful.
>> > It happens to be ok for this use case but not for the
>> > general case. i.e.
>> > We need to get the whole struct not just the values
>> > and use the selector to pick what bits are affected.
>> > Example if bit X is set to 1 in selector and bit X in value
>> > is 0, then we set the kernel's bit X to 0.
>>
>> Sure, have another helper for selector then.
>> Or, you can have:
>>
>> struct nla_flag_bits *fb;
>> fb = nla_get_flag_bits(tb[TCA_ROOT_FLAGS]);
>>
>> Or all 3 helpers. My point is, it is a specific netlink attribute with
>> specific format, it should have get/put helpers.
>>
>
>I did try nla_get_flag_bits(tb[TCA_ROOT_FLAGS], &fb) so i dont have
>to do alloc/free - it ended being a single line function which
>does a memcpy.
>Is this really necessary?
Yes please, it is necessary! By the same logic, nla_get_u32 would not be
necessary.
I don't understand why you need alloc/free...
>The user of this structure better know it to make use of it.
>
>cheers,
>jamal
^ permalink raw reply
* Re: [PATCH net 0/9] Bugs fixes in ena ethernet driver
From: David Miller @ 2017-06-12 14:24 UTC (permalink / raw)
To: netanel; +Cc: netdev, dwmw, zorik, matua, saeedb, msw, aliguori, nafea, evgenys
In-Reply-To: <1497276570720.79426@amazon.com>
From: "Belgazal, Netanel" <netanel@amazon.com>
Date: Mon, 12 Jun 2017 14:09:30 +0000
> Do you might have an ETA when do you plan to merge net branch into
> net-next? I plan to base my new patchset to net-next on top of this
> one.
Probably later in the week, either Tuesday or Weds.
^ permalink raw reply
* Re: [PATCH v2] net: phy: Make phy_ethtool_ksettings_get return void
From: David Miller @ 2017-06-12 14:25 UTC (permalink / raw)
To: yuval.shaia
Cc: michael.chan, f.fainelli, siva.kallam, prashant, madalin.bucur,
leoli, sebastian.hesselbarth, sergei.shtylyov, grygorii.strashko,
w-kwok2, m-karicheri2, andrew, woojung.huh, UNGLinuxDriver,
vivien.didelot, arnd, tremyfr, jarod, horms+renesas,
kazuya.mizuguchi.ks, dan.carpenter, niklas.soderlund+renesas,
johan, masaru.nagai.vx, geert+renesas, laurent.pinchart,
chris.brandt, ivan.khoronzhuk, mugunthanvnm, netdev,
linux-arm-kernel
In-Reply-To: <20170612141508.29229-1-yuval.shaia@oracle.com>
From: Yuval Shaia <yuval.shaia@oracle.com>
Date: Mon, 12 Jun 2017 17:15:08 +0300
> Make return value void since function never return meaningfull value
>
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> ---
> v0 ->v1:
> * These files were missing in v0
> * drivers/net/ethernet/renesas/ravb_main.c
> * drivers/net/ethernet/renesas/sh_eth.c
> * drivers/net/ethernet/ti/netcp_ethss.c
> * Add Acked-by: Sergei Shtylyov
> v1 -> v2:
> * Adjust to net-next tree
Applied, thank you.
^ permalink raw reply
* Re: [PATCH v2] net: phy: Make phy_ethtool_ksettings_get return void
From: David Miller @ 2017-06-12 14:59 UTC (permalink / raw)
To: yuval.shaia
Cc: michael.chan, f.fainelli, siva.kallam, prashant, madalin.bucur,
leoli, sebastian.hesselbarth, sergei.shtylyov, grygorii.strashko,
w-kwok2, m-karicheri2, andrew, woojung.huh, UNGLinuxDriver,
vivien.didelot, arnd, tremyfr, jarod, horms+renesas,
kazuya.mizuguchi.ks, dan.carpenter, niklas.soderlund+renesas,
johan, masaru.nagai.vx, geert+renesas, laurent.pinchart,
chris.brandt, ivan.khoronzhuk, mugunthanvnm, netdev,
linux-arm-kernel
In-Reply-To: <20170612.102525.1159274040679939960.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Mon, 12 Jun 2017 10:25:25 -0400 (EDT)
> From: Yuval Shaia <yuval.shaia@oracle.com>
> Date: Mon, 12 Jun 2017 17:15:08 +0300
>
>> Make return value void since function never return meaningfull value
>>
>> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
>> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> ---
>> v0 ->v1:
>> * These files were missing in v0
>> * drivers/net/ethernet/renesas/ravb_main.c
>> * drivers/net/ethernet/renesas/sh_eth.c
>> * drivers/net/ethernet/ti/netcp_ethss.c
>> * Add Acked-by: Sergei Shtylyov
>> v1 -> v2:
>> * Adjust to net-next tree
>
> Applied, thank you.
Reverted, please test your build properly:
drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c: In function ‘xgene_get_link_ksettings’:
drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c:134:10: error: void value not ignored as it ought to be
return phy_ethtool_ksettings_get(phydev, cmd);
^
drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c:140:11: error: void value not ignored as it ought to be
return phy_ethtool_ksettings_get(phydev, cmd);
^
scripts/Makefile.build:302: recipe for target 'drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.o' failed
^ permalink raw reply
* Re: [PATCH net-next v10 1/4] net netlink: Add new type NLA_FLAG_BITS
From: David Ahern @ 2017-06-12 15:00 UTC (permalink / raw)
To: Jiri Pirko, Jamal Hadi Salim
Cc: davem, netdev, xiyou.wangcong, eric.dumazet, simon.horman, mrv
In-Reply-To: <20170612141450.GD1993@nanopsycho>
On 6/12/17 8:14 AM, Jiri Pirko wrote:
>>> The thing is, struct nla_flag_bits is tightly coupled with NLA_FLAG_BITS
>>> enum value. They should be in the same uapi file. That makes sense to me.
>>>
>>
>> Sure - they should be in the same file. But is it uapi/linux/netlink.h?
>
> Might be the netlink-types.h you mentioned above.
>
> ccing DavidA.
>
Just saw this patch set this morning. Few comments:
1. I think nla_bitfield or nla_bitmap is a better name than nla_flag_bits
2. The length should be open ended with the size of the array determined
by nla_len / sizeof(struct nla_bitfield). That allows this to be
extended to an arbitrary large bitfield as needed.
3. IMO since these are nla prefixes and new NLA type they should be in
uapi/linux/netlink.h
^ permalink raw reply
* Re: [PATCH net-next v2] vxlan: dont migrate permanent fdb entries during learn
From: David Miller @ 2017-06-12 15:01 UTC (permalink / raw)
To: roopa; +Cc: netdev, jbenc, hannes, nicolas.dichtel, nikolay
In-Reply-To: <1497223970-40084-1-git-send-email-roopa@cumulusnetworks.com>
From: Roopa Prabhu <roopa@cumulusnetworks.com>
Date: Sun, 11 Jun 2017 16:32:50 -0700
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> This patch fixes vxlan_snoop to not move permanent fdb entries
> on learn events. This is consistent with the bridge fdb
> handling of permanent entries.
>
> Fixes: 26a41ae60438 ("vxlan: only migrate dynamic FDB entries")
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> ---
> v2 - added Fixes tag
Applied, thank you.
^ permalink raw reply
* Re: [PATCH v2] arm: eBPF JIT compiler
From: Shubham Bansal @ 2017-06-12 15:40 UTC (permalink / raw)
To: Daniel Borkmann
Cc: Kees Cook, Network Development, David S. Miller,
Alexei Starovoitov, Russell King,
linux-arm-kernel@lists.infradead.org, LKML, Andrew Lunn
In-Reply-To: <593E6B0F.8070901@iogearbox.net>
On Mon, Jun 12, 2017 at 3:51 PM, Daniel Borkmann <daniel@iogearbox.net> wrote:
> On 05/30/2017 09:19 PM, Kees Cook wrote:
>>> This patch is essentially changing the current implementation of JIT
>>> compiler of Berkeley Packet Filter from classic to internal with almost
>>> all instructions from eBPF ISA supported except the following
>>> BPF_ALU64 | BPF_DIV | BPF_K
>>> BPF_ALU64 | BPF_DIV | BPF_X
>>> BPF_ALU64 | BPF_MOD | BPF_K
>>> BPF_ALU64 | BPF_MOD | BPF_X
>>> BPF_STX | BPF_XADD | BPF_W
>>> BPF_STX | BPF_XADD | BPF_DW
>>> BPF_JMP | BPF_CALL
>
>
> Any plans to implement above especially BPF_JMP | BPF_CALL in near future?
> Reason why I'm asking is that i) currently the arm32 cBPF JIT implements
> all of the cBPF extensions (except SKF_AD_RANDOM and SKF_AD_VLAN_TPID).
> Some of the programs that were JITed before e.g. using SKF_AD_CPU would now
> fall back to the eBPF interpreter due to lack of translation in JIT, but
> also ii) that probably most (if not all) of eBPF programs use BPF helper
> calls heavily, which will still redirect them to the interpreter right now
> due to lack of BPF_JMP | BPF_CALL support, so it's really quite essential
> to have it implemented.
I can try for BPF_JMP | BPF_CALL. I didn't do it last time because I
thought, it would make the code look messy and become pain to get it
through the review.
For this, I have to map eBPF arguments with arm ABI arguments and move
ebpf arguments to corresponding arm ABI arguments, as eBPF arguments
doesn't match with arm ABI arguments.
Let me try that if its possible.
As far as following 4 are concerned :
>>> BPF_ALU64 | BPF_DIV | BPF_K
>>> BPF_ALU64 | BPF_DIV | BPF_X
>>> BPF_ALU64 | BPF_MOD | BPF_K
>>> BPF_ALU64 | BPF_MOD | BPF_X
I don't think it possible with current constraints over registers. I
already tried this.
>
>>> Implementation is using scratch space to emulate 64 bit eBPF ISA on 32
>>> bit
>>> ARM because of deficiency of general purpose registers on ARM. Currently,
>>> only LITTLE ENDIAN machines are supported in this eBPF JIT Compiler.
>>>
>>> Tested on ARMv7 with QEMU by me (Shubham Bansal).
>>> Tested on ARMv5 by Andrew Lunn (andrew@lunn.ch).
>>> Expected to work on ARMv6 as well, as its a part ARMv7 and part ARMv5.
>>> Although, a proper testing is not done for ARMv6.
>>>
>>> Both of these testing are done with and without CONFIG_FRAME_POINTER
>>> separately for LITTLE ENDIAN machine.
>>>
>>> For testing:
>>>
>>> 1. JIT is enabled with
>>> echo 1 > /proc/sys/net/core/bpf_jit_enable
>>> 2. Constant Blinding can be enabled along with JIT using
>>> echo 1 > /proc/sys/net/core/bpf_jit_enable
>>> echo 2 > /proc/sys/net/core/bpf_jit_harden
>>>
>>> See Documentation/networking/filter.txt for more information.
>>>
>>> Result : test_bpf: Summary: 314 PASSED, 0 FAILED, [278/306 JIT'ed]
>
>
> Did you also manage to get the BPF selftest suite running in the meantime
> (tools/testing/selftests/bpf/)? There are a couple of programs that clang
> will compile (test_pkt_access.o, test_xdp.o, test_l4lb.o, test_tcp_estats.o)
> and then test run.
Nope. It looks like a latest addition to testing. Can you please tell
me how to test with it?
>
> Did you manage to get tail calls tested as well (I assume so since you
> implemented emit_bpf_tail_call() in the patch but just out of curiosity)?
I didn't try it exclusively, I thought test_bpf must have tested it. Doesn't it?
>
>>> Signed-off-by: Shubham Bansal <illusionist.neo@gmail.com>
>>> ---
>>> Documentation/networking/filter.txt | 4 +-
>>> arch/arm/Kconfig | 2 +-
>>> arch/arm/net/bpf_jit_32.c | 2404
>>> ++++++++++++++++++++++++-----------
>>> arch/arm/net/bpf_jit_32.h | 108 +-
>>> 4 files changed, 1713 insertions(+), 805 deletions(-)
>>>
> [...]
>
> If arm folks take the patch, there will be two minor (silent) merge
> conflicts with net-next:
>
> 1) In bpf_int_jit_compile(), below the jited = 1 assignment, there
> needs to come a prog->jited_len = image_size.
Done.
> 2) The internal tail call opcode changed from BPF_JMP | BPF_CALL | BPF_X
> into BPF_JMP | BPF_TAIL_CALL.
Done.
>
> Two minor things below, could probably also be as follow-up.
>
> [...]
>>>
>>> + /* dst = imm64 */
>>> + case BPF_LD | BPF_IMM | BPF_DW:
>>> + {
>>> + const struct bpf_insn insn1 = insn[1];
>>> + u32 hi, lo = imm;
>>> +
>>> + if (insn1.code != 0 || insn1.src_reg != 0 ||
>>> + insn1.dst_reg != 0 || insn1.off != 0) {
>>> + /* Note: verifier in BPF core must catch invalid
>>> + * instruction.
>>> + */
>>> + pr_err_once("Invalid BPF_LD_IMM64
>>> instruction\n");
>>> + return -EINVAL;
>>> + }
>
>
> Nit: this check can be removed as verifier already takes care
> of it. (No JIT checks for this anymore.)
>
>>> + hi = insn1.imm;
>>> + emit_a32_mov_i(dst_lo, lo, dstk, ctx);
>>> + emit_a32_mov_i(dst_hi, hi, dstk, ctx);
>>> +
>>> + return 1;
>>> + }
>
> [...]
>>>
>>> - /* compute offsets only during the first pass */
>>> - if (ctx->target == NULL)
>>> - ctx->offsets[i] = ctx->idx * 4;
>>> +static int validate_code(struct jit_ctx *ctx)
>>> +{
>>> + int i;
>>> +
>>> + for (i = 0; i < ctx->idx; i++) {
>>> + u32 a32_insn = le32_to_cpu(ctx->target[i]);
>
>
> Given __opcode_to_mem_arm(ARM_INST_UDF) is used to fill the image,
> perhaps use the __mem_to_opcode_arm() helper for the check?
Done.
I will send the patch again with these fixes. I really appreciate if
you could find more issues with the code, so that I can add it to the
next fix.
Thanks.
Shubham
^ permalink raw reply
* Re: [PATCH v2] arm: eBPF JIT compiler
From: Shubham Bansal @ 2017-06-12 15:41 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Daniel Borkmann, Kees Cook, Network Development, David S. Miller,
Alexei Starovoitov, linux-arm-kernel@lists.infradead.org, LKML,
Andrew Lunn
In-Reply-To: <20170612110611.GC4902@n2100.armlinux.org.uk>
Hi Russel,
On Mon, Jun 12, 2017 at 4:36 PM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> On Mon, Jun 12, 2017 at 12:21:03PM +0200, Daniel Borkmann wrote:
>> On 05/30/2017 09:19 PM, Kees Cook wrote:
>> >On Thu, May 25, 2017 at 4:13 PM, Shubham Bansal
>> ><illusionist.neo@gmail.com> wrote:
>> >>+static int validate_code(struct jit_ctx *ctx)
>> >>+{
>> >>+ int i;
>> >>+
>> >>+ for (i = 0; i < ctx->idx; i++) {
>> >>+ u32 a32_insn = le32_to_cpu(ctx->target[i]);
>>
>> Given __opcode_to_mem_arm(ARM_INST_UDF) is used to fill the image,
>> perhaps use the __mem_to_opcode_arm() helper for the check?
>>
>> >>+ if (a32_insn == ARM_INST_UDF)
>
> The following is probably better:
>
> if (ctx->target[i] == __opcode_to_mem_arm(ARM_INST_UDF))
>
> since then you can take advantage of the compiler optimising the
> constant rather than having to do a byte swap on an unknown 32-bit
> value.
Done. Thanks :)
Please check if you can find anymore issues with the code. I really
appreciate it.
-Shubham
^ permalink raw reply
* Re: [net-next] net: phy: marvell: Show complete link partner advertising
From: Florian Fainelli @ 2017-06-12 16:05 UTC (permalink / raw)
To: Thomas Bogendoerfer, andrew, netdev, linux-kernel, rmk+kernel
In-Reply-To: <20170612133237.E20945085BC@solo.franken.de>
On 06/12/2017 05:54 AM, Thomas Bogendoerfer wrote:
> From: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>
> Give back all modes advertised by the link partner. This change brings
> the marvell phy driver in line with all other phy drivers.
>
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
I thought Russell had a similar patch but I can't find it applied in
net-next, so:
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
drivers/net/phy/lxt.c has a similar pattern that would be worth fixing too.
> ---
> drivers/net/phy/marvell.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index 4c5246fed69b..8400403b3f62 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -1139,7 +1139,6 @@ static int marvell_read_status_page_an(struct phy_device *phydev,
> int status;
> int lpa;
> int lpagb;
> - int adv;
>
> status = phy_read(phydev, MII_M1011_PHY_STATUS);
> if (status < 0)
> @@ -1153,12 +1152,6 @@ static int marvell_read_status_page_an(struct phy_device *phydev,
> if (lpagb < 0)
> return lpagb;
>
> - adv = phy_read(phydev, MII_ADVERTISE);
> - if (adv < 0)
> - return adv;
> -
> - lpa &= adv;
> -
> if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
> phydev->duplex = DUPLEX_FULL;
> else
>
--
Florian
^ permalink raw reply
* Re: [net-next] net: phy: marvell: Show complete link partner advertising
From: David Miller @ 2017-06-12 16:08 UTC (permalink / raw)
To: tsbogend; +Cc: andrew, f.fainelli, netdev, linux-kernel
In-Reply-To: <20170612133237.E20945085BC@solo.franken.de>
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Date: Mon, 12 Jun 2017 14:54:57 +0200
> From: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>
> Give back all modes advertised by the link partner. This change brings
> the marvell phy driver in line with all other phy drivers.
>
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Applied, thanks.
^ permalink raw reply
* Re: mdio-thunder.c:undefined reference to `mdiobus_unregister'
From: Randy Dunlap @ 2017-06-12 16:09 UTC (permalink / raw)
To: kbuild test robot, Florian Fainelli
Cc: kbuild-all, linux-kernel, netdev@vger.kernel.org, Arnd Bergmann
In-Reply-To: <201706121044.hytIipdV%fengguang.wu@intel.com>
On 06/11/17 19:14, kbuild test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 32c1431eea4881a6b17bd7c639315010aeefa452
> commit: 90eff9096c01ba90cdae504a6b95ee87fe2556a3 net: phy: Allow splitting MDIO bus/device support from PHYs
> date: 3 months ago
> config: x86_64-randconfig-s2-06120830 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> git checkout 90eff9096c01ba90cdae504a6b95ee87fe2556a3
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All errors (new ones prefixed by >>):
>
> drivers/built-in.o: In function `thunder_mdiobus_pci_remove':
>>> mdio-thunder.c:(.text+0x2a212f): undefined reference to `mdiobus_unregister'
>>> mdio-thunder.c:(.text+0x2a2138): undefined reference to `mdiobus_free'
> drivers/built-in.o: In function `thunder_mdiobus_pci_probe':
> mdio-thunder.c:(.text+0x2a22e7): undefined reference to `devm_mdiobus_alloc_size'
> mdio-thunder.c:(.text+0x2a236f): undefined reference to `of_mdiobus_register'
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
>
Ugh. I don't know the solution to this one.
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_THUNDER=y
CONFIG_PHYLIB=m
First 2 lines are OK, but the third line causes the problem...
in drivers/net/phy/Makefile:
# PHYLIB implies MDIO_DEVICE, in that case, we have a bunch of circular
# dependencies that does not make it possible to split mdio-bus objects into a
# dedicated loadable module, so we bundle them all together into libphy.ko
ifdef CONFIG_PHYLIB
libphy-y += $(mdio-bus-y)
else
obj-$(CONFIG_MDIO_DEVICE) += mdio-bus.o
endif
libphy-$(CONFIG_SWPHY) += swphy.o
libphy-$(CONFIG_LED_TRIGGER_PHY) += phy_led_triggers.o
obj-$(CONFIG_PHYLIB) += libphy.o
So PHYLIB is built as libphy.ko and the mdiobus functions are there
instead of being in mdio-bus.o (so they are not built-in), while the
mdio-thunder driver is built-in.
--
~Randy
^ permalink raw reply
* Re: [net-next] net: phy: marvell: Show complete link partner advertising
From: Russell King - ARM Linux @ 2017-06-12 16:10 UTC (permalink / raw)
To: Florian Fainelli; +Cc: Thomas Bogendoerfer, andrew, netdev, linux-kernel
In-Reply-To: <a172b1f9-5141-6d53-1d96-bd028a0b0a23@gmail.com>
On Mon, Jun 12, 2017 at 09:05:04AM -0700, Florian Fainelli wrote:
> On 06/12/2017 05:54 AM, Thomas Bogendoerfer wrote:
> > From: Thomas Bogendoerfer <tbogendoerfer@suse.de>
> >
> > Give back all modes advertised by the link partner. This change brings
> > the marvell phy driver in line with all other phy drivers.
> >
> > Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>
> I thought Russell had a similar patch but I can't find it applied in
> net-next, so:
I do, it has a subject line of "net: phy: fix marvell phy status reading"
and it's already been sent (first link). DaveM said he applied it
(second link):
https://www.mail-archive.com/netdev@vger.kernel.org/msg170743.html
https://www.mail-archive.com/netdev@vger.kernel.org/msg171036.html
However, Thomas' patch removes slightly more code (I didn't spot that
"adv" is no longer used and we don't need to read the MII_ADVERTISE
register anymore.)
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ 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