Skip to content

Commit

Permalink
virtio_net: Make virtio_net support carrier detection
Browse files Browse the repository at this point in the history
Impact: Make NetworkManager work with virtio_net

For now the semantics are simple: There is always carrier.

This allows a seamless experience with e.g., qemu/kvm
where NetworkManager just configures and sets up
everything automagically.

If/when a generally agreed-upon way to control
carrier on/off in the emulator/hypervisor level
emerges, it will be trivial to extend the driver
to support that too, but for now even this 2-liner
makes user experience that much better.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pantelis Koukousoulas authored and David S. Miller committed Mar 19, 2009
1 parent 17d0450 commit 4783256
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ static struct ethtool_ops virtnet_ethtool_ops = {
.set_tx_csum = virtnet_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = ethtool_op_set_tso,
.get_link = ethtool_op_get_link,
};

#define MIN_MTU 68
Expand Down Expand Up @@ -739,6 +740,8 @@ static int virtnet_probe(struct virtio_device *vdev)
goto unregister;
}

netif_carrier_on(dev);

pr_debug("virtnet: registered device %s\n", dev->name);
return 0;

Expand Down

0 comments on commit 4783256

Please sign in to comment.