Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] mwifiex: advertise low priority scan feature
From: Wei-Ning Huang @ 2016-03-21  8:09 UTC (permalink / raw)
  To: Linux Wireless
  Cc: LKML, Amitkumar Karwar, Daniel Kurtz, Wei-Ning Huang,
	Nishant Sarmukadam, kvalo-sgV2jX0FEOL9JmXXK+q4OQ,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1458547622-1632-1-git-send-email-wnhuang-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

Tested-by: Wei-Ning Huang <wnhuang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

On Mon, Mar 21, 2016 at 4:07 PM, Wei-Ning Huang <wnhuang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> From: Amitkumar Karwar <akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
>
> Low priority scan handling code which delays or aborts scan
> operation based on Tx traffic is removed recently. The reason
> is firmware already takes care of it in our new feature scan
> channel gap. Hence we should advertise low priority scan
> support to cfg80211.
>
> This patch fixes a problem in which OBSS scan request from
> wpa_supplicant was being rejected by cfg80211.
>
> Signed-off-by: Wei-Ning Huang <wnhuang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/net/wireless/marvell/mwifiex/cfg80211.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> index bb7235e..7dafc5b 100644
> --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> @@ -4086,6 +4086,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
>
>         wiphy->features |= NL80211_FEATURE_HT_IBSS |
>                            NL80211_FEATURE_INACTIVITY_TIMER |
> +                          NL80211_FEATURE_LOW_PRIORITY_SCAN |
>                            NL80211_FEATURE_NEED_OBSS_SCAN;
>
>         if (ISSUPP_TDLS_ENABLED(adapter->fw_cap_info))
> --
> 2.8.0.rc3.226.g39d4020
>



-- 
Wei-Ning Huang, 黃偉寧 | Software Engineer, Google Inc., Taiwan |
wnhuang-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org | Cell: +886 910-380678
--
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

* [PATCH] mwifiex: advertise low priority scan feature
From: Wei-Ning Huang @ 2016-03-21  8:07 UTC (permalink / raw)
  To: Linux Wireless
  Cc: LKML, akarwar, djkurtz, Wei-Ning Huang, nishants, kvalo, netdev

From: Amitkumar Karwar <akarwar@marvell.com>

Low priority scan handling code which delays or aborts scan
operation based on Tx traffic is removed recently. The reason
is firmware already takes care of it in our new feature scan
channel gap. Hence we should advertise low priority scan
support to cfg80211.

This patch fixes a problem in which OBSS scan request from
wpa_supplicant was being rejected by cfg80211.

Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index bb7235e..7dafc5b 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4086,6 +4086,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 
 	wiphy->features |= NL80211_FEATURE_HT_IBSS |
 			   NL80211_FEATURE_INACTIVITY_TIMER |
+			   NL80211_FEATURE_LOW_PRIORITY_SCAN |
 			   NL80211_FEATURE_NEED_OBSS_SCAN;
 
 	if (ISSUPP_TDLS_ENABLED(adapter->fw_cap_info))
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related

* Re: [PATCH net-next] net/mlx4_core: Fix backward compatibility on VFs
From: Alexey Kardashevskiy @ 2016-03-21  5:02 UTC (permalink / raw)
  To: Eli Cohen, davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <56EBCE2F.40902-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org>

On 03/18/2016 08:45 PM, Alexey Kardashevskiy wrote:
> On 03/18/2016 03:49 AM, Eli Cohen wrote:
>> Commit 85743f1eb345 ("net/mlx4_core: Set UAR page size to 4KB regardless
>> of system page size") introduced dependency where old VF drivers without
>> this fix fail to load if the PF driver runs with this commit.
>>
>> To resolve this add a module parameter which disables that functionality
>> by default.  If both the PF and VFs are running with a driver with that
>> commit the administrator may set the module param to true.
>>
>> The module parameter is called enable_4k_uar.
>>
>> Fixes: 85743f1eb345 ('net/mlx4_core: Set UAR page size to 4KB ...')
>> Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Thanks!

After more tries, I found that if for whatever reason mlx4_core fails to 
stop while shutting the guest down (last message is "mlx4_core 
0000:00:00.0: mlx4_shutdown was called"), then next time VF in guest won't 
start.

Example #1:

mlx4_core: Mellanox ConnectX core driver v2.2-1 (Feb, 2014)
mlx4_core: Initializing 0000:00:00.0
mlx4_core 0000:00:00.0: enabling device (0000 -> 0002)
mlx4_core 0000:00:00.0: Detected virtual function - running in slave mode
mlx4_core 0000:00:00.0: Sending reset
mlx4_core 0000:00:00.0: Sending vhcr0
mlx4_core 0000:00:00.0: HCA minimum page size:1
mlx4_core 0000:00:00.0: UAR size:4096 != kernel PAGE_SIZE of 65536
mlx4_core 0000:00:00.0: Failed to obtain slave caps

Example #2:

root@le-dbg:~# dhclient eth0
NETDEV WATCHDOG: eth0 (mlx4_core): transmit queue 11 timed out
------------[ cut here ]------------
WARNING: at /home/aik/p/guest-kernel/net/sched/sch_generic.c:303

and no IP assigned, timed out.


This is fixed by the guest restart, first restart might not help, then the 
second restart will.

The host is running the latest upstream plus the patch I am replying to. 
The guest is using initramdisk from debian bootstrap and vanilla v4.2 
kernel, ppc64le arch, POWER8 chip, QEMU is running with 1 CPU and 2GB of RAM.

Does this look any familiar?



>
>
> Tested-by: Alexey Kardashevskiy <aik-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org>
>
>
>
>
>> ---
>>   drivers/net/ethernet/mellanox/mlx4/main.c | 24 ++++++++++++++++++------
>>   1 file changed, 18 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c
>> b/drivers/net/ethernet/mellanox/mlx4/main.c
>> index 503ec23e84cc..358f7230da58 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
>> @@ -105,6 +105,11 @@ module_param(enable_64b_cqe_eqe, bool, 0444);
>>   MODULE_PARM_DESC(enable_64b_cqe_eqe,
>>            "Enable 64 byte CQEs/EQEs when the FW supports this (default:
>> True)");
>>
>> +static bool enable_4k_uar;
>> +module_param(enable_4k_uar, bool, 0444);
>> +MODULE_PARM_DESC(enable_4k_uar,
>> +         "Enable using 4K UAR. Should not be enabled if have VFs which
>> do not support 4K UARs (default: false)");
>> +
>>   #define PF_CONTEXT_BEHAVIOUR_MASK    (MLX4_FUNC_CAP_64B_EQE_CQE | \
>>                        MLX4_FUNC_CAP_EQE_CQE_STRIDE | \
>>                        MLX4_FUNC_CAP_DMFS_A0_STATIC)
>> @@ -423,7 +428,11 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct
>> mlx4_dev_cap *dev_cap)
>>           /* Virtual PCI function needs to determine UAR page size from
>>            * firmware. Only master PCI function can set the uar page size
>>            */
>> -        dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT;
>> +        if (enable_4k_uar)
>> +            dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT;
>> +        else
>> +            dev->uar_page_shift = PAGE_SHIFT;
>> +
>>           mlx4_set_num_reserved_uars(dev, dev_cap);
>>       }
>>
>> @@ -2233,11 +2242,14 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
>>
>>           dev->caps.max_fmr_maps = (1 << (32 -
>> ilog2(dev->caps.num_mpts))) - 1;
>>
>> -        /* Always set UAR page size 4KB, set log_uar_sz accordingly */
>> -        init_hca.log_uar_sz = ilog2(dev->caps.num_uars) +
>> -                      PAGE_SHIFT -
>> -                      DEFAULT_UAR_PAGE_SHIFT;
>> -        init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12;
>> +        if (enable_4k_uar) {
>> +            init_hca.log_uar_sz = ilog2(dev->caps.num_uars) +
>> +                            PAGE_SHIFT - DEFAULT_UAR_PAGE_SHIFT;
>> +            init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12;
>> +        } else {
>> +            init_hca.log_uar_sz = ilog2(dev->caps.num_uars);
>> +            init_hca.uar_page_sz = PAGE_SHIFT - 12;
>> +        }
>>
>>           init_hca.mw_enabled = 0;
>>           if (dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW ||
>>
>
>


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

^ permalink raw reply

* Re: [RFC PATCH 1/1] net namespace: dynamically configure new net namespace inherit net config
From: zhuyj @ 2016-03-21  2:35 UTC (permalink / raw)
  To: Zhu Yanjun, davem, kuznet, jmorris, yoshfuji, kaber, netdev,
	bruce.ashfield
In-Reply-To: <1457578473-14730-1-git-send-email-yanjun.zhu@windriver.com>

Hi, all

Would you like to give me some advice?

Any reply is appreciated.
Zhu Yanjun

On 03/10/2016 10:54 AM, Zhu Yanjun wrote:
> Sometimes the system engineer and application expect a new net namespace
> to inherit config from the base net config. Sometimes the current net config
> is expected by the system engineer and application. So it is necessary that
> the system engineer and application can choose a new net namespace to inherit
> from the base net config, or the current net config.
>
> For example, the value of /proc/sys/net/ipv4/ip_forward is taken as
> an example. The value of /proc/sys/net/ipv4/ip_forward in the base net
> config is 0 while the value of /proc/sys/net/ipv4/ip_forward is changed
> to 1 in the current net config. The system engineer and application can choose
> a new net namespace to inherit the value of /proc/sys/net/ipv4/ip_forward from
> the base or the current settings.
>
> Test case:
>
> 1. % cat /proc/sys/net/ipv4/net_ns_inherit
>     1
>
> 2. Set ip forwarding in the "base namespace"
>
>     % echo 1 > /proc/sys/net/ipv4/ip_forward
>
>     % cat /proc/sys/net/ipv4/ip_forward
>     1
>
> 3. Create a new namespace
>
>     % ip netns add mynewns
>
> 4. Check ip forwarding in the new namespace
>
>     % ip netns exec mynewns cat /proc/sys/net/ipv4/ip_forward
>     1
>
> 5. % echo 0 > /proc/sys/net/ipv4/net_ns_inherit
>
>     % cat /proc/sys/net/ipv4/net_ns_inherit
>     0
>
> 6. Set ip forwarding in the "base namespace"
>
>     % echo 1 > /proc/sys/net/ipv4/ip_forward
>
>     % cat /proc/sys/net/ipv4/ip_forward
>     1
>
> 7. Create a new namespace
>
>     % ip netns add mynewns_new
>
> 8. Check ip forwarding in the new namespace
>
>     % ip netns exec mynewns_new cat /proc/sys/net/ipv4/ip_forward
>     0
>
> Suggested-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@windriver.com>
> CC: David S. Miller  <davem@davemloft.net>
> CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> CC: James Morris <jmorris@namei.org>
> CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> CC: Patrick McHardy <kaber@trash.net>
>
> ---
>   include/linux/inetdevice.h  |    2 +-
>   include/net/ip.h            |    3 +++
>   include/uapi/linux/sysctl.h |    1 +
>   net/ipv4/devinet.c          |   58 ++++++++++++++++++++++++++++++++++++-------
>   net/ipv4/sysctl_net_ipv4.c  |    7 ++++++
>   5 files changed, 61 insertions(+), 10 deletions(-)
>
> diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
> index ee971f3..1c0ae93 100644
> --- a/include/linux/inetdevice.h
> +++ b/include/linux/inetdevice.h
> @@ -164,7 +164,7 @@ static inline struct net_device *ip_dev_find(struct net *net, __be32 addr)
>   
>   int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
>   int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
> -void devinet_init(void);
> +int devinet_init(void);
>   struct in_device *inetdev_by_index(struct net *, int);
>   __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
>   __be32 inet_confirm_addr(struct net *net, struct in_device *in_dev, __be32 dst,
> diff --git a/include/net/ip.h b/include/net/ip.h
> index 1a98f1c..0ad4a7d 100644
> --- a/include/net/ip.h
> +++ b/include/net/ip.h
> @@ -245,6 +245,9 @@ extern int inet_peer_threshold;
>   extern int inet_peer_minttl;
>   extern int inet_peer_maxttl;
>   
> +/* From devinet.c */
> +extern int net_ns_inherit;
> +
>   /* From ip_input.c */
>   extern int sysctl_ip_early_demux;
>   
> diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
> index 0956373..350c3ce 100644
> --- a/include/uapi/linux/sysctl.h
> +++ b/include/uapi/linux/sysctl.h
> @@ -426,6 +426,7 @@ enum
>   	NET_TCP_ALLOWED_CONG_CONTROL=123,
>   	NET_TCP_MAX_SSTHRESH=124,
>   	NET_TCP_FRTO_RESPONSE=125,
> +	NET_IPV4_NET_NS_INHERIT = 126,
>   };
>   
>   enum {
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index cebd9d3..b68d7fa 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -2277,28 +2277,31 @@ static struct ctl_table ctl_forward_entry[] = {
>   };
>   #endif
>   
> +#define NET_NS_INIT_DEFAULT	0
> +#define NET_NS_INIT_MODIFIED	1
> +
> +/* net ns initialized from current */
> +int net_ns_inherit __read_mostly = NET_NS_INIT_MODIFIED;
> +static struct ipv4_devconf *all_backup, *dflt_backup;
> +
>   static __net_init int devinet_init_net(struct net *net)
>   {
>   	int err;
> -	struct ipv4_devconf *all, *dflt;
> +	struct ipv4_devconf *all = NULL, *dflt = NULL;
>   #ifdef CONFIG_SYSCTL
>   	struct ctl_table *tbl = ctl_forward_entry;
>   	struct ctl_table_header *forw_hdr;
>   #endif
> -
>   	err = -ENOMEM;
> -	all = &ipv4_devconf;
> -	dflt = &ipv4_devconf_dflt;
>   
> -	if (!net_eq(net, &init_net)) {
> -		all = kmemdup(all, sizeof(ipv4_devconf), GFP_KERNEL);
> +	if (net_ns_inherit == NET_NS_INIT_DEFAULT) {
> +		all = kmemdup(all_backup, sizeof(ipv4_devconf), GFP_KERNEL);
>   		if (!all)
>   			goto err_alloc_all;
>   
> -		dflt = kmemdup(dflt, sizeof(ipv4_devconf_dflt), GFP_KERNEL);
> +		dflt = kmemdup(dflt_backup, sizeof(ipv4_devconf_dflt), GFP_KERNEL);
>   		if (!dflt)
>   			goto err_alloc_dflt;
> -
>   #ifdef CONFIG_SYSCTL
>   		tbl = kmemdup(tbl, sizeof(ctl_forward_entry), GFP_KERNEL);
>   		if (!tbl)
> @@ -2309,6 +2312,29 @@ static __net_init int devinet_init_net(struct net *net)
>   		tbl[0].extra2 = net;
>   #endif
>   	}
> +	if (net_ns_inherit == NET_NS_INIT_MODIFIED) {
> +		all = &ipv4_devconf;
> +		dflt = &ipv4_devconf_dflt;
> +
> +		if (!net_eq(net, &init_net)) {
> +			all = kmemdup(all, sizeof(ipv4_devconf), GFP_KERNEL);
> +			if (!all)
> +				goto err_alloc_all;
> +
> +			dflt = kmemdup(dflt, sizeof(ipv4_devconf_dflt), GFP_KERNEL);
> +			if (!dflt)
> +				goto err_alloc_dflt;
> +#ifdef CONFIG_SYSCTL
> +			tbl = kmemdup(tbl, sizeof(ctl_forward_entry), GFP_KERNEL);
> +			if (!tbl)
> +				goto err_alloc_ctl;
> +
> +			tbl[0].data = &all->data[IPV4_DEVCONF_FORWARDING - 1];
> +			tbl[0].extra1 = all;
> +			tbl[0].extra2 = net;
> +#endif
> +		}
> +	}
>   
>   #ifdef CONFIG_SYSCTL
>   	err = __devinet_sysctl_register(net, "all", all);
> @@ -2360,6 +2386,8 @@ static __net_exit void devinet_exit_net(struct net *net)
>   	__devinet_sysctl_unregister(net->ipv4.devconf_all);
>   	kfree(tbl);
>   #endif
> +	kfree(all_backup);
> +	kfree(dflt_backup);
>   	kfree(net->ipv4.devconf_dflt);
>   	kfree(net->ipv4.devconf_all);
>   }
> @@ -2377,10 +2405,20 @@ static struct rtnl_af_ops inet_af_ops __read_mostly = {
>   	.set_link_af	  = inet_set_link_af,
>   };
>   
> -void __init devinet_init(void)
> +int __init devinet_init(void)
>   {
>   	int i;
>   
> +	all_backup = kmemdup(&ipv4_devconf, sizeof(ipv4_devconf), GFP_KERNEL);
> +	if (!all_backup) {
> +		return -ENOBUFS;
> +	}
> +
> +	dflt_backup = kmemdup(&ipv4_devconf_dflt, sizeof(ipv4_devconf_dflt), GFP_KERNEL);
> +	if (!dflt_backup) {
> +		return -ENOBUFS;
> +	}
> +
>   	for (i = 0; i < IN4_ADDR_HSIZE; i++)
>   		INIT_HLIST_HEAD(&inet_addr_lst[i]);
>   
> @@ -2398,4 +2436,6 @@ void __init devinet_init(void)
>   	rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr, NULL);
>   	rtnl_register(PF_INET, RTM_GETNETCONF, inet_netconf_get_devconf,
>   		      inet_netconf_dump_devconf, NULL);
> +
> +	return 0;
>   }
> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> index a0bd7a5..d4a68e3 100644
> --- a/net/ipv4/sysctl_net_ipv4.c
> +++ b/net/ipv4/sysctl_net_ipv4.c
> @@ -799,6 +799,13 @@ static struct ctl_table ipv4_table[] = {
>   		.proc_handler	= proc_dointvec_minmax,
>   		.extra1		= &one
>   	},
> +	{
> +		.procname	= "net_ns_inherit",
> +		.data		= &net_ns_inherit,
> +		.maxlen		= sizeof(int),
> +		.mode		= 0644,
> +		.proc_handler	= proc_dointvec
> +	},
>   	{ }
>   };
>   

^ permalink raw reply

* Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM
From: Guenter Roeck @ 2016-03-20 22:59 UTC (permalink / raw)
  To: Geert Uytterhoeven, Woojung Huh, Microchip Linux Driver Support,
	David S. Miller
  Cc: Rafael J. Wysocki, netdev, linux-usb, linux-pm, linux-kernel
In-Reply-To: <1458470636-18986-1-git-send-email-geert@linux-m68k.org>

On 03/20/2016 03:43 AM, Geert Uytterhoeven wrote:
> If CONFIG_PM=n:
>
>      drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’:
>      drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no member named ‘runtime_auto’
>
> If PM is disabled, the runtime_auto flag is not available, but auto
> suspend is not enabled anyway.  Hence protect the check for runtime_auto
> by #ifdef CONFIG_PM to fix this.
>
> Fixes: a59f8c5b048dc938 ("lan78xx: add ndo_get_stats64")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Alternatively, we can add a dev_pm_runtime_auto_is_enabled() wrapper to
> include/linux/pm.h, which always return false if CONFIG_PM is disabled.
>
> The only other user in non-core code (drivers/usb/core/sysfs.c) has a
> big #ifdef CONFIG_PM check around all PM-related code.
>
> Thoughts?

Not that it matters anymore since David reverted the original patch,
but my reason for not sending a similar patch was that I wasn't sure
if .runtime_auto should be accessed from drivers in the first place,
or if there is some logical problem with the code.

Guenter

> ---
>   drivers/net/usb/lan78xx.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index d36d5ebf37f355f2..7b9ac47b2ecf9905 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -3271,7 +3271,9 @@ struct rtnl_link_stats64 *lan78xx_get_stats64(struct net_device *netdev,
>   	 * periodic reading from HW will prevent from entering USB auto suspend.
>   	 * if autosuspend is disabled, read from HW.
>   	 */
> +#ifdef CONFIG_PM
>   	if (!dev->udev->dev.power.runtime_auto)
> +#endif
>   		lan78xx_update_stats(dev);
>
>   	mutex_lock(&dev->stats.access_lock);
>

^ permalink raw reply

* Re: [PATCH] appletalk: Pass IP-over-DDP packets through when 'ipddp0' interface is not present
From: Adam Seering @ 2016-03-20 21:19 UTC (permalink / raw)
  To: David Miller; +Cc: acme, netdev
In-Reply-To: <1456447597.4577.49.camel@seering.org>

On Thu, 2016-02-25 at 19:46 -0500, Adam Seering wrote:
> On Thu, 2016-02-25 at 14:33 -0500, David Miller wrote:
> > From: Adam Seering <adam@seering.org>
> > Date: Tue, 23 Feb 2016 09:19:13 -0500
> > 
> > > Let userspace programs transmit and receive raw IP-over-DDP
> > > packets
> > > with a kernel where "ipddp" was compiled as a module but is not
> > loaded
> > > (so no "ipddp0" network interface is exposed).  This makes the
> > "module
> > > is not loaded" behavior match the "module was never compiled"
> > behavior.
> > > 
> > > Signed-off-by: Adam Seering <adam@seering.org>
> > 
> > I think a better approache is to somehow autoload the module.
> 
> Could you elaborate?  Specifically: the kernel currently suppresses
> packets on behalf of the module even after the module is unloaded. 
>  How
> would autoloading the module help with that?
> 

I realize and appreciate that I'm not supposed to nag you folks for
feedback.  But I don't know how to proceed.  So, rather than nag you,
I've filed a bug:

https://bugzilla.kernel.org/show_bug.cgi?id=115031

I've tested my patch; I believe it to be the simplest change that
resolves this bug.  I'm happy to write something else if it would be
cleaner and/or help others, but I would need a more-detailed
explanation of what you're looking for.

I've also filed a ticket downstream:  Red Hat appears to not build the
ipddp module with their stock kernel release, so their users don't hit
this bug.  But Ubuntu does build/ship ipddp; if they likewise didn't,
that would also solve my problem:

https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1559772

Adam

^ permalink raw reply

* Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM
From: David Miller @ 2016-03-20 20:52 UTC (permalink / raw)
  To: eric.dumazet
  Cc: geert, woojung.huh, UNGLinuxDriver, linux, rjw, netdev, linux-usb,
	linux-pm, linux-kernel
In-Reply-To: <1458491752.10868.4.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 20 Mar 2016 09:35:52 -0700

> On Sun, 2016-03-20 at 11:43 +0100, Geert Uytterhoeven wrote:
>> If CONFIG_PM=n:
>> 
>>     drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’:
>>     drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no member named ‘runtime_auto’
>> 
>> If PM is disabled, the runtime_auto flag is not available, but auto
>> suspend is not enabled anyway.  Hence protect the check for runtime_auto
>> by #ifdef CONFIG_PM to fix this.
>> 
>> Fixes: a59f8c5b048dc938 ("lan78xx: add ndo_get_stats64")
>> Reported-by: Guenter Roeck <linux@roeck-us.net>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
>> Alternatively, we can add a dev_pm_runtime_auto_is_enabled() wrapper to
>> include/linux/pm.h, which always return false if CONFIG_PM is disabled.
>> 
>> The only other user in non-core code (drivers/usb/core/sysfs.c) has a
>> big #ifdef CONFIG_PM check around all PM-related code.
>> 
>> Thoughts?
>> ---
>>  drivers/net/usb/lan78xx.c | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
>> index d36d5ebf37f355f2..7b9ac47b2ecf9905 100644
>> --- a/drivers/net/usb/lan78xx.c
>> +++ b/drivers/net/usb/lan78xx.c
>> @@ -3271,7 +3271,9 @@ struct rtnl_link_stats64 *lan78xx_get_stats64(struct net_device *netdev,
>>  	 * periodic reading from HW will prevent from entering USB auto suspend.
>>  	 * if autosuspend is disabled, read from HW.
>>  	 */
>> +#ifdef CONFIG_PM
>>  	if (!dev->udev->dev.power.runtime_auto)
>> +#endif
>>  		lan78xx_update_stats(dev);
>>  
>>  	mutex_lock(&dev->stats.access_lock);
> 
> Note that a ndo_get_stat64() handler is not allowed to sleep,
> so the mutex_lock() is not wise...
> 
> Historically /proc/net/dev handler but also bonding ndo_get_stats() used
> RCU or a rwlock or a spinlock.
> 
> So a complete fix would need to get rid of this mutex as well.

This function is also buggy for another reason.  The driver needs to
capture the statistics when the runtime suspend happens.

Since it's much easier to find things wrong rather than right with
this new code, I've decided to completely revert the commit that added
lan78xx_get_stats64().

Once a correct version is implemented we can add it back.

Thanks.

^ permalink raw reply

* Re: [PATCH] net: sched: Add description for cpu_bstats argument
From: David Miller @ 2016-03-20 20:49 UTC (permalink / raw)
  To: luisbg; +Cc: linux-kernel, netdev, edumazet, ast
In-Reply-To: <1458423098-3399-1-git-send-email-luisbg@osg.samsung.com>

From: Luis de Bethencourt <luisbg@osg.samsung.com>
Date: Sat, 19 Mar 2016 21:31:38 +0000

> Commit 22e0f8b9322c ("net: sched: make bstats per cpu and estimator RCU safe")
> added the argument cpu_bstats to functions gen_new_estimator and
> gen_replace_estimator and now the descriptions of these are missing for the
> documentation. Adding them.
> 
> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>

Applied.

^ permalink raw reply

* Re: [PATCH] gen_stats.c: Add description for cpu argument
From: David Miller @ 2016-03-20 20:49 UTC (permalink / raw)
  To: luisbg; +Cc: linux-kernel, netdev
In-Reply-To: <1458422395-895-1-git-send-email-luisbg@osg.samsung.com>

From: Luis de Bethencourt <luisbg@osg.samsung.com>
Date: Sat, 19 Mar 2016 21:19:55 +0000

> Function gnet_stats_copy_basic is missing the description of the cpu
> argument in the documentation. Adding it.
> 
> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>

Applied.

^ permalink raw reply

* Re: [PATCH v7] isdn: Use ktime_t instead of 'struct timeval'
From: David Miller @ 2016-03-20 20:47 UTC (permalink / raw)
  To: ruchandani.tina; +Cc: y2038, netdev, isdn, linux-kernel, arnd
In-Reply-To: <20160319182113.GA2256@tina-laptop>

From: Tina Ruchandani <ruchandani.tina@gmail.com>
Date: Sat, 19 Mar 2016 11:21:14 -0700

> 'struct timeval' uses 32-bit representation for seconds which will
> overflow in year 2038 and beyond. mISDN/clock.c needs to compute and
> store elapsed time in intervals of 125 microseconds. This patch replaces
> the usage of 'struct timeval' with 64-bit ktime_t which is y2038 safe.
> The patch also replaces do_gettimeofday() (wall-clock time) with
> ktime_get() (monotonic time) since we only care about elapsed time here.
> 
> Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
> Suggested-by: Arnd Bergmnann <arnd@arndb.de>
> Suggested-by: David Miller <davem@davemloft.net>

Applied, thank you.
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply

* Re: [PATCH net v2 0/3] Tunneling fixes
From: David Miller @ 2016-03-20 20:33 UTC (permalink / raw)
  To: jesse; +Cc: netdev
In-Reply-To: <1458405122-12565-1-git-send-email-jesse@kernel.org>

From: Jesse Gross <jesse@kernel.org>
Date: Sat, 19 Mar 2016 09:31:59 -0700

> This series fixes a problem that was reported where encapsulated packets
> do not have their encapsulation offload markers stripped off when being
> decapsulated. This causes a significant performance drop if the packets
> are later retransmitted.
> 
> Fixing this revealed two other bugs which are also addressed as prerequisites:
>  * GRO can aggregate packets for multiple layers of encapsulation which the
>    stack cannot properly handle.
>  * IPIP packets which are combined by GRO are not marked properly with their
>    GSO type.
> 
> Note that this is based off the net-next tree as the current target for
> bug fixes.
> 
> v2: No code changes, just additional information in commit messages and
>     a new cover letter.

Applied, thanks for respinning this Jesse.

^ permalink raw reply

* Re: [PATCH net] net: remove a dubious unlikely() clause
From: David Miller @ 2016-03-20 20:32 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, brouer
In-Reply-To: <1458498467.10868.14.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 20 Mar 2016 11:27:47 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> TCP protocol is still used these days, and TCP uses
> clones in its transmit path. We can not optimize linux
> stack assuming it is mostly used in routers, or that TCP
> is dead.
> 
> Fixes: 795bb1c00d ("net: bulk free infrastructure for NAPI context, use napi_consume_skb")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jesper Dangaard Brouer <brouer@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH] net/mlx4: remove unused array zero_gid[]
From: David Miller @ 2016-03-20 20:32 UTC (permalink / raw)
  To: colin.king-Z7WLFzj8eWMS+FvcfC7Uqw
  Cc: yishaih-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1458495896-18074-1-git-send-email-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>

From: Colin King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Date: Sun, 20 Mar 2016 17:44:56 +0000

> From: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> 
> zero_gid is not used, so remove this redundant array.
> 
> Signed-off-by: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>

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

^ permalink raw reply

* Re: [PATCH v2] sctp: align MTU to a word
From: David Miller @ 2016-03-20 20:31 UTC (permalink / raw)
  To: marcelo.leitner; +Cc: netdev, eric.dumazet, nhorman, vyasevich, linux-sctp
In-Reply-To: <1458400640-25448-1-git-send-email-marcelo.leitner@gmail.com>

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Sat, 19 Mar 2016 12:17:20 -0300

> SCTP is a protocol that is aligned to a word (4 bytes). Thus using bare
> MTU can sometimes return values that are not aligned, like for loopback,
> which is 65536 but ipv4_mtu() limits that to 65535. This mis-alignment
> will cause the last non-aligned bytes to never be used and can cause
> issues with congestion control.
> 
> So it's better to just consider a lower MTU and keep congestion control
> calcs saner as they are based on PMTU.
> 
> Same applies to icmp frag needed messages, which is also fixed by this
> patch.
> 
> One other effect of this is the inability to send MTU-sized packet
> without queueing or fragmentation and without hitting Nagle. As the
> check performed at sctp_packet_can_append_data():
> 
> if (chunk->skb->len + q->out_qlen >= transport->pathmtu - packet->overhead)
> 	/* Enough data queued to fill a packet */
> 	return SCTP_XMIT_OK;
> 
> with the above example of MTU, if there are no other messages queued,
> one cannot send a packet that just fits one packet (65532 bytes) and
> without causing DATA chunk fragmentation or a delay.
> 
> v2:
>  - Added WORD_TRUNC macro
> 
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH] sctp: do not update a_rwnd if we are not issuing a sack
From: David Miller @ 2016-03-20 20:31 UTC (permalink / raw)
  To: marcelo.leitner; +Cc: netdev, nhorman, vyasevich, linux-sctp
In-Reply-To: <1458337159-22792-3-git-send-email-marcelo.leitner@gmail.com>

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Fri, 18 Mar 2016 18:39:18 -0300

> The SACK can be lost pretty much elsewhere, but if its allocation fail,
> we know we are not sending it, so it is better to revert a_rwnd to its
> previous value as this may give it a chance to issue a window update
> later.
> 
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH] sctp: do not leak chunks that are sent to unconfirmed paths
From: David Miller @ 2016-03-20 20:31 UTC (permalink / raw)
  To: marcelo.leitner; +Cc: netdev, nhorman, vyasevich, linux-sctp
In-Reply-To: <1458337159-22792-4-git-send-email-marcelo.leitner@gmail.com>

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Fri, 18 Mar 2016 18:39:19 -0300

> Currently, if a chunk is scheduled to be sent through a transport that
> is currently unconfirmed, it will be leaked as it is dequeued from outq
> and is not re-queued nor freed.
> 
> As I'm not aware of any situation that may lead to this situation, I'm
> fixing this by freeing the chunk and also logging a trace so that we can
> fix the other bug if it ever happens.
> 
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Applied.

^ permalink raw reply

* Re: [RFD] workqueue: WQ_MEM_RECLAIM usage in network drivers
From: Tejun Heo @ 2016-03-20 18:55 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Jeff Layton, David S. Miller, Trond Myklebust, Anna Schumaker,
	netdev, linux-kernel, linux-nfs, Amitoj Kaur Chawla, kernel-team,
	Johannes Weiner, Johannes Berg, Eva Rachel Retuya,
	Bhaktipriya Shridhar, linux-wireless
In-Reply-To: <20160318212405.GA5192@fieldses.org>

Hello,

On Fri, Mar 18, 2016 at 05:24:05PM -0400, J. Bruce Fields wrote:
> > But does that actually work?  It's pointless to add WQ_MEM_RECLAIM to
> > workqueues unless all other things are also guaranteed to make forward
> > progress regardless of memory pressure.
> 
> It's supposed to work.
> 
> Also note there was a bunch of work done to allow swap on NFS: see
> a564b8f0 "nfs: enable swap on NFS".

Alright, WQ_MEM_RECLAIM for ethernet devices, then.

> I use NFS mounts over wifi at home.  I may just be odd.  I seem to
> recall some bug reports about suspend vs. NFS--were those also on
> laptops using NFS?
> 
> I wonder if home media centers might do writes over wifi to network
> storage?
> 
> Googling for "nfs wifi" turns up lots of individuals doing this.
> 
> My first impulse is to say that it's probably not perfect but that we
> shouldn't make it worse.

If everything else is working, I'd be happy to throw in WQ_MEM_RECLAIM
but I really don't want to add it if it doesn't actually achieve the
goal.  Can a wireless person chime in here?

Thanks.

-- 
tejun

^ permalink raw reply

* [PATCH net] net: remove a dubious unlikely() clause
From: Eric Dumazet @ 2016-03-20 18:27 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Jesper Dangaard Brouer

From: Eric Dumazet <edumazet@google.com>

TCP protocol is still used these days, and TCP uses
clones in its transmit path. We can not optimize linux
stack assuming it is mostly used in routers, or that TCP
is dead.

Fixes: 795bb1c00d ("net: bulk free infrastructure for NAPI context, use napi_consume_skb")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
---
 net/core/skbuff.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index f044f97..d04c2d1 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -815,7 +815,7 @@ void napi_consume_skb(struct sk_buff *skb, int budget)
 	trace_consume_skb(skb);
 
 	/* if SKB is a clone, don't handle this case */
-	if (unlikely(skb->fclone != SKB_FCLONE_UNAVAILABLE)) {
+	if (skb->fclone != SKB_FCLONE_UNAVAILABLE) {
 		__kfree_skb(skb);
 		return;
 	}

^ permalink raw reply related

* [PATCH] net/mlx4: remove unused array zero_gid[]
From: Colin King @ 2016-03-20 17:44 UTC (permalink / raw)
  To: Yishai Hadas, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>

zero_gid is not used, so remove this redundant array.

Signed-off-by: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
 drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index 42d8de8..6aa7397 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -39,8 +39,6 @@
 
 #include "mlx4.h"
 
-static const u8 zero_gid[16];	/* automatically initialized to 0 */
-
 int mlx4_get_mgm_entry_size(struct mlx4_dev *dev)
 {
 	return 1 << dev->oper_log_mgm_entry_size;
-- 
2.7.3

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

^ permalink raw reply related

* Re: [PATCH net 0/3] flowi6_tos fixes
From: David Miller @ 2016-03-20 17:44 UTC (permalink / raw)
  To: daniel; +Cc: jbenc, linville, jesse, dsa, alexei.starovoitov, netdev
In-Reply-To: <cover.1458320940.git.daniel@iogearbox.net>

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Fri, 18 Mar 2016 18:37:56 +0100

> This set is a follow-up to address Jiri's recent feedback [1] on
> the flowi6_tos issue, that it is not used for IPv6 route lookups.
> The three patches fix all current users of flowi6_tos and remove
> the define to avoid any future confusion on this. Tested the vxlan
> and geneve ones with IPv6 routing rules. For details, please see
> individual patches.
> 
> [ As fixes are currently applied against net-next tree, I've rebased
>   it against that. ]
> 
> Thanks!
> 
>   [1] http://patchwork.ozlabs.org/patch/592055/

Series applied, thanks Daniel.

^ permalink raw reply

* [PATCH] brcmfmac: sdio: remove unused variable retry_limit
From: Colin King @ 2016-03-20 17:34 UTC (permalink / raw)
  To: Brett Rudley, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Pieter-Paul Giesberts, Vineet Gupta, Kosuke Tatsukawa,
	linux-wireless, brcm80211-dev-list, netdev
  Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

retry_limit has never been used during the life of this driver, so
we may as well remove it as it is redundant.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 43fd3f4..cd92ba7 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -535,9 +535,6 @@ static int qcount[NUMPRIO];
 
 #define RETRYCHAN(chan) ((chan) == SDPCM_EVENT_CHANNEL)
 
-/* Retry count for register access failures */
-static const uint retry_limit = 2;
-
 /* Limit on rounding up frames */
 static const uint max_roundup = 512;
 
-- 
2.7.3

^ permalink raw reply related

* Re: [PATCH v1 0/2] basic ioctl support for netlink sockets
From: David Miller @ 2016-03-20 17:31 UTC (permalink / raw)
  To: ddecotig
  Cc: linux-kernel, netdev, nikolay, mst, ben, jeffrey.t.kirsher, decot,
	nicolas.dichtel, andrew, hadarh, ecree, john.r.fastabend, herbert,
	tgraf, daniel, chamaken, fw, dh.herrmann
In-Reply-To: <1458259436-85275-1-git-send-email-ddecotig@gmail.com>

From: David Decotigny <ddecotig@gmail.com>
Date: Thu, 17 Mar 2016 17:03:54 -0700

> This removes the requirement that ethtool be tied to the support
> of a specific L3 protocol, also updates a comment.

You're adding an ioctl handler to netlink sockets, and it is not
at all apparent to me how this influences ethtool handling at all.

Therefore you have to explain this here and in your commit message.

^ permalink raw reply

* Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM
From: Eric Dumazet @ 2016-03-20 16:35 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Woojung Huh, Microchip Linux Driver Support, David S. Miller,
	Guenter Roeck, Rafael J. Wysocki, netdev, linux-usb, linux-pm,
	linux-kernel
In-Reply-To: <1458470636-18986-1-git-send-email-geert@linux-m68k.org>

On Sun, 2016-03-20 at 11:43 +0100, Geert Uytterhoeven wrote:
> If CONFIG_PM=n:
> 
>     drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’:
>     drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no member named ‘runtime_auto’
> 
> If PM is disabled, the runtime_auto flag is not available, but auto
> suspend is not enabled anyway.  Hence protect the check for runtime_auto
> by #ifdef CONFIG_PM to fix this.
> 
> Fixes: a59f8c5b048dc938 ("lan78xx: add ndo_get_stats64")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Alternatively, we can add a dev_pm_runtime_auto_is_enabled() wrapper to
> include/linux/pm.h, which always return false if CONFIG_PM is disabled.
> 
> The only other user in non-core code (drivers/usb/core/sysfs.c) has a
> big #ifdef CONFIG_PM check around all PM-related code.
> 
> Thoughts?
> ---
>  drivers/net/usb/lan78xx.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index d36d5ebf37f355f2..7b9ac47b2ecf9905 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -3271,7 +3271,9 @@ struct rtnl_link_stats64 *lan78xx_get_stats64(struct net_device *netdev,
>  	 * periodic reading from HW will prevent from entering USB auto suspend.
>  	 * if autosuspend is disabled, read from HW.
>  	 */
> +#ifdef CONFIG_PM
>  	if (!dev->udev->dev.power.runtime_auto)
> +#endif
>  		lan78xx_update_stats(dev);
>  
>  	mutex_lock(&dev->stats.access_lock);

Note that a ndo_get_stat64() handler is not allowed to sleep,
so the mutex_lock() is not wise...

Historically /proc/net/dev handler but also bonding ndo_get_stats() used
RCU or a rwlock or a spinlock.

So a complete fix would need to get rid of this mutex as well.

^ permalink raw reply

* [PULL] virtio/vhost: new features, performance improvements, cleanups
From: Michael S. Tsirkin @ 2016-03-20 13:58 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: pmladek, kvm, geliangtang, netdev, mst, sebott, linux-kernel,
	pmladek, virtualization, borntraeger, luto, pbonzini, pabeni,
	schwidefsky, gkurz

The following changes since commit e1f33be9186363da7955bcb5f0b03e6685544c50:

  vhost: fix error path in vhost_init_used() (2016-03-02 17:01:49 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus

for you to fetch changes up to c67f5db82027ba6d2ea4ac9176bc45996a03ae6a:

  virtio_net: replace netdev_alloc_skb_ip_align() with napi_alloc_skb() (2016-03-17 17:42:00 +0200)

----------------------------------------------------------------
virtio/vhost: new features, performance improvements, cleanups

This adds basic polling support for vhost.
Reworks virtio to optionally use DMA API, fixing it on Xen.
Balloon stats gained a new entry.
Using the new napi_alloc_skb speeds up virtio net.
virtio blk stats can now be read while another VCPU
us busy inflating or deflating the balloon.
Plus misc cleanups in various places.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Andy Lutomirski (6):
      vring: Introduce vring_use_dma_api()
      virtio_ring: Support DMA APIs
      virtio: Add improved queue allocation API
      virtio_mmio: Use the DMA API if enabled
      virtio_pci: Use the DMA API if enabled
      vring: Use the DMA API on Xen

Christian Borntraeger (3):
      dma: Provide simple noop dma ops
      alpha/dma: use common noop dma ops
      s390/dma: Allow per device dma ops

Cornelia Huck (1):
      virtio/s390: size of SET_IND payload

Geliang Tang (1):
      virtio/s390: use dev_to_virtio

Greg Kurz (2):
      vhost: rename cross-endian helpers
      vhost: rename vhost_init_used()

Jason Wang (3):
      vhost: introduce vhost_has_work()
      vhost: introduce vhost_vq_avail_empty()
      vhost_net: basic polling support

Michael S. Tsirkin (1):
      virtio_blk: VIRTIO_BLK_F_WCE->VIRTIO_BLK_F_FLUSH

Paolo Abeni (1):
      virtio_net: replace netdev_alloc_skb_ip_align() with napi_alloc_skb()

Petr Mladek (2):
      virtio_balloon: Use a workqueue instead of "vballoon" kthread
      virtio_balloon: Allow to resize and update the balloon stats in parallel

 arch/s390/include/asm/device.h      |   6 +-
 arch/s390/include/asm/dma-mapping.h |   6 +-
 drivers/vhost/vhost.h               |   5 +-
 drivers/virtio/virtio_pci_common.h  |   6 -
 include/linux/dma-mapping.h         |   2 +
 include/linux/virtio.h              |  23 +-
 include/linux/virtio_ring.h         |  35 +++
 include/uapi/linux/vhost.h          |   6 +
 include/uapi/linux/virtio_blk.h     |   6 +-
 tools/virtio/linux/dma-mapping.h    |  17 ++
 arch/alpha/kernel/pci-noop.c        |  46 +---
 arch/s390/pci/pci.c                 |   1 +
 arch/s390/pci/pci_dma.c             |   4 +-
 drivers/block/virtio_blk.c          |  11 +-
 drivers/net/virtio_net.c            |   2 +-
 drivers/s390/virtio/virtio_ccw.c    |  15 +-
 drivers/vhost/net.c                 |  80 ++++++-
 drivers/vhost/scsi.c                |   2 +-
 drivers/vhost/test.c                |   2 +-
 drivers/vhost/vhost.c               |  69 +++++-
 drivers/virtio/virtio_balloon.c     | 122 +++++-----
 drivers/virtio/virtio_mmio.c        |  67 ++----
 drivers/virtio/virtio_pci_legacy.c  |  42 ++--
 drivers/virtio/virtio_pci_modern.c  |  61 ++---
 drivers/virtio/virtio_ring.c        | 439 +++++++++++++++++++++++++++++++-----
 lib/dma-noop.c                      |  75 ++++++
 arch/s390/Kconfig                   |   5 +-
 drivers/virtio/Kconfig              |   2 +-
 lib/Makefile                        |   1 +
 29 files changed, 823 insertions(+), 335 deletions(-)
 create mode 100644 tools/virtio/linux/dma-mapping.h
 create mode 100644 lib/dma-noop.c

^ permalink raw reply

* Re: [net-next v2] virtio_net: replace netdev_alloc_skb_ip_align() with napi_alloc_skb()
From: Michael S. Tsirkin @ 2016-03-20 12:28 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: netdev, virtualization, Hannes Frederic Sowa, Venkatesh Srinivas
In-Reply-To: <98c94ca899603eb4212c44aa1a658825198ed49a.1458290241.git.pabeni@redhat.com>

On Fri, Mar 18, 2016 at 04:42:48PM +0100, Paolo Abeni wrote:
> This gives small but noticeable rx performance improvement (2-3%)
> and will allow exploiting future napi improvement.
> 
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

I am not sure this is necessarily worth doing for this dumb hardware.
I queued v1 in vhost tree for now, let's see some performance
numbers before we start changing about other paths.

> --
>  v2: replace also netdev_alloc_skb_ip_align() invocation in
> 	add_recvbuf_small(), suggested by Venkatesh Srinivas
> ---
>  drivers/net/virtio_net.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index fb0eae4..100e039 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -260,7 +260,7 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi,
>  	p = page_address(page) + offset;
>  
>  	/* copy small packet so we can reuse these pages for small data */
> -	skb = netdev_alloc_skb_ip_align(vi->dev, GOOD_COPY_LEN);
> +	skb = napi_alloc_skb(&rq->napi, GOOD_COPY_LEN);
>  	if (unlikely(!skb))
>  		return NULL;
>  
> @@ -541,7 +541,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, struct receive_queue *rq,
>  	struct virtio_net_hdr_mrg_rxbuf *hdr;
>  	int err;
>  
> -	skb = __netdev_alloc_skb_ip_align(vi->dev, GOOD_PACKET_LEN, gfp);
> +	skb = __napi_alloc_skb(&rq->napi, GOOD_PACKET_LEN, gfp);
>  	if (unlikely(!skb))
>  		return -ENOMEM;
>  
> -- 
> 1.8.3.1

^ 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