Netdev List
 help / color / mirror / Atom feed
* [PATCH RESEND v2] net: fec: fix MDIO bus assignement for dual fec SoC's
From: Stefan Agner @ 2015-01-13 23:20 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: shawn.guo-QSEj5FYQhm4dnm+yROfE0A,
	u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ,
	fugang.duan-KZfg59tc24xl57MIdRCFDg,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg, mark.rutland-5wv7dgnIgG8,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, B38611-KZfg59tc24xl57MIdRCFDg,
	LW-bxm8fMRDkQLDiMYJYoSAnRvVK+yQ3ZXh,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	stefan-XLVq0VzYD2Y

On i.MX28, the MDIO bus is shared between the two FEC instances.
The driver makes sure that the second FEC uses the MDIO bus of the
first FEC. This is done conditionally if FEC_QUIRK_ENET_MAC is set.
However, in newer designs, such as Vybrid or i.MX6SX, each FEC MAC
has its own MDIO bus. Simply removing the quirk FEC_QUIRK_ENET_MAC
is not an option since other logic, triggered by this quirk, is
still needed.

Furthermore, there are board designs which use the same MDIO bus
for both PHY's even though the second bus would be available on the
SoC side. Such layout are popular since it saves pins on SoC side.
Due to the above quirk, those boards currently do work fine. The
boards in the mainline tree with such a layout are:
- Freescale Vybrid Tower with TWR-SER2 (vf610-twr.dts)
- Freescale i.MX6 SoloX SDB Board (imx6sx-sdb.dts)

This patch adds a new quirk FEC_QUIRK_SINGLE_MDIO for i.MX28, which
makes sure that the MDIO bus of the first FEC is used in any case.

However, the boards above do have a SoC with a MDIO bus for each FEC
instance. But the PHY's are not connected in a 1:1 configuration. A
proper device tree description is needed to allow the driver to
figure out where to find its PHY. This patch fixes that shortcoming
by adding a MDIO bus child node to the first FEC instance, along
with the two PHY's on that bus, and making use of the phy-handle
property to add a reference to the PHY's.

Acked-by: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>
---
Sorry for this resend, I forgot the netdev mailing list...

There are some discussion around this, see:
https://lkml.org/lkml/2015/1/9/338

I prefer to have the changes in one patch since they are inherently
connected to each other. Shawn seems to be ok with that...

 arch/arm/boot/dts/imx6sx-sdb.dts          | 15 +++++++++++++++
 arch/arm/boot/dts/vf610-twr.dts           | 15 +++++++++++++++
 drivers/net/ethernet/freescale/fec.h      |  2 ++
 drivers/net/ethernet/freescale/fec_main.c |  9 +++++----
 4 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts
index 1e6e5cc..8c1febd 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dts
+++ b/arch/arm/boot/dts/imx6sx-sdb.dts
@@ -159,13 +159,28 @@
 	pinctrl-0 = <&pinctrl_enet1>;
 	phy-supply = <&reg_enet_3v3>;
 	phy-mode = "rgmii";
+	phy-handle = <&ethphy1>;
 	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy1: ethernet-phy@0 {
+			reg = <0>;
+		};
+
+		ethphy2: ethernet-phy@1 {
+			reg = <1>;
+		};
+	};
 };
 
 &fec2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_enet2>;
 	phy-mode = "rgmii";
+	phy-handle = <&ethphy2>;
 	status = "okay";
 };
 
