Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next] net: dsa: bcm_sf2: dst in not an array
From: Florian Fainelli @ 2017-08-02 19:55 UTC (permalink / raw)
  To: Vivien Didelot, netdev; +Cc: linux-kernel, kernel, David S. Miller, Andrew Lunn
In-Reply-To: <20170802194825.29002-1-vivien.didelot@savoirfairelinux.com>

On 08/02/2017 12:48 PM, Vivien Didelot wrote:
> It's been a while now since ds->dst is not an array anymore, but a
> simple pointer to a dsa_switch_tree.
> 
> Fortunately, SF2 does not support multi-chip and thus ds->index is
> always 0.
> 
> This patch substitutes 'ds->dst[ds->index].' with 'ds->dst->'.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks!
-- 
Florian

^ permalink raw reply

* Re: [PATCH v2 net-next 3/4] tcp: Adjust TCP ULP to defer to sockets ULP
From: Dave Watson @ 2017-08-02 19:58 UTC (permalink / raw)
  To: Tom Herbert; +Cc: netdev, rohit
In-Reply-To: <20170802031846.21993-4-tom@quantonium.net>

On 08/01/17 08:18 PM, Tom Herbert wrote:
>  
> -static int tls_init(struct sock *sk)
> +static int tls_init(struct sock *sk, char __user *optval, int len)
>  {
> -	struct inet_connection_sock *icsk = inet_csk(sk);
>  	struct tls_context *ctx;
>  	int rc = 0;
>  
> @@ -450,7 +449,7 @@ static int tls_init(struct sock *sk)
>  		rc = -ENOMEM;
>  		goto out;
>  	}
> -	icsk->icsk_ulp_data = ctx;
> +	sk->sk_ulp_data = ctx;
>  	ctx->setsockopt = sk->sk_prot->setsockopt;
>  	ctx->getsockopt = sk->sk_prot->getsockopt;
>  	sk->sk_prot = &tls_base_prot;
> @@ -458,7 +457,7 @@ static int tls_init(struct sock *sk)
>  	return rc;
>  }

It looks like tls_init should be checking if this is a tcp socket now
also, and failing if not

^ permalink raw reply

* [PATCH net-next] tcp: remove extra POLL_OUT added for finished active connect()
From: Neal Cardwell @ 2017-08-02 19:59 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Neal Cardwell, Florian Westphal, Eric Dumazet,
	Yuchung Cheng

Commit 45f119bf936b ("tcp: remove header prediction") introduced a
minor bug: the sk_state_change() and sk_wake_async() notifications for
a completed active connection happen twice: once in this new spot
inside tcp_finish_connect() and once in the existing code in
tcp_rcv_synsent_state_process() immediately after it calls
tcp_finish_connect(). This commit remoes the duplicate POLL_OUT
notifications.

Fixes: 45f119bf936b ("tcp: remove header prediction")
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
---
 net/ipv4/tcp_input.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index df670d7ed98d..99cdf4ccabb8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5342,11 +5342,6 @@ void tcp_finish_connect(struct sock *sk, struct sk_buff *skb)
 
 	if (sock_flag(sk, SOCK_KEEPOPEN))
 		inet_csk_reset_keepalive_timer(sk, keepalive_time_when(tp));
-
-	if (!sock_flag(sk, SOCK_DEAD)) {
-		sk->sk_state_change(sk);
-		sk_wake_async(sk, SOCK_WAKE_IO, POLL_OUT);
-	}
 }
 
 static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack,
-- 
2.14.0.rc1.383.gd1ce394fe2-goog

^ permalink raw reply related

* Re: [RFC PATCH v2 0/2] nb8800 suspend/resume support
From: Mason @ 2017-08-02 20:02 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: Florian Fainelli, David Miller, netdev, Linux ARM
In-Reply-To: <f1554ee7-2151-1304-c5c1-35264b9be5be@free.fr>

On 02/08/2017 19:31, Mason wrote:

> # iperf3 -c 172.27.64.45 -u -b 950M
> Connecting to host 172.27.64.45, port 5201
> [  4] local 172.27.64.1 port 55533 connected to 172.27.64.45 port 5201
> [ ID] Interval           Transfer     Bandwidth       Total Datagrams
> [  4]   0.00-1.00   sec   102 MBytes   858 Mbits/sec  13091  
> [  4]   1.00-2.00   sec   114 MBytes   953 Mbits/sec  14541  

114 MB in 14541 packets => 7840 bytes per packet
Is iperf3 sending jumbo frames??
In the nb8800 driver, RX_BUF_SIZE is only 1552,
how would it deal with jumbo frames... truncate?

> # iperf3 -c 172.27.64.45 -u -b 950M -l 800
> Connecting to host 172.27.64.45, port 5201
> [  4] local 172.27.64.1 port 35197 connected to 172.27.64.45 port 5201
> [ ID] Interval           Transfer     Bandwidth       Total Datagrams
> [  4]   0.00-1.00   sec  90.6 MBytes   760 Mbits/sec  118724  
> [  4]   1.00-2.00   sec   107 MBytes   894 Mbits/sec  139718  

107 MB in 139718 packets => 766 bytes per packet
800 - 8 (UDP) - 20 (IPv4) = 772 bytes per packet
I suppose that's close enough...
772 * 139718 = 107.86 MB

