DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@mellanox.com>
To: Ori Kam <orika@mellanox.com>, Matan Azrad <matan@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Raslan Darawsheh <rasland@mellanox.com>,
	Slava Ovsiienko <viacheslavo@mellanox.com>
Subject: [dpdk-dev] [RFC] net/mlx5: new device parameter to configure hairpin queue data size
Date: Tue, 17 Mar 2020 15:45:34 +0000	[thread overview]
Message-ID: <VI1PR05MB419255A5DCF7DB1DCC3108AEDDF60@VI1PR05MB4192.eurprd05.prod.outlook.com> (raw)

When configuring hairpin queues, there is an input parameter to set
the number of descriptors both for TX and RX interfaces. But it is not
used for mlx5 devices because of the firmware mechanism.
Currently, the stride buffer is being used for every ingress packet in
the firmware. PMD driver could only set the total data buffer size and
the maximal number of packets. Their relationship is as below (for a
single queue):
  total_data_size = stride_size * maximal_packet_number

And small stride size is recommended (e.g. 64B) to save the
memory for small packets and get better performance. To
configure the hairpin queue, either the total data buffer size or the
maximal packet number could be used.
When using "maximal packet number", it is not quite straightforward:
  1. It doesn't mean the packets number that could be held in the same
     time. Because for a larger packet, more than one stride will be
     consumed.
  2. It is not quite clear that what is the maximal length supported
     for a single packet.

A new device parameter will be introduced for mlx5 devices to set the
data buffer length - "hp_buf_log_sz".
  1. It is a logarithm value, so the actual buffer length will be
    2 ^^ hp_buf_log_sz.
  2. If not set when probing the device, a default value will be used.
  3. If jumbo frames need to be supported for the hairpin, then a
     larger value could be set. Or else, some smaller value will help
     to save the memory and fewer cache misses.
  4. There is no need to care about the hairpin queue depth since no
     SW is involved. And firmware will be in charge of the packet
     descriptors number and make sure it is full enough.

             reply	other threads:[~2020-03-17 15:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 15:45 Bing Zhao [this message]
2020-03-24 12:59 ` [dpdk-dev] [PATCH] net/mlx5: introduce dev parameter for hairpin Bing Zhao
2020-03-31  8:20   ` Slava Ovsiienko
2020-03-31 14:01   ` Raslan Darawsheh

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=VI1PR05MB419255A5DCF7DB1DCC3108AEDDF60@VI1PR05MB4192.eurprd05.prod.outlook.com \
    --to=bingz@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=orika@mellanox.com \
    --cc=rasland@mellanox.com \
    --cc=viacheslavo@mellanox.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).