# Toeplitz Hash Not working

**URL:** <https://forum.p4.org/t/toeplitz-hash-not-working/549>\
**Category:** Getting Started with P4\
**Created:** [November 24, 2022, 4:48am UTC](https://forum.p4.org/t/toeplitz-hash-not-working/549 "2022-11-24T04:48:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![srihari39](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@srihari39](https://forum.p4.org/u/srihari39)\
**Post date:** [November 24, 2022, 4:48am UTC](https://forum.p4.org/t/toeplitz-hash-not-working/549/1 "2022-11-24T04:48:35Z")

</div>

I’m trying to use the `Toeplitz` hash function in one of my p4 programs, but the `v1model.p4` doesn’t seem to have the `Toeplitz` in the enum tag. But I found the implementation of `Toeplitz` in the subsequent backends and frontends, along with the behavioral-model. Am I missing something? Or is there any fix I should do to have the `Toeplitz` up and running in the system?

---

<div class="post-metadata">

**Author:** ![andyfingerhut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/andyfingerhut/32/17_2.png) [@andyfingerhut](https://forum.p4.org/u/andyfingerhut)\
**Post date:** [November 24, 2022, 2:05pm UTC](https://forum.p4.org/t/toeplitz-hash-not-working/549/2 "2022-11-24T14:05:27Z")

</div>

Where did you find the implementation of Toeplitz in the subsequent backends and frontends? I am not saying they do not exist, but if you could point specifically at what you have found, it may help determine if they are available for use, or how much work it would be to make them available for use.

---

<div class="post-metadata">

**Author:** ![srihari39](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@srihari39](https://forum.p4.org/u/srihari39)\
**Post date:** [November 24, 2022, 3:48pm UTC](https://forum.p4.org/t/toeplitz-hash-not-working/549/3 "2022-11-24T15:48:59Z")

</div>

> <https://github.com/p4lang/p4c/pull/3502>
>
> We'd like to make the Toeplitz hash algorithm available in v1model. The actual T…oeplitz hash function has already been added to BMv2: https://github.com/p4lang/behavioral-model/pull/1134.

Its already in Bmv2. Need to have this integrated into v1model.p4

---

<div class="post-metadata">

**Author:** ![andyfingerhut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/andyfingerhut/32/17_2.png) [@andyfingerhut](https://forum.p4.org/u/andyfingerhut)\
**Post date:** [November 24, 2022, 3:50pm UTC](https://forum.p4.org/t/toeplitz-hash-not-working/549/4 "2022-11-24T15:50:17Z")

</div>

Thanks for the link. Yes, it could be added to v1model. Are you volunteering to add it? Or can persuade someone to do so? If so, that would be excellent.

---

<div class="post-metadata">

**Author:** ![srihari39](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@srihari39](https://forum.p4.org/u/srihari39)\
**Post date:** [November 24, 2022, 4:19pm UTC](https://forum.p4.org/t/toeplitz-hash-not-working/549/5 "2022-11-24T16:19:11Z")

</div>

I at least want some guidance/instructions to add it to the v1model. Is there any documentation on how we could add it? Or any blog? Or any relevant resource?. Thanks.

---

<div class="post-metadata">

**Author:** ![andyfingerhut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/andyfingerhut/32/17_2.png) [@andyfingerhut](https://forum.p4.org/u/andyfingerhut)\
**Post date:** [November 25, 2022, 2:26am UTC](https://forum.p4.org/t/toeplitz-hash-not-working/549/6 "2022-11-25T02:26:52Z")

</div>

There is a pull request on how a new extern was added to behavioral-model before here: [Demonstration of adding a new extern to BMv2 / behavioral-model](https://forum.p4.org/t/demonstration-of-adding-a-new-extern-to-bmv2-behavioral-model/542)

Note: I make no claim that this is a hold-your-hands step-by-step tutorial. It is a working example of a feature added to behavioral-model, though.