I need to run the test slightly slower, to prevent
packet loss at the sender.

Perhaps -b 0 or -b 800M

Regards.

^ permalink raw reply

* [PATCH 0/3] ARM: dts: keystone-k2g: Add DCAN instances to 66AK2G
From: Franklin S Cooper Jr @ 2017-08-02 20:18 UTC (permalink / raw)
  To: wg, mkl, robh+dt, ssantosh, linux, linux-can, netdev, devicetree,
	linux-kernel, linux-arm-kernel
  Cc: Franklin S Cooper Jr

Add D CAN nodes to 66AK2G based SoC dtsi.

Franklin S Cooper Jr (2):
  dt-bindings: net: c_can: Update binding for clock and power-domains
    property
  ARM: configs: keystone: Enable D_CAN driver

Lokesh Vutla (1):
  ARM: dts: k2g: Add DCAN nodes

 Documentation/devicetree/bindings/net/can/c_can.txt | 13 ++++++++++++-
 arch/arm/boot/dts/keystone-k2g.dtsi                 | 18 ++++++++++++++++++
 arch/arm/configs/keystone_defconfig                 |  3 +++
 3 files changed, 33 insertions(+), 1 deletion(-)

-- 
2.9.4.dirty

^ permalink raw reply

* [PATCH 1/3] dt-bindings: net: c_can: Update binding for clock and power-domains property
From: Franklin S Cooper Jr @ 2017-08-02 20:18 UTC (permalink / raw)
  To: wg, mkl, robh+dt, ssantosh, linux, linux-can, netdev, devicetree,
	linux-kernel, linux-arm-kernel
  Cc: Franklin S Cooper Jr
In-Reply-To: <20170802201822.11532-1-fcooper@ti.com>

CAN driver uses the clk_get_rate call to determine the frequency of the
functional clock. OMAP based SoCs do not require the clock property since
hwmod already handles creating a "fck" clock thats accessible to drivers.
However, this isn't the case for 66AK2G which makes the clocks property
require for that SoC.

66AK2G requires a new property. Therefore, update the binding to also make
this property requirement clear. Also clarify that for OMAP based SoCs
ti,hwmod is a required property.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
---
 Documentation/devicetree/bindings/net/can/c_can.txt | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/can/c_can.txt b/Documentation/devicetree/bindings/net/can/c_can.txt
index 5a1d8b0..2d50425 100644
--- a/Documentation/devicetree/bindings/net/can/c_can.txt
+++ b/Documentation/devicetree/bindings/net/can/c_can.txt
@@ -11,9 +11,20 @@ Required properties:
 - interrupts		: property with a value describing the interrupt
 			  number
 
-Optional properties:
+The following are mandatory properties for DRA7x, AM33xx and AM43xx SoCs only:
 - ti,hwmods		: Must be "d_can<n>" or "c_can<n>", n being the
 			  instance number
+
+The following are mandatory properties for Keystone 2 66AK2G SoCs only:
+- power-domains		: Should contain a phandle to a PM domain provider node
+			  and an args specifier containing the DCAN device id
+			  value. This property is as per the binding,
+			  Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt
+- clocks		: CAN functional clock phandle. This property is as per the
+			  binding,
+			  Documentation/devicetree/bindings/clock/ti,sci-clk.txt
+
+Optional properties:
 - syscon-raminit	: Handle to system control region that contains the
 			  RAMINIT register, register offset to the RAMINIT
 			  register and the CAN instance number (0 offset).
-- 
2.9.4.dirty

^ permalink raw reply related

* [PATCH 2/3] ARM: dts: k2g: Add DCAN nodes
From: Franklin S Cooper Jr @ 2017-08-02 20:18 UTC (permalink / raw)
  To: wg, mkl, robh+dt, ssantosh, linux, linux-can, netdev, devicetree,
	linux-kernel, linux-arm-kernel
  Cc: Lokesh Vutla, Dave Gerlach, Franklin S Cooper Jr
In-Reply-To: <20170802201822.11532-1-fcooper@ti.com>

From: Lokesh Vutla <lokeshvutla@ti.com>

Add nodes for the two DCAN instances included in 66AK2G

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[d-gerlach@ti.com: add power-domains and clock information]
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
[fcooper@ti.com: update subject and commit message. Misc minor updates]
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
---
 arch/arm/boot/dts/keystone-k2g.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2g.dtsi b/arch/arm/boot/dts/keystone-k2g.dtsi
index bf4d1fa..bebc857 100644
--- a/arch/arm/boot/dts/keystone-k2g.dtsi
+++ b/arch/arm/boot/dts/keystone-k2g.dtsi
@@ -113,6 +113,24 @@
 			status = "disabled";
 		};
 
