From patchwork Mon Apr 8 03:44:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heng Qi X-Patchwork-Id: 13620532 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F9CE1860 for ; Mon, 8 Apr 2024 03:44:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.119 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712547877; cv=none; b=kDsEoP5RybjJ7RF5YxYIEYt6mJdmjGrJ+5TYCxdaUl6PSkNKdCUWSjyaOSqO5Qiq5pggiFIRjbL0q0y0bNzV57gLB0kEDaMhcIuBZP+2J/7u4qeNVfHxRAJhCpLIsgfBkgXwqK0JhnH7buzrtz4HrCgIP/nyD86eOLook9pcc1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712547877; c=relaxed/simple; bh=SWO0fVaWchjLFOPL6CaGCGri3NIRxlPUqkw9kX0BbOw=; h=From:To:Cc:Subject:Date:Message-Id; b=dCOneN/zlUPveSnm+DPmpgJHsIwWS+DeS2DSh7Y7MUtb/eQAx41Sam8q5Kd+0R+f/vPc9Mt3e5mXggeE2KT4Ie7dfC5yNVdT/Ou8JGVu0ML3FcXJVPKfu3Ks3fkGS/NiCimNLiTWy1xrSpyFFHoIkaMzXOnTW/In86ZCzMqfwoc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=yCAEOCtn; arc=none smtp.client-ip=115.124.30.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="yCAEOCtn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1712547872; h=From:To:Subject:Date:Message-Id; bh=tanDlrv6oLoOsI7+T+G+i7+SlpUnRod8vcHDadictDA=; b=yCAEOCtnkTP3PCt9wzwJDVC3Iqhz7dNTCzXY4dKrsbEOzTGpgHRqrYrTH5cTojkvUOLLp+ByGtz2B3ZzZYhefnaVHyzaTRxACaI9TTJj7ChH2CAwNZqxOAVyBOAPjdVlOfmvCdnqULrAapbIv0I8WTfkmG7Ideg0HGVh6YUFb4g= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R731e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=hengqi@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0W41ynly_1712547870; Received: from localhost(mailfrom:hengqi@linux.alibaba.com fp:SMTPD_---0W41ynly_1712547870) by smtp.aliyun-inc.com; Mon, 08 Apr 2024 11:44:31 +0800 From: Heng Qi To: netdev@vger.kernel.org, virtualization@lists.linux.dev Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jason Wang , "Michael S. Tsirkin" , Ratheesh Kannoth , Alexander Lobakin , Xuan Zhuo Subject: [PATCH net-next v4 0/4] ethtool: provide the dim profile fine-tuning channel Date: Mon, 8 Apr 2024 11:44:26 +0800 Message-Id: <1712547870-112976-1-git-send-email-hengqi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-Patchwork-Delegate: kuba@kernel.org The NetDIM library provides excellent acceleration for many modern network cards. However, the default profiles of DIM limits its maximum capabilities for different NICs, so providing a way which the NIC can be custom configured is necessary. Currently, interaction with the driver is still based on the commonly used "ethtool -C". The driver declares its supported parameters based on .supported_coalesce_params, and implements driver-related custom restrictions in .set_coalesce and .get_coalesce. Please review, thank you very much! Changelog ===== v3->v4: - Some tiny updates and patch 1 only add a new comment. v2->v3: - Break up the attributes to avoid the use of raw c structs. - Use per-device profile instead of global profile in the driver. v1->v2: - Use ethtool tool instead of net-sysfs V1 link: https://lore.kernel.org/all/1710421773-61277-1-git-send-email-hengqi@linux.alibaba.com/#r Heng Qi (4): ethtool: provide customized dim profile management linux/dim: move profiles from .c to .h file virtio-net: refactor dim initialization/destruction virtio-net: support dim profile fine-tuning Documentation/netlink/specs/ethtool.yaml | 29 +++++ Documentation/networking/ethtool-netlink.rst | 8 ++ drivers/net/virtio_net.c | 81 +++++++++++--- include/linux/dim.h | 45 ++++++++ include/linux/ethtool.h | 16 ++- include/uapi/linux/ethtool_netlink.h | 24 ++++ lib/dim/net_dim.c | 44 -------- net/ethtool/coalesce.c | 160 ++++++++++++++++++++++++++- 8 files changed, 347 insertions(+), 60 deletions(-)