[PATCH linux-next 5/9] vdpa_sim_net: Remove redundant get_config callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that mac address and mtu are set in the vdpa_sim allocated config
space and read from the vdpa_sim maintained memory area, remove
get_config callback implementation.

Link status is setup only once, set up once after config space is
allocated by the vdpa_sim.

Signed-off-by: Parav Pandit <parav@xxxxxxxxxx>
Reviewed-by: Eli Cohen <elic@xxxxxxxxxx>
---
 drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
index 6e941b0e7935..61f1d37d8d60 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
@@ -102,14 +102,6 @@ static void vdpasim_net_work(struct work_struct *work)
 	spin_unlock(&vdpasim->lock);
 }
 
-static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config)
-{
-	struct virtio_net_config *net_config =
-		(struct virtio_net_config *)config;
-
-	net_config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);
-}
-
 static void vdpasim_net_mgmtdev_release(struct device *dev)
 {
 }
@@ -137,7 +129,6 @@ static int vdpasim_net_dev_add(struct vdpa_mgmt_dev *mdev, const char *name)
 	dev_attr.supported_features = VDPASIM_NET_FEATURES;
 	dev_attr.nvqs = VDPASIM_NET_VQ_NUM;
 	dev_attr.config_size = sizeof(struct virtio_net_config);
-	dev_attr.get_config = vdpasim_net_get_config;
 	dev_attr.work_fn = vdpasim_net_work;
 	dev_attr.buffer_size = PAGE_SIZE;
 
@@ -148,6 +139,7 @@ static int vdpasim_net_dev_add(struct vdpa_mgmt_dev *mdev, const char *name)
 	cfg = simdev->config;
 	eth_random_addr(cfg->mac);
 	cfg->mtu = cpu_to_vdpasim16(simdev, 1500);
+	cfg->status = cpu_to_vdpasim16(simdev, VIRTIO_NET_S_LINK_UP);
 
 	ret = _vdpa_register_device(&simdev->vdpa);
 	if (ret)
-- 
2.26.2

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux