Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition
From: David Miller @ 2018-09-04  4:23 UTC (permalink / raw)
  To: mst; +Cc: jasowang, glebfm, kvm, virtualization, netdev, linux-kernel
In-Reply-To: <20180903231102-mutt-send-email-mst@kernel.org>

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 3 Sep 2018 23:11:11 -0400

> On Tue, Sep 04, 2018 at 11:08:40AM +0800, Jason Wang wrote:
>> 
>> 
>> On 2018年09月04日 10:22, Michael S. Tsirkin wrote:
>> > On Mon, Sep 03, 2018 at 08:59:13PM +0300, Gleb Fotengauer-Malinovskiy wrote:
>> > > The _IOC_READ flag fits this ioctl request more because this request
>> > > actually only writes to, but doesn't read from userspace.
>> > > See NOTEs in include/uapi/asm-generic/ioctl.h for more information.
>> > > 
>> > > Fixes: 429711aec282 ("vhost: switch to use new message format")
>> > > Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
>> > Hmm it does make sense, and it's not too late to fix this up.
>> > Jason, what's your take on this? Was _IOW intentional?
>> 
>> My bad, not intentional. And I agree that fixing this is not too late.
>> 
>> So
>> 
>> Acked-by: Jason Wang <jasowang@redhat.com>
> 
> 
> OK then
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>

Applied, thanks everyone.

^ permalink raw reply

* RE: [PATCH 4/4 next] net: lan78xx: Make declaration style consistent
From: RaghuramChary.Jallipalli @ 2018-09-04  4:23 UTC (permalink / raw)
  To: stefan.wahren, Woojung.Huh
  Cc: UNGLinuxDriver, davem, netdev, linux-usb, linux-kernel
In-Reply-To: <1535994759-8938-5-git-send-email-stefan.wahren@i2se.com>

> This patch makes some declaration more consistent.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

Reviewed-by: Raghuram Chary Jallipalli <raghuramchary.jallipalli@microchip.com>

Thanks,
-Raghu

^ permalink raw reply

* RE: [PATCH 3/4 next] net: lan78xx: Switch to SPDX identifier
From: RaghuramChary.Jallipalli @ 2018-09-04  4:29 UTC (permalink / raw)
  To: stefan.wahren, Woojung.Huh
  Cc: UNGLinuxDriver, davem, netdev, linux-usb, linux-kernel
In-Reply-To: <1535994759-8938-4-git-send-email-stefan.wahren@i2se.com>

> +// SPDX-License-Identifier: GPL-2.0+
> +/* Copyright (C) 2015 Microchip Technology */

Can we merge both in single comment line?

> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/* Copyright (C) 2015 Microchip Technology */

Here too.

Thanks,
-Raghu

^ permalink raw reply

* Re: [PATCH 00/25] Change tty_port(standard)_install's return type
From: Sam Ravnborg @ 2018-09-04  4:42 UTC (permalink / raw)
  To: Jaejoong Kim
  Cc: linux-um, netdev, linux-mmc, linux-s390, devel, greybus-dev,
	linuxppc-dev, linux-serial, sparclinux, linux-usb,
	linux-bluetooth, linux-kernel, Greg Kroah-Hartman, Jiri Slaby
In-Reply-To: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com>

Hi Jaejoong.

> Change return type for tty functions. Patch No.01
>   tty: Change return type to void
Adding this patch first will generate a lot of warnings
until all users are updated.
It is usual practice to prepare all users
and then apply the infrastructure changes as the
last patch.
Then people will not see a lot of warnings when
they build something in the middle,
and I guess current stack set may also generate
a few mails from the 0-day build infrastructure.


>   isdn: i4l: isdn_tty: Change return type to void

And a nitpick on the patch description.
This patch do not change any return type, but
it ignore the return value og tty_part_install().
Same goes for all ramaining patches.

	Sam

^ permalink raw reply

* Re: [PATCH v2] net/ibm/emac: wrong emac_calc_base call was used by typo
From: David Miller @ 2018-09-04  4:51 UTC (permalink / raw)
  To: ivan; +Cc: netdev, linux-kernel, chunkeey
In-Reply-To: <20180903072628.19986-1-ivan@de.ibm.com>

From: Ivan Mikhaylov <ivan@de.ibm.com>
Date: Mon, 3 Sep 2018 10:26:28 +0300

> __emac_calc_base_mr1 was used instead of __emac4_calc_base_mr1
> by copy-paste mistake for emac4syn.
> 
> Fixes: 45d6e545505fd32edb812f085be7de45b6a5c0af ("net/ibm/emac: add 8192 rx/tx fifo size")
> Signed-off-by: Ivan Mikhaylov <ivan@de.ibm.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 00/11] Misc. bug fixes & small enhancements for HNS3 Driver
From: David Miller @ 2018-09-04  5:06 UTC (permalink / raw)
  To: salil.mehta
  Cc: yisen.zhuang, lipeng321, mehta.salil, netdev, linux-kernel,
	linuxarm
In-Reply-To: <20180903102156.18676-1-salil.mehta@huawei.com>

From: Salil Mehta <salil.mehta@huawei.com>
Date: Mon, 3 Sep 2018 11:21:45 +0100

> This patch-set presents some fixes and minor enhancements to HNS3
> Driver

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH v2 00/11] mscc: ocelot: add support for SerDes muxing configuration
From: David Miller @ 2018-09-04  5:09 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: andrew, quentin.schulz, ralf, paul.burton, jhogan, robh+dt,
	mark.rutland, kishon, f.fainelli, allan.nielsen, linux-mips,
	devicetree, linux-kernel, netdev, thomas.petazzoni
In-Reply-To: <20180903134522.GC13888@piout.net>

From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: Mon, 3 Sep 2018 15:45:22 +0200

> On 03/09/2018 15:34:15+0200, Andrew Lunn wrote:
>> > I suggest patches 1 and 8 go through MIPS tree, 2 to 5 and 11 go through
>> > net while the others (6, 7, 9 and 10) go through the generic PHY subsystem.
>> 
>> Hi Quentin
>> 
>> Are you expecting merge conflicts? If not, it might be simpler to gets
>> ACKs from each maintainer, and then merge it though one tree.
>> 
> 
> There are some other DT changes for this cycle so those should probably
> go through MIPS.

No objection for this going through the MIPS tree, and from me:

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

^ permalink raw reply

* Re: [PATCH net-next 01/12] net: phy: ste10Xp: Remove wrong SUPPORTED_Pause
From: Andrew Lunn @ 2018-09-04  1:20 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: David Miller, netdev, maxime.chevallier
In-Reply-To: <5481c281-98ec-cfc1-2972-646c3191f6c8@gmail.com>

On Mon, Sep 03, 2018 at 10:53:58AM -0700, Florian Fainelli wrote:
> 
> 
> On 9/2/2018 10:06 AM, Andrew Lunn wrote:
> >The PHY driver should not indicate that Pause is supported. It is upto
> >the MAC drive enable it, if it supports Pause frames. So remove it
> >from the ste10Xp driver.
> 
> This came up before when Timur was cleaning up the Pause|ASym_Pause
> advertisment bits, and we agreed that a driver that cannot have the
> Asym_Pause bit writable, e.g: bcm63xx, would have to specifically leave
> SUPPORTED_Pause as a way to tell PHYLIB about that situation. See:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/phy?id=529ed12752635ba8a35dc78ec70ed6f42570b4ca
> 
> Can you check the datasheet if available?

Hi Florian

Datasheet is at:

https://www.st.com/resource/en/datasheet/ste100p.pdf

It indicates that bit 10 of the Auto-Neg advertisement for Pause is
R/W and defaults to 1. There is no support for Asym Pause, bit 11 is
reserved.

So we don't have the case of the bcm63xx. It should be that this PHY
supports plain symmetric Pause.

	 Andrew

^ permalink raw reply

* Re: [PATCH net-next] bnxt_en: Properly get address type of encapsulation IP headers
From: Sathya Perla @ 2018-09-04  6:01 UTC (permalink / raw)
  To: yuehaibing; +Cc: David Miller, Michael Chan, open list, Netdev
In-Reply-To: <20180901092529.11828-1-yuehaibing@huawei.com>

On Sat, Sep 1, 2018 at 2:56 PM YueHaibing <yuehaibing@huawei.com> wrote:
>
> gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c: In function 'bnxt_tc_parse_flow':
> drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c:186:6: warning:
>  variable 'addr_type' set but not used [-Wunused-but-set-variable]
>
> As done elsewhere in TC/flower offload code, the address type of
> the encapsulation IP headers should be realized accroding to the
> addr_type field of the encapsulation control dissector key.
...
>  drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> index 092c817..5c625e5 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> @@ -242,7 +242,7 @@ static int bnxt_tc_parse_flow(struct bnxt *bp,
>                 flow->l2_key.num_vlans = 1;
>         }
>
> -       if (dissector_uses_key(dissector, FLOW_DISSECTOR_KEY_IPV4_ADDRS)) {

 __skb_flow_dissect() (in net/core/flow_dissector.c) uses the same
construct. So, can you clarify what you are trying to fix here
functionally. Thanks.

^ permalink raw reply

* Re: [PATCH] iwlwifi: mvm:  fix spelling mistake "Recieved" -> "Received"
From: Luciano Coelho @ 2018-09-04  6:05 UTC (permalink / raw)
  To: Colin King, Johannes Berg, Emmanuel Grumbach,
	Intel Linux Wireless, Kalle Valo, David S . Miller,
	linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel
In-Reply-To: <20180826223117.12892-1-colin.king@canonical.com>

On Sun, 2018-08-26 at 23:31 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Trivial fix to spelling mistake in debug message.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
> index b15b0d84bb7e..5f32d3131d62 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
> @@ -3320,7 +3320,7 @@ static bool iwl_mvm_rx_aux_roc(struct iwl_notif_wait_data *notif_wait,
>  	resp = (void *)pkt->data;
>  
>  	IWL_DEBUG_TE(mvm,
> -		     "Aux ROC: Recieved response from ucode: status=%d uid=%d\n",
> +		     "Aux ROC: Received response from ucode: status=%d uid=%d\n",
>  		     resp->status, resp->event_unique_id);
>  
>  	te_data->uid = le32_to_cpu(resp->event_unique_id);

Thanks! Again I pushed this to our internal tree and it will reach the
mainline following our normal process.

--
Cheers,
Luca.

^ permalink raw reply

* Re: [PATCH] iwlwifi: pcie: make array 'prop' static, shrinks object size
From: Luciano Coelho @ 2018-09-04  6:07 UTC (permalink / raw)
  To: Colin King, Johannes Berg, Emmanuel Grumbach,
	Intel Linux Wireless, Kalle Valo, David S . Miller,
	linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel
In-Reply-To: <20180821102109.1630-1-colin.king@canonical.com>

On Tue, 2018-08-21 at 11:21 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array prop on the stack but instead make it static.
> Makes the object code smaller by 30 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   80138	  15382	    576	  96096	  17760	drivers/net/wireless/intel/iwlwifi/pcie/trans.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   79948	  15542	    576	  96066	  17742	drivers/net/wireless/intel/iwlwifi/pcie/trans.o
> 
> (gcc version 8.2.0 x86_64)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> index 7d319b6863fe..c7daf666ee21 100644
> --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> @@ -1947,7 +1947,7 @@ static void iwl_trans_pcie_removal_wk(struct work_struct *wk)
>  	struct iwl_trans_pcie_removal *removal =
>  		container_of(wk, struct iwl_trans_pcie_removal, work);
>  	struct pci_dev *pdev = removal->pdev;
> -	char *prop[] = {"EVENT=INACCESSIBLE", NULL};
> +	static char *prop[] = {"EVENT=INACCESSIBLE", NULL};
>  
>  	dev_err(&pdev->dev, "Device gone - attempting removal\n");
>  	kobject_uevent_env(&pdev->dev.kobj, KOBJ_CHANGE, prop);

Thanks! I pushed this to our internal tree and it will reach upstream
following our normal process.

--
Luca.

^ permalink raw reply

* Re: [PATCH] iwlwifi: d3: use struct_size() in kzalloc()
From: Luciano Coelho @ 2018-09-04  6:26 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Johannes Berg, Emmanuel Grumbach,
	Intel Linux Wireless, Kalle Valo, David S. Miller
  Cc: linux-wireless, netdev, linux-kernel, Kees Cook
In-Reply-To: <20180824011540.GA25716@embeddedor.com>

On Thu, 2018-08-23 at 20:15 -0500, Gustavo A. R. Silva wrote:
> One of the more common cases of allocation size calculations is finding
> the size of a structure that has a zero-sized array at the end, along
> with memory for some number of elements for that array. For example:
> 
> struct foo {
> 	int stuff;
>         void *entry[];
> };
> 
> instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);
> 
> Instead of leaving these open-coded and prone to type mistakes, we can
> now use the new struct_size() helper:
> 
> instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);
> 
> This issue was detected with the help of Coccinelle.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> index 79bdae9..6960318 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> @@ -1769,8 +1769,7 @@ static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm,
>  		n_matches = 0;
>  	}
>  
> -	net_detect = kzalloc(sizeof(*net_detect) +
> -			     (n_matches * sizeof(net_detect->matches[0])),
> +	net_detect = kzalloc(struct_size(net_detect, matches, n_matches),
>  			     GFP_KERNEL);
>  	if (!net_detect || !n_matches)
>  		goto out_report_nd;
> @@ -1785,8 +1784,7 @@ static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm,
>  		for (j = 0; j < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN; j++)
>  			n_channels += hweight8(fw_match->matching_channels[j]);
>  
> -		match = kzalloc(sizeof(*match) +
> -				(n_channels * sizeof(*match->channels)),
> +		match = kzalloc(struct_size(match, channels, n_channels),
>  				GFP_KERNEL);
>  		if (!match)
>  			goto out_report_nd;

Thanks! I applied this to our internal tree and it will reach the
mainline following our normal process.

--
Cheers,
Luca.

^ permalink raw reply

* Re: [PATCH net] ip6_tunnel: respect ttl inherit for ip6tnl
From: David Miller @ 2018-09-04  2:04 UTC (permalink / raw)
  To: liuhangbin; +Cc: netdev
In-Reply-To: <1535705521-1263-1-git-send-email-liuhangbin@gmail.com>

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Fri, 31 Aug 2018 16:52:01 +0800

> man ip-tunnel ttl section says:
> 0 is a special value meaning that packets inherit the TTL value.
> 
> IPv4 tunnel respect this in ip_tunnel_xmit(), but IPv6 tunnel has not
> implement it yet. To make IPv6 behave consistently with IP tunnel,
> add ipv6 tunnel inherit support.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied, thank you.

^ permalink raw reply

* [Patch net] tipc: call start and done ops directly in __tipc_nl_compat_dumpit()
From: Cong Wang @ 2018-09-04  2:12 UTC (permalink / raw)
  To: netdev; +Cc: tipc-discussion, Cong Wang, Jon Maloy, Ying Xue

__tipc_nl_compat_dumpit() uses a netlink_callback on stack,
so the only way to align it with other ->dumpit() call path
is calling tipc_dump_start() and tipc_dump_done() directly
inside it. Otherwise ->dumpit() would always get NULL from
cb->args[0].

But, tipc_dump_start() uses sock_net(cb->skb->sk) to retrieve
net pointer, the cb->skb here doesn't set ->sk, the net pointer
is saved in msg->net instead, so introduce a helper function
__tipc_dump_start() to pass in msg->net.

Fixes: 9a07efa9aea2 ("tipc: switch to rhashtable iterator")
Reported-by: syzbot+e93a2c41f91b8e2c7d9b@syzkaller.appspotmail.com
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/tipc/netlink_compat.c | 2 ++
 net/tipc/socket.c         | 8 ++++++--
 net/tipc/socket.h         | 1 +
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index a2f76743c73a..82f665728382 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -185,6 +185,7 @@ static int __tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
 		return -ENOMEM;
 
 	buf->sk = msg->dst_sk;
+	__tipc_dump_start(&cb, msg->net);
 
 	do {
 		int rem;
@@ -216,6 +217,7 @@ static int __tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
 	err = 0;
 
 err_out:
+	tipc_dump_done(&cb);
 	kfree_skb(buf);
 
 	if (err == -EMSGSIZE) {
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ab7a2a7178f7..a19b2b1c77ed 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -3264,9 +3264,14 @@ int tipc_nl_sk_walk(struct sk_buff *skb, struct netlink_callback *cb,
 EXPORT_SYMBOL(tipc_nl_sk_walk);
 
 int tipc_dump_start(struct netlink_callback *cb)
+{
+	return __tipc_dump_start(cb, sock_net(cb->skb->sk));
+}
+EXPORT_SYMBOL(tipc_dump_start);
+
+int __tipc_dump_start(struct netlink_callback *cb, struct net *net)
 {
 	struct rhashtable_iter *iter = (void *)cb->args[0];
-	struct net *net = sock_net(cb->skb->sk);
 	struct tipc_net *tn = tipc_net(net);
 
 	if (!iter) {
@@ -3280,7 +3285,6 @@ int tipc_dump_start(struct netlink_callback *cb)
 	rhashtable_walk_enter(&tn->sk_rht, iter);
 	return 0;
 }
-EXPORT_SYMBOL(tipc_dump_start);
 
 int tipc_dump_done(struct netlink_callback *cb)
 {
diff --git a/net/tipc/socket.h b/net/tipc/socket.h
index d43032e26532..5e575f205afe 100644
--- a/net/tipc/socket.h
+++ b/net/tipc/socket.h
@@ -69,5 +69,6 @@ int tipc_nl_sk_walk(struct sk_buff *skb, struct netlink_callback *cb,
 				       struct netlink_callback *cb,
 				       struct tipc_sock *tsk));
 int tipc_dump_start(struct netlink_callback *cb);
+int __tipc_dump_start(struct netlink_callback *cb, struct net *net);
 int tipc_dump_done(struct netlink_callback *cb);
 #endif
-- 
2.14.4

^ permalink raw reply related

* [Patch net] tipc: orphan sock in tipc_release()
From: Cong Wang @ 2018-09-04  2:12 UTC (permalink / raw)
  To: netdev; +Cc: tipc-discussion, Cong Wang, Jon Maloy, Ying Xue
In-Reply-To: <20180904021241.11426-1-xiyou.wangcong@gmail.com>

Before we unlock the sock in tipc_release(), we have to
detach sk->sk_socket from sk, otherwise a parallel
tipc_sk_fill_sock_diag() could stil read it after we
free this socket.

Fixes: c30b70deb5f4 ("tipc: implement socket diagnostics for AF_TIPC")
Reported-and-tested-by: syzbot+48804b87c16588ad491d@syzkaller.appspotmail.com
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/tipc/socket.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index a19b2b1c77ed..b5a6635e4dfa 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -576,6 +576,7 @@ static int tipc_release(struct socket *sock)
 	sk_stop_timer(sk, &sk->sk_timer);
 	tipc_sk_remove(tsk);
 
+	sock_orphan(sk);
 	/* Reject any messages that accumulated in backlog queue */
 	release_sock(sk);
 	tipc_dest_list_purge(&tsk->cong_links);
-- 
2.14.4

^ permalink raw reply related

* [PATCH net] net: phy: sfp: Handle unimplemented hwmon limits and alarms
From: Andrew Lunn @ 2018-09-04  2:23 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Russell King, Florian Fainelli, Andrew Lunn

Not all SFPs implement the registers containing sensor limits and
alarms. Luckily, there is a bit indicating if they are implemented or
not. Add checking for this bit, when deciding if the hwmon attributes
should be visible.

Fixes: 1323061a018a ("net: phy: sfp: Add HWMON support for module sensors")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/phy/sfp.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 4637d980310e..52fffb98fde9 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -398,7 +398,6 @@ static umode_t sfp_hwmon_is_visible(const void *data,
 	switch (type) {
 	case hwmon_temp:
 		switch (attr) {
-		case hwmon_temp_input:
 		case hwmon_temp_min_alarm:
 		case hwmon_temp_max_alarm:
 		case hwmon_temp_lcrit_alarm:
@@ -407,13 +406,16 @@ static umode_t sfp_hwmon_is_visible(const void *data,
 		case hwmon_temp_max:
 		case hwmon_temp_lcrit:
 		case hwmon_temp_crit:
+			if (!(sfp->id.ext.enhopts & SFP_ENHOPTS_ALARMWARN))
+				return 0;
+			/* fall through */
+		case hwmon_temp_input:
 			return 0444;
 		default:
 			return 0;
 		}
 	case hwmon_in:
 		switch (attr) {
-		case hwmon_in_input:
 		case hwmon_in_min_alarm:
 		case hwmon_in_max_alarm:
 		case hwmon_in_lcrit_alarm:
@@ -422,13 +424,16 @@ static umode_t sfp_hwmon_is_visible(const void *data,
 		case hwmon_in_max:
 		case hwmon_in_lcrit:
 		case hwmon_in_crit:
+			if (!(sfp->id.ext.enhopts & SFP_ENHOPTS_ALARMWARN))
+				return 0;
+			/* fall through */
+		case hwmon_in_input:
 			return 0444;
 		default:
 			return 0;
 		}
 	case hwmon_curr:
 		switch (attr) {
-		case hwmon_curr_input:
 		case hwmon_curr_min_alarm:
 		case hwmon_curr_max_alarm:
 		case hwmon_curr_lcrit_alarm:
@@ -437,6 +442,10 @@ static umode_t sfp_hwmon_is_visible(const void *data,
 		case hwmon_curr_max:
 		case hwmon_curr_lcrit:
 		case hwmon_curr_crit:
+			if (!(sfp->id.ext.enhopts & SFP_ENHOPTS_ALARMWARN))
+				return 0;
+			/* fall through */
+		case hwmon_curr_input:
 			return 0444;
 		default:
 			return 0;
@@ -452,7 +461,6 @@ static umode_t sfp_hwmon_is_visible(const void *data,
 		    channel == 1)
 			return 0;
 		switch (attr) {
-		case hwmon_power_input:
 		case hwmon_power_min_alarm:
 		case hwmon_power_max_alarm:
 		case hwmon_power_lcrit_alarm:
@@ -461,6 +469,10 @@ static umode_t sfp_hwmon_is_visible(const void *data,
 		case hwmon_power_max:
 		case hwmon_power_lcrit:
 		case hwmon_power_crit:
+			if (!(sfp->id.ext.enhopts & SFP_ENHOPTS_ALARMWARN))
+				return 0;
+			/* fall through */
+		case hwmon_power_input:
 			return 0444;
 		default:
 			return 0;
-- 
2.19.0.rc1

^ permalink raw reply related

* Re: [PATCH net-next v1 3/5] ipv4: enable IFA_IF_NETNSID for RTM_GETADDR
From: Jiri Benc @ 2018-09-04  6:50 UTC (permalink / raw)
  To: David Ahern
  Cc: Christian Brauner, netdev, linux-kernel, davem, kuznet, yoshfuji,
	pombredanne, kstewart, gregkh, fw, ktkhai, lucien.xin,
	jakub.kicinski, nicolas.dichtel
In-Reply-To: <a4282d46-4c17-b395-dec0-7c8ac10cbf97@gmail.com>

On Mon, 3 Sep 2018 21:11:30 -0600, David Ahern wrote:
> Can only use it once per message type, but NLM_F_DUMP_FILTERED is a flag
> that can be set to explicitly say the request is filtered as requested.

The problem is that NLM_F_DUMP_FILTERED is too coarse. There's no way
to determine whether the netnsid was honored or whether it was not but
other filtering took effect.

This is a general problem with netlink: unknown attributes are ignored.
We need a way to detect that certain attribute was understood by the
kernel or was not. And it needs to work retroactively, i.e. the
application has to be able to determine the currently running kernel
does not support the feature (because it's too old).

That's why we return back the attribute in responses to a request with
IFLA_IF_NETNSID present and why we should do the same for
IFA_IF_NETNSID.

> See 21fdd092acc7e. I would like to see other filters added for addresses
> in the same release this gets used. The only one that comes to mind for
> addresses is to only return addresses for devices with master device
> index N (same intent as 21fdd092acc7e for neighbors).

I also question the statement that IFA_F_NETNSID is a filter: my
understanding of "filter" is something that limits the output to a
certain subset. I.e., unfiltered results always contain everything that
is in a filtered result. While with IFA_F_NETNSID, we get a completely
different set of data. Does that really constitute a filter? Note that
we can still filter in the target netns.

Thanks,

 Jiri

^ permalink raw reply

* Re: [PATCH net-next 00/12] Preparing for phylib limkmodes
From: David Miller @ 2018-09-04  2:44 UTC (permalink / raw)
  To: andrew; +Cc: netdev, f.fainelli, maxime.chevallier
In-Reply-To: <1535908001-18593-1-git-send-email-andrew@lunn.ch>

From: Andrew Lunn <andrew@lunn.ch>
Date: Sun,  2 Sep 2018 19:06:29 +0200

> phylib currently makes us of a u32 bitmap for advertising, supported,
> and link partner capabilities. For a long time, this has been
> sufficient, for devices up to 1Gbps. With more MAC/PHY combinations
> now supporting speeds greater than 1Gbps, we have run out of
> bits. There is the need to replace this u32 with an
> __ETHTOOL_DECLARE_LINK_MODE_MASK, which makes use of linux's generic
> bitmaps.
> 
> This patchset does some of the work preparing for this change. A few
> cleanups are applied to PHY drivers. Some MAC drivers directly access
> members of phydev which are going to change type. These patches adds
> some helpers and swaps MAC drivers to use them, mostly dealing with
> Pause configuration.

Andrew, please fix the indentation issue Florian pointed out in patch
#8 and finish the other feedback threads which seem to still be in
progress.

Thanks!

^ permalink raw reply

* [PATCH 01/25] tty: Change return type to void
From: Jaejoong Kim @ 2018-09-04  2:44 UTC (permalink / raw)
  To: linux-um, netdev, linux-mmc, linux-s390, devel, greybus-dev,
	linuxppc-dev, linux-serial, sparclinux, linux-usb,
	linux-bluetooth, linux-kernel
  Cc: Greg Kroah-Hartman, Jiri Slaby
In-Reply-To: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com>

Many drivers with tty use the tty_stand_install(). But, there is no
need to handle the error, since it always returns 0. So, change the
return type of tty_standard_install() and tty_port_install() to void
type and remove unnecessary exception handling where we use these
functions.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
---
 drivers/tty/tty_io.c   | 10 ++++++----
 drivers/tty/tty_port.c |  4 ++--
 include/linux/tty.h    |  4 ++--
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 32bc3e3..b01cec8 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1196,13 +1196,12 @@ void tty_init_termios(struct tty_struct *tty)
 }
 EXPORT_SYMBOL_GPL(tty_init_termios);
 
-int tty_standard_install(struct tty_driver *driver, struct tty_struct *tty)
+void tty_standard_install(struct tty_driver *driver, struct tty_struct *tty)
 {
 	tty_init_termios(tty);
 	tty_driver_kref_get(driver);
 	tty->count++;
 	driver->ttys[tty->index] = tty;
-	return 0;
 }
 EXPORT_SYMBOL_GPL(tty_standard_install);
 
@@ -1221,8 +1220,11 @@ EXPORT_SYMBOL_GPL(tty_standard_install);
 static int tty_driver_install_tty(struct tty_driver *driver,
 						struct tty_struct *tty)
 {
-	return driver->ops->install ? driver->ops->install(driver, tty) :
-		tty_standard_install(driver, tty);
+	if (driver->ops->install)
+		return driver->ops->install(driver, tty);
+
+	tty_standard_install(driver, tty);
+	return 0;
 }
 
 /**
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 25d7368..fd8d40d 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -656,11 +656,11 @@ EXPORT_SYMBOL(tty_port_close);
  * to a concrete tty specified by @tty. Use this or tty_port_register_device
  * (or both). Call tty_port_link_device as a last resort.
  */
-int tty_port_install(struct tty_port *port, struct tty_driver *driver,
+void tty_port_install(struct tty_port *port, struct tty_driver *driver,
 		struct tty_struct *tty)
 {
 	tty->port = port;
-	return tty_standard_install(driver, tty);
+	tty_standard_install(driver, tty);
 }
 EXPORT_SYMBOL_GPL(tty_port_install);
 
diff --git a/include/linux/tty.h b/include/linux/tty.h
index c56e397..63cdac1 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -556,7 +556,7 @@ extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx);
 extern void tty_release_struct(struct tty_struct *tty, int idx);
 extern int tty_release(struct inode *inode, struct file *filp);
 extern void tty_init_termios(struct tty_struct *tty);
-extern int tty_standard_install(struct tty_driver *driver,
+extern void tty_standard_install(struct tty_driver *driver,
 		struct tty_struct *tty);
 
 extern struct mutex tty_mutex;
@@ -688,7 +688,7 @@ extern int tty_port_close_start(struct tty_port *port,
 extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty);
 extern void tty_port_close(struct tty_port *port,
 				struct tty_struct *tty, struct file *filp);
-extern int tty_port_install(struct tty_port *port, struct tty_driver *driver,
+extern void tty_port_install(struct tty_port *port, struct tty_driver *driver,
 				struct tty_struct *tty);
 extern int tty_port_open(struct tty_port *port,
 				struct tty_struct *tty, struct file *filp);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 02/25] isdn: i4l: isdn_tty: Change return type to void
From: Jaejoong Kim @ 2018-09-04  2:44 UTC (permalink / raw)
  To: linux-um, netdev, linux-mmc, linux-s390, devel, greybus-dev,
	linuxppc-dev, linux-serial, sparclinux, linux-usb,
	linux-bluetooth, linux-kernel
  Cc: Greg Kroah-Hartman, Jiri Slaby
In-Reply-To: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com>

Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
---
 drivers/isdn/i4l/isdn_tty.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index b730037..3d6b24e 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1481,8 +1481,9 @@ static int isdn_tty_install(struct tty_driver *driver, struct tty_struct *tty)
 		return -ENODEV;
 
 	tty->driver_data = info;
+	tty_port_install(&info->port, driver, tty);
 
-	return tty_port_install(&info->port, driver, tty);
+	return 0;
 }
 
 /*
-- 
2.7.4

^ permalink raw reply related

* [PATCH 15/25] um: Change return type to void
From: Jaejoong Kim @ 2018-09-04  2:44 UTC (permalink / raw)
  To: linux-um, netdev, linux-mmc, linux-s390, devel, greybus-dev,
	linuxppc-dev, linux-serial, sparclinux, linux-usb,
	linux-bluetooth, linux-kernel
  Cc: Greg Kroah-Hartman, Jiri Slaby
In-Reply-To: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com>

Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
---
 arch/um/drivers/line.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 8d80b27..47058cf 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -338,12 +338,7 @@ int line_open(struct tty_struct *tty, struct file *filp)
 int line_install(struct tty_driver *driver, struct tty_struct *tty,
 		 struct line *line)
 {
-	int ret;
-
-	ret = tty_standard_install(driver, tty);
-	if (ret)
-		return ret;
-
+	tty_standard_install(driver, tty);
 	tty->driver_data = line;
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related

* [PATCH v2 net-next] failover: Add missing check to validate 'slave_dev' in net_failover_slave_unregister
From: YueHaibing @ 2018-09-04  2:56 UTC (permalink / raw)
  To: David S. Miller, Sridhar Samudrala, Stephen Hemminger,
	Dan Carpenter, Alexander Duyck, Jeff Kirsher, Liran Alon,
	Joao Martins
  Cc: YueHaibing, netdev, kernel-janitors
In-Reply-To: <1535771205-156540-1-git-send-email-yuehaibing@huawei.com>

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/net_failover.c: In function 'net_failover_slave_unregister':
drivers/net/net_failover.c:598:35: warning:
 variable 'primary_dev' set but not used [-Wunused-but-set-variable]

There should check the validity of 'slave_dev'.

Fixes: cfc80d9a1163 ("net: Introduce net_failover driver")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: use WARN_ON_ONCE as Liran Alon suggested
---
 drivers/net/net_failover.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index 7ae1856..5a749dc 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -603,6 +603,9 @@ static int net_failover_slave_unregister(struct net_device *slave_dev,
 	primary_dev = rtnl_dereference(nfo_info->primary_dev);
 	standby_dev = rtnl_dereference(nfo_info->standby_dev);
 
+	if (WARN_ON_ONCE(slave_dev != primary_dev && slave_dev != standby_dev))
+		return -ENODEV;
+
 	vlan_vids_del_by_dev(slave_dev, failover_dev);
 	dev_uc_unsync(slave_dev, failover_dev);
 	dev_mc_unsync(slave_dev, failover_dev);

^ permalink raw reply related

* [PATCH 17/25] misc: pti: Change return type to void
From: Jaejoong Kim @ 2018-09-04  2:44 UTC (permalink / raw)
  To: linux-um, netdev, linux-mmc, linux-s390, devel, greybus-dev,
	linuxppc-dev, linux-serial, sparclinux, linux-usb,
	linux-bluetooth, linux-kernel
  Cc: Greg Kroah-Hartman, Jiri Slaby
In-Reply-To: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com>

Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
---
 drivers/misc/pti.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index 41f2a9f..5c885a1 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -462,26 +462,24 @@ static int pti_tty_install(struct tty_driver *driver, struct tty_struct *tty)
 {
 	int idx = tty->index;
 	struct pti_tty *pti_tty_data;
-	int ret = tty_standard_install(driver, tty);
 
-	if (ret == 0) {
-		pti_tty_data = kmalloc(sizeof(struct pti_tty), GFP_KERNEL);
-		if (pti_tty_data == NULL)
-			return -ENOMEM;
+	tty_standard_install(driver, tty);
+	pti_tty_data = kmalloc(sizeof(struct pti_tty), GFP_KERNEL);
+	if (pti_tty_data == NULL)
+		return -ENOMEM;
 
-		if (idx == PTITTY_MINOR_START)
-			pti_tty_data->mc = pti_request_masterchannel(0, NULL);
-		else
-			pti_tty_data->mc = pti_request_masterchannel(2, NULL);
+	if (idx == PTITTY_MINOR_START)
+		pti_tty_data->mc = pti_request_masterchannel(0, NULL);
+	else
+		pti_tty_data->mc = pti_request_masterchannel(2, NULL);
 
-		if (pti_tty_data->mc == NULL) {
-			kfree(pti_tty_data);
-			return -ENXIO;
-		}
-		tty->driver_data = pti_tty_data;
+	if (pti_tty_data->mc == NULL) {
+		kfree(pti_tty_data);
+		return -ENXIO;
 	}
+	tty->driver_data = pti_tty_data;
 
-	return ret;
+	return 0;
 }
 
 /**
-- 
2.7.4

^ permalink raw reply related

* [PATCH 18/25] mmc: core: sdio_uart: Change return type to void
From: Jaejoong Kim @ 2018-09-04  2:44 UTC (permalink / raw)
  To: linux-um, netdev, linux-mmc, linux-s390, devel, greybus-dev,
	linuxppc-dev, linux-serial, sparclinux, linux-usb,
	linux-bluetooth, linux-kernel
  Cc: Greg Kroah-Hartman, Jiri Slaby
In-Reply-To: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com>

Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
---
 drivers/mmc/core/sdio_uart.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c
index 25e1130..b727186 100644
--- a/drivers/mmc/core/sdio_uart.c
+++ b/drivers/mmc/core/sdio_uart.c
@@ -731,14 +731,11 @@ static int sdio_uart_install(struct tty_driver *driver, struct tty_struct *tty)
 {
 	int idx = tty->index;
 	struct sdio_uart_port *port = sdio_uart_port_get(idx);
-	int ret = tty_standard_install(driver, tty);
 
-	if (ret == 0)
-		/* This is the ref sdio_uart_port get provided */
-		tty->driver_data = port;
-	else
-		sdio_uart_port_put(port);
-	return ret;
+	tty_standard_install(driver, tty);
+	tty->driver_data = port;
+
+	return 0;
 }
 
 /**
-- 
2.7.4

^ permalink raw reply related

* [PATCH 21/25] staging: greybus: uart: Change return type to void
From: Jaejoong Kim @ 2018-09-04  2:44 UTC (permalink / raw)
  To: linux-um, netdev, linux-mmc, linux-s390, devel, greybus-dev,
	linuxppc-dev, linux-serial, sparclinux, linux-usb,
	linux-bluetooth, linux-kernel
  Cc: Greg Kroah-Hartman, Jiri Slaby
In-Reply-To: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com>

Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
---
 drivers/staging/greybus/uart.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index 8a00632..182155b 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -393,21 +393,15 @@ static void release_minor(struct gb_tty *gb_tty)
 static int gb_tty_install(struct tty_driver *driver, struct tty_struct *tty)
 {
 	struct gb_tty *gb_tty;
-	int retval;
 
 	gb_tty = get_gb_by_minor(tty->index);
 	if (!gb_tty)
 		return -ENODEV;
 
-	retval = tty_standard_install(driver, tty);
-	if (retval)
-		goto error;
-
+	tty_standard_install(driver, tty);
 	tty->driver_data = gb_tty;
+
 	return 0;
-error:
-	tty_port_put(&gb_tty->port);
-	return retval;
 }
 
 static int gb_tty_open(struct tty_struct *tty, struct file *file)
-- 
2.7.4

^ permalink raw reply related


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