Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v2 0/7] net: ethernet: ti: cpsw: support placing CPDMA descriptors into DDR
From: David Miller @ 2017-01-08  1:48 UTC (permalink / raw)
  To: grygorii.strashko
  Cc: netdev, mugunthanvnm, ivan.khoronzhuk, nsekhar, linux-kernel,
	linux-omap
In-Reply-To: <20170106200735.4210-1-grygorii.strashko@ti.com>

From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Fri, 6 Jan 2017 14:07:28 -0600

> This series intended to add support for placing CPDMA descriptors into DDR by
> introducing new module parameter "descs_pool_size" to specify size of descriptor's
> pool. The "descs_pool_size" defines total number of CPDMA
> CPPI descriptors to be used for both ingress/egress packets
> processing. If not specified - the default value 256 will be used
> which will allow to place descriptor's pool into the internal CPPI
> RAM.
> 
> In addition, added ability to re-split CPDMA pool of descriptors between RX and TX
> path via ethtool '-G' command wich will allow to configure and fix number
> of descriptors used by RX and TX path, which, then, will be split between
> RX/TX channels proportionally depending on number of RX/TX channels and
> its weight. 
> 
> This allows significantly to reduce UDP packets drop rate
> for bandwidth >301 Mbits/sec (am57x).  
> 
> Before enabling this feature, the am437x SoC has to be fixed as it's proved
> that it's not working when CPDMA descriptors placed in DDR.
> So, the patch 1 fixes this issue.

Series applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH net] net: Fix inconsistent rtnl_lock usage on dev_get_stats().
From: David Miller @ 2017-01-08  2:03 UTC (permalink / raw)
  To: eric.dumazet; +Cc: michael.chan, netdev
In-Reply-To: <1483733603.9712.38.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 06 Jan 2017 12:13:23 -0800

