search for: ndev

Displaying 20 results from an estimated 224 matches for "ndev".

Did you mean: mdev
2011 Nov 11
1
[RFC] kvm tools: Implement multiple VQ for virtio-net
...UEUES]; + pthread_mutex_t io_lock[VIRTIO_NET_NUM_QUEUES]; + pthread_cond_t io_cond[VIRTIO_NET_NUM_QUEUES]; + int rx_vq_num; + int tx_vq_num; + int vq_num; int tap_fd; char tap_name[IFNAMSIZ]; @@ -78,17 +76,22 @@ static void *virtio_net_rx_thread(void *p) struct net_dev *ndev = p; u16 out, in; u16 head; - int len; + int len, queue_num; + + mutex_lock(&ndev->mutex); + queue_num = ndev->rx_vq_num * 2; + ndev->tx_vq_num++; + mutex_unlock(&ndev->mutex); kvm = ndev->kvm; - vq = &ndev->vqs[VIRTIO_NET_RX_QUEUE]; + vq = &ndev->vqs[qu...
2011 Nov 11
1
[RFC] kvm tools: Implement multiple VQ for virtio-net
...UEUES]; + pthread_mutex_t io_lock[VIRTIO_NET_NUM_QUEUES]; + pthread_cond_t io_cond[VIRTIO_NET_NUM_QUEUES]; + int rx_vq_num; + int tx_vq_num; + int vq_num; int tap_fd; char tap_name[IFNAMSIZ]; @@ -78,17 +76,22 @@ static void *virtio_net_rx_thread(void *p) struct net_dev *ndev = p; u16 out, in; u16 head; - int len; + int len, queue_num; + + mutex_lock(&ndev->mutex); + queue_num = ndev->rx_vq_num * 2; + ndev->tx_vq_num++; + mutex_unlock(&ndev->mutex); kvm = ndev->kvm; - vq = &ndev->vqs[VIRTIO_NET_RX_QUEUE]; + vq = &ndev->vqs[qu...
2020 Jul 16
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
.... They're use > + * is internal and they must be provided by the driver. > + */ > + struct mlx5_vdpa_umem umem1; > + struct mlx5_vdpa_umem umem2; > + struct mlx5_vdpa_umem umem3; > + > + bool initialized; > + int index; > + u32 virtq_id; > + struct mlx5_vdpa_net *ndev; > + u16 avail_idx; > + int fw_state; > + > + /* keep last in the struct */ > + struct mlx5_vq_restore_info ri; > +}; > + > +/* We will remove this limitation once mlx5_vdpa_alloc_resources() > + * provides for driver space allocation > + */ > +#define MLX5_MAX_SUPP...
2023 Apr 03
0
[Patch v3] vdpa/mlx5: Avoid losing link state updates
...; >> + return false; > >> +} > >> + > >> +static void update_carrier(struct work_struct *work) > >> +{ > >> + struct mlx5_vdpa_wq_ent *wqent; > >> + struct mlx5_vdpa_dev *mvdev; > >> + struct mlx5_vdpa_net *ndev; > >> + > >> + wqent = container_of(work, struct mlx5_vdpa_wq_ent, work); > >> + mvdev = wqent->mvdev; > >> + ndev = to_mlx5_vdpa_ndev(mvdev); > >> + if (get_link_state(mvdev)) > >> + ndev->config.stat...
2012 May 20
16
nouveau_subdev & misc patches
Hello all, this series includes a wide range of fixes - from a few month's old one-liners from Andreas Heider regarding vga_switcheroo, via a null pointer dereference and double memory allocation, to a buffer overflow. Please review and comment --- drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 ++- drivers/gpu/drm/nouveau/nouveau_device.c | 26 +++++++++++++++-----------
2018 May 24
0
[PATCH net-next v12 2/5] netvsc: refactor notifier/event handling code to use the failover framework
...ssociated network device from VF to netvsc. * note: already called with rcu_read_lock @@ -1825,46 +1786,6 @@ static rx_handler_result_t netvsc_vf_handle_frame(struct sk_buff **pskb) return RX_HANDLER_ANOTHER; } -static int netvsc_vf_join(struct net_device *vf_netdev, - struct net_device *ndev) -{ - struct net_device_context *ndev_ctx = netdev_priv(ndev); - int ret; - - ret = netdev_rx_handler_register(vf_netdev, - netvsc_vf_handle_frame, ndev); - if (ret != 0) { - netdev_err(vf_netdev, - "can not register netvsc VF receive handler (err = %d)\n", - ret); - goto...
2023 Feb 15
1
[PATCH v3] vdpa/mlx5: should not activate virtq object when suspended
...et.c @@ -2411,7 +2411,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev, if (err) goto err_mr; - if (!(mvdev->status & VIRTIO_CONFIG_S_DRIVER_OK)) + if (!(mvdev->status & VIRTIO_CONFIG_S_DRIVER_OK) || mvdev->suspended) goto err_mr; restore_channels_info(ndev); @@ -2579,6 +2579,7 @@ static int mlx5_vdpa_reset(struct vdpa_device *vdev) clear_vqs_ready(ndev); mlx5_vdpa_destroy_mr(&ndev->mvdev); ndev->mvdev.status = 0; + ndev->mvdev.suspended = false; ndev->cur_num_vqs = 0; ndev->mvdev.cvq.received_desc = 0; ndev->mvdev.cv...
2012 Jun 25
1
[PATCH 1/2] drm/nouveau/pm: Prepare for more GDDR5 MR values
...u32 mr[9]; u8 tCWL; diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 1e1483e..1d290ab 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c @@ -626,6 +626,7 @@ nouveau_mem_gddr5_mr(struct nouveau_device *ndev, u32 freq, struct nouveau_pm_memtiming *boot, struct nouveau_pm_memtiming *t) { + u8 add_term; /* CMD/ADD termination */ if (len < 15) { t->drive_strength = boot->drive_strength; t->odt = boot->odt; @@ -644,18 +645,24 @@ nouveau_mem_gddr5_mr(struct nouveau_de...
2023 Mar 27
0
[PATCH] vdpa/mlx5: Avoid losing link state updates
...dev *mvdev) > +{ > + if (query_vport_state(mvdev->mdev, MLX5_VPORT_STATE_OP_MOD_VNIC_VPORT, 0) == > + VPORT_STATE_UP) > + return true; > + > + return false; > +} > + > +static void update_link_state(struct mlx5_vdpa_dev *mvdev) > +{ > + struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); > + bool up; > + > + up = get_link_state(mvdev); > + spin_lock(&ndev->status_lock); > + if (up) > + ndev->config.status |= cpu_to_mlx5vdpa16(mvdev, VIRTIO_NET_S_LINK_UP); > + else > + ndev->config.status &= cpu_to_mlx5vdpa16(mvd...
2018 Apr 20
0
[PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework
...atch */ - } - - return NULL; -} - /* Called when VF is injecting data into network stack. * Change the associated network device from VF to netvsc. * note: already called with rcu_read_lock @@ -1829,39 +1790,15 @@ static int netvsc_vf_join(struct net_device *vf_netdev, struct net_device *ndev) { struct net_device_context *ndev_ctx = netdev_priv(ndev); - int ret; - - ret = netdev_rx_handler_register(vf_netdev, - netvsc_vf_handle_frame, ndev); - if (ret != 0) { - netdev_err(vf_netdev, - "can not register netvsc VF receive handler (err = %d)\n", - ret); - goto...
2018 Apr 10
0
[RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework
...atch */ - } - - return NULL; -} - /* Called when VF is injecting data into network stack. * Change the associated network device from VF to netvsc. * note: already called with rcu_read_lock @@ -1829,39 +1790,15 @@ static int netvsc_vf_join(struct net_device *vf_netdev, struct net_device *ndev) { struct net_device_context *ndev_ctx = netdev_priv(ndev); - int ret; - - ret = netdev_rx_handler_register(vf_netdev, - netvsc_vf_handle_frame, ndev); - if (ret != 0) { - netdev_err(vf_netdev, - "can not register netvsc VF receive handler (err = %d)\n", - ret); - goto...
2023 Feb 16
1
[PATCH v3] vdpa/mlx5: should not activate virtq object when suspended
...& VIRTIO_CONFIG_S_DRIVER_OK) || mvdev->suspended) One more thought, Does this mean set_map() is forbidden during suspending? I'm not sure this is correct or at least we need restrict in in the vDPA core. Thanks > goto err_mr; > > restore_channels_info(ndev); > @@ -2579,6 +2579,7 @@ static int mlx5_vdpa_reset(struct vdpa_device *vdev) > clear_vqs_ready(ndev); > mlx5_vdpa_destroy_mr(&ndev->mvdev); > ndev->mvdev.status = 0; > + ndev->mvdev.suspended = false; > ndev->cur_num_vqs = 0;...
2023 Feb 16
1
[PATCH v3] vdpa/mlx5: should not activate virtq object when suspended
...ot;goto err_mr" below actually returns 0 when it leaves mlx5_vdpa_change_map(). -Siwei > I'm not sure > this is correct or at least we need restrict in in the vDPA core. > > Thanks > >> goto err_mr; >> >> restore_channels_info(ndev); >> @@ -2579,6 +2579,7 @@ static int mlx5_vdpa_reset(struct vdpa_device *vdev) >> clear_vqs_ready(ndev); >> mlx5_vdpa_destroy_mr(&ndev->mvdev); >> ndev->mvdev.status = 0; >> + ndev->mvdev.suspended = false; >>...
2023 Aug 31
2
[PATCH v2] vdpa/mlx5: Fix firmware error on creation of 1k VQs
...nsertions(+), 9 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 40a03b08d7cf..ef5907b1d513 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -625,30 +625,70 @@ static void cq_destroy(struct mlx5_vdpa_net *ndev, u16 idx) mlx5_db_free(ndev->mvdev.mdev, &vcq->db); } +static int read_umem_params(struct mlx5_vdpa_net *ndev) +{ + u32 in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {}; + u16 opmod = (MLX5_CAP_VDPA_EMULATION << 1) | (HCA_CAP_OPMOD_GET_CUR & 0x01); + struct mlx5_core_dev *mdev = nd...
2020 Jul 17
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
On 2020/7/16 ??7:54, Eli Cohen wrote: > On Thu, Jul 16, 2020 at 05:14:32PM +0800, Jason Wang wrote: >>> +static void suspend_vqs(struct mlx5_vdpa_net *ndev) >>> +{ >>> + int i; >>> + >>> + for (i = 0; i < MLX5_MAX_SUPPORTED_VQS; i++) >>> + suspend_vq(ndev, &ndev->vqs[i]); >> >> In teardown_virtqueues() it has a check of mvq->num_ent, any reason >> not doing it here? >>...
2023 Jul 26
1
[PATCH] vdpa/mlx5: Fix crash on shutdown for when no ndev exists
The ndev was accessed on shutdown without a check if it actually exists. This triggered the crash pasted below. This patch simply adds a check before using ndev. BUG: kernel NULL pointer dereference, address: 0000000000000300 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-prese...
2017 Dec 19
5
[RFC PATCH] virtio_net: Extend virtio to use VF datapath when available
...ytes += vf_stats.rx_bytes; + tot->tx_bytes += vf_stats.tx_bytes; + tot->tx_dropped += vf_stats.tx_dropped; } #ifdef CONFIG_NET_POLL_CONTROLLER @@ -2508,6 +2599,47 @@ static int virtnet_validate(struct virtio_device *vdev) return 0; } +static void __virtnet_vf_setup(struct net_device *ndev, + struct net_device *vf_netdev) +{ + int ret; + + /* Align MTU of VF with master */ + ret = dev_set_mtu(vf_netdev, ndev->mtu); + if (ret) + netdev_warn(vf_netdev, + "unable to change mtu to %u\n", ndev->mtu); + + if (netif_running(ndev)) { + ret = dev_open(vf_netde...
2017 Dec 19
5
[RFC PATCH] virtio_net: Extend virtio to use VF datapath when available
...ytes += vf_stats.rx_bytes; + tot->tx_bytes += vf_stats.tx_bytes; + tot->tx_dropped += vf_stats.tx_dropped; } #ifdef CONFIG_NET_POLL_CONTROLLER @@ -2508,6 +2599,47 @@ static int virtnet_validate(struct virtio_device *vdev) return 0; } +static void __virtnet_vf_setup(struct net_device *ndev, + struct net_device *vf_netdev) +{ + int ret; + + /* Align MTU of VF with master */ + ret = dev_set_mtu(vf_netdev, ndev->mtu); + if (ret) + netdev_warn(vf_netdev, + "unable to change mtu to %u\n", ndev->mtu); + + if (netif_running(ndev)) { + ret = dev_open(vf_netde...
2023 Jul 27
1
[PATCH] vdpa/mlx5: Fix crash on shutdown for when no ndev exists
On Thu, Jul 27, 2023 at 04:02:16PM +0000, Dragos Tatulea wrote: > On Wed, 2023-07-26 at 15:26 -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 26, 2023 at 10:07:38PM +0300, Dragos Tatulea wrote: > > > The ndev was accessed on shutdown without a check if it actually exists. > > > This triggered the crash pasted below. This patch simply adds a check > > > before using ndev. > > > > > > ?BUG: kernel NULL pointer dereference, address: 0000000000000300 > > > ?#PF:...
2012 Jul 23
4
[RFC 0/2] virtio: provide a way for host to monitor critical events in the device
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill. This short patch series introduces a new device named virtio-notifier which does two simple things: 1. Provide a simple interface for the guest to notify the host of critical