Displaying 20 results from an estimated 191 matches for "virtnet_send_command".
2013 Dec 10
11
[PATCH net-next 1/3] virtio_net: set multicast filter list to host
...09:02:45 2009 +0000
virtio_net: Add a MAC filter table
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
--- a/drivers/net/virtio_net.c 2013-12-09 16:12:03.897891975 -0800
+++ b/drivers/net/virtio_net.c 2013-12-09 16:12:36.353164803 -0800
@@ -893,7 +893,7 @@ static bool virtnet_send_command(struct
sg_init_one(&hdr, &ctrl, sizeof(ctrl));
sgs[out_num++] = &hdr;
- if (out)
+ for (; out; out = sg_next(out))
sgs[out_num++] = out;
if (in)
sgs[out_num + in_num++] = in;
2013 Dec 10
11
[PATCH net-next 1/3] virtio_net: set multicast filter list to host
...09:02:45 2009 +0000
virtio_net: Add a MAC filter table
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
--- a/drivers/net/virtio_net.c 2013-12-09 16:12:03.897891975 -0800
+++ b/drivers/net/virtio_net.c 2013-12-09 16:12:36.353164803 -0800
@@ -893,7 +893,7 @@ static bool virtnet_send_command(struct
sg_init_one(&hdr, &ctrl, sizeof(ctrl));
sgs[out_num++] = &hdr;
- if (out)
+ for (; out; out = sg_next(out))
sgs[out_num++] = out;
if (in)
sgs[out_num + in_num++] = in;
2013 Dec 10
0
[PATCH net-next 2/3] virtio_net: remove unused parameter to send_command
...r <stephen at networkplumber.org>
--- a/drivers/net/virtio_net.c 2013-12-09 16:12:36.353164803 -0800
+++ b/drivers/net/virtio_net.c 2013-12-09 16:12:41.409051865 -0800
@@ -876,13 +876,12 @@ static netdev_tx_t start_xmit(struct sk_
* never fail unless improperly formated.
*/
static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
- struct scatterlist *out,
- struct scatterlist *in)
+ struct scatterlist *out)
{
struct scatterlist *sgs[4], hdr, stat;
struct virtio_net_ctrl_hdr ctrl;
virtio_net_ctrl_ack status = ~0;
- unsigned out_num = 0, in_num = 0, tmp;
+ unsigne...
2016 Apr 18
1
Potential hang in virtnet_send_command
Hi,
I was debugging an issue caused by a bad usage of dpdk.
That is fixed in the meantime and I'll backport that into our code as well.
But along debugging that, I found a potential hang in virtnet_send_command
that my case ran into.
The following code can become an infinite loop:
/* Spin for a response, the kick causes an ioport write, trapping
* into the hypervisor, so the request should be handled immediately.
*/
while (!virtqueue_get_buf(vi->cvq, &tmp) &&
!virtqueue_is_broken(v...
2016 Apr 18
1
Potential hang in virtnet_send_command
Hi,
I was debugging an issue caused by a bad usage of dpdk.
That is fixed in the meantime and I'll backport that into our code as well.
But along debugging that, I found a potential hang in virtnet_send_command
that my case ran into.
The following code can become an infinite loop:
/* Spin for a response, the kick causes an ioport write, trapping
* into the hypervisor, so the request should be handled immediately.
*/
while (!virtqueue_get_buf(vi->cvq, &tmp) &&
!virtqueue_is_broken(v...
2018 Apr 19
1
[PATCH v2 net 1/3] virtio_net: split out ctrl buffer
...lock */
- struct virtio_net_ctrl_hdr ctrl_hdr;
- virtio_net_ctrl_ack ctrl_status;
- struct virtio_net_ctrl_mq ctrl_mq;
- u8 ctrl_promisc;
- u8 ctrl_allmulti;
- u16 ctrl_vid;
- u64 ctrl_offloads;
+ struct control_buf *ctrl;
/* Ethtool settings */
u8 duplex;
@@ -1454,25 +1458,25 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
/* Caller should know better */
BUG_ON(!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ));
- vi->ctrl_status = ~0;
- vi->ctrl_hdr.class = class;
- vi->ctrl_hdr.cmd = cmd;
+ vi->ctrl->status = ~0;
+ vi->ctrl->hdr.class = clas...
2018 Apr 19
3
[PATCH net] virtio_net: split out ctrl buffer
...lock */
- struct virtio_net_ctrl_hdr ctrl_hdr;
- virtio_net_ctrl_ack ctrl_status;
- struct virtio_net_ctrl_mq ctrl_mq;
- u8 ctrl_promisc;
- u8 ctrl_allmulti;
- u16 ctrl_vid;
- u64 ctrl_offloads;
+ struct control_buf *ctrl;
/* Ethtool settings */
u8 duplex;
@@ -1454,25 +1458,25 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
/* Caller should know better */
BUG_ON(!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ));
- vi->ctrl_status = ~0;
- vi->ctrl_hdr.class = class;
- vi->ctrl_hdr.cmd = cmd;
+ vi->ctrl->status = ~0;
+ vi->ctrl->hdr.class = clas...
2015 Oct 28
2
[PATCH v2 1/3] virtio_net: Stop doing DMA from the stack
...++++++++++++++++++++++++++++++----------------
1 file changed, 36 insertions(+), 17 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index d8838dedb7a4..4f10f8a58811 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -976,31 +976,43 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
struct scatterlist *out)
{
struct scatterlist *sgs[4], hdr, stat;
- struct virtio_net_ctrl_hdr ctrl;
- virtio_net_ctrl_ack status = ~0;
+
+ struct {
+ struct virtio_net_ctrl_hdr ctrl;
+ virtio_net_ctrl_ack status;
+ } *buf;
+
unsigned out_num...
2015 Oct 28
2
[PATCH v2 1/3] virtio_net: Stop doing DMA from the stack
...++++++++++++++++++++++++++++++----------------
1 file changed, 36 insertions(+), 17 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index d8838dedb7a4..4f10f8a58811 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -976,31 +976,43 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
struct scatterlist *out)
{
struct scatterlist *sgs[4], hdr, stat;
- struct virtio_net_ctrl_hdr ctrl;
- virtio_net_ctrl_ack status = ~0;
+
+ struct {
+ struct virtio_net_ctrl_hdr ctrl;
+ virtio_net_ctrl_ack status;
+ } *buf;
+
unsigned out_num...
2015 Oct 28
0
[PATCH v2 1/3] virtio_net: Stop doing DMA from the stack
...-----------
> 1 file changed, 36 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index d8838dedb7a4..4f10f8a58811 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -976,31 +976,43 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
> struct scatterlist *out)
> {
> struct scatterlist *sgs[4], hdr, stat;
> - struct virtio_net_ctrl_hdr ctrl;
> - virtio_net_ctrl_ack status = ~0;
> +
> + struct {
> + struct virtio_net_ctrl_hdr ctrl;
> + virtio_net_ctr...
2015 Oct 30
0
[PATCH v4 1/6] virtio-net: Stop doing DMA from the stack
...gt;] check_for_stack+0xae/0x118)
[ 33.534738] [<0000000000586e3c>] debug_dma_map_page+0x114/0x160
[ 33.534740] [<00000000005a31f8>] vring_map_one_sg.isra.7+0x98/0xc0
[ 33.534742] [<00000000005a3b72>] virtqueue_add_sgs+0x1e2/0x788
[ 33.534744] [<0000000000618afc>] virtnet_send_command+0xcc/0x140
[ 33.534745] [<0000000000618c0c>] virtnet_set_queues+0x9c/0x110
[ 33.534747] [<0000000000619928>] virtnet_set_channels+0x78/0xe0
[ 33.534748] [<00000000006f63ea>] ethtool_set_channels+0x62/0x88
[ 33.534750] [<00000000006f8900>] dev_ethtool+0x10d8/0x1a4...
2014 Apr 18
3
[PATCH] virtio_net: zero is an invald queue_pairs number
Execute "ethtool -L eth0 combined 0" in guest, if multiqueue
is enabled, virtnet_send_command() will return -EINVAL error,
there is a validation in QEMU.
But if multiqueue is disabled, virtnet_set_queues() will just
return zero (success). We should return error for this situation.
Signed-off-by: Amos Kong <akong at redhat.com>
---
drivers/net/virtio_net.c | 2 +-
1 file changed, 1...
2014 Apr 18
3
[PATCH] virtio_net: zero is an invald queue_pairs number
Execute "ethtool -L eth0 combined 0" in guest, if multiqueue
is enabled, virtnet_send_command() will return -EINVAL error,
there is a validation in QEMU.
But if multiqueue is disabled, virtnet_set_queues() will just
return zero (success). We should return error for this situation.
Signed-off-by: Amos Kong <akong at redhat.com>
---
drivers/net/virtio_net.c | 2 +-
1 file changed, 1...
2015 Oct 28
0
[PATCH v3 1/3] virtio_net: Stop doing DMA from the stack
...++++++++++++++++++++++++++++++----------------
1 file changed, 36 insertions(+), 17 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index d8838dedb7a4..4f10f8a58811 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -976,31 +976,43 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
struct scatterlist *out)
{
struct scatterlist *sgs[4], hdr, stat;
- struct virtio_net_ctrl_hdr ctrl;
- virtio_net_ctrl_ack status = ~0;
+
+ struct {
+ struct virtio_net_ctrl_hdr ctrl;
+ virtio_net_ctrl_ack status;
+ } *buf;
+
unsigned out_num...
2015 Oct 28
0
[PATCH v3 1/3] virtio_net: Stop doing DMA from the stack
...-----------
> 1 file changed, 36 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index d8838dedb7a4..4f10f8a58811 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -976,31 +976,43 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
> struct scatterlist *out)
> {
> struct scatterlist *sgs[4], hdr, stat;
> - struct virtio_net_ctrl_hdr ctrl;
> - virtio_net_ctrl_ack status = ~0;
> +
> + struct {
> + struct virtio_net_ctrl_hdr ctrl;
> + virtio_net_ctr...
2023 Jan 27
2
[PATCH v3 0/2] virtio_net: vdpa: update MAC address when it is generated by virtio-net
...ress is not provided by the vdpa device virtio_net
driver assigns a random one without notifying the device.
The consequence, in the case of mlx5_vdpa, is the internal routing
tables of the device are not updated and this can block the
communication between two namespaces.
To fix this problem, use virtnet_send_command(VIRTIO_NET_CTRL_MAC)
to set the address from virtnet_probe() when the MAC address is
not provided by the device.
v3:
- update comments
- fail probe if VIRTIO_NET_CTRL_MAC_ADDR_SET fails
- move the virtnet_send_command() upper, inside the RTNL lock,
this simplifies the cleanup in case of...
2013 Jan 10
8
[RFC PATCH 0/2] make mac programming for virtio net more robust
From: Amos Kong <akong at redhat.com>
Currenly mac is programmed byte by byte. This means that we
have an intermediate step where mac is wrong.
Second patch introduced a new vq control command to set mac
address in one time.
Amos Kong (2):
move virtnet_send_command() above virtnet_set_mac_address()
virtio-net: introduce a new control to set macaddr
drivers/net/virtio_net.c | 105 ++++++++++++++++++++++------------------
include/uapi/linux/virtio_net.h | 8 ++-
2 files changed, 66 insertions(+), 47 deletions(-)
--
1.7.11.7
2013 Jan 10
8
[RFC PATCH 0/2] make mac programming for virtio net more robust
From: Amos Kong <akong at redhat.com>
Currenly mac is programmed byte by byte. This means that we
have an intermediate step where mac is wrong.
Second patch introduced a new vq control command to set mac
address in one time.
Amos Kong (2):
move virtnet_send_command() above virtnet_set_mac_address()
virtio-net: introduce a new control to set macaddr
drivers/net/virtio_net.c | 105 ++++++++++++++++++++++------------------
include/uapi/linux/virtio_net.h | 8 ++-
2 files changed, 66 insertions(+), 47 deletions(-)
--
1.7.11.7
2018 Apr 19
3
[PATCH v2 net 2/3] virtio_net: fix adding vids on big-endian
...nt virtnet_vlan_rx_add_vid(struct net_device *dev,
struct virtnet_info *vi = netdev_priv(dev);
struct scatterlist sg;
- vi->ctrl->vid = vid;
+ vi->ctrl->vid = cpu_to_virtio16(vi->vdev, vid);
sg_init_one(&sg, &vi->ctrl->vid, sizeof(vi->ctrl->vid));
if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN,
@@ -1733,7 +1733,7 @@ static int virtnet_vlan_rx_kill_vid(struct net_device *dev,
struct virtnet_info *vi = netdev_priv(dev);
struct scatterlist sg;
- vi->ctrl->vid = vid;
+ vi->ctrl->vid = cpu_to_virtio16(vi->vdev, vid);
sg_init_one(&sg, &vi...
2018 Apr 19
3
[PATCH v2 net 2/3] virtio_net: fix adding vids on big-endian
...nt virtnet_vlan_rx_add_vid(struct net_device *dev,
struct virtnet_info *vi = netdev_priv(dev);
struct scatterlist sg;
- vi->ctrl->vid = vid;
+ vi->ctrl->vid = cpu_to_virtio16(vi->vdev, vid);
sg_init_one(&sg, &vi->ctrl->vid, sizeof(vi->ctrl->vid));
if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN,
@@ -1733,7 +1733,7 @@ static int virtnet_vlan_rx_kill_vid(struct net_device *dev,
struct virtnet_info *vi = netdev_priv(dev);
struct scatterlist sg;
- vi->ctrl->vid = vid;
+ vi->ctrl->vid = cpu_to_virtio16(vi->vdev, vid);
sg_init_one(&sg, &vi...