Displaying 20 results from an estimated 144 matches for "netif_carrier_off".
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...if ((primary_dev && failover_xmit_ready(primary_dev)) ||
> > > + (standby_dev && failover_xmit_ready(standby_dev))) {
> > > + netif_carrier_on(failover_dev);
> > > + netif_tx_wake_all_queues(failover_dev);
> > > + } else {
> > > + netif_carrier_off(failover_dev);
> > > + netif_tx_stop_all_queues(failover_dev);
> > And I think it's a good idea to get stats from device here too.
>
> Not sure why we need to get stats from lower devs here?
link down is often indication of a hardware problem.
lower dev might stop respon...
2012 Apr 12
2
[net-next V7 PATCH] virtio-net: send gratuitous packets when needed
..._peers(vi->dev);
+ virtnet_ack_link_announce(vi);
+ }
/* Ignore unknown (future) status bits */
v &= VIRTIO_NET_S_LINK_UP;
if (vi->status == v)
- return;
+ goto done;
vi->status = v;
@@ -976,13 +1006,15 @@ static void virtnet_update_status(struct virtnet_info *vi)
netif_carrier_off(vi->dev);
netif_stop_queue(vi->dev);
}
+done:
+ mutex_unlock(&vi->config_lock);
}
static void virtnet_config_changed(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
- virtnet_update_status(vi);
+ queue_work(system_nrt_wq, &vi->config_work);...
2012 Apr 12
2
[net-next V7 PATCH] virtio-net: send gratuitous packets when needed
..._peers(vi->dev);
+ virtnet_ack_link_announce(vi);
+ }
/* Ignore unknown (future) status bits */
v &= VIRTIO_NET_S_LINK_UP;
if (vi->status == v)
- return;
+ goto done;
vi->status = v;
@@ -976,13 +1006,15 @@ static void virtnet_update_status(struct virtnet_info *vi)
netif_carrier_off(vi->dev);
netif_stop_queue(vi->dev);
}
+done:
+ mutex_unlock(&vi->config_lock);
}
static void virtnet_config_changed(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
- virtnet_update_status(vi);
+ queue_work(system_nrt_wq, &vi->config_work);...
2011 Apr 05
3
[PATCH] staging: hv: Fix GARP not sent after Quick Migration
...but net device "
@@ -229,7 +231,8 @@ static void netvsc_linkstatus_callback(struct hv_device *device_obj,
if (status == 1) {
netif_carrier_on(net);
netif_wake_queue(net);
- netif_notify_peers(net);
+ ndev_ctx = netdev_priv(net);
+ schedule_work(&ndev_ctx->work);
} else {
netif_carrier_off(net);
netif_stop_queue(net);
@@ -328,6 +331,17 @@ static const struct net_device_ops device_ops = {
.ndo_set_mac_address = eth_mac_addr,
};
+static void netvsc_send_garp(struct work_struct *w)
+{
+ struct net_device_context *ndev_ctx;
+ struct net_device *net;
+
+ ndev_ctx = container_of(w...
2011 Apr 05
3
[PATCH] staging: hv: Fix GARP not sent after Quick Migration
...but net device "
@@ -229,7 +231,8 @@ static void netvsc_linkstatus_callback(struct hv_device *device_obj,
if (status == 1) {
netif_carrier_on(net);
netif_wake_queue(net);
- netif_notify_peers(net);
+ ndev_ctx = netdev_priv(net);
+ schedule_work(&ndev_ctx->work);
} else {
netif_carrier_off(net);
netif_stop_queue(net);
@@ -328,6 +331,17 @@ static const struct net_device_ops device_ops = {
.ndo_set_mac_address = eth_mac_addr,
};
+static void netvsc_send_garp(struct work_struct *w)
+{
+ struct net_device_context *ndev_ctx;
+ struct net_device *net;
+
+ ndev_ctx = container_of(w...
2013 Feb 06
0
[PATCH 1/4] xen/netback: shutdown the ring if it contains garbage.
...s/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -343,17 +343,22 @@ err:
return err;
}
-void xenvif_disconnect(struct xenvif *vif)
+void xenvif_carrier_off(struct xenvif *vif)
{
struct net_device *dev = vif->dev;
- if (netif_carrier_ok(dev)) {
- rtnl_lock();
- netif_carrier_off(dev); /* discard queued packets */
- if (netif_running(dev))
- xenvif_down(vif);
- rtnl_unlock();
- xenvif_put(vif);
- }
+
+ rtnl_lock();
+ netif_carrier_off(dev); /* discard queued packets */
+ if (netif_running(dev))
+ xenvif_down(vif);
+ rtnl_unlock();
+ xenvif_put(vif);
+}
+
+void xenvif_...
2018 Feb 16
8
[RFC PATCH v3 0/3] Enable virtio_net to act as a backup for a passthru device
Patch 1 introduces a new feature bit VIRTIO_NET_F_BACKUP that can be
used by hypervisor to indicate that virtio_net interface should act as
a backup for another device with the same MAC address.
Ppatch 2 is in response to the community request for a 3 netdev
solution. However, it creates some issues we'll get into in a moment.
It extends virtio_net to use alternate datapath when available
2018 Feb 16
8
[RFC PATCH v3 0/3] Enable virtio_net to act as a backup for a passthru device
Patch 1 introduces a new feature bit VIRTIO_NET_F_BACKUP that can be
used by hypervisor to indicate that virtio_net interface should act as
a backup for another device with the same MAC address.
Ppatch 2 is in response to the community request for a 3 netdev
solution. However, it creates some issues we'll get into in a moment.
It extends virtio_net to use alternate datapath when available
2018 Apr 06
2
[RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
...>+
>+ /* spinlock while updating stats */
>+ spinlock_t stats_lock;
>+};
>+
>+static int virtnet_bypass_open(struct net_device *dev)
>+{
>+ struct virtnet_bypass_info *vbi = netdev_priv(dev);
>+ struct net_device *active_netdev, *backup_netdev;
>+ int err;
>+
>+ netif_carrier_off(dev);
>+ netif_tx_wake_all_queues(dev);
>+
>+ active_netdev = rtnl_dereference(vbi->active_netdev);
>+ if (active_netdev) {
>+ err = dev_open(active_netdev);
>+ if (err)
>+ goto err_active_open;
>+ }
>+
>+ backup_netdev = rtnl_dereference(vbi->backup_netdev);...
2018 Apr 06
2
[RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
...>+
>+ /* spinlock while updating stats */
>+ spinlock_t stats_lock;
>+};
>+
>+static int virtnet_bypass_open(struct net_device *dev)
>+{
>+ struct virtnet_bypass_info *vbi = netdev_priv(dev);
>+ struct net_device *active_netdev, *backup_netdev;
>+ int err;
>+
>+ netif_carrier_off(dev);
>+ netif_tx_wake_all_queues(dev);
>+
>+ active_netdev = rtnl_dereference(vbi->active_netdev);
>+ if (active_netdev) {
>+ err = dev_open(active_netdev);
>+ if (err)
>+ goto err_active_open;
>+ }
>+
>+ backup_netdev = rtnl_dereference(vbi->backup_netdev);...
2011 May 23
5
[PATCH 1/6] staging: hv: remove unnecessary code in netvsc_probe().
netif_carrier_off() was called earlier in this function, and there is
no other thread access this device yet. The status checking code is not
necessary here.
Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys at microsoft.com>
Signed-off-by: Abhishek Kane <v...
2011 May 23
5
[PATCH 1/6] staging: hv: remove unnecessary code in netvsc_probe().
netif_carrier_off() was called earlier in this function, and there is
no other thread access this device yet. The status checking code is not
necessary here.
Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys at microsoft.com>
Signed-off-by: Abhishek Kane <v...
2018 Feb 16
0
[RFC PATCH v3 2/3] virtio_net: Extend virtio to use VF datapath when available
...rr = dev_open(child_netdev);
+
+ if (err)
+ netdev_warn(dev, "unable to open slave: %s: %d\n",
+ child_netdev->name, err);
+}
+
+static int virtnet_bypass_open(struct net_device *dev)
+{
+ struct virtnet_bypass_info *vbi = netdev_priv(dev);
+ struct net_device *child_netdev;
+
+ netif_carrier_off(dev);
+ netif_tx_wake_all_queues(dev);
+
+ child_netdev = rtnl_dereference(vbi->active_netdev);
+ if (child_netdev)
+ virtnet_bypass_child_open(dev, child_netdev);
+
+ child_netdev = rtnl_dereference(vbi->backup_netdev);
+ if (child_netdev)
+ virtnet_bypass_child_open(dev, child_netdev);
+...
2018 Apr 05
0
[RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
...tats */
+ struct rtnl_link_stats64 bypass_stats;
+
+ /* spinlock while updating stats */
+ spinlock_t stats_lock;
+};
+
+static int virtnet_bypass_open(struct net_device *dev)
+{
+ struct virtnet_bypass_info *vbi = netdev_priv(dev);
+ struct net_device *active_netdev, *backup_netdev;
+ int err;
+
+ netif_carrier_off(dev);
+ netif_tx_wake_all_queues(dev);
+
+ active_netdev = rtnl_dereference(vbi->active_netdev);
+ if (active_netdev) {
+ err = dev_open(active_netdev);
+ if (err)
+ goto err_active_open;
+ }
+
+ backup_netdev = rtnl_dereference(vbi->backup_netdev);
+ if (backup_netdev) {
+ err = dev_ope...
2016 Oct 19
7
[PATCH net-next 5/6] net: use core MTU range checking in virt drivers
...ODEV;
- if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2)
- limit = NETVSC_MTU - ETH_HLEN;
-
- if (mtu < NETVSC_MTU_MIN || mtu > limit)
- return -EINVAL;
-
ret = netvsc_close(ndev);
if (ret)
goto out;
@@ -1343,6 +1336,13 @@ static int netvsc_probe(struct hv_device *dev,
netif_carrier_off(net);
+ /* MTU range: 68 - 1500 or 65521 */
+ net->min_mtu = NETVSC_MTU_MIN;
+ if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2)
+ net->max_mtu = NETVSC_MTU - ETH_HLEN;
+ else
+ net->max_mtu = ETH_DATA_LEN;
+
netvsc_init_settings(net);
net_device_ctx = netdev_priv(net);
d...
2016 Oct 19
7
[PATCH net-next 5/6] net: use core MTU range checking in virt drivers
...ODEV;
- if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2)
- limit = NETVSC_MTU - ETH_HLEN;
-
- if (mtu < NETVSC_MTU_MIN || mtu > limit)
- return -EINVAL;
-
ret = netvsc_close(ndev);
if (ret)
goto out;
@@ -1343,6 +1336,13 @@ static int netvsc_probe(struct hv_device *dev,
netif_carrier_off(net);
+ /* MTU range: 68 - 1500 or 65521 */
+ net->min_mtu = NETVSC_MTU_MIN;
+ if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2)
+ net->max_mtu = NETVSC_MTU - ETH_HLEN;
+ else
+ net->max_mtu = ETH_DATA_LEN;
+
netvsc_init_settings(net);
net_device_ctx = netdev_priv(net);
d...
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...v != standby_dev)
> + goto done;
> +
> + if ((primary_dev && failover_xmit_ready(primary_dev)) ||
> + (standby_dev && failover_xmit_ready(standby_dev))) {
> + netif_carrier_on(failover_dev);
> + netif_tx_wake_all_queues(failover_dev);
> + } else {
> + netif_carrier_off(failover_dev);
> + netif_tx_stop_all_queues(failover_dev);
And I think it's a good idea to get stats from device here too.
> + }
> +
> +done:
> + return NOTIFY_DONE;
> +}
> +
> +static bool failover_validate_event_dev(struct net_device *dev)
> +{
> + /* Skip pa...
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...v != standby_dev)
> + goto done;
> +
> + if ((primary_dev && failover_xmit_ready(primary_dev)) ||
> + (standby_dev && failover_xmit_ready(standby_dev))) {
> + netif_carrier_on(failover_dev);
> + netif_tx_wake_all_queues(failover_dev);
> + } else {
> + netif_carrier_off(failover_dev);
> + netif_tx_stop_all_queues(failover_dev);
And I think it's a good idea to get stats from device here too.
> + }
> +
> +done:
> + return NOTIFY_DONE;
> +}
> +
> +static bool failover_validate_event_dev(struct net_device *dev)
> +{
> + /* Skip pa...
2018 Apr 06
0
[RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
...t;> + if ((active_netdev && virtnet_bypass_xmit_ready(active_netdev)) ||
>> + (backup_netdev && virtnet_bypass_xmit_ready(backup_netdev))) {
>> + netif_carrier_on(bypass_netdev);
>> + netif_tx_wake_all_queues(bypass_netdev);
>> + } else {
>> + netif_carrier_off(bypass_netdev);
>> + netif_tx_stop_all_queues(bypass_netdev);
>> + }
>> +
>> + return 0;
>> +}
>> +
>> +/* Called when child dev is injecting data into network stack.
>> + * Change the associated network device from lower dev to virtio.
>> + *...
2016 Jun 02
1
[PATCH -next 2/2] virtio_net: Read the advised MTU
..._net: registering cpu notifier failed\n");
1938 goto free_unregister_netdev;
1939 }
1940
1941 /* Assume link up if device can't report link status,
1942 otherwise get link status from config. */
1943 if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
1944 netif_carrier_off(dev);
1945 schedule_work(&vi->config_work);
1946 } else {
1947 vi->status = VIRTIO_NET_S_LINK_UP;
1948 netif_carrier_on(dev);
1949 }
1950
1951 pr_debug("virtnet: registered device %s with %d RX and TX vq's\n",
1952 dev->name, max_queue_pairs);...