+		dcan0: can@0260B200 {
+			compatible = "ti,am4372-d_can", "ti,am3352-d_can";
+			reg = <0x0260B200 0x200>;
+			interrupts = <GIC_SPI 190 IRQ_TYPE_EDGE_RISING>;
+			status = "disabled";
+			power-domains = <&k2g_pds 0x0008>;
+			clocks = <&k2g_clks 0x0008 1>;
+		};
+
+		dcan1: can@0260B400 {
+			compatible = "ti,am4372-d_can", "ti,am3352-d_can";
+			reg = <0x0260B400 0x200>;
+			interrupts = <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>;
+			status = "disabled";
+			power-domains = <&k2g_pds 0x0009>;
+			clocks = <&k2g_clks 0x0009 1>;
+		};
+
 		kirq0: keystone_irq@026202a0 {
 			compatible = "ti,keystone-irq";
 			interrupts = <GIC_SPI 1 IRQ_TYPE_EDGE_RISING>;
-- 
2.9.4.dirty

^ permalink raw reply related

* [PATCH 3/3] ARM: configs: keystone: Enable D_CAN driver
From: Franklin S Cooper Jr @ 2017-08-02 20:18 UTC (permalink / raw)
  To: wg, mkl, robh+dt, ssantosh, linux, linux-can, netdev, devicetree,
	linux-kernel, linux-arm-kernel
  Cc: Franklin S Cooper Jr
In-Reply-To: <20170802201822.11532-1-fcooper@ti.com>

Enable C_CAN/D_CAN driver supported by 66AK2G

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
---
 arch/arm/configs/keystone_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index d47ea43..47be99e 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -112,6 +112,9 @@ CONFIG_IP_NF_ARP_MANGLE=y
 CONFIG_IP6_NF_IPTABLES=m
 CONFIG_IP_SCTP=y
 CONFIG_VLAN_8021Q=y
+CONFIG_CAN=m
+CONFIG_CAN_C_CAN=m
+CONFIG_CAN_C_CAN_PLATFORM=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
-- 
2.9.4.dirty

^ permalink raw reply related

* Re: [PATCH net-next] tcp: remove extra POLL_OUT added for finished active connect()
From: Eric Dumazet @ 2017-08-02 20:56 UTC (permalink / raw)
  To: Neal Cardwell
  Cc: David Miller, netdev, Florian Westphal, Eric Dumazet,
	Yuchung Cheng
In-Reply-To: <20170802195958.21383-1-ncardwell@google.com>

On Wed, 2017-08-02 at 15:59 -0400, Neal Cardwell wrote:
> Commit 45f119bf936b ("tcp: remove header prediction") introduced a
> minor bug: the sk_state_change() and sk_wake_async() notifications for
> a completed active connection happen twice: once in this new spot
> inside tcp_finish_connect() and once in the existing code in
> tcp_rcv_synsent_state_process() immediately after it calls
> tcp_finish_connect(). This commit remoes the duplicate POLL_OUT
> notifications.
> 
> Fixes: 45f119bf936b ("tcp: remove header prediction")
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Cc: Florian Westphal <fw@strlen.de>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Yuchung Cheng <ycheng@google.com>
> ---
>  net/ipv4/tcp_input.c | 5 -----
>  1 file changed, 5 deletions(-)

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* Re: [PATCH V5 1/2] firmware: add more flexible request_firmware_async function
From: Luis R. Rodriguez @ 2017-08-02 21:30 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Luis R . Rodriguez, Greg Kroah-Hartman, Bjorn Andersson,
	Daniel Wagner, David Woodhouse, Arend van Spriel,
	Rafael J . Wysocki, yi1.li, atull, Moritz Fischer, pmladek,
	Johannes Berg, emmanuel.grumbach, luciano.coelho, Kalle Valo,
	luto, Linus Torvalds, Kees Cook, AKASHI Takahiro, David Howells,
	pjones, Hans de Goede, alan
In-Reply-To: <20170731150945.8925-1-zajec5@gmail.com>

On Mon, Jul 31, 2017 at 05:09:44PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> So far we got only one function for loading firmware asynchronously:
> request_firmware_nowait. It didn't allow much customization of firmware
> loading process - there is only one bool uevent argument. Moreover this
> bool also controls user helper in an unclear way.

> Some drivers need more flexible helper providing more options. This
> includes control over uevent or warning for the missing firmware. Of
> course this list may grow up in the future.
> 
> To handle this easily this patch adds a generic request_firmware_async
> function. It takes struct with options as an argument which will allow
> extending it in the future without massive changes.
> 
> This is a really cheap change (no new independent API) which works
> nicely with the existing code. The old request_firmware_nowait is kept
> as a simple helper calling new helper.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> V3: Don't expose all FW_OPT_* flags.
>     As Luis noted we want a struct so add struct firmware_opts for real
>     flexibility.
>     Thank you Luis for your review!
> V5: Rebase, update commit message, resend after drvdata discussion
> ---
>  drivers/base/firmware_class.c | 43 ++++++++++++++++++++++++++++++++++---------
>  include/linux/firmware.h      | 15 ++++++++++++++-
>  2 files changed, 48 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> index b9f907eedbf7..cde85b05e4cb 100644
> --- a/drivers/base/firmware_class.c
> +++ b/drivers/base/firmware_class.c
> @@ -1375,7 +1375,7 @@ static void request_firmware_work_func(struct work_struct *work)
>  	_request_firmware(&fw, fw_work->name, fw_work->device, NULL, 0,
>  			  fw_work->opt_flags);
>  	fw_work->cont(fw, fw_work->context);
> -	put_device(fw_work->device); /* taken in request_firmware_nowait() */
> +	put_device(fw_work->device); /* taken in __request_firmware_nowait() */
>  
>  	module_put(fw_work->module);
>  	kfree_const(fw_work->name);
> @@ -1383,10 +1383,9 @@ static void request_firmware_work_func(struct work_struct *work)
>  }
>  
>  /**
> - * request_firmware_nowait - asynchronous version of request_firmware
> + * __request_firmware_nowait - asynchronous version of request_firmware
>   * @module: module requesting the firmware
> - * @uevent: sends uevent to copy the firmware image if this flag
> - *	is non-zero else the firmware copy must be done manually.
> + * @opt_flags: flags that control firmware loading process, see FW_OPT_*
>   * @name: name of firmware file
>   * @device: device for which firmware is being loaded
>   * @gfp: allocation flags
> @@ -1405,9 +1404,9 @@ static void request_firmware_work_func(struct work_struct *work)
>   *
>   *		- can't sleep at all if @gfp is GFP_ATOMIC.
>   **/
> -int
> -request_firmware_nowait(
> -	struct module *module, bool uevent,
> +static int
> +__request_firmware_nowait(
> +	struct module *module, unsigned int opt_flags,
>  	const char *name, struct device *device, gfp_t gfp, void *context,
>  	void (*cont)(const struct firmware *fw, void *context))
>  {
> @@ -1426,8 +1425,7 @@ request_firmware_nowait(
>  	fw_work->device = device;
>  	fw_work->context = context;
>  	fw_work->cont = cont;
> -	fw_work->opt_flags = FW_OPT_NOWAIT | FW_OPT_FALLBACK |
> -		(uevent ? FW_OPT_UEVENT : FW_OPT_USERHELPER);
> +	fw_work->opt_flags = FW_OPT_NOWAIT | opt_flags;
>  
>  	if (!try_module_get(module)) {
>  		kfree_const(fw_work->name);
> @@ -1440,8 +1438,35 @@ request_firmware_nowait(
>  	schedule_work(&fw_work->work);
>  	return 0;
>  }
> +
> +int request_firmware_nowait(struct module *module, bool uevent,
> +			    const char *name, struct device *device, gfp_t gfp,
> +			    void *context,
> +			    void (*cont)(const struct firmware *fw, void *context))
> +{
> +	unsigned int opt_flags = FW_OPT_FALLBACK |
> +		(uevent ? FW_OPT_UEVENT : FW_OPT_USERHELPER);
> +
> +	return __request_firmware_nowait(module, opt_flags, name, device, gfp,
> +					 context, cont);
> +}
>  EXPORT_SYMBOL(request_firmware_nowait);
>  
> +int __request_firmware_async(struct module *module, const char *name,
> +			     struct firmware_opts *fw_opts, struct device *dev,
> +			     void *context,
> +			     void (*cont)(const struct firmware *fw, void *context))
> +{
> +	unsigned int opt_flags = FW_OPT_UEVENT;

This exposes a long issue. Think -- why do we want this enabled by default? Its
actually because even though the fallback stuff is optional and can be, the uevent
internal flag *also* provides caching support as a side consequence only. We
don't want to add a new API without first cleaning up that mess.

This is a slipery slope and best to clean that up before adding any new API.

That and also Greg recently stated he would like to see at least 3 users of
a feature before adding it. Although I think that's pretty arbitrary, and
considering that request_firmware_into_buf() only has *one* user -- its what
he wishes.

  Luis

^ permalink raw reply

* Car Owners List
From: Rachel Haynes @ 2017-08-02 20:59 UTC (permalink / raw)
  To: netdev


Hi,

Would you be interested in acquiring an Email list of "Car Owners" from USA?

We also have data for Luxury Car Owners List, Luxury Brand Buyers List, Mercedes-Benz Owners, BMW Owners, Audi Owners, Hyundai Owners, Porsche Owners, Toyota Owners, Harley Davidson Owners List, Motor Cycle Owners, Car Owners, HNI list, RV Owners and many more...

Each record in the list contains Contact Name(First and Last Name), Direct Mailing Address, List Type, Source and Email Address.

Let me know if you'd be interested in hearing more about it.

Look forward to your response.

Thanks & Regards,
Rachel Haynes

We respect your privacy, if you do not wish to receive any further emails from our end, please reply with a subject “Leave Out”.

^ permalink raw reply

* [PATCH net-next 0/4] ibmvnic: Improve ethtool functionality
From: John Allen @ 2017-08-02 21:42 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Falcon, Nathan Fontenot

This patch series improves ibmvnic ethtool functionality by adding support
for ethtool -l and -g options, correcting existing statistics reporting,
and augmenting the existing statistics with counters for each tx and rx
queue.

John Allen (4):
  ibmvnic: Implement per-queue statistics reporting
  ibmvnic: Convert vnic server reported statistics to cpu endian
  ibmvnic: Implement .get_ringparam
  ibmvnic: Implement .get_channels

 drivers/net/ethernet/ibm/ibmvnic.c | 115 ++++++++++++++++++++++++++++++++++---
 drivers/net/ethernet/ibm/ibmvnic.h |  17 ++++++
 2 files changed, 125 insertions(+), 7 deletions(-)

-- 
2.12.3

^ permalink raw reply

* [PATCH net-next 1/4] ibmvnic: Implement per-queue statistics reporting
From: John Allen @ 2017-08-02 21:44 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Falcon, Nathan Fontenot
In-Reply-To: <f89ddaab-fe27-2b3c-5b3a-3aaac1e60ae3@linux.vnet.ibm.com>

Add counters to report number of packets, bytes, and dropped packets for
each transmit queue and number of packets, bytes, and interrupts for each
receive queue. Modify ethtool callbacks to report the new statistics.

Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
---
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index a3e694679635..a264c6992328 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -346,6 +346,31 @@ static void replenish_pools(struct ibmvnic_adapter *adapter)
 	}
 }

+static void release_stats_buffers(struct ibmvnic_adapter *adapter)
+{
+	kfree(adapter->tx_stats_buffers);
+	kfree(adapter->rx_stats_buffers);
+}
+
+static int init_stats_buffers(struct ibmvnic_adapter *adapter)
+{
+	adapter->tx_stats_buffers =
+				kcalloc(adapter->req_tx_queues,
+					sizeof(struct ibmvnic_tx_queue_stats),
+					GFP_KERNEL);
+	if (!adapter->tx_stats_buffers)
+		return -ENOMEM;
+
+	adapter->rx_stats_buffers =
+				kcalloc(adapter->req_rx_queues,
+					sizeof(struct ibmvnic_rx_queue_stats),
+					GFP_KERNEL);
+	if (!adapter->rx_stats_buffers)
+		return -ENOMEM;
+
+	return 0;
+}
+
 static void release_stats_token(struct ibmvnic_adapter *adapter)
 {
 	struct device *dev = &adapter->vdev->dev;
@@ -686,6 +711,7 @@ static void release_resources(struct ibmvnic_adapter *adapter)
 	release_rx_pools(adapter);

 	release_stats_token(adapter);
+	release_stats_buffers(adapter);
 	release_error_buffers(adapter);

 	if (adapter->napi) {
@@ -763,6 +789,10 @@ static int init_resources(struct ibmvnic_adapter *adapter)
 	if (rc)
 		return rc;

+	rc = init_stats_buffers(adapter);
+	if (rc)
+		return rc;
+
 	rc = init_stats_token(adapter);
 	if (rc)
 		return rc;
@@ -1245,6 +1275,9 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
 	netdev->stats.tx_packets += tx_packets;
 	adapter->tx_send_failed += tx_send_failed;
 	adapter->tx_map_failed += tx_map_failed;
+	adapter->tx_stats_buffers[queue_num].packets += tx_packets;
+	adapter->tx_stats_buffers[queue_num].bytes += tx_bytes;
+	adapter->tx_stats_buffers[queue_num].dropped_packets += tx_dropped;

 	return ret;
 }
@@ -1585,6 +1618,8 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
 		napi_gro_receive(napi, skb); /* send it up */
 		netdev->stats.rx_packets++;
 		netdev->stats.rx_bytes += length;
+		adapter->rx_stats_buffers[scrq_num].packets++;
+		adapter->rx_stats_buffers[scrq_num].bytes += length;
 		frames_processed++;
 	}

@@ -1706,6 +1741,7 @@ static void ibmvnic_get_ringparam(struct net_device *netdev,

 static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)
 {
+	struct ibmvnic_adapter *adapter = netdev_priv(dev);
 	int i;

 	if (stringset != ETH_SS_STATS)
@@ -1713,13 +1749,39 @@ static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)

 	for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++, data += ETH_GSTRING_LEN)
 		memcpy(data, ibmvnic_stats[i].name, ETH_GSTRING_LEN);
+
+	for (i = 0; i < adapter->req_tx_queues; i++) {
+		snprintf(data, ETH_GSTRING_LEN, "tx%d_packets", i);
+		data += ETH_GSTRING_LEN;
+
+		snprintf(data, ETH_GSTRING_LEN, "tx%d_bytes", i);
+		data += ETH_GSTRING_LEN;
+
+		snprintf(data, ETH_GSTRING_LEN, "tx%d_dropped_packets", i);
+		data += ETH_GSTRING_LEN;
+	}
+
+	for (i = 0; i < adapter->req_rx_queues; i++) {
+		snprintf(data, ETH_GSTRING_LEN, "rx%d_packets", i);
+		data += ETH_GSTRING_LEN;
+
+		snprintf(data, ETH_GSTRING_LEN, "rx%d_bytes", i);
+		data += ETH_GSTRING_LEN;
+
+		snprintf(data, ETH_GSTRING_LEN, "rx%d_interrupts", i);
+		data += ETH_GSTRING_LEN;
+	}
 }

 static int ibmvnic_get_sset_count(struct net_device *dev, int sset)
 {
+	struct ibmvnic_adapter *adapter = netdev_priv(dev);
+
 	switch (sset) {
 	case ETH_SS_STATS:
-		return ARRAY_SIZE(ibmvnic_stats);
+		return ARRAY_SIZE(ibmvnic_stats) +
+		       adapter->req_tx_queues * NUM_TX_STATS +
+		       adapter->req_rx_queues * NUM_RX_STATS;
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -1730,7 +1792,7 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
 {
 	struct ibmvnic_adapter *adapter = netdev_priv(dev);
 	union ibmvnic_crq crq;
-	int i;
+	int i, j;

 	memset(&crq, 0, sizeof(crq));
 	crq.request_statistics.first = IBMVNIC_CRQ_CMD;
@@ -1746,6 +1808,24 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,

 	for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++)
 		data[i] = IBMVNIC_GET_STAT(adapter, ibmvnic_stats[i].offset);
+
+	for (j = 0; j < adapter->req_tx_queues; j++) {
+		data[i] = adapter->tx_stats_buffers[j].packets;
+		i++;
+		data[i] = adapter->tx_stats_buffers[j].bytes;
+		i++;
+		data[i] = adapter->tx_stats_buffers[j].dropped_packets;
+		i++;
+	}
+
+	for (j = 0; j < adapter->req_rx_queues; j++) {
+		data[i] = adapter->rx_stats_buffers[j].packets;
+		i++;
+		data[i] = adapter->rx_stats_buffers[j].bytes;
+		i++;
+		data[i] = adapter->rx_stats_buffers[j].interrupts;
+		i++;
+	}
 }

 static const struct ethtool_ops ibmvnic_ethtool_ops = {
@@ -2050,6 +2130,8 @@ static irqreturn_t ibmvnic_interrupt_rx(int irq, void *instance)
 	struct ibmvnic_sub_crq_queue *scrq = instance;
 	struct ibmvnic_adapter *adapter = scrq->adapter;

+	adapter->rx_stats_buffers[scrq->scrq_num].interrupts++;
+
 	if (napi_schedule_prep(&adapter->napi[scrq->scrq_num])) {
 		disable_scrq_irq(adapter, scrq);
 		__napi_schedule(&adapter->napi[scrq->scrq_num]);
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index 8eff6e15f4bb..d02257ccc377 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -166,6 +166,20 @@ struct ibmvnic_statistics {
 	u8 reserved[72];
 } __packed __aligned(8);

+#define NUM_TX_STATS 3
+struct ibmvnic_tx_queue_stats {
+	u64 packets;
+	u64 bytes;
+	u64 dropped_packets;
+};
+
+#define NUM_RX_STATS 3
+struct ibmvnic_rx_queue_stats {
+	u64 packets;
+	u64 bytes;
+	u64 interrupts;
+};
+
 struct ibmvnic_acl_buffer {
 	__be32 len;
 	__be32 version;
@@ -956,6 +970,9 @@ struct ibmvnic_adapter {
 	int tx_send_failed;
 	int tx_map_failed;

+	struct ibmvnic_tx_queue_stats *tx_stats_buffers;
+	struct ibmvnic_rx_queue_stats *rx_stats_buffers;
+
 	int phys_link_state;
 	int logical_link_state;

^ permalink raw reply related

* [PATCH net-next 2/4] ibmvnic: Convert vnic server reported statistics to cpu endian
From: John Allen @ 2017-08-02 21:45 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Falcon, Nathan Fontenot
In-Reply-To: <f89ddaab-fe27-2b3c-5b3a-3aaac1e60ae3@linux.vnet.ibm.com>

The vnic server reports the statistics buffer in big endian format and must
be converted to cpu endian in order to be displayed correctly on little
endian lpars.

Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
---
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index a264c6992328..285ea23bac6a 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1807,7 +1807,8 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
 	wait_for_completion(&adapter->stats_done);

 	for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++)
-		data[i] = IBMVNIC_GET_STAT(adapter, ibmvnic_stats[i].offset);
+		data[i] = be64_to_cpu(IBMVNIC_GET_STAT(adapter,
+						ibmvnic_stats[i].offset));

 	for (j = 0; j < adapter->req_tx_queues; j++) {
 		data[i] = adapter->tx_stats_buffers[j].packets;

^ permalink raw reply related

* [PATCH net-next 3/4] ibmvnic: Implement .get_ringparam
From: John Allen @ 2017-08-02 21:46 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Falcon, Nathan Fontenot
In-Reply-To: <f89ddaab-fe27-2b3c-5b3a-3aaac1e60ae3@linux.vnet.ibm.com>

Implement .get_ringparam (ethtool -g) functionality

Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
---
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 285ea23bac6a..1cc5db94e40f 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1729,12 +1729,14 @@ static u32 ibmvnic_get_link(struct net_device *netdev)
 static void ibmvnic_get_ringparam(struct net_device *netdev,
 				  struct ethtool_ringparam *ring)
 {
-	ring->rx_max_pending = 0;
-	ring->tx_max_pending = 0;
+	struct ibmvnic_adapter *adapter = netdev_priv(netdev);
+
+	ring->rx_max_pending = adapter->max_rx_add_entries_per_subcrq;
+	ring->tx_max_pending = adapter->max_tx_entries_per_subcrq;
 	ring->rx_mini_max_pending = 0;
 	ring->rx_jumbo_max_pending = 0;
-	ring->rx_pending = 0;
-	ring->tx_pending = 0;
+	ring->rx_pending = adapter->req_rx_add_entries_per_subcrq;
+	ring->tx_pending = adapter->req_tx_entries_per_subcrq;
 	ring->rx_mini_pending = 0;
 	ring->rx_jumbo_pending = 0;
 }

^ permalink raw reply related

* [PATCH net-next 4/4] ibmvnic: Implement .get_channels
From: John Allen @ 2017-08-02 21:47 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Falcon, Nathan Fontenot
In-Reply-To: <f89ddaab-fe27-2b3c-5b3a-3aaac1e60ae3@linux.vnet.ibm.com>

Implement .get_channels (ethtool -l) functionality

Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
---
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 1cc5db94e40f..130aee7b5c32 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1741,6 +1741,21 @@ static void ibmvnic_get_ringparam(struct net_device *netdev,
 	ring->rx_jumbo_pending = 0;
 }

+static void ibmvnic_get_channels(struct net_device *netdev,
+				 struct ethtool_channels *channels)
+{
+	struct ibmvnic_adapter *adapter = netdev_priv(netdev);
+
+	channels->max_rx = adapter->max_rx_queues;
+	channels->max_tx = adapter->max_tx_queues;
+	channels->max_other = 0;
+	channels->max_combined = 0;
+	channels->rx_count = adapter->req_rx_queues;
+	channels->tx_count = adapter->req_tx_queues;
+	channels->other_count = 0;
+	channels->combined_count = 0;
+}
+
 static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)
 {
 	struct ibmvnic_adapter *adapter = netdev_priv(dev);
@@ -1837,6 +1852,7 @@ static const struct ethtool_ops ibmvnic_ethtool_ops = {
 	.set_msglevel		= ibmvnic_set_msglevel,
 	.get_link		= ibmvnic_get_link,
 	.get_ringparam		= ibmvnic_get_ringparam,
+	.get_channels		= ibmvnic_get_channels,
 	.get_strings            = ibmvnic_get_strings,
 	.get_sset_count         = ibmvnic_get_sset_count,
 	.get_ethtool_stats	= ibmvnic_get_ethtool_stats,

^ permalink raw reply related

* Re: sysctl, argument parsing, possible bug
From: Luis R. Rodriguez @ 2017-08-02 21:53 UTC (permalink / raw)
  To: Cong Wang
  Cc: Massimo Sala, Luis R. Rodriguez, Kees Cook, LKML,
	Linux Kernel Network Developers
In-Reply-To: <CAM_iQpV8rJOxvA+hT4Dfs_+sJv5N9ZVv5DCgYDxjpvr2X124ww@mail.gmail.com>

On Tue, Aug 01, 2017 at 02:54:51PM -0700, Cong Wang wrote:
> On Tue, Aug 1, 2017 at 2:34 PM, Massimo Sala <massimo.sala.71@gmail.com> wrote:
> > Do you confirm it is a sysctl parsing bug ?
> >
> > Bosybox handles these cases, so I think also standalone sysctl have to.
> >
> > Or at least someone must update sysctl docs / MAN about this.
> >
> 
> Maybe, sysctl seems (I never look into it) just to interpret dot as
> a separator, unless it reads from the /proc/sys/ directory, it can
> not know eth0.100 is actually a netdev name.

Using echo or sysctl -w works for me, try upgrading your procps,
I have procps-3.3.12. Busybox sysctl fails though, so it would
seems this is an issue with busybox, go fix that.

With procps-3.3.12.:

Setting:

ergon:~ # cat /proc/sys/net/ipv4/conf/eth0.100/forwarding 
1

ergon:~ # sysctl -w net.ipv4.conf.eth0/100.forwarding=0
net.ipv4.conf.eth0/100.forwarding = 0

ergon:~ # cat /proc/sys/net/ipv4/conf/eth0.100/forwarding 
0

Querying:

ergon:~ # sysctl net.ipv4.conf.eth0/100.forwarding
net.ipv4.conf.eth0/100.forwarding = 0

With busybox:

ergon:~ # busybox-static sysctl net.ipv4.conf.eth0/100.forwarding
sysctl: error: 'net.ipv4.conf.eth0.100.forwarding' is an unknown key

  Luis

^ permalink raw reply

* Re: [patch net-next 1/6] ipv4: fib: Set offload indication according to nexthop flags
From: David Ahern @ 2017-08-02 23:01 UTC (permalink / raw)
  To: Jiri Pirko, netdev
  Cc: davem, idosch, mlxsw, roopa, nikolay, hannes, yoshfuji, kuznet
In-Reply-To: <20170802075606.1090-2-jiri@resnulli.us>

On 8/2/17 1:56 AM, Jiri Pirko wrote:
> From: Ido Schimmel <idosch@mellanox.com>
> 
> We're going to have capable drivers indicate route offload using the
> nexthop flags, but for non-multipath routes these flags aren't dumped to
> user space.
> 
> Instead, set the offload indication in the route message flags.
> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
>  net/ipv4/fib_semantics.c | 2 ++
>  1 file changed, 2 insertions(+)

Acked-by: David Ahern <dsahern@gmail.com>

^ permalink raw reply

* Re: [patch net-next 6/6] ipv4: fib: Remove unused functions
From: David Ahern @ 2017-08-02 23:01 UTC (permalink / raw)
  To: Jiri Pirko, netdev
  Cc: davem, idosch, mlxsw, roopa, nikolay, hannes, yoshfuji, kuznet
In-Reply-To: <20170802075606.1090-7-jiri@resnulli.us>

On 8/2/17 1:56 AM, Jiri Pirko wrote:
> From: Ido Schimmel <idosch@mellanox.com>
> 
> Previous patches converted users of these functions to provide offload
> indication using the nexthop's flags instead of the FIB info's.
> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
>  include/net/ip_fib.h | 13 -------------
>  1 file changed, 13 deletions(-)
> 

Acked-by: David Ahern <dsahern@gmail.com>

^ permalink raw reply

* Re: [PATCH 1/2] [for 4.13] net: qcom/emac: disable flow control autonegotiation by default
From: David Miller @ 2017-08-02 23:15 UTC (permalink / raw)
  To: timur; +Cc: netdev
In-Reply-To: <3c31277c-93c4-c0a5-cf0d-7270d07c432c@codeaurora.org>

From: Timur Tabi <timur@codeaurora.org>
Date: Wed, 2 Aug 2017 13:39:34 -0500

> On 08/02/2017 01:35 PM, David Miller wrote:
>> Again, any serious installation will have a system watchdog enabled
>> which will break the pause frame bomb.
> 
> Oh well.  I guess I'll have to carry this patch internally.

So you don't want to run a proper watchdog on your systems?
You want them to just hang there and wait for someone to
notice instead?

> What about patch #2?

No real objection.

^ permalink raw reply

* Re: [patch net-next 3/6] mlxsw: spectrum_router: Provide offload indication using nexthop flags
From: David Ahern @ 2017-08-02 23:20 UTC (permalink / raw)
  To: Jiri Pirko, netdev
  Cc: davem, idosch, mlxsw, roopa, nikolay, hannes, yoshfuji, kuznet
In-Reply-To: <20170802075606.1090-4-jiri@resnulli.us>

On 8/2/17 1:56 AM, Jiri Pirko wrote:
> From: Ido Schimmel <idosch@mellanox.com>
> 
> In a similar fashion to previous patch, use the nexthop flags to provide
> offload indication instead of the FIB info's flags.
> 
> In case a nexthop in a multipath route can't be offloaded (gateway's MAC
> can't be resolved, for example), then its offload flag isn't set.
> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
>  .../net/ethernet/mellanox/mlxsw/spectrum_router.c  | 38 ++++++++++++++++++++--
>  1 file changed, 36 insertions(+), 2 deletions(-)
> 
>

Tested-by: David Ahern <dsahern@gmail.com>

^ permalink raw reply

* Re: [patch net-next 5/6] mlxsw: spectrum_router: Refresh offload indication upon group refresh
From: David Ahern @ 2017-08-02 23:20 UTC (permalink / raw)
  To: Jiri Pirko, netdev
  Cc: davem, idosch, mlxsw, roopa, nikolay, hannes, yoshfuji, kuznet
In-Reply-To: <20170802075606.1090-6-jiri@resnulli.us>

On 8/2/17 1:56 AM, Jiri Pirko wrote:
> From: Ido Schimmel <idosch@mellanox.com>
> 
> Now that we provide offload indication using the nexthop's flags we must
> refresh the offload indication whenever the offload state within the
> group changes.
> 
> This didn't matter until now, as offload indication was provided using
> the FIB info flags and multipath routes were marked as offloaded as long
> as one of the nexthops was offloaded.
> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
>  .../net/ethernet/mellanox/mlxsw/spectrum_router.c  | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 

Tested-by: David Ahern <dsahern@gmail.com>

^ permalink raw reply

* Re: [patch net-next 4/6] mlxsw: spectrum_router: Don't check state when refreshing offload indication
From: David Ahern @ 2017-08-02 23:21 UTC (permalink / raw)
  To: Jiri Pirko, netdev
  Cc: davem, idosch, mlxsw, roopa, nikolay, hannes, yoshfuji, kuznet
In-Reply-To: <20170802075606.1090-5-jiri@resnulli.us>

On 8/2/17 1:56 AM, Jiri Pirko wrote:
> From: Ido Schimmel <idosch@mellanox.com>
> 
> Previous patch removed the reliance on the counter in the FIB info to
> set the offload indication, so we no longer need to keep an offload
> state on each FIB entry and can just set or unset the RTNH_F_OFFLOAD
> flag in each nexthop.
> 
> This is also necessary because we're going to need to refresh the
> offload indication whenever the nexthop group associated with the FIB
> entry is refreshed. Current check would prevent us from marking a newly
> resolved nexthop as offloaded if the FIB entry is already marked as
> offloaded.
> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)

Tested-by: David Ahern <dsahern@gmail.com>

^ permalink raw reply

* Re: [PATCH net-next] net: dsa: Add support for 64-bit statistics
From: David Miller @ 2017-08-02 23:49 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, andrew, vivien.didelot, linux-kernel
In-Reply-To: <20170801220036.11355-1-f.fainelli@gmail.com>

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue,  1 Aug 2017 15:00:36 -0700

> DSA slave network devices maintain a pair of bytes and packets counters
> for each directions, but these are not 64-bit capable. Re-use
> pcpu_sw_netstats which contains exactly what we need for that purpose
> and update the code path to report 64-bit capable statistics.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks.

I would run ethtool -S and ifconfig under perf to see where it is
spending so much time.

^ permalink raw reply

* Re: [PATCH net-next] liquidio: set sriov_totalvfs correctly
From: David Miller @ 2017-08-02 23:51 UTC (permalink / raw)
  To: felix.manlunas; +Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla
In-Reply-To: <20170801220507.GA1357@felix-thinkpad.cavium.com>

From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Tue, 1 Aug 2017 15:05:07 -0700

> From: Derek Chickles <derek.chickles@cavium.com>
> 
> The file /sys/devices/pci000.../sriov_totalvfs is showing a wrong value.
> Fix it by calling pci_sriov_set_totalvfs() to set the total number of VFs
> available after calculations for the number of PF and VF queues are made.
> 
> Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
> Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>

Applied, thanks.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox