diff mbox series

[net-next,v5,03/15] virtio-net: add priv_flags IFF_NOT_USE_DMA_ADDR

Message ID 20210610082209.91487-4-xuanzhuo@linux.alibaba.com
State New
Headers show
Series virtio-net: support xdp socket zero copy | expand

Commit Message

Xuan Zhuo June 10, 2021, 8:21 a.m. UTC
virtio-net not use dma addr directly. So add this priv_flags
IFF_NOT_USE_DMA_ADDR.

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
 drivers/net/virtio_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Wang June 16, 2021, 9:27 a.m. UTC | #1
在 2021/6/10 下午4:21, Xuan Zhuo 写道:
> virtio-net not use dma addr directly. So add this priv_flags

> IFF_NOT_USE_DMA_ADDR.

>

> Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>

> ---

>   drivers/net/virtio_net.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c

> index 0416a7e00914..6c1233f0ab3e 100644

> --- a/drivers/net/virtio_net.c

> +++ b/drivers/net/virtio_net.c

> @@ -3064,7 +3064,7 @@ static int virtnet_probe(struct virtio_device *vdev)

>   

>   	/* Set up network device as normal. */

>   	dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE |

> -			   IFF_TX_SKB_NO_LINEAR;

> +			   IFF_TX_SKB_NO_LINEAR | IFF_NOT_USE_DMA_ADDR;



I wonder instead of doing trick like this, how about teach the virtio 
core to accept DMA address via sg?

Thanks


>   	dev->netdev_ops = &virtnet_netdev;

>   	dev->features = NETIF_F_HIGHDMA;

>
diff mbox series

Patch

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 0416a7e00914..6c1233f0ab3e 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -3064,7 +3064,7 @@  static int virtnet_probe(struct virtio_device *vdev)
 
 	/* Set up network device as normal. */
 	dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE |
-			   IFF_TX_SKB_NO_LINEAR;
+			   IFF_TX_SKB_NO_LINEAR | IFF_NOT_USE_DMA_ADDR;
 	dev->netdev_ops = &virtnet_netdev;
 	dev->features = NETIF_F_HIGHDMA;