From: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
To: "Wang, Yipeng1" <yipeng1.wang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
"Chilikin, Andrey" <andrey.chilikin@intel.com>,
"Kinsella, Ray" <ray.kinsella@intel.com>,
"Gobriel, Sameh" <sameh.gobriel@intel.com>,
"Richardson, Bruce" <bruce.richardson@intel.com>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] hash: add predictable RSS implementation
Date: Sun, 11 Apr 2021 21:52:49 +0300 [thread overview]
Message-ID: <55e3ada5-4073-7e69-11d6-11366de565a9@intel.com> (raw)
In-Reply-To: <BYAPR11MB34941D81BA16F7EB7E3C3946C3729@BYAPR11MB3494.namprd11.prod.outlook.com>
On 10/04/2021 03:10, Wang, Yipeng1 wrote:
>> -----Original Message-----
>> From: Medvedkin, Vladimir <vladimir.medvedkin@intel.com>
>> Sent: Tuesday, April 6, 2021 12:51 PM
>> To: dev@dpdk.org
>> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Chilikin, Andrey
>> <andrey.chilikin@intel.com>; Kinsella, Ray <ray.kinsella@intel.com>; Wang,
>> Yipeng1 <yipeng1.wang@intel.com>; Gobriel, Sameh
>> <sameh.gobriel@intel.com>; Richardson, Bruce
>> <bruce.richardson@intel.com>
>> Subject: [PATCH v2 2/3] hash: add predictable RSS implementation
>>
>> This patch implements predictable RSS functionality.
>>
>> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
>> ---
>> lib/librte_hash/rte_thash.c | 577
>> ++++++++++++++++++++++++++++++++++++++++++--
>> lib/librte_hash/rte_thash.h | 42 ++++
>> lib/librte_hash/version.map | 1 +
>> 3 files changed, 602 insertions(+), 18 deletions(-)
>>
<snip>
>> +/**
>> + * writes m-sequence to the hash_key for range [start, end]
>> + * (i.e. including start and end positions) */ static int
>> +generate_subkey(struct rte_thash_ctx *ctx, struct thash_lfsr *lfsr,
>> +uint32_t start, uint32_t end)
>> +{
>> +uint32_t i;
>> +uint32_t req_bits = (start < end) ? (end - start) : (start - end);
>> +req_bits++; /* due to incuding end */
>> +
>> +/* check if lfsr overflow period of the m-sequence */
>> +if (((lfsr->bits_cnt + req_bits) > (1ULL << lfsr->deg) - 1) &&
>> +((ctx->flags &
>> RTE_THASH_IGNORE_PERIOD_OVERFLOW) !=
>> +RTE_THASH_IGNORE_PERIOD_OVERFLOW))
>> +return -ENOSPC;
> [Wang, Yipeng]
> If nospace, should one increase lfsr->deg? Or if it is already the highest deg you predefined then what to do?
> Maybe a log msg could help user with more information on the solutions.
It is not possible to increase the degree of lfsr due to mathematical
restrictions. It must be exactly equal to the number of bits for which
we want to have a collision.
>> +
>> +if (start < end) {
>> +/* original direction (from left to right)*/
>> +for (i = start; i <= end; i++)
>> +set_bit(ctx->hash_key, get_bit_lfsr(lfsr), i);
<snip>
>> +/**
>> + * Adjust tuple with complimentary bits.
>> + *
> [Wang, Yipeng]
> More explanation for this API is needed.
> My understanding is that user should call this function in a loop, until
> the above callback function returns success thus this function succeeds.
I'm going to rewrite this function in v3. The loop will be internal.
> BTW, why not put this API in the first API commit?
>
My fault, will fix this
>> + * @param h
>> + * Pointer to the helper struct
>> + * @param orig_tuple
>> + * Pointer to the tuple to be adjusted
>> + * @param adj_bits
>> + * Valure returned by rte_thash_get_compliment
> [Wang, Yipeng] typo. *value
>> + * @param fn
>> + * Callback function to check adjusted tuple. Could be NULL
>> + * @param userdata
>> + * Pointer to the userdata to be passed to fn(). Could be NULL
>> + *
>> + * @return
>> + * 0 on success
>> + * negative otherwise
>> + */
>> +__rte_experimental
>> +int
>> +rte_thash_adjust_tuple(struct rte_thash_subtuple_helper *h,
>> +uint8_t *orig_tuple, uint32_t adj_bits,
>> +rte_thash_check_tuple_t fn, void *userdata);
>> +
>> #ifdef __cplusplus
>> }
>> #endif
>> diff --git a/lib/librte_hash/version.map b/lib/librte_hash/version.map index
>> 93cb230..a992a1e 100644
>> --- a/lib/librte_hash/version.map
>> +++ b/lib/librte_hash/version.map
>> @@ -32,6 +32,7 @@ DPDK_21 {
>> EXPERIMENTAL {
>> global:
>>
>> +rte_thash_adjust_tuple;
>> rte_hash_free_key_with_position;
>> rte_hash_lookup_with_hash_bulk;
>> rte_hash_lookup_with_hash_bulk_data;
>> --
>> 2.7.4
>
--
Regards,
Vladimir
next prev parent reply other threads:[~2021-04-11 18:52 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 18:24 [dpdk-dev] [PATCH v1 0/3] Predictable RSS feature Vladimir Medvedkin
2021-03-16 18:24 ` [dpdk-dev] [PATCH v1 1/3] hash: add predictable RSS API Vladimir Medvedkin
2021-03-16 18:24 ` [dpdk-dev] [PATCH v1 2/3] hash: add predictable RSS implementation Vladimir Medvedkin
2021-03-16 18:24 ` [dpdk-dev] [PATCH v1 3/3] test/hash: add additional thash tests Vladimir Medvedkin
2021-04-06 19:50 ` [dpdk-dev] [PATCH v2 0/3] Predictable RSS feature Vladimir Medvedkin
2021-04-08 15:56 ` Stephen Hemminger
2021-04-11 18:51 ` Medvedkin, Vladimir
2021-10-22 20:37 ` Thomas Monjalon
2021-10-24 14:42 ` Vladimir Medvedkin
2021-04-10 0:32 ` Wang, Yipeng1
2021-04-11 18:51 ` Medvedkin, Vladimir
2021-04-11 19:11 ` [dpdk-dev] [PATCH v3 " Vladimir Medvedkin
2021-04-13 13:19 ` [dpdk-dev] [PATCH v4 " Vladimir Medvedkin
2021-04-14 18:04 ` Wang, Yipeng1
2021-04-15 8:29 ` David Marchand
2021-04-19 15:59 ` [dpdk-dev] [PATCH v5 0/5] " Vladimir Medvedkin
2021-04-20 21:31 ` Thomas Monjalon
2021-04-19 15:59 ` [dpdk-dev] [PATCH v5 1/5] hash: add predictable RSS API Vladimir Medvedkin
2021-04-19 15:59 ` [dpdk-dev] [PATCH v5 2/5] hash: add predictable RSS implementation Vladimir Medvedkin
2021-04-19 15:59 ` [dpdk-dev] [PATCH v5 3/5] test/hash: add additional thash tests Vladimir Medvedkin
2021-04-29 9:13 ` David Marchand
2021-04-29 9:17 ` Medvedkin, Vladimir
2021-04-29 18:45 ` Stanislaw Kardach
2021-05-04 14:06 ` Medvedkin, Vladimir
2021-04-19 15:59 ` [dpdk-dev] [PATCH v5 4/5] doc: add thash documentation Vladimir Medvedkin
2021-04-20 11:25 ` Mcnamara, John
2021-04-19 15:59 ` [dpdk-dev] [PATCH v5 5/5] maintainers: claim maintainership of the hash library Vladimir Medvedkin
2021-04-13 13:19 ` [dpdk-dev] [PATCH v4 1/3] hash: add predictable RSS API Vladimir Medvedkin
2021-04-14 17:06 ` Wang, Yipeng1
2021-04-13 13:19 ` [dpdk-dev] [PATCH v4 2/3] hash: add predictable RSS implementation Vladimir Medvedkin
2021-04-14 17:51 ` Wang, Yipeng1
2021-04-13 13:19 ` [dpdk-dev] [PATCH v4 3/3] test/hash: add additional thash tests Vladimir Medvedkin
2021-04-14 17:56 ` Wang, Yipeng1
2021-04-11 19:11 ` [dpdk-dev] [PATCH v3 1/3] hash: add predictable RSS API Vladimir Medvedkin
2021-04-11 19:11 ` [dpdk-dev] [PATCH v3 2/3] hash: add predictable RSS implementation Vladimir Medvedkin
2021-04-11 19:11 ` [dpdk-dev] [PATCH v3 3/3] test/hash: add additional thash tests Vladimir Medvedkin
2021-04-06 19:50 ` [dpdk-dev] [PATCH v2 1/3] hash: add predictable RSS API Vladimir Medvedkin
2021-04-10 0:05 ` Wang, Yipeng1
2021-04-11 18:52 ` Medvedkin, Vladimir
2021-04-06 19:50 ` [dpdk-dev] [PATCH v2 2/3] hash: add predictable RSS implementation Vladimir Medvedkin
2021-04-07 12:53 ` Ananyev, Konstantin
2021-04-11 18:51 ` Medvedkin, Vladimir
2021-04-12 9:47 ` Ananyev, Konstantin
2021-04-13 12:28 ` Medvedkin, Vladimir
2021-04-10 0:10 ` Wang, Yipeng1
2021-04-11 18:52 ` Medvedkin, Vladimir [this message]
2021-04-06 19:50 ` [dpdk-dev] [PATCH v2 3/3] test/hash: add additional thash tests Vladimir Medvedkin
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=55e3ada5-4073-7e69-11d6-11366de565a9@intel.com \
--to=vladimir.medvedkin@intel.com \
--cc=andrey.chilikin@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=ray.kinsella@intel.com \
--cc=sameh.gobriel@intel.com \
--cc=stephen@networkplumber.org \
--cc=yipeng1.wang@intel.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).