> Well, there are cases where RTNL is quite contended, but supervisions
> like to get /proc/net/devices or various sysfs attributes
> (netstat_show() can be called very very often
> for /sys/class/net/*/statistics/*) in a reasonable amount of time.
> 
> I fear that such a change will add drifts, when devices are constantly
> added/removed.

It stands to reason that RTNETLINK could use pure RCU locking for
device and stat dumps, and frankly that would make their usage and
overhead superior to poking files over and over.

^ permalink raw reply

* Re: [net-next v1 0/8] netcp: enhancements and minor fixes
From: David Miller @ 2017-01-08  2:04 UTC (permalink / raw)
  To: m-karicheri2
  Cc: arnd, netdev, linux-kernel, mugunthanvnm, linux-omap,
	grygorii.strashko
In-Reply-To: <1483735066-14632-1-git-send-email-m-karicheri2@ti.com>

From: Murali Karicheri <m-karicheri2@ti.com>
Date: Fri, 6 Jan 2017 15:37:38 -0500

> This series is for net-next. This propagates enhancements and minor
> bug fixes from internal version of the driver to keep the upstream
> in sync. Please review and apply if this looks good.
> 
> Tested on all of K2HK/E/L boards with nfs rootfs.
> Test logs below
> K2HK-EVM: http://pastebin.ubuntu.com/23754106/
> k2L-EVM: http://pastebin.ubuntu.com/23754143/
> K2E-EVM: http://pastebin.ubuntu.com/23754159/
> 
> History:
>   v1 - dropped 1/10 amd 2/10 of v0 based on comments from Rob as
>        it needs more work before submission
>   v0 - Initial version

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH net] be2net: fix unicast list filling
From: David Miller @ 2017-01-08  2:27 UTC (permalink / raw)
  To: cera
  Cc: netdev, sathya.perla, ajit.khaparde, sriharsha.basavapatna,
	somnath.kotur
In-Reply-To: <20170106205930.3996-1-cera@cera.cz>

From: Ivan Vecera <cera@cera.cz>
Date: Fri,  6 Jan 2017 21:59:30 +0100

> The adapter->pmac_id[0] item is used for primary MAC address but
> this is not true for adapter->uc_list[0] as is assumed in
> be_set_uc_list(). There are N UC addresses copied first from net_device
> to adapter->uc_list[1..N] and then N UC addresses from
> adapter->uc_list[0..N-1] are sent to HW. So the last UC address is never
> stored into HW and address 00:00:00:00;00:00 (from uc_list[0]) is used
> instead.
> 
> Cc: Sathya Perla <sathya.perla@broadcom.com>
> Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
> Cc: Somnath Kotur <somnath.kotur@broadcom.com>
> Fixes: b717241 be2net: replace polling with sleeping in the FW completion path
> Signed-off-by: Ivan Vecera <cera@cera.cz>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net] tg3: Fix race condition in tg3_get_stats64().
From: David Miller @ 2017-01-08  2:35 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev, wangyufen
In-Reply-To: <1483737533-25059-1-git-send-email-michael.chan@broadcom.com>

From: Michael Chan <michael.chan@broadcom.com>
Date: Fri,  6 Jan 2017 16:18:53 -0500

> The driver's ndo_get_stats64() method is not always called under RTNL.
> So it can race with driver close or ethtool reconfigurations.  Fix the
> race condition by taking tp->lock spinlock in tg3_free_consistent()
> when freeing the tp->hw_stats memory block.  tg3_get_stats64() is
> already taking tp->lock.
> 
> Reported-by: Wang Yufen <wangyufen@huawei.com>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>

Applied, thanks Michael.

^ permalink raw reply

* Re: [PATCH net-next] net: dsa: move HWMON support to its own file
From: David Miller @ 2017-01-08  3:42 UTC (permalink / raw)
  To: vivien.didelot; +Cc: netdev, linux-kernel, kernel, f.fainelli, andrew
In-Reply-To: <20170106214200.15633-1-vivien.didelot@savoirfairelinux.com>

From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Fri,  6 Jan 2017 16:42:00 -0500

> Isolate the HWMON support in DSA in its own file. Currently only the
> legacy DSA code is concerned.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Applied.

^ permalink raw reply

* [PATCH net-next] net: ipv4: remove disable of bottom half in inet_rtm_getroute
From: David Ahern @ 2017-01-08  4:04 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern

Nothing about the route lookup requires bottom half to be disabled.
Remove the local_bh_disable ... local_bh_enable around ip_route_input.
This appears to be a vestige of days gone by as it has been there
since the beginning of git time.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
 net/ipv4/route.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f51823dc998b..7144288371cf 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2631,9 +2631,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
 		skb->protocol	= htons(ETH_P_IP);
 		skb->dev	= dev;
 		skb->mark	= mark;
-		local_bh_disable();
 		err = ip_route_input(skb, dst, src, rtm->rtm_tos, dev);
-		local_bh_enable();
 
 		rt = skb_rtable(skb);
 		if (err == 0 && rt->dst.error)
-- 
2.1.4

^ permalink raw reply related

* Re: [PATCH net-next] net: ipv6: put autoconf routes into per-interface tables
From: David Ahern @ 2017-01-08  4:24 UTC (permalink / raw)
  To: Lorenzo Colitti, netdev
  Cc: zenczykowski, hannes, ek, hideaki.yoshifuji, davem, drosen
In-Reply-To: <20170106153026.24785-1-lorenzo@google.com>

On 1/6/17 8:30 AM, Lorenzo Colitti wrote:
> This patch adds a per-interface sysctl to have the kernel put
> autoconf routes into different tables. This allows each interface
> to have its own routing table if desired.  Choosing the default
> interface, or using different interfaces at the same time on a
> per-socket or per-packet basis) can be done using policy routing
> mechanisms that use as SO_BINDTODEVICE / IPV6_PKTINFO, mark-based
> routing, or UID-based routing to select specific routing tables.

Why not use the VRF capability then? create a VRF and assign the interface to it. End result is the same -- separate tables and the need to use a bind-to-device API to hit those routes.

^ permalink raw reply

* [PATCH net 0/2] net: dsa: bcm_sf2: Couple fixes
From: Florian Fainelli @ 2017-01-08  5:01 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli

Hi David,

Here are a couple of fixes for bcm_sf2, please queue these up for -stable
as well, thank you very much!

Florian Fainelli (2):
  net: dsa: bcm_sf2: Do not clobber b53_switch_ops
  net: dsa: bcm_sf2: Utilize nested MDIO read/write

 drivers/net/dsa/bcm_sf2.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

-- 
2.9.3

^ permalink raw reply

* [PATCH net 1/2] net: dsa: bcm_sf2: Do not clobber b53_switch_ops
From: Florian Fainelli @ 2017-01-08  5:01 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli
In-Reply-To: <20170108050157.16302-1-f.fainelli@gmail.com>

We make the bcm_sf2 driver override ds->ops which points to
b53_switch_ops since b53_switch_alloc() did the assignent. This is all
well and good until a second b53 switch comes in, and ends up using the
bcm_sf2 operations. Make a proper local copy, substitute the ds->ops
pointer and then override the operations.

Fixes: f458995b9ad8 ("net: dsa: bcm_sf2: Utilize core B53 driver when possible")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/bcm_sf2.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 9ec33b51a0ed..2f9f910c0e40 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -982,6 +982,7 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
 	const char *reg_names[BCM_SF2_REGS_NUM] = BCM_SF2_REGS_NAME;
 	struct device_node *dn = pdev->dev.of_node;
 	struct b53_platform_data *pdata;
+	struct dsa_switch_ops *ops;
 	struct bcm_sf2_priv *priv;
 	struct b53_device *dev;
 	struct dsa_switch *ds;
@@ -995,6 +996,10 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
+	ops = devm_kzalloc(&pdev->dev, sizeof(*ops), GFP_KERNEL);
+	if (!ops)
+		return -ENOMEM;
+
 	dev = b53_switch_alloc(&pdev->dev, &bcm_sf2_io_ops, priv);
 	if (!dev)
 		return -ENOMEM;
@@ -1014,6 +1019,8 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
 	ds = dev->ds;
 
 	/* Override the parts that are non-standard wrt. normal b53 devices */
+	memcpy(ops, ds->ops, sizeof(*ops));
+	ds->ops = ops;
 	ds->ops->get_tag_protocol = bcm_sf2_sw_get_tag_protocol;
 	ds->ops->setup = bcm_sf2_sw_setup;
 	ds->ops->get_phy_flags = bcm_sf2_sw_get_phy_flags;
-- 
2.9.3

^ permalink raw reply related

* [PATCH net 2/2] net: dsa: bcm_sf2: Utilize nested MDIO read/write
From: Florian Fainelli @ 2017-01-08  5:01 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli
In-Reply-To: <20170108050157.16302-1-f.fainelli@gmail.com>

We are implementing a MDIO bus which is behind another one, so use the
nested version of the accessors to get lockdep annotations correct.

Fixes: 461cd1b03e32 ("net: dsa: bcm_sf2: Register our slave MDIO bus")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/bcm_sf2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 2f9f910c0e40..2ce7ae97ac91 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -393,7 +393,7 @@ static int bcm_sf2_sw_mdio_read(struct mii_bus *bus, int addr, int regnum)
 	if (addr == BRCM_PSEUDO_PHY_ADDR && priv->indir_phy_mask & BIT(addr))
 		return bcm_sf2_sw_indir_rw(priv, 1, addr, regnum, 0);
 	else
-		return mdiobus_read(priv->master_mii_bus, addr, regnum);
+		return mdiobus_read_nested(priv->master_mii_bus, addr, regnum);
 }
 
 static int bcm_sf2_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
