Skip to content

Hashing Enhancements for Efficient RoCE Traffic Distribution#2144

Merged
tjchadaga merged 1 commit intoopencomputeproject:masterfrom
sathk-marvell:sathk_hash_rdma
Mar 24, 2025
Merged

Hashing Enhancements for Efficient RoCE Traffic Distribution#2144
tjchadaga merged 1 commit intoopencomputeproject:masterfrom
sathk-marvell:sathk_hash_rdma

Conversation

@sathk-marvell
Copy link
Copy Markdown
Contributor

This Feature adds New Hash fields to support hashing based on RDMA fields

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Feb 27, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread inc/saihash.h Outdated

/** No field - for compatibility, must be last */
SAI_NATIVE_HASH_FIELD_NONE = 0x00000021,
SAI_NATIVE_HASH_FIELD_NONE = 0x00000023,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not backward compatible change and you are adding exception for that, please remove

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified this based on comment on Line No:178. This might change in future even with new hash-field additions.

Can we deprecate this enum definition and start adding new fields after this.? will add a comment saying not a valid field used only for backward compatibility

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bring it back to expected value and remove exception in ancestry, NONE is none, no mather what value it has binary

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kcudnik, @sathk-marvell - this field is still causing meta checker to fail. Please check

Comment thread meta/ancestry.pl Outdated
next if $enumName eq "SAI_OBJECT_TYPE_MAX";
next if $enumName eq "SAI_PORT_INTERFACE_TYPE_MAX";
next if $enumName eq "SAI_PORT_BREAKOUT_MODE_TYPE_MAX";
next if $enumName eq "SAI_NATIVE_HASH_FIELD_NONE";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding exception is not backward compatible, please revert

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For modules with last attribute != XXX_END, we need this. tried all combinations, meta always failing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only applies to attributes enum, previously last enum was flow lubelskie and it was passing, please remote those exceptions as semestr like the error maybe in diferent place

@tjchadaga tjchadaga requested a review from abdosi March 6, 2025 22:22
@tjchadaga
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@tjchadaga
Copy link
Copy Markdown
Collaborator

@vmittal-msft - FYI

@tjchadaga tjchadaga added the reviewed PR is discussed in SAI Meeting label Mar 6, 2025
@tjchadaga
Copy link
Copy Markdown
Collaborator

@JaiOCP - could you please help review?

@tjchadaga
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@sathk-marvell sathk-marvell force-pushed the sathk_hash_rdma branch 3 times, most recently from e739d0d to 9f5fc22 Compare March 12, 2025 09:02
@tjchadaga
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@tjchadaga
Copy link
Copy Markdown
Collaborator

@kcudnik - could you please help check why the meta checker is failing for this?

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 13, 2025

processing commit 9f5fc22
ERROR: check ! SAI_NATIVE_HASH_FIELD_NONE value is 0x00000022, but on was 0x00000021 on commit 3132018
WARNING: Both enums have the same value SAI_NATIVE_HASH_FIELD_RDMA_BTH_DEST_QP and SAI_NATIVE_HASH_FIELD_NONE = 0x00000021
processing commit 7df1c94
ERROR: check ! SAI_NATIVE_HASH_FIELD_NONE value is 0x00000021, but on was 0x00000022 on commit 9f5fc22
processing commit 00ecb4d
ERROR: check ! SAI_NATIVE_HASH_FIELD_NONE value is 0x00000022, but on was 0x00000021 on commit 7df1c94
ERROR: please correct all 3 error(s) and all 1 warnings before continue
make: *** [Makefile:89: all] Error 1

you need to squash your commits, and force push again, since you changed NONE field and shifted enum values

@sathk-marvell
Copy link
Copy Markdown
Contributor Author

@kcudnik still seeing the same issue. Can i add below diff..

builder@sonic-skarra:~/SAI$ git diff
diff --git a/meta/ancestry.pl b/meta/ancestry.pl
index 29f6115..1e002f7 100755
--- a/meta/ancestry.pl
+++ b/meta/ancestry.pl
@@ -178,6 +178,7 @@ sub BuildCommitHistory
next if $enumName eq "SAI_OBJECT_TYPE_MAX";
next if $enumName eq "SAI_PORT_INTERFACE_TYPE_MAX";
next if $enumName eq "SAI_PORT_BREAKOUT_MODE_TYPE_MAX";

  •        next if $enumName eq "SAI_NATIVE_HASH_FIELD_NONE";
    
           LogError "wrong initializer on $enumName $enumValue" if not $enumValue =~ /^0x[0-9a-f]{8}$/;
    

@@ -209,6 +210,7 @@ sub BuildCommitHistory
#print "elsif (defined $enumName $IGNORED{$enumName} and $IGNORED{$enumName} eq $HISTORY{$enumTypeName}{$enumName}{name})";

                 next if $HISTORY{$enumTypeName}{$enumValue} eq "SAI_PORT_BREAKOUT_MODE_TYPE_MAX";
  •                next if $HISTORY{$enumTypeName}{$enumValue} eq "SAI_NATIVE_HASH_FIELD_NONE";
                   LogWarning "Both enums have the same value $enumName and $HISTORY{$enumTypeName}{$enumValue} = $enumValue";
               }
           }
    

