Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1307751 > unrolled thread

[PATCH net-next 00/10] Proposal for a API set for HW Buffer management

Started byGregory CLEMENT <gregory.clement@free-electrons.com>
First post2016-01-12 20:20 +0100
Last post2016-01-13 21:00 +0100
Articles 19 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net-next 00/10] Proposal for a API set for HW Buffer management Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
    [PATCH net-next 02/10] ARM: mvebu: enable SRAM support in mvebu_v7_defconfig Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
    [PATCH net-next 05/10] ARM: mvebu: enable buffer manager support on Armada 38x boards Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
    [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
      Re: [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework Marcin Wojtas <mw@semihalf.com> - 2016-01-12 23:50 +0100
        Re: [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-13 18:50 +0100
    [PATCH net-next 07/10] ARM: mvebu: enable buffer manager support on Armada XP boards Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
    [PATCH net-next 01/10] bus: mvebu-mbus: provide api for obtaining IO and DRAM window information Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
    [PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
      Re: [PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info Marcin Wojtas <mw@semihalf.com> - 2016-01-12 22:50 +0100
      RE: [PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for  mvebu_mbus_get_dram_win_info David Laight <David.Laight@ACULAB.COM> - 2016-01-14 15:10 +0100
    [PATCH net-next 06/10] ARM: mvebu: add buffer manager nodes to armada-xp.dtsi Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
    [PATCH net-next 09/10] net: Add a hardware buffer management helper API Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
    [PATCH net-next 04/10] ARM: mvebu: add buffer manager nodes to armada-38x.dtsi Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-12 20:20 +0100
    Re: [PATCH net-next 03/10] net: mvneta: bm: add support for hardware  buffer management Marcin Wojtas <mw@semihalf.com> - 2016-01-12 21:20 +0100
      Re: [PATCH net-next 03/10] net: mvneta: bm: add support for hardware buffer management Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-13 18:40 +0100
    Re: [PATCH net-next 00/10] Proposal for a API set for HW Buffer  management David Miller <davem@davemloft.net> - 2016-01-12 22:00 +0100
      Re: [PATCH net-next 00/10] Proposal for a API set for HW Buffer management Gregory CLEMENT <gregory.clement@free-electrons.com> - 2016-01-13 18:40 +0100
        Re: [PATCH net-next 00/10] Proposal for a API set for HW Buffer  management David Miller <davem@davemloft.net> - 2016-01-13 21:00 +0100

#1307751 — [PATCH net-next 00/10] Proposal for a API set for HW Buffer management

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 00/10] Proposal for a API set for HW Buffer management
Message-ID<qQcE1-5kS-3@gated-at.bofh.it>
Hello,

A few weeks ago Marcin proposed a patch set including the support of
the buffer management for mvneta:
http://marc.info/?l=linux-netdev&m=144817888806131&w=2

He was asked to propose helpers in order to have common code taking
core of the hardware buffer manager. As Marcin was busy on other
topics we agreed that I would take care of it. After a few weeks, here
it is a first proposal.

The set of helpers is pretty small because I encountered issues while
trying writing more optimized helpers. The current implementation
provide a hwbm_pool structure which represents a pool with very
general members to define it: such as the number of buffers and the
size of the buffers. The structure also has a private member allowing
adding driver specific data and also a constructor called during the
allocation of a buffer.

The 3 helpers are:

- hwbm_pool_refill which allocates a new buffer and adds it in the
pool. If a constructor is provided in the hwbm_pool struct then it
will call it just after the allocation. The purpose of this
constructor is to do the hardware specific job such as informing the
hardware buffer manager of the new buffer.

- hwbm_pool_add which grows the amount of buffer in a given pool.

- hwbm_buf_free which frees a buffer calling the appropriate function
(skb_free_frag or kfree) depending of the size of the buffers of the
pool.

* At the beginning I hoped to be able to use kmem_cache objects for the
buffers pool. Indeed, for a given pool the size of the buffers is
fixed and the purpose of a SLAB allocator is to create caches, which
contains a set of objects of the same size.

However, in order to free an object from a cache we need to have a
reference to this one. As freeing the buffer is done most of the time
outside the driver there is no more reference to the cache the buffer
belonged. One solution would be to look for the buffer address in each
pool to find the slab cache, but I fear that the cost would be too
high. However, I didn't try it and maybe walking through a sorting
list would be a solution.

* I also though to add call to a ndo_free_buffer function inside the
skb_free_head. This callback would be responsible of freeing the data
buffer and in under certain circumstances with the help of a hardware
buffer manager it would only put back the buffer into the pool. Thanks
to this it would remove the cost of an allocation and of a free.

But there again we need to have a reference to the pool the buffer
belonged.



I am waiting for your feedback to consolidate this "framework".

For this RFC the interesting patches are the last 2 ones: "net:
mvneta: Use the new hwbm framework" and "net: Add a hardware buffer
management helper API". The other patches of the series are here to
let people testing the series on an Armada XP or an Armada 38x based
board.

Thanks,

Gregory

Gregory CLEMENT (3):
  bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info
  net: Add a hardware buffer management helper API
  net: mvneta: Use the new hwbm framework

Marcin Wojtas (7):
  bus: mvebu-mbus: provide api for obtaining IO and DRAM window
    information
  ARM: mvebu: enable SRAM support in mvebu_v7_defconfig
  net: mvneta: bm: add support for hardware buffer management
  ARM: mvebu: add buffer manager nodes to armada-38x.dtsi
  ARM: mvebu: enable buffer manager support on Armada 38x boards
  ARM: mvebu: add buffer manager nodes to armada-xp.dtsi
  ARM: mvebu: enable buffer manager support on Armada XP boards

 .../bindings/net/marvell-armada-370-neta.txt       |  19 +-
 .../devicetree/bindings/net/marvell-neta-bm.txt    |  49 +++
 arch/arm/boot/dts/armada-385-db-ap.dts             |  20 +-
 arch/arm/boot/dts/armada-388-db.dts                |  17 +-
 arch/arm/boot/dts/armada-388-gp.dts                |  17 +-
 arch/arm/boot/dts/armada-38x.dtsi                  |  18 +
 arch/arm/boot/dts/armada-xp-db.dts                 |  19 +-
 arch/arm/boot/dts/armada-xp-gp.dts                 |  19 +-
 arch/arm/boot/dts/armada-xp.dtsi                   |  18 +
 arch/arm/configs/mvebu_v7_defconfig                |   1 +
 drivers/bus/mvebu-mbus.c                           |  51 +++
 drivers/net/ethernet/marvell/Kconfig               |  14 +
 drivers/net/ethernet/marvell/Makefile              |   1 +
 drivers/net/ethernet/marvell/mvneta.c              | 407 +++++++++++++++--
 drivers/net/ethernet/marvell/mvneta_bm.c           | 486 +++++++++++++++++++++
 drivers/net/ethernet/marvell/mvneta_bm.h           | 162 +++++++
 include/linux/mbus.h                               |   3 +
 include/net/hwbm.h                                 |  19 +
 net/core/Makefile                                  |   2 +-
 net/core/hwbm.c                                    |  78 ++++
 20 files changed, 1364 insertions(+), 56 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/marvell-neta-bm.txt
 create mode 100644 drivers/net/ethernet/marvell/mvneta_bm.c
 create mode 100644 drivers/net/ethernet/marvell/mvneta_bm.h
 create mode 100644 include/net/hwbm.h
 create mode 100644 net/core/hwbm.c

-- 
2.5.0

[toc] | [next] | [standalone]


#1307752 — [PATCH net-next 02/10] ARM: mvebu: enable SRAM support in mvebu_v7_defconfig

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 02/10] ARM: mvebu: enable SRAM support in mvebu_v7_defconfig
Message-ID<qQcE1-5kS-9@gated-at.bofh.it>
In reply to#1307751
From: Marcin Wojtas <mw@semihalf.com>

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 arch/arm/configs/mvebu_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/mvebu_v7_defconfig b/arch/arm/configs/mvebu_v7_defconfig
index c6729bf0a8dd..fe57e20ba200 100644
--- a/arch/arm/configs/mvebu_v7_defconfig
+++ b/arch/arm/configs/mvebu_v7_defconfig
@@ -58,6 +58,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_PXA3xx=y
 CONFIG_MTD_SPI_NOR=y
+CONFIG_SRAM=y
 CONFIG_EEPROM_AT24=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_ATA=y
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307753 — [PATCH net-next 05/10] ARM: mvebu: enable buffer manager support on Armada 38x boards

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 05/10] ARM: mvebu: enable buffer manager support on Armada 38x boards
Message-ID<qQcE1-5kS-5@gated-at.bofh.it>
In reply to#1307751
From: Marcin Wojtas <mw@semihalf.com>

Since mvneta driver supports using hardware buffer management (BM), in
order to use it, board files have to be adjusted accordingly. This commit
enables BM on:
* A385-DB-AP - each port has its own pool for long and common pool for
short packets,
* A388-DB - to each port unique 'short' and 'long' pools are mapped,
* A388-GP - same as above.

Moreover appropriate entry is added to 'soc' node ranges, as well as "okay"
status for 'bm' and 'bm-bppi' (internal SRAM) nodes.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 arch/arm/boot/dts/armada-385-db-ap.dts | 20 +++++++++++++++++++-
 arch/arm/boot/dts/armada-388-db.dts    | 17 ++++++++++++++++-
 arch/arm/boot/dts/armada-388-gp.dts    | 17 ++++++++++++++++-
 3 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/armada-385-db-ap.dts b/arch/arm/boot/dts/armada-385-db-ap.dts
index acd5b1519edb..5f9451be21ff 100644
--- a/arch/arm/boot/dts/armada-385-db-ap.dts
+++ b/arch/arm/boot/dts/armada-385-db-ap.dts
@@ -61,7 +61,8 @@
 		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
 			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
 			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
-			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
+			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
+			  MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
 
 		internal-regs {
 			spi1: spi@10680 {
@@ -138,12 +139,18 @@
 				status = "okay";
 				phy = <&phy2>;
 				phy-mode = "sgmii";
+				buffer-manager = <&bm>;
+				bm,pool-long = <1>;
+				bm,pool-short = <3>;
 			};
 
 			ethernet@34000 {
 				status = "okay";
 				phy = <&phy1>;
 				phy-mode = "sgmii";
+				buffer-manager = <&bm>;
+				bm,pool-long = <2>;
+				bm,pool-short = <3>;
 			};
 
 			ethernet@70000 {
@@ -157,6 +164,13 @@
 				status = "okay";
 				phy = <&phy0>;
 				phy-mode = "rgmii-id";
+				buffer-manager = <&bm>;
+				bm,pool-long = <0>;
+				bm,pool-short = <3>;
+			};
+
+			bm@c8000 {
+				status = "okay";
 			};
 
 			nfc: flash@d0000 {
@@ -178,6 +192,10 @@
 			};
 		};
 
+		bm-bppi {
+			status = "okay";
+		};
+
 		pcie-controller {
 			status = "okay";
 
diff --git a/arch/arm/boot/dts/armada-388-db.dts b/arch/arm/boot/dts/armada-388-db.dts
index ff47af57f091..ea93ed727030 100644
--- a/arch/arm/boot/dts/armada-388-db.dts
+++ b/arch/arm/boot/dts/armada-388-db.dts
@@ -66,7 +66,8 @@
 		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
 			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
 			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
-			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
+			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
+			  MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
 
 		internal-regs {
 			spi@10600 {
@@ -99,6 +100,9 @@
 				status = "okay";
 				phy = <&phy1>;
 				phy-mode = "rgmii-id";
+				buffer-manager = <&bm>;
+				bm,pool-long = <2>;
+				bm,pool-short = <3>;
 			};
 
 			usb@58000 {
@@ -109,6 +113,9 @@
 				status = "okay";
 				phy = <&phy0>;
 				phy-mode = "rgmii-id";
+				buffer-manager = <&bm>;
+				bm,pool-long = <0>;
+				bm,pool-short = <1>;
 			};
 
 			mdio@72004 {
@@ -129,6 +136,10 @@
 				status = "okay";
 			};
 
+			bm@c8000 {
+				status = "okay";
+			};
+
 			flash@d0000 {
 				status = "okay";
 				num-cs = <1>;
@@ -169,6 +180,10 @@
 			};
 		};
 
+		bm-bppi {
+			status = "okay";
+		};
+
 		pcie-controller {
 			status = "okay";
 			/*
diff --git a/arch/arm/boot/dts/armada-388-gp.dts b/arch/arm/boot/dts/armada-388-gp.dts
index a633be3defda..0a3bd7fba488 100644
--- a/arch/arm/boot/dts/armada-388-gp.dts
+++ b/arch/arm/boot/dts/armada-388-gp.dts
@@ -60,7 +60,8 @@
 		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
 			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
 			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
-			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
+			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
+			  MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
 
 		internal-regs {
 			spi@10600 {
@@ -133,6 +134,9 @@
 				status = "okay";
 				phy = <&phy1>;
 				phy-mode = "rgmii-id";
+				buffer-manager = <&bm>;
+				bm,pool-long = <2>;
+				bm,pool-short = <3>;
 			};
 
 			/* CON4 */
@@ -152,6 +156,9 @@
 				status = "okay";
 				phy = <&phy0>;
 				phy-mode = "rgmii-id";
+				buffer-manager = <&bm>;
+				bm,pool-long = <0>;
+				bm,pool-short = <1>;
 			};
 
 
@@ -186,6 +193,10 @@
 				};
 			};
 
+			bm@c8000 {
+				status = "okay";
+			};
+
 			sata@e0000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&sata2_pins>, <&sata3_pins>;
@@ -240,6 +251,10 @@
 			};
 		};
 
