Netdev List
 help / color / mirror / Atom feed
* RE: [PATCH] i40e: don't enable and init FCOE by default when do PF reset
From: Dev, Vasu @ 2015-01-26 22:38 UTC (permalink / raw)
  To: ethan zhao
  Cc: Kirsher, Jeffrey T, Ethan Zhao, Ronciak, John, Brandeburg, Jesse,
	Allan, Bruce W, Wyborny, Carolyn, Skidmore, Donald C,
	Rose, Gregory V, Vick, Matthew, Williams, Mitch A, Parikh, Neerav,
	Linux NICS, e1000-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	brian.maly@oracle.com
In-Reply-To: <54BDB7F3.2020400@oracle.com>

> -----Original Message-----
> From: ethan zhao [mailto:ethan.zhao@oracle.com]
> Sent: Monday, January 19, 2015 6:06 PM
> To: Dev, Vasu
> Cc: Kirsher, Jeffrey T; Ethan Zhao; Ronciak, John; Brandeburg, Jesse; Allan,
> Bruce W; Wyborny, Carolyn; Skidmore, Donald C; Rose, Gregory V; Vick,
> Matthew; Williams, Mitch A; Parikh, Neerav; Linux NICS; e1000-
> devel@lists.sourceforge.net; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; brian.maly@oracle.com
> Subject: Re: [PATCH] i40e: don't enable and init FCOE by default when do PF
> reset
> 
> 
> On 2015/1/20 5:10, Dev, Vasu wrote:
> >> -----Original Message-----
> >> From: ethan zhao [mailto:ethan.zhao@oracle.com]
> >> Sent: Friday, January 16, 2015 7:01 PM
> >> To: Kirsher, Jeffrey T
> >> Cc: Dev, Vasu; Ethan Zhao; Ronciak, John; Brandeburg, Jesse; Allan,
> >> Bruce W; Wyborny, Carolyn; Skidmore, Donald C; Rose, Gregory V; Vick,
> >> Matthew; Williams, Mitch A; Parikh, Neerav; Linux NICS; e1000-
> >> devel@lists.sourceforge.net; netdev@vger.kernel.org; linux-
> >> kernel@vger.kernel.org; brian.maly@oracle.com
> >> Subject: Re: [PATCH] i40e: don't enable and init FCOE by default when
> >> do PF reset
> >>
> >> Vasu,
> >>
> >>     What' your idea about the v2, any suggestion ?  Jeff is looking
> >> forward to see it.
> >>
> > Jeff was asking for v2 in response to your last comment as "disable FCOE as
> default configuration as a temporary step" but I think that is the fix and user
> should n't enable FCoE until they have FCoE enabled X710 FCoE with either
> fabric or VN2VN mode FCoE setup.
>   As a Linux distro, we don't know users have FCoE capable X710 or not, so
> we couldn't disable the FCoE configuration
>   by default in the released kernel except FCoE is officially not supported yet
> with X710, but if yes, fix those bugs I
>   mentioned is the only choice.
> 

Yes must be fixed but I don't see your VLAN issue in my XL710  setup having engineering FW 4.33 with FCoE enabled, I could create VLANs and bring them up or down. 

As for the patch under discussion, it won't help any way whether fcoe enabled or not as I explained before. So I guess my setup differs in XL710 FW version, so upgrading FW should fix the issue and then you could keep FCoE configuration enabled in your distro w/o any concern to XL710 FCoE capable or not in XL710. We can take any FW related further discussion off list.

Thanks,
Vasu

> 
> Thanks,
> Ethan
> 
> 
> >
> > Thanks,
> > Vasu
> >
> >> Thanks,
> >> Ethan
> >>
> >>
> >> On 2015/1/16 22:47, Jeff Kirsher wrote:
> >>> On Fri, 2015-01-16 at 09:48 +0800, ethan zhao wrote:
> >>>> Vasu,
> >>>>
> >>>>       OK, disable FCOE as default configuration as a temporary step
> >>>> to make it  work.
> >>> Sounds like I should expect a v2 coming, correct?
> >>>
> >>>> Thanks,
> >>>> Ethan
> >>>>
> >>>> On 2015/1/16 7:45, Dev, Vasu wrote:
> >>>>>> -----Original Message-----
> >>>>>> From: ethan zhao [mailto:ethan.zhao@oracle.com]
> >>>>>> Sent: Tuesday, January 13, 2015 6:41 PM
> >>>>>> To: Dev, Vasu
> >>>>>> Cc: Ethan Zhao; Ronciak, John; Kirsher, Jeffrey T; Brandeburg,
> >>>>>> Jesse; Allan, Bruce W; Wyborny, Carolyn; Skidmore, Donald C;
> >>>>>> Rose, Gregory V; Vick, Matthew; Williams, Mitch A; Parikh,
> >>>>>> Neerav; Linux NICS; e1000- devel@lists.sourceforge.net;
> >>>>>> netdev@vger.kernel.org;
> >>>>>> linux- kernel@vger.kernel.org; brian.maly@oracle.com
> >>>>>> Subject: Re: [PATCH] i40e: don't enable and init FCOE by default
> >>>>>> when do PF reset
> >>>>>>
> >>>>>> Vasu,
> >>>>>>
> >>>>>> On 2015/1/14 3:38, Dev, Vasu wrote:
> >>>>>>>> -----Original Message-----
> >>>>>>>>>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c
> >>>>>>>>>>> b/drivers/net/ethernet/intel/i40e/i40e_main.c
> >>>>>>>>>>> index a5f2660..a2572cc 100644
> >>>>>>>>>>> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> >>>>>>>>>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> >>>>>>>>>>> @@ -6180,9 +6180,12 @@ static void
> >>>>>>>>>>> i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
> >>>>>>>>>>>         }
> >>>>>>>>>>>      #endif /* CONFIG_I40E_DCB */
> >>>>>>>>>>>      #ifdef I40E_FCOE
> >>>>>>>>>>> -   ret = i40e_init_pf_fcoe(pf);
> >>>>>>>>>>> -   if (ret)
> >>>>>>>>>>> -           dev_info(&pf->pdev->dev, "init_pf_fcoe failed: %d\n",
> ret);
> >>>>>>>>>>> +   if (pf->flags & I40E_FLAG_FCOE_ENABLED) {
> >>>>>>>>>>> +           ret = i40e_init_pf_fcoe(pf);
> >>>>>>>>> Calling i40e_init_pf_fcoe() here conflicts with its
> >>>>>>>> I40E_FLAG_FCOE_ENABLED pre-condition since
> >>>>>> I40E_FLAG_FCOE_ENABLED is
> >>>>>>>> set by very same i40e_init_pf_fcoe(), in turn
> >>>>>>>> i40e_init_pf_fcoe() will never get called.
> >>>>>>>>
> >>>>>>>> I don't think so,  here ,i40e_reset_and_rebuild()  is not the
> >>>>>>>> only and the first place that  i40e_init_pf_fcoe() is called,
> >>>>>>>> see i40e_probe(), that is the first chance.
> >>>>>>>>
> >>>>>>>> i40e_probe()
> >>>>>>>> -->i40e_sw_init()
> >>>>>>>>          -->i40e_init_pf_fcoe()
> >>>>>>>>
> >>>>>>>> And the I40E_FLAG_FCOE_ENABLED is possible be set by
> >>>>>>>> i40e_fcoe_enable() or i40e_fcoe_disable() interface before the
> >>>>>>>> reset action is to be done.
> >>>>>>>>
> >>>>>>> It is set by i40e_init_pf_fcoe() and you are right that the
> >>>>>>> modified call flow
> >>>>>> by your patch won't impact setting of I40E_FLAG_FCOE_ENABLED
> >> anyway
> >>>>>> which could have prevented calling i40e_init_pf_fcoe() as I
> >>>>>> described above, so this is not an issue with the patch.
> >>>>>>>> BTW, the reason I post this patch is that we hit a bug, after
> >>>>>>>> setup vlan, the PF is enabled to FCOE.
> >>>>>>>>
> >>>>>>> Then that BUG would still remain un-fixed and calling
> >>>>>>> i40e_init_pf_fcoe()
> >>>>>> under I40E_FLAG_FCOE_ENABLED  flag really won't affect call flow
> >>>>>> to fix anything. I mean I40E_FLAG_FCOE_ENABLED  condition will be
> >>>>>> true with "pf-
> >>>>>>> hw.func_caps.fcoe == true" and otherwise calling
> >>>>>>> i40e_init_pf_fcoe() simply
> >>>>>> returns back early on after checking "pf->hw.func_caps.fcoe ==
> >>>>>> false", so how that bug is fixed here by added
> >> I40E_FLAG_FCOE_ENABLED  condition ?
> >>>>>> What is the bug ?
> >>>>>>      The func_caps.fcoe is assigned by following call path, under
> >>>>>> our test environment,
> >>>>>>
> >>>>>>      i40e_probe()
> >>>>>>       ->i40e_get_capabilities()
> >>>>>>          ->i40e_aq_discover_capabilities()
> >>>>>>             ->i40e_parse_discover_capabilities()
> >>>>>>
> >>>>>>      Or
> >>>>>>
> >>>>>>      i40e_reset_and_rebuild()
> >>>>>>       ->i40e_get_capabilities()
> >>>>>>         ->i40e_aq_discover_capabilities()
> >>>>>>           ->i40e_parse_discover_capabilities()
> >>>>>>
> >>>>>>      Under our test environment, the "pf->hw.func_caps.fcoe" is
> >>>>>> true. so if
> >>>>>> i40e_reset_and_rebuild() is called for VLAN setup, ethtool
> >>>>>> diagnostic
> >> test.
> >>>>>>      And then i40e_init_pf_fcoe() is to be called,
> >>>>>>
> >>>>>>      While if (!pf->hw.func_caps.fcoe) wouldn't return,
> >>>>>>
> >>>>> I said it would return with "pf->hw.func_caps.fcoe == false" in my
> >>>>> last
> >> response, more details below.
> >>>>>>      So  pf->flags is set to I40E_FLAG_FCOE_ENABLED.
> >>>>>>
> >>>>>>      With my patch,  i40e_init_pf_fcoe() is only called after
> >>>>>> I40E_FLAG_FCOE_ENABLED is set before reset.
> >>>>>>
> >>>>>> Enable FCOE in i40e_probe() or not is another issue.
> >>>>>>
> >>>>> Nope since both cases we should do i40e_init_pf_fcoe() or don't
> >>>>> based
> >> on fcoe cap true or false.
> >>>>> I don't have much to add as I described before with the your patch
> >>>>> that
> >> "calling i40e_init_pf_fcoe() under I40E_FLAG_FCOE_ENABLED  flag
> >> really won't affect call flow to fix anything. I mean
> >> I40E_FLAG_FCOE_ENABLED condition will be true with
> >> "pf->hw.func_caps.fcoe == true" and otherwise calling
> >> i40e_init_pf_fcoe() simply returns back early on after checking "pf-
> >>> hw.func_caps.fcoe == false".
> >>>>> May be I'm missing something, I guess next either go with
> >> CONFIG_I40E_FCOE disable as I suggested before and now it in upstream
> >> kernel or we can have further off list discussion to fix the issue
> >> you are trying to fix with the patch.
> >>>>> Thanks,
> >>>>> Vasu
> >>>>>
> >>>>>> Thanks,
> >>>>>> Ethan
> >>>>>>
> >>>>>>
> >>>>>>>>> Jeff Kirsher should be getting out a patch queued by me which
> >>>>>>>>> adds
> >>>>>>>> I40E_FCoE Kbuild option, in that FCoE is disabled by default
> >>>>>>>> and user could enable FCoE only if needed, that patch would do
> >>>>>>>> same of skipping
> >>>>>>>> i40e_init_pf_fcoe() whether FCoE capability in device enabled
> >>>>>>>> or not in default config.
> >>>>>>>> The following patch will not fix the above issue --
> >>>>>>>> configuration of PF will be changed via reset.
> >>>>>>>> How about the FCOE is configured and disabled by
> >>>>>>>> i40e_fcoe_disable() , then reset happens ?
> >>>>>>>>
> >>>>>>> May be but if the BUG is due to FCoE being enabled then having
> >>>>>>> it disabled
> >>>>>> in config will avoid the bug for non FCoE config option and once
> >>>>>> bug is understood then that has to be fixed for FCoE enabled
> >>>>>> config also as I asked above.
> >>>>>>> Thanks Ethan for detailed response.
> >>>>>>> Vasu
> >>>>>>>
> >>>>>>>>>     From patchwork Wed Oct  2 23:26:08 2013
> >>>>>>>>> Content-Type: text/plain; charset="utf-8"
> >>>>>>>>> MIME-Version: 1.0
> >>>>>>>>> Content-Transfer-Encoding: 7bit
> >>>>>>>>> Subject: [net] i40e: adds FCoE configure option
> >>>>>>>>> Date: Thu, 03 Oct 2013 07:26:08 -0000
> >>>>>>>>> From: Vasu Dev <vasu.dev@intel.com>
> >>>>>>>>> X-Patchwork-Id: 11797
> >>>>>>>>>
> >>>>>>>>> Adds FCoE config option I40E_FCOE, so that FCoE can be enabled
> >>>>>>>>> as needed but otherwise have it disabled by default.
> >>>>>>>>>
> >>>>>>>>> This also eliminate multiple FCoE config checks, instead now
> >>>>>>>>> just one config check for CONFIG_I40E_FCOE.
> >>>>>>>>>
> >>>>>>>>> The I40E FCoE was added with 3.17 kernel and therefore this
> >>>>>>>>> patch shall be applied to stable 3.17 kernel also.
> >>>>>>>>>
> >>>>>>>>> CC: <stable@vger.kernel.org>
> >>>>>>>>> Signed-off-by: Vasu Dev <vasu.dev@intel.com>
> >>>>>>>>> Tested-by: Jim Young <jamesx.m.young@intel.com>
> >>>>>>>>>
> >>>>>>>>> ---
> >>>>>>>>> drivers/net/ethernet/intel/Kconfig           |   11 +++++++++++
> >>>>>>>>>      drivers/net/ethernet/intel/i40e/Makefile     |    2 +-
> >>>>>>>>>      drivers/net/ethernet/intel/i40e/i40e_osdep.h |    4 ++--
> >>>>>>>>>      3 files changed, 14 insertions(+), 3 deletions(-)
> >>>>>>>>>
> >>>>>>>>> diff --git a/drivers/net/ethernet/intel/Kconfig
> >>>>>>>>> b/drivers/net/ethernet/intel/Kconfig
> >>>>>>>>> index 5b8300a..4d61ef5 100644
> >>>>>>>>> --- a/drivers/net/ethernet/intel/Kconfig
> >>>>>>>>> +++ b/drivers/net/ethernet/intel/Kconfig
> >>>>>>>>> @@ -281,6 +281,17 @@ config I40E_DCB
> >>>>>>>>>
> >>>>>>>>>               If unsure, say N.
> >>>>>>>>>
> >>>>>>>>> +config I40E_FCOE
> >>>>>>>>> +       bool "Fibre Channel over Ethernet (FCoE)"
> >>>>>>>>> +       default n
> >>>>>>>>> +       depends on I40E && DCB && FCOE
> >>>>>>>>> +       ---help---
> >>>>>>>>> +         Say Y here if you want to use Fibre Channel over
> >>>>>>>>> +Ethernet
> >> (FCoE)
> >>>>>>>>> +         in the driver. This will create new netdev for exclusive FCoE
> >>>>>>>>> +         use with XL710 FCoE offloads enabled.
> >>>>>>>>> +
> >>>>>>>>> +         If unsure, say N.
> >>>>>>>>> +
> >>>>>>>>>      config I40EVF
> >>>>>>>>>             tristate "Intel(R) XL710 X710 Virtual Function
> >>>>>>>>> Ethernet
> >> support"
> >>>>>>>>>             depends on PCI_MSI diff --git
> >>>>>>>>> a/drivers/net/ethernet/intel/i40e/Makefile
> >>>>>>>>> b/drivers/net/ethernet/intel/i40e/Makefile
> >>>>>>>>> index 4b94ddb..c405819 100644
> >>>>>>>>> --- a/drivers/net/ethernet/intel/i40e/Makefile
> >>>>>>>>> +++ b/drivers/net/ethernet/intel/i40e/Makefile
> >>>>>>>>> @@ -44,4 +44,4 @@ i40e-objs := i40e_main.o \
> >>>>>>>>>             i40e_virtchnl_pf.o
> >>>>>>>>>
> >>>>>>>>>      i40e-$(CONFIG_I40E_DCB) += i40e_dcb.o i40e_dcb_nl.o
> >>>>>>>>> -i40e-$(CONFIG_FCOE:m=y) += i40e_fcoe.o
> >>>>>>>>> +i40e-$(CONFIG_I40E_FCOE) += i40e_fcoe.o
> >>>>>>>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_osdep.h
> >>>>>>>>> b/drivers/net/ethernet/intel/i40e/i40e_osdep.h
> >>>>>>>>> index 045b5c4..ad802dd 100644
> >>>>>>>>> --- a/drivers/net/ethernet/intel/i40e/i40e_osdep.h
> >>>>>>>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_osdep.h
> >>>>>>>>> @@ -78,7 +78,7 @@ do {                                                            \
> >>>>>>>>>      } while (0)
> >>>>>>>>>
> >>>>>>>>>      typedef enum i40e_status_code i40e_status; -#if
> >>>>>>>>> defined(CONFIG_FCOE)
> >>>>>>>>> || defined(CONFIG_FCOE_MODULE)
> >>>>>>>>> +#ifdef CONFIG_I40E_FCOE
> >>>>>>>>>      #define I40E_FCOE
> >>>>>>>>> -#endif /* CONFIG_FCOE or CONFIG_FCOE_MODULE */
> >>>>>>>>> +#endif
> >>>>>>>>>      #endif /* _I40E_OSDEP_H_ */
> >>>>>>>>>
> >>>>>>>>>>> +           if (ret)
> >>>>>>>>>>> +                   dev_info(&pf->pdev->dev,
> >>>>>>>>>>> +                            "init_pf_fcoe failed: %d\n", ret);
> >>>>>>>>>>> +   }
> >>>>>>>>>>>
> >>>>>>>>>>>      #endif
> >>>>>>>>>>>         /* do basic switch setup */
> >>>>>>>>>>> --
> >>>>>>>>>>> 1.8.3.1
> >>>>>>>> Thanks,
> >>>>>>>> Ethan


^ permalink raw reply

* Re: [PATCH 1/2] net: mvneta: Fix highmem support in the non-TSO egress path
From: David Miller @ 2015-01-26 22:40 UTC (permalink / raw)
  To: ezequiel.garcia; +Cc: netdev, linux, B38611, fabio.estevam
In-Reply-To: <1421844850-30886-2-git-send-email-ezequiel.garcia@free-electrons.com>

From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Date: Wed, 21 Jan 2015 09:54:09 -0300

> +		if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr)) {
> +
> +			/* The first descriptor is either a TSO header or
> +			 * the linear part of the skb.
> +			 */

This empty line is unnecessary and inapparopriate, please remove it.

^ permalink raw reply

* Re: [PATCH 2/2] net: mv643xx_eth: Fix highmem support in non-TSO egress path
From: David Miller @ 2015-01-26 22:40 UTC (permalink / raw)
  To: ezequiel.garcia; +Cc: netdev, linux, B38611, fabio.estevam
In-Reply-To: <1421844850-30886-3-git-send-email-ezequiel.garcia@free-electrons.com>

From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Date: Wed, 21 Jan 2015 09:54:10 -0300

> +		if (!IS_TSO_HEADER(txq, desc->buf_ptr)) {
> +
> +			/* The first descriptor is either a TSO header or
> +			 * the linear part of the skb.
> +			 */

Similar to the first patch, please remove this empty line.

Thanks.

^ permalink raw reply

* Re: [PATCH 1/2] rhashtable: Introduce rhashtable_walk_*
From: Herbert Xu @ 2015-01-26 22:42 UTC (permalink / raw)
  To: David Miller
  Cc: David.Laight, tgraf, ying.xue, kaber, paulmck, netdev,
	netfilter-devel
In-Reply-To: <20150126.143613.1798698028405169123.davem@davemloft.net>

On Mon, Jan 26, 2015 at 02:36:13PM -0800, David Miller wrote:
>
> I really think the amount of time and effort being put into making
> the walker function properly is excessive.
> 
> Let's just say that if you want to use rhashtable, you have to use a
> linked list, or similar separate mechanism, to have stable walks of
> the entire set of objects.

I definitely agree with that :)

However, I'd really like to get these primitives in first so that
at least I can convert the existing rhashtable walkers over and
get on with implementing rhashtable rehashing which is what I set
out to do.

As otherwise we'd be looking at fixing the existing users (in
particular, nft_hash) properly which might take a lot more time.

If and when we finally fix the existing users we can always remove
these primitives.

FWIW when I first wrote this patch I called it
rhashtable_walk_dangerously, I can readopt that name if you think
that will dissuade people from using it.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH 0/2 net-next] sunvnet: fix null pointer deref and crash recovery
From: Sowmini Varadhan @ 2015-01-26 22:44 UTC (permalink / raw)
  To: David L Stevens; +Cc: David Miller, netdev
In-Reply-To: <54C6A976.4060502@oracle.com>

On (01/26/15 15:54), David L Stevens wrote:
> These patches fix an incorrect ordering in releasing ring data, clear pending
> tx buffers on a reset, and make the sunvnet driver more reliable when remote
> systems crash during active transmits.

Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>

^ permalink raw reply

* Re: [PATCH net-next] sunvnet: improve error handling when a remote crashes
From: Sowmini Varadhan @ 2015-01-26 22:45 UTC (permalink / raw)
  To: David L Stevens; +Cc: David Miller, netdev
In-Reply-To: <54C6A95F.8010602@oracle.com>

On (01/26/15 15:53), David L Stevens wrote:
> 
> I demoted it to a notice and we can change it to a counter when we add
> stats. This way it's clear that it's an unexpected state and it's easy
> to see them when we want them.

fair enough.

--Sowmini

^ permalink raw reply

* Re: [PATCH net-next] cxgb4: Fixes cxgb4_inet6addr_notifier unregister call
From: David Miller @ 2015-01-26 22:46 UTC (permalink / raw)
  To: hariprasad; +Cc: netdev, leedom, anish, nirranjan, praveenm
In-Reply-To: <1421854072-6427-1-git-send-email-hariprasad@chelsio.com>

From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Wed, 21 Jan 2015 20:57:52 +0530

> commit b5a02f503caa0837 ("cxgb4 : Update ipv6 address handling api") introduced
> a regression where unregister cxgb4_inet6addr_notifier wasn't getting called
> during module_exit.
> 
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>

Applied, thanks.

^ permalink raw reply

* [PATCH 1/2] driver core: add device_poll interface
From: Xander Huff @ 2015-01-26 22:46 UTC (permalink / raw)
  To: gregkh, davem, jeff.westfahl
  Cc: netdev, linux-kernel, jaeden.amero, ben.shelton, brad.mouring,
	rich.tollerton

From: Jeff Westfahl <jeff.westfahl@ni.com>

Add the device_poll interface to the driver core. This is a generic
interface that any struct device can take advantage of to dynamically
switch between using interrupts and polling. Many drivers can be easily
modified to take advantage of this feature if desired.

This interface is most likely to be used along with the RT patch. It has
only been used thus far on Ethernet interfaces. Even with the standard
RT change to threaded interrupts for all devices, some RT applications
can be sensitive to even the minimal hardware interrupt that still occurs
with threaded interrupt handlers. The device_poll interface can be used
to completely eliminate all hardware interrupts for a device and the
associated jitter.

This is a standalone feature that should be submitted for review and
possible inclusion in mainline, or maybe in the RT patch.

Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
---
 drivers/base/Kconfig        |   3 +
 drivers/base/Makefile       |   1 +
 drivers/base/poll.c         | 327 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/device_poll.h | 105 ++++++++++++++
 4 files changed, 436 insertions(+)
 create mode 100644 drivers/base/poll.c
 create mode 100644 include/linux/device_poll.h

diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 21cf46f..d23df71 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -174,4 +174,7 @@ config SYS_HYPERVISOR
 
 source "drivers/base/regmap/Kconfig"
 
+config DEVICE_POLL
+	bool
+
 endmenu
diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 99a375a..92ab7f3 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_MODULES)	+= module.o
 endif
 obj-$(CONFIG_SYS_HYPERVISOR) += hypervisor.o
 obj-$(CONFIG_REGMAP)	+= regmap/
+obj-$(CONFIG_DEVICE_POLL) += poll.o
 
 ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
 
diff --git a/drivers/base/poll.c b/drivers/base/poll.c
new file mode 100644
index 0000000..911a296
--- /dev/null
+++ b/drivers/base/poll.c
@@ -0,0 +1,327 @@
+/*
+ * Copyright (C) 2014 National Instruments Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/device_poll.h>
+#include <linux/device.h>
+#include <linux/sysfs.h>
+#include <linux/sched.h>
+#include <linux/stat.h>
+#include <linux/kthread.h>
+#include <linux/delay.h>
+
+/* sysfs attributes */
+
+#define to_ext_attr(x) container_of(x, struct dev_ext_attribute, attr)
+
+/* get sysfs attributes */
+
+ssize_t device_poll_get_interval(struct device *dev,
+				 struct device_attribute *attr, char *buf)
+{
+	struct dev_ext_attribute *ea = to_ext_attr(attr);
+	struct device_poll *device_poll = ea->var;
+
+	return sprintf(buf, "%d\n", device_poll->interval);
+}
+
+static ssize_t device_poll_get_policy(struct device *dev,
+				      struct device_attribute *attr, char *buf)
+{
+	struct dev_ext_attribute *ea = to_ext_attr(attr);
+	struct device_poll *device_poll = ea->var;
+
+	switch (device_poll->policy) {
+	case SCHED_NORMAL:
+		return sprintf(buf, "SCHED_NORMAL (SCHED_OTHER)\n");
+	case SCHED_FIFO:
+		return sprintf(buf, "SCHED_FIFO\n");
+	case SCHED_RR:
+		return sprintf(buf, "SCHED_RR\n");
+	case SCHED_BATCH:
+		return sprintf(buf, "SCHED_BATCH\n");
+	case SCHED_IDLE:
+		return sprintf(buf, "SCHED_IDLE\n");
+	default:
+		return sprintf(buf, "unknown\n");
+	}
+}
+
+static ssize_t device_poll_get_priority(struct device *dev,
+					struct device_attribute *attr,
+					char *buf)
+{
+	struct dev_ext_attribute *ea = to_ext_attr(attr);
+	struct device_poll *device_poll = ea->var;
+
+	return sprintf(buf, "%d\n", device_poll->priority);
+}
+
+/* set sysfs attributes */
+
+static ssize_t device_poll_set_interval(struct device *dev,
+					struct device_attribute *attr,
+					const char *buf, size_t size)
+{
+	struct dev_ext_attribute *ea = to_ext_attr(attr);
+	struct device_poll *device_poll = ea->var;
+	int interval;
+	int ret = 0;
+
+	if (device_poll->use_capability && !capable(device_poll->capability))
+		return -EPERM;
+
+	if (0 > kstrtoint(buf, 0, &interval))
+		return -EINVAL;
+
+	device_poll->ops->lock(device_poll);
+	if (device_poll->interval != interval) {
+		device_poll->interval = interval;
+
+		ret = device_poll->ops->reinit(device_poll);
+	}
+	device_poll->ops->unlock(device_poll);
+
+	if (ret)
+		return ret;
+
+	return size;
+}
+
+static ssize_t device_poll_set_policy(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
+{
+	struct dev_ext_attribute *ea = to_ext_attr(attr);
+	struct device_poll *device_poll = ea->var;
+	char policy_str[16] = { 0 };
+	int policy;
+	struct sched_param param;
+
+	if (device_poll->use_capability && !capable(device_poll->capability))
+		return -EPERM;
+
+	if (1 != sscanf(buf, "%15s", policy_str))
+		return -EINVAL;
+
+	if ((0 == strcmp(policy_str, "SCHED_NORMAL") ||
+	     (0 == strcmp(policy_str, "SCHED_OTHER"))))
+		policy = SCHED_NORMAL;
+	else if (0 == strcmp(policy_str, "SCHED_FIFO"))
+		policy = SCHED_FIFO;
+	else if (0 == strcmp(policy_str, "SCHED_RR"))
+		policy = SCHED_RR;
+	else if (0 == strcmp(policy_str, "SCHED_BATCH"))
+		policy = SCHED_BATCH;
+	else if (0 == strcmp(policy_str, "SCHED_IDLE"))
+		policy = SCHED_IDLE;
+	else
+		return -EINVAL;
+
+	device_poll->ops->lock(device_poll);
+	if (device_poll->policy != policy) {
+		device_poll->policy = policy;
+
+		if (device_poll->task) {
+			param.sched_priority = device_poll->priority;
+			sched_setscheduler(device_poll->task,
+					   device_poll->policy,
+					   &param);
+		}
+	}
+	device_poll->ops->unlock(device_poll);
+
+	return size;
+}
+
+static ssize_t device_poll_set_priority(struct device *dev,
+					struct device_attribute *attr,
+					const char *buf, size_t size)
+{
+	struct dev_ext_attribute *ea = to_ext_attr(attr);
+	struct device_poll *device_poll = ea->var;
+	int priority;
+	struct sched_param param;
+
+	if (device_poll->use_capability && !capable(device_poll->capability))
+		return -EPERM;
+
+	if (0 > kstrtoint(buf, 0, &priority))
+		return -EINVAL;
+
+	device_poll->ops->lock(device_poll);
+	if (device_poll->priority != priority) {
+		device_poll->priority = priority;
+
+		if (device_poll->task) {
+			param.sched_priority = device_poll->priority;
+			sched_setscheduler(device_poll->task,
+					   device_poll->policy,
+					   &param);
+		}
+	}
+	device_poll->ops->unlock(device_poll);
+
+	return size;
+}
+
+/* sysfs attributes */
+
+static const DEVICE_ATTR(interval, S_IWUSR | S_IRUGO,
+			 device_poll_get_interval, device_poll_set_interval);
+
+static const DEVICE_ATTR(policy, S_IWUSR | S_IRUGO,
+			 device_poll_get_policy, device_poll_set_policy);
+
+static const DEVICE_ATTR(priority, S_IWUSR | S_IRUGO,
+			 device_poll_get_priority, device_poll_set_priority);
+
+/* device_poll internal functions */
+
+static int device_poll_thread(void *info)
+{
+	struct device_poll *device_poll = info;
+	int polling_interval;
+	int polling_interval_us;
+	struct sched_param param;
+
+	polling_interval = device_poll->interval;
+
+	/* If we got changed to interrupt mode before the polling thread
+	   started. */
+	if (unlikely(0 >= polling_interval)) {
+		while (!kthread_should_stop())
+			usleep(1);
+		return -EINTR;
+	}
+
+	polling_interval_us = polling_interval * 1000;
+
+	param.sched_priority = device_poll->priority;
+	sched_setscheduler(current, device_poll->policy, &param);
+
+	while (!kthread_should_stop()) {
+		/* Ensure changes to device_poll->enabled made on other CPUs
+		   are seen here. */
+		smp_rmb();
+		if (device_poll->enabled)
+			device_poll->ops->interrupt(device_poll);
+
+		if (20 > polling_interval)
+			usleep_range(polling_interval_us, polling_interval_us);
+		else
+			msleep(polling_interval);
+	}
+
+	return 0;
+}
+
+/* device_poll external functions */
+
+int device_poll_init(struct device_poll *device_poll)
+{
+	int ret;
+
+	if (!device_poll || !device_poll->device || !device_poll->ops)
+		return -EINVAL;
+
+	if (!device_poll->ops->reinit || !device_poll->ops->lock ||
+	    !device_poll->ops->unlock || !device_poll->ops->interrupt)
+		return -EINVAL;
+
+	if (device_poll->use_capability && !cap_valid(device_poll->capability))
+		return -EINVAL;
+
+	device_poll->task = NULL;
+	device_poll->enabled = 0;
+
+	device_poll->interval_attr.attr = dev_attr_interval;
+	device_poll->policy_attr.attr = dev_attr_policy;
+	device_poll->priority_attr.attr = dev_attr_priority;
+
+	device_poll->interval_attr.var = device_poll;
+	device_poll->policy_attr.var = device_poll;
+	device_poll->priority_attr.var = device_poll;
+
+	if (device_poll->use_capability) {
+		device_poll->interval_attr.attr.attr.mode |= S_IWUGO;
+		device_poll->policy_attr.attr.attr.mode |= S_IWUGO;
+		device_poll->priority_attr.attr.attr.mode |= S_IWUGO;
+	}
+
+	sysfs_attr_init(&device_poll->interval_attr.attr.attr);
+	sysfs_attr_init(&device_poll->policy_attr.attr.attr);
+	sysfs_attr_init(&device_poll->priority_attr.attr.attr);
+
+	device_poll->attrs[0] = &device_poll->interval_attr.attr.attr;
+	device_poll->attrs[1] = &device_poll->policy_attr.attr.attr;
+	device_poll->attrs[2] = &device_poll->priority_attr.attr.attr;
+	device_poll->attrs[3] = NULL;
+
+	device_poll->attr_group.name = "device_poll";
+	device_poll->attr_group.attrs = device_poll->attrs;
+
+	ret = sysfs_create_group(&device_poll->device->kobj,
+				 &device_poll->attr_group);
+	if (ret)
+		device_poll_exit(device_poll);
+
+	return ret;
+}
+EXPORT_SYMBOL(device_poll_init);
+
+void device_poll_exit(struct device_poll *device_poll)
+{
+	if (!device_poll || !device_poll->device)
+		return;
+
+	sysfs_remove_group(&device_poll->device->kobj,
+			   &device_poll->attr_group);
+}
+EXPORT_SYMBOL(device_poll_exit);
+
+int device_poll_request_irq(struct device_poll *device_poll)
+{
+	int err;
+
+	if (!device_poll)
+		return -EINVAL;
+
+	/* If interrupts are enabled. */
+	if (device_poll->interval <= 0)
+		return -ERANGE;
+
+	/* Start up the polling thread. */
+	device_poll->task = kthread_run(device_poll_thread,
+					device_poll, "poll/%s",
+					dev_name(device_poll->device));
+	if (IS_ERR(device_poll->task)) {
+		err = PTR_ERR(device_poll->task);
+		device_poll->task = NULL;
+		dev_err(device_poll->device,
+			"Unable to create polling thread: %d\n", err);
+		return err;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL(device_poll_request_irq);
+
+void device_poll_free_irq(struct device_poll *device_poll)
+{
+	if (device_poll_is_active(device_poll)) {
+		kthread_stop(device_poll->task);
+		device_poll->task = NULL;
+	}
+}
+EXPORT_SYMBOL(device_poll_free_irq);
diff --git a/include/linux/device_poll.h b/include/linux/device_poll.h
new file mode 100644
index 0000000..846a3b4
--- /dev/null
+++ b/include/linux/device_poll.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2014 National Instruments Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _LINUX_DEVICE_POLL_H_
+#define _LINUX_DEVICE_POLL_H_
+
+#ifdef CONFIG_DEVICE_POLL
+
+#include <linux/device.h>
+
+struct device_poll;
+
+struct device_poll_ops {
+	/* Reinitialize, if the mode changes. */
+	int (*reinit)(struct device_poll *device_poll);
+
+	/* Lock and unlock, for consistency when changing settings. */
+	void (*lock)(struct device_poll *device_poll);
+	void (*unlock)(struct device_poll *device_poll);
+
+	/* Polled interrupt handler. */
+	void (*interrupt)(struct device_poll *device_poll);
+};
+
+struct device_poll {
+	/* The following must be initialized by the driver before calling
+	   device_poll_init. */
+
+	/* The device for which we're polling. */
+	struct device *device;
+
+	/* Device operations. */
+	struct device_poll_ops *ops;
+
+	/* A capability can be specified to allow non-root users to modify
+	   the sysfs attributes. */
+	bool use_capability;
+	int capability;
+
+	/* Polling interval in milliseconds. A value of 0 or less means
+	   use interrupts. */
+	int interval;
+
+	/* Polling task policy and priority, such as SCHED_FIFO 10. */
+	int policy;
+	int priority;
+
+	/* The following are internal struct members and should not be touched
+	   by drivers. */
+
+	struct task_struct *task;
+	int enabled;
+
+	struct dev_ext_attribute interval_attr;
+	struct dev_ext_attribute policy_attr;
+	struct dev_ext_attribute priority_attr;
+	struct attribute *attrs[4];
+	struct attribute_group attr_group;
+};
+
+int device_poll_init(struct device_poll *device_poll);
+void device_poll_exit(struct device_poll *device_poll);
+
+int device_poll_request_irq(struct device_poll *device_poll);
+void device_poll_free_irq(struct device_poll *device_poll);
+
+static inline int device_poll_is_active(struct device_poll *device_poll)
+{
+	return likely(device_poll) && (device_poll->task != NULL);
+}
+
+static inline void device_poll_enable_irq(struct device_poll *device_poll)
+{
+	if (device_poll_is_active(device_poll)) {
+		device_poll->enabled = 1;
+		/* Ensure changes to device_poll->enabled are seen by the
+		   polling thread. */
+		smp_wmb();
+	}
+}
+
+static inline void device_poll_disable_irq(struct device_poll *device_poll)
+{
+	if (device_poll_is_active(device_poll)) {
+		device_poll->enabled = 0;
+		/* Ensure changes to device_poll->enabled are seen by the
+		   polling thread. */
+		smp_wmb();
+	}
+}
+
+#endif
+
+#endif /* _LINUX_DEVICE_POLL_H_ */
-- 
1.9.1

^ permalink raw reply related

* [PATCH 2/2] net: add device_poll functionality common to all net devices
From: Xander Huff @ 2015-01-26 22:46 UTC (permalink / raw)
  To: gregkh, davem, jeff.westfahl
  Cc: netdev, linux-kernel, jaeden.amero, ben.shelton, brad.mouring,
	rich.tollerton
In-Reply-To: <1422312393-61485-1-git-send-email-xander.huff@ni.com>

From: Jeff Westfahl <jeff.westfahl@ni.com>

The device_poll feature is generic to any device. Most net devices should
be able to use a set of common functionality to implement device_poll, such
as CAP_NET_ADMIN and rtnl_lock. Add this common functionality for all net
devices to use.

This is a standalone feature that should be submitted for review and
possible inclusion in mainline, or maybe in the RT patch.

Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
---
 include/linux/netdev_poll.h | 26 ++++++++++++++++++
 net/Kconfig                 |  3 +++
 net/core/Makefile           |  1 +
 net/core/dev_poll.c         | 64 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 94 insertions(+)
 create mode 100644 include/linux/netdev_poll.h
 create mode 100644 net/core/dev_poll.c

diff --git a/include/linux/netdev_poll.h b/include/linux/netdev_poll.h
new file mode 100644
index 0000000..3785454
--- /dev/null
+++ b/include/linux/netdev_poll.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2014 National Instruments Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _LINUX_NETDEV_POLL_H_
+#define _LINUX_NETDEV_POLL_H_
+
+#ifdef CONFIG_NETDEV_POLL
+
+#include <linux/device_poll.h>
+
+int netdev_poll_init(struct device_poll *device_poll);
+
+#endif
+
+#endif /* _LINUX_NETDEV_POLL_H_ */
diff --git a/net/Kconfig b/net/Kconfig
index a073148..6e6ec69 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -324,5 +324,8 @@ source "net/caif/Kconfig"
 source "net/ceph/Kconfig"
 source "net/nfc/Kconfig"
 
+config NETDEV_POLL
+	bool
+	select DEVICE_POLL
 
 endif   # if NET
diff --git a/net/core/Makefile b/net/core/Makefile
index 0d357b1..4255163 100644
--- a/net/core/Makefile
+++ b/net/core/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_FIB_RULES) += fib_rules.o
 obj-$(CONFIG_TRACEPOINTS) += net-traces.o
 obj-$(CONFIG_NET_DROP_MONITOR) += drop_monitor.o
 obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += timestamping.o
+obj-$(CONFIG_NETDEV_POLL) += dev_poll.o
diff --git a/net/core/dev_poll.c b/net/core/dev_poll.c
new file mode 100644
index 0000000..1f2d455
--- /dev/null
+++ b/net/core/dev_poll.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2014 National Instruments Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/netdev_poll.h>
+#include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
+
+/* netdev_poll internal functions */
+
+static int netdev_poll_reinit(struct device_poll *device_poll)
+{
+	int ret = 0;
+	struct net_device *netdev = to_net_dev(device_poll->device);
+
+	if (netif_running(netdev)) {
+		netdev->netdev_ops->ndo_stop(netdev);
+		ret = netdev->netdev_ops->ndo_open(netdev);
+	}
+
+	return ret;
+}
+
+static void netdev_poll_lock(struct device_poll *device_poll)
+{
+	rtnl_lock();
+}
+
+static void netdev_poll_unlock(struct device_poll *device_poll)
+{
+	rtnl_unlock();
+}
+
+/* netdev_poll external functions */
+
+int netdev_poll_init(struct device_poll *device_poll)
+{
+	if (!device_poll || !device_poll->device || !device_poll->ops)
+		return -EINVAL;
+
+	if (!device_poll->ops->reinit)
+		device_poll->ops->reinit = netdev_poll_reinit;
+	if (!device_poll->ops->lock)
+		device_poll->ops->lock = netdev_poll_lock;
+	if (!device_poll->ops->unlock)
+		device_poll->ops->unlock = netdev_poll_unlock;
+
+	/* Allow changes from any process with CAP_NET_ADMIN. */
+	device_poll->use_capability = 1;
+	device_poll->capability = CAP_NET_ADMIN;
+
+	return device_poll_init(device_poll);
+}
+EXPORT_SYMBOL(netdev_poll_init);
-- 
1.9.1

^ permalink raw reply related

* Re: make allyesconfig i386 build failure with next-20150122 (caused by fb_agm1264k-fl driver)
From: Greg Kroah-Hartman @ 2015-01-26 22:46 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: devel, Stephen Rothwell, isdn, netdev, linux-kernel, linux-next,
	Jim Davis
In-Reply-To: <20150126215959.GA9853@roeck-us.net>

On Mon, Jan 26, 2015 at 01:59:59PM -0800, Guenter Roeck wrote:
> On Thu, Jan 22, 2015 at 12:10:33PM -0700, Jim Davis wrote:
> > make ARCH=i386 allyesconfig fails with
> > 
> > drivers/staging/built-in.o: In function `reset':
> > (.text+0x2ae89d): multiple definition of `reset'
> > drivers/isdn/built-in.o:(.text+0x185dc2): first defined here
> > make[1]: *** [drivers/built-in.o] Error 1
> 
> Culprit:
> 
> commit b2ebd4be6fa1d2329b63531b044f9e25474981cb
> Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Date:   Wed Dec 31 10:11:10 2014 +0100
> 
>     staging: fbtft: add fb_agm1264k-fl driver
> 
> A global function named 'reset' isn't really a good idea.
> 
> Not that the global function with the same name in the isdn code
> is better ;-).

Agreed, the fbtft code is now fixed.  Patches to fix the isdn code would
be gladly accepted as well :)

thanks,

greg k-h

^ permalink raw reply

* RE: [PATCH v2] net: hyperv: else branch not necessary
From: Haiyang Zhang @ 2015-01-26 22:47 UTC (permalink / raw)
  To: Nicholas Mc Guire, KY Srinivasan
  Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
In-Reply-To: <1422209317-18975-1-git-send-email-der.herr@hofr.at>



> -----Original Message-----
> From: Nicholas Mc Guire [mailto:der.herr@hofr.at]
> Sent: Sunday, January 25, 2015 1:09 PM
> To: KY Srinivasan
> Cc: Haiyang Zhang; devel@linuxdriverproject.org; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Nicholas Mc Guire
> Subject: [PATCH v2] net: hyperv: else branch not necessary
> 
> As the if completes with a unconditional goto the else branch
> is not needed here.
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Thank you!

> ---
> 
> v2: added missing subsystem string in subject line - patch unchanged
> 
> All paths of execution that did not exit through the if branch will
> go through the else branch so no need for an explicit else here
> 
> Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y
> CONFIG_HYPERV=m, CONFIG_HYPERV_NET=m
> 
> Patch is against 3.19.0-rc5 -next-20150123
> 
>  drivers/net/hyperv/rndis_filter.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/hyperv/rndis_filter.c
> b/drivers/net/hyperv/rndis_filter.c
> index 7bd8387..efb84a9 100644
> --- a/drivers/net/hyperv/rndis_filter.c
> +++ b/drivers/net/hyperv/rndis_filter.c
> @@ -833,10 +833,10 @@ int rndis_filter_set_packet_filter(struct
> rndis_device *dev, u32 new_filter)
>  		 * send completion for it.
>  		 */
>  		goto exit;
> -	} else {
> -		set_complete = &request->response_msg.msg.set_complete;
> -		status = set_complete->status;
> -	}
> +	}
> +
> +	set_complete = &request->response_msg.msg.set_complete;
> +	status = set_complete->status;
> 
>  cleanup:
>  	if (request)
> --
> 1.7.10.4

