* [PATCH net-next 2/4] net: phy: use genphy_config_eee_advert in genphy_c45_an_config_aneg
From: Heiner Kallweit @ 2019-02-18 20:27 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <35d86611-9a07-7239-3310-767d8d1050b5@gmail.com>
Like in genphy_config_aneg() for clause 22 PHY's, we should keep modes
from being advertised that are known to be broken with EEE.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/phy-c45.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 16636d49b..2f5721430 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -89,12 +89,14 @@ EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
*/
int genphy_c45_an_config_aneg(struct phy_device *phydev)
{
- int changed = 0, ret;
+ int changed, ret;
u32 adv;
linkmode_and(phydev->advertising, phydev->advertising,
phydev->supported);
+ changed = genphy_config_eee_advert(phydev);
+
adv = linkmode_adv_to_mii_adv_t(phydev->advertising);
ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
--
2.20.1
^ permalink raw reply related
* [PATCH net-next 3/4] net: phy: add genphy_c45_check_and_restart_aneg
From: Heiner Kallweit @ 2019-02-18 20:27 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <35d86611-9a07-7239-3310-767d8d1050b5@gmail.com>
This function will be used by config_aneg callback implementations of
PHY drivers and allows to reduce boilerplate code.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/phy-c45.c | 30 ++++++++++++++++++++++++++++++
include/linux/phy.h | 1 +
2 files changed, 31 insertions(+)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 2f5721430..fc3173cc0 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -156,6 +156,36 @@ int genphy_c45_restart_aneg(struct phy_device *phydev)
}
EXPORT_SYMBOL_GPL(genphy_c45_restart_aneg);
+/**
+ * genphy_c45_check_and_restart_aneg - Enable and restart auto-negotiation
+ * @phydev: target phy_device struct
+ * @restart: whether aneg restart is requested
+ *
+ * This assumes that the auto-negotiation MMD is present.
+ *
+ * Check, and restart auto-negotiation if needed.
+ */
+int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart)
+{
+ int ret = 0;
+
+ if (!restart) {
+ /* Configure and restart aneg if it wasn't set before */
+ ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1);
+ if (ret < 0)
+ return ret;
+
+ if (!(ret & MDIO_AN_CTRL1_ENABLE))
+ restart = true;
+ }
+
+ if (restart)
+ ret = genphy_c45_restart_aneg(phydev);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(genphy_c45_check_and_restart_aneg);
+
/**
* genphy_c45_aneg_done - return auto-negotiation complete status
* @phydev: target phy_device struct
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 761131de4..8e9fc5764 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1097,6 +1097,7 @@ int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum,
/* Clause 45 PHY */
int genphy_c45_restart_aneg(struct phy_device *phydev);
+int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart);
int genphy_c45_aneg_done(struct phy_device *phydev);
int genphy_c45_read_link(struct phy_device *phydev);
int genphy_c45_read_lpa(struct phy_device *phydev);
--
2.20.1
^ permalink raw reply related
* [PATCH net-next 4/4] net: phy: marvell10g: use genphy_c45_check_and_restart_aneg in mv3310_config_aneg
From: Heiner Kallweit @ 2019-02-18 20:27 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
In-Reply-To: <35d86611-9a07-7239-3310-767d8d1050b5@gmail.com>
Use new function genphy_c45_check_and_restart_aneg() to reduce
boilerplate code.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/marvell10g.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 67066127b..8cbf35964 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -291,20 +291,7 @@ static int mv3310_config_aneg(struct phy_device *phydev)
if (ret > 0)
changed = true;
- if (!changed) {
- /* Configure and restart aneg if it wasn't set before */
- ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1);
- if (ret < 0)
- return ret;
-
- if (!(ret & MDIO_AN_CTRL1_ENABLE))
- changed = 1;
- }
-
- if (changed)
- ret = genphy_c45_restart_aneg(phydev);
-
- return ret;
+ return genphy_c45_check_and_restart_aneg(phydev, changed);
}
static int mv3310_aneg_done(struct phy_device *phydev)
--
2.20.1
^ permalink raw reply related
* Re: [PATCH 3/3] dt-bindings: can: rcar_canfd: Document r8a774a1 support
From: Rob Herring @ 2019-02-18 20:33 UTC (permalink / raw)
To: Fabrizio Castro
Cc: Wolfgang Grandegger, Marc Kleine-Budde, Fabrizio Castro,
David S. Miller, Simon Horman, Magnus Damm, Geert Uytterhoeven,
Chris Paterson, Biju Das, linux-can, netdev, devicetree,
linux-renesas-soc, linux-clk
In-Reply-To: <1547736856-16539-4-git-send-email-fabrizio.castro@bp.renesas.com>
On Thu, 17 Jan 2019 14:54:16 +0000, Fabrizio Castro wrote:
> Document support for rcar_canfd on R8A774A1 SoC devices.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Reviewed-by: Chris Paterson <Chris.Paterson2@renesas.com>
> ---
> This patch depends on:
> https://patchwork.kernel.org/patch/10766781/
>
> Documentation/devicetree/bindings/net/can/rcar_canfd.txt | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* [PATCH net-next] net: phy: improve definition of __ETHTOOL_LINK_MODE_MASK_NBITS
From: Heiner Kallweit @ 2019-02-18 20:43 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev@vger.kernel.org
The way to define __ETHTOOL_LINK_MODE_MASK_NBITS seems to be overly
complicated, go with a standard approach instead.
Whilst we're at it, move the comment to the right place.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
include/linux/ethtool.h | 4 ----
include/uapi/linux/ethtool.h | 17 +++++++++--------
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 19a8de532..e6ebc9761 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -98,10 +98,6 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
return index % n_rx_rings;
}
-/* number of link mode bits/ulongs handled internally by kernel */
-#define __ETHTOOL_LINK_MODE_MASK_NBITS \
- (__ETHTOOL_LINK_MODE_LAST + 1)
-
/* declare a link mode bitmap */
#define __ETHTOOL_DECLARE_LINK_MODE_MASK(name) \
DECLARE_BITMAP(name, __ETHTOOL_LINK_MODE_MASK_NBITS)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 17be76aeb..17128eed3 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1432,6 +1432,13 @@ enum ethtool_link_mode_bit_indices {
ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,
ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,
ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,
+
+ /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
+ * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
+ * macro for bits > 31. The only way to use indices > 31 is to
+ * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.
+ */
+
ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,
ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33,
ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34,
@@ -1454,14 +1461,8 @@ enum ethtool_link_mode_bit_indices {
ETHTOOL_LINK_MODE_FEC_RS_BIT = 50,
ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51,
- /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
- * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
- * macro for bits > 31. The only way to use indices > 31 is to
- * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.
- */
-
- __ETHTOOL_LINK_MODE_LAST
- = ETHTOOL_LINK_MODE_FEC_BASER_BIT,
+ /* must be last entry */
+ __ETHTOOL_LINK_MODE_MASK_NBITS
};
#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) \
--
2.20.1
^ permalink raw reply related
* Re: [PATCH net-next 09/12] net: sched: flower: handle concurrent tcf proto deletion
From: Cong Wang @ 2019-02-18 20:47 UTC (permalink / raw)
To: Vlad Buslov
Cc: Linux Kernel Network Developers, Jamal Hadi Salim, Jiri Pirko,
David Miller
In-Reply-To: <20190214074712.17846-10-vladbu@mellanox.com>
On Wed, Feb 13, 2019 at 11:47 PM Vlad Buslov <vladbu@mellanox.com> wrote:
>
> Without rtnl lock protection tcf proto can be deleted concurrently. Check
> tcf proto 'deleting' flag after taking tcf spinlock to verify that no
> concurrent deletion is in progress. Return EAGAIN error if concurrent
> deletion detected, which will cause caller to retry and possibly create new
> instance of tcf proto.
>
Please state the reason why you prefer retry over locking the whole
tp without retrying, that is why and how it is better?
Personally I always prefer non-retry logic, because it is very easy
to understand and justify its correctness.
As you prefer otherwise, please share your reasoning in changelog.
Thanks!
^ permalink raw reply
* Re: [PATCH net-next 2/2] net: phy: don't use 10BaseT/half as default in genphy_read_status
From: Florian Fainelli @ 2019-02-18 21:08 UTC (permalink / raw)
To: Heiner Kallweit, Andrew Lunn, David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <f56cc2be-6a75-94be-598a-9478c462c092@gmail.com>
On 2/18/2019 11:29 AM, Heiner Kallweit wrote:
> If link partner and we can't agree on any mode, then it doesn't make
> sense to pretend we would have agreed on 10/half. Therefore set a
> proper default.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply
* Re: [PATCH 3/8] dt-bindings: net: bluetooth: Add rtl8723bs-bluetooth
From: Rob Herring @ 2019-02-18 21:10 UTC (permalink / raw)
To: Vasily Khoruzhick
Cc: David S. Miller, Mark Rutland, Maxime Ripard, Chen-Yu Tsai,
Marcel Holtmann, Johan Hedberg, netdev, devicetree,
linux-arm-kernel, linux-bluetooth
In-Reply-To: <20190118170232.16142-4-anarsoul@gmail.com>
On Fri, Jan 18, 2019 at 09:02:27AM -0800, Vasily Khoruzhick wrote:
> Add binding document for bluetooth part of RTL8723BS/RTL8723CS
>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
> .../bindings/net/rtl8723bs-bluetooth.txt | 35 +++++++++++++++++++
> 1 file changed, 35 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
>
> diff --git a/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> new file mode 100644
> index 000000000000..8357f242ae4c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> @@ -0,0 +1,35 @@
> +RTL8723BS/RTL8723CS Bluetooth
> +---------------------
> +
> +RTL8723CS/RTL8723CS is WiFi + BT chip. WiFi part is connected over SDIO, while
> +BT is connected over serial. It speaks H5 protocol with few extra commands
> +to upload firmware and change module speed.
> +
> +Required properties:
> +
> + - compatible: should be one of the following:
> + * "realtek,rtl8723bs-bt"
> + * "realtek,rtl8723cs-bt"
> +Optional properties:
> +
> + - device-wake-gpios: GPIO specifier, used to wakeup the BT module (active high)
> + - enable-gpios: GPIO specifier, used to enable the BT module (active high)
> + - host-wake-gpios: GPIO specifier, used to wakeup the host processor (active high)
> + - firmware-postfix: firmware postfix to be used for firmware config
How is this used?
Rob
^ permalink raw reply
* Re: [PATCH][unix] missing barriers in some of unix_sock ->addr and ->path accesses
From: Sasha Levin @ 2019-02-18 21:14 UTC (permalink / raw)
To: Sasha Levin, Al Viro, netdev; +Cc: David Miller, stable, stable
In-Reply-To: <20190215200934.GM2217@ZenIV.linux.org.uk>
Hi,
[This is an automated email]
This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: .+
The bot has tested the following trees: v4.20.10, v4.19.23, v4.14.101, v4.9.158, v4.4.174, v3.18.134.
v4.20.10: Build OK!
v4.19.23: Build OK!
v4.14.101: Failed to apply! Possible dependencies:
27204aaa9dc6 ("tcp: uniform the set up of sockets after successful connection")
3830d0771ef6 ("soc: qcom: Introduce QMI helpers")
64ac5f5977df ("tipc: refactor function filter_rcv()")
75da2163dbb6 ("tipc: introduce communication groups")
9b2c45d479d0 ("net: make getname() functions return length rather than use int* parameter")
9b8a11e82615 ("soc: qcom: Introduce QMI encoder/decoder")
a3f8683bf7d5 ("->poll() methods should return __poll_t")
a50ff19d0658 ("of/platform: Generalize /reserved-memory handling")
a80ae5306a73 ("tipc: improve destination linked list")
ade994f4f6c8 ("net: annotate ->poll() instances")
d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
v4.9.158: Failed to apply! Possible dependencies:
13d3b1ebe287 ("bpf: Support for setting initial receive window")
27204aaa9dc6 ("tcp: uniform the set up of sockets after successful connection")
3007098494be ("cgroup: add support for eBPF programs")
3830d0771ef6 ("soc: qcom: Introduce QMI helpers")
40304b2a1567 ("bpf: BPF support for sock_ops")
526735ddc0ae ("net: fix AF_SMC related typo")
610236587600 ("bpf: Add new cgroup attach type to enable sock modifications")
8550f328f45d ("bpf: Support for per connection SYN/SYN-ACK RTOs")
8c9814b97002 ("net: convert unix_address.refcnt from atomic_t to refcount_t")
9872a4bde31b ("bpf: Add TCP connection BPF callbacks")
9b2c45d479d0 ("net: make getname() functions return length rather than use int* parameter")
9b8a11e82615 ("soc: qcom: Introduce QMI encoder/decoder")
a3f8683bf7d5 ("->poll() methods should return __poll_t")
a50ff19d0658 ("of/platform: Generalize /reserved-memory handling")
ac7138746e14 ("smc: establish new socket family")
ade994f4f6c8 ("net: annotate ->poll() instances")
b2cd12574aa3 ("bpf: Refactor cgroups code in prep for new type")
cb5da847af44 ("tipc: set kern=0 in sk_alloc() during tipc_accept()")
cdfbabfb2f0c ("net: Work around lockdep limitation in sockets that use sockets")
d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
v4.4.174: Failed to apply! Possible dependencies:
35da60941e44 ("pstore/ram: add Device Tree bindings")
3830d0771ef6 ("soc: qcom: Introduce QMI helpers")
4420cfd3f51c ("staging: lustre: format properly all comment blocks for LNet core")
44a7185c2ae6 ("of/platform: Add common method to populate default bus")
4c3523623dc0 ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs")
529182e204db ("ramoops: use DT reserved-memory bindings")
53692b1de419 ("sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC")
5fd88337d209 ("staging: lustre: fix all conditional comparison to zero in LNet layer")
8c9814b97002 ("net: convert unix_address.refcnt from atomic_t to refcount_t")
9b2c45d479d0 ("net: make getname() functions return length rather than use int* parameter")
9b8a11e82615 ("soc: qcom: Introduce QMI encoder/decoder")
a188222b6ed2 ("net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK")
a50ff19d0658 ("of/platform: Generalize /reserved-memory handling")
d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
fc520f8b4fa3 ("of/platform: disable the of_platform_default_populate_init() for all the ppc boards")
v3.18.134: Failed to apply! Possible dependencies:
35da60941e44 ("pstore/ram: add Device Tree bindings")
3830d0771ef6 ("soc: qcom: Introduce QMI helpers")
43443ad692cf ("of/platform: add function to populate default bus")
44a7185c2ae6 ("of/platform: Add common method to populate default bus")
4b638df4c9d5 ("soc: qcom: Add Shared Memory Manager driver")
529182e204db ("ramoops: use DT reserved-memory bindings")
7ce75bb2c05e ("ARM: qcom: Add Subsystem Power Manager (SPM) driver")
7d0c8beea6b8 ("soc: qcom: Reorder SMEM/SMD configs")
8c9814b97002 ("net: convert unix_address.refcnt from atomic_t to refcount_t")
936f14cf4e67 ("soc: qcom: Driver for the Qualcomm RPM over SMD")
9b2c45d479d0 ("net: make getname() functions return length rather than use int* parameter")
9b8a11e82615 ("soc: qcom: Introduce QMI encoder/decoder")
a50ff19d0658 ("of/platform: Generalize /reserved-memory handling")
d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
f2ab3298fb49 ("soc: qcom: Add Shared Memory Driver")
fc520f8b4fa3 ("of/platform: disable the of_platform_default_populate_init() for all the ppc boards")
How should we proceed with this patch?
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH 3/8] dt-bindings: net: bluetooth: Add rtl8723bs-bluetooth
From: Vasily Khoruzhick @ 2019-02-18 21:24 UTC (permalink / raw)
To: Rob Herring
Cc: David S. Miller, Mark Rutland, Maxime Ripard, Chen-Yu Tsai,
Marcel Holtmann, Johan Hedberg, netdev, devicetree, arm-linux,
linux-bluetooth
In-Reply-To: <20190218211035.GA28145@bogus>
On Mon, Feb 18, 2019 at 1:10 PM Rob Herring <robh@kernel.org> wrote:
>
> On Fri, Jan 18, 2019 at 09:02:27AM -0800, Vasily Khoruzhick wrote:
> > Add binding document for bluetooth part of RTL8723BS/RTL8723CS
> >
> > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> > ---
> > .../bindings/net/rtl8723bs-bluetooth.txt | 35 +++++++++++++++++++
> > 1 file changed, 35 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> >
> > diff --git a/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > new file mode 100644
> > index 000000000000..8357f242ae4c
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > @@ -0,0 +1,35 @@
> > +RTL8723BS/RTL8723CS Bluetooth
> > +---------------------
> > +
> > +RTL8723CS/RTL8723CS is WiFi + BT chip. WiFi part is connected over SDIO, while
> > +BT is connected over serial. It speaks H5 protocol with few extra commands
> > +to upload firmware and change module speed.
> > +
> > +Required properties:
> > +
> > + - compatible: should be one of the following:
> > + * "realtek,rtl8723bs-bt"
> > + * "realtek,rtl8723cs-bt"
> > +Optional properties:
> > +
> > + - device-wake-gpios: GPIO specifier, used to wakeup the BT module (active high)
> > + - enable-gpios: GPIO specifier, used to enable the BT module (active high)
> > + - host-wake-gpios: GPIO specifier, used to wakeup the host processor (active high)
> > + - firmware-postfix: firmware postfix to be used for firmware config
>
> How is this used?
rtl8723bs-bt needs 2 firmware binaries -- one is actual firmware,
another is firmware config which is specific to the board. If
firmware-postfix is specified, driver appends it to the name of config
and requests board-specific config while loading firmware. I.e. if
'pine64' is specified as firmware-postfix driver will load
rtl8723bs_config-pine64.bin.
> Rob
>
^ permalink raw reply
* Re: [PATCH][unix] missing barriers in some of unix_sock ->addr and ->path accesses
From: Al Viro @ 2019-02-18 21:32 UTC (permalink / raw)
To: Sasha Levin; +Cc: netdev, David Miller, stable, stable
In-Reply-To: <20190218211434.05DF121773@mail.kernel.org>
On Mon, Feb 18, 2019 at 09:14:33PM +0000, Sasha Levin wrote:
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
Ugh... Should've removed Cc; stable from netdev posting; my apologies.
> How should we proceed with this patch?
Wait for it to get into davem's tree, for starters?
Sorry about that, again...
FWIW, further adventures in net/unix land:
unix_dgram_poll() contains
/* connection hasn't started yet? */
if (sk->sk_state == TCP_SYN_SENT)
return mask;
and nothing in there sets TCP_SYN_SENT state (not that it would've made
any sense of AF_UNIX).
unix_poll() contains
/* Connection-based need to check for termination and startup */
if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) &&
sk->sk_state == TCP_CLOSE)
while it can only be called as ->poll of unix_stream_ops, which means
that sk->sk_type can't be anything other that SOCK_STREAM in there.
static void scan_children(struct sock *x, void (*func)(struct unix_sock *),
struct sk_buff_head *hitlist)
{
if (x->sk_state != TCP_LISTEN) {
scan_inflight(x, func, hitlist);
} else {
...
has no exclusion or barriers to deal with the store of TCP_LISTEN into
->sk_state inside unix_listen(). That one's potentially nasty - we won't
find SCM_RIGHTS already queued to embrios in x's queue until we notice
that x->sk_state == TCP_LISTEN, which can happen between two calls of
scan_children() in the same unix_gc() run. The race is narrow, but not
impossible, AFAICS. Reasonably easy to fix - lift locking the queue
out of scan_inflight(), grab the queue lock before checking if it's
a listener and have unix_listen() either grab the queue lock around the
assignment to ->sk_state, or pump it up and down before dropping
unix_state_lock() (at which point connect() might be able to find it, etc.)
Al, still digging through net/unix...
^ permalink raw reply
* Re: [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8()
From: Borislav Petkov @ 2019-02-18 21:49 UTC (permalink / raw)
To: Kalle Valo
Cc: Masahiro Yamada, Ingo Molnar, Thomas Gleixner, H . Peter Anvin,
x86, linux-wireless, Christoph Hellwig, David S. Miller, netdev,
linux-kernel, Lorenzo Bianconi, linux-mediatek, linux-arm-kernel,
Felix Fietkau, Matthias Brugger
In-Reply-To: <87pnrosy29.fsf@kamboji.qca.qualcomm.com>
On Mon, Feb 18, 2019 at 09:20:46PM +0200, Kalle Valo wrote:
> So Masahiro, could you hold your x86 patch for a while until the mt76
> patch will be in Linus' tree? That should not take more than two weeks,
> I think.
No hurry - I won't take it into the x86 now and queue it for 5.1 because
it is not something urgent or fixing a bug or so. It is a cleanup and as
such it can surely wait for 5.2, I'd say. Unless there are other aspects
which I'm not thinking of right now...
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply
* Re: [PATCH 3/8] dt-bindings: net: bluetooth: Add rtl8723bs-bluetooth
From: Stefan Wahren @ 2019-02-18 22:08 UTC (permalink / raw)
To: Vasily Khoruzhick, Rob Herring
Cc: Mark Rutland, devicetree, Johan Hedberg, Maxime Ripard, netdev,
Marcel Holtmann, linux-bluetooth, Chen-Yu Tsai, David S. Miller,
arm-linux, beagleboard
In-Reply-To: <CA+E=qVdq5GORg-t-vVXM3zBxy3Aq93iCE+zmcGgLFBMcnTDgfw@mail.gmail.com>
Hi Vasily,
> Vasily Khoruzhick <anarsoul@gmail.com> hat am 18. Februar 2019 um 22:24 geschrieben:
>
>
> On Mon, Feb 18, 2019 at 1:10 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Fri, Jan 18, 2019 at 09:02:27AM -0800, Vasily Khoruzhick wrote:
> > > Add binding document for bluetooth part of RTL8723BS/RTL8723CS
> > >
> > > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> > > ---
> > > .../bindings/net/rtl8723bs-bluetooth.txt | 35 +++++++++++++++++++
> > > 1 file changed, 35 insertions(+)
> > > create mode 100644 Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > >
> > > diff --git a/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > > new file mode 100644
> > > index 000000000000..8357f242ae4c
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > > @@ -0,0 +1,35 @@
> > > +RTL8723BS/RTL8723CS Bluetooth
> > > +---------------------
> > > +
> > > +RTL8723CS/RTL8723CS is WiFi + BT chip. WiFi part is connected over SDIO, while
> > > +BT is connected over serial. It speaks H5 protocol with few extra commands
> > > +to upload firmware and change module speed.
> > > +
> > > +Required properties:
> > > +
> > > + - compatible: should be one of the following:
> > > + * "realtek,rtl8723bs-bt"
> > > + * "realtek,rtl8723cs-bt"
> > > +Optional properties:
> > > +
> > > + - device-wake-gpios: GPIO specifier, used to wakeup the BT module (active high)
> > > + - enable-gpios: GPIO specifier, used to enable the BT module (active high)
> > > + - host-wake-gpios: GPIO specifier, used to wakeup the host processor (active high)
> > > + - firmware-postfix: firmware postfix to be used for firmware config
> >
sorry, i didn't noticed your great series before. David and i working at the same stuff but for the Asus Tinker Board.
I created a similiar yet untested patch version for hci_h5 [1]. Maybe it's useful.
Just a comment about the binding. It's really necessary to add the reset-gpio? Can't we use the enable-gpio with inverse polarity for this?
Stefan
^ permalink raw reply
* Re: [PATCH 3/8] dt-bindings: net: bluetooth: Add rtl8723bs-bluetooth
From: Stefan Wahren @ 2019-02-18 22:10 UTC (permalink / raw)
To: Vasily Khoruzhick, Rob Herring
Cc: Mark Rutland, devicetree, Johan Hedberg, Maxime Ripard, netdev,
Marcel Holtmann, beagleboard, linux-bluetooth, Chen-Yu Tsai,
David S. Miller, arm-linux
In-Reply-To: <1245842044.588056.1550527701604@email.ionos.de>
> Stefan Wahren <stefan.wahren@i2se.com> hat am 18. Februar 2019 um 23:08 geschrieben:
>
>
> Hi Vasily,
>
> > Vasily Khoruzhick <anarsoul@gmail.com> hat am 18. Februar 2019 um 22:24 geschrieben:
> >
> >
> > On Mon, Feb 18, 2019 at 1:10 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Fri, Jan 18, 2019 at 09:02:27AM -0800, Vasily Khoruzhick wrote:
> > > > Add binding document for bluetooth part of RTL8723BS/RTL8723CS
> > > >
> > > > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> > > > ---
> > > > .../bindings/net/rtl8723bs-bluetooth.txt | 35 +++++++++++++++++++
> > > > 1 file changed, 35 insertions(+)
> > > > create mode 100644 Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > > > new file mode 100644
> > > > index 000000000000..8357f242ae4c
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > > > @@ -0,0 +1,35 @@
> > > > +RTL8723BS/RTL8723CS Bluetooth
> > > > +---------------------
> > > > +
> > > > +RTL8723CS/RTL8723CS is WiFi + BT chip. WiFi part is connected over SDIO, while
> > > > +BT is connected over serial. It speaks H5 protocol with few extra commands
> > > > +to upload firmware and change module speed.
> > > > +
> > > > +Required properties:
> > > > +
> > > > + - compatible: should be one of the following:
> > > > + * "realtek,rtl8723bs-bt"
> > > > + * "realtek,rtl8723cs-bt"
> > > > +Optional properties:
> > > > +
> > > > + - device-wake-gpios: GPIO specifier, used to wakeup the BT module (active high)
> > > > + - enable-gpios: GPIO specifier, used to enable the BT module (active high)
> > > > + - host-wake-gpios: GPIO specifier, used to wakeup the host processor (active high)
> > > > + - firmware-postfix: firmware postfix to be used for firmware config
> > >
>
> sorry, i didn't noticed your great series before. David and i working at the same stuff but for the Asus Tinker Board.
>
> I created a similiar yet untested patch version for hci_h5 [1]. Maybe it's useful.
>
> Just a comment about the binding. It's really necessary to add the reset-gpio? Can't we use the enable-gpio with inverse polarity for this?
>
> Stefan
[1] - https://gist.github.com/lategoodbye/79bac99d4f1158a719a48ea3c45eb7f1
^ permalink raw reply
* Re: [PATCH 3/8] dt-bindings: net: bluetooth: Add rtl8723bs-bluetooth
From: Vasily Khoruzhick @ 2019-02-18 22:28 UTC (permalink / raw)
To: Stefan Wahren
Cc: Rob Herring, Mark Rutland, devicetree, Johan Hedberg,
Maxime Ripard, netdev, Marcel Holtmann, linux-bluetooth,
Chen-Yu Tsai, David S. Miller, arm-linux, beagleboard
In-Reply-To: <1245842044.588056.1550527701604@email.ionos.de>
On Mon, Feb 18, 2019 at 2:08 PM Stefan Wahren <stefan.wahren@i2se.com> wrote:
>
> Hi Vasily,
Hi Stefan,
> > Vasily Khoruzhick <anarsoul@gmail.com> hat am 18. Februar 2019 um 22:24 geschrieben:
> >
> >
> > On Mon, Feb 18, 2019 at 1:10 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Fri, Jan 18, 2019 at 09:02:27AM -0800, Vasily Khoruzhick wrote:
> > > > Add binding document for bluetooth part of RTL8723BS/RTL8723CS
> > > >
> > > > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> > > > ---
> > > > .../bindings/net/rtl8723bs-bluetooth.txt | 35 +++++++++++++++++++
> > > > 1 file changed, 35 insertions(+)
> > > > create mode 100644 Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > > > new file mode 100644
> > > > index 000000000000..8357f242ae4c
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt
> > > > @@ -0,0 +1,35 @@
> > > > +RTL8723BS/RTL8723CS Bluetooth
> > > > +---------------------
> > > > +
> > > > +RTL8723CS/RTL8723CS is WiFi + BT chip. WiFi part is connected over SDIO, while
> > > > +BT is connected over serial. It speaks H5 protocol with few extra commands
> > > > +to upload firmware and change module speed.
> > > > +
> > > > +Required properties:
> > > > +
> > > > + - compatible: should be one of the following:
> > > > + * "realtek,rtl8723bs-bt"
> > > > + * "realtek,rtl8723cs-bt"
> > > > +Optional properties:
> > > > +
> > > > + - device-wake-gpios: GPIO specifier, used to wakeup the BT module (active high)
> > > > + - enable-gpios: GPIO specifier, used to enable the BT module (active high)
> > > > + - host-wake-gpios: GPIO specifier, used to wakeup the host processor (active high)
> > > > + - firmware-postfix: firmware postfix to be used for firmware config
> > >
>
> sorry, i didn't noticed your great series before. David and i working at the same stuff but for the Asus Tinker Board.
>
> I created a similiar yet untested patch version for hci_h5 [1]. Maybe it's useful.
Looks good to me, but you may need to add firmware-postfix.
> Just a comment about the binding. It's really necessary to add the reset-gpio? Can't we use the enable-gpio with inverse polarity for this?
Yes, we can use enable-gpio instead of reset-gpio on pine64 and pinebook.
> Stefan
^ permalink raw reply
* [PATCH net v4.15..v4.19] net: dsa: Fix NPD checking for br_vlan_enabled()
From: Florian Fainelli @ 2019-02-18 22:30 UTC (permalink / raw)
To: netdev
Cc: davem, frank-w, Florian Fainelli, Andrew Lunn, Vivien Didelot,
open list
It is possible for the DSA slave network device not to be part of a
bridge, yet have an upper device like a VLAN device be part of a bridge.
When that VLAN device is enslaved, since it does not define any
switchdev_ops, we will recurse down to the lower/physical port device,
call switchdev_port_obj_add() with a VLAN, and here we will check
br_vlan_enabled() on a NULL dp->bridge_dev, thus causing a NULL pointer
de-reference.
This is no longer a problem upstream after commit d17d9f5e5143
("switchdev: Replace port obj add/del SDO with a notification").
Fixes: 2ea7a679ca2a ("net: dsa: Don't add vlans when vlan filtering is disabled")
Reported-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
David,
This affects v4.15..v4.19, but not v5.0-rc1 can you still queue this up
for -stable? Thanks!
net/dsa/port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/dsa/port.c b/net/dsa/port.c
index ed0595459df1..792a13068c50 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -255,7 +255,7 @@ int dsa_port_vlan_add(struct dsa_port *dp,
if (netif_is_bridge_master(vlan->obj.orig_dev))
return -EOPNOTSUPP;
- if (br_vlan_enabled(dp->bridge_dev))
+ if (dp->bridge_dev && br_vlan_enabled(dp->bridge_dev))
return dsa_port_notify(dp, DSA_NOTIFIER_VLAN_ADD, &info);
return 0;
@@ -273,7 +273,7 @@ int dsa_port_vlan_del(struct dsa_port *dp,
if (netif_is_bridge_master(vlan->obj.orig_dev))
return -EOPNOTSUPP;
- if (br_vlan_enabled(dp->bridge_dev))
+ if (dp->bridge_dev && br_vlan_enabled(dp->bridge_dev))
return dsa_port_notify(dp, DSA_NOTIFIER_VLAN_DEL, &info);
return 0;
--
2.19.1
^ permalink raw reply related
* [PATCH 0/2] Netfilter/IPVS fixes for net
From: Pablo Neira Ayuso @ 2019-02-18 23:08 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev
Hi David,
The following patchset contains Netfilter/IPVS fixes for net:
1) Follow up patch to fix a compilation warning in a recent IPVS fix:
098e13f5b21d ("ipvs: fix dependency on nf_defrag_ipv6").
2) Bogus ENOENT error on flush after rule deletion in the same batch,
reported by Phil Sutter.
You can pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
Thanks!
----------------------------------------------------------------
The following changes since commit f9bcc9f3ee4fbbe8f11dfec76745476f5780517e:
net: ethernet: freescale: set FEC ethtool regs version (2019-02-14 12:45:35 -0500)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git HEAD
for you to fetch changes up to c93a49b9769e435990c82297aa0baa31e1538790:
ipvs: fix warning on unused variable (2019-02-16 10:41:42 +0100)
----------------------------------------------------------------
Andrea Claudi (1):
ipvs: fix warning on unused variable
Pablo Neira Ayuso (1):
netfilter: nf_tables: fix flush after rule deletion in the same batch
net/netfilter/ipvs/ip_vs_ctl.c | 3 ++-
net/netfilter/nf_tables_api.c | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
^ permalink raw reply
* [PATCH 1/2] netfilter: nf_tables: fix flush after rule deletion in the same batch
From: Pablo Neira Ayuso @ 2019-02-18 23:08 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <20190218230823.8114-1-pablo@netfilter.org>
Flush after rule deletion bogusly hits -ENOENT. Skip rules that have
been already from nft_delrule_by_chain() which is always called from the
flush path.
Fixes: cf9dc09d0949 ("netfilter: nf_tables: fix missing rules flushing per table")
Reported-by: Phil Sutter <phil@nwl.cc>
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nf_tables_api.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 5a92f23f179f..4893f248dfdc 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -313,6 +313,9 @@ static int nft_delrule_by_chain(struct nft_ctx *ctx)
int err;
list_for_each_entry(rule, &ctx->chain->rules, list) {
+ if (!nft_is_active_next(ctx->net, rule))
+ continue;
+
err = nft_delrule(ctx, rule);
if (err < 0)
return err;
--
2.11.0
^ permalink raw reply related
* [PATCH] arm64: do_csum: implement accelerated scalar version
From: Ard Biesheuvel @ 2019-02-18 23:08 UTC (permalink / raw)
To: linux-arm-kernel
Cc: will.deacon, steve.capper, ilias.apalodimas, netdev,
Ard Biesheuvel, huanglingyan (A)
It turns out that the IP checksumming code is still exercised often,
even though one might expect that modern NICs with checksum offload
have no use for it. However, as Lingyan points out, there are
combinations of features where the network stack may still fall back
to software checksumming, and so it makes sense to provide an
optimized implementation in software as well.
So provide an implementation of do_csum() in scalar assembler, which,
unlike C, gives direct access to the carry flag, making the code run
substantially faster. The routine uses overlapping 64 byte loads for
all input size > 64 bytes, in order to reduce the number of branches
and improve performance on cores with deep pipelines.
On Cortex-A57, this implementation is on par with Lingyan's NEON
implementation, and roughly 7x as fast as the generic C code.
Cc: "huanglingyan (A)" <huanglingyan2@huawei.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
Test code after the patch.
arch/arm64/include/asm/checksum.h | 3 +
arch/arm64/lib/Makefile | 2 +-
arch/arm64/lib/csum.S | 127 ++++++++++++++++++++
3 files changed, 131 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/checksum.h b/arch/arm64/include/asm/checksum.h
index 0b6f5a7d4027..e906b956c1fc 100644
--- a/arch/arm64/include/asm/checksum.h
+++ b/arch/arm64/include/asm/checksum.h
@@ -46,6 +46,9 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
}
#define ip_fast_csum ip_fast_csum
+extern unsigned int do_csum(const unsigned char *buff, int len);
+#define do_csum do_csum
+
#include <asm-generic/checksum.h>
#endif /* __ASM_CHECKSUM_H */
diff --git a/arch/arm64/lib/Makefile b/arch/arm64/lib/Makefile
index 5540a1638baf..a7606007a749 100644
--- a/arch/arm64/lib/Makefile
+++ b/arch/arm64/lib/Makefile
@@ -3,7 +3,7 @@ lib-y := clear_user.o delay.o copy_from_user.o \
copy_to_user.o copy_in_user.o copy_page.o \
clear_page.o memchr.o memcpy.o memmove.o memset.o \
memcmp.o strcmp.o strncmp.o strlen.o strnlen.o \
- strchr.o strrchr.o tishift.o
+ strchr.o strrchr.o tishift.o csum.o
ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o
diff --git a/arch/arm64/lib/csum.S b/arch/arm64/lib/csum.S
new file mode 100644
index 000000000000..534e2ebdc426
--- /dev/null
+++ b/arch/arm64/lib/csum.S
@@ -0,0 +1,127 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Linaro, Ltd. <ard.biesheuvel@linaro.org>
+ */
+
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+
+ENTRY(do_csum)
+ adds x2, xzr, xzr // clear x2 and C flag
+
+ // 64 bytes at a time
+ lsr x3, x1, #6
+ and x1, x1, #63
+ cbz x3, 1f
+
+ // Eight 64-bit adds per iteration
+0: ldp x4, x5, [x0], #64
+ ldp x6, x7, [x0, #-48]
+ ldp x8, x9, [x0, #-32]
+ ldp x10, x11, [x0, #-16]
+ adcs x2, x2, x4
+ sub x3, x3, #1
+ adcs x2, x2, x5
+ adcs x2, x2, x6
+ adcs x2, x2, x7
+ adcs x2, x2, x8
+ adcs x2, x2, x9
+ adcs x2, x2, x10
+ adcs x2, x2, x11
+ cbnz x3, 0b
+ adc x2, x2, xzr
+
+ cbz x1, 7f
+ bic x3, x1, #1
+ add x12, x0, x1
+ add x0, x0, x3
+ neg x3, x3
+ add x3, x3, #64
+ lsl x3, x3, #3
+
+ // Handle remaining 63 bytes or less using an overlapping 64-byte load
+ // and a branchless code path to complete the calculation
+ ldp x4, x5, [x0, #-64]
+ ldp x6, x7, [x0, #-48]
+ ldp x8, x9, [x0, #-32]
+ ldp x10, x11, [x0, #-16]
+ ldrb w12, [x12, #-1]
+
+ .irp reg, x4, x5, x6, x7, x8, x9, x10, x11
+ cmp x3, #64
+ csel \reg, \reg, xzr, lt
+ ccmp x3, xzr, #0, lt
+ csel x13, x3, xzr, gt
+ sub x3, x3, #64
+CPU_LE( lsr \reg, \reg, x13 )
+CPU_BE( lsl \reg, \reg, x13 )
+ .endr
+
+ adds x2, x2, x4
+ adcs x2, x2, x5
+ adcs x2, x2, x6
+ adcs x2, x2, x7
+ adcs x2, x2, x8
+ adcs x2, x2, x9
+ adcs x2, x2, x10
+ adcs x2, x2, x11
+ adc x2, x2, xzr
+
+CPU_LE( adds x12, x2, x12 )
+CPU_BE( adds x12, x2, x12, lsl #8 )
+ adc x12, x12, xzr
+ tst x1, #1
+ csel x2, x2, x12, eq
+
+7: lsr x1, x2, #32
+ adds w2, w2, w1
+ adc w2, w2, wzr
+
+ lsr w1, w2, #16
+ uxth w2, w2
+ add w2, w2, w1
+
+ lsr w1, w2, #16 // handle the carry by hand
+ add w2, w2, w1
+
+ uxth w0, w2
+ ret
+
+ // Handle 63 bytes or less
+1: tbz x1, #5, 2f
+ ldp x4, x5, [x0], #32
+ ldp x6, x7, [x0, #-16]
+ adds x2, x2, x4
+ adcs x2, x2, x5
+ adcs x2, x2, x6
+ adcs x2, x2, x7
+ adc x2, x2, xzr
+
+2: tbz x1, #4, 3f
+ ldp x4, x5, [x0], #16
+ adds x2, x2, x4
+ adcs x2, x2, x5
+ adc x2, x2, xzr
+
+3: tbz x1, #3, 4f
+ ldr x4, [x0], #8
+ adds x2, x2, x4
+ adc x2, x2, xzr
+
+4: tbz x1, #2, 5f
+ ldr w4, [x0], #4
+ adds x2, x2, x4
+ adc x2, x2, xzr
+
+5: tbz x1, #1, 6f
+ ldrh w4, [x0], #2
+ adds x2, x2, x4
+ adc x2, x2, xzr
+
+6: tbz x1, #0, 7b
+ ldrb w4, [x0]
+CPU_LE( adds x2, x2, x4 )
+CPU_BE( adds x2, x2, x4, lsl #8 )
+ adc x2, x2, xzr
+ b 7b
+ENDPROC(do_csum)
--
2.20.1
diff --git a/lib/checksum.c b/lib/checksum.c
index d3ec93f9e5f3..7711f1186f71 100644
--- a/lib/checksum.c
+++ b/lib/checksum.c
@@ -37,7 +37,7 @@
#include <asm/byteorder.h>
-#ifndef do_csum
+#if 1 //ndef do_csum
static inline unsigned short from32to16(unsigned int x)
{
/* add up 16-bit and 16-bit for 16+c bit */
@@ -47,7 +47,7 @@ static inline unsigned short from32to16(unsigned int x)
return x;
}
-static unsigned int do_csum(const unsigned char *buff, int len)
+static unsigned int __do_csum(const unsigned char *buff, int len)
{
int odd;
unsigned int result = 0;
@@ -206,3 +206,23 @@ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
}
EXPORT_SYMBOL(csum_tcpudp_nofold);
#endif
+
+extern u8 crypto_ft_tab[];
+
+static int __init do_selftest(void)
+{
+ int i, j;
+ u16 c1, c2;
+
+ for (i = 0; i < 1024; i++) {
+ for (j = i + 1; j <= 1024; j++) {
+ c1 = __do_csum(crypto_ft_tab + i, j - i);
+ c2 = do_csum(crypto_ft_tab + i, j - i);
+
+ if (c1 != c2)
+ pr_err("######### %d %d %x %x\n", i, j, c1, c2);
+ }
+ }
+ return 0;
+}
+late_initcall(do_selftest);
^ permalink raw reply related
* [PATCH 2/2] ipvs: fix warning on unused variable
From: Pablo Neira Ayuso @ 2019-02-18 23:08 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <20190218230823.8114-1-pablo@netfilter.org>
From: Andrea Claudi <aclaudi@redhat.com>
When CONFIG_IP_VS_IPV6 is not defined, build produced this warning:
net/netfilter/ipvs/ip_vs_ctl.c:899:6: warning: unused variable ‘ret’ [-Wunused-variable]
int ret = 0;
^~~
Fix this by moving the declaration of 'ret' in the CONFIG_IP_VS_IPV6
section in the same function.
While at it, drop its unneeded initialisation.
Fixes: 098e13f5b21d ("ipvs: fix dependency on nf_defrag_ipv6")
Reported-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/ipvs/ip_vs_ctl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 86afacb07e5f..ac8d848d7624 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -896,12 +896,13 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest,
{
struct ip_vs_dest *dest;
unsigned int atype, i;
- int ret = 0;
EnterFunction(2);
#ifdef CONFIG_IP_VS_IPV6
if (udest->af == AF_INET6) {
+ int ret;
+
atype = ipv6_addr_type(&udest->addr.in6);
if ((!(atype & IPV6_ADDR_UNICAST) ||
atype & IPV6_ADDR_LINKLOCAL) &&
--
2.11.0
^ permalink raw reply related
* Re: [PATCH bpf 1/2] bpf/test_run: fix unkillable BPF_PROG_TEST_RUN
From: Daniel Borkmann @ 2019-02-18 23:23 UTC (permalink / raw)
To: Stanislav Fomichev; +Cc: Stanislav Fomichev, netdev, davem, ast, syzbot
In-Reply-To: <20190218172934.GD20651@mini-arch>
On 02/18/2019 06:29 PM, Stanislav Fomichev wrote:
> On 02/16, Daniel Borkmann wrote:
>> On 02/13/2019 12:42 AM, Stanislav Fomichev wrote:
>>> Syzbot found out that running BPF_PROG_TEST_RUN with repeat=0xffffffff
>>> makes process unkillable. The problem is that when CONFIG_PREEMPT is
>>> enabled, we never see need_resched() return true. This is due to the
>>> fact that preempt_enable() (which we do in bpf_test_run_one on each
>>> iteration) now handles resched if it's needed.
>>>
>>> Let's disable preemption for the whole run, not per test. In this case
>>> we can properly see whether resched is needed.
>>> Let's also properly return -EINTR to the userspace in case of a signal
>>> interrupt.
>>>
>>> See recent discussion:
>>> http://lore.kernel.org/netdev/CAH3MdRWHr4N8jei8jxDppXjmw-Nw=puNDLbu1dQOFQHxfU2onA@mail.gmail.com
>>>
>>> I'll follow up with the same fix bpf_prog_test_run_flow_dissector in
>>> bpf-next.
>>>
>>> Reported-by: syzbot <syzkaller@googlegroups.com>
>>> Signed-off-by: Stanislav Fomichev <sdf@google.com>
>>> ---
>>> net/bpf/test_run.c | 45 ++++++++++++++++++++++++---------------------
>>> 1 file changed, 24 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
>>> index fa2644d276ef..e31e1b20f7f4 100644
>>> --- a/net/bpf/test_run.c
>>> +++ b/net/bpf/test_run.c
>>> @@ -13,27 +13,13 @@
>>> #include <net/sock.h>
>>> #include <net/tcp.h>
>>>
>>> -static __always_inline u32 bpf_test_run_one(struct bpf_prog *prog, void *ctx,
>>> - struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE])
>>> -{
>>> - u32 ret;
>>> -
>>> - preempt_disable();
>>> - rcu_read_lock();
>>> - bpf_cgroup_storage_set(storage);
>>> - ret = BPF_PROG_RUN(prog, ctx);
>>> - rcu_read_unlock();
>>> - preempt_enable();
>>> -
>>> - return ret;
>>> -}
>>> -
>>> -static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 *ret,
>>> - u32 *time)
>>> +static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat,
>>> + u32 *retval, u32 *time)
>>> {
>>> struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 0 };
>>> enum bpf_cgroup_storage_type stype;
>>> u64 time_start, time_spent = 0;
>>> + int ret = 0;
>>> u32 i;
>>>
>>> for_each_cgroup_storage_type(stype) {
>>> @@ -48,25 +34,42 @@ static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 *ret,
>>>
>>> if (!repeat)
>>> repeat = 1;
>>> +
>>> + rcu_read_lock();
>>> + preempt_disable();
>>> time_start = ktime_get_ns();
>>> for (i = 0; i < repeat; i++) {
>>> - *ret = bpf_test_run_one(prog, ctx, storage);
>>> + bpf_cgroup_storage_set(storage);
>>> + *retval = BPF_PROG_RUN(prog, ctx);
>>> +
>>> + if (signal_pending(current)) {
>>> + ret = -EINTR;
>>> + break;
>>> + }
>>
>> Wouldn't it be enough to just move the signal_pending() test to
>> the above as you did to actually fix the unkillable issue? For
>> CONFIG_PREEMPT the below need_resched() is never triggered as you
>> mention as preempt_enable() handles rescheduling internally in
>> this situation, so moving it only out should suffice.
>>
>> The rationale for disabling preemption for the whole run is imho
>> a bit different, namely that you would not screw up the ktime
>> measurements due to rescheduling happening in between otherwise.
> That's exactly the reason why we need to preempt_disable() the whole
> run; we can't preempt on preempt_enable(), it would screw up our
> ktime estimation.
>
>> But then, once preemption is disabled for the whole run, is there
>> a need to move out the extra signal_pending() test (presumably as
>> need_resched() does not handle TIF_SIGPENDING but only TIF_NEED_RESCHED
>> but we still wouldn't get into a unkillable situation here, no)?
> I'm not sure, they look like two separate flags, it feels safer to handle
> them separately (and we have a precedent in do_check in verifier.c). While
> we do set them both when sending signal, it looks like need_resched is
> for the cases where we wake up a task with a higher priority. So, in
> theory, we can have a signal_pending without need_resched. (Also, with
> CONFIG_PREEMT=y kernel, there is another complication with
> preempt_count()).
Yeah, given there is no separation, it's better to move it out, agree.
Applied both, thanks!
>>> if (need_resched()) {
>>> - if (signal_pending(current))
>>> - break;
>>> time_spent += ktime_get_ns() - time_start;
>>> + preempt_enable();
>>> + rcu_read_unlock();
>>> +
>>> cond_resched();
>>> +
>>> + rcu_read_lock();
>>> + preempt_disable();
>>> time_start = ktime_get_ns();
>>> }
>>> }
>>> time_spent += ktime_get_ns() - time_start;
>>> + preempt_enable();
>>> + rcu_read_unlock();
>>> +
>>> do_div(time_spent, repeat);
>>> *time = time_spent > U32_MAX ? U32_MAX : (u32)time_spent;
>>>
>>> for_each_cgroup_storage_type(stype)
>>> bpf_cgroup_storage_free(storage[stype]);
>>>
>>> - return 0;
>>> + return ret;
>>> }
>>>
>>> static int bpf_test_finish(const union bpf_attr *kattr,
>>>
>>
^ permalink raw reply
* Re: [PATCH v2 3/8] net: thunderx: make CFG_DONE message to run through generic send-ack sequence
From: David Miller @ 2019-02-18 23:33 UTC (permalink / raw)
To: vlomovtsev
Cc: sgoutham, rric, linux-arm-kernel, netdev, linux-kernel, dnelson
In-Reply-To: <20190218095159.3847-4-vlomovtsev@marvell.com>
From: Vadim Lomovtsev <vlomovtsev@marvell.com>
Date: Mon, 18 Feb 2019 09:52:14 +0000
> @@ -169,6 +169,20 @@ static int nicvf_check_pf_ready(struct nicvf *nic)
> return 1;
> }
>
> +static int nicvf_send_cfg_done(struct nicvf *nic)
> +{
> + union nic_mbx mbx = {};
> +
> + mbx.msg.msg = NIC_MBOX_MSG_CFG_DONE;
> + if (nicvf_send_msg_to_pf(nic, &mbx)) {
> + netdev_err(nic->netdev,
> + "PF didn't respond to CFG DONE msg\n");
> + return 0;
> + }
> +
> + return 1;
> +}
...
> @@ -1515,8 +1528,7 @@ int nicvf_open(struct net_device *netdev)
> nicvf_enable_intr(nic, NICVF_INTR_RBDR, qidx);
>
> /* Send VF config done msg to PF */
> - mbx.msg.msg = NIC_MBOX_MSG_CFG_DONE;
> - nicvf_write_to_mbx(nic, &mbx);
> + nicvf_send_cfg_done(nic);
If the one and only call site doesn't even bother to check the return
value, just make it return void.
Thanks.
^ permalink raw reply
* Re: [RFC PATCH net-next v3 07/21] ethtool: implement EVENT notifications
From: Andrew Lunn @ 2019-02-18 23:46 UTC (permalink / raw)
To: Michal Kubecek
Cc: netdev, David Miller, Jakub Kicinski, Jiri Pirko, linux-kernel
In-Reply-To: <c75c70d7b8f5e1b9a3ef6b83c2adaac2b113db31.1550513384.git.mkubecek@suse.cz>
On Mon, Feb 18, 2019 at 07:21:59PM +0100, Michal Kubecek wrote:
> Three types of netlink notifications are introduced:
>
> - ETHA_EVENT_NEWDEV to notify about newly registered network devices
> - ETHA_EVENT_DELDEV to notify about unregistered network devices
> - ETHA_EVENT_RENAMEDEV to notify about renamed network device
>
> The notifications are triggered by NETDEV_REGISTER, NETDEV_UNREGISTER and
> NETDEV_CHANGENAME notifiers.
>
> These notifications are intended for applications and daemons monitoring
> ethtool events to allow updating the list of existing devices without
> having to open another socket for rtnetlink.
Hi Michal
Does ETHA_EVENT_RENAMEDEV actually contain enough information to avoid
needing a rtnetlink lookup? If i understand the code correctly, all
you have is the new name. You don't know the old name?
Having said that, i don't see an easy way to get access to the old
name when handling the NETDEV_CHANGENAME.
Andrew
^ permalink raw reply
* Re: Possible bug into DSA2 code.
From: Andrew Lunn @ 2019-02-19 0:03 UTC (permalink / raw)
To: Rodolfo Giometti
Cc: Florian Fainelli, Vivien Didelot, David S. Miller, netdev
In-Reply-To: <f3fc92ec-606c-fc48-6482-a3015a82c72d@enneenne.com>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 54a5b660640a..bb46ebbb2bb8 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -2399,7 +2399,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
> int i;
>
> chip->ds = ds;
> - ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip);
> + ds->slave_mii_bus = NULL;
>
> mutex_lock(&chip->reg_lock);
>
> Is that right?
Hi Rodolfo
Humm, that needs testing. There are two used combinations you need to
test:
No MDIO node in device tree, e.g.
arch/arm/boot/dts/kirkwood-dir665.dts
MDIO node in device tree, e.g:
arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
There is a third combination which will appear soon. There is only the
external mdio bus in device tree:
port@9 {
reg = <9>;
label = "eth_cu_1000_2";
phy-handle = <&phy9>;
phy-mode = "sgmii";
managed = "in-band-status";
};
};
mdio1 {
compatible = "marvell,mv88e6xxx-mdio-external";
#address-cells = <1>;
#size-cells = <0>;
phy9: phy9@0 {
compatible = "ethernet-phy-ieee802.3-c45";
pinctrl-0 = <&pinctrl_gpio_phy9>;
pinctrl-names = "default";
interrupt-parent = <&gpio2>;
interrupts = <30 IRQ_TYPE_LEVEL_LOW>;
reg = <0>;
};
};
Here port 9 uses the external MDIO bus and all the other ports
implicitly make use of the internal MDIO bus.
Andrew
^ permalink raw reply
* Re: [PATCH v2 1/2] net: phy: at803x: dont inline helpers
From: David Miller @ 2019-02-19 0:28 UTC (permalink / raw)
To: vkoul
Cc: linux-arm-msm, bjorn.andersson, netdev, niklas.cassel, andrew,
f.fainelli, nsekhar, peter.ujfalusi, marc.w.gonzalez
In-Reply-To: <20190218101853.4290-1-vkoul@kernel.org>
From: Vinod Koul <vkoul@kernel.org>
Date: Mon, 18 Feb 2019 15:48:52 +0530
> Some helpers were inlined, but makes more sense to allow compiler
> to do the right optiomazations instead, so remove inline for
> at803x_disable_rx_delay() and at803x_disable_tx_delay()
>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
Two problem with this patch series.
1) It fixes a bug in 'net' but the patches only apply cleanly to
'net-next'. Please respin this against 'net'.
2) This series lacks a header posting "[PATCH vX 0/N] " which
explains at a high level what the series is doing, how it is
doing it, and why it is doing it that way.
Thanks.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox