Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1593854 > unrolled thread

[PATCH net-next 1/5] ldmvsw: better use of link up and down on ldom vswitch

Started byShannon Nelson <shannon.nelson@oracle.com>
First post2017-03-07 03:10 +0100
Last post2017-03-07 05:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH net-next 1/5] ldmvsw: better use of link up and down on ldom vswitch Shannon Nelson <shannon.nelson@oracle.com> - 2017-03-07 03:10 +0100
    Re: [PATCH net-next 1/5] ldmvsw: better use of link up and down on  ldom vswitch Florian Fainelli <f.fainelli@gmail.com> - 2017-03-07 05:00 +0100
      Re: [PATCH net-next 1/5] ldmvsw: better use of link up and down on  ldom vswitch Shannon Nelson <shannon.nelson@oracle.com> - 2017-03-07 05:50 +0100

#1593854 — [PATCH net-next 1/5] ldmvsw: better use of link up and down on ldom vswitch

FromShannon Nelson <shannon.nelson@oracle.com>
Date2017-03-07 03:10 +0100
Subject[PATCH net-next 1/5] ldmvsw: better use of link up and down on ldom vswitch
Message-ID<ticJz-ns-7@gated-at.bofh.it>
When an ldom VM is bound, the network vswitch infrastructure is set up for
it, but was being forced 'UP' by the userland switch configuration script.
When 'UP' but not actually connected to a running VM, the ipv6 neighbor
probes fail (not a horrible thing) and start cluttering up the kernel logs.
Funny thing: these are debug messages that never actually show up, but
we do see the net_ratelimited messages that say N callbacks were
suppressed.

This patch defers the netif_carrier_on() until an actual link has been
established with the VM, as indicated by receiving an LDC_EVENT_UP from
the underlying LDC protocol.  Similarly, we take the link down when we
see the LDC_EVENT_RESET.

Orabug: 25525312

Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
---
 drivers/net/ethernet/sun/ldmvsw.c         |   10 +++++++---
 drivers/net/ethernet/sun/sunvnet_common.c |   14 ++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/sun/ldmvsw.c b/drivers/net/ethernet/sun/ldmvsw.c
index 89952de..c6f6d59 100644
--- a/drivers/net/ethernet/sun/ldmvsw.c
+++ b/drivers/net/ethernet/sun/ldmvsw.c
@@ -41,8 +41,8 @@
 static u8 vsw_port_hwaddr[ETH_ALEN] = {0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
 
 #define DRV_MODULE_NAME		"ldmvsw"
-#define DRV_MODULE_VERSION	"1.1"
-#define DRV_MODULE_RELDATE	"February 3, 2017"
+#define DRV_MODULE_VERSION	"1.2"
+#define DRV_MODULE_RELDATE	"March 4, 2017"
 
 static char version[] =
 	DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")";
@@ -133,7 +133,6 @@ static void vsw_poll_controller(struct net_device *dev)
 #endif
 
 static const struct net_device_ops vsw_ops = {
-	.ndo_open		= sunvnet_open_common,
 	.ndo_stop		= sunvnet_close_common,
 	.ndo_set_rx_mode	= vsw_set_rx_mode,
 	.ndo_set_mac_address	= sunvnet_set_mac_addr_common,
@@ -365,6 +364,11 @@ static int vsw_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	napi_enable(&port->napi);
 	vio_port_up(&port->vio);
 
+	/* assure no carrier until we receive an LDC_EVENT_UP,
+	 * even if the vsw config script tries to force us up
+	 */
+	netif_carrier_off(dev);
+
 	netdev_info(dev, "LDOM vsw-port %pM\n", dev->dev_addr);
 
 	pr_info("%s: PORT ( remote-mac %pM%s )\n", dev->name,
diff --git a/drivers/net/ethernet/sun/sunvnet_common.c b/drivers/net/ethernet/sun/sunvnet_common.c
index fa2d11c..bba0691 100644
--- a/drivers/net/ethernet/sun/sunvnet_common.c
+++ b/drivers/net/ethernet/sun/sunvnet_common.c
@@ -747,6 +747,13 @@ static int vnet_event_napi(struct vnet_port *port, int budget)
 
 	/* RESET takes precedent over any other event */
 	if (port->rx_event & LDC_EVENT_RESET) {
+		/* a link went down */
+
+		if (port->vsw == 1) {
+			netif_tx_stop_all_queues(dev);
+			netif_carrier_off(dev);
+		}
+
 		vio_link_state_change(vio, LDC_EVENT_RESET);
 		vnet_port_reset(port);
 		vio_port_up(vio);
@@ -766,6 +773,13 @@ static int vnet_event_napi(struct vnet_port *port, int budget)
 	}
 
 	if (port->rx_event & LDC_EVENT_UP) {
+		/* a link came up */
+
+		if (port->vsw == 1) {
+			netif_carrier_on(port->dev);
+			netif_tx_start_all_queues(port->dev);
+		}
+
 		vio_link_state_change(vio, LDC_EVENT_UP);
 		port->rx_event = 0;
 		return 0;
-- 
1.7.1

[toc] | [next] | [standalone]


#1593901 — Re: [PATCH net-next 1/5] ldmvsw: better use of link up and down on ldom vswitch

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-03-07 05:00 +0100
SubjectRe: [PATCH net-next 1/5] ldmvsw: better use of link up and down on ldom vswitch
Message-ID<ties2-1uN-15@gated-at.bofh.it>
In reply to#1593854
On 03/06/2017 03:15 PM, Shannon Nelson wrote:
> When an ldom VM is bound, the network vswitch infrastructure is set up for
> it, but was being forced 'UP' by the userland switch configuration script.
> When 'UP' but not actually connected to a running VM, the ipv6 neighbor
> probes fail (not a horrible thing) and start cluttering up the kernel logs.
> Funny thing: these are debug messages that never actually show up, but
> we do see the net_ratelimited messages that say N callbacks were
> suppressed.
> 
> This patch defers the netif_carrier_on() until an actual link has been
> established with the VM, as indicated by receiving an LDC_EVENT_UP from
> the underlying LDC protocol.  Similarly, we take the link down when we
> see the LDC_EVENT_RESET.
> 
> Orabug: 25525312
> 
> Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
> ---
>  drivers/net/ethernet/sun/ldmvsw.c         |   10 +++++++---
>  drivers/net/ethernet/sun/sunvnet_common.c |   14 ++++++++++++++
>  2 files changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sun/ldmvsw.c b/drivers/net/ethernet/sun/ldmvsw.c
> index 89952de..c6f6d59 100644
> --- a/drivers/net/ethernet/sun/ldmvsw.c
> +++ b/drivers/net/ethernet/sun/ldmvsw.c
> @@ -41,8 +41,8 @@
>  static u8 vsw_port_hwaddr[ETH_ALEN] = {0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
>  
>  #define DRV_MODULE_NAME		"ldmvsw"
> -#define DRV_MODULE_VERSION	"1.1"
> -#define DRV_MODULE_RELDATE	"February 3, 2017"
> +#define DRV_MODULE_VERSION	"1.2"
> +#define DRV_MODULE_RELDATE	"March 4, 2017"
>  
>  static char version[] =
>  	DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")";
> @@ -133,7 +133,6 @@ static void vsw_poll_controller(struct net_device *dev)
>  #endif
>  
>  static const struct net_device_ops vsw_ops = {
> -	.ndo_open		= sunvnet_open_common,

Is this change intentional? It was not entirely obvious where you would
be setting ::ndo_open in other places.
-- 
Florian

[toc] | [prev] | [next] | [standalone]


#1593907 — Re: [PATCH net-next 1/5] ldmvsw: better use of link up and down on ldom vswitch

FromShannon Nelson <shannon.nelson@oracle.com>
Date2017-03-07 05:50 +0100
SubjectRe: [PATCH net-next 1/5] ldmvsw: better use of link up and down on ldom vswitch
Message-ID<tifep-23S-5@gated-at.bofh.it>
In reply to#1593901

On 3/6/2017 3:53 PM, Florian Fainelli wrote:
> On 03/06/2017 03:15 PM, Shannon Nelson wrote:
>> When an ldom VM is bound, the network vswitch infrastructure is set up for
>> it, but was being forced 'UP' by the userland switch configuration script.
>> When 'UP' but not actually connected to a running VM, the ipv6 neighbor
>> probes fail (not a horrible thing) and start cluttering up the kernel logs.
>> Funny thing: these are debug messages that never actually show up, but
>> we do see the net_ratelimited messages that say N callbacks were
>> suppressed.
>>
>> This patch defers the netif_carrier_on() until an actual link has been
>> established with the VM, as indicated by receiving an LDC_EVENT_UP from
>> the underlying LDC protocol.  Similarly, we take the link down when we
>> see the LDC_EVENT_RESET.
>>
>> Orabug: 25525312
>>
>> Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
>> ---
>>  drivers/net/ethernet/sun/ldmvsw.c         |   10 +++++++---
>>  drivers/net/ethernet/sun/sunvnet_common.c |   14 ++++++++++++++
>>  2 files changed, 21 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/sun/ldmvsw.c b/drivers/net/ethernet/sun/ldmvsw.c
>> index 89952de..c6f6d59 100644
>> --- a/drivers/net/ethernet/sun/ldmvsw.c
>> +++ b/drivers/net/ethernet/sun/ldmvsw.c
>> @@ -41,8 +41,8 @@
>>  static u8 vsw_port_hwaddr[ETH_ALEN] = {0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
>>
>>  #define DRV_MODULE_NAME		"ldmvsw"
>> -#define DRV_MODULE_VERSION	"1.1"
>> -#define DRV_MODULE_RELDATE	"February 3, 2017"
>> +#define DRV_MODULE_VERSION	"1.2"
>> +#define DRV_MODULE_RELDATE	"March 4, 2017"
>>
>>  static char version[] =
>>  	DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")";
>> @@ -133,7 +133,6 @@ static void vsw_poll_controller(struct net_device *dev)
>>  #endif
>>
>>  static const struct net_device_ops vsw_ops = {
>> -	.ndo_open		= sunvnet_open_common,
>
> Is this change intentional? It was not entirely obvious where you would
> be setting ::ndo_open in other places.

Yes, it is correct.  It does look a bit odd, but nearly all the work is 
done in the _probe(), and now the carrier_on happens a little later when 
the LDC_EVENT_UP is received, so there's no longer a need for the 
_open() call.

sln


>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web