Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp549685pxa; Tue, 11 Aug 2020 09:12:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJT/pePhH1n4SdnbTmbjMucg3tS2nLrbo68zY3ll325hMT5QeSH2L8PG7Vwm0BsuW+0RL4 X-Received: by 2002:a50:8f44:: with SMTP id 62mr25901782edy.351.1597162326188; Tue, 11 Aug 2020 09:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597162326; cv=none; d=google.com; s=arc-20160816; b=DUetpxHz7GN2CWJq2yRxSJjekNNd1zaz41A9WGQEgJnGc/kd3abU+NklQb6tvmgx3k taDsCWvwbov22X4hlUswkYZi7IoLNihMsHxtcetvGjuYd5Rsexs1PdqRjmgb5M4MaQ5c 9gTnXSvieMYZB+2aGFo7cvh3ytnuGwsZ9pr3NYwCd7Yzl5YuedqsyYfP+WLnEerZjjwS xbn65knSoqbdQ7C1+fziMJI0z29b+buA8q2ho5owrZVZeBWkeT77ZQyNDRppyBIeBSu2 9NSKwXT27CzJrRw2JDok1hrOZREMdqHiIbnUjxopV1Lmub5dJffDdatOZG5iuRLX9d44 393A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=EK1sbFulOF0V9vRXAL3GbYbkOAW9ujbZSox8NAhaWus=; b=nE8IpDL3DnzLaklzLDKpjYkbEaZB920XgrIHXU93rqi7ecDXaX04hL1GTqbhskhisp iDro3dotUT0wSOmnS9fyQd203slLnZ0JvPi0kjC5Rs1muNRxw8wZu8/4j7fIeiFOJ7aP DK6iVoMFhT++hM/ywogndfU57VLcUexBqxnboIjZ+MlH6Lk62PCfW8pJDQQVeH0cYrJK U2b/ejWES8ucTrnEhtxrrZlzvuyd/QdVBuctOEQnYKCYWZF1yGcWzOwYApW7wd4GZBkK 9nN1howNcSxTStPC0YQTzVetTOqx5mfE/n91wZPfc454Udr3Cf7cAXA9Lz+/MNFMPA4J +aJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=gS19uwfs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si10915035ejg.674.2020.08.11.09.11.43; Tue, 11 Aug 2020 09:12:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=gS19uwfs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729090AbgHKQLG (ORCPT + 99 others); Tue, 11 Aug 2020 12:11:06 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:14353 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728797AbgHKQLF (ORCPT ); Tue, 11 Aug 2020 12:11:05 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 11 Aug 2020 09:10:52 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 11 Aug 2020 09:11:05 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 11 Aug 2020 09:11:05 -0700 Received: from [10.2.60.121] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 11 Aug 2020 16:10:56 +0000 Subject: Re: VDPA Debug/Statistics To: "Michael S. Tsirkin" , Eli Cohen CC: Jason Wang , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "eli@mellanox.com" , "lulu@redhat.com" , Majd Dibbiny , "Maor Dickman" , Shahaf Shuler , "Parav Pandit" References: <20200811073144-mutt-send-email-mst@kernel.org> <20200811083803-mutt-send-email-mst@kernel.org> From: Roopa Prabhu Message-ID: <16cef93e-7421-a151-65ab-ba21e44cd00f@nvidia.com> Date: Tue, 11 Aug 2020 09:10:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200811083803-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1597162252; bh=EK1sbFulOF0V9vRXAL3GbYbkOAW9ujbZSox8NAhaWus=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:Content-Type: Content-Transfer-Encoding:Content-Language:X-Originating-IP: X-ClientProxiedBy; b=gS19uwfsH12QJJzg9ZODa7mhQbKSP1lVW35d0TgX5+PAr7ToMbjpXXuaq/R2J2vnZ sEYD47GIu0nqR+rJQtdkjFLU+Yl83CqM3MN7b7BonSD8L5BanYpKbg81YS7Nz8UXL7 YlKbwRcNK5liipinpMS67fkeNt6gw9WLVwW6mG+z5419Q78JxjOSAY+U4XHVbghojA PHyzitc4Y9iftdDW7ymuUOn22mRkk3QQ9KI/LJ80d4bAZc6GChOwJkxndt4l4gPuHU fEmP4ctUu244HPPdLw8pmcBQNnlxbwGUPeM1l0YgXZJr830nTrYW/lb0oD+9sa+XmV 61sTlM6BQOFDA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/11/20 5:44 AM, Michael S. Tsirkin wrote: > External email: Use caution opening links or attachments > > > On Tue, Aug 11, 2020 at 11:58:23AM +0000, Eli Cohen wrote: >> On Tue, Aug 11, 2020 at 11:26:20AM +0000, Eli Cohen wrote: >>> Hi All >>> >>> Currently, the only statistics we get for a VDPA instance comes from the virtio_net device instance. Since VDPA involves hardware acceleration, there can be quite a lot of information that can be fetched from the underlying device. Currently there is no generic method to fetch this information. >>> >>> One way of doing this can be to create a the host, a net device for >>> each VDPA instance, and use it to get this information or do some >>> configuration. Ethtool can be used in such a case >>> >>> I would like to hear what you think about this or maybe you have some other ideas to address this topic. >>> >>> Thanks, >>> Eli >> Something I'm not sure I understand is how are vdpa instances created on mellanox cards? There's a devlink command for that, is that right? >> Can that be extended for stats? >> >> Currently any VF will be probed as VDPA device. We're adding devlink support but I am not sure if devlink is suitable for displaying statistics. We will discuss internally but I wanted to know why you guys think. > OK still things like specifying the mac are managed through rtnetlink, > right? > > Right now it does not look like you can mix stats and vf, they are > handled separately: > > if (rtnl_fill_stats(skb, dev)) > goto nla_put_failure; > > if (rtnl_fill_vf(skb, dev, ext_filter_mask)) > goto nla_put_failure; > > but ability to query vf stats on the host sounds useful generally. > > As another option, we could use a vdpa specific way to retrieve stats, > and teach qemu to report them. If you are looking for a place to add additional stats, please, check the RTM_*STATS api https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/net/core/rtnetlink.c#n5351 (Its a place where new interface and protocol stats are being added)