+		bm-bppi {
+			status = "okay";
+		};
+
 		pcie-controller {
 			status = "okay";
 			/*
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307754 — [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 10/10] net: mvneta: Use the new hwbm framework
Message-ID<qQcE1-5kS-13@gated-at.bofh.it>
In reply to#1307751
Now that the hardware buffer management framework had been introduced,
let's use it.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/net/ethernet/marvell/mvneta.c    |  44 +++++++---
 drivers/net/ethernet/marvell/mvneta_bm.c | 140 +++++++------------------------
 drivers/net/ethernet/marvell/mvneta_bm.h |  11 +--
 3 files changed, 67 insertions(+), 128 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index d82481cdbfbb..d32291c4e5aa 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -33,6 +33,7 @@
 #include <linux/phy.h>
 #include <linux/clk.h>
 #include <linux/cpu.h>
+#include <net/hwbm.h>
 #include "mvneta_bm.h"
 
 /* Registers */
@@ -1016,11 +1017,12 @@ static int mvneta_bm_port_init(struct platform_device *pdev,
 static void mvneta_bm_update_mtu(struct mvneta_port *pp, int mtu)
 {
 	struct mvneta_bm_pool *bm_pool = pp->pool_long;
+	struct hwbm_pool *hwbm_pool = &bm_pool->hwbm_pool;
 	int num;
 
 	/* Release all buffers from long pool */
 	mvneta_bm_bufs_free(pp->bm_priv, bm_pool, 1 << pp->id);
-	if (bm_pool->buf_num) {
+	if (hwbm_pool->buf_num) {
 		WARN(1, "cannot free all buffers in pool %d\n",
 		     bm_pool->id);
 		goto bm_mtu_err;
@@ -1028,14 +1030,14 @@ static void mvneta_bm_update_mtu(struct mvneta_port *pp, int mtu)
 
 	bm_pool->pkt_size = MVNETA_RX_PKT_SIZE(mtu);
 	bm_pool->buf_size = MVNETA_RX_BUF_SIZE(bm_pool->pkt_size);
-	bm_pool->frag_size = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) +
+	hwbm_pool->size = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) +
 			  SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(bm_pool->pkt_size));
 
 	/* Fill entire long pool */
-	num = mvneta_bm_bufs_add(pp->bm_priv, bm_pool, bm_pool->size);
-	if (num != bm_pool->size) {
+	num = hwbm_pool_add(hwbm_pool, hwbm_pool->size);
+	if (num != hwbm_pool->size) {
 		WARN(1, "pool %d: %d of %d allocated\n",
-		     bm_pool->id, num, bm_pool->size);
+		     bm_pool->id, num, hwbm_pool->size);
 		goto bm_mtu_err;
 	}
 	mvneta_bm_pool_bufsize_set(pp, bm_pool->buf_size, bm_pool->id);
@@ -1715,6 +1717,14 @@ static void mvneta_txq_done(struct mvneta_port *pp,
 	}
 }
 
+void *mvneta_frag_alloc(unsigned int frag_size)
+{
+	if (likely(frag_size <= PAGE_SIZE))
+		return netdev_alloc_frag(frag_size);
+	else
+		return kmalloc(frag_size, GFP_ATOMIC);
+}
+
 /* Refill processing for SW buffer management */
 static int mvneta_rx_refill(struct mvneta_port *pp,
 			    struct mvneta_rx_desc *rx_desc)
@@ -1770,6 +1780,14 @@ static u32 mvneta_skb_tx_csum(struct mvneta_port *pp, struct sk_buff *skb)
 	return MVNETA_TX_L4_CSUM_NOT;
 }
 