@@ -407,7 +407,7 @@ static int bcm_sf2_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
 	if (addr == BRCM_PSEUDO_PHY_ADDR && priv->indir_phy_mask & BIT(addr))
 		bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
 	else
-		mdiobus_write(priv->master_mii_bus, addr, regnum, val);
+		mdiobus_write_nested(priv->master_mii_bus, addr, regnum, val);
 
 	return 0;
 }
-- 
2.9.3

^ permalink raw reply related

* Re: [for-next 07/10] IB/mlx5: Use blue flame register allocator in mlx5_ib
From: Leon Romanovsky @ 2017-01-08  6:22 UTC (permalink / raw)
  To: David Miller; +Cc: eli, saeedm, dledford, netdev, linux-rdma, eli, matanb
In-Reply-To: <20170106.111131.1775665484264248231.davem@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]

On Fri, Jan 06, 2017 at 11:11:31AM -0500, David Miller wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
> Date: Fri, 6 Jan 2017 08:06:09 +0200
>
> > On Thu, Jan 05, 2017 at 03:07:31PM -0500, David Miller wrote:
> >> From: Eli Cohen <eli@dev.mellanox.co.il>
> >> Date: Thu, 5 Jan 2017 14:03:18 -0600
> >>
> >> > If necessary I can make sure it builds on 32 bits as well.
> >>
> >> Please do.
> >
> > Dave,
> >
> > I'm failing to understand the benefits of building mlx5 on 32 bits, and
> > see only disadvantages:
> >  * It is actual dead code without test coverage.
> >  * It misleads reviewers/customers by seeing code for 32 bits.
> >  * It adds compilation time for 32 bits platforms and "punishes" them
> >    for not relevant for them driver.
> >
> > Why do you call removing all that as a "regression"?
>
> We have this thing called "CONFIG_COMPILE_TEST", it has tons of value,
> perhaps you've seen it before?

