Re: [PATCH net-next V1 2/4] virtio_net: extract get/set interrupt coalesce to a function

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

 





On Mon, Jul 10, 2023 at 5:21 PM Gavin Li <gavinl@xxxxxxxxxx> wrote:
Extract get/set interrupt coalesce to a function to be reused by global
and per queue config.

Signed-off-by: Gavin Li <gavinl@xxxxxxxxxx>
Reviewed-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>
---
 drivers/net/virtio_net.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

Acked-by: Jason Wang <jasowang@xxxxxxxxxx>

Thanks
 

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index dd5fec073a27..802ed21453f5 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -3093,10 +3093,8 @@ static int virtnet_coal_params_supported(struct ethtool_coalesce *ec)
        return 0;
 }

-static int virtnet_set_coalesce(struct net_device *dev,
-                               struct ethtool_coalesce *ec,
-                               struct kernel_ethtool_coalesce *kernel_coal,
-                               struct netlink_ext_ack *extack)
+static int virtnet_set_coalesce_one(struct net_device *dev,
+                                   struct ethtool_coalesce *ec)
 {
        struct virtnet_info *vi = netdev_priv(dev);
        int ret, i, napi_weight;
@@ -3127,10 +3125,16 @@ static int virtnet_set_coalesce(struct net_device *dev,
        return ret;
 }

-static int virtnet_get_coalesce(struct net_device *dev,
+static int virtnet_set_coalesce(struct net_device *dev,
                                struct ethtool_coalesce *ec,
                                struct kernel_ethtool_coalesce *kernel_coal,
                                struct netlink_ext_ack *extack)
+{
+       return virtnet_set_coalesce_one(dev, ec);
+}
+
+static int virtnet_get_coalesce_one(struct net_device *dev,
+                                   struct ethtool_coalesce *ec)
 {
        struct virtnet_info *vi = netdev_priv(dev);

@@ -3149,6 +3153,14 @@ static int virtnet_get_coalesce(struct net_device *dev,
        return 0;
 }

+static int virtnet_get_coalesce(struct net_device *dev,
+                               struct ethtool_coalesce *ec,
+                               struct kernel_ethtool_coalesce *kernel_coal,
+                               struct netlink_ext_ack *extack)
+{
+       return virtnet_get_coalesce_one(dev, ec);
+}
+
 static void virtnet_init_settings(struct net_device *dev)
 {
        struct virtnet_info *vi = netdev_priv(dev);
--
2.39.1

_______________________________________________
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