diff --git a/arch/arm/boot/dts/vf610-twr.dts b/arch/arm/boot/dts/vf610-twr.dts
index a0f7621..f2b64b1 100644
--- a/arch/arm/boot/dts/vf610-twr.dts
+++ b/arch/arm/boot/dts/vf610-twr.dts
@@ -129,13 +129,28 @@
 
 &fec0 {
 	phy-mode = "rmii";
+	phy-handle = <&ethphy0>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_fec0>;
 	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy0: ethernet-phy@0 {
+			reg = <0>;
+		};
+
+		ethphy1: ethernet-phy@1 {
+			reg = <1>;
+		};
+	};
 };
 
 &fec1 {
 	phy-mode = "rmii";
+	phy-handle = <&ethphy1>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_fec1>;
 	status = "okay";
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 469691a..4013292 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -424,6 +424,8 @@ struct bufdesc_ex {
  * (40ns * 6).
  */
 #define FEC_QUIRK_BUG_CAPTURE		(1 << 10)
+/* Controller has only one MDIO bus */
+#define FEC_QUIRK_SINGLE_MDIO		(1 << 11)
 
 struct fec_enet_priv_tx_q {
 	int index;
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 5ebdf8d..8dc0391 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -91,7 +91,8 @@ static struct platform_device_id fec_devtype[] = {
 		.driver_data = 0,
 	}, {
 		.name = "imx28-fec",
-		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME,
+		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME |
+				FEC_QUIRK_SINGLE_MDIO,
 	}, {
 		.name = "imx6q-fec",
 		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
@@ -1937,7 +1938,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	int err = -ENXIO, i;
 
 	/*
-	 * The dual fec interfaces are not equivalent with enet-mac.
+	 * The i.MX28 dual fec interfaces are not equal.
 	 * Here are the differences:
 	 *
 	 *  - fec0 supports MII & RMII modes while fec1 only supports RMII
@@ -1952,7 +1953,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	 * mdio interface in board design, and need to be configured by
 	 * fec0 mii_bus.
 	 */
-	if ((fep->quirks & FEC_QUIRK_ENET_MAC) && fep->dev_id > 0) {
+	if ((fep->quirks & FEC_QUIRK_SINGLE_MDIO) && fep->dev_id > 0) {
 		/* fec1 uses fec0 mii_bus */
 		if (mii_cnt && fec0_mii_bus) {
 			fep->mii_bus = fec0_mii_bus;
@@ -2015,7 +2016,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	mii_cnt++;
 
 	/* save fec0 mii_bus */
-	if (fep->quirks & FEC_QUIRK_ENET_MAC)
+	if (fep->quirks & FEC_QUIRK_SINGLE_MDIO)
 		fec0_mii_bus = fep->mii_bus;
 
 	return 0;
-- 
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH] tcp: Fix RFC reference in comment
From: Banerjee, Debabrata @ 2015-01-13 23:17 UTC (permalink / raw)
  To: John Heffner
  Cc: Yuchung Cheng, David Miller, netdev, linux-kernel@vger.kernel.org
In-Reply-To: <CABrhC0m=aPO=OcfK_gTusHz7CU9OUeXAHoqUDaVTGLDiQnL56Q@mail.gmail.com>

On 1/13/15, 5:01 PM, "John Heffner" <johnwheffner@gmail.com> wrote:

>On Tue, Jan 13, 2015 at 4:42 PM, Banerjee, Debabrata
><dbanerje@akamai.com> wrote:
>> On 1/13/15, 4:36 PM, "Yuchung Cheng" <ycheng@google.com> wrote:
>>
>>>RFC2861 resets the cwnd like in RFC2581, but the rest of the code
>>>implements RFC2861. So I think the current comment is fine.
>>
>>
>> No RFC2861 is an experimental RFC that's implemented in
>> tcp_cwnd_application_limited(). RFC2861 Recommends reducing the cwnd by
>> averaging the current cwnd and the used cwnd as the new cwnd.
>>
>>
>> RFC2581 4.1 Says to set cwnd to initial cwnd if more than one rto has
>> passed since the last send. This is what is implemented in the function
>> above.
>
>Look at the code a little closer -- it's decaying cwnd based on number
>of timeouts as described in 2861, not resetting to IW as recommended
>in 2581.
>
>  -John


You're right it's not RFC2581 I was partially misled by the comment
(reset/restart window), but it doesn't appear to be doing what rfc2861 3.2
says either:

           For i=1  To (tcpnow - T_last)/RTO
	win =  min(cwnd, receiver's declared max window)
	cwnd =  max(win/2, MSS)


Versus:

u32 restart_cwnd = tcp_init_cwnd(tp, dst);

restart_cwnd = min(restart_cwnd, cwnd);

	while ((delta -= inet_csk(sk)->icsk_rto) > 0 && cwnd > restart_cwnd)
	cwnd >>= 1;
	tp->snd_cwnd = max(cwnd, restart_cwnd);


It's not using receiver window, it's using cwnd/init_cwnd, it should at
least be using tp->snd_wnd, no?.


I stumbled onto this because it looks like tcp_cwnd_application_limited()
doesn't execute when it should, because tp->snd_cwnd_stamp is being
touched much more often than in rfc2861 3.2. Something seems not right
here...

-Debabrata

^ permalink raw reply

* Re: [net-next PATCH v2 02/12] net: flow_table: add flow, delete flow
From: Alexei Starovoitov @ 2015-01-13 23:00 UTC (permalink / raw)
  To: John Fastabend
  Cc: Thomas Graf, simon.horman, Scott Feldman, netdev@vger.kernel.org,
	gerlitz.or@gmail.com, Jamal Hadi Salim, Andy Gospodarek,
	David S. Miller
In-Reply-To: <20150113213556.13874.41211.stgit@nitbit.x32>

On Tue, Jan 13, 2015 at 1:35 PM, John Fastabend
<john.fastabend@gmail.com> wrote:
> Now that the device capabilities are exposed we can add support to
> add and delete flows from the tables.
>
> The two operations are
>
> table_set_flows :
>
>   The set flow operations is used to program a set of flows into a
>   hardware device table. The message is consumed via netlink encoded

should now netlink cmd be called table_set_rules ?
and s/flow/rule/ everywhere in commit log?

>   message which is then decoded into a null terminated  array of
>   flow entry structures. A flow entry structure is defined as
>
>      struct net_flow_flow {

commit log no longer matches implementation ;)
should be net_flow_rule ?

can you update your .html writeup?
I hope to see more real examples in there.

btw how the whole thing will work with queue splitting from
your other patch?

^ permalink raw reply

* Re: [patch net-next 2/2] net: rename vlan_tx_* helpers since "tx" is misleading there
From: David Miller @ 2015-01-13 22:51 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, kaber
In-Reply-To: <1421165624-19882-2-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Tue, 13 Jan 2015 17:13:44 +0100

> The same macros are used for rx as well. So rename it.
> 
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Applied.

^ permalink raw reply

* Re: [patch net-next v2 1/2] net: sched: fix skb->protocol use in case of accelerated vlan path
From: David Miller @ 2015-01-13 22:51 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, kaber
In-Reply-To: <1421165624-19882-1-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Tue, 13 Jan 2015 17:13:43 +0100

> tc code implicitly considers skb->protocol even in case of accelerated
> vlan paths and expects vlan protocol type here. However, on rx path,
> if the vlan header was already stripped, skb->protocol contains value
> of next header. Similar situation is on tx path.
> 
> So for skbs that use skb->vlan_tci for tagging, use skb->vlan_proto instead.
> 
> Reported-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

Applied.

^ permalink raw reply

* Re: [PATCH] atm: horizon: Remove some unused functions
From: David Miller @ 2015-01-13 22:28 UTC (permalink / raw)
  To: rickard_strandqvist; +Cc: chas, linux-atm-general, netdev, linux-kernel
In-Reply-To: <1421175021-6022-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Date: Tue, 13 Jan 2015 19:50:21 +0100

> Removes some functions that are not used anywhere:
> channel_to_vpivci() query_tx_channel_config() rx_disabled_handler()
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

Applied.

^ permalink raw reply

* Re: [PATCH] atm: lanai: Remove unused function
From: David Miller @ 2015-01-13 22:27 UTC (permalink / raw)
  To: rickard_strandqvist; +Cc: chas, linux-atm-general, netdev, linux-kernel
In-Reply-To: <1421174719-5371-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Date: Tue, 13 Jan 2015 19:45:19 +0100

> Remove the function aal5_spacefor() that is not used anywhere.
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

Applied.

^ permalink raw reply

* Re: [PATCH] tipc: link: Remove unused function
From: David Miller @ 2015-01-13 22:27 UTC (permalink / raw)
  To: rickard_strandqvist
  Cc: jon.maloy, allan.stephens, netdev, tipc-discussion, linux-kernel
In-Reply-To: <1421173498-4012-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Date: Tue, 13 Jan 2015 19:24:58 +0100

> Remove the function tipc_link_get_max_pkt() that is not used anywhere.
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

This does not apply to net-next.

^ permalink raw reply

* Re: [PATCH net-next 2/8] net: dsa: make module builds work
From: Florian Fainelli @ 2015-01-13 22:27 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, buytenh
In-Reply-To: <20150113.163853.1503595006355422756.davem@davemloft.net>

On 13/01/15 13:38, David Miller wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> Date: Mon, 12 Jan 2015 13:57:40 -0800
> 
>> Building any DSA driver as a module will work from a compilation/linking
>> perspective, but the resulting modules produced are not functional.
>>
>> Any DSA driver references register_switch_driver and
>> unregister_switch_driver which are provided by net/dsa/dsa.c, so loading
>> any of these modules prior to dsa_core.ko being loaded will faill.
>>
>> Unfortunately, loading dsa_core.ko will make us call dsa_switch_probe()
>> which will find no DSA switch driver and return an error so we are stuck
>> there because there is no switch driver available. So this is getting us
>> nowhere.
>>
>> This patch introduces a separate module, named dsa_lib which contains
>> register_switch_driver, unregister_switch_driver and dsa_switch_probe
>> (to avoid exposing the list and mutex used for walking switch drivers),
>> such that the following can be done:
>>
>> - load dsa_lib
>> - load the dsa switch driver, e.g: mv88e6060, bcm_sf2
>> - load the dsa_core module
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> This looks worse to me.
> 
> Really, the match table and probing should not be in dsa_core at all.
> 
> It should only be done in individual drivers.

Right, I guess enough procrastination on my side is enough, time to get
this plan submitted: http://marc.info/?t=141038714600002&r=1&w=2.
-- 
Florian

^ permalink raw reply

* Re: [PATCH] tipc: correctly handle releasing a not fully initialized sock
From: David Miller @ 2015-01-13 22:25 UTC (permalink / raw)
  To: sasha.levin
  Cc: linux-kernel, ying.xue, Tero.Aho, jon.maloy, allan.stephens,
	netdev, tipc-discussion
In-Reply-To: <1421171201-25224-1-git-send-email-sasha.levin@oracle.com>

From: Sasha Levin <sasha.levin@oracle.com>
Date: Tue, 13 Jan 2015 12:46:41 -0500

> Commit "tipc: make tipc node table aware of net namespace" has added a
> dereference of sock->sk before making sure it's not NULL, which makes
> releasing a tipc socket NULL pointer dereference for sockets that are
> not fully initialized.
> 
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

Good catch, applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] sunvnet: fix rx packet length check to allow for TSO
From: David Miller @ 2015-01-13 22:24 UTC (permalink / raw)
  To: david.stevens; +Cc: netdev, sowmini.varadhan
In-Reply-To: <54B559A1.9010303@oracle.com>

From: David L Stevens <david.stevens@oracle.com>
Date: Tue, 13 Jan 2015 12:45:05 -0500

> This patch fixes the rx packet length check in the sunvnet driver to allow
> for a TSO max packet length greater than the LDC channel negotiated MTU.
> These are negotiated separately and there is no requirement that
> port->tsolen be less than port->rmtu, but if it isn't, it'll drop packets
> with rx length errors.
> 
> Signed-off-by: David L Stevens <david.stevens@oracle.com>

Applied, thanks David.

^ permalink raw reply

* Re: [PATCHv2 net] xen-netfront: use different locks for Rx and Tx stats
From: David Miller @ 2015-01-13 22:22 UTC (permalink / raw)
  To: david.vrabel; +Cc: netdev, xen-devel, konrad.wilk, boris.ostrovsky
In-Reply-To: <1421167363-27249-1-git-send-email-david.vrabel@citrix.com>

From: David Vrabel <david.vrabel@citrix.com>
Date: Tue, 13 Jan 2015 16:42:42 +0000

> In netfront the Rx and Tx path are independent and use different
> locks.  The Tx lock is held with hard irqs disabled, but Rx lock is
> held with only BH disabled.  Since both sides use the same stats lock,
> a deadlock may occur.
> 
>   [ INFO: possible irq lock inversion dependency detected ]
>   3.16.2 #16 Not tainted
>   ---------------------------------------------------------
>   swapper/0/0 just changed the state of lock:
>    (&(&queue->tx_lock)->rlock){-.....}, at: [<c03adec8>]
>   xennet_tx_interrupt+0x14/0x34
>   but this lock took another, HARDIRQ-unsafe lock in the past:
>    (&stat->syncp.seq#2){+.-...}
>   and interrupts could create inverse lock ordering between them.
>   other info that might help us debug this:
>    Possible interrupt unsafe locking scenario:
> 
>          CPU0                    CPU1
>          ----                    ----
>     lock(&stat->syncp.seq#2);
>                                  local_irq_disable();
>                                  lock(&(&queue->tx_lock)->rlock);
>                                  lock(&stat->syncp.seq#2);
>     <Interrupt>
>       lock(&(&queue->tx_lock)->rlock);
> 
> Using separate locks for the Rx and Tx stats fixes this deadlock.
> 
> Reported-by: Dmitry Piotrovsky <piotrovskydmitry@gmail.com>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 6/6] openvswitch: Support VXLAN Group Policy extension
From: Thomas Graf @ 2015-01-13 22:18 UTC (permalink / raw)
  To: Jesse Gross
  Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev, David Miller,
	Stephen Hemminger, Alexei Starovoitov, Tom Herbert
In-Reply-To: <CAEP_g=9=am_n_aSjA8mxOaViUMEaJgfr8DpMG9GsbitJm8006w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 01/13/15 at 02:15pm, Jesse Gross wrote:
> On Mon, Jan 12, 2015 at 5:02 PM, Thomas Graf <tgraf@suug.ch> wrote:
> > What about if we only apply tun_info->options on Geneve if
> > TUNNEL_GENEVE_OPT is set and vice versa?
> 
> That seems nice and simple to me.

Great! I have implemented this in v4 of the series as posted a couple
of hours ago.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

^ permalink raw reply

* [PATCH 2/2] net/macb: improved ethtool statistics support
From: Xander Huff @ 2015-01-13 22:15 UTC (permalink / raw)
  To: nicolas.ferre
  Cc: jaeden.amero, rich.tollerton, ben.shelton, brad.mouring, netdev,
	linux-kernel, Xander Huff
In-Reply-To: <1421187351-27279-1-git-send-email-xander.huff@ni.com>

Currently `ethtool -S` simply returns "no stats available". It
would be more useful to see what the various ethtool statistics
registers' values are. This change implements get_ethtool_stats,
get_strings, and get_sset_count functions to accomplish this.

Read all GEM statistics registers and sum them into
macb.ethtool_stats. Add the necessary infrastructure to make this
accessible via `ethtool -S`.

Update gem_update_stats to utilize ethtool_stats.

Signed-off-by: Xander Huff <xander.huff@ni.com>
---
 drivers/net/ethernet/cadence/macb.c |  55 +++++++-
 drivers/net/ethernet/cadence/macb.h | 256 ++++++++++++++++++++++++++++++++++++
 2 files changed, 307 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 3767271..dd8c202 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1827,12 +1827,23 @@ static int macb_close(struct net_device *dev)
 
 static void gem_update_stats(struct macb *bp)
 {
-	u32 __iomem *reg = bp->regs + GEM_OTX;
+	int i;
 	u32 *p = &bp->hw_stats.gem.tx_octets_31_0;
-	u32 *end = &bp->hw_stats.gem.rx_udp_checksum_errors + 1;
 
-	for (; p < end; p++, reg++)
-		*p += __raw_readl(reg);
+	for (i = 0; i < GEM_STATS_LEN; ++i, ++p) {
+		u32 offset = gem_statistics[i].offset;
+		u64 val = __raw_readl(bp->regs+offset);
+
+		bp->ethtool_stats[i] += val;
+		*p += val;
+
+		if (offset == GEM_OCTTXL || offset == GEM_OCTRXL) {
+			/* Add GEM_OCTTXH, GEM_OCTRXH */
+			val = __raw_readl(bp->regs+offset+4);
+			bp->ethtool_stats[i] += ((u64)val)<<32;
+			*(++p) += val;
+		}
+	}
 }
 
 static struct net_device_stats *gem_get_stats(struct macb *bp)
@@ -1873,6 +1884,39 @@ static struct net_device_stats *gem_get_stats(struct macb *bp)
 	return nstat;
 }
 
+static void gem_get_ethtool_stats(struct net_device *dev,
+				  struct ethtool_stats *stats, u64 *data)
+{
+	struct macb *bp;
+
+	bp = netdev_priv(dev);
+	gem_update_stats(bp);
+	memcpy(data, &bp->ethtool_stats, sizeof(u64)*GEM_STATS_LEN);
+}
+
+static int gem_get_sset_count(struct net_device *dev, int sset)
+{
+	switch (sset) {
+	case ETH_SS_STATS:
+		return GEM_STATS_LEN;
+	default:
+		return -EOPNOTSUPP;
+	}
+}
+
+static void gem_get_ethtool_strings(struct net_device *dev, u32 sset, u8 *p)
+{
+	int i;
+
+	switch (sset) {
+	case ETH_SS_STATS:
+		for (i = 0; i < GEM_STATS_LEN; i++, p += ETH_GSTRING_LEN)
+			memcpy(p, gem_statistics[i].stat_string,
+			       ETH_GSTRING_LEN);
+		break;
+	}
+}
+
 struct net_device_stats *macb_get_stats(struct net_device *dev)
 {
 	struct macb *bp = netdev_priv(dev);
@@ -1988,6 +2032,9 @@ const struct ethtool_ops macb_ethtool_ops = {
 	.get_regs		= macb_get_regs,
 	.get_link		= ethtool_op_get_link,
 	.get_ts_info		= ethtool_op_get_ts_info,
+	.get_ethtool_stats	= gem_get_ethtool_stats,
+	.get_strings		= gem_get_ethtool_strings,
+	.get_sset_count		= gem_get_sset_count,
 };
 EXPORT_SYMBOL_GPL(macb_ethtool_ops);
 
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 8e8c3c9..378b218 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -82,6 +82,159 @@
 #define GEM_SA4B				0x00A0 /* Specific4 Bottom */
 #define GEM_SA4T				0x00A4 /* Specific4 Top */
 #define GEM_OTX					0x0100 /* Octets transmitted */
+#define GEM_OCTTXL				0x0100 /* Octets transmitted
+							* [31:0]
+							*/
+#define GEM_OCTTXH				0x0104 /* Octets transmitted
+							* [47:32]
+							*/
+#define GEM_TXCNT				0x0108 /* Error-free Frames
+							* Transmitted counter
+							*/
+#define GEM_TXBCCNT				0x010c /* Error-free Broadcast
+							* Frames counter
+							*/
+#define GEM_TXMCCNT				0x0110 /* Error-free Multicast
+							* Frames counter
+							*/
+#define GEM_TXPAUSECNT				0x0114 /* Pause Frames
+							* Transmitted Counter
+							*/
+#define GEM_TX64CNT				0x0118 /* Error-free 64 byte
+							* Frames Transmitted
+							* counter
+							*/
+#define GEM_TX65CNT				0x011c /* Error-free 65-127 byte
+							* Frames Transmitted
+							* counter
+							*/
+#define GEM_TX128CNT				0x0120 /* Error-free 128-255
+							* byte Frames
+							* Transmitted counter
+							*/
+#define GEM_TX256CNT				0x0124 /* Error-free 256-511
+							* byte Frames
+							* transmitted counter
+							*/
+#define GEM_TX512CNT				0x0128 /* Error-free 512-1023
+							* byte Frames
+							* transmitted counter
+							*/
+#define GEM_TX1024CNT				0x012c /* Error-free 1024-1518
+							* byte Frames
+							* transmitted counter
+							*/
+#define GEM_TX1519CNT				0x0130 /* Error-free larger than
+							* 1519 byte Frames
+							* tranmitted counter
+							*/
+#define GEM_TXURUNCNT				0x0134 /* TX under run error
+							* counter
+							*/
+#define GEM_SNGLCOLLCNT				0x0138 /* Single Collision Frame
+							* Counter
+							*/
+#define GEM_MULTICOLLCNT			0x013c /* Multiple Collision
+							* Frame Counter
+							*/
+#define GEM_EXCESSCOLLCNT			0x0140 /* Excessive Collision
+							* Frame Counter
+							*/
+#define GEM_LATECOLLCNT				0x0144 /* Late Collision Frame
+							* Counter
+							*/
+#define GEM_TXDEFERCNT				0x0148 /* Deferred Transmission
+							* Frame Counter
+							*/
+#define GEM_TXCSENSECNT				0x014c /* Carrier Sense Error
+							* Counter
+							*/
+#define GEM_ORX					0x0150 /* Octets received */
+#define GEM_OCTRXL				0x0150 /* Octets received
+							* [31:0]
+							*/
+#define GEM_OCTRXH				0x0154 /* Octets received
+							* [47:32]
+							*/
+#define GEM_RXCNT				0x0158 /* Error-free Frames
+							* Received Counter
+							*/
+#define GEM_RXBROADCNT				0x015c /* Error-free Broadcast
+							* Frames Received
+							* Counter
+							*/
+#define GEM_RXMULTICNT				0x0160 /* Error-free Multicast
+							* Frames Received
+							* Counter
+							*/
+#define GEM_RXPAUSECNT				0x0164 /* Error-free Pause
+							* Frames Received
+							* Counter
+							*/
+#define GEM_RX64CNT				0x0168 /* Error-free 64 byte
+							* Frames Received
+							* Counter
+							*/
+#define GEM_RX65CNT				0x016c /* Error-free 65-127 byte
+							* Frames Received
+							* Counter
+							*/
+#define GEM_RX128CNT				0x0170 /* Error-free 128-255
+							* byte Frames Received
+							* Counter
+							*/
+#define GEM_RX256CNT				0x0174 /* Error-free 256-511
+							* byte Frames Received
+							* Counter
+							*/
+#define GEM_RX512CNT				0x0178 /* Error-free 512-1023
+							* byte Frames Received
+							* Counter
+							*/
+#define GEM_RX1024CNT				0x017c /* Error-free 1024-1518
+							* byte Frames Received
+							* Counter
+							*/
+#define GEM_RX1519CNT				0x0180 /* Error-free larger than
+							* 1519 Frames Received
+							* Counter
+							*/
+#define GEM_RXUNDRCNT				0x0184 /* Undersize Frames
+							* Received Counter
+							*/
+#define GEM_RXOVRCNT				0x0188 /* Oversize Frames
+							* Received Counter
+							*/
+#define GEM_RXJABCNT				0x018c /* Jabbers Received
+							* Counter
+							*/
+#define GEM_RXFCSCNT				0x0190 /* Frame Check Sequence
+							* Error Counter
+							*/
+#define GEM_RXLENGTHCNT				0x0194 /* Length Field Error
+							* Counter
+							*/
+#define GEM_RXSYMBCNT				0x0198 /* Symbol Error
+							* Counter
+							*/
+#define GEM_RXALIGNCNT				0x019c /* Alignment Error
+							* Counter
+							*/
+#define GEM_RXRESERRCNT				0x01a0 /* Receive Resource Error
+							* Counter
+							*/
+#define GEM_RXORCNT				0x01a4 /* Receive Overrun
+							* Counter
+							*/
+#define GEM_RXIPCCNT				0x01a8 /* IP header Checksum
+							* Error Counter
+							*/
+#define GEM_RXTCPCCNT				0x01ac /* TCP Checksum Error
+							* Counter
+							*/
+#define GEM_RXUDPCCNT				0x01b0 /* UDP Checksum Error
+							* Counter
+							*/
 #define GEM_DCFG1				0x0280 /* Design Config 1 */
 #define GEM_DCFG2				0x0284 /* Design Config 2 */
 #define GEM_DCFG3				0x0288 /* Design Config 3 */
@@ -650,6 +803,107 @@ struct gem_stats {
 	u32	rx_udp_checksum_errors;
 };
 
+/* Describes the name and offset of an individual statistic register, as
+ * returned by `ethtool -S`. Also describes which net_device_stats statistics
+ * this register should contribute to.
+ */
+struct gem_statistic {
+	char stat_string[ETH_GSTRING_LEN];
+	int offset;
+	u32 stat_bits;
+};
+
+/* Bitfield defs for net_device_stat statistics */
+#define GEM_NDS_RXERR_OFFSET		0
+#define GEM_NDS_RXLENERR_OFFSET		1
+#define GEM_NDS_RXOVERERR_OFFSET	2
+#define GEM_NDS_RXCRCERR_OFFSET		3
+#define GEM_NDS_RXFRAMEERR_OFFSET	4
+#define GEM_NDS_RXFIFOERR_OFFSET	5
+#define GEM_NDS_TXERR_OFFSET		6
+#define GEM_NDS_TXABORTEDERR_OFFSET	7
+#define GEM_NDS_TXCARRIERERR_OFFSET	8
+#define GEM_NDS_TXFIFOERR_OFFSET	9
+#define GEM_NDS_COLLISIONS_OFFSET	10
+
+#define GEM_STAT_TITLE(name, title) GEM_STAT_TITLE_BITS(name, title, 0)
+#define GEM_STAT_TITLE_BITS(name, title, bits) {	\
+	.stat_string = title,				\
+	.offset = GEM_##name,				\
+	.stat_bits = bits				\
+}
+
+/* list of gem statistic registers. The names MUST match the
+ * corresponding GEM_* definitions.
+ */
+static const struct gem_statistic gem_statistics[] = {
+	GEM_STAT_TITLE(OCTTXL, "tx_octets"), /* OCTTXH combined with OCTTXL */
+	GEM_STAT_TITLE(TXCNT, "tx_frames"),
+	GEM_STAT_TITLE(TXBCCNT, "tx_broadcast_frames"),
+	GEM_STAT_TITLE(TXMCCNT, "tx_multicast_frames"),
+	GEM_STAT_TITLE(TXPAUSECNT, "tx_pause_frames"),
+	GEM_STAT_TITLE(TX64CNT, "tx_64_byte_frames"),
+	GEM_STAT_TITLE(TX65CNT, "tx_65_127_byte_frames"),
+	GEM_STAT_TITLE(TX128CNT, "tx_128_255_byte_frames"),
+	GEM_STAT_TITLE(TX256CNT, "tx_256_511_byte_frames"),
+	GEM_STAT_TITLE(TX512CNT, "tx_512_1023_byte_frames"),
+	GEM_STAT_TITLE(TX1024CNT, "tx_1024_1518_byte_frames"),
+	GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
+	GEM_STAT_TITLE_BITS(TXURUNCNT, "tx_underrun",
+			    GEM_BIT(NDS_TXERR)|GEM_BIT(NDS_TXFIFOERR)),
+	GEM_STAT_TITLE_BITS(SNGLCOLLCNT, "tx_single_collision_frames",
+			    GEM_BIT(NDS_TXERR)|GEM_BIT(NDS_COLLISIONS)),
+	GEM_STAT_TITLE_BITS(MULTICOLLCNT, "tx_multiple_collision_frames",
+			    GEM_BIT(NDS_TXERR)|GEM_BIT(NDS_COLLISIONS)),
+	GEM_STAT_TITLE_BITS(EXCESSCOLLCNT, "tx_excessive_collisions",
+			    GEM_BIT(NDS_TXERR)|
+			    GEM_BIT(NDS_TXABORTEDERR)|
+			    GEM_BIT(NDS_COLLISIONS)),
+	GEM_STAT_TITLE_BITS(LATECOLLCNT, "tx_late_collisions",
+			    GEM_BIT(NDS_TXERR)|GEM_BIT(NDS_COLLISIONS)),
+	GEM_STAT_TITLE(TXDEFERCNT, "tx_deferred_frames"),
+	GEM_STAT_TITLE_BITS(TXCSENSECNT, "tx_carrier_sense_errors",
+			    GEM_BIT(NDS_TXERR)|GEM_BIT(NDS_COLLISIONS)),
+	GEM_STAT_TITLE(OCTRXL, "rx_octets"), /* OCTRXH combined with OCTRXL */
+	GEM_STAT_TITLE(RXCNT, "rx_frames"),
+	GEM_STAT_TITLE(RXBROADCNT, "rx_broadcast_frames"),
+	GEM_STAT_TITLE(RXMULTICNT, "rx_multicast_frames"),
+	GEM_STAT_TITLE(RXPAUSECNT, "rx_pause_frames"),
+	GEM_STAT_TITLE(RX64CNT, "rx_64_byte_frames"),
+	GEM_STAT_TITLE(RX65CNT, "rx_65_127_byte_frames"),
+	GEM_STAT_TITLE(RX128CNT, "rx_128_255_byte_frames"),
+	GEM_STAT_TITLE(RX256CNT, "rx_256_511_byte_frames"),
+	GEM_STAT_TITLE(RX512CNT, "rx_512_1023_byte_frames"),
+	GEM_STAT_TITLE(RX1024CNT, "rx_1024_1518_byte_frames"),
+	GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
+	GEM_STAT_TITLE_BITS(RXUNDRCNT, "rx_undersized_frames",
+			    GEM_BIT(NDS_RXERR)|GEM_BIT(NDS_RXLENERR)),
+	GEM_STAT_TITLE_BITS(RXOVRCNT, "rx_oversize_frames",
+			    GEM_BIT(NDS_RXERR)|GEM_BIT(NDS_RXLENERR)),
+	GEM_STAT_TITLE_BITS(RXJABCNT, "rx_jabbers",
+			    GEM_BIT(NDS_RXERR)|GEM_BIT(NDS_RXLENERR)),
+	GEM_STAT_TITLE_BITS(RXFCSCNT, "rx_frame_check_sequence_errors",
+			    GEM_BIT(NDS_RXERR)|GEM_BIT(NDS_RXCRCERR)),
+	GEM_STAT_TITLE_BITS(RXLENGTHCNT, "rx_length_field_frame_errors",
+			    GEM_BIT(NDS_RXERR)),
+	GEM_STAT_TITLE_BITS(RXSYMBCNT, "rx_symbol_errors",
+			    GEM_BIT(NDS_RXERR)|GEM_BIT(NDS_RXFRAMEERR)),
+	GEM_STAT_TITLE_BITS(RXALIGNCNT, "rx_alignment_errors",
+			    GEM_BIT(NDS_RXERR)|GEM_BIT(NDS_RXOVERERR)),
+	GEM_STAT_TITLE_BITS(RXRESERRCNT, "rx_resource_errors",
+			    GEM_BIT(NDS_RXERR)|GEM_BIT(NDS_RXOVERERR)),
+	GEM_STAT_TITLE_BITS(RXORCNT, "rx_overruns",
+			    GEM_BIT(NDS_RXERR)|GEM_BIT(NDS_RXFIFOERR)),
+	GEM_STAT_TITLE_BITS(RXIPCCNT, "rx_ip_header_checksum_errors",
+			    GEM_BIT(NDS_RXERR)),
+	GEM_STAT_TITLE_BITS(RXTCPCCNT, "rx_tcp_checksum_errors",
+			    GEM_BIT(NDS_RXERR)),
+	GEM_STAT_TITLE_BITS(RXUDPCCNT, "rx_udp_checksum_errors",
+			    GEM_BIT(NDS_RXERR)),
+};
+
+#define GEM_STATS_LEN ARRAY_SIZE(gem_statistics)
+
 struct macb;
 
 struct macb_or_gem_ops {
@@ -728,6 +982,8 @@ struct macb {
 	dma_addr_t skb_physaddr;		/* phys addr from pci_map_single */
 	int skb_length;				/* saved skb length for pci_unmap_single */
 	unsigned int		max_tx_length;
+
+	u64			ethtool_stats[GEM_STATS_LEN];
 };
 
 extern const struct ethtool_ops macb_ethtool_ops;
-- 
1.9.1

^ permalink raw reply related

* [PATCH 1/2] net/macb: Adding comments to various #defs to make interpretation easier
From: Xander Huff @ 2015-01-13 22:15 UTC (permalink / raw)
  To: nicolas.ferre
  Cc: jaeden.amero, rich.tollerton, ben.shelton, brad.mouring, netdev,
	linux-kernel, Xander Huff

This change is to help improve at-a-glace knowledge of the purpose of the
various Cadence MACB/GEM registers. Comments are more helpful for human
readability than short acronyms.

Describe various #define varibles Cadence MACB/GEM registers as documented
in Xilinix's "Zynq-7000 All Programmable SoC TechnicalReference Manual, v1.9.1
(UG-585)"

Signed-off-by: Xander Huff <xander.huff@ni.com>
---
 drivers/net/ethernet/cadence/macb.h | 269 ++++++++++++++++++++++--------------
 1 file changed, 162 insertions(+), 107 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 084191b..8e8c3c9 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -15,20 +15,20 @@
 #define MACB_MAX_QUEUES 8
 
 /* MACB register offsets */
-#define MACB_NCR				0x0000
-#define MACB_NCFGR				0x0004
-#define MACB_NSR				0x0008
+#define MACB_NCR				0x0000 /* Network Control */
+#define MACB_NCFGR				0x0004 /* Network Config */
+#define MACB_NSR				0x0008 /* Network Status */
 #define MACB_TAR				0x000c /* AT91RM9200 only */
 #define MACB_TCR				0x0010 /* AT91RM9200 only */
-#define MACB_TSR				0x0014
-#define MACB_RBQP				0x0018
-#define MACB_TBQP				0x001c
-#define MACB_RSR				0x0020
-#define MACB_ISR				0x0024
-#define MACB_IER				0x0028
-#define MACB_IDR				0x002c
-#define MACB_IMR				0x0030
-#define MACB_MAN				0x0034
+#define MACB_TSR				0x0014 /* Transmit Status */
+#define MACB_RBQP				0x0018 /* RX Q Base Address */
+#define MACB_TBQP				0x001c /* TX Q Base Address */
+#define MACB_RSR				0x0020 /* Receive Status */
+#define MACB_ISR				0x0024 /* Interrupt Status */
+#define MACB_IER				0x0028 /* Interrupt Enable */
+#define MACB_IDR				0x002c /* Interrupt Disable */
+#define MACB_IMR				0x0030 /* Interrupt Mask */
+#define MACB_MAN				0x0034 /* PHY Maintenance */
 #define MACB_PTR				0x0038
 #define MACB_PFR				0x003c
 #define MACB_FTO				0x0040
@@ -68,27 +68,27 @@
 #define MACB_MID				0x00fc
 
 /* GEM register offsets. */
-#define GEM_NCFGR				0x0004
-#define GEM_USRIO				0x000c
-#define GEM_DMACFG				0x0010
-#define GEM_HRB					0x0080
-#define GEM_HRT					0x0084
-#define GEM_SA1B				0x0088
-#define GEM_SA1T				0x008C
-#define GEM_SA2B				0x0090
-#define GEM_SA2T				0x0094
-#define GEM_SA3B				0x0098
-#define GEM_SA3T				0x009C
-#define GEM_SA4B				0x00A0
-#define GEM_SA4T				0x00A4
-#define GEM_OTX					0x0100
-#define GEM_DCFG1				0x0280
-#define GEM_DCFG2				0x0284
-#define GEM_DCFG3				0x0288
-#define GEM_DCFG4				0x028c
-#define GEM_DCFG5				0x0290
-#define GEM_DCFG6				0x0294
-#define GEM_DCFG7				0x0298
+#define GEM_NCFGR				0x0004 /* Network Config */
+#define GEM_USRIO				0x000c /* User IO */
+#define GEM_DMACFG				0x0010 /* DMA Configuration */
+#define GEM_HRB					0x0080 /* Hash Bottom */
+#define GEM_HRT					0x0084 /* Hash Top */
+#define GEM_SA1B				0x0088 /* Specific1 Bottom */
+#define GEM_SA1T				0x008C /* Specific1 Top */
+#define GEM_SA2B				0x0090 /* Specific2 Bottom */
+#define GEM_SA2T				0x0094 /* Specific2 Top */
+#define GEM_SA3B				0x0098 /* Specific3 Bottom */
+#define GEM_SA3T				0x009C /* Specific3 Top */
+#define GEM_SA4B				0x00A0 /* Specific4 Bottom */
+#define GEM_SA4T				0x00A4 /* Specific4 Top */
+#define GEM_OTX					0x0100 /* Octets transmitted */
+#define GEM_DCFG1				0x0280 /* Design Config 1 */
+#define GEM_DCFG2				0x0284 /* Design Config 2 */
+#define GEM_DCFG3				0x0288 /* Design Config 3 */
+#define GEM_DCFG4				0x028c /* Design Config 4 */
+#define GEM_DCFG5				0x0290 /* Design Config 5 */
+#define GEM_DCFG6				0x0294 /* Design Config 6 */
+#define GEM_DCFG7				0x0298 /* Design Config 7 */
 
 #define GEM_ISR(hw_q)				(0x0400 + ((hw_q) << 2))
 #define GEM_TBQP(hw_q)				(0x0440 + ((hw_q) << 2))
@@ -98,67 +98,73 @@
 #define GEM_IMR(hw_q)				(0x0640 + ((hw_q) << 2))
 
 /* Bitfields in NCR */
-#define MACB_LB_OFFSET				0
+#define MACB_LB_OFFSET				0 /* reserved */
 #define MACB_LB_SIZE				1
-#define MACB_LLB_OFFSET				1
+#define MACB_LLB_OFFSET				1 /* Loop back local */
 #define MACB_LLB_SIZE				1
-#define MACB_RE_OFFSET				2
+#define MACB_RE_OFFSET				2 /* Receive enable */
 #define MACB_RE_SIZE				1
-#define MACB_TE_OFFSET				3
+#define MACB_TE_OFFSET				3 /* Transmit enable */
 #define MACB_TE_SIZE				1
-#define MACB_MPE_OFFSET				4
+#define MACB_MPE_OFFSET				4 /* Management port enable */
 #define MACB_MPE_SIZE				1
-#define MACB_CLRSTAT_OFFSET			5
+#define MACB_CLRSTAT_OFFSET			5 /* Clear stats regs */
 #define MACB_CLRSTAT_SIZE			1
-#define MACB_INCSTAT_OFFSET			6
+#define MACB_INCSTAT_OFFSET			6 /* Incremental stats regs */
 #define MACB_INCSTAT_SIZE			1
-#define MACB_WESTAT_OFFSET			7
+#define MACB_WESTAT_OFFSET			7 /* Write enable stats regs */
 #define MACB_WESTAT_SIZE			1
-#define MACB_BP_OFFSET				8
+#define MACB_BP_OFFSET				8 /* Back pressure */
 #define MACB_BP_SIZE				1
-#define MACB_TSTART_OFFSET			9
+#define MACB_TSTART_OFFSET			9 /* Start transmission */
 #define MACB_TSTART_SIZE			1
-#define MACB_THALT_OFFSET			10
+#define MACB_THALT_OFFSET			10 /* Transmit halt */
 #define MACB_THALT_SIZE				1
-#define MACB_NCR_TPF_OFFSET			11
+#define MACB_NCR_TPF_OFFSET			11 /* Transmit pause frame */
 #define MACB_NCR_TPF_SIZE			1
-#define MACB_TZQ_OFFSET				12
+#define MACB_TZQ_OFFSET				12 /* Transmit zero quantum
+						    * pause frame
+						    */
 #define MACB_TZQ_SIZE				1
 
 /* Bitfields in NCFGR */
-#define MACB_SPD_OFFSET				0
+#define MACB_SPD_OFFSET				0 /* Speed */
 #define MACB_SPD_SIZE				1
-#define MACB_FD_OFFSET				1
+#define MACB_FD_OFFSET				1 /* Full duplex */
 #define MACB_FD_SIZE				1
-#define MACB_BIT_RATE_OFFSET			2
+#define MACB_BIT_RATE_OFFSET			2 /* Discard non-VLAN frames */
 #define MACB_BIT_RATE_SIZE			1
-#define MACB_JFRAME_OFFSET			3
+#define MACB_JFRAME_OFFSET			3 /* reserved */
 #define MACB_JFRAME_SIZE			1
-#define MACB_CAF_OFFSET				4
+#define MACB_CAF_OFFSET				4 /* Copy all frames */
 #define MACB_CAF_SIZE				1
-#define MACB_NBC_OFFSET				5
+#define MACB_NBC_OFFSET				5 /* No broadcast */
 #define MACB_NBC_SIZE				1
-#define MACB_NCFGR_MTI_OFFSET			6
+#define MACB_NCFGR_MTI_OFFSET			6 /* Multicast hash enable */
 #define MACB_NCFGR_MTI_SIZE			1
-#define MACB_UNI_OFFSET				7
+#define MACB_UNI_OFFSET				7 /* Unicast hash enable */
 #define MACB_UNI_SIZE				1
-#define MACB_BIG_OFFSET				8
+#define MACB_BIG_OFFSET				8 /* Receive 1536 byte frames */
 #define MACB_BIG_SIZE				1
-#define MACB_EAE_OFFSET				9
+#define MACB_EAE_OFFSET				9 /* External address match
+						   * enable
+						   */
 #define MACB_EAE_SIZE				1
 #define MACB_CLK_OFFSET				10
 #define MACB_CLK_SIZE				2
-#define MACB_RTY_OFFSET				12
+#define MACB_RTY_OFFSET				12 /* Retry test */
 #define MACB_RTY_SIZE				1
-#define MACB_PAE_OFFSET				13
+#define MACB_PAE_OFFSET				13 /* Pause enable */
 #define MACB_PAE_SIZE				1
 #define MACB_RM9200_RMII_OFFSET			13 /* AT91RM9200 only */
 #define MACB_RM9200_RMII_SIZE			1  /* AT91RM9200 only */
-#define MACB_RBOF_OFFSET			14
+#define MACB_RBOF_OFFSET			14 /* Receive buffer offset */
 #define MACB_RBOF_SIZE				2
-#define MACB_RLCE_OFFSET			16
+#define MACB_RLCE_OFFSET			16 /* Length field error frame
+						    * discard
+						    */
 #define MACB_RLCE_SIZE				1
-#define MACB_DRFCS_OFFSET			17
+#define MACB_DRFCS_OFFSET			17 /* FCS remove */
 #define MACB_DRFCS_SIZE				1
 #define MACB_EFRHD_OFFSET			18
 #define MACB_EFRHD_SIZE				1
@@ -166,111 +172,160 @@
 #define MACB_IRXFCS_SIZE			1
 
 /* GEM specific NCFGR bitfields. */
-#define GEM_GBE_OFFSET				10
+#define GEM_GBE_OFFSET				10 /* Gigabit mode enable */
 #define GEM_GBE_SIZE				1
-#define GEM_CLK_OFFSET				18
+#define GEM_CLK_OFFSET				18 /* MDC clock division */
 #define GEM_CLK_SIZE				3
-#define GEM_DBW_OFFSET				21
+#define GEM_DBW_OFFSET				21 /* Data bus width */
 #define GEM_DBW_SIZE				2
 #define GEM_RXCOEN_OFFSET			24
 #define GEM_RXCOEN_SIZE				1
 
 /* Constants for data bus width. */
-#define GEM_DBW32				0
-#define GEM_DBW64				1
-#define GEM_DBW128				2
+#define GEM_DBW32				0 /* 32 bit AMBA AHB data bus
+						   * width
+						   */
+#define GEM_DBW64				1 /* 64 bit AMBA AHB data bus
+						   * width
+						   */
+#define GEM_DBW128				2 /* 128 bit AMBA AHB data bus
+						   * width
+						   */
 
 /* Bitfields in DMACFG. */
-#define GEM_FBLDO_OFFSET			0
+#define GEM_FBLDO_OFFSET			0 /* AHB fixed burst length for
+						   * DMA data operations
+						   */
 #define GEM_FBLDO_SIZE				5
-#define GEM_ENDIA_OFFSET			7
+#define GEM_ENDIA_OFFSET			7 /* AHB endian swap mode enable
+						   * for packet data accesses
+						   */
 #define GEM_ENDIA_SIZE				1
-#define GEM_RXBMS_OFFSET			8
+#define GEM_RXBMS_OFFSET			8 /* Receiver packet buffer
+						   * memory size select
+						   */
 #define GEM_RXBMS_SIZE				2
-#define GEM_TXPBMS_OFFSET			10
+#define GEM_TXPBMS_OFFSET			10 /* Transmitter packet buffer
+						    * memory size select
+						    */
 #define GEM_TXPBMS_SIZE				1
-#define GEM_TXCOEN_OFFSET			11
+#define GEM_TXCOEN_OFFSET			11 /* Transmitter IP, TCP and
+						    * UDP checksum generation
+						    * offload enable
+						    */
 #define GEM_TXCOEN_SIZE				1
-#define GEM_RXBS_OFFSET				16
+#define GEM_RXBS_OFFSET				16 /* DMA receive buffer size in
+						    * AHB system memory
+						    */
 #define GEM_RXBS_SIZE				8
-#define GEM_DDRP_OFFSET				24
+#define GEM_DDRP_OFFSET				24 /* disc_when_no_ahb */
 #define GEM_DDRP_SIZE				1
 
 
 /* Bitfields in NSR */
-#define MACB_NSR_LINK_OFFSET			0
+#define MACB_NSR_LINK_OFFSET			0 /* pcs_link_state */
 #define MACB_NSR_LINK_SIZE			1
-#define MACB_MDIO_OFFSET			1
+#define MACB_MDIO_OFFSET			1 /* status of the mdio_in
+						   * pin
+						   */
 #define MACB_MDIO_SIZE				1
-#define MACB_IDLE_OFFSET			2
+#define MACB_IDLE_OFFSET			2 /* The PHY management logic is
+						   * idle (i.e. has completed)
+						   */
 #define MACB_IDLE_SIZE				1
 
 /* Bitfields in TSR */
-#define MACB_UBR_OFFSET				0
+#define MACB_UBR_OFFSET				0 /* Used bit read */
 #define MACB_UBR_SIZE				1
-#define MACB_COL_OFFSET				1
+#define MACB_COL_OFFSET				1 /* Collision occurred */
 #define MACB_COL_SIZE				1
-#define MACB_TSR_RLE_OFFSET			2
+#define MACB_TSR_RLE_OFFSET			2 /* Retry limit exceeded */
 #define MACB_TSR_RLE_SIZE			1
-#define MACB_TGO_OFFSET				3
+#define MACB_TGO_OFFSET				3 /* Transmit go */
 #define MACB_TGO_SIZE				1
-#define MACB_BEX_OFFSET				4
+#define MACB_BEX_OFFSET				4 /* Transmit frame corruption
+						   * due to AHB error
+						   */
 #define MACB_BEX_SIZE				1
 #define MACB_RM9200_BNQ_OFFSET			4 /* AT91RM9200 only */
 #define MACB_RM9200_BNQ_SIZE			1 /* AT91RM9200 only */
-#define MACB_COMP_OFFSET			5
+#define MACB_COMP_OFFSET			5 /* Trnasmit complete */
 #define MACB_COMP_SIZE				1
-#define MACB_UND_OFFSET				6
+#define MACB_UND_OFFSET				6 /* Trnasmit under run */
 #define MACB_UND_SIZE				1
 
 /* Bitfields in RSR */
-#define MACB_BNA_OFFSET				0
+#define MACB_BNA_OFFSET				0 /* Buffer not available */
 #define MACB_BNA_SIZE				1
-#define MACB_REC_OFFSET				1
+#define MACB_REC_OFFSET				1 /* Frame received */
 #define MACB_REC_SIZE				1
-#define MACB_OVR_OFFSET				2
+#define MACB_OVR_OFFSET				2 /* Receive overrun */
 #define MACB_OVR_SIZE				1
 
 /* Bitfields in ISR/IER/IDR/IMR */
-#define MACB_MFD_OFFSET				0
+#define MACB_MFD_OFFSET				0 /* Management frame sent */
 #define MACB_MFD_SIZE				1
-#define MACB_RCOMP_OFFSET			1
+#define MACB_RCOMP_OFFSET			1 /* Receive complete */
 #define MACB_RCOMP_SIZE				1
-#define MACB_RXUBR_OFFSET			2
+#define MACB_RXUBR_OFFSET			2 /* RX used bit read */
 #define MACB_RXUBR_SIZE				1
-#define MACB_TXUBR_OFFSET			3
+#define MACB_TXUBR_OFFSET			3 /* TX used bit read */
 #define MACB_TXUBR_SIZE				1
-#define MACB_ISR_TUND_OFFSET			4
+#define MACB_ISR_TUND_OFFSET			4 /* Enable trnasmit buffer
+						   * under run interrupt
+						   */
 #define MACB_ISR_TUND_SIZE			1
-#define MACB_ISR_RLE_OFFSET			5
+#define MACB_ISR_RLE_OFFSET			5 /* Enable retry limit exceeded
+						   * or late collision interrupt
+						   */
 #define MACB_ISR_RLE_SIZE			1
-#define MACB_TXERR_OFFSET			6
+#define MACB_TXERR_OFFSET			6 /* Enable transmit frame
+						   * corruption due to AHB error
+						   * interrupt
+						   */
 #define MACB_TXERR_SIZE				1
-#define MACB_TCOMP_OFFSET			7
+#define MACB_TCOMP_OFFSET			7 /* Enable transmit complete
+						   * interrupt
+						   */
 #define MACB_TCOMP_SIZE				1
-#define MACB_ISR_LINK_OFFSET			9
+#define MACB_ISR_LINK_OFFSET			9 /* Enable link change
+						   * interrupt
+						   */
 #define MACB_ISR_LINK_SIZE			1
-#define MACB_ISR_ROVR_OFFSET			10
+#define MACB_ISR_ROVR_OFFSET			10 /* Enable receive overrun
+						    * interrupt
+						    */
 #define MACB_ISR_ROVR_SIZE			1
-#define MACB_HRESP_OFFSET			11
+#define MACB_HRESP_OFFSET			11 /* Enable hrsep not OK
+						    * interrupt
+						    */
 #define MACB_HRESP_SIZE				1
-#define MACB_PFR_OFFSET				12
+#define MACB_PFR_OFFSET				12 /* Enable pause frame with
+						    * non-zero pause quantum
+						    * interrupt
+						    */
 #define MACB_PFR_SIZE				1
-#define MACB_PTZ_OFFSET				13
+#define MACB_PTZ_OFFSET				13 /* Enable pause time zero
+						    * interrupt
+						    */
 #define MACB_PTZ_SIZE				1
 
 /* Bitfields in MAN */
-#define MACB_DATA_OFFSET			0
+#define MACB_DATA_OFFSET			0 /* data */
 #define MACB_DATA_SIZE				16
-#define MACB_CODE_OFFSET			16
+#define MACB_CODE_OFFSET			16 /* Must be written to 10 */
 #define MACB_CODE_SIZE				2
-#define MACB_REGA_OFFSET			18
+#define MACB_REGA_OFFSET			18 /* Register address */
 #define MACB_REGA_SIZE				5
-#define MACB_PHYA_OFFSET			23
+#define MACB_PHYA_OFFSET			23 /* PHY address */
 #define MACB_PHYA_SIZE				5
-#define MACB_RW_OFFSET				28
+#define MACB_RW_OFFSET				28 /* Operation. 10 is read. 01
+						    * is write.
+						    */
 #define MACB_RW_SIZE				2
-#define MACB_SOF_OFFSET				30
+#define MACB_SOF_OFFSET				30 /* Must be written to 1 for
+						    * Clause 22 operation
+						    */
 #define MACB_SOF_SIZE				2
 
 /* Bitfields in USRIO (AVR32) */
@@ -286,7 +341,7 @@
 /* Bitfields in USRIO (AT91) */
 #define MACB_RMII_OFFSET			0
 #define MACB_RMII_SIZE				1
-#define GEM_RGMII_OFFSET			0	/* GEM gigabit mode */
+#define GEM_RGMII_OFFSET			0 /* GEM gigabit mode */
 #define GEM_RGMII_SIZE				1
 #define MACB_CLKEN_OFFSET			1
 #define MACB_CLKEN_SIZE				1
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH 6/6] openvswitch: Support VXLAN Group Policy extension
From: Jesse Gross @ 2015-01-13 22:15 UTC (permalink / raw)
  To: Thomas Graf
  Cc: David Miller, Stephen Hemminger, Pravin Shelar, Tom Herbert,
	Alexei Starovoitov, dev@openvswitch.org, netdev
In-Reply-To: <20150113010213.GA20387@casper.infradead.org>

On Mon, Jan 12, 2015 at 5:02 PM, Thomas Graf <tgraf@suug.ch> wrote:
> On 01/12/15 at 01:54pm, Jesse Gross wrote:
>> On Mon, Jan 12, 2015 at 4:26 AM, Thomas Graf <tgraf@suug.ch> wrote:
>> > +       if (!is_mask)
>> > +               SW_FLOW_KEY_PUT(match, tun_opts_len, sizeof(opts), false);
>> > +       else
>> > +               SW_FLOW_KEY_PUT(match, tun_opts_len, 0xff, true);
>>
>> Have you thought carefully about how the masking model work as other
>> extensions are potentially added? This was a little tricky with Geneve
>> because I wanted to be able to match on both "no options present" as
>> well as wildcard all options. The other interesting thing is how you
>> serialize them back correctly to userspace, which was the genesis of
>> the TUNNEL_OPTIONS_PRESENT flag.
>>
>> My guess is that this may basically work fine now that there is only
>> one extension present but it is important to think about how it might
>> work with multiple independent extensions in the future. (I haven't
>> thought about it, I'm just asking.)
>
> I currently don't see a reason why adding another extension would be
> a problem. It should work like Geneve options except that the order
> of the options in the flow is given (struct vxlan_opts).
>
> Matching on "no options present" is supported in the datapath by
> via the TUNNEL_VXLAN_OPT flag although there is no way in user space
> to express this intent yet. I haven't come across a need to support it
> yet.
>
> Since the Netlink API is decoupled from the datapath flow
> representation, all of this can be changed if needed without breaking
> the Netlink ABI.

OK, it seems fine for now.

I agree that "not present" is probably less interesting for VXLAN than
Geneve given the fixed sized header. It would seem to only have
benefit in the event that the port configuration is decoupled from
flow processing in userspace.

>> If you set Geneve options and output to a VXLAN port (or vice versa),
>> you will get garbage, right? Is there any way that we can sanity check
>> that?
>
> What about if we only apply tun_info->options on Geneve if
> TUNNEL_GENEVE_OPT is set and vice versa?

That seems nice and simple to me.

^ permalink raw reply

* Re: [PATCH] mISDN: avoid arch specific __builtin_return_address call
From: David Miller @ 2015-01-13 22:08 UTC (permalink / raw)
  To: arnd; +Cc: isdn4linux, netdev, isdn, linux-arm-kernel, linux-kernel
In-Reply-To: <1816278.9Bv8N8K5IB@wuerfel>

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 13 Jan 2015 17:10:58 +0100

> Not all architectures are able to call __builtin_return_address().
> On ARM, the mISDN code produces this warning:
> 
> hardware/mISDN/w6692.c: In function 'w6692_dctrl':
> hardware/mISDN/w6692.c:1181:75: warning: unsupported argument to '__builtin_return_address'
>   pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__,
>                                                                            ^
> hardware/mISDN/mISDNipac.c: In function 'open_dchannel':
> hardware/mISDN/mISDNipac.c:759:75: warning: unsupported argument to '__builtin_return_address'
>   pr_debug("%s: %s dev(%d) open from %p\n", isac->name, __func__,
>                                                                            ^
> 
> In a lot of cases, this is relatively easy to work around by
> passing the value of __builtin_return_address(0) from the
> callers into the functions that want it. One exception is
> the indirect 'open' function call in struct isac_hw. While it
> would be possible to fix this as well, this patch only addresses
> the other callers properly and lets this one return the direct
> parent function, which should be good enough.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied.

^ permalink raw reply

* Re: [PATCH] infiniband: mlx5: avoid a compile-time warning
From: David Miller @ 2015-01-13 22:08 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: eli-VPRAkNaXOzVWk0Htik3J/w, roland-DgEjT+Ai2ygdnm+yROfE0A,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <2267004.49D0qFBpL1@wuerfel>

From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Date: Tue, 13 Jan 2015 17:09:43 +0100

> The return type of find_first_bit() is architecture specific,
> on ARM it is 'unsigned int', while the asm-generic code used
> on x86 and a lot of other architectures returns 'unsigned long'.
> 
> When building the mlx5 driver on ARM, we get a warning about
> this:
> 
> infiniband/hw/mlx5/mem.c: In function 'mlx5_ib_cont_pages':
> infiniband/hw/mlx5/mem.c:84:143: warning: comparison of distinct pointer types lacks a cast
>      m = min(m, find_first_bit(&tmp, sizeof(tmp)));
> 
> This patch changes the driver to use min_t to make it behave
> the same way on all architectures.
> 
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] mlx5: avoid build warnings on 32-bit
From: David Miller @ 2015-01-13 22:08 UTC (permalink / raw)
  To: arnd; +Cc: netdev, eli, linux-rdma
In-Reply-To: <4105686.Jz5UR0277i@wuerfel>

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 13 Jan 2015 17:08:06 +0100

> The mlx5 driver passes a string pointer in through a 'u64' variable,
> which on 32-bit machines causes a build warning:
> 
> drivers/net/ethernet/mellanox/mlx5/core/debugfs.c: In function 'qp_read_field':
> drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:303:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> 
> The code is in fact safe, so we can shut up the warning by adding
> extra type casts.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied.

^ permalink raw reply

* Re: [PATCH] tcp: Fix RFC reference in comment
From: John Heffner @ 2015-01-13 22:01 UTC (permalink / raw)
  To: Banerjee, Debabrata
  Cc: Yuchung Cheng, David Miller, netdev, linux-kernel@vger.kernel.org
In-Reply-To: <D0DAFA79.4435F%dbanerje@akamai.com>

On Tue, Jan 13, 2015 at 4:42 PM, Banerjee, Debabrata
<dbanerje@akamai.com> wrote:
> On 1/13/15, 4:36 PM, "Yuchung Cheng" <ycheng@google.com> wrote:
>
>>On Tue, Jan 13, 2015 at 1:10 PM, Debabrata Banerjee <dbanerje@akamai.com>
>>wrote:
>>>
>>> -/* RFC2861. Reset CWND after idle period longer RTO to "restart
>>>window".
>>> +/* RFC2581 4.1. Reset CWND after idle period longer RTO to "restart
>>>window".
>>>   * This is the first part of cwnd validation mechanism. */
>>>  static void tcp_cwnd_restart(struct sock *sk, const struct dst_entry
>>>*dst)
>>>  {
>>
>>RFC2861 resets the cwnd like in RFC2581, but the rest of the code
>>implements RFC2861. So I think the current comment is fine.
>
>
> No RFC2861 is an experimental RFC that's implemented in
> tcp_cwnd_application_limited(). RFC2861 Recommends reducing the cwnd by
> averaging the current cwnd and the used cwnd as the new cwnd.
>
>
> RFC2581 4.1 Says to set cwnd to initial cwnd if more than one rto has
> passed since the last send. This is what is implemented in the function
> above.

Look at the code a little closer -- it's decaying cwnd based on number
of timeouts as described in 2861, not resetting to IW as recommended
in 2581.

  -John

^ permalink raw reply

* Re: BW regression after "tcp: refine TSO autosizing"
From: Eric Dumazet @ 2015-01-13 22:00 UTC (permalink / raw)
  To: Eyal Perry
  Cc: Or Gerlitz, Linux Netdev List, Amir Vadai, Yevgeny Petrilin,
	Saeed Mahameed, Ido Shamay, Amir Ancel, Eyal Perry
In-Reply-To: <54B590FB.5040805@dev.mellanox.co.il>

On Tue, 2015-01-13 at 23:41 +0200, Eyal Perry wrote:
> On 1/13/2015 22:21 PM, Or Gerlitz wrote:
> > On Tue, Jan 13, 2015 at 8:57 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >> On Tue, 2015-01-13 at 18:48 +0200, Eyal Perry wrote:
> >>> Hello Eric,
> >>> Lately we've observed performance degradation in BW of about 30-40% (depends on
> >>> the setup we use).
> >>> I've bisected the issue down to the this commit: 605ad7f1 ("tcp: refine TSO
> >>> autosizing")
> >>>
> >>> For instance, I was running the following test:
> >>> 1. Bounding net device' irqs to core 0 for both client and server side
> >>> 2. Running netperf with 64K massage size (used the following command)
> >>> $ netperf -H remote -T 1,1 -l 100 -t TCP_STREAM -- -k THROUGHPUT -M 65536 -m 65536
> >>>
> >>> I ran the test on upstream net-next including your patch and than reverted it
> >>> and these are the results I got was improvement from 14.6Gbps to 22.1Gbps.
> >>>
> >>> an additional difference I've noticed when inspecting the ethtool statics,
> >>> number of xmit_more packets increased from 4 to 160 with the reverted kernel.
> >>>
> >>> We are investigating this issue, do you have a hint?
> >> Which driver are you using for this test ?
> > AFAIK, mlx4
> Oops, forgot to mention.
> mlx4 indeed.

Make sure you do not drop packets at receiver.

(Patch might have increased raw speed, and receiver starts dropping
packets because it is not able to sustain line rate on a single flow)

If cwnd is too small, then yes, sending slightly smaller TSO packets can
impact performance, but this is desirable as well.

This is a congestion control problem.


lpaa23:~# nstat >/dev/null; DUMP_TCP_INFO=1 ./netperf -H lpaa24;nstat
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to lpaa24.prod.google.com () port 0 AF_INET
rto=201000 ato=0 pmtu=1500 rcv_ssthresh=29200 rtt=52 rttvar=2 snd_ssthresh=66 cwnd=102 reordering=3 total_retrans=439 ca_state=0
Recv   Send    Send                          
Socket Socket  Message  Elapsed              
Size   Size    Size     Time     Throughput  
bytes  bytes   bytes    secs.    10^6bits/sec  

 87380  16384  16384    10.00    17366.51   
#kernel
IpInReceives                    379010             0.0
IpInDelivers                    379010             0.0
IpOutRequests                   494794             0.0
IcmpInErrors                    1                  0.0
IcmpInTimeExcds                 1                  0.0
IcmpOutErrors                   1                  0.0
IcmpOutTimeExcds                1                  0.0
IcmpMsgInType3                  1                  0.0
IcmpMsgOutType3                 1                  0.0
TcpActiveOpens                  18                 0.0
TcpPassiveOpens                 4                  0.0
TcpAttemptFails                 8                  0.0
TcpEstabResets                  7                  0.0
TcpInSegs                       378992             0.0
TcpOutSegs                      14993053           0.0
TcpRetransSegs                  439                0.0
TcpOutRsts                      28                 0.0
UdpInDatagrams                  16                 0.0
UdpNoPorts                      1                  0.0
UdpOutDatagrams                 17                 0.0
TcpExtTW                        3                  0.0
TcpExtDelayedACKs               1                  0.0
TcpExtTCPPrequeued              1                  0.0
TcpExtTCPHPHits                 14                 0.0
TcpExtTCPPureAcks               301046             0.0
TcpExtTCPHPAcks                 77858              0.0
TcpExtTCPSackRecovery           75                 0.0
TcpExtTCPFastRetrans            439                0.0
TcpExtTCPAbortOnData            7                  0.0
TcpExtTCPSackShifted            17                 0.0
TcpExtTCPSackMerged             57                 0.0
TcpExtTCPSackShiftFallback      234                0.0
TcpExtTCPRcvCoalesce            6                  0.0
TcpExtTCPFastOpenActive         7                  0.0
TcpExtTCPSpuriousRtxHostQueues  2                  0.0
TcpExtTCPAutoCorking            68423              0.0
TcpExtTCPOrigDataSent           14992970           0.0
TcpExtTCPHystartTrainDetect     1                  0.0
TcpExtTCPHystartTrainCwnd       70                 0.0
IpExtInOctets                   19731445           0.0
IpExtOutOctets                  21736126719        0.0
IpExtInNoECTPkts                379010             0.0


You also can see in this sample Hystart ended slow start 
with a very small cwnd of 70

^ permalink raw reply

* Re: [Xen-devel] [PATCH 08/14] xen-netback: use foreign page information from the pages themselves
From: David Miller @ 2015-01-13 21:57 UTC (permalink / raw)
  To: david.vrabel; +Cc: xen-devel, boris.ostrovsky, jennifer.herbert, netdev
In-Reply-To: <54B52F1B.8040408@citrix.com>

From: David Vrabel <david.vrabel@citrix.com>
Date: Tue, 13 Jan 2015 14:43:39 +0000

> On 12/01/15 15:43, David Vrabel wrote:
>> From: Jenny Herbert <jenny.herbert@citrix.com>
>> 
>> Use the foreign page flag in netback to get the domid and grant ref
>> needed for the grant copy.  This signficiantly simplifies the netback
>> code and makes netback work with foreign pages from other backends
>> (e.g., blkback).
>> 
>> This allows blkback to use iSCSI disks provided by domUs running on
>> the same host.
> 
> Dave,
> 
> This depends on several xen changes.  It's been Acked-by: Ian Campbell
> <ian.campbell@citrix.com>
> 
> Are you happy for me to merge this via the xen tree in 3.20?

No objections from me:

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* Re: [PATCH] rocker: fix harmless warning on 32-bit machines
From: David Miller @ 2015-01-13 21:56 UTC (permalink / raw)
  To: arnd; +Cc: netdev, jiri, sfeldma, linux-arm-kernel
In-Reply-To: <4047824.AYNhYQQ6UI@wuerfel>

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 13 Jan 2015 15:23:52 +0100

> The rocker driver tries to assign a pointer to a 64-bit integer
> and then back to a pointer. This is safe on all architectures,
> but causes a compiler warning when pointers are shorter than
> 64-bit:
> 
> rocker/rocker.c: In function 'rocker_desc_cookie_ptr_get':
> rocker/rocker.c:809:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>   return (void *) desc_info->desc->cookie;
>          ^
> 
> This adds another cast to uintptr_t to tell the compiler
> that it's safe.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [net PATCH 1/1] drivers: net: cpsw: fix multicast flush in dual emac mode
From: David Miller @ 2015-01-13 21:54 UTC (permalink / raw)
  To: mugunthanvnm; +Cc: netdev, stable
In-Reply-To: <1421150749-4329-1-git-send-email-mugunthanvnm@ti.com>

From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Tue, 13 Jan 2015 17:35:49 +0530

> Since ALE table is a common resource for both the interfaces in Dual EMAC
> mode and while bringing up the second interface in cpsw_ndo_set_rx_mode()
> all the multicast entries added by the first interface is flushed out and
> only second interface multicast addresses are added. Fixing this by
> flushing multicast addresses based on dual EMAC port vlans which will not
> affect the other emac port multicast addresses.
> 
> Fixes: d9ba8f9 (driver: net: ethernet: cpsw: dual emac interface implementation)
> Cc: <stable@vger.kernel.org> # v3.9+
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] cxgb4: Ripping out old hard-wired initialization code in driver
From: David Miller @ 2015-01-13 21:53 UTC (permalink / raw)
  To: hariprasad; +Cc: netdev, leedom, nirranjan
In-Reply-To: <1421142565-10232-1-git-send-email-hariprasad@chelsio.com>

From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Tue, 13 Jan 2015 15:19:25 +0530

> Removing old hard-wired initialization code in the driver, which is no longer
> used. Also deprecating few module parameters.
> 
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>

Applied.

^ 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