+void mvneta_frag_free(unsigned int frag_size, void *data)
+{
+	if (likely(frag_size <= PAGE_SIZE))
+		skb_free_frag(data);
+	else
+		kfree(data);
+}
+
 /* Drop packets received by the RXQ and free buffers */
 static void mvneta_rxq_drop_pkts(struct mvneta_port *pp,
 				 struct mvneta_rx_queue *rxq)
@@ -1880,7 +1898,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,
 		}
 
 		/* Refill processing */
-		err = bm_in_use ? mvneta_bm_pool_refill(pp->bm_priv, bm_pool) :
+		err = bm_in_use ? hwbm_pool_refill(&bm_pool->hwbm_pool) :
 				  mvneta_rx_refill(pp, rx_desc);
 		if (err) {
 			netdev_err(dev, "Linux processing - Can't refill\n");
@@ -1888,7 +1906,8 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,
 			goto err_drop_frame;
 		}
 
-		frag_size = bm_in_use ? bm_pool->frag_size : pp->frag_size;
+		frag_size = bm_in_use ? bm_pool->hwbm_pool.size :
+					pp->frag_size;
 
 		skb = build_skb(data, frag_size > PAGE_SIZE ? 0 : frag_size);
 
@@ -3946,11 +3965,6 @@ static int mvneta_probe(struct platform_device *pdev)
 	dev->priv_flags |= IFF_UNICAST_FLT;
 	dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
 
-	err = register_netdev(dev);
-	if (err < 0) {
-		dev_err(&pdev->dev, "failed to register\n");
-		goto err_free_stats;
-	}
 
 	pp->id = dev->ifindex;
 
@@ -3965,6 +3979,12 @@ static int mvneta_probe(struct platform_device *pdev)
 		}
 	}
 
+	err = register_netdev(dev);
+	if (err < 0) {
+		dev_err(&pdev->dev, "failed to register\n");
+		goto err_free_stats;
+	}
+
 	err = mvneta_init(&pdev->dev, pp);
 	if (err < 0)
 		goto err_netdev;
diff --git a/drivers/net/ethernet/marvell/mvneta_bm.c b/drivers/net/ethernet/marvell/mvneta_bm.c
index ff7e73c6d31c..66a08910b5bf 100644
--- a/drivers/net/ethernet/marvell/mvneta_bm.c
+++ b/drivers/net/ethernet/marvell/mvneta_bm.c
@@ -10,16 +10,17 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/kernel.h>
+#include <linux/clk.h>
 #include <linux/genalloc.h>
-#include <linux/platform_device.h>
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
 #include <linux/mbus.h>
 #include <linux/module.h>
-#include <linux/io.h>
+#include <linux/netdevice.h>
 #include <linux/of.h>
-#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <linux/skbuff.h>
+#include <net/hwbm.h>
 #include "mvneta_bm.h"
 
 #define MVNETA_BM_DRIVER_NAME "mvneta_bm"
@@ -88,35 +89,13 @@ static void mvneta_bm_pool_target_set(struct mvneta_bm *priv, int pool_id,
 	mvneta_bm_write(priv, MVNETA_BM_XBAR_POOL_REG(pool_id), val);
 }
 
-void *mvneta_frag_alloc(unsigned int frag_size)
-{
-	if (likely(frag_size <= PAGE_SIZE))
-		return netdev_alloc_frag(frag_size);
-	else
-		return kmalloc(frag_size, GFP_ATOMIC);
-}
-EXPORT_SYMBOL_GPL(mvneta_frag_alloc);
-
-void mvneta_frag_free(unsigned int frag_size, void *data)
+int mvneta_bm_construct(struct hwbm_pool *hwbm_pool, void *buf)
 {
-	if (likely(frag_size <= PAGE_SIZE))
-		skb_free_frag(data);
-	else
-		kfree(data);
-}
-EXPORT_SYMBOL_GPL(mvneta_frag_free);
-
-/* Allocate skb for BM pool */
-void *mvneta_buf_alloc(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool,
-		       dma_addr_t *buf_phys_addr)
-{
-	void *buf;
+	struct mvneta_bm_pool *bm_pool =
+		(struct mvneta_bm_pool *)hwbm_pool->priv;
+	struct mvneta_bm *priv = bm_pool->priv;
 	dma_addr_t phys_addr;
 
-	buf = mvneta_frag_alloc(bm_pool->frag_size);
-	if (!buf)
-		return NULL;
-
 	/* In order to update buf_cookie field of RX descriptor properly,
 	 * BM hardware expects buf virtual address to be placed in the
 	 * first four bytes of mapped buffer.
@@ -124,74 +103,13 @@ void *mvneta_buf_alloc(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool,
 	*(u32 *)buf = (u32)buf;
 	phys_addr = dma_map_single(&priv->pdev->dev, buf, bm_pool->buf_size,
 				   DMA_FROM_DEVICE);
-	if (unlikely(dma_mapping_error(&priv->pdev->dev, phys_addr))) {
-		mvneta_frag_free(bm_pool->frag_size, buf);
-		return NULL;
-	}
-	*buf_phys_addr = phys_addr;
-
-	return buf;
-}
-
-/* Refill processing for HW buffer management */
-int mvneta_bm_pool_refill(struct mvneta_bm *priv,
-			  struct mvneta_bm_pool *bm_pool)
-{
-	dma_addr_t buf_phys_addr;
-	void *buf;
-
-	buf = mvneta_buf_alloc(priv, bm_pool, &buf_phys_addr);
-	if (!buf)
+	if (unlikely(dma_mapping_error(&priv->pdev->dev, phys_addr)))
 		return -ENOMEM;
 
-	mvneta_bm_pool_put_bp(priv, bm_pool, buf_phys_addr);
-
+	mvneta_bm_pool_put_bp(priv, bm_pool, phys_addr);
 	return 0;
 }
-EXPORT_SYMBOL_GPL(mvneta_bm_pool_refill);
-
-/* Allocate buffers for the pool */
-int mvneta_bm_bufs_add(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool,
-		       int buf_num)
-{
-	int err, i;
-
-	if (bm_pool->buf_num == bm_pool->size) {
-		dev_dbg(&priv->pdev->dev, "pool %d already filled\n",
-			bm_pool->id);
-		return bm_pool->buf_num;
-	}
-
-	if (buf_num < 0 ||
-	    (buf_num + bm_pool->buf_num > bm_pool->size)) {
-		dev_err(&priv->pdev->dev,
-			"cannot allocate %d buffers for pool %d\n",
-			buf_num, bm_pool->id);
-		return 0;
-	}
-
-	for (i = 0; i < buf_num; i++) {
-		err = mvneta_bm_pool_refill(priv, bm_pool);
-		if (err < 0)
-			break;
-	}
-
-	/* Update BM driver with number of buffers added to pool */
-	bm_pool->buf_num += i;
 
-	dev_dbg(&priv->pdev->dev,
-		"%s pool %d: pkt_size=%4d, buf_size=%4d, frag_size=%4d\n",
-		bm_pool->type == MVNETA_BM_SHORT ? "short" : "long",
-		bm_pool->id, bm_pool->pkt_size, bm_pool->buf_size,
-		bm_pool->frag_size);
-
-	dev_dbg(&priv->pdev->dev,
-		"%s pool %d: %d of %d buffers added\n",
-		bm_pool->type == MVNETA_BM_SHORT ? "short" : "long",
-		bm_pool->id, i, buf_num);
-
-	return i;
-}
 
 /* Create pool */
 static int mvneta_bm_pool_create(struct mvneta_bm *priv,
@@ -200,8 +118,7 @@ static int mvneta_bm_pool_create(struct mvneta_bm *priv,
 	struct platform_device *pdev = priv->pdev;
 	u8 target_id, attr;
 	int size_bytes, err;
-
-	size_bytes = sizeof(u32) * bm_pool->size;
+	size_bytes = sizeof(u32) * bm_pool->hwbm_pool.size;
 	bm_pool->virt_addr = dma_alloc_coherent(&pdev->dev, size_bytes,
 						&bm_pool->phys_addr,
 						GFP_KERNEL);
@@ -262,11 +179,16 @@ struct mvneta_bm_pool *mvneta_bm_pool_use(struct mvneta_bm *priv, u8 pool_id,
 
 	/* Allocate buffers in case BM pool hasn't been used yet */
 	if (new_pool->type == MVNETA_BM_FREE) {
+		struct hwbm_pool *hwbm_pool = &new_pool->hwbm_pool;
+
+		new_pool->priv = priv;
 		new_pool->type = type;
 		new_pool->buf_size = MVNETA_RX_BUF_SIZE(new_pool->pkt_size);
-		new_pool->frag_size =
+		hwbm_pool->size =
 			SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(new_pool->pkt_size)) +
 			SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
+		hwbm_pool->construct = mvneta_bm_construct;
+		hwbm_pool->priv = new_pool;
 
 		/* Create new pool */
 		err = mvneta_bm_pool_create(priv, new_pool);
@@ -277,10 +199,10 @@ struct mvneta_bm_pool *mvneta_bm_pool_use(struct mvneta_bm *priv, u8 pool_id,
 		}
 
 		/* Allocate buffers for this pool */
-		num = mvneta_bm_bufs_add(priv, new_pool, new_pool->size);
-		if (num != new_pool->size) {
+		num = hwbm_pool_add(hwbm_pool, hwbm_pool->size);
+		if (num != hwbm_pool->size) {
 			WARN(1, "pool %d: %d of %d allocated\n",
-			     new_pool->id, num, new_pool->size);
+			     new_pool->id, num, hwbm_pool->size);
 			return NULL;
 		}
 	}
@@ -301,7 +223,7 @@ void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool,
 
 	mvneta_bm_config_set(priv, MVNETA_BM_EMPTY_LIMIT_MASK);
 
-	for (i = 0; i < bm_pool->buf_num; i++) {
+	for (i = 0; i < bm_pool->hwbm_pool.buf_num; i++) {
 		dma_addr_t buf_phys_addr;
 		u32 *vaddr;
 
@@ -320,19 +242,20 @@ void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool,
 
 		dma_unmap_single(&priv->pdev->dev, buf_phys_addr,
 				 bm_pool->buf_size, DMA_FROM_DEVICE);
-		mvneta_frag_free(bm_pool->frag_size, vaddr);
+		hwbm_buf_free(&bm_pool->hwbm_pool, vaddr);
 	}
 
 	mvneta_bm_config_clear(priv, MVNETA_BM_EMPTY_LIMIT_MASK);
 
 	/* Update BM driver with number of buffers removed from pool */
-	bm_pool->buf_num -= i;
+	bm_pool->hwbm_pool.buf_num -= i;
 }
 
 /* Cleanup pool */
 void mvneta_bm_pool_destroy(struct mvneta_bm *priv,
 			    struct mvneta_bm_pool *bm_pool, u8 port_map)
 {
+	struct hwbm_pool *hwbm_pool = &bm_pool->hwbm_pool;
 	bm_pool->port_map &= ~port_map;
 	if (bm_pool->port_map)
 		return;
@@ -340,11 +263,12 @@ void mvneta_bm_pool_destroy(struct mvneta_bm *priv,
 	bm_pool->type = MVNETA_BM_FREE;
 
 	mvneta_bm_bufs_free(priv, bm_pool, port_map);
-	if (bm_pool->buf_num)
+	if (hwbm_pool->buf_num)
 		WARN(1, "cannot free all buffers in pool %d\n", bm_pool->id);
 
 	if (bm_pool->virt_addr) {
-		dma_free_coherent(&priv->pdev->dev, sizeof(u32) * bm_pool->size,
+		dma_free_coherent(&priv->pdev->dev,
+				  sizeof(u32) * hwbm_pool->size,
 				  bm_pool->virt_addr, bm_pool->phys_addr);
 		bm_pool->virt_addr = NULL;
 	}
@@ -397,10 +321,10 @@ static void mvneta_bm_pools_init(struct mvneta_bm *priv)
 				 MVNETA_BM_POOL_CAP_ALIGN));
 			size = ALIGN(size, MVNETA_BM_POOL_CAP_ALIGN);
 		}
-		bm_pool->size = size;
+		bm_pool->hwbm_pool.size = size;
 
 		mvneta_bm_write(priv, MVNETA_BM_POOL_SIZE_REG(i),
-				bm_pool->size);
+				bm_pool->hwbm_pool.size);
 
 		/* Obtain custom pkt_size from DT */
 		sprintf(prop, "pool%d,pkt-size", i);
diff --git a/drivers/net/ethernet/marvell/mvneta_bm.h b/drivers/net/ethernet/marvell/mvneta_bm.h
index f2449b843577..ea08736d8cb4 100644
--- a/drivers/net/ethernet/marvell/mvneta_bm.h
+++ b/drivers/net/ethernet/marvell/mvneta_bm.h
@@ -108,20 +108,15 @@ struct mvneta_bm {
 };
 
 struct mvneta_bm_pool {
+	struct hwbm_pool hwbm_pool;
 	/* Pool number in the range 0-3 */
 	u8 id;
 	enum mvneta_bm_type type;
 
-	/* Buffer Pointers Pool External (BPPE) size in number of bytes */
-	int size;
-	/* Number of buffers used by this pool */
-	int buf_num;
-	/* Pool buffer size */
-	int buf_size;
 	/* Packet size */
 	int pkt_size;
-	/* Single frag size */
-	u32 frag_size;
+	/* Size of the buffer acces through DMA*/
+	u32 buf_size;
 
 	/* BPPE virtual base address */
 	u32 *virt_addr;
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307900 — Re: [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework

FromMarcin Wojtas <mw@semihalf.com>
Date2016-01-12 23:50 +0100
SubjectRe: [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework
Message-ID<qQfVg-7so-31@gated-at.bofh.it>
In reply to#1307754
Hi Gregory,

A quick remark below. All changes look fine to me at a first look, but
I will test and dig more into code soon.

>
> @@ -3946,11 +3965,6 @@ static int mvneta_probe(struct platform_device *pdev)
>         dev->priv_flags |= IFF_UNICAST_FLT;
>         dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
>
> -       err = register_netdev(dev);
> -       if (err < 0) {
> -               dev_err(&pdev->dev, "failed to register\n");
> -               goto err_free_stats;
> -       }

The purpose of shifting register_netdev() was to be able to obtain
pp->id from net_device, before mvneta_bm_port_init is called. It is
needed for proper port - pool mapping control.

>
>         pp->id = dev->ifindex;
>
> @@ -3965,6 +3979,12 @@ static int mvneta_probe(struct platform_device *pdev)
>                 }
>         }
>
> +       err = register_netdev(dev);
> +       if (err < 0) {
> +               dev_err(&pdev->dev, "failed to register\n");
> +               goto err_free_stats;
> +       }
> +
>         err = mvneta_init(&pdev->dev, pp);
>         if (err < 0)
>                 goto err_netdev;

Best regards,
Marcin

[toc] | [prev] | [next] | [standalone]


#1308680 — Re: [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-13 18:50 +0100
SubjectRe: [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework
Message-ID<qQxIu-34w-5@gated-at.bofh.it>
In reply to#1307900
Hi Marcin,
 
 On mar., janv. 12 2016, Marcin Wojtas <mw@semihalf.com> wrote:

> Hi Gregory,
>
> A quick remark below. All changes look fine to me at a first look, but
> I will test and dig more into code soon.

Great! A test would be nice because I have just did basic tests: mainly an
iperf.

>
>>
>> @@ -3946,11 +3965,6 @@ static int mvneta_probe(struct platform_device *pdev)
>>         dev->priv_flags |= IFF_UNICAST_FLT;
>>         dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
>>
>> -       err = register_netdev(dev);
>> -       if (err < 0) {
>> -               dev_err(&pdev->dev, "failed to register\n");
>> -               goto err_free_stats;
>> -       }
>
> The purpose of shifting register_netdev() was to be able to obtain
> pp->id from net_device, before mvneta_bm_port_init is called. It is
> needed for proper port - pool mapping control.

I can revert this change, initially I moved this chunk because I wanted
to add a netdev_ops before registering it and this netdev_op depend on
the bm support. As for now I don't have this this netdev_op this change
is pointless. But if in future I need it, then I will look for how to do
it in a different way.

Thanks,


>
>>
>>         pp->id = dev->ifindex;
>>
>> @@ -3965,6 +3979,12 @@ static int mvneta_probe(struct platform_device *pdev)
>>                 }
>>         }
>>
>> +       err = register_netdev(dev);
>> +       if (err < 0) {
>> +               dev_err(&pdev->dev, "failed to register\n");
>> +               goto err_free_stats;
>> +       }
>> +
>>         err = mvneta_init(&pdev->dev, pp);
>>         if (err < 0)
>>                 goto err_netdev;
>
> Best regards,
> Marcin

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1307755 — [PATCH net-next 07/10] ARM: mvebu: enable buffer manager support on Armada XP boards

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 07/10] ARM: mvebu: enable buffer manager support on Armada XP boards
Message-ID<qQcE1-5kS-7@gated-at.bofh.it>
In reply to#1307751
From: Marcin Wojtas <mw@semihalf.com>

Since mvneta driver supports using hardware buffer management (BM), in
order to use it, board files have to be adjusted accordingly. This commit
enables BM on AXP-DB and AXP-GP in same manner - because number of ports
on those boards is the same as number of possible pools, each port is
supposed to use single pool for all kind of packets.

Moreover appropriate entry is added to 'soc' node ranges, as well as "okay"
status for 'bm' and 'bm-bppi' (internal SRAM) nodes.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 arch/arm/boot/dts/armada-xp-db.dts | 19 ++++++++++++++++++-
 arch/arm/boot/dts/armada-xp-gp.dts | 19 ++++++++++++++++++-
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index f774101416a5..30657302305d 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -77,7 +77,8 @@
 			  MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
 			  MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000
 			  MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
-			  MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
+			  MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000
+			  MBUS_ID(0x0c, 0x04) 0 0 0xf1200000 0x100000>;
 
 		devbus-bootcs {
 			status = "okay";
@@ -181,21 +182,33 @@
 				status = "okay";
 				phy = <&phy0>;
 				phy-mode = "rgmii-id";
+				buffer-manager = <&bm>;
+				bm,pool-long = <0>;
 			};
 			ethernet@74000 {
 				status = "okay";
 				phy = <&phy1>;
 				phy-mode = "rgmii-id";
+				buffer-manager = <&bm>;
+				bm,pool-long = <1>;
 			};
 			ethernet@30000 {
 				status = "okay";
 				phy = <&phy2>;
 				phy-mode = "sgmii";
+				buffer-manager = <&bm>;
+				bm,pool-long = <2>;
 			};
 			ethernet@34000 {
 				status = "okay";
 				phy = <&phy3>;
 				phy-mode = "sgmii";
+				buffer-manager = <&bm>;
+				bm,pool-long = <3>;
+			};
+
+			bm@c0000 {
+				status = "okay";
 			};
 
 			mvsdio@d4000 {
@@ -230,5 +243,9 @@
 				};
 			};
 		};