Thanks David,
I see your point.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH net-next V2 0/3] net/sched: act_pedit: Use offset relative to conventional network headers
From: Amir Vadai @ 2017-01-08  8:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, jiri, ogerlitz, hadarh
In-Reply-To: <20170106.205109.917848391545129035.davem@davemloft.net>

On Fri, Jan 06, 2017 at 08:51:09PM -0500, David Miller wrote:
> From: Amir Vadai <amir@vadai.me>
> Date: Thu,  5 Jan 2017 11:54:51 +0200
> 
> > Enhancing the UAPI to allow for specifying that would allow the same
> > flows to be set into both SW and HW.
> 
> This is actually not backward compatible.
> 
> When pedit rules are dumped, older tools will not know about the
> type field and therefore will completely misinterpret the rule.
> 
> You must extend this the proper way, which is to add a new attribute
> or something along those lines.  The presense of a new attribute
> is an explicit communication to older tools that somethng they
> might not support and understand is going on.

Sorry, I missed this scenario. Going back to the drawing board.

^ permalink raw reply

* Re: [PATCH net-next 6/7] net/mlx5: E-Switch, Add control for inline mode
From: Jiri Pirko @ 2017-01-08  9:56 UTC (permalink / raw)
  To: Saeed Mahameed; +Cc: David S. Miller, netdev, Or Gerlitz, Roi Dayan
In-Reply-To: <1479733561-26601-7-git-send-email-saeedm@mellanox.com>

Mon, Nov 21, 2016 at 02:06:00PM CET, saeedm@mellanox.com wrote:
>From: Roi Dayan <roid@mellanox.com>
>
>Implement devlink show and set of HW inline-mode.
>The supported modes: none, link, network, transport.
>We currently support one mode for all vports so set is done on all vports.
>When eswitch is first initialized the inline-mode is queried from the FW.
>
>Signed-off-by: Roi Dayan <roid@mellanox.com>
>Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>

Saeed, could you please use get_maintainer script and cc those people
for you submissions? Thanks!

^ permalink raw reply

* [net-next 0/8][pull request] 100GbE Intel Wired LAN Driver Updates 2017-01-08
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane

This series contains updates to fm10k only.

Ngai-Mint changes the driver to use the MAC pointer in the fm10k_mac_info
structure for fm10k_get_host_state_generic().  Fixed a race condition
where the mailbox interrupt request bits can be cleared before being
handled causing certain mailbox messages from the PF to be untreated
and the PF will enter in some inactive state.

Jake removes the typecast of u8 to char, and the extra variable that was
created for the typecast.  Bumps the driver version.  Added back the
receive descriptor timestamp value so that applications built on top
of the IES API can function properly.  Cleaned up the debug statistics
flag, since debug statistics were removed and the flag was missed in
the removal.

Scott limits the DMA sync for CPU to the actual length of the packet,
instead of the entire buffer, since the DMA sync occurs every time a
packet is received.

The following are changes since commit 111427f6eb5a5d9ce22f8a90780ac1c18113091a:
  net: dsa: move HWMON support to its own file
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 100GbE

Jacob Keller (4):
  fm10k: remove extraneous variable definition in fm10k_ethtool.c
  fm10k: bump version number
  fm10k: report the receive timestamp in FM10K_CB(skb)->tstamp
  fm10k: remove FM10K_FLAG_DEBUG_STATS

Ngai-Mint Kwan (3):
  fm10k-shared: use mac-> instead of hw->mac.
  fm10k: request reset when mbx->state changes
  fm10k: do not clear global mailbox interrupt bits

Scott Peterson (1):
  fm10k: Limit dma sync of RX buffers to actual packet size

 drivers/net/ethernet/intel/fm10k/fm10k.h         |  4 +---
 drivers/net/ethernet/intel/fm10k/fm10k_common.c  |  6 +++---
 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 21 +++++++++------------
 drivers/net/ethernet/intel/fm10k/fm10k_main.c    | 12 ++++++++----
 drivers/net/ethernet/intel/fm10k/fm10k_mbx.c     | 10 +++++++---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c     |  6 +++++-
 drivers/net/ethernet/intel/fm10k/fm10k_pf.c      |  4 ----
 7 files changed, 33 insertions(+), 30 deletions(-)

-- 
2.9.3

^ permalink raw reply

* [net-next 3/8] fm10k: request reset when mbx->state changes
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem
  Cc: Ngai-Mint Kwan, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jacob Keller, Jeff Kirsher
In-Reply-To: <20170108101034.119851-1-jeffrey.t.kirsher@intel.com>

From: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>