^ permalink raw reply

* Re: [PATCH v3] net: mv643xx_eth: Fix highmem support in non-TSO egress path
From: Russell King - ARM Linux @ 2015-01-26 23:11 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: David Miller, netdev, B38611, fabio.estevam, David.Laight
In-Reply-To: <54C3A1F9.1000403@free-electrons.com>

On Sat, Jan 24, 2015 at 10:45:29AM -0300, Ezequiel Garcia wrote:
> Hi all,
> 
> On 01/22/2015 11:33 AM, Ezequiel Garcia wrote:
> > Commit 69ad0dd7af22b61d9e0e68e56b6290121618b0fb
> > Author: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > Date:   Mon May 19 13:59:59 2014 -0300
> > 
> >     net: mv643xx_eth: Use dma_map_single() to map the skb fragments
> > 
> > caused a nasty regression by removing the support for highmem skb
> > fragments. By using page_address() to get the address of a fragment's
> > page, we are assuming a lowmem page. However, such assumption is incorrect,
> > as fragments can be in highmem pages, resulting in very nasty issues.
> > 
> > This commit fixes this by using the skb_frag_dma_map() helper,
> > which takes care of mapping the skb fragment properly. Additionally,
> > the type of mapping is now tracked, so it can be unmapped using
> > dma_unmap_page or dma_unmap_single when appropriate.
> > 
> > This commit also fixes the error path in txq_init() to release the
> > resources properly.
> > 
> > Fixes: 69ad0dd7af22 ("net: mv643xx_eth: Use dma_map_single() to map the skb fragments")
> > Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> Russell, when you have some time, please test this patch. I think it
> solves the regression and it manages to unmap the descriptors properly.

Yes, this seems to work as well, thanks.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply

* Re: [PATCH v2] net: stmmac: add BQL support
From: David Miller @ 2015-01-26 23:22 UTC (permalink / raw)
  To: b.galvani; +Cc: peppe.cavallaro, f.fainelli, dave.taht, netdev, linux-kernel
In-Reply-To: <1421863647-20048-1-git-send-email-b.galvani@gmail.com>

From: Beniamino Galvani <b.galvani@gmail.com>
Date: Wed, 21 Jan 2015 19:07:27 +0100

> Add support for Byte Queue Limits to the STMicro MAC driver.
> 
> Tested on a Amlogic S802 quad Cortex-A9 board, where the use of BQL
> decreases the latency of a high priority ping from ~12ms to ~1ms when
> the 100Mbit link is saturated by 20 TCP streams.
> 
> Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>

Applied.

^ permalink raw reply

* Re: pull-request: can 2015-01-21
From: David Miller @ 2015-01-26 23:24 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, kernel
In-Reply-To: <1421876791-31014-1-git-send-email-mkl@pengutronix.de>

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Wed, 21 Jan 2015 22:46:30 +0100

> this is a pull request for v3.19, net/master, which consists of a single patch.
> 
> Viktor Babrian fixes the issue in the c_can dirver, that the CAN interface
> might continue to send frames after the interface has been shut down.

Pulled, thanks Marc.

^ permalink raw reply

* Re: [PATCH 1/2] rhashtable: Introduce rhashtable_walk_*
From: Herbert Xu @ 2015-01-26 23:31 UTC (permalink / raw)
  To: David Miller
  Cc: David.Laight, tgraf, ying.xue, kaber, paulmck, netdev,
	netfilter-devel
In-Reply-To: <20150126224216.GA30551@gondor.apana.org.au>

On Tue, Jan 27, 2015 at 09:42:16AM +1100, Herbert Xu wrote:
> 
> As otherwise we'd be looking at fixing the existing users (in
> particular, nft_hash) properly which might take a lot more time.

I take that back.  Looks like my walkers would be no good for
netfilter anyway since it wants to do nested walks, meaning no
locks can be taken.

So I think I'll just have to tackle netfilter first in which case
the walk function would be no use anyway since I could just fix
netlink by itself.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: pull-request: can-next 2015-21-01
From: David Miller @ 2015-01-26 23:42 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, kernel
In-Reply-To: <54C02F0B.7030509@pengutronix.de>

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Wed, 21 Jan 2015 23:58:19 +0100

> this is a pull request of 4 patches for net-next/master.
> 
> Andri Yngvason contributes one patch to further consolidate the CAN
> state change handling. The next patch is by kbuild test robot/Fengguang
> Wu which fixes a coccinelle warning in the CAN infrastructure. The two
> last patches are by me, they remove a unused variable from the flexcan
> and at91_can driver.

Pulled, thanks Marc.

^ permalink raw reply

* Re: [PATCH net-next v14 0/5] openvswitch: Introduce 128-bit unique flow identifiers.
From: David Miller @ 2015-01-26 23:46 UTC (permalink / raw)
  To: joestringer-l0M0P4e3n4LQT0dZR+AlfA
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1421887372-56414-1-git-send-email-joestringer-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

From: Joe Stringer <joestringer@nicira.com>
Date: Wed, 21 Jan 2015 16:42:47 -0800

> This series extends the openvswitch datapath interface for flow commands to use
> 128-bit unique identifiers as an alternative to the netlink-formatted flow key.
> This significantly reduces the cost of assembling messages between the kernel
> and userspace, in particular improving Open vSwitch revalidation performance by
> 40% or more.

Series applied, thanks.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

^ permalink raw reply

* Anyone have working cable for Intel 40GB Ethernet NIC?
From: Ben Greear @ 2015-01-27  0:03 UTC (permalink / raw)
  To: netdev

I cannot find info on a direct-attached cable that is known to work..and the
one I bought is not accepted by the driver/NIC.

If anyone knows of a cable that works, please let me know
so I can order one.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply

* Re: [net PATCH v2 1/1] drivers: net: cpsw: discard dual emac default vlan configuration
From: David Miller @ 2015-01-27  0:06 UTC (permalink / raw)
  To: mugunthanvnm; +Cc: netdev, stable
In-Reply-To: <1421920162-13398-1-git-send-email-mugunthanvnm@ti.com>

From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Thu, 22 Jan 2015 15:19:22 +0530

> In Dual EMAC, the default VLANs are used to segregate Rx packets between
> the ports, so adding the same default VLAN to the switch will affect the
> normal packet transfers. So returning error on addition of dual EMAC
> default VLANs.
> 
> Even if EMAC 0 default port VLAN is added to EMAC 1, it will lead to
> break dual EMAC port separations.
> 
> Fixes: d9ba8f9e6298 (driver: net: ethernet: cpsw: dual emac interface implementation)
> Cc: <stable@vger.kernel.org> # v3.9+
> Reported-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net 0/2] Two cls_bpf fixes
From: David Miller @ 2015-01-26 23:50 UTC (permalink / raw)
  To: dborkman; +Cc: jiri, netdev
In-Reply-To: <1421919662-21066-1-git-send-email-dborkman@redhat.com>

From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 22 Jan 2015 10:41:00 +0100

> Found them while doing a review on act_bpf and going over the
> cls_bpf code again. Will also address the first issue in act_bpf
> as it needs to be fixed there, too.

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next 0/2] Minor cls_basic, act_bpf update
From: David Miller @ 2015-01-27  0:09 UTC (permalink / raw)
  To: dborkman; +Cc: jiri, netdev
In-Reply-To: <1421920699-26556-1-git-send-email-dborkman@redhat.com>

From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 22 Jan 2015 10:58:17 +0100

> Daniel Borkmann (2):
>   net: cls_basic: return from walking on match in basic_get
>   net: act_bpf: fix size mismatch on filter preparation

Seires applied, thanks.

^ permalink raw reply

* Re: pull-request: wireless-drivers-next 2015-01-22
From: David Miller @ 2015-01-27  0:12 UTC (permalink / raw)
  To: kvalo-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <87h9vjnic4.fsf-HodKDYzPHsUD5k0oWYwrnHL1okKdlPRT@public.gmane.org>

From: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Date: Thu, 22 Jan 2015 13:52:11 +0200

> now a bigger pull request for net-next. Rafal found a UTF-8 bug in
> patchwork[1] and because of that two commits (d0c102f70aec and
> d0f66df5392a) have his name corrupted:
> 
>     Acked-by: Rafa? Mi?ecki <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> Somehow I failed to spot that when I commited the patches. As rebasing
> public git trees is bad, I thought we can live with these and decided
> not to rebase. But I'll pay close attention to this in the future to
> make sure that it won't happen again. Also we requested an update to
> patchwork.kernel.org, the latest patchwork doesn't seem to have this
> bug.
> 
> Also please note this pull request also adds one DT binding doc, but
> this was reviewed in the device tree list:
> 
>  .../bindings/net/wireless/qcom,ath10k.txt          |   30 +
> 
> Please let me know if you have any issues.

Pulled, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 net 0/4] Fixes for sh_eth #2
From: David Miller @ 2015-01-27  0:13 UTC (permalink / raw)
  To: ben.hutchings
  Cc: netdev, linux-kernel, nobuhiro.iwamatsu.yj, mitsuhiro.kimura.kc,
	hisashi.nakamura.ak, ykaneko0929
In-Reply-To: <1421930284.1222.285.camel@xylophone.i.decadent.org.uk>

From: Ben Hutchings <ben.hutchings@codethink.co.uk>
Date: Thu, 22 Jan 2015 12:38:04 +0000

> I'm continuing review and testing of Ethernet support on the R-Car H2
> chip.  This series fixes more of the issues I've found, but it won't be
> the last set.
> 
> These are not tested on any of the other supported chips.

Series applied, thanks Ben.

^ permalink raw reply

* Re: [PATCH v3] net: mv643xx_eth: Fix highmem support in non-TSO egress path
From: David Miller @ 2015-01-27  0:15 UTC (permalink / raw)
  To: ezequiel.garcia; +Cc: linux, netdev, B38611, fabio.estevam, David.Laight
In-Reply-To: <1421937182-1708-1-git-send-email-ezequiel.garcia@free-electrons.com>

From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Date: Thu, 22 Jan 2015 11:33:02 -0300

> Commit 69ad0dd7af22b61d9e0e68e56b6290121618b0fb
> Author: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> Date:   Mon May 19 13:59:59 2014 -0300
> 
>     net: mv643xx_eth: Use dma_map_single() to map the skb fragments
> 
> caused a nasty regression by removing the support for highmem skb
> fragments. By using page_address() to get the address of a fragment's
> page, we are assuming a lowmem page. However, such assumption is incorrect,
> as fragments can be in highmem pages, resulting in very nasty issues.
> 
> This commit fixes this by using the skb_frag_dma_map() helper,
> which takes care of mapping the skb fragment properly. Additionally,
> the type of mapping is now tracked, so it can be unmapped using
> dma_unmap_page or dma_unmap_single when appropriate.
> 
> This commit also fixes the error path in txq_init() to release the
> resources properly.
> 
> Fixes: 69ad0dd7af22 ("net: mv643xx_eth: Use dma_map_single() to map the skb fragments")
> Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 1/5] PCI: Add defines for max read request sizes
From: Bjorn Helgaas @ 2015-01-27  0:20 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-pci, Matt Porter, Alexandre Bounine, Chris Metcalf,
	Bradley Grove, linux-scsi, Realtek linux nic maintainers, netdev
In-Reply-To: <1422291922-12324-1-git-send-email-zajec5@gmail.com>

On Mon, Jan 26, 2015 at 06:05:22PM +0100, Rafał Miłecki wrote:
> There are few drivers using magic numbers when operating with PCIe
> capabilities and PCI_EXP_DEVCTL_READRQ. Define known values to allow
> cleaning their code a bit.
> 
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

I applied this whole series, with acks from Alexandre and Chris, to
pci/misc for v3.20, thanks!

> ---
>  include/uapi/linux/pci_regs.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> index 4a1d0cc..efe3443 100644
> --- a/include/uapi/linux/pci_regs.h
> +++ b/include/uapi/linux/pci_regs.h
> @@ -451,6 +451,10 @@
>  #define  PCI_EXP_DEVCTL_AUX_PME	0x0400	/* Auxiliary Power PM Enable */
>  #define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
>  #define  PCI_EXP_DEVCTL_READRQ	0x7000	/* Max_Read_Request_Size */
> +#define  PCI_EXP_DEVCTL_READRQ_128B  0x0000 /* 128 Bytes */
> +#define  PCI_EXP_DEVCTL_READRQ_256B  0x1000 /* 256 Bytes */
> +#define  PCI_EXP_DEVCTL_READRQ_512B  0x2000 /* 512 Bytes */
> +#define  PCI_EXP_DEVCTL_READRQ_1024B 0x3000 /* 1024 Bytes */
>  #define  PCI_EXP_DEVCTL_BCR_FLR 0x8000  /* Bridge Configuration Retry / FLR */
>  #define PCI_EXP_DEVSTA		10	/* Device Status */
>  #define  PCI_EXP_DEVSTA_CED	0x0001	/* Correctable Error Detected */
> -- 
> 1.8.4.5
> 

^ 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