Jason Wang
2023-Jul-12 07:39 UTC
[PATCH net-next V1 2/4] virtio_net: extract get/set interrupt coalesce to a function
On Mon, Jul 10, 2023 at 5:21?PM Gavin Li <gavinl at nvidia.com> wrote:> Extract get/set interrupt coalesce to a function to be reused by global > and per queue config. > > Signed-off-by: Gavin Li <gavinl at nvidia.com> > Reviewed-by: Dragos Tatulea <dtatulea at nvidia.com> > Reviewed-by: Jiri Pirko <jiri at nvidia.com> > --- > drivers/net/virtio_net.c | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) >Acked-by: Jason Wang <jasowang at redhat.com> 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 > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20230712/cc618896/attachment.html>