From: Simon Horman <horms@kernel.org>
To: Ronak Doshi <ronak.doshi@broadcom.com>
Cc: netdev@vger.kernel.org,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 2/4] vmxnet3: add latency measurement support in vmxnet3
Date: Wed, 15 May 2024 11:46:26 +0100 [thread overview]
Message-ID: <20240515104626.GE154012@kernel.org> (raw)
In-Reply-To: <20240514182050.20931-3-ronak.doshi@broadcom.com>
On Tue, May 14, 2024 at 11:20:47AM -0700, Ronak Doshi wrote:
> This patch enhances vmxnet3 to support latency measurement.
> This support will help to track the latency in packet processing
> between guest virtual nic driver and host. For this purpose, we
> introduce a new timestamp ring in vmxnet3 which will be per Tx/Rx
> queue. This ring will be used to carry timestamp of the packets
> which will be used to calculate the latency.
>
> Signed-off-by: Ronak Doshi <ronak.doshi@broadcom.com>
> Acked-by: Guolin Yang <guolin.yang@broadcom.com>
...
> index b3f3136cc8be..74cb63e3d311 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -143,6 +143,29 @@ vmxnet3_tq_stop(struct vmxnet3_tx_queue *tq, struct vmxnet3_adapter *adapter)
> netif_stop_subqueue(adapter->netdev, (tq - adapter->tx_queue));
> }
>
> +static u64
> +vmxnet3_get_cycles(int pmc)
> +{
> + u32 low, high;
> +
> + asm volatile("rdpmc" : "=a" (low), "=d" (high) : "c" (pmc));
> + return (low | ((u_int64_t)high << 32));
> +}
Hi Ronak,
This seems to open-code the rdpmc macro.
And it also seems to exclude compilation of this driver other than for x86.
This seems undesirable as, in general, networking drivers are supposed to
be architecture independent. I'd say, doubly so, for software devices.
Moreover, rdpmc outside of x86 architecture-specific code seems highly
unusual to me. So I wonder if there is a better approach to the problem at
hand.
If not, I would suggest making this feature optional and only compiled
for x86. That might mean factoring it out into a different file. I'm
unsure.
If not, I think the driver's Kconfig needs to be updated to reflect
that it can only be compiled for x86.
...
next prev parent reply other threads:[~2024-05-15 10:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 18:20 [PATCH net-next 0/4] vmxnet3: upgrade to version 9 Ronak Doshi
2024-05-14 18:20 ` [PATCH net-next 1/4] vmxnet3: prepare for version 9 changes Ronak Doshi
2024-05-14 18:20 ` [PATCH net-next 2/4] vmxnet3: add latency measurement support in vmxnet3 Ronak Doshi
2024-05-15 10:46 ` Simon Horman [this message]
[not found] ` <CAP1Q3XRYGySJQaWe8dvasUGmpZGcYy_g_Xgft2u=hg9R_eqEsQ@mail.gmail.com>
2024-05-20 19:19 ` Ronak Doshi
2024-05-20 20:06 ` Simon Horman
2024-05-15 23:02 ` kernel test robot
2024-05-16 1:59 ` kernel test robot
2024-05-16 3:31 ` kernel test robot
2024-05-14 18:20 ` [PATCH net-next 3/4] vmxnet3: add command to allow disabling of offloads Ronak Doshi
2024-05-15 10:47 ` Simon Horman
2024-05-14 18:20 ` [PATCH net-next 4/4] vmxnet3: update to version 9 Ronak Doshi
2024-05-15 10:49 ` Simon Horman
2024-05-15 10:52 ` [PATCH net-next 0/4] vmxnet3: upgrade " Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240515104626.GE154012@kernel.org \
--to=horms@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ronak.doshi@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).