+
+		bm-bppi {
+			status = "okay";
+		};
 	};
 };
diff --git a/arch/arm/boot/dts/armada-xp-gp.dts b/arch/arm/boot/dts/armada-xp-gp.dts
index 4878d7353069..a1ded01d0c07 100644
--- a/arch/arm/boot/dts/armada-xp-gp.dts
+++ b/arch/arm/boot/dts/armada-xp-gp.dts
@@ -96,7 +96,8 @@
 			  MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
 			  MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000
 			  MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
-			  MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
+			  MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000
+			  MBUS_ID(0x0c, 0x04) 0 0 0xf1200000 0x100000>;
 
 		devbus-bootcs {
 			status = "okay";
@@ -196,21 +197,29 @@
 				status = "okay";
 				phy = <&phy0>;
 				phy-mode = "qsgmii";
+				buffer-manager = <&bm>;
+				bm,pool-long = <0>;
 			};
 			ethernet@74000 {
 				status = "okay";
 				phy = <&phy1>;
 				phy-mode = "qsgmii";
+				buffer-manager = <&bm>;
+				bm,pool-long = <1>;
 			};
 			ethernet@30000 {
 				status = "okay";
 				phy = <&phy2>;
 				phy-mode = "qsgmii";
+				buffer-manager = <&bm>;
+				bm,pool-long = <2>;
 			};
 			ethernet@34000 {
 				status = "okay";
 				phy = <&phy3>;
 				phy-mode = "qsgmii";
+				buffer-manager = <&bm>;
+				bm,pool-long = <3>;
 			};
 
 			/* Front-side USB slot */
@@ -235,6 +244,10 @@
 				};
 			};
 
+			bm@c0000 {
+				status = "okay";
+			};
+
 			nand@d0000 {
 				status = "okay";
 				num-cs = <1>;
@@ -243,5 +256,9 @@
 				nand-on-flash-bbt;
 			};
 		};
+
+		bm-bppi {
+			status = "okay";
+		};
 	};
 };
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307756 — [PATCH net-next 01/10] bus: mvebu-mbus: provide api for obtaining IO and DRAM window information

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 01/10] bus: mvebu-mbus: provide api for obtaining IO and DRAM window information
Message-ID<qQcE1-5kS-15@gated-at.bofh.it>
In reply to#1307751
From: Marcin Wojtas <mw@semihalf.com>

This commit enables finding appropriate mbus window and obtaining its
target id and attribute for given physical address in two separate
routines, both for IO and DRAM windows. This functionality
is needed for Armada XP/38x Network Controller's Buffer Manager and
PnC configuration.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>

[DRAM window information reference in LKv3.10]
Signed-off-by: Evan Wang <xswang@marvell.com>
---
 drivers/bus/mvebu-mbus.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mbus.h     |  3 +++
 2 files changed, 54 insertions(+)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index c43c3d2baf73..3d1c0c3880ec 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -948,6 +948,57 @@ void mvebu_mbus_get_pcie_io_aperture(struct resource *res)
 	*res = mbus_state.pcie_io_aperture;
 }
 
