* [PATCH 2/6] ARM: dts: dm814x: switch to use phy-gmii-sel
From: Grygorii Strashko @ 2019-02-20 15:25 UTC (permalink / raw)
To: David S. Miller, Kishon Vijay Abraham I, Rob Herring,
Tony Lindgren
Cc: netdev, Sekhar Nori, linux-kernel, linux-omap, devicetree,
linux-arm-kernel, Grygorii Strashko
In-Reply-To: <1550676319-6440-1-git-send-email-grygorii.strashko@ti.com>
Switch to use phy-gmii-sel PHY instead of cpsw-phy-sel.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
arch/arm/boot/dts/dm814x.dtsi | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boot/dts/dm814x.dtsi b/arch/arm/boot/dts/dm814x.dtsi
index 601c57afd4fe..413ae19dd5f0 100644
--- a/arch/arm/boot/dts/dm814x.dtsi
+++ b/arch/arm/boot/dts/dm814x.dtsi
@@ -343,6 +343,12 @@
#size-cells = <1>;
ranges = <0 0 0x800>;
+ phy_gmii_sel: phy-gmii-sel {
+ compatible = "ti,dm814-phy-gmii-sel";
+ reg = <0x650 0x4>;
+ #phy-cells = <1>;
+ };
+
scm_clocks: clocks {
#address-cells = <1>;
#size-cells = <0>;
@@ -549,17 +555,14 @@
cpsw_emac0: slave@4a100200 {
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
+ phys = <&phy_gmii_sel 1>;
+
};
cpsw_emac1: slave@4a100300 {
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
- };
-
- phy_sel: cpsw-phy-sel@48140650 {
- compatible = "ti,am3352-cpsw-phy-sel";
- reg= <0x48140650 0x4>;
- reg-names = "gmii-sel";
+ phys = <&phy_gmii_sel 2>;
};
};
--
2.17.1
^ permalink raw reply related
* [PATCH 1/6] ARM: dts: dra7: switch to use phy-gmii-sel
From: Grygorii Strashko @ 2019-02-20 15:25 UTC (permalink / raw)
To: David S. Miller, Kishon Vijay Abraham I, Rob Herring,
Tony Lindgren
Cc: netdev, Sekhar Nori, linux-kernel, linux-omap, devicetree,
linux-arm-kernel, Grygorii Strashko
In-Reply-To: <1550676319-6440-1-git-send-email-grygorii.strashko@ti.com>
Switch to use phy-gmii-sel PHY instead of cpsw-phy-sel.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
arch/arm/boot/dts/dra7-l4.dtsi | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boot/dts/dra7-l4.dtsi b/arch/arm/boot/dts/dra7-l4.dtsi
index bb45cb7fc3b6..414f1cd68733 100644
--- a/arch/arm/boot/dts/dra7-l4.dtsi
+++ b/arch/arm/boot/dts/dra7-l4.dtsi
@@ -77,18 +77,18 @@
};
};
+ phy_gmii_sel: phy-gmii-sel {
+ compatible = "ti,dra7xx-phy-gmii-sel";
+ reg = <0x554 0x4>;
+ #phy-cells = <1>;
+ };
+
scm_conf_clocks: clocks {
#address-cells = <1>;
#size-cells = <0>;
};
};
- phy_sel: cpsw-phy-sel@554 {
- compatible = "ti,dra7xx-cpsw-phy-sel";
- reg= <0x554 0x4>;
- reg-names = "gmii-sel";
- };
-
dra7_pmx_core: pinmux@1400 {
compatible = "ti,dra7-padconf",
"pinctrl-single";
@@ -3099,7 +3099,6 @@
<GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>;
ranges = <0 0 0x4000>;
syscon = <&scm_conf>;
- cpsw-phy-sel = <&phy_sel>;
status = "disabled";
davinci_mdio: mdio@1000 {
@@ -3114,11 +3113,13 @@
cpsw_emac0: slave@200 {
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
+ phys = <&phy_gmii_sel 1>;
};
cpsw_emac1: slave@300 {
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
+ phys = <&phy_gmii_sel 2>;
};
};
};
--
2.17.1
^ permalink raw reply related
* [PATCH 5/6] dt-bindings: net: ti: deprecate cpsw-phy-sel bindings
From: Grygorii Strashko @ 2019-02-20 15:25 UTC (permalink / raw)
To: David S. Miller, Kishon Vijay Abraham I, Rob Herring,
Tony Lindgren
Cc: netdev, Sekhar Nori, linux-kernel, linux-omap, devicetree,
linux-arm-kernel, Grygorii Strashko
In-Reply-To: <1550676319-6440-1-git-send-email-grygorii.strashko@ti.com>
The cpsw-phy-sel driver was replaced with new PHY driver phy-gmii-sel, so
deprecate cpsw-phy-sel bindings.
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
Documentation/devicetree/bindings/net/cpsw-phy-sel.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt b/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
index 764c0c79b43d..5d76f991c027 100644
--- a/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
+++ b/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
@@ -1,4 +1,4 @@
-TI CPSW Phy mode Selection Device Tree Bindings
+TI CPSW Phy mode Selection Device Tree Bindings (DEPRECATED)
-----------------------------------------------
Required properties:
--
2.17.1
^ permalink raw reply related
* [PATCH 6/6] net: ethernet: ti: cpsw: deprecate cpsw-phy-sel driver
From: Grygorii Strashko @ 2019-02-20 15:25 UTC (permalink / raw)
To: David S. Miller, Kishon Vijay Abraham I, Rob Herring,
Tony Lindgren
Cc: netdev, Sekhar Nori, linux-kernel, linux-omap, devicetree,
linux-arm-kernel, Grygorii Strashko
In-Reply-To: <1550676319-6440-1-git-send-email-grygorii.strashko@ti.com>
Deprecate cpsw-phy-sel driver as it's been replaced with new
TI phy-gmii-sel PHY driver.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
drivers/net/ethernet/ti/Kconfig | 6 +++---
drivers/net/ethernet/ti/cpsw.h | 6 ++++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index bb126be1eb72..8b21b40a9fe5 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -49,10 +49,11 @@ config TI_DAVINCI_CPDMA
will be called davinci_cpdma. This is recommended.
config TI_CPSW_PHY_SEL
- bool
+ bool "TI CPSW Phy mode Selection (DEPRECATED)"
+ default n
---help---
This driver supports configuring of the phy mode connected to
- the CPSW.
+ the CPSW. DEPRECATED: use PHY_TI_GMII_SEL.
config TI_CPSW_ALE
tristate "TI CPSW ALE Support"
@@ -64,7 +65,6 @@ config TI_CPSW
depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
select TI_DAVINCI_CPDMA
select TI_DAVINCI_MDIO
- select TI_CPSW_PHY_SEL
select TI_CPSW_ALE
select MFD_SYSCON
select REGMAP
diff --git a/drivers/net/ethernet/ti/cpsw.h b/drivers/net/ethernet/ti/cpsw.h
index cf111db3dc27..907e05fc22e4 100644
--- a/drivers/net/ethernet/ti/cpsw.h
+++ b/drivers/net/ethernet/ti/cpsw.h
@@ -21,7 +21,13 @@
((mac)[2] << 16) | ((mac)[3] << 24))
#define mac_lo(mac) (((mac)[4] << 0) | ((mac)[5] << 8))
+#if IS_ENABLED(CONFIG_TI_CPSW_PHY_SEL)
void cpsw_phy_sel(struct device *dev, phy_interface_t phy_mode, int slave);
+#else
+static inline
+void cpsw_phy_sel(struct device *dev, phy_interface_t phy_mode, int slave)
+{}
+#endif
int ti_cm_get_macid(struct device *dev, int slave, u8 *mac_addr);
#endif /* __CPSW_H__ */
--
2.17.1
^ permalink raw reply related
* [PATCH 4/6] ARM: dts: am335x: switch to use phy-gmii-sel
From: Grygorii Strashko @ 2019-02-20 15:25 UTC (permalink / raw)
To: David S. Miller, Kishon Vijay Abraham I, Rob Herring,
Tony Lindgren
Cc: netdev, Sekhar Nori, linux-kernel, linux-omap, devicetree,
linux-arm-kernel, Grygorii Strashko
In-Reply-To: <1550676319-6440-1-git-send-email-grygorii.strashko@ti.com>
Switch to use phy-gmii-sel PHY instead of cpsw-phy-sel.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
arch/arm/boot/dts/am335x-baltos-ir2110.dts | 4 ----
arch/arm/boot/dts/am335x-baltos-ir3220.dts | 4 ----
arch/arm/boot/dts/am335x-baltos-ir5221.dts | 4 ----
arch/arm/boot/dts/am335x-chiliboard.dts | 4 ----
arch/arm/boot/dts/am335x-icev2.dts | 4 ----
arch/arm/boot/dts/am335x-igep0033.dtsi | 4 ----
arch/arm/boot/dts/am335x-lxm.dts | 4 ----
arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi | 5 -----
arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts | 5 -----
arch/arm/boot/dts/am335x-phycore-som.dtsi | 4 ----
arch/arm/boot/dts/am33xx-l4.dtsi | 15 ++++++++-------
11 files changed, 8 insertions(+), 49 deletions(-)
diff --git a/arch/arm/boot/dts/am335x-baltos-ir2110.dts b/arch/arm/boot/dts/am335x-baltos-ir2110.dts
index 75de1e723303..50dcf1290ac6 100644
--- a/arch/arm/boot/dts/am335x-baltos-ir2110.dts
+++ b/arch/arm/boot/dts/am335x-baltos-ir2110.dts
@@ -72,7 +72,3 @@
dual_emac_res_vlan = <2>;
phy-handle = <&phy1>;
};
-
-&phy_sel {
- rmii-clock-ext = <1>;
-};
diff --git a/arch/arm/boot/dts/am335x-baltos-ir3220.dts b/arch/arm/boot/dts/am335x-baltos-ir3220.dts
index 1b215c425c57..f3f1abd26470 100644
--- a/arch/arm/boot/dts/am335x-baltos-ir3220.dts
+++ b/arch/arm/boot/dts/am335x-baltos-ir3220.dts
@@ -114,7 +114,3 @@
dual_emac_res_vlan = <2>;
phy-handle = <&phy1>;
};
-
-&phy_sel {
- rmii-clock-ext = <1>;
-};
diff --git a/arch/arm/boot/dts/am335x-baltos-ir5221.dts b/arch/arm/boot/dts/am335x-baltos-ir5221.dts
index 832ead864dc5..42f473f0ed77 100644
--- a/arch/arm/boot/dts/am335x-baltos-ir5221.dts
+++ b/arch/arm/boot/dts/am335x-baltos-ir5221.dts
@@ -133,10 +133,6 @@
phy-handle = <&phy1>;
};
-&phy_sel {
- rmii-clock-ext = <1>;
-};
-
&dcan1 {
pinctrl-names = "default";
pinctrl-0 = <&dcan1_pins>;
diff --git a/arch/arm/boot/dts/am335x-chiliboard.dts b/arch/arm/boot/dts/am335x-chiliboard.dts
index 9c2a947aacf5..4a869534db50 100644
--- a/arch/arm/boot/dts/am335x-chiliboard.dts
+++ b/arch/arm/boot/dts/am335x-chiliboard.dts
@@ -151,10 +151,6 @@
phy-mode = "rmii";
};
-&phy_sel {
- rmii-clock-ext;
-};
-
/* USB */
&usb {
status = "okay";
diff --git a/arch/arm/boot/dts/am335x-icev2.dts b/arch/arm/boot/dts/am335x-icev2.dts
index f2005ecca74f..9ac775c71072 100644
--- a/arch/arm/boot/dts/am335x-icev2.dts
+++ b/arch/arm/boot/dts/am335x-icev2.dts
@@ -484,10 +484,6 @@
dual_emac;
};
-&phy_sel {
- rmii-clock-ext;
-};
-
&davinci_mdio {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
diff --git a/arch/arm/boot/dts/am335x-igep0033.dtsi b/arch/arm/boot/dts/am335x-igep0033.dtsi
index 55b4c94cfafb..cbd22f25de95 100644
--- a/arch/arm/boot/dts/am335x-igep0033.dtsi
+++ b/arch/arm/boot/dts/am335x-igep0033.dtsi
@@ -123,10 +123,6 @@
phy-mode = "rmii";
};
-&phy_sel {
- rmii-clock-ext;
-};
-
&elm {
status = "okay";
};
diff --git a/arch/arm/boot/dts/am335x-lxm.dts b/arch/arm/boot/dts/am335x-lxm.dts
index 481edcfaf121..d0e8e720a4d6 100644
--- a/arch/arm/boot/dts/am335x-lxm.dts
+++ b/arch/arm/boot/dts/am335x-lxm.dts
@@ -328,10 +328,6 @@
dual_emac_res_vlan = <3>;
};
-&phy_sel {
- rmii-clock-ext;
-};
-
&mac {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_default>;
diff --git a/arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi b/arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi
index 14f781953475..cb5913a69837 100644
--- a/arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi
+++ b/arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi
@@ -159,11 +159,6 @@
status = "okay";
};
-&phy_sel {
- reg= <0x44e10650 0xf5>;
- rmii-clock-ext;
-};
-
&sham {
status = "okay";
};
diff --git a/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts b/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts
index 5a58efc0c874..e562ce40f290 100644
--- a/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts
+++ b/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts
@@ -446,11 +446,6 @@
dual_emac_res_vlan = <2>;
};
-&phy_sel {
- reg= <0x44e10650 0xf5>;
- rmii-clock-ext;
-};
-
&sham {
status = "okay";
};
diff --git a/arch/arm/boot/dts/am335x-phycore-som.dtsi b/arch/arm/boot/dts/am335x-phycore-som.dtsi
index 428a25e952b0..015adb626b03 100644
--- a/arch/arm/boot/dts/am335x-phycore-som.dtsi
+++ b/arch/arm/boot/dts/am335x-phycore-som.dtsi
@@ -100,10 +100,6 @@
status = "okay";
};
-&phy_sel {
- rmii-clock-ext;
-};
-
/* I2C Busses */
&am33xx_pinmux {
i2c0_pins: pinmux_i2c0 {
diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi
index 7b818d9d2eab..f813131f8461 100644
--- a/arch/arm/boot/dts/am33xx-l4.dtsi
+++ b/arch/arm/boot/dts/am33xx-l4.dtsi
@@ -279,12 +279,6 @@
#pinctrl-cells = <1>;
ranges = <0 0 0x2000>;
- phy_sel: cpsw-phy-sel@650 {
- compatible = "ti,am3352-cpsw-phy-sel";
- reg= <0x650 0x4>;
- reg-names = "gmii-sel";
- };
-
am33xx_pinmux: pinmux@800 {
compatible = "pinctrl-single";
reg = <0x800 0x238>;
@@ -302,6 +296,12 @@
#size-cells = <1>;
ranges = <0 0 0x800>;
+ phy_gmii_sel: phy-gmii-sel {
+ compatible = "ti,am3352-phy-gmii-sel";
+ reg = <0x650 0x4>;
+ #phy-cells = <2>;
+ };
+
scm_clocks: clocks {
#address-cells = <1>;
#size-cells = <0>;
@@ -717,7 +717,6 @@
interrupts = <40 41 42 43>;
ranges = <0 0 0x8000>;
syscon = <&scm_conf>;
- cpsw-phy-sel = <&phy_sel>;
status = "disabled";
davinci_mdio: mdio@1000 {
@@ -733,11 +732,13 @@
cpsw_emac0: slave@200 {
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
+ phys = <&phy_gmii_sel 1 1>;
};
cpsw_emac1: slave@300 {
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
+ phys = <&phy_gmii_sel 2 1>;
};
};
};
--
2.17.1
^ permalink raw reply related
* Re: [RESEND PATCH 0/7] Add FOLL_LONGTERM to GUP fast and use it
From: Christoph Hellwig @ 2019-02-20 15:19 UTC (permalink / raw)
To: ira.weiny
Cc: John Hubbard, Andrew Morton, Michal Hocko, Kirill A. Shutemov,
Peter Zijlstra, Jason Gunthorpe, Benjamin Herrenschmidt,
Paul Mackerras, David S. Miller, Martin Schwidefsky,
Heiko Carstens, Rich Felker, Yoshinori Sato, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, Ralf Baechle, Paul Burton,
James Hogan, linux-kernel, linux-mm, linux-mips, linuxppc-dev,
linux-s390, linux-sh, sparclinux, kvm-ppc, kvm, linux-fpga,
dri-devel, linux-rdma, linux-media, linux-scsi, devel,
virtualization, netdev, linux-fbdev, xen-devel, devel, ceph-devel,
rds-devel
In-Reply-To: <20190220053040.10831-1-ira.weiny@intel.com>
On Tue, Feb 19, 2019 at 09:30:33PM -0800, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
>
> Resending these as I had only 1 minor comment which I believe we have covered
> in this series. I was anticipating these going through the mm tree as they
> depend on a cleanup patch there and the IB changes are very minor. But they
> could just as well go through the IB tree.
>
> NOTE: This series depends on my clean up patch to remove the write parameter
> from gup_fast_permitted()[1]
>
> HFI1, qib, and mthca, use get_user_pages_fast() due to it performance
> advantages. These pages can be held for a significant time. But
> get_user_pages_fast() does not protect against mapping of FS DAX pages.
This I don't get - if you do lock down long term mappings performance
of the actual get_user_pages call shouldn't matter to start with.
What do I miss?
^ permalink raw reply
* [PATCH net] ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK
From: Jan Sokolowski @ 2019-02-20 15:20 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev, Jan Sokolowski
An issue has been found while testing zero-copy XDP that
causes a reset to be triggered. As it takes some time to
turn the carrier on after setting zc, and we already
start trying to transmit some packets, watchdog considers
this as an erroneous state and triggers a reset.
Don't do any work if netif carrier is not OK.
Fixes: 8221c5eba8c13 (ixgbe: add AF_XDP zero-copy Tx support)
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
index 98870707b51a..51c29358c2a9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
@@ -617,7 +617,8 @@ static bool ixgbe_xmit_zc(struct ixgbe_ring *xdp_ring, unsigned int budget)
dma_addr_t dma;
while (budget-- > 0) {
- if (unlikely(!ixgbe_desc_unused(xdp_ring))) {
+ if (unlikely(!ixgbe_desc_unused(xdp_ring)) ||
+ !netif_carrier_ok(xdp_ring->netdev)) {
work_done = false;
break;
}
--
2.18.1
^ permalink raw reply related
* Re: [PATCH v2 net-next 2/4] net: dsa: microchip: add MIB counter reading support
From: Andrew Lunn @ 2019-02-20 15:08 UTC (permalink / raw)
To: Tristram.Ha
Cc: Sergio Paracuellos, Florian Fainelli, Pavel Machek,
UNGLinuxDriver, netdev
In-Reply-To: <1550620623-13036-3-git-send-email-Tristram.Ha@microchip.com>
> +static void mib_monitor(struct timer_list *t)
> +{
> + struct ksz_device *dev = from_timer(dev, t, mib_read_timer);
> + const struct dsa_port *dp;
> + struct net_device *netdev;
> + struct ksz_port_mib *mib;
> + struct ksz_port *p;
> + int i;
> +
> + mod_timer(&dev->mib_read_timer, jiffies + dev->mib_read_interval);
> +
> + /* Check which port needs to read MIB counters. */
> + for (i = 0; i < dev->mib_port_cnt; i++) {
> + p = &dev->ports[i];
> + if (!p->on)
> + continue;
> + dp = dsa_to_port(dev->ds, i);
> + netdev = dp->slave;
> +
> + mib = &p->mib;
> + mutex_lock(&mib->cnt_mutex);
> +
> + /* Read only dropped counters when link is not up. */
> + if (netdev && netdev->phydev && !netdev->phydev->link)
> + mib->cnt_ptr = dev->reg_mib_cnt;
> + mutex_unlock(&mib->cnt_mutex);
> + p->read = true;
> + }
> + schedule_work(&dev->mib_read);
> +}
Hi Tristram
This is much easier to understand. Thanks for making the change.
However, i suspect Florian was suggesting you use
netif_carrier_ok(netdev), not poke around inside the phydev structure.
Andrew
^ permalink raw reply
* Re: [PATCH] phonet: fix building with clang
From: Rémi Denis-Courmont @ 2019-02-20 14:57 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Remi Denis-Courmont, David S. Miller, Nathan Chancellor, netdev,
linux-kernel
In-Reply-To: <20190219215359.391543-1-arnd@arndb.de>
Le tiistaina 19. helmikuuta 2019, 23.53.50 EET Arnd Bergmann a écrit :
> clang warns about overflowing the data[] member in the struct pnpipehdr:
>
> net/phonet/pep.c:295:8: warning: array index 4 is past the end of the array
> (which contains 1 element) [-Warray-bounds] if (hdr->data[4] ==
> PEP_IND_READY)
> ^ ~
> include/net/phonet/pep.h:66:3: note: array 'data' declared here
> u8 data[1];
>
> Using a flexible array member at the end of the struct avoids the
> warning, but since we cannot have a flexible array member inside
> of the union, each index now has to be moved back by one, which
> makes it a little uglier.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Rémi Denis-Courmont <remi@remlab.net>
> ---
> include/net/phonet/pep.h | 5 +++--
> net/phonet/pep.c | 32 ++++++++++++++++----------------
> 2 files changed, 19 insertions(+), 18 deletions(-)
>
> diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
> index b669fe6dbc3b..98f31c7ea23d 100644
> --- a/include/net/phonet/pep.h
> +++ b/include/net/phonet/pep.h
> @@ -63,10 +63,11 @@ struct pnpipehdr {
> u8 state_after_reset; /* reset request */
> u8 error_code; /* any response */
> u8 pep_type; /* status indication */
> - u8 data[1];
> + u8 data0; /* anything else */
> };
> + u8 data[];
> };
> -#define other_pep_type data[1]
> +#define other_pep_type data[0]
>
> static inline struct pnpipehdr *pnp_hdr(struct sk_buff *skb)
> {
> diff --git a/net/phonet/pep.c b/net/phonet/pep.c
> index 9fc76b19cd3c..db3473540303 100644
> --- a/net/phonet/pep.c
> +++ b/net/phonet/pep.c
> @@ -132,7 +132,7 @@ static int pep_indicate(struct sock *sk, u8 id, u8 code,
> ph->utid = 0;
> ph->message_id = id;
> ph->pipe_handle = pn->pipe_handle;
> - ph->data[0] = code;
> + ph->error_code = code;
> return pn_skb_send(sk, skb, NULL);
> }
>
> @@ -153,7 +153,7 @@ static int pipe_handler_request(struct sock *sk, u8 id,
> u8 code, ph->utid = id; /* whatever */
> ph->message_id = id;
> ph->pipe_handle = pn->pipe_handle;
> - ph->data[0] = code;
> + ph->error_code = code;
> return pn_skb_send(sk, skb, NULL);
> }
>
> @@ -208,7 +208,7 @@ static int pep_ctrlreq_error(struct sock *sk, struct
> sk_buff *oskb, u8 code, struct pnpipehdr *ph;
> struct sockaddr_pn dst;
> u8 data[4] = {
> - oph->data[0], /* PEP type */
> + oph->pep_type, /* PEP type */
> code, /* error code, at an unusual offset */
> PAD, PAD,
> };
> @@ -221,7 +221,7 @@ static int pep_ctrlreq_error(struct sock *sk, struct
> sk_buff *oskb, u8 code, ph->utid = oph->utid;
> ph->message_id = PNS_PEP_CTRL_RESP;
> ph->pipe_handle = oph->pipe_handle;
> - ph->data[0] = oph->data[1]; /* CTRL id */
> + ph->data0 = oph->data[0]; /* CTRL id */
>
> pn_skb_get_src_sockaddr(oskb, &dst);
> return pn_skb_send(sk, skb, &dst);
> @@ -272,17 +272,17 @@ static int pipe_rcv_status(struct sock *sk, struct
> sk_buff *skb) return -EINVAL;
>
> hdr = pnp_hdr(skb);
> - if (hdr->data[0] != PN_PEP_TYPE_COMMON) {
> + if (hdr->pep_type != PN_PEP_TYPE_COMMON) {
> net_dbg_ratelimited("Phonet unknown PEP type: %u\n",
> - (unsigned int)hdr->data[0]);
> + (unsigned int)hdr->pep_type);
> return -EOPNOTSUPP;
> }
>
> - switch (hdr->data[1]) {
> + switch (hdr->data[0]) {
> case PN_PEP_IND_FLOW_CONTROL:
> switch (pn->tx_fc) {
> case PN_LEGACY_FLOW_CONTROL:
> - switch (hdr->data[4]) {
> + switch (hdr->data[3]) {
> case PEP_IND_BUSY:
> atomic_set(&pn->tx_credits, 0);
> break;
> @@ -292,7 +292,7 @@ static int pipe_rcv_status(struct sock *sk, struct
> sk_buff *skb) }
> break;
> case PN_ONE_CREDIT_FLOW_CONTROL:
> - if (hdr->data[4] == PEP_IND_READY)
> + if (hdr->data[3] == PEP_IND_READY)
> atomic_set(&pn->tx_credits, wake = 1);
> break;
> }
> @@ -301,12 +301,12 @@ static int pipe_rcv_status(struct sock *sk, struct
> sk_buff *skb) case PN_PEP_IND_ID_MCFC_GRANT_CREDITS:
> if (pn->tx_fc != PN_MULTI_CREDIT_FLOW_CONTROL)
> break;
> - atomic_add(wake = hdr->data[4], &pn->tx_credits);
> + atomic_add(wake = hdr->data[3], &pn->tx_credits);
> break;
>
> default:
> net_dbg_ratelimited("Phonet unknown PEP indication: %u\n",
> - (unsigned int)hdr->data[1]);
> + (unsigned int)hdr->data[0]);
> return -EOPNOTSUPP;
> }
> if (wake)
> @@ -318,7 +318,7 @@ static int pipe_rcv_created(struct sock *sk, struct
> sk_buff *skb) {
> struct pep_sock *pn = pep_sk(sk);
> struct pnpipehdr *hdr = pnp_hdr(skb);
> - u8 n_sb = hdr->data[0];
> + u8 n_sb = hdr->data0;
>
> pn->rx_fc = pn->tx_fc = PN_LEGACY_FLOW_CONTROL;
> __skb_pull(skb, sizeof(*hdr));
> @@ -506,7 +506,7 @@ static int pep_connresp_rcv(struct sock *sk, struct
> sk_buff *skb) return -ECONNREFUSED;
>
> /* Parse sub-blocks */
> - n_sb = hdr->data[4];
> + n_sb = hdr->data[3];
> while (n_sb > 0) {
> u8 type, buf[6], len = sizeof(buf);
> const u8 *data = pep_get_sb(skb, &type, &len, buf);
> @@ -739,7 +739,7 @@ static int pipe_do_remove(struct sock *sk)
> ph->utid = 0;
> ph->message_id = PNS_PIPE_REMOVE_REQ;
> ph->pipe_handle = pn->pipe_handle;
> - ph->data[0] = PAD;
> + ph->data0 = PAD;
> return pn_skb_send(sk, skb, NULL);
> }
>
> @@ -817,7 +817,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int
> flags, int *errp, peer_type = hdr->other_pep_type << 8;
>
> /* Parse sub-blocks (options) */
> - n_sb = hdr->data[4];
> + n_sb = hdr->data[3];
> while (n_sb > 0) {
> u8 type, buf[1], len = sizeof(buf);
> const u8 *data = pep_get_sb(skb, &type, &len, buf);
> @@ -1109,7 +1109,7 @@ static int pipe_skb_send(struct sock *sk, struct
> sk_buff *skb) ph->utid = 0;
> if (pn->aligned) {
> ph->message_id = PNS_PIPE_ALIGNED_DATA;
> - ph->data[0] = 0; /* padding */
> + ph->data0 = 0; /* padding */
> } else
> ph->message_id = PNS_PIPE_DATA;
> ph->pipe_handle = pn->pipe_handle;
--
レミ・デニ-クールモン
http://www.remlab.net/
^ permalink raw reply
* Re: Possible bug into DSA2 code.
From: Andrew Lunn @ 2019-02-20 15:02 UTC (permalink / raw)
To: Rodolfo Giometti
Cc: Florian Fainelli, Vivien Didelot, David S. Miller, netdev
In-Reply-To: <a2f6fa7e-49c3-cb3f-43eb-8ab248b0bb63@enneenne.com>
On Wed, Feb 20, 2019 at 08:54:01AM +0100, Rodolfo Giometti wrote:
> On 19/02/2019 01:03, Andrew Lunn wrote:
> >>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
>
> I'm sorry but I haven't such boards... :'(
Hi Rodolfo
I know. But you should be able to modify the device tree of the boards
you are using to follow these patterns, and test them.
>
> >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.
>
> Mmm... maybe should code into drivers/net/dsa/mv88e6xxx use private data to
> hold used mdio busses instead of ds->slave_mii_bus pointer?
I suspend that might break some of these different use cases.
Either there needs to be a well argued analysis, or some testing of
these setups.
Andrew
^ permalink raw reply
* [RFC] net: dsa: qca8k: CPU port broken with commit 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status")
From: Michal Vokáč @ 2019-02-20 15:02 UTC (permalink / raw)
To: Andrew Lunn, Vinod Koul, Heiner Kallweit
Cc: David S. Miller, Florian Fainelli, netdev
Hi,
Another issue in a row with networking on imx6dl-yapp4 platform [1]
that uses QCA8334 Ethernet switch.
Very recently, with Vinod and Andrew, we solved an issue with
RGMII_ID mode by patch[2][3]. I tested those with next-20190215
and it worked just fine.
The patch[2] was merged into next-20190220 so I tested the latest version.
Now the cpu port does not work again. I tracked it down to this commit
5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in
genphy_read_status") [4]
If I revert the offending commit, cpu port works fine. I suspect the
problem is on the qca8k driver side but I am not really sure.
AFAICT autonegotiation is not available on the QCA833x cpu port (MAC0).
Any ideas what may be the root cause of the problem?
Thank you,
Michal
[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=87489ec3a77f3e01bcf0d46e353ae7112ec8c4f0
[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a968b5e9d5879f9535d6099505f9e14abcafb623
[3] https://lore.kernel.org/patchwork/patch/1043817/
[4] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5502b218e001
^ permalink raw reply
* RE: [RFC v1 15/19] RDMA/irdma: Add miscellaneous utility definitions
From: Saleem, Shiraz @ 2019-02-20 14:53 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: dledford@redhat.com, davem@davemloft.net,
linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
Ismail, Mustafa, Kirsher, Jeffrey T
In-Reply-To: <20190215174714.GE30706@ziepe.ca>
>Subject: Re: [RFC v1 15/19] RDMA/irdma: Add miscellaneous utility definitions
>
>On Fri, Feb 15, 2019 at 11:11:02AM -0600, Shiraz Saleem wrote:
>> From: Mustafa Ismail <mustafa.ismail@intel.com>
>>
>> Add miscellaneous utility functions and headers.
>>
[....]
>
>> +#define to_device(ptr) \
>> + (&((struct pci_dev *)((ptr)->hw->dev_context))->dev)
>
>?? Seems like this wants to be container_of??
Yes.
>
>> +/**
>> + * irdma_insert_wqe_hdr - write wqe header
>> + * @wqe: cqp wqe for header
>> + * @header: header for the cqp wqe
>> + */
>> +static inline void irdma_insert_wqe_hdr(__le64 *wqe, u64 hdr) {
>> + wmb(); /* make sure WQE is populated before polarity is set */
>> + set_64bit_val(wqe, 24, hdr);
>
>Generally don't like seeing wmbs in drivers.. Are you sure this isn't supposed to
>be smp_store_release(), or dma_wmb() perhaps?
Why is wmb() an issue in drivers?
>
>> +/**
>> + * irdma_inetaddr_event - system notifier for ipv4 addr events
>> + * @notfier: not used
>> + * @event: event for notifier
>> + * @ptr: if address
>> + */
>> +int irdma_inetaddr_event(struct notifier_block *notifier,
>> + unsigned long event,
>> + void *ptr)
>> +{
>> + struct in_ifaddr *ifa = ptr;
>> + struct net_device *event_netdev = ifa->ifa_dev->dev;
>> + struct net_device *netdev;
>> + struct net_device *upper_dev;
>> + struct irdma_device *iwdev;
>> + u32 local_ipaddr;
>> +
>> + iwdev = irdma_find_netdev(event_netdev);
>
>This is all being changed too (and is probably wrongly locked here)
OK. We ll adapt it based on your new series. Thanks!
[...]
>
>> +/**
>> + * irdma_add_devusecount - add dev refcount
>> + * @iwdev: dev for refcount
>> + */
>> +void irdma_add_devusecount(struct irdma_device *iwdev) {
>> + atomic64_inc(&iwdev->use_count);
>> +}
>> +
>> +/**
>> + * irdma_rem_devusecount - decrement refcount for dev
>> + * @iwdev: device
>> + */
>> +void irdma_rem_devusecount(struct irdma_device *iwdev) {
>> + if (!atomic64_dec_and_test(&iwdev->use_count))
>> + return;
>> + wake_up(&iwdev->close_wq);
>> +}
>> +
>> +/**
>> + * irdma_add_pdusecount - add pd refcount
>> + * @iwpd: pd for refcount
>> + */
>> +void irdma_add_pdusecount(struct irdma_pd *iwpd) {
>> + atomic_inc(&iwpd->usecount);
>> +}
>
>Why do we have these wrappers? Don't like wrappers liket his.
>
>Are you sure this should be an atomic, not a kref, refcount, etc?
>
>Very concerning to refcounting of HW object structures like this.. Most often when
>I see this in IB drivers it comes along with concurrency bugs in the destroy path.
The need for it is being re-visited and will likely go away.
>
>> +/**
>> + * irdma_allocate_dma_mem - Memory alloc helper fn
>> + * @hw: pointer to the HW structure
>> + * @mem: ptr to mem struct to fill out
>> + * @size: size of memory requested
>> + * @alignment: what to align the allocation to */ enum
>> +irdma_status_code irdma_allocate_dma_mem(struct irdma_hw *hw,
>> + struct irdma_dma_mem *mem,
>> + u64 size,
>> + u32 alignment)
>> +{
>> + struct pci_dev *pcidev = (struct pci_dev *)hw->dev_context;
>> +
>> + if (!mem)
>> + return IRDMA_ERR_PARAM;
>> +
>> + mem->size = ALIGN(size, alignment);
>> + mem->va = dma_alloc_coherent(&pcidev->dev, mem->size,
>> + (dma_addr_t *)&mem->pa, GFP_KERNEL);
>> + if (!mem->va)
>> + return IRDMA_ERR_NO_MEMORY;
>> +
>> + return 0;
>> +}
>
>More wrappers? Why?
I agree on your previous comment on wrapper for usecnt tracking but this does
consolidate some common code and avoid duplication.
Shiraz
^ permalink raw reply
* RE: [RFC v1 12/19] RDMA/irdma: Implement device supported verb APIs
From: Saleem, Shiraz @ 2019-02-20 14:52 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: dledford@redhat.com, davem@davemloft.net,
linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
Ismail, Mustafa, Kirsher, Jeffrey T
In-Reply-To: <20190215173539.GD30706@ziepe.ca>
>Subject: Re: [RFC v1 12/19] RDMA/irdma: Implement device supported verb APIs
>
>On Fri, Feb 15, 2019 at 11:10:59AM -0600, Shiraz Saleem wrote:
>
>> +static int irdma_alloc_pd(struct ib_pd *pd,
>> + struct ib_ucontext *context,
>> + struct ib_udata *udata)
>> +{
>> + struct irdma_pd *iwpd = to_iwpd(pd);
>> + struct irdma_device *iwdev = to_iwdev(pd->device);
>> + struct irdma_sc_dev *dev = &iwdev->rf->sc_dev;
>> + struct irdma_pci_f *rf = iwdev->rf;
>> + struct irdma_alloc_pd_resp uresp = {};
>> + struct irdma_sc_pd *sc_pd;
>> + struct irdma_ucontext *ucontext;
>> + u32 pd_id = 0;
>> + int err;
>> +
>> + if (iwdev->closing)
>> + return -ENODEV;
>
>No crazy unlocked 'closing' flags. The core code takes care of everything a driver
>needs to worry about if you use it properly.
OK. We are revisiting the use of this flag and need for internal refcnts
maintained on objects like the one you pointed out in other patch
(irdma_add_pdusecount). It will likely be dropped.
>
>> +/**
>> + * irdma_create_cq - create cq
>> + * @ibdev: device pointer from stack
>> + * @attr: attributes for cq
>> + * @context: user context created during alloc
>> + * @udata: user data
>> + */
>> +static struct ib_cq *irdma_create_cq(struct ib_device *ibdev,
>> + const struct ib_cq_init_attr *attr,
>> + struct ib_ucontext *context,
>> + struct ib_udata *udata)
>> +{
>> + struct irdma_device *iwdev = to_iwdev(ibdev);
>> + struct irdma_pci_f *rf = iwdev->rf;
>> + struct irdma_cq *iwcq;
>> + struct irdma_pbl *iwpbl;
>> + u32 cq_num = 0;
>> + struct irdma_sc_cq *cq;
>> + struct irdma_sc_dev *dev = &rf->sc_dev;
>> + struct irdma_cq_init_info info = {};
>> + enum irdma_status_code status;
>> + struct irdma_cqp_request *cqp_request;
>> + struct cqp_cmds_info *cqp_info;
>> + struct irdma_cq_uk_init_info *ukinfo = &info.cq_uk_init_info;
>> + unsigned long flags;
>> + int err_code;
>> + int entries = attr->cqe;
>> +
>> + if (iwdev->closing)
>> + return ERR_PTR(-ENODEV);
>> +
>> + if (entries > rf->max_cqe)
>> + return ERR_PTR(-EINVAL);
>> +
>> + iwcq = kzalloc(sizeof(*iwcq), GFP_KERNEL);
>> + if (!iwcq)
>> + return ERR_PTR(-ENOMEM);
>> +
>> + err_code = irdma_alloc_rsrc(rf, rf->allocated_cqs,
>> + rf->max_cq, &cq_num,
>> + &rf->next_cq);
>> + if (err_code)
>> + goto error;
>> +
>> + cq = &iwcq->sc_cq;
>> + cq->back_cq = (void *)iwcq;
>> + spin_lock_init(&iwcq->lock);
>> + info.dev = dev;
>> + ukinfo->cq_size = max(entries, 4);
>> + ukinfo->cq_id = cq_num;
>> + iwcq->ibcq.cqe = info.cq_uk_init_info.cq_size;
>> + if (attr->comp_vector < rf->ceqs_count)
>> + info.ceq_id = attr->comp_vector;
>> + info.ceq_id_valid = true;
>> + info.ceqe_mask = 1;
>> + info.type = IRDMA_CQ_TYPE_IWARP;
>> + info.vsi = &iwdev->vsi;
>> +
>> + if (context) {
>
>Drivers should rarely write 'if context'. The test for userspaceness is 'if (udata)' -
>and in this case context is guarenteed. Lots of places with this wrong..
>
>Also this will need to be rebased as this all changed.
Will fix.
>
>> + return (struct ib_cq *)iwcq;
>
>And don't write casts like that, &iwcq->ib_qp or something.
>
>Find and fix them all please.
OK.
>
>> +/**
>> + * irdma_set_page - populate pbl list for fmr
>> + * @ibmr: ib mem to access iwarp mr pointer
>> + * @addr: page dma address fro pbl list */ static int
>> +irdma_set_page(struct ib_mr *ibmr,
>> + u64 addr)
>
>Can you please read through this giant driver and hit various places with wonky
>formatting with clang-format? We don't need to start out a new driver with bonkers
>indentation.
Will run clang-format. This should have been on on one line and not split.
>> +
>> +static const struct ib_device_ops irdma_roce_dev_ops = {
>> + .get_link_layer = irdma_get_link_layer,
>> + .query_ah = irdma_query_ah,
>> + .attach_mcast = irdma_attach_mcast,
>> + .detach_mcast = irdma_detach_mcast,
>> + .query_gid = irdma_query_gid_roce,
>> + .modify_qp = irdma_modify_qp_roce,
>> +};
>> +
>> +static const struct ib_device_ops irdma_iw_dev_ops = {
>> + .query_gid = irdma_query_gid,
>> + .modify_qp = irdma_modify_qp,
>> +};
>> +
>> +static const struct ib_device_ops irdma_dev_ops = {
>> + .get_port_immutable = irdma_port_immutable,
>> + .get_netdev = irdma_get_netdev,
>> + .query_port = irdma_query_port,
>> + .modify_port = irdma_modify_port,
>> + .query_pkey = irdma_query_pkey,
>> + .alloc_ucontext = irdma_alloc_ucontext,
>> + .dealloc_ucontext = irdma_dealloc_ucontext,
>> + .mmap = irdma_mmap,
>> + .alloc_pd = irdma_alloc_pd,
>> + .dealloc_pd = irdma_dealloc_pd,
>> + .create_qp = irdma_create_qp,
>> + .query_qp = irdma_query_qp,
>> + .destroy_qp = irdma_destroy_qp,
>> + .create_cq = irdma_create_cq,
>> + .destroy_cq = irdma_destroy_cq,
>> + .get_dma_mr = irdma_get_dma_mr,
>> + .reg_user_mr = irdma_reg_user_mr,
>> + .dereg_mr = irdma_dereg_mr,
>> + .alloc_mw = irdma_alloc_mw,
>> + .dealloc_mw = irdma_dealloc_mw,
>> + .alloc_hw_stats = irdma_alloc_hw_stats,
>> + .get_hw_stats = irdma_get_hw_stats,
>> + .query_device = irdma_query_device,
>> + .create_ah = irdma_create_ah,
>> + .destroy_ah = irdma_destroy_ah,
>> + .drain_sq = irdma_drain_sq,
>> + .drain_rq = irdma_drain_rq,
>> + .alloc_mr = irdma_alloc_mr,
>> + .map_mr_sg = irdma_map_mr_sg,
>> + .get_dev_fw_str = irdma_get_dev_fw_str,
>> + .poll_cq = irdma_poll_cq,
>> + .req_notify_cq = irdma_req_notify_cq,
>> + .post_send = irdma_post_send,
>> + .post_recv = irdma_post_recv,
>> + .disassociate_ucontext = irdma_disassociate_ucontext,
>> + INIT_RDMA_OBJ_SIZE(ib_pd, irdma_pd, ibpd), };
>
>All lists of things should be sorted. I saw many examples of unsorted lists.
>
OK. We weren't aware of this rule in kernel drivers. Is this subsystem specific?
>> +/**
>> + * irdma_init_roce_device - initialization of iwarp rdma device
>> + * @iwibdev: irdma ib device
>> + */
>> +static int irdma_init_iw_device(struct irdma_ib_device *iwibdev) {
>> + struct net_device *netdev = iwibdev->iwdev->netdev;
>> +
>> + iwibdev->ibdev.node_type = RDMA_NODE_RNIC;
>> + ether_addr_copy((u8 *)&iwibdev->ibdev.node_guid, netdev->dev_addr);
>> + iwibdev->ibdev.iwcm = kzalloc(sizeof(*iwibdev->ibdev.iwcm),
>GFP_KERNEL);
>> + if (!iwibdev->ibdev.iwcm)
>> + return -ENOMEM;
>> +
>> + iwibdev->ibdev.iwcm->add_ref = irdma_add_ref;
>> + iwibdev->ibdev.iwcm->rem_ref = irdma_rem_ref;
>> + iwibdev->ibdev.iwcm->get_qp = irdma_get_qp;
>> + iwibdev->ibdev.iwcm->connect = irdma_connect;
>> + iwibdev->ibdev.iwcm->accept = irdma_accept;
>> + iwibdev->ibdev.iwcm->reject = irdma_reject;
>> + iwibdev->ibdev.iwcm->create_listen = irdma_create_listen;
>> + iwibdev->ibdev.iwcm->destroy_listen = irdma_destroy_listen;
>
>Huh. These should probably be moved into the ops structure too.
Not sure. It looks cleaner this way. These are iWARP CM specific. Why allocate them for all devices?
Shiraz
^ permalink raw reply
* RE: [RFC v1 17/19] RDMA/irdma: Add ABI definitions
From: Saleem, Shiraz @ 2019-02-20 14:52 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: dledford@redhat.com, davem@davemloft.net,
linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
Ismail, Mustafa, Kirsher, Jeffrey T
In-Reply-To: <20190215171638.GA30706@ziepe.ca>
>Subject: Re: [RFC v1 17/19] RDMA/irdma: Add ABI definitions
>
>On Fri, Feb 15, 2019 at 11:11:04AM -0600, Shiraz Saleem wrote:
>> From: Mustafa Ismail <mustafa.ismail@intel.com>
>>
>> Add ABI definitions for irdma.
[....]
>>
>> +
>> +#include <linux/types.h>
>> +
>> +#define IRDMA_ABI_VER 6
>
>Starting with high numbers?
It's a bump on the current i40iw ABI ver. of 5 since we
want to be compatible and support current rdma-core's libi40iw
for Gen1 (X722) device.
>
>> +enum irdma_memreg_type {
>> + IW_MEMREG_TYPE_MEM = 0,
>> + IW_MEMREG_TYPE_QP = 1,
>> + IW_MEMREG_TYPE_CQ = 2,
>> + IW_MEMREG_TYPE_RSVD = 3,
>> + IW_MEMREG_TYPE_MW = 4,
>> +};
>> +
>> +struct irdma_alloc_ucontext_req {
>> + __u32 rsvd32;
>> + __u8 userspace_ver;
>> + __u8 rsvd8[3];
>> +};
>> +
>> +struct irdma_alloc_ucontext_resp {
>> + __u8 kernel_ver;
>> + __u8 rsvd[7];
>> + struct irdma_hw_attrs hw_attrs;
>
>This won't even compile like this - don't forget you have to send the rdma-core
>PR along with the kernel patches. You should already be running the travis
>checks yourself. rdma-core should detect malformed user space headers..
Yes. We will be sending the rdma-core patches soon.
Maybe we are missing something here, but this did compile with libirdma
in rdma-core-v22, but we havent run travis checks yet.
>
>> +struct irdma_mem_reg_req {
>> + __u16 reg_type; /* Memory, QP or CQ */
>> + __u16 cq_pages;
>> + __u16 rq_pages;
>> + __u16 sq_pages;
>> +};
>
>New structs should be aligned to 8 bytes.
>
>> +struct i40iw_create_qp_resp {
>> + __u32 qp_id;
>> + __u32 actual_sq_size;
>> + __u32 actual_rq_size;
>> + __u32 i40iw_drv_opt;
>> + __u16 push_idx;
>> + __u8 lsmm;
>> + __u8 rsvd2;
>> +};
>
>ditto
This is not aligned to 8 bytes. But the previous one is ok right?
>
>> +struct irdma_create_ah_resp {
>> + __u32 ah_id;
>> + __u32 rsvd[4];
>
>typo? __u8?
>
Yes. Thanks!
^ permalink raw reply
* Re: [PATCH] net: dsa: add missing of_node_put
From: Andrew Lunn @ 2019-02-20 14:46 UTC (permalink / raw)
To: Himadri Pandya
Cc: outreachy-kernel, julia.lawall, f.fainelli, davem, netdev,
linux-kernel
In-Reply-To: <20190220032432.2878-1-himadri18.07@gmail.com>
On Wed, Feb 20, 2019 at 08:54:32AM +0530, Himadri Pandya wrote:
> Decrement the reference count on port while returning out of the loop.
>
> Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Hi Himadri
Thanks for the patch. The code changes themselves look good.
Netdev has a few additional processes for submitting patches. Please
take a look at
https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt
Please base this patch on net-next.
Thanks
Andrew
^ permalink raw reply
* [PATCH iproute2] ss: fix compilation under glibc < 2.18
From: Thomas De Schampheleire @ 2019-02-20 14:41 UTC (permalink / raw)
To: netdev; +Cc: Thomas De Schampheleire
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Commit c759116a0b2b6da8df9687b0a40ac69050132c77 introduced support for
AF_VSOCK. This define is only provided since glibc version 2.18, so
compilation fails when using older toolchains.
Provide the necessary definitions if needed.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
misc/ss.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/misc/ss.c b/misc/ss.c
index 9e821faf..766fdc5f 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -51,6 +51,14 @@
#include <linux/tipc_netlink.h>
#include <linux/tipc_sockets_diag.h>
+/* AF_VSOCK/PF_VSOCK is only provided since glibc 2.18 */
+#ifndef PF_VSOCK
+#define PF_VSOCK 40
+#endif
+#ifndef AF_VSOCK
+#define AF_VSOCK PF_VSOCK
+#endif
+
#define MAGIC_SEQ 123456
#define BUF_CHUNK (1024 * 1024)
#define LEN_ALIGN(x) (((x) + 1) & ~1)
--
2.19.2
^ permalink raw reply related
* bug report: iwlwifi: mvm: support mac80211 TXQs model
From: Colin Ian King @ 2019-02-20 14:40 UTC (permalink / raw)
To: Sara Sharon, Johannes Berg, Emmanuel Grumbach, Luca Coelho,
Intel Linux Wireless, Sara Sharon, linux-wireless@vger.kernel.org,
netdev
Cc: Kalle Valo, David S. Miller, linux-kernel@vger.kernel.org
Hi,
Static analysis by CoverityScan has detected an uninitialized variable
error in drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
Variable used_hw_queues in iwl_mvm_mac_ctxt_init() is no longer being
assigned an initial value, causing garbage to be found when calling
find_first_zero_bit() on used_hw_queues.
CoverityScan reports this as follows:
363 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
CID 1477001 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value used_hw_queues when
calling find_first_zero_bit.
364 u8 queue = find_first_zero_bit(&used_hw_queues,
queue_limit);
365
This issue was caused by the following commit:
cfbc6c4c5b91c7725ef14465b98ac347d31f2334 ("iwlwifi: mvm: support
mac80211 TXQs model")
..when the used_hw_queues initialization was removed:
@@ -360,8 +300,6 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm,
struct ieee80211_vif *vif)
mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL,
iwl_mvm_mac_iface_iterator, &data);
- used_hw_queues = iwl_mvm_get_used_hw_queues(mvm, vif);
-
/*
* In the case we're getting here during resume, it's similar to
* firmware restart, and with RESUME_ALL the iterator will find
I'm not 100% sure if the right thing to do is just to now initialize
used_hw_queues to zero; it's not entirely clear what the initial value
should be now.
Colin
^ permalink raw reply
* general protection fault in xfrmi_decode_session
From: syzbot @ 2019-02-20 14:36 UTC (permalink / raw)
To: davem, herbert, linux-kernel, netdev, steffen.klassert,
syzkaller-bugs
Hello,
syzbot found the following crash on:
HEAD commit: abf446c90405 Add linux-next specific files for 20190220
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=175c2248c00000
kernel config: https://syzkaller.appspot.com/x/.config?x=463cb576ac40e350
dashboard link: https://syzkaller.appspot.com/bug?extid=b69368fd933c6c592f4c
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14dfb248c00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=133bd26cc00000
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+b69368fd933c6c592f4c@syzkaller.appspotmail.com
8021q: adding VLAN 0 to HW filter on device batadv0
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 7683 Comm: syz-executor240 Not tainted 5.0.0-rc7-next-20190220
#39
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:xs_net include/net/xfrm.h:253 [inline]
RIP: 0010:xfrmi_decode_session net/xfrm/xfrm_interface.c:82 [inline]
RIP: 0010:xfrmi_decode_session+0x15c/0x6c0 net/xfrm/xfrm_interface.c:73
Code: 7c fc 08 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 2e 05 00 00 48 b8 00
00 00 00 00 fc ff df 4f 8b 64 fc 08 4c 89 e2 48 c1 ea 03 <80> 3c 02 00 0f
85 01 05 00 00 4d 8b 3c 24 e8 91 62 55 fb e8 cc b7
RSP: 0018:ffff88808870f128 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff888096313e00 RCX: ffffffff860899d3
RDX: 0000000000000000 RSI: ffffffff86089a10 RDI: ffff8880a0ef4f08
RBP: ffff88808870f150 R08: ffff88808fc2a300 R09: ffffed1015d05bc8
R10: ffffed1015d05bc7 R11: ffff8880ae82de3b R12: 0000000000000000
R13: 0000000000000036 R14: ffff888096313e10 R15: ffffffffffffffff
FS: 0000000001129880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000002000a000 CR3: 0000000092970000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__xfrm_policy_check+0x1f8/0x2730 net/xfrm/xfrm_policy.c:3316
__xfrm_policy_check2 include/net/xfrm.h:1176 [inline]
xfrm_policy_check include/net/xfrm.h:1181 [inline]
xfrm4_policy_check include/net/xfrm.h:1186 [inline]
vti_input+0x4e3/0x7b0 net/ipv4/ip_vti.c:63
vti_rcv+0x10b/0x140 net/ipv4/ip_vti.c:109
xfrm4_esp_rcv+0xd8/0x230 net/ipv4/xfrm4_protocol.c:100
ip_protocol_deliver_rcu+0x60/0x8e0 net/ipv4/ip_input.c:208
ip_local_deliver_finish+0x23b/0x390 net/ipv4/ip_input.c:234
NF_HOOK include/linux/netfilter.h:289 [inline]
NF_HOOK include/linux/netfilter.h:283 [inline]
ip_local_deliver+0x1e9/0x520 net/ipv4/ip_input.c:255
dst_input include/net/dst.h:450 [inline]
ip_rcv_finish+0x1db/0x2f0 net/ipv4/ip_input.c:414
NF_HOOK include/linux/netfilter.h:289 [inline]
NF_HOOK include/linux/netfilter.h:283 [inline]
ip_rcv+0xe8/0x3f0 net/ipv4/ip_input.c:524
__netif_receive_skb_one_core+0x115/0x1a0 net/core/dev.c:4973
__netif_receive_skb+0x2c/0x1c0 net/core/dev.c:5083
netif_receive_skb_internal+0x117/0x660 net/core/dev.c:5186
napi_frags_finish net/core/dev.c:5753 [inline]
napi_gro_frags+0xade/0xd10 net/core/dev.c:5827
tun_get_user+0x28ae/0x3b20 drivers/net/tun.c:1974
tun_chr_write_iter+0xbd/0x160 drivers/net/tun.c:2019
call_write_iter include/linux/fs.h:1857 [inline]
do_iter_readv_writev+0x5e1/0x8e0 fs/read_write.c:680
do_iter_write fs/read_write.c:956 [inline]
do_iter_write+0x184/0x610 fs/read_write.c:937
vfs_writev+0x1b3/0x2f0 fs/read_write.c:1001
do_writev+0xf6/0x290 fs/read_write.c:1036
__do_sys_writev fs/read_write.c:1109 [inline]
__se_sys_writev fs/read_write.c:1106 [inline]
__x64_sys_writev+0x75/0xb0 fs/read_write.c:1106
do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x441e50
Code: 05 48 3d 01 f0 ff ff 0f 83 3d 0f fc ff c3 66 2e 0f 1f 84 00 00 00 00
00 66 90 83 3d c1 91 29 00 00 75 14 b8 14 00 00 00 0f 05 <48> 3d 01 f0 ff
ff 0f 83 14 0f fc ff c3 48 83 ec 08 e8 7a 2b 00 00
RSP: 002b:00007fff989f5108 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007fff989f5150 RCX: 0000000000441e50
RDX: 0000000000000001 RSI: 00007fff989f5150 RDI: 00000000000000f0
RBP: 00007fff989f5120 R08: 0000000000000100 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000403280 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 75b9c68f6203bc58 ]---
RIP: 0010:xs_net include/net/xfrm.h:253 [inline]
RIP: 0010:xfrmi_decode_session net/xfrm/xfrm_interface.c:82 [inline]
RIP: 0010:xfrmi_decode_session+0x15c/0x6c0 net/xfrm/xfrm_interface.c:73
Code: 7c fc 08 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 2e 05 00 00 48 b8 00
00 00 00 00 fc ff df 4f 8b 64 fc 08 4c 89 e2 48 c1 ea 03 <80> 3c 02 00 0f
85 01 05 00 00 4d 8b 3c 24 e8 91 62 55 fb e8 cc b7
RSP: 0018:ffff88808870f128 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff888096313e00 RCX: ffffffff860899d3
RDX: 0000000000000000 RSI: ffffffff86089a10 RDI: ffff8880a0ef4f08
RBP: ffff88808870f150 R08: ffff88808fc2a300 R09: ffffed1015d05bc8
R10: ffffed1015d05bc7 R11: ffff8880ae82de3b R12: 0000000000000000
R13: 0000000000000036 R14: ffff888096313e10 R15: ffffffffffffffff
FS: 0000000001129880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000002000a000 CR3: 0000000092970000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches
^ permalink raw reply
* [PATCH net] ipv6: route: purge exception on removal
From: Paolo Abeni @ 2019-02-20 14:08 UTC (permalink / raw)
To: netdev; +Cc: David Ahern, David S. Miller
When a netdevice is unregistered, we flush the relevant exception
via rt6_sync_down_dev() -> fib6_ifdown() -> fib6_del() -> fib6_del_route().
Finally, we end-up calling rt6_remove_exception(), where we release
the relevant dst, while we keep the references to the related fib6_info and
dev. Such references should be released later when the dst will be
destroyed.
There are a number of caches that can keep the exception around for an
unlimited amount of time - namely dst_cache, possibly even socket cache.
As a result device registration may hang, as demonstrated by this script:
ip netns add cl
ip netns add rt
ip netns add srv
ip netns exec rt sysctl -w net.ipv6.conf.all.forwarding=1
ip link add name cl_veth type veth peer name cl_rt_veth
ip link set dev cl_veth netns cl
ip -n cl link set dev cl_veth up
ip -n cl addr add dev cl_veth 2001::2/64
ip -n cl route add default via 2001::1
ip -n cl link add tunv6 type ip6tnl mode ip6ip6 local 2001::2 remote 2002::1 hoplimit 64 dev cl_veth
ip -n cl link set tunv6 up
ip -n cl addr add 2013::2/64 dev tunv6
ip link set dev cl_rt_veth netns rt
ip -n rt link set dev cl_rt_veth up
ip -n rt addr add dev cl_rt_veth 2001::1/64
ip link add name rt_srv_veth type veth peer name srv_veth
ip link set dev srv_veth netns srv
ip -n srv link set dev srv_veth up
ip -n srv addr add dev srv_veth 2002::1/64
ip -n srv route add default via 2002::2
ip -n srv link add tunv6 type ip6tnl mode ip6ip6 local 2002::1 remote 2001::2 hoplimit 64 dev srv_veth
ip -n srv link set tunv6 up
ip -n srv addr add 2013::1/64 dev tunv6
ip link set dev rt_srv_veth netns rt
ip -n rt link set dev rt_srv_veth up
ip -n rt addr add dev rt_srv_veth 2002::2/64
ip netns exec srv netserver & sleep 0.1
ip netns exec cl ping6 -c 4 2013::1
ip netns exec cl netperf -H 2013::1 -t TCP_STREAM -l 3 & sleep 1
ip -n rt link set dev rt_srv_veth mtu 1400
wait %2
ip -n cl link del cl_veth
This commit addresses the issue purging all the references held by the
exception at time, as we currently do for e.g. ipv6 pcpu dst entries.
Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/ipv6/route.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 964491cf3672..43a819ae46c2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1274,11 +1274,21 @@ static DEFINE_SPINLOCK(rt6_exception_lock);
static void rt6_remove_exception(struct rt6_exception_bucket *bucket,
struct rt6_exception *rt6_ex)
{
+ struct fib6_info *from;
struct net *net;
if (!bucket || !rt6_ex)
return;
+ /* purge completely the exception to allow releasing the held resources:
+ * some [sk] cache may keep the dst around for unlimited time
+ */
+ from = rcu_dereference_protected(rt6_ex->rt6i->from,
+ lockdep_is_held(&rt6_exception_lock));
+ rcu_assign_pointer(rt6_ex->rt6i->from, NULL);
+ fib6_info_release(from);
+ dst_dev_put(&rt6_ex->rt6i->dst);
+
net = dev_net(rt6_ex->rt6i->dst.dev);
hlist_del_rcu(&rt6_ex->hlist);
dst_release(&rt6_ex->rt6i->dst);
--
2.20.1
^ permalink raw reply related
* skb_can_coalesce() merges tcp frags with XFS-related slab objects
From: Vasily Averin @ 2019-02-20 13:34 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Kernel Network Developers, Ilya Dryomov
Dear David,
currently do_tcp_sendpages() calls skb_can_coalesce() to merge proper tcp fragments.
If these fragments are slab objects and the data is not transferred out of the local host
then tcp_recvmsg() can crash host on BUG_ON (see [2] below).
There is known usecase when slab objects are provided to tcp_sendpage:
XFS over locally landed network blockdevice.
I found few such cases:
- _drbd_send_page() had PageSlab() check log time ago.
- recently Ilya Dryomov fixed it in ceph
by commit 7e241f647dc7 "libceph: fall back to sendmsg for slab pages"
Recently OpenVZ team noticed this problem during experiments with
XFS over locally-landed iscsi target.
I would note: triggered BUG is not a real problem but false alert,
that though crashes host.
I can fix last problem by adding PageSlab() into iscsi_tcp_segment_map(),
however it does not fix the problem completely,
there are chances that the problem will be reproduced again with some other filesystems
or with some other kind of network blockdevice.
David, what do you think, is it probably better to add PageSlab() check
directly into skb_can_coalesce()? (see [1] below)
Thank you,
Vasily Averin
[1] The patch preventing the merge of the Slab-based tcp fragments
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 95d25b010a25..e1d200ba1fef 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3089,7 +3089,7 @@ static inline bool skb_can_coalesce(struct sk_buff *skb, int i,
if (i) {
const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
- return page == skb_frag_page(frag) &&
+ return page == skb_frag_page(frag) && !PageSlab(page) &&
off == frag->page_offset + skb_frag_size(frag);
}
return false;
[2] oops example, RHEL7-based OpenVZ node, XFS over locally-landed iscsi target
[ 4902.545219] usercopy: kernel memory exposure attempt detected from ffff8c1497c92200 (kmalloc-512) (1024 bytes)
[ 4902.550585] ------------[ cut here ]------------
[ 4902.552472] kernel BUG at mm/usercopy.c:72!
[ 4902.554148] invalid opcode: 0000 [#1] SMP
[ 4902.555906] Modules linked in: nf_conntrack_netlink xt_mark raw_diag udp_diag netlink_diag af_packet_diag unix_diag dm_service_time iscsi_tcp libiscsi_tcp libiscsi xfs xt_CHECKSUM ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ebtable_broute ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ip_tables binfmt_misc tun devlink tcp_diag inet_diag ip_set nfnetlink fuse kvm_intel ppdev kvm i2c_piix4 irqbypass sg virtio_balloon parport_pc parport joydev pcspkr libcrc32c br_netfilter veth overlay ip6_vzprivnet ip6_vznetstat
[ 4903.413397] ip_vznetstat ip_vzprivnet vziolimit vzevent vzlist vzstat vznetstat vznetdev vzmon vzdev bridge pio_kaio pio_nfs pio_direct pfmt_raw pfmt_ploop1 ploop ext4 mbcache jbd2 sd_mod crc_t10dif sr_mod crct10dif_generic cdrom crct10dif_common ata_generic pata_acpi 8021q garp mrp stp llc virtio_net virtio_console virtio_scsi bochs_drm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm ata_piix scsi_transport_iscsi drm libata crc32c_intel serio_raw virtio_pci virtio_ring dm_multipath virtio drm_panel_orientation_quirks floppy sunrpc dm_mirror dm_region_hash dm_log dm_mod [last unloaded: ip_tables]
[ 4903.433902] CPU: 0 PID: 13793 Comm: tgtd ve: 0 Kdump: loaded Not tainted 3.10.0-957.1.3.vz7.83.4 #1 83.4
[ 4903.436975] Hardware name: Virtuozzo KVM, BIOS 1.10.2-3.1.vz7.3 04/01/2014
[ 4903.439474] task: ffff8c14f898c740 ti: ffff8c14f8a94000 task.ti: ffff8c14f8a94000
[ 4903.442278] RIP: 0010:[<ffffffff9ce59427>] [<ffffffff9ce59427>] __check_object_size+0x87/0x250
[ 4903.445370] RSP: 0018:ffff8c14f8a97b58 EFLAGS: 00010246
[ 4903.447547] RAX: 0000000000000062 RBX: ffff8c1497c92200 RCX: 0000000000000000
[ 4903.450108] RDX: 0000000000000000 RSI: ffff8c167fc138d8 RDI: ffff8c167fc138d8
[ 4903.452753] RBP: ffff8c14f8a97b78 R08: 0000000000000004 R09: ffff8c166d14af00
[ 4903.455451] R10: 0000000000000080 R11: ffff97b6016ffff8 R12: 0000000000000400
[ 4903.458142] R13: 0000000000000001 R14: ffff8c1497c92600 R15: 0000000000000400
[ 4903.460759] FS: 00007fd59b2b7740(0000) GS:ffff8c167fc00000(0000) knlGS:0000000000000000
[ 4903.463776] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4903.466111] CR2: 0000000002701b58 CR3: 00000000b8a98000 CR4: 00000000000006f0
[ 4903.468860] Call Trace:
[ 4903.470483] [<ffffffff9cfb310d>] memcpy_toiovec+0x4d/0xb0
[ 4903.472780] [<ffffffff9d2589e8>] skb_copy_datagram_iovec+0x128/0x280
[ 4903.475388] [<ffffffff9d2c0646>] tcp_recvmsg+0x246/0xbb0
[ 4903.477884] [<ffffffff9cdd42cd>] ? __alloc_pages_nodemask+0x26d/0x610
[ 4903.480432] [<ffffffff9d2ef1d0>] inet_recvmsg+0x80/0xb0
[ 4903.482718] [<ffffffff9d2467bc>] sock_aio_read.part.12+0x14c/0x170
[ 4903.485255] [<ffffffff9d246801>] sock_aio_read+0x21/0x30
[ 4903.487495] [<ffffffff9ce5edd6>] do_sync_read+0x96/0xe0
[ 4903.489710] [<ffffffff9ce5f8b5>] vfs_read+0x145/0x170
[ 4903.491975] [<ffffffff9ce606cf>] SyS_read+0x7f/0xf0
[ 4903.494179] [<ffffffff9d3a4de1>] ? system_call_after_swapgs+0xae/0x146
[ 4903.496684] [<ffffffff9d3a4e9b>] system_call_fastpath+0x22/0x27
[ 4903.499143] [<ffffffff9d3a4de1>] ? system_call_after_swapgs+0xae/0x146
[ 4903.501748] Code: 45 d1 48 c7 c6 f8 c3 68 9d 48 c7 c1 93 5e 69 9d 48 0f 45 f1 49 89 c0 4d 89 e1 48 89 d9 48 c7 c7 68 2b 69 9d 31 c0 e8 4f 1e 53 00 <0f> 0b 0f 1f 80 00 00 00 00 48 c7 c0 00 00 c0 9c 4c 39 f0 73 0d
[ 4903.510508] RIP [<ffffffff9ce59427>] __check_object_size+0x87/0x250
[ 4903.513149] RSP <ffff8c14f8a97b58>
^ permalink raw reply related
* update on netdev 0x13 conference
From: Jamal Hadi Salim @ 2019-02-20 13:24 UTC (permalink / raw)
To: netdev@vger.kernel.org, linux-wireless, netfilter-devel,
netfilter, lartc
This is a small update to the community on the Netdev 0x13 conference
(March 20-22, in Prague, Czech Republic)
https://www.netdevconf.org/0x13
Early registration fees end today at 23:59 EST.
To Register: https://www.netdevconf.org/0x13/registration.html
Our bursaries are also going to close today at 23:59 EST.
Any member of the community may request for a bursary (sponsorship) to
attend.
https://www.netdevconf.org/0x13/bursaries.html
Many hours of exciting working discussions and talks.
https://www.netdevconf.org/0x13/accepted-sessions.html
https://www.netdevconf.org/0x13/schedule.html
Because the schedule is packed we will be providing lunch
this time at the conference location.
For regular updates, please subscribe to people@lists.netdevconf.org
(more info at: https://lists.netdevconf.org/cgi-bin/mailman/listinfo/people)
If twitter is your thing then follow us: @netdev01
and use hashtag #netdevconf
cheers,
jamal
^ permalink raw reply
* Re: [RFC PATCH net-next v3 13/21] ethtool: provide timestamping information in GET_INFO request
From: Michal Kubecek @ 2019-02-20 13:00 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev, David Miller, Andrew Lunn, Jiri Pirko, linux-kernel
In-Reply-To: <20190219190048.1c8a4482@cakuba.netronome.com>
On Tue, Feb 19, 2019 at 07:00:48PM -0800, Jakub Kicinski wrote:
> On Mon, 18 Feb 2019 19:22:29 +0100 (CET), Michal Kubecek wrote:
> > Add timestamping information as provided by ETHTOOL_GET_TS_INFO ioctl
> > command in GET_INFO reply if ETH_INFO_IM_TSINFO flag is set in the request.
> >
> > Add constants for counts of HWTSTAMP_TX_* and HWTSTAM_FILTER_* constants
> > and provide symbolic names for timestamping related values so that they can
> > be retrieved in GET_STRSET and GET_INFO requests.
>
> What's the reason for providing the symbolic names?
One of the the goals I had was to reduce the need to keep the lists of
possible values in sync between kernel and userspace ethtool and other
users of the interface so that when a new value is added, we don't have
to update all userspace tools to be able to use or present it.
This already works in ethtool for some newer commands (e.g. features)
and obviously for those where the list of available options depends on
the device (e.g. private flags or statistics). I would like to extend
the principle also to older commands and new ones which do not work like
this (e.g. device reset).
Michal
^ permalink raw reply
* [PATCH net-next v3 3/3] net: dsa: enable flooding for bridge ports
From: Russell King @ 2019-02-20 12:36 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Vivien Didelot
Cc: Heiner Kallweit, David S. Miller, netdev
In-Reply-To: <20190220123615.fcyrlhz5jpx5ecgv@shell.armlinux.org.uk>
Switches work by learning the MAC address for each attached station by
monitoring traffic from each station. When a station sends a packet,
the switch records which port the MAC address is connected to.
With IPv4 networking, before communication commences with a neighbour,
an ARP packet is broadcasted to all stations asking for the MAC address
corresponding with the IPv4. The desired station responds with an ARP
reply, and the ARP reply causes the switch to learn which port the
station is connected to.
With IPv6 networking, the situation is rather different. Rather than
broadcasting ARP packets, a "neighbour solicitation" is multicasted
rather than broadcasted. This multicast needs to reach the intended
station in order for the neighbour to be discovered.
Once a neighbour has been discovered, and entered into the sending
stations neighbour cache, communication can restart at a point later
without sending a new neighbour solicitation, even if the entry in
the neighbour cache is marked as stale. This can be after the MAC
address has expired from the forwarding cache of the DSA switch -
when that occurs, there is a long pause in communication.
Our DSA implementation for mv88e6xxx switches disables flooding of
multicast and unicast frames for bridged ports. As per the above
description, this is fine for IPv4 networking, since the broadcasted
ARP queries will be sent to and received by all stations on the same
network. However, this breaks IPv6 very badly - blocking neighbour
solicitations and later causing connections to stall.
The defaults that the Linux bridge code expect from bridges are for
unknown unicast and unknown multicast frames to be flooded to all ports
on the bridge, which is at odds to the defaults adopted by our DSA
implementation for mv88e6xxx switches.
This commit enables by default flooding of both unknown unicast and
unknown multicast frames whenever a port is added to a bridge, and
disables the flooding when a port leaves the bridge. This means that
mv88e6xxx DSA switches now behave as per the bridge(8) man page, and
IPv6 works flawlessly through such a switch.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
net/dsa/port.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/dsa/port.c b/net/dsa/port.c
index b84d010fb165..9e7aab13957e 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -105,6 +105,11 @@ int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br)
};
int err;
+ /* Set the flooding mode before joining */
+ err = dsa_port_bridge_flags(dp, BR_FLOOD | BR_MCAST_FLOOD, NULL);
+ if (err)
+ return err;
+
/* Here the port is already bridged. Reflect the current configuration
* so that drivers can program their chips accordingly.
*/
@@ -113,8 +118,10 @@ int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br)
err = dsa_port_notify(dp, DSA_NOTIFIER_BRIDGE_JOIN, &info);
/* The bridging is rolled back on error */
- if (err)
+ if (err) {
+ dsa_port_bridge_flags(dp, 0, NULL);
dp->bridge_dev = NULL;
+ }
return err;
}
@@ -137,6 +144,9 @@ void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br)
if (err)
pr_err("DSA: failed to notify DSA_NOTIFIER_BRIDGE_LEAVE\n");
+ /* Port is leaving the bridge, disable flooding */
+ dsa_port_bridge_flags(dp, BR_LEARNING, NULL);
+
/* Port left the bridge, put in BR_STATE_DISABLED by the bridge layer,
* so allow it to be in BR_STATE_FORWARDING to be kept functional
*/
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 1/3] net: dsa: add support for bridge flags
From: Russell King @ 2019-02-20 12:36 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Vivien Didelot
Cc: Heiner Kallweit, David S. Miller, netdev
In-Reply-To: <20190220123615.fcyrlhz5jpx5ecgv@shell.armlinux.org.uk>
The Linux bridge implementation allows various properties of the bridge
to be controlled, such as flooding unknown unicast and multicast frames.
This patch adds the necessary DSA infrastructure to allow the Linux
bridge support to control these properties for DSA switches.
We implement this by providing two new methods: one to get the switch-
wide support bitmask, and another to set the properties.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
include/net/dsa.h | 2 ++
net/dsa/dsa_priv.h | 2 ++
net/dsa/port.c | 16 ++++++++++++++++
net/dsa/slave.c | 6 ++++++
4 files changed, 26 insertions(+)
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 7f2a668ef2cc..2c2c10812814 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -400,6 +400,8 @@ struct dsa_switch_ops {
void (*port_stp_state_set)(struct dsa_switch *ds, int port,
u8 state);
void (*port_fast_age)(struct dsa_switch *ds, int port);
+ int (*port_egress_floods)(struct dsa_switch *ds, int port,
+ bool unicast, bool multicast);
/*
* VLAN support
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index 1f4972dab9f2..f4f99ec29f5d 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -160,6 +160,8 @@ int dsa_port_mdb_add(const struct dsa_port *dp,
struct switchdev_trans *trans);
int dsa_port_mdb_del(const struct dsa_port *dp,
const struct switchdev_obj_port_mdb *mdb);
+int dsa_port_bridge_flags(const struct dsa_port *dp, unsigned long flags,
+ struct switchdev_trans *trans);
int dsa_port_vlan_add(struct dsa_port *dp,
const struct switchdev_obj_port_vlan *vlan,
struct switchdev_trans *trans);
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 2d7e01b23572..b84d010fb165 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -177,6 +177,22 @@ int dsa_port_ageing_time(struct dsa_port *dp, clock_t ageing_clock,
return dsa_port_notify(dp, DSA_NOTIFIER_AGEING_TIME, &info);
}
+int dsa_port_bridge_flags(const struct dsa_port *dp, unsigned long flags,
+ struct switchdev_trans *trans)
+{
+ struct dsa_switch *ds = dp->ds;
+ int port = dp->index;
+
+ if (switchdev_trans_ph_prepare(trans))
+ return 0;
+
+ if (ds->ops->port_egress_floods)
+ ds->ops->port_egress_floods(ds, port, flags & BR_FLOOD,
+ flags & BR_MCAST_FLOOD);
+
+ return 0;
+}
+
int dsa_port_fdb_add(struct dsa_port *dp, const unsigned char *addr,
u16 vid)
{
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 2e5e7c04821b..f99161c3b1ea 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -295,6 +295,9 @@ static int dsa_slave_port_attr_set(struct net_device *dev,
case SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME:
ret = dsa_port_ageing_time(dp, attr->u.ageing_time, trans);
break;
+ case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
+ ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, trans);
+ break;
default:
ret = -EOPNOTSUPP;
break;
@@ -384,6 +387,9 @@ static int dsa_slave_port_attr_get(struct net_device *dev,
switch (attr->id) {
case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
attr->u.brport_flags_support = 0;
+ if (ds->ops->port_egress_floods)
+ attr->u.brport_flags_support |= BR_FLOOD |
+ BR_MCAST_FLOOD;
break;
default:
return -EOPNOTSUPP;
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 2/3] net: dsa: mv88e6xxx: add support for bridge flags
From: Russell King @ 2019-02-20 12:36 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Vivien Didelot
Cc: Heiner Kallweit, David S. Miller, netdev
In-Reply-To: <20190220123615.fcyrlhz5jpx5ecgv@shell.armlinux.org.uk>
Add support for the bridge flags to Marvell 88e6xxx bridges, allowing
the multicast and unicast flood properties to be controlled. These
can be controlled on a per-port basis via commands such as:
bridge link set dev lan1 flood on|off
bridge link set dev lan1 mcast_flood on|off
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/net/dsa/mv88e6xxx/chip.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 32e7af5caa69..937370639fe4 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -4692,6 +4692,24 @@ static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port,
return err;
}
+static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port,
+ bool unicast, bool multicast)
+{
+ struct mv88e6xxx_chip *chip = ds->priv;
+ int ret = -EOPNOTSUPP;
+
+ WARN_ON_ONCE(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port));
+
+ mutex_lock(&chip->reg_lock);
+ if (chip->info->ops->port_set_egress_floods)
+ ret = chip->info->ops->port_set_egress_floods(chip, port,
+ unicast,
+ multicast);
+ mutex_unlock(&chip->reg_lock);
+
+ return ret;
+}
+
static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
#if IS_ENABLED(CONFIG_NET_DSA_LEGACY)
.probe = mv88e6xxx_drv_probe,
@@ -4719,6 +4737,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
.set_ageing_time = mv88e6xxx_set_ageing_time,
.port_bridge_join = mv88e6xxx_port_bridge_join,
.port_bridge_leave = mv88e6xxx_port_bridge_leave,
+ .port_egress_floods = mv88e6xxx_port_egress_floods,
.port_stp_state_set = mv88e6xxx_port_stp_state_set,
.port_fast_age = mv88e6xxx_port_fast_age,
.port_vlan_filtering = mv88e6xxx_port_vlan_filtering,
--
2.7.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox