From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Parav Pandit <parav@nvidia.com>
Cc: "jasowang@redhat.com" <jasowang@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
David Edmondson <david.edmondson@oracle.com>,
"virtio-comment@lists.oasis-open.org"
<virtio-comment@lists.oasis-open.org>,
"virtio-dev@lists.oasis-open.org"
<virtio-dev@lists.oasis-open.org>
Subject: [virtio-dev] Re: RE: RE: [PATCH v16] virtio-net: support device stats
Date: Mon, 4 Sep 2023 16:02:14 +0800 [thread overview]
Message-ID: <1693814534.4663684-3-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <PH0PR12MB5481859AEB22FDDFCDA9D57FDCE9A@PH0PR12MB5481.namprd12.prod.outlook.com>
On Mon, 4 Sep 2023 08:00:36 +0000, Parav Pandit <parav@nvidia.com> wrote:
>
> > From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > Sent: Monday, September 4, 2023 1:04 PM
>
> > > > +If one or more of the VIRTIO_NET_F_GUEST_TSO4,
> > > > VIRTIO_NET_F_GUEST_TSO6,
> > > > +or VIRTIO_NET_F_GUEST_UFO have been negotiated, the receiveq GSO
> > > > +statistics can be obtained.
> > > > +
> > > UFO is deprecated feature in the OS that supported it.
> > > And unlikely to be used in any new OS.
> > > So I think one should drop the UFO for now from above.
> >
> > But, the virtio spec supports it. So I think we should include it here.
> >
> UFO and receive GSO is bit different.
> And UFO has near to zero use.
> So if this is really needed, one can implement such counter later when UFO is actually implemented and used.
I agree.
>
> > > > +\begin{description}
> > > > + \item [tx_gso_packets]
> > > > + The number of the GSO packets sent by device that are not cut to
> > small
> > > > + packets.
> > > > +
> > > Above is a strange counter.
> > > Do you have an example of it along with _split counter below?
> > > I am probably misunderstanding it.
> >
> > On one host, a vm can send a gso packet without cutting to other vm.
> >
> Do you mean some sw entity has sent the GSO packet directly such as 64KB SKB without creating segments?
YES.
> If so, how will the receive device can receive such large packet when the posted buffer is not worth the 64KB size?
The virtio-net merge mode.
>
> > >
> > > > + \item [tx_gso_bytes]
> > > > + The bytes of the GSO packets sent by device that are not cut to small
> > > > + packets.
> > > > +
> > > > + \item [tx_gso_packets_split]
> > > > + The number of the GSO packets that been cut into small packets.
> > > > +
> > > Which has been cut into small packets.
> > >
> > > > + \item [tx_gso_bytes_split]
> > > > + The bytes of the GSO packets that been cut into small packets.
> > > > +
> > > > + \item [tx_gso_segments]
> > > > + The number of segments separated from the GSO packets.
> > > > +
> > > > + \item [tx_gso_segments_bytes]
> > > > + The bytes of segments separated from the GSO packets.
> > > > +\end{description}
> > > > +
> > > > +\subparagraph{Receiveq Speed Statistic}\label{sec:Device Types /
> > > > +Network Device / Device Operation / Control Virtqueue / Device
> > > > +Statistic / Receiveq Speed Statistic}
> > > > +
> > > > +The structure corresponding to the receiveq speed statistics is
> > > > virtio_net_stats_rx_speed.
> > > > +The corresponding type is VIRTIO_NET_STATS_TYPE_RX_SPEED. This is
> > > > +for the receiveq.
> > > > +
> > > > +The device has the allowance for the speed. If
> > > > +VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, the driver can get
> > > > +this by
> > > > \field{speed}.
> > > > +When the real speed exceeds the speed allowance, some packets will
> > > > +be dropped by the device.
> > > > +
> > > Above description regarding "real speed" is confusing.
> > > I think you wanted to say,
> > >
> > > When the received packets rate exceeds the negotiated speed, some packets
> > may be dropped by the device.
> > >
> > > > +\begin{lstlisting}
> > > > +struct virtio_net_stats_rx_speed {
> > > > + struct virtio_net_stats_reply_hdr hdr;
> > > > +
> > > > + le64 rx_packets_allowance_exceeded;
> > > > + le64 rx_bytes_allowance_exceeded; }; \end{lstlisting}
> > > > +
> > > > +The packets described below were all presented on the specified virtqueue.
> > > > +\begin{description}
> > > > + \item [rx_packets_allowance_exceeded]
> > > > + The number of the packets dropped by device due to the real speed
> > > > + exceeding the speed allowance.
> > > > +
> > > Similar rewording like above to drop "real".
> > >
> > > > + \item [rx_bytes_allowance_exceeded]
> > > > + The bytes of the packets dropped by device due to the real speed
> > > > + exceeding the speed allowance.
> > > > +
> > > > +\end{description}
> > > > +
> > > > +\subparagraph{Transmitq Speed Statistic}\label{sec:Device Types /
> > > > +Network Device / Device Operation / Control Virtqueue / Device
> > > > +Statistic / Transmitq Speed Statistic}
> > > > +
> > > > +The structure corresponding to the transmitq speed statistics is
> > > > +virtio_net_stats_tx_speed. The corresponding type is
> > > > +VIRTIO_NET_STATS_TYPE_TX_SPEED. This is for the transmitq.
> > > > +
> > > > +The device has the allowance for the speed. If
> > > > +VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, the driver can get
> > > > +this by
> > > > \field{speed}.
> > > > +When the real speed exceeds the speed allowance, some packets will
> > > > +be dropped by the device.
> > > > +
> > > > +\begin{lstlisting}
> > > > +struct virtio_net_stats_tx_speed {
> > > > + struct virtio_net_stats_reply_hdr hdr;
> > > > +
> > > > + le64 tx_packets_allowance_exceeded;
> > > > + le64 tx_bytes_allowance_exceeded; }; \end{lstlisting}
> > > > +
> > > > +The packets described below were all presented on the specified virtqueue.
> > > > +\begin{description}
> > > > + \item [tx_packets_allowance_exceeded]
> > > > + The number of the packets dropped by device due to the real speed
> > > > + exceeding the speed allowance.
> > > > +
> > > > + \item [tx_bytes_allowance_exceeded]
> > > > + The bytes of the packets dropped by device due to the real speed
> > > > + exceeding the speed allowance.
> > > > +
> > > > +\end{description}
> > > > +
> > > > +\devicenormative{\subparagraph}{Device Statistic}{Device Types /
> > > > +Network Device / Device Operation / Control Virtqueue / Device
> > > > +Statistic} The device MUST replies to the command
> > > > +VIRTIO_NET_CTRL_STATS_QUERY with the struct
> > virtio_net_stats_capabilities.
> > > > \field{supported_stats_types} includes all the statistic types
> > > > supported by the device.
> > > > +
> > > > +If virtio_net_ctrl_queue_stats is incorrect (such as the
> > > > +following), the device MUST set \field{ack} to VIRTIO_NET_ERR. Even
> > > > +if there is only one error, the device MUST fail the entire command.
> > > > +\begin{itemize}
> > > > + \item \field{vq_index} exceeds the queue range.
> > > > + \item \field{types_bitmap} contains unknown types.
> > > > + \item One or more of the bits present in \field{types_bitmap} is not valid
> > > > + for the specified virtqueue.
> > > > + \item The feature corresponding to the specified \field{types_bitmap}
> > was
> > > > + not negotiated.
> > > > + \item The size of the buffer allocated by the driver for
> > > > +\field{command-
> > > > specific-result}
> > > > + is less than the total size of the statistics specialed by
> > > > + \field{virtio_net_ctrl_queue_stats}.
> > > > +\end{itemize}
> > > > +
> > > > +The device MUST write the requested statistic structures in
> > > s/statistic/statistics
> > >
> > > > +\field{command-specific-result} in the order specified by the
> > > > +structure virtio_net_ctrl_queue_stats. If the \field{types_bitmap}
> > > > +indicates
> > > Use \field{..}
> > >
> > > > +multiple statistics, the replies order by the type value from small to large.
> > > > +
> > > These replies are ordered by the type value from small to large.
> > > I am not sure device needs to order them.
> >
> > Now, the hdr of statistics has the type field.
> >
> > We can remove this.
> >
> We still need the type field, just need to remove the ordering need.
Yes. I think so.
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
next prev parent reply other threads:[~2023-09-04 8:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 5:52 [virtio-dev] [PATCH v16] virtio-net: support device stats Xuan Zhuo
2023-09-01 13:58 ` [virtio-dev] " Parav Pandit
2023-09-01 14:45 ` [virtio-dev] " Michael S. Tsirkin
2023-09-04 7:46 ` [virtio-dev] Re: [virtio-comment] " Xuan Zhuo
2023-09-04 7:33 ` [virtio-dev] Re: " Xuan Zhuo
2023-09-04 8:00 ` [virtio-dev] " Parav Pandit
2023-09-04 8:02 ` Xuan Zhuo [this message]
2023-09-04 8:08 ` [virtio-dev] " Parav Pandit
2023-09-04 8:52 ` [virtio-dev] " Xuan Zhuo
2023-09-04 10:26 ` [virtio-dev] " Parav Pandit
2023-09-04 11:11 ` Heng Qi
2023-09-04 12:21 ` Parav Pandit
2023-09-04 13:28 ` Michael S. Tsirkin
2023-09-04 13:40 ` Parav Pandit
2023-09-05 2:55 ` Xuan Zhuo
2023-09-05 3:31 ` Parav Pandit
2023-09-05 6:42 ` Xuan Zhuo
2023-09-05 6:51 ` Parav Pandit
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=1693814534.4663684-3-xuanzhuo@linux.alibaba.com \
--to=xuanzhuo@linux.alibaba.com \
--cc=david.edmondson@oracle.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=parav@nvidia.com \
--cc=virtio-comment@lists.oasis-open.org \
--cc=virtio-dev@lists.oasis-open.org \
/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