Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net] rds: MP-RDS may use an invalid c_path
From: David Miller @ 2018-04-11 14:24 UTC (permalink / raw)
  To: ka-cheong.poon; +Cc: netdev, santosh.shilimkar, rds-devel
In-Reply-To: <1523433445-7596-1-git-send-email-ka-cheong.poon@oracle.com>

From: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Date: Wed, 11 Apr 2018 00:57:25 -0700

> rds_sendmsg() calls rds_send_mprds_hash() to find a c_path to use to
> send a message.  Suppose the RDS connection is not yet up.  In
> rds_send_mprds_hash(), it does
> 
> 	if (conn->c_npaths == 0)
> 		wait_event_interruptible(conn->c_hs_waitq,
> 					 (conn->c_npaths != 0));
> 
> If it is interrupted before the connection is set up,
> rds_send_mprds_hash() will return a non-zero hash value.  Hence
> rds_sendmsg() will use a non-zero c_path to send the message.  But if
> the RDS connection ends up to be non-MP capable, the message will be
> lost as only the zero c_path can be used.
> 
> Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH 1/2] staging: irda: Replace mdelay with usleep_range in stir421x_fw_upload
From: David Miller @ 2018-04-11 14:26 UTC (permalink / raw)
  To: baijiaju1990
  Cc: devel, samuel, gregkh, johan, linux-kernel, netdev,
	arvind.yadav.cs
In-Reply-To: <865ad04e-ccbc-6144-c6ea-fc39790f861f@gmail.com>

From: Jia-Ju Bai <baijiaju1990@gmail.com>
Date: Wed, 11 Apr 2018 16:20:22 +0800

> Okay, I now know why many of my patches were not replied.

Many of your patches are not responded to because you handle patch
feedback poorly sometimes.

Also, all of your networking submissions have been dropped because
the net-next tree is closed.

^ permalink raw reply

* Re: [PATCH 1/2] staging: irda: Replace mdelay with usleep_range in stir421x_fw_upload
From: Jia-Ju Bai @ 2018-04-11 14:30 UTC (permalink / raw)
  To: David Miller
  Cc: devel, samuel, gregkh, johan, linux-kernel, netdev,
	arvind.yadav.cs
In-Reply-To: <20180411.102603.1023000970717039691.davem@davemloft.net>



On 2018/4/11 22:26, David Miller wrote:
> From: Jia-Ju Bai <baijiaju1990@gmail.com>
> Date: Wed, 11 Apr 2018 16:20:22 +0800
>
>> Okay, I now know why many of my patches were not replied.
> Many of your patches are not responded to because you handle patch
> feedback poorly sometimes.

Okay, thanks for pointing it out.
I will handle patch feedback much more carefully.

> Also, all of your networking submissions have been dropped because
> the net-next tree is closed.
>

Okay, I will choose the proper tree to submit.


Best wishes,
Jia-Ju Bai

^ permalink raw reply

* Re: [PATCH] lan78xx: Correctly indicate invalid OTP
From: David Miller @ 2018-04-11 14:31 UTC (permalink / raw)
  To: phil; +Cc: woojung.huh, UNGLinuxDriver, netdev, linux-usb, linux-kernel
In-Reply-To: <1523440757-127451-1-git-send-email-phil@raspberrypi.org>

From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 11 Apr 2018 10:59:17 +0100

> lan78xx_read_otp tries to return -EINVAL in the event of invalid OTP
> content, but the value gets overwritten before it is returned and the
> read goes ahead anyway. Make the read conditional as it should be
> and preserve the error code.
> 
> Signed-off-by: Phil Elwell <phil@raspberrypi.org>

Applied with appropriate Fixes: tag added, and queud up for -stable.

Thanks.

^ permalink raw reply

* Re: [PATCH] net/tls: Remove VLA usage
From: Dave Watson @ 2018-04-11 14:31 UTC (permalink / raw)
  To: Kees Cook
  Cc: linux-kernel, netdev, Ilya Lesokhin, Aviad Yehezkel,
	David S. Miller
In-Reply-To: <20180411005234.GA39848@beast>

On 04/10/18 05:52 PM, Kees Cook wrote:
> In the quest to remove VLAs from the kernel[1], this replaces the VLA
> size with the only possible size used in the code, and adds a mechanism
> to double-check future IV sizes.
> 
> [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>

Thanks

Acked-by: Dave Watson <davejwatson@fb.com>

> ---
>  net/tls/tls_sw.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
> index 4dc766b03f00..71e79597f940 100644
> --- a/net/tls/tls_sw.c
> +++ b/net/tls/tls_sw.c
> @@ -41,6 +41,8 @@
>  #include <net/strparser.h>
>  #include <net/tls.h>
>  
> +#define MAX_IV_SIZE	TLS_CIPHER_AES_GCM_128_IV_SIZE
> +
>  static int tls_do_decryption(struct sock *sk,
>  			     struct scatterlist *sgin,
>  			     struct scatterlist *sgout,
> @@ -673,7 +675,7 @@ static int decrypt_skb(struct sock *sk, struct sk_buff *skb,
>  {
>  	struct tls_context *tls_ctx = tls_get_ctx(sk);
>  	struct tls_sw_context *ctx = tls_sw_ctx(tls_ctx);
> -	char iv[TLS_CIPHER_AES_GCM_128_SALT_SIZE + tls_ctx->rx.iv_size];
> +	char iv[TLS_CIPHER_AES_GCM_128_SALT_SIZE + MAX_IV_SIZE];
>  	struct scatterlist sgin_arr[MAX_SKB_FRAGS + 2];
>  	struct scatterlist *sgin = &sgin_arr[0];
>  	struct strp_msg *rxm = strp_msg(skb);
> @@ -1094,6 +1096,12 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx)
>  		goto free_priv;
>  	}
>  
> +	/* Sanity-check the IV size for stack allocations. */
> +	if (iv_size > MAX_IV_SIZE) {
> +		rc = -EINVAL;
> +		goto free_priv;
> +	}
> +
>  	cctx->prepend_size = TLS_HEADER_SIZE + nonce_size;
>  	cctx->tag_size = tag_size;
>  	cctx->overhead_size = cctx->prepend_size + cctx->tag_size;
> -- 
> 2.7.4
> 
> 
> -- 
> Kees Cook
> Pixel Security

^ permalink raw reply

* Re: [PATCH] lan78xx: Avoid spurious kevent 4 "error"
From: David Miller @ 2018-04-11 14:33 UTC (permalink / raw)
  To: phil; +Cc: woojung.huh, UNGLinuxDriver, netdev, linux-usb, linux-kernel
In-Reply-To: <1523444567-128200-1-git-send-email-phil@raspberrypi.org>

From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 11 Apr 2018 12:02:47 +0100

> lan78xx_defer_event generates an error message whenever the work item
> is already scheduled. lan78xx_open defers three events -
> EVENT_STAT_UPDATE, EVENT_DEV_OPEN and EVENT_LINK_RESET. Being aware
> of the likelihood (or certainty) of an error message, the DEV_OPEN
> event is added to the set of pending events directly, relying on
> the subsequent deferral of the EVENT_LINK_RESET call to schedule the
> work.  Take the same precaution with EVENT_STAT_UPDATE to avoid a
> totally unnecessary error message.
> 
> Signed-off-by: Phil Elwell <phil@raspberrypi.org>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH v2 net] slip: Check if rstate is initialized before uncompressing
From: David Miller @ 2018-04-11 14:34 UTC (permalink / raw)
  To: tejaswit; +Cc: netdev, g.nault
In-Reply-To: <20180411110441.GA4678@tejaswit-linux.qualcomm.com>

From: Tejaswi Tanikella <tejaswit@codeaurora.org>
Date: Wed, 11 Apr 2018 16:34:47 +0530

> On receiving a packet the state index points to the rstate which must be
> used to fill up IP and TCP headers. But if the state index points to a
> rstate which is unitialized, i.e. filled with zeros, it gets stuck in an
> infinite loop inside ip_fast_csum trying to compute the ip checsum of a
> header with zero length.
 ...
> Adding a variable to indicate if the current rstate is initialized. If
> such a packet arrives, move to toss state.
> 
> Signed-off-by: Tejaswi Tanikella <tejaswit@codeaurora.org>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH 1/5] dt-bindings: allow dwmac-sun8i to use other devices' exported regmap
From: Brüns, Stefan @ 2018-04-11 14:36 UTC (permalink / raw)
  To: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	icenowy-h8G6r0blFSE@public.gmane.org
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Giuseppe Cavallaro,
	Corentin Labbe, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20180411141641.14675-2-icenowy-h8G6r0blFSE@public.gmane.org>

On Mittwoch, 11. April 2018 16:16:37 CEST Icenowy Zheng wrote:
> On some Allwinner SoCs the EMAC clock register needed by dwmac-sun8i is
> in another device's memory space. In this situation dwmac-sun8i can use
> a regmap exported by the other device with only the EMAC clock register.
> 
> Document this situation in the dwmac-sun8i device tree binding
> documentation.
> 
> Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/net/dwmac-sun8i.txt | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
> b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt index
> 3d6d5fa0c4d5..0c5f63a80617 100644
> --- a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
> +++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
> @@ -20,8 +20,9 @@ Required properties:
>  - phy-handle: See ethernet.txt
>  - #address-cells: shall be 1
>  - #size-cells: shall be 0
> -- syscon: A phandle to the syscon of the SoC with one of the following
> - compatible string:
> +- syscon: A phandle to a device which exports the EMAC clock register as a
> + regmap or to the syscon of the SoC with one of the following compatible
... regmap, or ...

> + string:
string_s_:

>    - allwinner,sun8i-h3-system-controller
>    - allwinner,sun8i-v3s-system-controller
>    - allwinner,sun50i-a64-system-controller

Kind regards,

Stefan

^ permalink raw reply

* Re: [PATCH net] sctp: do not check port in sctp_inet6_cmp_addr
From: Neil Horman @ 2018-04-11 14:36 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, davem, Marcelo Ricardo Leitner
In-Reply-To: <340aad3be762046ca9d02e54edba5bfefa2f4e71.1523451485.git.lucien.xin@gmail.com>

On Wed, Apr 11, 2018 at 08:58:05PM +0800, Xin Long wrote:
> pf->cmp_addr() is called before binding a v6 address to the sock. It
> should not check ports, like in sctp_inet_cmp_addr.
> 
> But sctp_inet6_cmp_addr checks the addr by invoking af(6)->cmp_addr,
> sctp_v6_cmp_addr where it also compares the ports.
> 
> This would cause that setsockopt(SCTP_SOCKOPT_BINDX_ADD) could bind
> multiple duplicated IPv6 addresses after Commit 40b4f0fd74e4 ("sctp:
> lack the check for ports in sctp_v6_cmp_addr").
> 
> This patch is to remove af->cmp_addr called in sctp_inet6_cmp_addr,
> but do the proper check for both v6 addrs and v4mapped addrs.
> 
> Fixes: 40b4f0fd74e4 ("sctp: lack the check for ports in sctp_v6_cmp_addr")
> Reported-by: Jianwen Ji <jiji@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
>  net/sctp/ipv6.c | 27 ++++++++++++++++++++++++---
>  1 file changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index f1fc48e..be4b72c 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -846,8 +846,8 @@ static int sctp_inet6_cmp_addr(const union sctp_addr *addr1,
>  			       const union sctp_addr *addr2,
>  			       struct sctp_sock *opt)
>  {
> -	struct sctp_af *af1, *af2;
>  	struct sock *sk = sctp_opt2sk(opt);
> +	struct sctp_af *af1, *af2;
>  
>  	af1 = sctp_get_af_specific(addr1->sa.sa_family);
>  	af2 = sctp_get_af_specific(addr2->sa.sa_family);
> @@ -863,10 +863,31 @@ static int sctp_inet6_cmp_addr(const union sctp_addr *addr1,
>  	if (sctp_is_any(sk, addr1) || sctp_is_any(sk, addr2))
>  		return 1;
>  
> -	if (addr1->sa.sa_family != addr2->sa.sa_family)
> +	if (addr1->sa.sa_family != addr2->sa.sa_family) {
> +		if (addr1->sa.sa_family == AF_INET &&
> +		    addr2->sa.sa_family == AF_INET6 &&
> +		    ipv6_addr_v4mapped(&addr2->v6.sin6_addr))
> +			if (addr2->v6.sin6_addr.s6_addr32[3] ==
> +			    addr1->v4.sin_addr.s_addr)
> +				return 1;
> +		if (addr2->sa.sa_family == AF_INET &&
> +		    addr1->sa.sa_family == AF_INET6 &&
> +		    ipv6_addr_v4mapped(&addr1->v6.sin6_addr))
> +			if (addr1->v6.sin6_addr.s6_addr32[3] ==
> +			    addr2->v4.sin_addr.s_addr)
> +				return 1;
> +		return 0;
> +	}
> +
> +	if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
> +		return 0;
> +
> +	if ((ipv6_addr_type(&addr1->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) &&
> +	    addr1->v6.sin6_scope_id && addr2->v6.sin6_scope_id &&
> +	    addr1->v6.sin6_scope_id != addr2->v6.sin6_scope_id)
>  		return 0;
>  
> -	return af1->cmp_addr(addr1, addr2);
> +	return 1;
>  }
>  
>  /* Verify that the provided sockaddr looks bindable.   Common verification,
> -- 
> 2.1.0
> 
This looks correct to me, but is it worth duplicating the comparison code like
this from the cmp_addr function?  It might be more worthwhile to add a flag to
the cmp_addr method to direct weather it needs to check port values or not.
That way you could continue to use the cmp_addr function here.

Neil

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

^ permalink raw reply

* Re: [PATCH] cdc_ether: flag the Cinterion AHS8 modem by gemalto as WWAN
From: David Miller @ 2018-04-11 14:37 UTC (permalink / raw)
  To: oneukum; +Cc: bassem.boubaker, linux-kernel, linux-usb, netdev
In-Reply-To: <1523445938.22084.3.camel@suse.com>

From: Oliver Neukum <oneukum@suse.com>
Date: Wed, 11 Apr 2018 13:25:38 +0200

> Am Mittwoch, den 11.04.2018, 13:15 +0200 schrieb Bassem Boubaker:
>>     The Cinterion AHS8 is a 3G device with one embedded WWAN interface
>>     using cdc_ether as a driver.
>> 
>>     The modem is  controlled via AT commands through the exposed TTYs.
>> 
>>     AT+CGDCONT write command can be used to activate or deactivate a WWAN
>>     connection for a PDP context defined with the same command. UE supports
>>     one WWAN adapter.
>> 
>> Signed-off-by: Bassem Boubaker <bassem.boubaker@actia.fr>
> Acked-by: Oliver Neukum <oneukum@suse.com>

Applied and queued up for -stable.

^ permalink raw reply

* RE: [PATCH] lan78xx: Don't reset the interface on open
From: Nisar.Sayed @ 2018-04-11 14:37 UTC (permalink / raw)
  To: phil, Woojung.Huh, UNGLinuxDriver, agraf, tbogendoerfer, netdev,
	linux-usb, linux-kernel
In-Reply-To: <dc7f30e2-624c-17d8-911b-d20ce96c2652@raspberrypi.org>

Hi Phil,

> Hi Nisar,
> 
> On 10/04/2018 15:16, Nisar.Sayed@microchip.com wrote:
> > Thanks Phil, for identifying the issues.
> >
> >> -	ret = lan78xx_reset(dev);
> >> -	if (ret < 0)
> >> -		goto done;
> >> -
> >>  	phy_start(net->phydev);
> >>
> >>  	netif_dbg(dev, ifup, dev->net, "phy initialised successfully");
> >> --
> >
> > You may need to start the interrupts before "phy_start" instead of
> suppressing call to "lan78xx_reset".
> >
> > +             if (dev->domain_data.phyirq > 0)
> > +                             phy_start_interrupts(dev->net->phydev);
> 
> Shouldn't phy_connect_direct, called from lan78xx_phy_init, already have
> enabled interrupts for us?
> 
> This patch addresses two problems - time wasted by renegotiating the link
> after the reset and the missed interrupt - and I'd like both to be fixed. Unless
> you can come up with a good reason for performing the reset from the open
> handler I think it should be removed.
> 
> Phil

Thanks, we have verified suspected test cases and these are passed, the changes are good to go.

- Nisar

^ permalink raw reply

* Re: [PATCH linux] net: fix deadlock while clearing neighbor proxy table
From: David Miller @ 2018-04-11 14:38 UTC (permalink / raw)
  To: w.bumiller; +Cc: netdev, yoshfuji
In-Reply-To: <5acdfcbd910c6_a7b2ac7838cb0d497@olga.notmuch>

From: Wolfgang Bumiller <w.bumiller@proxmox.com>
Date: Wed, 11 Apr 2018 14:17:01 +0200

> David Miller wrote:
>> Another way is to rename pneigh_ifdown() to "pneigh_ifdown_and_unlock()".
> 
> Sure, I can send a v2 with whichever is preferred - personally I prefer
> the rename as it'll be visible at both the calling & implementation
> side.

Yeah the rename is probably best.

^ permalink raw reply

* Re: [PATCH net 0/2] Aquantia atlantic critical fixes 04/2018
From: David Miller @ 2018-04-11 14:41 UTC (permalink / raw)
  To: igor.russkikh; +Cc: netdev, darcari, pavel.belous
In-Reply-To: <cover.1523449097.git.igor.russkikh@aquantia.com>

From: Igor Russkikh <igor.russkikh@aquantia.com>
Date: Wed, 11 Apr 2018 15:23:23 +0300

> Two regressions on latest 4.16 driver reported by users
> 
> Some of old FW (1.5.44) had a link management logic which prevents
> driver to make clean reset. Driver of 4.16 has a full hardware reset
> implemented and that broke the link and traffic on such a cards.
> 
> Second is oops on shutdown callback in case interface is already
> closed or was never opened.

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH net] sctp: do not check port in sctp_inet6_cmp_addr
From: Marcelo Ricardo Leitner @ 2018-04-11 14:42 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman
In-Reply-To: <340aad3be762046ca9d02e54edba5bfefa2f4e71.1523451485.git.lucien.xin@gmail.com>

On Wed, Apr 11, 2018 at 08:58:05PM +0800, Xin Long wrote:
> pf->cmp_addr() is called before binding a v6 address to the sock. It
> should not check ports, like in sctp_inet_cmp_addr.
>
> But sctp_inet6_cmp_addr checks the addr by invoking af(6)->cmp_addr,
> sctp_v6_cmp_addr where it also compares the ports.
>
> This would cause that setsockopt(SCTP_SOCKOPT_BINDX_ADD) could bind
> multiple duplicated IPv6 addresses after Commit 40b4f0fd74e4 ("sctp:
> lack the check for ports in sctp_v6_cmp_addr").
>
> This patch is to remove af->cmp_addr called in sctp_inet6_cmp_addr,
> but do the proper check for both v6 addrs and v4mapped addrs.
>
> Fixes: 40b4f0fd74e4 ("sctp: lack the check for ports in sctp_v6_cmp_addr")
> Reported-by: Jianwen Ji <jiji@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

^ permalink raw reply

* Re: [RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
From: Michael S. Tsirkin @ 2018-04-11 14:45 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Samudrala, Sridhar, stephen, davem, netdev, virtualization,
	virtio-dev, jesse.brandeburg, alexander.h.duyck, kubakici,
	jasowang, loseweigh
In-Reply-To: <20180411080332.GL2028@nanopsycho>

On Wed, Apr 11, 2018 at 10:03:32AM +0200, Jiri Pirko wrote:
> Wed, Apr 11, 2018 at 08:24:43AM CEST, sridhar.samudrala@intel.com wrote:
> >On 4/10/2018 11:03 PM, Jiri Pirko wrote:
> >> Tue, Apr 10, 2018 at 05:59:02PM CEST, sridhar.samudrala@intel.com wrote:
> >> > On 4/10/2018 8:43 AM, Jiri Pirko wrote:
> >> > > Tue, Apr 10, 2018 at 05:27:48PM CEST, sridhar.samudrala@intel.com wrote:
> >> > > > On 4/10/2018 8:22 AM, Jiri Pirko wrote:
> >> > > > > Tue, Apr 10, 2018 at 05:13:40PM CEST, sridhar.samudrala@intel.com wrote:
> >> > > > > > On 4/10/2018 3:55 AM, Jiri Pirko wrote:
> >> > > > > > > Mon, Apr 09, 2018 at 08:47:06PM CEST, sridhar.samudrala@intel.com wrote:
> >> > > > > > > > On 4/9/2018 1:07 AM, Jiri Pirko wrote:
> >> > > > > > > > > Sat, Apr 07, 2018 at 12:59:14AM CEST, sridhar.samudrala@intel.com wrote:
> >> > > > > > > > > > On 4/6/2018 5:48 AM, Jiri Pirko wrote:
> >> > > > > > > > > > > Thu, Apr 05, 2018 at 11:08:22PM CEST, sridhar.samudrala@intel.com wrote:
> >> > > > > > > > > [...]
> >> > > > > > > > > 
> >> > > > > > > > > > > > +static int virtnet_bypass_join_child(struct net_device *bypass_netdev,
> >> > > > > > > > > > > > +				     struct net_device *child_netdev)
> >> > > > > > > > > > > > +{
> >> > > > > > > > > > > > +	struct virtnet_bypass_info *vbi;
> >> > > > > > > > > > > > +	bool backup;
> >> > > > > > > > > > > > +
> >> > > > > > > > > > > > +	vbi = netdev_priv(bypass_netdev);
> >> > > > > > > > > > > > +	backup = (child_netdev->dev.parent == bypass_netdev->dev.parent);
> >> > > > > > > > > > > > +	if (backup ? rtnl_dereference(vbi->backup_netdev) :
> >> > > > > > > > > > > > +			rtnl_dereference(vbi->active_netdev)) {
> >> > > > > > > > > > > > +		netdev_info(bypass_netdev,
> >> > > > > > > > > > > > +			    "%s attempting to join bypass dev when %s already present\n",
> >> > > > > > > > > > > > +			    child_netdev->name, backup ? "backup" : "active");
> >> > > > > > > > > > > Bypass module should check if there is already some other netdev
> >> > > > > > > > > > > enslaved and refuse right there.
> >> > > > > > > > > > This will work for virtio-net with 3 netdev model, but this check has to be done by netvsc
> >> > > > > > > > > > as its bypass_netdev is same as the backup_netdev.
> >> > > > > > > > > > Will add a flag while registering with the bypass module to indicate if the driver is doing
> >> > > > > > > > > > a 2 netdev or 3 netdev model and based on that flag this check can be done in bypass module
> >> > > > > > > > > > for 3 netdev scenario.
> >> > > > > > > > > Just let me undestand it clearly. What I expect the difference would be
> >> > > > > > > > > between 2netdev and3 netdev model is this:
> >> > > > > > > > > 2netdev:
> >> > > > > > > > >        bypass_master
> >> > > > > > > > >           /
> >> > > > > > > > >          /
> >> > > > > > > > > VF_slave
> >> > > > > > > > > 
> >> > > > > > > > > 3netdev:
> >> > > > > > > > >        bypass_master
> >> > > > > > > > >           /     \
> >> > > > > > > > >          /       \
> >> > > > > > > > > VF_slave   backup_slave
> >> > > > > > > > > 
> >> > > > > > > > > Is that correct? If not, how does it look like?
> >> > > > > > > > > 
> >> > > > > > > > > 
> >> > > > > > > > Looks correct.
> >> > > > > > > > VF_slave and backup_slave are the original netdevs and are present in both the models.
> >> > > > > > > > In the 3 netdev model, bypass_master netdev is created and VF_slave and backup_slave are
> >> > > > > > > > marked as the 2 slaves of this new netdev.
> >> > > > > > > You say it looks correct and in another sentence you provide completely
> >> > > > > > > different description. Could you please look again?
> >> > > > > > > 
> >> > > > > > To be exact, 2 netdev model with netvsc looks like this.
> >> > > > > > 
> >> > > > > >       netvsc_netdev
> >> > > > > >         /
> >> > > > > >        /
> >> > > > > > VF_slave
> >> > > > > > 
> >> > > > > > With virtio_net, 3 netdev model
> >> > > > > > 
> >> > > > > >     bypass_netdev
> >> > > > > >         /     \
> >> > > > > >        /       \
> >> > > > > > VF_slave   virtio_net netdev
> >> > > > > Could you also mark the original netdev which is there now? is it
> >> > > > > bypass_netdev or virtio_net_netdev ?
> >> > > > bypass_netdev
> >> > > >       /     \
> >> > > >      /       \
> >> > > > VF_slave   virtio_net netdev (original)
> >> > > That does not make sense.
> >> > > 1) You diverge from the behaviour of the netvsc, where the original
> >> > >      netdev is a master of the VF
> >> > > 2) If the original netdev is a slave, you cannot have any IP address
> >> > >      configured on it (well you could, but the rx_handler would eat every
> >> > >      incoming packet). So you will break the user bacause he would have to
> >> > >      move the configuration to the new master device.
> >> > > This only makes sense that the original netdev becomes the master for both
> >> > > netvsc and virtio_net.
> >> > Forgot to mention that bypass_netdev takes over the name of the original
> >> > netdev and
> >> > virtio_net netdev will get the backup name.
> >> What do you mean by "name"?
> >
> >bypass_netdev also is associated with the same pci device as the original virtio_net
> >netdev via SET_NETDEV_DEV().  Also, we added ndo_get_phys_port_name() to virtio_net
> >that will return _bkup when BACKUP feature is enabled.
> 
> Okay.
> 
> >
> >So for ex: if virtio_net inteface was getting 'ens12' as the name assigned by udev
> >without BACKUP feature,  when BACKUP feature is enabled,  the  bypass_netdev will be
> >named 'ens12' and the original virtio_net will get named as ens12n_bkup.
> 
> Got it.
> 
> I don't like the bypass_master to look differently in netvsc and
> virtio_net :/ The best would be to convert netvsc to 3 netdev model and
> treat them the same. The more I think about it, the more the 2 netdev
> model feels wrong.

If you believe that, then this patchset is a step in the right
direction.

With something like this patchset applied, converting netvsc to a 3
device model will presumably be just a flag flip away. Afterwards
we'll be able to drop dead code handling the bypass_master flag.

> 
> >
> >
> >> 
> >> > So the userspace network configuration doesn't need to change.
> >> > 
> >> > 
> >

^ permalink raw reply

* Re: [PATCH net] sctp: do not check port in sctp_inet6_cmp_addr
From: Marcelo Ricardo Leitner @ 2018-04-11 14:51 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman
In-Reply-To: <20180411144241.GA3711@localhost.localdomain>

On Wed, Apr 11, 2018 at 11:42:41AM -0300, Marcelo Ricardo Leitner wrote:
> On Wed, Apr 11, 2018 at 08:58:05PM +0800, Xin Long wrote:
> > pf->cmp_addr() is called before binding a v6 address to the sock. It
> > should not check ports, like in sctp_inet_cmp_addr.
> >
> > But sctp_inet6_cmp_addr checks the addr by invoking af(6)->cmp_addr,
> > sctp_v6_cmp_addr where it also compares the ports.
> >
> > This would cause that setsockopt(SCTP_SOCKOPT_BINDX_ADD) could bind
> > multiple duplicated IPv6 addresses after Commit 40b4f0fd74e4 ("sctp:
> > lack the check for ports in sctp_v6_cmp_addr").
> >
> > This patch is to remove af->cmp_addr called in sctp_inet6_cmp_addr,
> > but do the proper check for both v6 addrs and v4mapped addrs.
> >
> > Fixes: 40b4f0fd74e4 ("sctp: lack the check for ports in sctp_v6_cmp_addr")
> > Reported-by: Jianwen Ji <jiji@redhat.com>
> > Signed-off-by: Xin Long <lucien.xin@gmail.com>
>
> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Sorry, I take this back.

^ permalink raw reply

* Re: [PATCH net] sctp: do not check port in sctp_inet6_cmp_addr
From: David Miller @ 2018-04-11 14:51 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman
In-Reply-To: <340aad3be762046ca9d02e54edba5bfefa2f4e71.1523451485.git.lucien.xin@gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Wed, 11 Apr 2018 20:58:05 +0800

> @@ -863,10 +863,31 @@ static int sctp_inet6_cmp_addr(const union sctp_addr *addr1,
>  	if (sctp_is_any(sk, addr1) || sctp_is_any(sk, addr2))
>  		return 1;
>  
> -	if (addr1->sa.sa_family != addr2->sa.sa_family)
> +	if (addr1->sa.sa_family != addr2->sa.sa_family) {
> +		if (addr1->sa.sa_family == AF_INET &&
> +		    addr2->sa.sa_family == AF_INET6 &&
> +		    ipv6_addr_v4mapped(&addr2->v6.sin6_addr))
> +			if (addr2->v6.sin6_addr.s6_addr32[3] ==
> +			    addr1->v4.sin_addr.s_addr)
> +				return 1;
> +		if (addr2->sa.sa_family == AF_INET &&
> +		    addr1->sa.sa_family == AF_INET6 &&
> +		    ipv6_addr_v4mapped(&addr1->v6.sin6_addr))
> +			if (addr1->v6.sin6_addr.s6_addr32[3] ==
> +			    addr2->v4.sin_addr.s_addr)
> +				return 1;
> +		return 0;
> +	}
> +
> +	if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
> +		return 0;
> +
> +	if ((ipv6_addr_type(&addr1->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) &&
> +	    addr1->v6.sin6_scope_id && addr2->v6.sin6_scope_id &&
> +	    addr1->v6.sin6_scope_id != addr2->v6.sin6_scope_id)
>  		return 0;
>  
> -	return af1->cmp_addr(addr1, addr2);
> +	return 1;
>  }

I agree with Neil that we should try to avoid the code duplication here
somehow.

Although we risk gcc emitting two copies of the function if we do
something like:

__sctp_v6_cmp_addr(addr1, addr2, check_ports)
{
}

sctp_v6_cmp_addr(addr, addr2)
{
	return __sctp_v6_cmp_addr(addr1, addr2, true);
}

and invoke __sctp_v6_cmp_addr(addr1, addr2, true) from sctp_inet6_cmp_addr().

^ permalink raw reply

* Re: [RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
From: Jiri Pirko @ 2018-04-11 14:51 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Samudrala, Sridhar, stephen, davem, netdev, virtualization,
	virtio-dev, jesse.brandeburg, alexander.h.duyck, kubakici,
	jasowang, loseweigh
In-Reply-To: <20180411174157-mutt-send-email-mst@kernel.org>

Wed, Apr 11, 2018 at 04:45:07PM CEST, mst@redhat.com wrote:
>On Wed, Apr 11, 2018 at 10:03:32AM +0200, Jiri Pirko wrote:
>> Wed, Apr 11, 2018 at 08:24:43AM CEST, sridhar.samudrala@intel.com wrote:
>> >On 4/10/2018 11:03 PM, Jiri Pirko wrote:
>> >> Tue, Apr 10, 2018 at 05:59:02PM CEST, sridhar.samudrala@intel.com wrote:
>> >> > On 4/10/2018 8:43 AM, Jiri Pirko wrote:
>> >> > > Tue, Apr 10, 2018 at 05:27:48PM CEST, sridhar.samudrala@intel.com wrote:
>> >> > > > On 4/10/2018 8:22 AM, Jiri Pirko wrote:
>> >> > > > > Tue, Apr 10, 2018 at 05:13:40PM CEST, sridhar.samudrala@intel.com wrote:
>> >> > > > > > On 4/10/2018 3:55 AM, Jiri Pirko wrote:
>> >> > > > > > > Mon, Apr 09, 2018 at 08:47:06PM CEST, sridhar.samudrala@intel.com wrote:
>> >> > > > > > > > On 4/9/2018 1:07 AM, Jiri Pirko wrote:
>> >> > > > > > > > > Sat, Apr 07, 2018 at 12:59:14AM CEST, sridhar.samudrala@intel.com wrote:
>> >> > > > > > > > > > On 4/6/2018 5:48 AM, Jiri Pirko wrote:
>> >> > > > > > > > > > > Thu, Apr 05, 2018 at 11:08:22PM CEST, sridhar.samudrala@intel.com wrote:
>> >> > > > > > > > > [...]
>> >> > > > > > > > > 
>> >> > > > > > > > > > > > +static int virtnet_bypass_join_child(struct net_device *bypass_netdev,
>> >> > > > > > > > > > > > +				     struct net_device *child_netdev)
>> >> > > > > > > > > > > > +{
>> >> > > > > > > > > > > > +	struct virtnet_bypass_info *vbi;
>> >> > > > > > > > > > > > +	bool backup;
>> >> > > > > > > > > > > > +
>> >> > > > > > > > > > > > +	vbi = netdev_priv(bypass_netdev);
>> >> > > > > > > > > > > > +	backup = (child_netdev->dev.parent == bypass_netdev->dev.parent);
>> >> > > > > > > > > > > > +	if (backup ? rtnl_dereference(vbi->backup_netdev) :
>> >> > > > > > > > > > > > +			rtnl_dereference(vbi->active_netdev)) {
>> >> > > > > > > > > > > > +		netdev_info(bypass_netdev,
>> >> > > > > > > > > > > > +			    "%s attempting to join bypass dev when %s already present\n",
>> >> > > > > > > > > > > > +			    child_netdev->name, backup ? "backup" : "active");
>> >> > > > > > > > > > > Bypass module should check if there is already some other netdev
>> >> > > > > > > > > > > enslaved and refuse right there.
>> >> > > > > > > > > > This will work for virtio-net with 3 netdev model, but this check has to be done by netvsc
>> >> > > > > > > > > > as its bypass_netdev is same as the backup_netdev.
>> >> > > > > > > > > > Will add a flag while registering with the bypass module to indicate if the driver is doing
>> >> > > > > > > > > > a 2 netdev or 3 netdev model and based on that flag this check can be done in bypass module
>> >> > > > > > > > > > for 3 netdev scenario.
>> >> > > > > > > > > Just let me undestand it clearly. What I expect the difference would be
>> >> > > > > > > > > between 2netdev and3 netdev model is this:
>> >> > > > > > > > > 2netdev:
>> >> > > > > > > > >        bypass_master
>> >> > > > > > > > >           /
>> >> > > > > > > > >          /
>> >> > > > > > > > > VF_slave
>> >> > > > > > > > > 
>> >> > > > > > > > > 3netdev:
>> >> > > > > > > > >        bypass_master
>> >> > > > > > > > >           /     \
>> >> > > > > > > > >          /       \
>> >> > > > > > > > > VF_slave   backup_slave
>> >> > > > > > > > > 
>> >> > > > > > > > > Is that correct? If not, how does it look like?
>> >> > > > > > > > > 
>> >> > > > > > > > > 
>> >> > > > > > > > Looks correct.
>> >> > > > > > > > VF_slave and backup_slave are the original netdevs and are present in both the models.
>> >> > > > > > > > In the 3 netdev model, bypass_master netdev is created and VF_slave and backup_slave are
>> >> > > > > > > > marked as the 2 slaves of this new netdev.
>> >> > > > > > > You say it looks correct and in another sentence you provide completely
>> >> > > > > > > different description. Could you please look again?
>> >> > > > > > > 
>> >> > > > > > To be exact, 2 netdev model with netvsc looks like this.
>> >> > > > > > 
>> >> > > > > >       netvsc_netdev
>> >> > > > > >         /
>> >> > > > > >        /
>> >> > > > > > VF_slave
>> >> > > > > > 
>> >> > > > > > With virtio_net, 3 netdev model
>> >> > > > > > 
>> >> > > > > >     bypass_netdev
>> >> > > > > >         /     \
>> >> > > > > >        /       \
>> >> > > > > > VF_slave   virtio_net netdev
>> >> > > > > Could you also mark the original netdev which is there now? is it
>> >> > > > > bypass_netdev or virtio_net_netdev ?
>> >> > > > bypass_netdev
>> >> > > >       /     \
>> >> > > >      /       \
>> >> > > > VF_slave   virtio_net netdev (original)
>> >> > > That does not make sense.
>> >> > > 1) You diverge from the behaviour of the netvsc, where the original
>> >> > >      netdev is a master of the VF
>> >> > > 2) If the original netdev is a slave, you cannot have any IP address
>> >> > >      configured on it (well you could, but the rx_handler would eat every
>> >> > >      incoming packet). So you will break the user bacause he would have to
>> >> > >      move the configuration to the new master device.
>> >> > > This only makes sense that the original netdev becomes the master for both
>> >> > > netvsc and virtio_net.
>> >> > Forgot to mention that bypass_netdev takes over the name of the original
>> >> > netdev and
>> >> > virtio_net netdev will get the backup name.
>> >> What do you mean by "name"?
>> >
>> >bypass_netdev also is associated with the same pci device as the original virtio_net
>> >netdev via SET_NETDEV_DEV().  Also, we added ndo_get_phys_port_name() to virtio_net
>> >that will return _bkup when BACKUP feature is enabled.
>> 
>> Okay.
>> 
>> >
>> >So for ex: if virtio_net inteface was getting 'ens12' as the name assigned by udev
>> >without BACKUP feature,  when BACKUP feature is enabled,  the  bypass_netdev will be
>> >named 'ens12' and the original virtio_net will get named as ens12n_bkup.
>> 
>> Got it.
>> 
>> I don't like the bypass_master to look differently in netvsc and
>> virtio_net :/ The best would be to convert netvsc to 3 netdev model and
>> treat them the same. The more I think about it, the more the 2 netdev
>> model feels wrong.
>
>If you believe that, then this patchset is a step in the right
>direction.
>
>With something like this patchset applied, converting netvsc to a 3
>device model will presumably be just a flag flip away. Afterwards

If done properly. Yes.

>we'll be able to drop dead code handling the bypass_master flag.
>
>> 
>> >
>> >
>> >> 
>> >> > So the userspace network configuration doesn't need to change.
>> >> > 
>> >> > 
>> >

^ permalink raw reply

* RE: [PATCH v1 net 0/3] lan78xx: Fixes and enhancements
From: RaghuramChary.Jallipalli @ 2018-04-11 14:54 UTC (permalink / raw)
  To: davem; +Cc: netdev, UNGLinuxDriver, Woojung.Huh
In-Reply-To: <20180411.102009.742541645869806513.davem@davemloft.net>

> 
> > These series of patches have fix and enhancements for lan78xx driver.
> 
> Two problems with this series:
> 
> 1) Only bug fixes are appropriate at this time.  Features and "enhancements"
>    belong in net-next which is not open right now.
> 
> 2) Patch #3 doesn't even apply cleanly.  Always base your patches on the
>    current tree.
> 
Sure, will send  #2,#3 patches in net-next when it opens.
Also will make sure they will be based on current tree.

Thanks,
Raghu

^ permalink raw reply

* [PATCH net 0/2] ibmvnic: Fix parameter change request handling
From: Nathan Fontenot @ 2018-04-11 14:37 UTC (permalink / raw)
  To: netdev; +Cc: jallen, tlfalcon

When updating parameters for the ibmvnic driver there is a possibility
of entering an infinite loop if a return value other that a partial
success is received from sending the login CRQ.

Also, a deadlock can occur on the rtnl lock if netdev_notify_peers()
is called during driver reset for a parameter change reset.

This patch set corrects both of these issues by updating the return
code handling in ibmvnic_login() nand gaurding against calling
netdev_notify_peers() for parameter change requests.

-Nathan
---

Nathan Fontenot (2):
      ibmvnic: Handle all login error conditions
      ibmvnic: Do not notify peers on parameter change resets


 drivers/net/ethernet/ibm/ibmvnic.c |   58 +++++++++++++++++++++++-------------
 drivers/net/ethernet/ibm/ibmvnic.h |    1 -
 2 files changed, 37 insertions(+), 22 deletions(-)

^ permalink raw reply

* [PATCH net 1/2] ibmvnic: Handle all login error conditions
From: Nathan Fontenot @ 2018-04-11 14:37 UTC (permalink / raw)
  To: netdev; +Cc: jallen, tlfalcon
In-Reply-To: <152345733402.41721.15717591824692008270.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com>

There is a bug in handling the possible return codes from sending the
login CRQ. The current code treats any non-success return value,
minus failure to send the crq and a timeout waiting for a login response,
as a need to re-send the login CRQ. This can put the drive in an
inifinite loop of trying to login when getting return values other
that a partial success such as a return code of aborted. For these
scenarios the login will not ever succeed at this point and the
driver would need to be reset again.

To resolve this loop trying to login is updated to only retry the
login if the driver gets a return code of a partial success. Other
return coes are treated as an error and the driver returns an error
from ibmvnic_login().

To avoid infinite looping in the partial success return cases, the
number of retries is capped at the maximum number of supported
queues. This value was chosen because the driver does a renegatiation
of capabilities which sets the number of queus possible and allows
the driver to attempt a login for possible value for the number
of queues supported.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c |   55 +++++++++++++++++++++++-------------
 drivers/net/ethernet/ibm/ibmvnic.h |    1 -
 2 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index aad5658d79d5..c6d5e9448eef 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -794,46 +794,61 @@ static int ibmvnic_login(struct net_device *netdev)
 {
 	struct ibmvnic_adapter *adapter = netdev_priv(netdev);
 	unsigned long timeout = msecs_to_jiffies(30000);
-	struct device *dev = &adapter->vdev->dev;
+	int retry_count = 0;
 	int rc;
 
 	do {
-		if (adapter->renegotiate) {
-			adapter->renegotiate = false;
+		if (retry_count > IBMVNIC_MAX_QUEUES) {
+			netdev_warn(netdev, "Login attempts exceeded\n");
+			return -1;
+		}
+
+		adapter->init_done_rc = 0;
+		reinit_completion(&adapter->init_done);
+		rc = send_login(adapter);
+		if (rc) {
+			netdev_warn(netdev, "Unable to login\n");
+			return rc;
+		}
+
+		if (!wait_for_completion_timeout(&adapter->init_done,
+						 timeout)) {
+			netdev_warn(netdev, "Login timed out\n");
+			return -1;
+		}
+
+		if (adapter->init_done_rc == PARTIALSUCCESS) {
+			retry_count++;
 			release_sub_crqs(adapter, 1);
 
+			adapter->init_done_rc = 0;
 			reinit_completion(&adapter->init_done);
 			send_cap_queries(adapter);
 			if (!wait_for_completion_timeout(&adapter->init_done,
 							 timeout)) {
-				dev_err(dev, "Capabilities query timeout\n");
+				netdev_warn(netdev,
+					    "Capabilities query timed out\n");
 				return -1;
 			}
+
 			rc = init_sub_crqs(adapter);
 			if (rc) {
-				dev_err(dev,
-					"Initialization of SCRQ's failed\n");
+				netdev_warn(netdev,
+					    "SCRQ initialization failed\n");
 				return -1;
 			}
+
 			rc = init_sub_crq_irqs(adapter);
 			if (rc) {
-				dev_err(dev,
-					"Initialization of SCRQ's irqs failed\n");
+				netdev_warn(netdev,
+					    "SCRQ irq initialization failed\n");
 				return -1;
 			}
-		}
-
-		reinit_completion(&adapter->init_done);
-		rc = send_login(adapter);
-		if (rc) {
-			dev_err(dev, "Unable to attempt device login\n");
-			return rc;
-		} else if (!wait_for_completion_timeout(&adapter->init_done,
-						 timeout)) {
-			dev_err(dev, "Login timeout\n");
+		} else if (adapter->init_done_rc) {
+			netdev_warn(netdev, "Adapter login failed\n");
 			return -1;
 		}
-	} while (adapter->renegotiate);
+	} while (adapter->init_done_rc == PARTIALSUCCESS);
 
 	/* handle pending MAC address changes after successful login */
 	if (adapter->mac_change_pending) {
@@ -3942,7 +3957,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
 	 * to resend the login buffer with fewer queues requested.
 	 */
 	if (login_rsp_crq->generic.rc.code) {
-		adapter->renegotiate = true;
+		adapter->init_done_rc = login_rsp_crq->generic.rc.code;
 		complete(&adapter->init_done);
 		return 0;
 	}
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index 99c0b58c2c39..22391e8805f6 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -1035,7 +1035,6 @@ struct ibmvnic_adapter {
 
 	struct ibmvnic_sub_crq_queue **tx_scrq;
 	struct ibmvnic_sub_crq_queue **rx_scrq;
-	bool renegotiate;
 
 	/* rx structs */
 	struct napi_struct *napi;

^ permalink raw reply related

* Re: [PATCH v3 0/2] vhost: fix vhost_vq_access_ok() log check
From: David Miller @ 2018-04-11 14:55 UTC (permalink / raw)
  To: mst
  Cc: stefanha, virtualization, torvalds, jasowang, netdev,
	syzkaller-bugs, kvm, linux-kernel
In-Reply-To: <20180411162345-mutt-send-email-mst@kernel.org>

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Wed, 11 Apr 2018 16:24:02 +0300

> On Wed, Apr 11, 2018 at 10:35:39AM +0800, Stefan Hajnoczi wrote:
>> v3:
>>  * Rebased onto net/master and resolved conflict [DaveM]
>> 
>> v2:
>>  * Rewrote the conditional to make the vq access check clearer [Linus]
>>  * Added Patch 2 to make the return type consistent and harder to misuse [Linus]
>> 
>> The first patch fixes the vhost virtqueue access check which was recently
>> broken.  The second patch replaces the int return type with bool to prevent
>> future bugs.
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> 
> We need the 1st one on stable I think.

Series applied and patch #1 queued up for -stable.

^ permalink raw reply

* [PATCH net 2/2] ibmvnic: Do not notify peers on parameter change resets
From: Nathan Fontenot @ 2018-04-11 14:37 UTC (permalink / raw)
  To: netdev; +Cc: jallen, tlfalcon
In-Reply-To: <152345733402.41721.15717591824692008270.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com>

When attempting to change the driver parameters, such as the MTU
value or number of queues, do not call netdev_notify_peers().
Doing so will deadlock on the rtnl_lock.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index c6d5e9448eef..fdca1ea5bbf9 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1843,7 +1843,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 	for (i = 0; i < adapter->req_rx_queues; i++)
 		napi_schedule(&adapter->napi[i]);
 
-	if (adapter->reset_reason != VNIC_RESET_FAILOVER)
+	if (adapter->reset_reason != VNIC_RESET_FAILOVER &&
+	    adapter->reset_reason != VNIC_RESET_CHANGE_PARAM)
 		netdev_notify_peers(netdev);
 
 	netif_carrier_on(netdev);

^ permalink raw reply related

* Re: WARNING in kobject_add_internal
From: Dmitry Vyukov @ 2018-04-11 14:57 UTC (permalink / raw)
  To: syzbot
  Cc: bridge, David Miller, Greg Kroah-Hartman, LKML, netdev,
	stephen hemminger, syzkaller-bugs
In-Reply-To: <001a113f8036fab00405620e4d72@google.com>

On Fri, Jan 5, 2018 at 10:41 PM, syzbot
<syzbot+e204ced820ef739d71ef5438f5e1976a874abc8d@syzkaller.appspotmail.com>
wrote:
> syzkaller has found reproducer for the following crash on
> 89876f275e8d562912d9c238cd888b52065cf25c
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master
> compiler: gcc (GCC) 7.1.1 20170620
> .config is attached
> Raw console output is attached.
> C reproducer is attached
> syzkaller reproducer is attached. See https://goo.gl/kgGztJ
> for information about syzkaller reproducers
>
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by:
> syzbot+e204ced820ef739d71ef5438f5e1976a874abc8d@syzkaller.appspotmail.com
> It will help syzbot understand when the bug is fixed.

#syz dup: WARNING: kobject bug in device_add

> ------------[ cut here ]------------
> kobject_add_internal failed for   (error: -12 parent: net)
> WARNING: CPU: 1 PID: 3494 at lib/kobject.c:244
> kobject_add_internal+0x3f6/0xbc0 lib/kobject.c:242
> Kernel panic - not syncing: panic_on_warn set ...
>
> CPU: 1 PID: 3494 Comm: syzkaller425998 Not tainted 4.15.0-rc6+ #249
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011
> Call Trace:
>  __dump_stack lib/dump_stack.c:17 [inline]
>  dump_stack+0x194/0x257 lib/dump_stack.c:53
>  panic+0x1e4/0x41c kernel/panic.c:183
>  __warn+0x1dc/0x200 kernel/panic.c:547
>  report_bug+0x211/0x2d0 lib/bug.c:184
>  fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
>  fixup_bug arch/x86/kernel/traps.c:247 [inline]
>  do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
>  do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
>  invalid_op+0x22/0x40 arch/x86/entry/entry_64.S:1079
> RIP: 0010:kobject_add_internal+0x3f6/0xbc0 lib/kobject.c:242
> RSP: 0018:ffff8801c53c76f0 EFLAGS: 00010286
> RAX: dffffc0000000008 RBX: ffff8801bf5a88d8 RCX: ffffffff8159da9e
> RDX: 0000000000000000 RSI: 1ffff10038a78e99 RDI: ffff8801c53c73f8
> RBP: ffff8801c53c77e8 R08: 1ffff10038a78e5b R09: 0000000000000000
> R10: ffff8801c53c74b0 R11: 0000000000000000 R12: 1ffff10038a78ee4
> R13: 00000000fffffff4 R14: ffff8801d8359a80 R15: ffffffff86201980
>  kobject_add_varg lib/kobject.c:366 [inline]
>  kobject_add+0x132/0x1f0 lib/kobject.c:411
>  device_add+0x35d/0x1650 drivers/base/core.c:1787
>  netdev_register_kobject+0x183/0x360 net/core/net-sysfs.c:1604
>  register_netdevice+0xb2b/0x1010 net/core/dev.c:7698
>  tun_set_iff drivers/net/tun.c:2319 [inline]
>  __tun_chr_ioctl+0x1d89/0x3dd0 drivers/net/tun.c:2524
>  tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2773
>  vfs_ioctl fs/ioctl.c:46 [inline]
>  do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
>  SYSC_ioctl fs/ioctl.c:701 [inline]
>  SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
>  entry_SYSCALL_64_fastpath+0x23/0x9a
> RIP: 0033:0x444fc9
> RSP: 002b:00007fff53389dc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000444fc9
> RDX: 0000000020533000 RSI: 00000000400454ca RDI: 0000000000000004
> RBP: 0000000000000005 R08: 0000000000000002 R09: 0000006f00003131
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000402500
> R13: 0000000000402590 R14: 0000000000000000 R15: 0000000000000000
>
> Dumping ftrace buffer:
>    (ftrace buffer empty)
> Kernel Offset: disabled
> Rebooting in 86400 seconds..
>

^ permalink raw reply

* Re: [PATCH] dec: tulip: de4x5: Replace mdelay with usleep_range in de4x5_hw_init
From: kbuild test robot @ 2018-04-11 14:58 UTC (permalink / raw)
  To: Jia-Ju Bai
  Cc: kbuild-all, davem, dhowells, stephen, johannes.berg,
	arvind.yadav.cs, netdev, linux-parisc, linux-kernel, Jia-Ju Bai
In-Reply-To: <1523412054-2108-1-git-send-email-baijiaju1990@gmail.com>

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

Hi Jia-Ju,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]
[also build test ERROR on v4.16 next-20180411]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Jia-Ju-Bai/dec-tulip-de4x5-Replace-mdelay-with-usleep_range-in-de4x5_hw_init/20180411-222527
config: i386-randconfig-x015-201814 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/net//ethernet/dec/tulip/de4x5.c: In function 'de4x5_hw_init':
>> drivers/net//ethernet/dec/tulip/de4x5.c:1110:5: error: implicit declaration of function 'usleep'; did you mean 'ssleep'? [-Werror=implicit-function-declaration]
        usleep(10000, 11000);
        ^~~~~~
        ssleep
   cc1: some warnings being treated as errors

vim +1110 drivers/net//ethernet/dec/tulip/de4x5.c

  1091	
  1092	
  1093	static int
  1094	de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
  1095	{
  1096	    char name[DE4X5_NAME_LENGTH + 1];
  1097	    struct de4x5_private *lp = netdev_priv(dev);
  1098	    struct pci_dev *pdev = NULL;
  1099	    int i, status=0;
  1100	
  1101	    dev_set_drvdata(gendev, dev);
  1102	
  1103	    /* Ensure we're not sleeping */
  1104	    if (lp->bus == EISA) {
  1105		outb(WAKEUP, PCI_CFPM);
  1106	    } else {
  1107		pdev = to_pci_dev (gendev);
  1108		pci_write_config_byte(pdev, PCI_CFDA_PSM, WAKEUP);
  1109	    }
> 1110	    usleep(10000, 11000);
  1111	
  1112	    RESET_DE4X5;
  1113	
  1114	    if ((inl(DE4X5_STS) & (STS_TS | STS_RS)) != 0) {
  1115		return -ENXIO;                       /* Hardware could not reset */
  1116	    }
  1117	
  1118	    /*
  1119	    ** Now find out what kind of DC21040/DC21041/DC21140 board we have.
  1120	    */
  1121	    lp->useSROM = false;
  1122	    if (lp->bus == PCI) {
  1123		PCI_signature(name, lp);
  1124	    } else {
  1125		EISA_signature(name, gendev);
  1126	    }
  1127	
  1128	    if (*name == '\0') {                     /* Not found a board signature */
  1129		return -ENXIO;
  1130	    }
  1131	
  1132	    dev->base_addr = iobase;
  1133	    printk ("%s: %s at 0x%04lx", dev_name(gendev), name, iobase);
  1134	
  1135	    status = get_hw_addr(dev);
  1136	    printk(", h/w address %pM\n", dev->dev_addr);
  1137	
  1138	    if (status != 0) {
  1139		printk("      which has an Ethernet PROM CRC error.\n");
  1140		return -ENXIO;
  1141	    } else {
  1142		skb_queue_head_init(&lp->cache.queue);
  1143		lp->cache.gepc = GEP_INIT;
  1144		lp->asBit = GEP_SLNK;
  1145		lp->asPolarity = GEP_SLNK;
  1146		lp->asBitValid = ~0;
  1147		lp->timeout = -1;
  1148		lp->gendev = gendev;
  1149		spin_lock_init(&lp->lock);
  1150		timer_setup(&lp->timer, de4x5_ast, 0);
  1151		de4x5_parse_params(dev);
  1152	
  1153		/*
  1154		** Choose correct autosensing in case someone messed up
  1155		*/
  1156	        lp->autosense = lp->params.autosense;
  1157	        if (lp->chipset != DC21140) {
  1158	            if ((lp->chipset==DC21040) && (lp->params.autosense&TP_NW)) {
  1159	                lp->params.autosense = TP;
  1160	            }
  1161	            if ((lp->chipset==DC21041) && (lp->params.autosense&BNC_AUI)) {
  1162	                lp->params.autosense = BNC;
  1163	            }
  1164	        }
  1165		lp->fdx = lp->params.fdx;
  1166		sprintf(lp->adapter_name,"%s (%s)", name, dev_name(gendev));
  1167	
  1168		lp->dma_size = (NUM_RX_DESC + NUM_TX_DESC) * sizeof(struct de4x5_desc);
  1169	#if defined(__alpha__) || defined(__powerpc__) || defined(CONFIG_SPARC) || defined(DE4X5_DO_MEMCPY)
  1170		lp->dma_size += RX_BUFF_SZ * NUM_RX_DESC + DE4X5_ALIGN;
  1171	#endif
  1172		lp->rx_ring = dma_alloc_coherent(gendev, lp->dma_size,
  1173						 &lp->dma_rings, GFP_ATOMIC);
  1174		if (lp->rx_ring == NULL) {
  1175		    return -ENOMEM;
  1176		}
  1177	
  1178		lp->tx_ring = lp->rx_ring + NUM_RX_DESC;
  1179	
  1180		/*
  1181		** Set up the RX descriptor ring (Intels)
  1182		** Allocate contiguous receive buffers, long word aligned (Alphas)
  1183		*/
  1184	#if !defined(__alpha__) && !defined(__powerpc__) && !defined(CONFIG_SPARC) && !defined(DE4X5_DO_MEMCPY)
  1185		for (i=0; i<NUM_RX_DESC; i++) {
  1186		    lp->rx_ring[i].status = 0;
  1187		    lp->rx_ring[i].des1 = cpu_to_le32(RX_BUFF_SZ);
  1188		    lp->rx_ring[i].buf = 0;
  1189		    lp->rx_ring[i].next = 0;
  1190		    lp->rx_skb[i] = (struct sk_buff *) 1;     /* Dummy entry */
  1191		}
  1192	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31227 bytes --]

^ 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