Multiple IES API resets can cause a race condition where the mailbox
interrupt request bits can be cleared before being handled. This can
leave certain mailbox messages from the PF to be untreated and the PF
will enter in some inactive state. If this situation occurs, the IES API
will initiate a mailbox version reset which, then, trigger a mailbox
state change. Once this mailbox transition occurs (from OPEN to CONNECT
state), a request for reset will be returned.

This ensures that PF will undergo a reset whenever IES API encounters an
unknown global mailbox interrupt event or whenever the IES API
terminates.

Signed-off-by: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_mbx.c | 10 +++++++---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c |  6 +++++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c
index c9dfa65..334088a 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c
@@ -2011,9 +2011,10 @@ static void fm10k_sm_mbx_create_reply(struct fm10k_hw *hw,
  *  function can also be used to respond to an error as the connection
  *  resetting would also be a means of dealing with errors.
  **/
-static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
-				       struct fm10k_mbx_info *mbx)
+static s32 fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
+				      struct fm10k_mbx_info *mbx)
 {
+	s32 err = 0;
 	const enum fm10k_mbx_state state = mbx->state;
 
 	switch (state) {
@@ -2026,6 +2027,7 @@ static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
 	case FM10K_STATE_OPEN:
 		/* flush any incomplete work */
 		fm10k_sm_mbx_connect_reset(mbx);
+		err = FM10K_ERR_RESET_REQUESTED;
 		break;
 	case FM10K_STATE_CONNECT:
 		/* Update remote value to match local value */
@@ -2035,6 +2037,8 @@ static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
 	}
 
 	fm10k_sm_mbx_create_reply(hw, mbx, mbx->tail);
+
+	return err;
 }
 
 /**
@@ -2115,7 +2119,7 @@ static s32 fm10k_sm_mbx_process(struct fm10k_hw *hw,
 
 	switch (FM10K_MSG_HDR_FIELD_GET(mbx->mbx_hdr, SM_VER)) {
 	case 0:
-		fm10k_sm_mbx_process_reset(hw, mbx);
+		err = fm10k_sm_mbx_process_reset(hw, mbx);
 		break;
 	case FM10K_SM_MBX_VERSION:
 		err = fm10k_sm_mbx_process_version_1(hw, mbx);
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index b1a2f84..e372a58 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1144,6 +1144,7 @@ static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data)
 	struct fm10k_hw *hw = &interface->hw;
 	struct fm10k_mbx_info *mbx = &hw->mbx;
 	u32 eicr;
+	s32 err = 0;
 
 	/* unmask any set bits related to this interrupt */
 	eicr = fm10k_read_reg(hw, FM10K_EICR);
@@ -1159,12 +1160,15 @@ static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data)
 
 	/* service mailboxes */
 	if (fm10k_mbx_trylock(interface)) {
-		mbx->ops.process(hw, mbx);
+		err = mbx->ops.process(hw, mbx);
 		/* handle VFLRE events */
 		fm10k_iov_event(interface);
 		fm10k_mbx_unlock(interface);
 	}
 