Comment thread inc/saihash.h
Comment on lines +172 to +177
/** Native hash field RDMA packet BTH(Base Transport Header) opcode */
SAI_NATIVE_HASH_FIELD_RDMA_BTH_OPCODE = 0x00000022,

/** Native hash field RDMA packet BTH destination queue pair */
SAI_NATIVE_HASH_FIELD_RDMA_BTH_DEST_QP = 0x00000023,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

place those after NONE

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this set to 0x22 & 0x23? are enum values 0x19, 0x1a, 0x1b .. 0x20 not usable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

placed after NONE only. these values are already in use, but not in order

/**
* @brief Native hash field destination IPv6
*
* Also, refers to the outer source IPv6
* in case for encapsulated packets
*/
SAI_NATIVE_HASH_FIELD_DST_IPV6 = 0x0000001c,

/** Native hash field inner source IPv4 */
SAI_NATIVE_HASH_FIELD_INNER_SRC_IPV4 = 0x0000001d,

/** Native hash field inner destination IPv4 */
SAI_NATIVE_HASH_FIELD_INNER_DST_IPV4 = 0x0000001e,

/** Native hash field inner source IPv6 */
SAI_NATIVE_HASH_FIELD_INNER_SRC_IPV6 = 0x0000001f,

/** Native hash field inner destination IPv6 */
SAI_NATIVE_HASH_FIELD_INNER_DST_IPV6 = 0x00000020,

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 13, 2025

is your change rebased to top of masteR ?

@sathk-marvell
Copy link
Copy Markdown
Contributor Author

is your change rebased to top of masteR ?

yes

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 14, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 14, 2025

all passed now :)


- Queue Pair (QP) Number
- RDMA opcode(Operation type)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in addition to the option to use it via UDF ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will allow the users to use native H/w support

Comment thread meta/ancestry.pl Outdated
next if $enumName eq "SAI_OBJECT_TYPE_MAX";
next if $enumName eq "SAI_PORT_INTERFACE_TYPE_MAX";
next if $enumName eq "SAI_PORT_BREAKOUT_MODE_TYPE_MAX";
next if $enumName eq "SAI_NATIVE_HASH_FIELD_NONE";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only applies to attributes enum, previously last enum was flow lubelskie and it was passing, please remote those exceptions as semestr like the error maybe in diferent place

@sathk-marvell
Copy link
Copy Markdown
Contributor Author

seeing below errors when i remove that line:
ERROR: check ! SAI_NATIVE_HASH_FIELD_NONE value is 0x00000022, but on was 0x00000021 on commit 3132018
ERROR: please correct all 1 error(s) and all 0 warnings before continue
Makefile:85: recipe for target 'all' failed
make: *** [all] Error 1
make: Leaving directory '/home/builder/SAI/meta'

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 20, 2025

did you rebased your PR to SAI master ?

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 20, 2025

you should squash your changes and rebase to SAI/master, then this error will go away

@tjchadaga tjchadaga requested a review from kcudnik March 21, 2025 05:43
@tjchadaga
Copy link
Copy Markdown
Collaborator

@sathk-marvell - could you please resolve conflicts?

@sathk-marvell sathk-marvell force-pushed the sathk_hash_rdma branch 2 times, most recently from e6d7876 to 035a3a1 Compare March 21, 2025 15:08
@sathk-marvell
Copy link
Copy Markdown
Contributor Author

@sathk-marvell - could you please resolve conflicts?

Done

@sathk-marvell
Copy link
Copy Markdown
Contributor Author

you should squash your changes and rebase to SAI/master, then this error will go away

tried that.

  1. Reset to Head to before my commit
  2. do the pull to latest master and clean build: Build is successful
  3. applied my patches again w/o above line
  4. Tried building, seeing same failure again
  5. added that Line:build went through
  6. Pull to latest master and tried rebuild: Build is working w/o any issues

@tjchadaga
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 21, 2025

you should squash your changes and rebase to SAI/master, then this error will go away

tried that.

  1. Reset to Head to before my commit
  2. do the pull to latest master and clean build: Build is successful
  3. applied my patches again w/o above line
  4. Tried building, seeing same failure again
  5. added that Line:build went through
  6. Pull to latest master and tried rebuild: Build is working w/o any issues

there is a limitation in validator, which is not able to handle enums added in the middle of the enum, please put your enums after NONE, and it will PASS, and remove those exceptions

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 21, 2025

i will try to fix this issue

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 21, 2025

@sathk-marvell i fixed it here: #2157, please remove exceptions from ancestry, and you can now put your flags before NONE field, enjoy

Signed-off-by: Satheesh Kumar Karra <skarra@marvell.com>
@sathk-marvell
Copy link
Copy Markdown
Contributor Author

@sathk-marvell i fixed it here: #2157, please remove exceptions from ancestry, and you can now put your flags before NONE field, enjoy

Update the review now, Thanks a lot @kcudnik for all your timely help

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Mar 22, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@tjchadaga tjchadaga merged commit 28751b9 into opencomputeproject:master Mar 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewed PR is discussed in SAI Meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants