search for: eth_random_addr

Displaying 20 results from an estimated 51 matches for "eth_random_addr".

2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...ice *dev; > int ret = -ENOMEM; > @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) > if (!vdpasim->buffer) > goto err_iommu; > > - config = &vdpasim->config; > - config->mtu = 1500; > - config->status = VIRTIO_NET_S_LINK_UP; > - eth_random_addr(config->mac); > + eth_random_addr(vdpasim->config.mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); > @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_devic...
2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...ice *dev; > int ret = -ENOMEM; > @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) > if (!vdpasim->buffer) > goto err_iommu; > > - config = &vdpasim->config; > - config->mtu = 1500; > - config->status = VIRTIO_NET_S_LINK_UP; > - eth_random_addr(config->mac); > + eth_random_addr(vdpasim->config.mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); > @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_devic...
2023 Jul 07
1
[PATCH virtio 1/4] pds_vdpa: reset to vdpa specified mac
...gt;> struct virtio_net_config __iomem *vc; >> >> vc = pdsv->vdpa_aux->vd_mdev.device; >> - memcpy_fromio(mac, vc->mac, sizeof(mac)); >> - if (is_zero_ether_addr(mac)) { >> - eth_random_addr(mac); >> - dev_info(dev, "setting random mac %pM\n", mac); >> - pds_vdpa_cmd_set_mac(pdsv, mac); >> + memcpy_fromio(pdsv->mac, vc->mac, sizeof(pdsv->mac)); >> + if (is_zero_ether_addr(...
2020 Jul 15
2
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
...8 @@ static struct vdpasim *vdpasim_create(void) goto err_iommu; config = &vdpasim->config; - config->mtu = 1500; - config->status = VIRTIO_NET_S_LINK_UP; + config->mtu = cpu_to_vdpasim16(vdpasim, 1500); + config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); eth_random_addr(config->mac); vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); -- MST
2020 Jul 15
2
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
...8 @@ static struct vdpasim *vdpasim_create(void) goto err_iommu; config = &vdpasim->config; - config->mtu = 1500; - config->status = VIRTIO_NET_S_LINK_UP; + config->mtu = cpu_to_vdpasim16(vdpasim, 1500); + config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); eth_random_addr(config->mac); vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); -- MST
2020 Aug 03
0
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...*config; struct vdpasim *vdpasim; struct device *dev; int ret = -ENOMEM; @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) if (!vdpasim->buffer) goto err_iommu; - config = &vdpasim->config; - config->mtu = 1500; - config->status = VIRTIO_NET_S_LINK_UP; - eth_random_addr(config->mac); + eth_random_addr(vdpasim->config.mac); vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_device *vdpa) static int vdpasim...
2020 Aug 05
0
[PATCH v3 22/38] vdpa_sim: fix endian-ness of config space
...*config; struct vdpasim *vdpasim; struct device *dev; int ret = -ENOMEM; @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) if (!vdpasim->buffer) goto err_iommu; - config = &vdpasim->config; - config->mtu = 1500; - config->status = VIRTIO_NET_S_LINK_UP; - eth_random_addr(config->mac); + eth_random_addr(vdpasim->config.mac); vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_device *vdpa) static int vdpasim...
2020 Aug 05
0
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...-ENOMEM; > > @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) > > if (!vdpasim->buffer) > > goto err_iommu; > > - config = &vdpasim->config; > > - config->mtu = 1500; > > - config->status = VIRTIO_NET_S_LINK_UP; > > - eth_random_addr(config->mac); > > + eth_random_addr(vdpasim->config.mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > > vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); > > @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struc...
2020 Feb 11
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...pasim->buffer) > + goto err_buffer_alloc; > + > + vdpasim->iommu = vhost_iotlb_alloc(2048, 0); > + if (!vdpasim->iommu) > + goto err_iotlb; > + > + config = &vdpasim->config; > + config->mtu = 1500; > + config->status = VIRTIO_NET_S_LINK_UP; > + eth_random_addr(config->mac); > + > + INIT_WORK(&vdpasim->work, vdpasim_work); > + spin_lock_init(&vdpasim->lock); > + > + vdpa = &vdpasim->vdpa; > + vdpa->dev.release = vdpasim_release_dev; The driver should not provide the release function. Again the safest model is...
2020 Jul 16
1
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
..._iommu; > > config = &vdpasim->config; > > - config->mtu = 1500; > > - config->status = VIRTIO_NET_S_LINK_UP; > > + config->mtu = cpu_to_vdpasim16(vdpasim, 1500); > > + config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); > > eth_random_addr(config->mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu);
2023 Jun 30
4
[PATCH virtio 0/4] pds_vdpa: mac, reset, and irq updates
v2 for internal review - heavily reworked NET_F_MAC patch, matches recent PR-68875 - reordered to put "clean and reset vqs" before "alloc-irq" to make them slightly simpler patches - other minor cleanups for simpler patches These are some fixes for device providing a MAC address, for allocating irq resources later to support vhost use, and for properly cleaning vq info
2023 Jun 30
4
[PATCH virtio 0/4] pds_vdpa: mac, reset, and irq updates
v2 for internal review - heavily reworked NET_F_MAC patch, matches recent PR-68875 - reordered to put "clean and reset vqs" before "alloc-irq" to make them slightly simpler patches - other minor cleanups for simpler patches These are some fixes for device providing a MAC address, for allocating irq resources later to support vhost use, and for properly cleaning vq info
2020 Jul 15
0
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
...oid) > goto err_iommu; > > config = &vdpasim->config; > - config->mtu = 1500; > - config->status = VIRTIO_NET_S_LINK_UP; > + config->mtu = cpu_to_vdpasim16(vdpasim, 1500); > + config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); > eth_random_addr(config->mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu);
2020 Jul 11
0
[vhost:config-endian 33/36] drivers/vdpa/vdpa_sim/vdpa_sim.c:335:21: sparse: sparse: incorrect type in assignment (different base types)
...ivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 @335 config->mtu = 1500; 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 @336 config->status = VIRTIO_NET_S_LINK_UP; 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 337 eth_random_addr(config->mac); 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 338 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 339 vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); 2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vd...
2020 Aug 03
51
[PATCH v2 00/24] virtio: config space endian-ness cleanup
Config space endian-ness is currently a mess: fields are not tagged with the correct endian-ness so it's easy to make mistakes like instanciating config space in native endian-ness. The following patches adding sparse tagging are currently in my tree. Lightly tested. As a follow-up, I plan to add new APIs that handle modern config space in a more efficient way (bypassing the version check).
2019 Sep 10
1
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...return -ENOMEM; > + > + mvnet->buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); > + if (!mvnet->buffer) { > + kfree(mvnet); > + return -ENOMEM; > + } > + > + config = &mvnet->config; > + config->mtu = 1500; > + config->status = VIRTIO_NET_S_LINK_UP; > + eth_random_addr(config->mac); > + > + INIT_WORK(&mvnet->work, mvnet_work); > + > + spin_lock_init(&mvnet->lock); > + mvnet->mdev = mdev; > + mdev_set_drvdata(mdev, mvnet); > + > + mutex_lock(&mdev_list_lock); > + list_add(&mvnet->next, &mdev_devices_lis...
2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); + if (!vdpasim->buffer) + goto err_buffer_alloc; + + vdpasim->iommu = vhost_iotlb_alloc(2048, 0); + if (!vdpasim->iommu) + goto err_iotlb; + + config = &vdpasim->config; + config->mtu = 1500; + config->status = VIRTIO_NET_S_LINK_UP; + eth_random_addr(config->mac); + + INIT_WORK(&vdpasim->work, vdpasim_work); + spin_lock_init(&vdpasim->lock); + + vdpa = &vdpasim->vdpa; + vdpa->dev.release = vdpasim_release_dev; + + vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); + vringh_set_iotlb(&vdpasim->v...
2020 Feb 20
0
[PATCH V3 5/5] vdpasim: vDPA device simulator
...NEL); + if (!buffer) + goto err_buffer; + + vdpasim = kzalloc(sizeof(*vdpasim), GFP_KERNEL); + if (!vdpasim) + goto err_alloc; + + vdpasim->buffer = buffer; + vdpasim->iommu = iommu; + + config = &vdpasim->config; + config->mtu = 1500; + config->status = VIRTIO_NET_S_LINK_UP; + eth_random_addr(config->mac); + + INIT_WORK(&vdpasim->work, vdpasim_work); + spin_lock_init(&vdpasim->lock); + + vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); + vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); + + dev = &vdpasim->dev; + dev->relea...
2019 Nov 05
0
[PATCH V8 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...uct mvnet_state), GFP_KERNEL); + if (mvnet == NULL) + return -ENOMEM; + + mvnet->buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); + if (!mvnet->buffer) { + kfree(mvnet); + return -ENOMEM; + } + + config = &mvnet->config; + config->mtu = 1500; + config->status = VIRTIO_NET_S_LINK_UP; + eth_random_addr(config->mac); + + INIT_WORK(&mvnet->work, mvnet_work); + + spin_lock_init(&mvnet->lock); + mvnet->mdev = mdev; + mdev_set_drvdata(mdev, mvnet); + + mutex_lock(&mdev_list_lock); + list_add(&mvnet->next, &mdev_devices_list); + mutex_unlock(&mdev_list_lock); + +...
2019 Sep 10
0
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...uct mvnet_state), GFP_KERNEL); + if (mvnet == NULL) + return -ENOMEM; + + mvnet->buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); + if (!mvnet->buffer) { + kfree(mvnet); + return -ENOMEM; + } + + config = &mvnet->config; + config->mtu = 1500; + config->status = VIRTIO_NET_S_LINK_UP; + eth_random_addr(config->mac); + + INIT_WORK(&mvnet->work, mvnet_work); + + spin_lock_init(&mvnet->lock); + mvnet->mdev = mdev; + mdev_set_drvdata(mdev, mvnet); + + mutex_lock(&mdev_list_lock); + list_add(&mvnet->next, &mdev_devices_list); + mutex_unlock(&mdev_list_lock); + +...