+	if (err == FM10K_ERR_RESET_REQUESTED)
+		interface->flags |= FM10K_FLAG_RESET_REQUESTED;
+
 	/* if switch toggled state we should reset GLORTs */
 	if (eicr & FM10K_EICR_SWITCHNOTREADY) {
 		/* force link down for at least 4 seconds */
-- 
2.9.3

^ permalink raw reply related

* [net-next 4/8] fm10k: do not clear global mailbox interrupt bits
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem
  Cc: Ngai-Mint Kwan, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jacob Keller, Jeff Kirsher
In-Reply-To: <20170108101034.119851-1-jeffrey.t.kirsher@intel.com>

From: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>

Partially revert commit 5e93cbadd3e9 ("fm10k: Reset mailbox global
interrupts", 2016-06-07)

The register bits related to this commit are now solely being handled by
the IES API. Recent changes in the IES API will allow an automatic
recovery from improper handling of these bits.

Signed-off-by: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
index 23fb319..40ee024 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
@@ -72,10 +72,6 @@ static s32 fm10k_reset_hw_pf(struct fm10k_hw *hw)
 	fm10k_write_flush(hw);
 	udelay(FM10K_RESET_TIMEOUT);
 
-	/* Reset mailbox global interrupts */
-	reg = FM10K_MBX_GLOBAL_REQ_INTERRUPT | FM10K_MBX_GLOBAL_ACK_INTERRUPT;
-	fm10k_write_reg(hw, FM10K_GMBX, reg);
-
 	/* Verify we made it out of reset */
 	reg = fm10k_read_reg(hw, FM10K_IP);
 	if (!(reg & FM10K_IP_NOTINRESET))
-- 
2.9.3

^ permalink raw reply related

* [net-next 2/8] fm10k: remove extraneous variable definition in fm10k_ethtool.c
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem
  Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher
In-Reply-To: <20170108101034.119851-1-jeffrey.t.kirsher@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

We don't need to typecast a u8 * into a char *, so just remove the extra
variable.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
index 5241e08..0c84fef 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
@@ -148,7 +148,7 @@ enum {
 static const char fm10k_prv_flags[FM10K_PRV_FLAG_LEN][ETH_GSTRING_LEN] = {
 };
 
-static void fm10k_add_stat_strings(char **p, const char *prefix,
+static void fm10k_add_stat_strings(u8 **p, const char *prefix,
 				   const struct fm10k_stats stats[],
 				   const unsigned int size)
 {
@@ -164,32 +164,31 @@ static void fm10k_add_stat_strings(char **p, const char *prefix,
 static void fm10k_get_stat_strings(struct net_device *dev, u8 *data)
 {
 	struct fm10k_intfc *interface = netdev_priv(dev);
-	char *p = (char *)data;
 	unsigned int i;
 
-	fm10k_add_stat_strings(&p, "", fm10k_gstrings_net_stats,
+	fm10k_add_stat_strings(&data, "", fm10k_gstrings_net_stats,
 			       FM10K_NETDEV_STATS_LEN);
 
-	fm10k_add_stat_strings(&p, "", fm10k_gstrings_global_stats,
+	fm10k_add_stat_strings(&data, "", fm10k_gstrings_global_stats,
 			       FM10K_GLOBAL_STATS_LEN);
 
-	fm10k_add_stat_strings(&p, "", fm10k_gstrings_mbx_stats,
+	fm10k_add_stat_strings(&data, "", fm10k_gstrings_mbx_stats,
 			       FM10K_MBX_STATS_LEN);
 
 	if (interface->hw.mac.type != fm10k_mac_vf)
-		fm10k_add_stat_strings(&p, "", fm10k_gstrings_pf_stats,
+		fm10k_add_stat_strings(&data, "", fm10k_gstrings_pf_stats,
 				       FM10K_PF_STATS_LEN);
 
 	for (i = 0; i < interface->hw.mac.max_queues; i++) {
 		char prefix[ETH_GSTRING_LEN];
 
 		snprintf(prefix, ETH_GSTRING_LEN, "tx_queue_%u_", i);
-		fm10k_add_stat_strings(&p, prefix,
+		fm10k_add_stat_strings(&data, prefix,
 				       fm10k_gstrings_queue_stats,
 				       FM10K_QUEUE_STATS_LEN);
 
 		snprintf(prefix, ETH_GSTRING_LEN, "rx_queue_%u_", i);
-		fm10k_add_stat_strings(&p, prefix,
+		fm10k_add_stat_strings(&data, prefix,
 				       fm10k_gstrings_queue_stats,
 				       FM10K_QUEUE_STATS_LEN);
 	}
@@ -198,18 +197,16 @@ static void fm10k_get_stat_strings(struct net_device *dev, u8 *data)
 static void fm10k_get_strings(struct net_device *dev,
 			      u32 stringset, u8 *data)
 {
-	char *p = (char *)data;
-
 	switch (stringset) {
 	case ETH_SS_TEST:
-		memcpy(data, *fm10k_gstrings_test,
+		memcpy(data, fm10k_gstrings_test,
 		       FM10K_TEST_LEN * ETH_GSTRING_LEN);
 		break;
 	case ETH_SS_STATS:
 		fm10k_get_stat_strings(dev, data);
 		break;
 	case ETH_SS_PRIV_FLAGS:
-		memcpy(p, fm10k_prv_flags,
+		memcpy(data, fm10k_prv_flags,
 		       FM10K_PRV_FLAG_LEN * ETH_GSTRING_LEN);
 		break;
 	}
-- 
2.9.3

^ permalink raw reply related

* [net-next 1/8] fm10k-shared: use mac-> instead of hw->mac.
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem
  Cc: Ngai-Mint Kwan, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jacob Keller, Jeff Kirsher
In-Reply-To: <20170108101034.119851-1-jeffrey.t.kirsher@intel.com>

From: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>

Since a pointer "mac" to fm10k_mac_info structure exists, use it to
access the contents of its members.

Signed-off-by: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.c b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
index dd95ac4..62a6ad9 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
@@ -506,7 +506,7 @@ s32 fm10k_get_host_state_generic(struct fm10k_hw *hw, bool *host_ready)
 		goto out;
 
 	/* if we somehow dropped the Tx enable we should reset */
-	if (hw->mac.tx_ready && !(txdctl & FM10K_TXDCTL_ENABLE)) {
+	if (mac->tx_ready && !(txdctl & FM10K_TXDCTL_ENABLE)) {
 		ret_val = FM10K_ERR_RESET_REQUESTED;
 		goto out;
 	}
@@ -523,8 +523,8 @@ s32 fm10k_get_host_state_generic(struct fm10k_hw *hw, bool *host_ready)
 
 	/* interface cannot receive traffic without logical ports */
 	if (mac->dglort_map == FM10K_DGLORTMAP_NONE) {
-		if (hw->mac.ops.request_lport_map)
-			ret_val = hw->mac.ops.request_lport_map(hw);
+		if (mac->ops.request_lport_map)
+			ret_val = mac->ops.request_lport_map(hw);
 
 		goto out;
 	}
-- 
2.9.3

^ permalink raw reply related

* [net-next 5/8] fm10k: bump version number
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem
  Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher
In-Reply-To: <20170108101034.119851-1-jeffrey.t.kirsher@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 5de9378..509514d 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -28,7 +28,7 @@
 
 #include "fm10k.h"
 
-#define DRV_VERSION	"0.21.2-k"
+#define DRV_VERSION	"0.21.7-k"
 #define DRV_SUMMARY	"Intel(R) Ethernet Switch Host Interface Driver"
 const char fm10k_driver_version[] = DRV_VERSION;
 char fm10k_driver_name[] = "fm10k";
-- 
2.9.3

^ permalink raw reply related

* [net-next 7/8] fm10k: report the receive timestamp in FM10K_CB(skb)->tstamp
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem
  Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher
In-Reply-To: <20170108101034.119851-1-jeffrey.t.kirsher@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

This was accidentally removed when we defeatured the full 1588 Clock
support. We need to report the Rx descriptor timestamp value so that
applications built on top of the IES API can function properly.

Additionally, remove the FM10K_FLAG_RX_TS_ENABLED, as it is not used now
that 1588 functionality has been removed.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k.h      | 5 ++---
 drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h
index 4d19e46..75d2c80 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k.h
+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h
@@ -260,9 +260,8 @@ struct fm10k_intfc {
 #define FM10K_FLAG_RESET_REQUESTED		(u32)(BIT(0))
 #define FM10K_FLAG_RSS_FIELD_IPV4_UDP		(u32)(BIT(1))
 #define FM10K_FLAG_RSS_FIELD_IPV6_UDP		(u32)(BIT(2))
-#define FM10K_FLAG_RX_TS_ENABLED		(u32)(BIT(3))
-#define FM10K_FLAG_SWPRI_CONFIG			(u32)(BIT(4))
-#define FM10K_FLAG_DEBUG_STATS			(u32)(BIT(5))
+#define FM10K_FLAG_SWPRI_CONFIG			(u32)(BIT(3))
+#define FM10K_FLAG_DEBUG_STATS			(u32)(BIT(4))
 	int xcast_mode;
 
 	/* Tx fast path data */
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 8f90c6d..5bb233a 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -475,6 +475,8 @@ static unsigned int fm10k_process_skb_fields(struct fm10k_ring *rx_ring,
 
 	fm10k_rx_checksum(rx_ring, rx_desc, skb);
 
+	FM10K_CB(skb)->tstamp = rx_desc->q.timestamp;
+
 	FM10K_CB(skb)->fi.w.vlan = rx_desc->w.vlan;
 
 	skb_record_rx_queue(skb, rx_ring->queue_index);
-- 
2.9.3

^ permalink raw reply related

* [net-next 6/8] fm10k: Limit dma sync of RX buffers to actual packet size
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem
  Cc: Scott Peterson, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jacob Keller, Jeff Kirsher
In-Reply-To: <20170108101034.119851-1-jeffrey.t.kirsher@intel.com>

From: Scott Peterson <scott.d.peterson@intel.com>

On packet RX, we perform a dma sync for cpu before passing the
packet up.  Here we limit that sync to the actual length of the
incoming packet, rather than always syncing the entire buffer.

Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 509514d..8f90c6d 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -251,6 +251,7 @@ static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer,
 /**
  * fm10k_add_rx_frag - Add contents of Rx buffer to sk_buff
  * @rx_buffer: buffer containing page to add
+ * @size: packet size from rx_desc
  * @rx_desc: descriptor containing length of buffer written by hardware
  * @skb: sk_buff to place the data into
  *
@@ -263,12 +264,12 @@ static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer,
  * true if the buffer can be reused by the interface.
  **/
 static bool fm10k_add_rx_frag(struct fm10k_rx_buffer *rx_buffer,
+			      unsigned int size,
 			      union fm10k_rx_desc *rx_desc,
 			      struct sk_buff *skb)
 {
 	struct page *page = rx_buffer->page;
 	unsigned char *va = page_address(page) + rx_buffer->page_offset;
-	unsigned int size = le16_to_cpu(rx_desc->w.length);
 #if (PAGE_SIZE < 8192)
 	unsigned int truesize = FM10K_RX_BUFSZ;
 #else
@@ -314,6 +315,7 @@ static struct sk_buff *fm10k_fetch_rx_buffer(struct fm10k_ring *rx_ring,
 					     union fm10k_rx_desc *rx_desc,
 					     struct sk_buff *skb)
 {
+	unsigned int size = le16_to_cpu(rx_desc->w.length);
 	struct fm10k_rx_buffer *rx_buffer;
 	struct page *page;
 
@@ -350,11 +352,11 @@ static struct sk_buff *fm10k_fetch_rx_buffer(struct fm10k_ring *rx_ring,
 	dma_sync_single_range_for_cpu(rx_ring->dev,
 				      rx_buffer->dma,
 				      rx_buffer->page_offset,
-				      FM10K_RX_BUFSZ,
+				      size,
 				      DMA_FROM_DEVICE);
 
 	/* pull page into skb */
-	if (fm10k_add_rx_frag(rx_buffer, rx_desc, skb)) {
+	if (fm10k_add_rx_frag(rx_buffer, size, rx_desc, skb)) {
 		/* hand second half of page back to the ring */
 		fm10k_reuse_rx_page(rx_ring, rx_buffer);
 	} else {
-- 
2.9.3

^ permalink raw reply related

* [net-next 8/8] fm10k: remove FM10K_FLAG_DEBUG_STATS
From: Jeff Kirsher @ 2017-01-08 10:10 UTC (permalink / raw)
  To: davem
  Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher
In-Reply-To: <20170108101034.119851-1-jeffrey.t.kirsher@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

The debug statistics were removed due to complications with the ethtool
statistics API which are not possible to resolve without a new
statistics interface. The flag was left behind, but we no longer need
it.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h
index 75d2c80..52b9794 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k.h
+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h
@@ -261,7 +261,6 @@ struct fm10k_intfc {
 #define FM10K_FLAG_RSS_FIELD_IPV4_UDP		(u32)(BIT(1))
 #define FM10K_FLAG_RSS_FIELD_IPV6_UDP		(u32)(BIT(2))
 #define FM10K_FLAG_SWPRI_CONFIG			(u32)(BIT(3))
-#define FM10K_FLAG_DEBUG_STATS			(u32)(BIT(4))
 	int xcast_mode;
 
 	/* Tx fast path data */
-- 
2.9.3

^ permalink raw reply related

* Re: [PATCH net-next 4/7] devlink: Add E-Switch inline mode control
From: Jiri Pirko @ 2017-01-08 10:29 UTC (permalink / raw)
  To: Saeed Mahameed; +Cc: David S. Miller, netdev, Or Gerlitz, Roi Dayan
In-Reply-To: <1479733561-26601-5-git-send-email-saeedm@mellanox.com>

Mon, Nov 21, 2016 at 02:05:58PM CET, saeedm@mellanox.com wrote:
>From: Roi Dayan <roid@mellanox.com>
>
>Some HWs need the VF driver to put part of the packet headers on the
>TX descriptor so the e-switch can do proper matching and steering.

Could you please elaborate a bit about possible use-cases for different
modes? Thanks.


>
>The supported modes: none, link, network, transport.
>
>Signed-off-by: Roi Dayan <roid@mellanox.com>
>Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>

^ permalink raw reply

* [PATCH] net: fix accept4() flags not work
From: yuan linyu @ 2017-01-08 10:47 UTC (permalink / raw)
  To: netdev; +Cc: David S . Miller, yuan linyu

From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

user input flags store to newsock which should be used.

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
---
 net/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/socket.c b/net/socket.c
index a8c2307..415f988 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1508,7 +1508,7 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
 	if (err)
 		goto out_fd;
 
-	err = sock->ops->accept(sock, newsock, sock->file->f_flags);
+	err = sock->ops->accept(sock, newsock, newsock->file->f_flags);
 	if (err < 0)
 		goto out_fd;
 
-- 
2.7.4

^ permalink raw reply related


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