+int mvebu_mbus_get_dram_win_info(phys_addr_t phyaddr, u8 *target, u8 *attr)
+{
+	const struct mbus_dram_target_info *dram;
+	int i;
+
+	/* Get dram info */
+	dram = mv_mbus_dram_info();
+	if (!dram) {
+		pr_err("missing DRAM information\n");
+		return -ENODEV;
+	}
+
+	/* Try to find matching DRAM window for phyaddr */
+	for (i = 0; i < dram->num_cs; i++) {
+		const struct mbus_dram_window *cs = dram->cs + i;
+
+		if (cs->base <= phyaddr && phyaddr <= (cs->base + cs->size)) {
+			*target = dram->mbus_dram_target_id;
+			*attr = cs->mbus_attr;
+			return 0;
+		}
+	}
+
+	pr_err("invalid dram address 0x%x\n", phyaddr);
+	return -EINVAL;
+}
+EXPORT_SYMBOL_GPL(mvebu_mbus_get_dram_win_info);
+
+int mvebu_mbus_get_io_win_info(phys_addr_t phyaddr, u32 *size, u8 *target,
+			       u8 *attr)
+{
+	int win;
+
+	for (win = 0; win < mbus_state.soc->num_wins; win++) {
+		u64 wbase;
+		int enabled;
+
+		mvebu_mbus_read_window(&mbus_state, win, &enabled, &wbase,
+				       size, target, attr, NULL);
+
+		if (!enabled)
+			continue;
+
+		if (wbase <= phyaddr && phyaddr <= wbase + *size)
+			return win;
+	}
+
+	return -EINVAL;
+}
+EXPORT_SYMBOL_GPL(mvebu_mbus_get_io_win_info);
+
 static __init int mvebu_mbus_debugfs_init(void)
 {
 	struct mvebu_mbus_state *s = &mbus_state;
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
index 1f7bc630d225..ea34a867caa0 100644
--- a/include/linux/mbus.h
+++ b/include/linux/mbus.h
@@ -69,6 +69,9 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info_nooverlap(vo
 int mvebu_mbus_save_cpu_target(u32 *store_addr);
 void mvebu_mbus_get_pcie_mem_aperture(struct resource *res);
 void mvebu_mbus_get_pcie_io_aperture(struct resource *res);
+int mvebu_mbus_get_dram_win_info(phys_addr_t phyaddr, u8 *target, u8 *attr);
+int mvebu_mbus_get_io_win_info(phys_addr_t phyaddr, u32 *size, u8 *target,
+			       u8 *attr);
 int mvebu_mbus_add_window_remap_by_id(unsigned int target,
 				      unsigned int attribute,
 				      phys_addr_t base, size_t size,
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307757 — [PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info
Message-ID<qQcE2-5kS-17@gated-at.bofh.it>
In reply to#1307751
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/bus/mvebu-mbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 3d1c0c3880ec..214bb964165b 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -964,7 +964,7 @@ int mvebu_mbus_get_dram_win_info(phys_addr_t phyaddr, u8 *target, u8 *attr)
 	for (i = 0; i < dram->num_cs; i++) {
 		const struct mbus_dram_window *cs = dram->cs + i;
 
-		if (cs->base <= phyaddr && phyaddr <= (cs->base + cs->size)) {
+		if (cs->base <= phyaddr && phyaddr <= (cs->base + cs->size - 1)) {
 			*target = dram->mbus_dram_target_id;
 			*attr = cs->mbus_attr;
 			return 0;
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307853 — Re: [PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info

FromMarcin Wojtas <mw@semihalf.com>
Date2016-01-12 22:50 +0100
SubjectRe: [PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info
Message-ID<qQeZc-6Mv-31@gated-at.bofh.it>
In reply to#1307757
Gregory,



2016-01-12 20:10 GMT+01:00 Gregory CLEMENT <gregory.clement@free-electrons.com>:
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  drivers/bus/mvebu-mbus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
> index 3d1c0c3880ec..214bb964165b 100644
> --- a/drivers/bus/mvebu-mbus.c
> +++ b/drivers/bus/mvebu-mbus.c
> @@ -964,7 +964,7 @@ int mvebu_mbus_get_dram_win_info(phys_addr_t phyaddr, u8 *target, u8 *attr)
>         for (i = 0; i < dram->num_cs; i++) {
>                 const struct mbus_dram_window *cs = dram->cs + i;
>
> -               if (cs->base <= phyaddr && phyaddr <= (cs->base + cs->size)) {
> +               if (cs->base <= phyaddr && phyaddr <= (cs->base + cs->size - 1)) {
>                         *target = dram->mbus_dram_target_id;
>                         *attr = cs->mbus_attr;
>                         return 0;
> --

Except for a typo in the commit log, the fix is good.
If you wish you can add
Reviewed-by: Marcin Wojtas <mw@semihalf.com>

Best regards,
Marcin

[toc] | [prev] | [next] | [standalone]


#1309296 — RE: [PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info

FromDavid Laight <David.Laight@ACULAB.COM>
Date2016-01-14 15:10 +0100
SubjectRE: [PATCH net-next 08/10] bus: mvenus-mbus: Fix size test for mvebu_mbus_get_dram_win_info
Message-ID<qQQL8-8bA-5@gated-at.bofh.it>
In reply to#1307757
From: Gregory CLEMENT
> Sent: 12 January 2016 19:11
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  drivers/bus/mvebu-mbus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
> index 3d1c0c3880ec..214bb964165b 100644
> --- a/drivers/bus/mvebu-mbus.c
> +++ b/drivers/bus/mvebu-mbus.c
> @@ -964,7 +964,7 @@ int mvebu_mbus_get_dram_win_info(phys_addr_t phyaddr, u8 *target, u8 *attr)
>  	for (i = 0; i < dram->num_cs; i++) {
>  		const struct mbus_dram_window *cs = dram->cs + i;
> 
> -		if (cs->base <= phyaddr && phyaddr <= (cs->base + cs->size)) {
> +		if (cs->base <= phyaddr && phyaddr <= (cs->base + cs->size - 1)) {

Wouldn't it be better to change the line to:
> +		if (cs->base <= phyaddr && phyaddr < (cs->base + cs->size)) {

	David

[toc] | [prev] | [next] | [standalone]


#1307758 — [PATCH net-next 06/10] ARM: mvebu: add buffer manager nodes to armada-xp.dtsi

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 06/10] ARM: mvebu: add buffer manager nodes to armada-xp.dtsi
Message-ID<qQcE2-5kS-21@gated-at.bofh.it>
In reply to#1307751
From: Marcin Wojtas <mw@semihalf.com>

Armada XP network controller supports hardware buffer management (BM).
Since it is now enabled in mvneta driver, appropriate nodes can be added
to armada-xp.dtsi - for the actual common BM unit (bm@c0000) and its
internal SRAM (bm-bppi), which is used for indirect access to buffer
pointer ring residing in DRAM.

Pools - ports mapping, bm-bppi entry in 'soc' node's ranges and optional
parameters are supposed to be set in board files.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 arch/arm/boot/dts/armada-xp.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi
index be23196829bb..bd459360d7a6 100644
--- a/arch/arm/boot/dts/armada-xp.dtsi
+++ b/arch/arm/boot/dts/armada-xp.dtsi
@@ -253,6 +253,14 @@
 				marvell,crypto-sram-size = <0x800>;
 			};
 
+			bm: bm@c0000 {
+				compatible = "marvell,armada-380-neta-bm";
+				reg = <0xc0000 0xac>;
+				clocks = <&gateclk 13>;
+				internal-mem = <&bm_bppi>;
+				status = "disabled";
+			};
+
 			xor@f0900 {
 				compatible = "marvell,orion-xor";
 				reg = <0xF0900 0x100
@@ -291,6 +299,16 @@
 			#size-cells = <1>;
 			ranges = <0 MBUS_ID(0x09, 0x05) 0 0x800>;
 		};
+
+		bm_bppi: bm-bppi {
+			compatible = "mmio-sram";
+			reg = <MBUS_ID(0x0c, 0x04) 0 0x100000>;
+			ranges = <0 MBUS_ID(0x0c, 0x04) 0 0x100000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			clocks = <&gateclk 13>;
+			status = "disabled";
+		};
 	};
 
 	clocks {
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307759 — [PATCH net-next 09/10] net: Add a hardware buffer management helper API

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 09/10] net: Add a hardware buffer management helper API
Message-ID<qQcE2-5kS-23@gated-at.bofh.it>
In reply to#1307751
This basic implementation allows to share code between driver using
hardware buffer management. As the code is hardware agnostic, there is
few helpers, most of the optimization brought by the an HW BM has to be
done at driver level.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 include/net/hwbm.h | 19 +++++++++++++
 net/core/Makefile  |  2 +-
 net/core/hwbm.c    | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+), 1 deletion(-)
 create mode 100644 include/net/hwbm.h
 create mode 100644 net/core/hwbm.c

diff --git a/include/net/hwbm.h b/include/net/hwbm.h
new file mode 100644
index 000000000000..898ccd2fb58d
--- /dev/null
+++ b/include/net/hwbm.h
@@ -0,0 +1,19 @@
+#ifndef _HWBM_H
+#define _HWBM_H
+
+struct hwbm_pool {
+	/* Size of the buffers managed */
+	int size;
+	/* Number of buffers currently used by this pool */
+	int buf_num;
+	/* constructor called during alocation */
+	int (*construct)(struct hwbm_pool *bm_pool, void *buf);
+	/* private data */
+	void *priv;
+};
+
+void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf);
+int hwbm_pool_refill(struct hwbm_pool *bm_pool);
+int hwbm_pool_add(struct hwbm_pool *bm_pool, int buf_num);
+
+#endif /* _HWBM_H */
diff --git a/net/core/Makefile b/net/core/Makefile
index 0b835de04de3..df81bf11f072 100644
--- a/net/core/Makefile
+++ b/net/core/Makefile
@@ -9,7 +9,7 @@ obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
 
 obj-y		     += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
 			neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
-			sock_diag.o dev_ioctl.o tso.o sock_reuseport.o
+			sock_diag.o dev_ioctl.o tso.o sock_reuseport.o hwbm.o
 
 obj-$(CONFIG_XFRM) += flow.o
 obj-y += net-sysfs.o
diff --git a/net/core/hwbm.c b/net/core/hwbm.c
new file mode 100644
index 000000000000..d5d40d63cb34
--- /dev/null
+++ b/net/core/hwbm.c
@@ -0,0 +1,78 @@
+/* Support for hardware buffer manager.
+ *
+ * Copyright (C) 2016 Marvell
+ *
+ * Gregory CLEMENT <gregory.clement@free-electrons.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ */
+#include <linux/kernel.h>
+#include <linux/printk.h>
+#include <linux/skbuff.h>
+#include <net/hwbm.h>
+
+void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf)
+{
+	if (likely(bm_pool->size <= PAGE_SIZE))
+		skb_free_frag(buf);
+	else
+		kfree(buf);
+}
+EXPORT_SYMBOL_GPL(hwbm_buf_free);
+
+/* Refill processing for HW buffer management */
+int hwbm_pool_refill(struct hwbm_pool *bm_pool)
+{
+	void *buf;
+	int frag_size = bm_pool->size;
+
+	if (likely(frag_size <= PAGE_SIZE))
+		buf = netdev_alloc_frag(frag_size);
+	else
+		buf = kmalloc(frag_size, GFP_ATOMIC);
+
+	if (!buf)
+		return -ENOMEM;
+
+	if (bm_pool->construct)
+		if (bm_pool->construct(bm_pool, buf)) {
+			hwbm_buf_free(bm_pool, buf);
+			return -ENOMEM;
+		}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(hwbm_pool_refill);
+
+int hwbm_pool_add(struct hwbm_pool *bm_pool, int buf_num)
+{
+	int err, i;
+
+	if (bm_pool->buf_num == bm_pool->size) {
+		pr_debug("pool already filled\n");
+		return bm_pool->buf_num;
+	}
+
+	if (buf_num + bm_pool->buf_num > bm_pool->size) {
+		pr_debug("cannot allocate %d buffers for pool\n",
+			 buf_num);
+		return 0;
+	}
+
+	for (i = 0; i < buf_num; i++) {
+		err = hwbm_pool_refill(bm_pool);
+		if (err < 0)
+			break;
+	}
+
+	/* Update BM driver with number of buffers added to pool */
+	bm_pool->buf_num += i;
+
+	pr_debug("hwpm pool: %d of %d buffers added\n", i, buf_num);
+
+	return i;
+}
+EXPORT_SYMBOL_GPL(hwbm_pool_add);
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307760 — [PATCH net-next 04/10] ARM: mvebu: add buffer manager nodes to armada-38x.dtsi

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-12 20:20 +0100
Subject[PATCH net-next 04/10] ARM: mvebu: add buffer manager nodes to armada-38x.dtsi
Message-ID<qQcE2-5kS-27@gated-at.bofh.it>
In reply to#1307751
From: Marcin Wojtas <mw@semihalf.com>

Armada 38x network controller supports hardware buffer management (BM).
Since it is now enabled in mvneta driver, appropriate nodes can be added
to armada-38x.dtsi - for the actual common BM unit (bm@c8000) and its
internal SRAM (bm-bppi), which is used for indirect access to buffer
pointer ring residing in DRAM.

Pools - ports mapping, bm-bppi entry in 'soc' node's ranges and optional
parameters are supposed to be set in board files.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 arch/arm/boot/dts/armada-38x.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/armada-38x.dtsi b/arch/arm/boot/dts/armada-38x.dtsi
index e8b7f6726772..1b7d690d8e10 100644
--- a/arch/arm/boot/dts/armada-38x.dtsi
+++ b/arch/arm/boot/dts/armada-38x.dtsi
@@ -540,6 +540,14 @@
 				status = "disabled";
 			};
 
+			bm: bm@c8000 {
+				compatible = "marvell,armada-380-neta-bm";
+				reg = <0xc8000 0xac>;
+				clocks = <&gateclk 13>;
+				internal-mem = <&bm_bppi>;
+				status = "disabled";
+			};
+
 			sata@e0000 {
 				compatible = "marvell,armada-380-ahci";
 				reg = <0xe0000 0x2000>;
@@ -618,6 +626,16 @@
 			#size-cells = <1>;
 			ranges = <0 MBUS_ID(0x09, 0x15) 0 0x800>;
 		};
+
+		bm_bppi: bm-bppi {
+			compatible = "mmio-sram";
+			reg = <MBUS_ID(0x0c, 0x04) 0 0x100000>;
+			ranges = <0 MBUS_ID(0x0c, 0x04) 0 0x100000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			clocks = <&gateclk 13>;
+			status = "disabled";
+		};
 	};
 
 	clocks {
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1307796 — Re: [PATCH net-next 03/10] net: mvneta: bm: add support for hardware buffer management

FromMarcin Wojtas <mw@semihalf.com>
Date2016-01-12 21:20 +0100
SubjectRe: [PATCH net-next 03/10] net: mvneta: bm: add support for hardware buffer management
Message-ID<qQdA5-5WY-3@gated-at.bofh.it>
In reply to#1307751
Hi Gregory,

I have two remarks to my own code. Please let me know before patch v2,
I will provide you with corrected version (I already did it locally).

> @@ -1556,17 +1777,20 @@ static void mvneta_rxq_drop_pkts(struct mvneta_port *pp,
>         int rx_done, i;
>
>         rx_done = mvneta_rxq_busy_desc_num_get(pp, rxq);
> +       if (rx_done)
> +               mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_done);
> +
> +       if (pp->bm_priv)
> +               return;
> +

This is wrong - buffers that are supposed to be dropped should return
to bm_pool.

> @@ -1587,23 +1812,35 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,
>
>         rx_done = 0;
>
> +       bm_in_use = pp->bm_priv ? true : false;
> +
>         /* Fairness NAPI loop */
>         while (rx_done < rx_todo) {
>                 struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
> +               struct mvneta_bm_pool *bm_pool = NULL;
>                 struct sk_buff *skb;
>                 unsigned char *data;
>                 dma_addr_t phys_addr;
> -               u32 rx_status;
> +               u32 rx_status, frag_size;
>                 int rx_bytes, err;
> +               u8 pool_id;
>
>                 rx_done++;
>                 rx_status = rx_desc->status;
>                 rx_bytes = rx_desc->data_size - (ETH_FCS_LEN + MVNETA_MH_SIZE);
>                 data = (unsigned char *)rx_desc->buf_cookie;
>                 phys_addr = rx_desc->buf_phys_addr;
> +               if (bm_in_use) {
> +                       pool_id = MVNETA_RX_GET_BM_POOL_ID(rx_desc);
> +                       bm_pool = &pp->bm_priv->bm_pools[pool_id];
> +               }
>
>                 if (!mvneta_rxq_desc_is_first_last(rx_status) ||
>                     (rx_status & MVNETA_RXD_ERR_SUMMARY)) {
> +                       /* Return the buffer to the pool */
> +                       if (bm_in_use)
> +                               mvneta_bm_pool_put_bp(pp->bm_priv, bm_pool,
> +                                                     rx_desc->buf_phys_addr);
>                 err_drop_frame:
>                         dev->stats.rx_errors++;
>                         mvneta_rx_error(pp, rx_desc);
> @@ -1633,25 +1870,38 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,
>                         rcvd_pkts++;
>                         rcvd_bytes += rx_bytes;
>
> +                       /* Return the buffer to the pool */
> +                       if (bm_in_use)
> +                               mvneta_bm_pool_put_bp(pp->bm_priv, bm_pool,
> +                                                     rx_desc->buf_phys_addr);
> +
>                         /* leave the descriptor and buffer untouched */
>                         continue;
>                 }
>
>                 /* Refill processing */
> -               err = mvneta_rx_refill(pp, rx_desc);
> +               err = bm_in_use ? mvneta_bm_pool_refill(pp->bm_priv, bm_pool) :
> +                                 mvneta_rx_refill(pp, rx_desc);
>                 if (err) {
>                         netdev_err(dev, "Linux processing - Can't refill\n");
>                         rxq->missed++;
>                         goto err_drop_frame;

Wrong - on refill fail, original buffer should be returned to bm_pool.
Same case is, when netdev_alloc_skb_ip_align fail inside copybreak
(this should also be fixed).

Best regards,
Marcin

[toc] | [prev] | [next] | [standalone]


#1308677 — Re: [PATCH net-next 03/10] net: mvneta: bm: add support for hardware buffer management

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-13 18:40 +0100
SubjectRe: [PATCH net-next 03/10] net: mvneta: bm: add support for hardware buffer management
Message-ID<qQxyP-300-57@gated-at.bofh.it>
In reply to#1307796
Hi Marcin,
 
 On mar., janv. 12 2016, Marcin Wojtas <mw@semihalf.com> wrote:

> Hi Gregory,
>
> I have two remarks to my own code. Please let me know before patch v2,
> I will provide you with corrected version (I already did it locally).

OK I will asked your version before the next submitting.

Thanks,

Gregory

>
>> @@ -1556,17 +1777,20 @@ static void mvneta_rxq_drop_pkts(struct mvneta_port *pp,
>>         int rx_done, i;
>>
>>         rx_done = mvneta_rxq_busy_desc_num_get(pp, rxq);
>> +       if (rx_done)
>> +               mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_done);
>> +
>> +       if (pp->bm_priv)
>> +               return;
>> +
>
> This is wrong - buffers that are supposed to be dropped should return
> to bm_pool.
>
>> @@ -1587,23 +1812,35 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,
>>
>>         rx_done = 0;
>>
>> +       bm_in_use = pp->bm_priv ? true : false;
>> +
>>         /* Fairness NAPI loop */
>>         while (rx_done < rx_todo) {
>>                 struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
>> +               struct mvneta_bm_pool *bm_pool = NULL;
>>                 struct sk_buff *skb;
>>                 unsigned char *data;
>>                 dma_addr_t phys_addr;
>> -               u32 rx_status;
>> +               u32 rx_status, frag_size;
>>                 int rx_bytes, err;
>> +               u8 pool_id;
>>
>>                 rx_done++;
>>                 rx_status = rx_desc->status;
>>                 rx_bytes = rx_desc->data_size - (ETH_FCS_LEN + MVNETA_MH_SIZE);
>>                 data = (unsigned char *)rx_desc->buf_cookie;
>>                 phys_addr = rx_desc->buf_phys_addr;
>> +               if (bm_in_use) {
>> +                       pool_id = MVNETA_RX_GET_BM_POOL_ID(rx_desc);
>> +                       bm_pool = &pp->bm_priv->bm_pools[pool_id];
>> +               }
>>
>>                 if (!mvneta_rxq_desc_is_first_last(rx_status) ||
>>                     (rx_status & MVNETA_RXD_ERR_SUMMARY)) {
>> +                       /* Return the buffer to the pool */
>> +                       if (bm_in_use)
>> +                               mvneta_bm_pool_put_bp(pp->bm_priv, bm_pool,
>> +                                                     rx_desc->buf_phys_addr);
>>                 err_drop_frame:
>>                         dev->stats.rx_errors++;
>>                         mvneta_rx_error(pp, rx_desc);
>> @@ -1633,25 +1870,38 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,
>>                         rcvd_pkts++;
>>                         rcvd_bytes += rx_bytes;
>>
>> +                       /* Return the buffer to the pool */
>> +                       if (bm_in_use)
>> +                               mvneta_bm_pool_put_bp(pp->bm_priv, bm_pool,
>> +                                                     rx_desc->buf_phys_addr);
>> +
>>                         /* leave the descriptor and buffer untouched */
>>                         continue;
>>                 }
>>
>>                 /* Refill processing */
>> -               err = mvneta_rx_refill(pp, rx_desc);
>> +               err = bm_in_use ? mvneta_bm_pool_refill(pp->bm_priv, bm_pool) :
>> +                                 mvneta_rx_refill(pp, rx_desc);
>>                 if (err) {
>>                         netdev_err(dev, "Linux processing - Can't refill\n");
>>                         rxq->missed++;
>>                         goto err_drop_frame;
>
> Wrong - on refill fail, original buffer should be returned to bm_pool.
> Same case is, when netdev_alloc_skb_ip_align fail inside copybreak
> (this should also be fixed).
>
> Best regards,
> Marcin

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1307826 — Re: [PATCH net-next 00/10] Proposal for a API set for HW Buffer management

FromDavid Miller <davem@davemloft.net>
Date2016-01-12 22:00 +0100
SubjectRe: [PATCH net-next 00/10] Proposal for a API set for HW Buffer management
Message-ID<qQecO-6d2-13@gated-at.bofh.it>
In reply to#1307751
If you are going to contribute to netdev you must follow the mailing
list and make not of important announcements such as:

http://marc.info/?l=linux-netdev&m=145248145925834&w=2

Thank you.

[toc] | [prev] | [next] | [standalone]


#1308666

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2016-01-13 18:40 +0100
Message-ID<qQxyO-300-15@gated-at.bofh.it>
In reply to#1307826
Hi David,
 
 On mar., janv. 12 2016, David Miller <davem@davemloft.net> wrote:

> If you are going to contribute to netdev you must follow the mailing
> list and make not of important announcements such as:
>
> http://marc.info/?l=linux-netdev&m=145248145925834&w=2

I perfectly understand that you are busy during this merge
window. However, I didn't expect a feedback from you but more from the
others who were involved previously on this topic. Moreover, at this
stage I don't expect a deep review but more to start a discussion about
this topic in order to submit a better proposal when the net-ext will be
opened.

I realize that I should not have put you as main recipient. It was
because your address is part of my netdev alias.

Sorry for the inconvenience,

Gregory

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1308774 — Re: [PATCH net-next 00/10] Proposal for a API set for HW Buffer management

FromDavid Miller <davem@davemloft.net>
Date2016-01-13 21:00 +0100
SubjectRe: [PATCH net-next 00/10] Proposal for a API set for HW Buffer management
Message-ID<qQzKi-4mW-1@gated-at.bofh.it>
In reply to#1308666
From: Gregory CLEMENT <gregory.clement@free-electrons.com>
Date: Wed, 13 Jan 2016 18:36:54 +0100

> I perfectly understand that you are busy during this merge
> window. However, I didn't expect a feedback from you but more from the
> others who were involved previously on this topic.

When a patch is submitted with "net-next" in the Subject line and
no "RFC" or other indication like that, it means you think the
patch is ready for me to consider applying to my tree.

You have to communicate properly in your Subject line tags if you
want me to interpret your changes one way or another.

And quite frankly, I really don't even want to see a lot of RFC
networking changes posted when the merge window is open, I only want
to see bug fixes and people concentrating on that instead of future
work.

Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web