<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 2: Code-Review+1</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 2: Code-Review-1</p><p style="white-space: pre-wrap; word-wrap: break-word;">Looks good to me. Except I'm unsure if crc16 as hash is good enough. Maybe @laforge can give additional feedback.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I don't really have the mathematical background to say if it is good enough or not.  In the Linux kernel we typically used the Bob Jenkins hash (https://burtleburtle.net/bob/hash/) see include/linux/jhash.h</p><p style="white-space: pre-wrap; word-wrap: break-word;">We usually expect a lot of variance in the final part of the ISMI, and little at the state.  If one ignores the MCC/MNC (first 5 digits), 9 of the 10 decimal digits can actually even be represented in an uint32_t.  So one would probably even get quite good distribution by simply using the modulo-32 representation of the 10 final IMSI digits.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I just want to add that the hashtable is only 10 bit large anyway so using crc16 or 32 will still just result in one of 1024 buckets being chosen.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">I guess without simulation it will be hard to predict what's the best approach.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd say it should for sure be good enough to merge.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Unrelated comment: It would be great to add "show" commands for bobth the IMSI and the TLLI cache.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Ok, will do as separate commit</p><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/22251">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/22251">change 22251</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-sgsn/+/22251"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sgsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If0a8d6cc1d63f2fb2c395cc5d4373a915bc2cb87 </div>
<div style="display:none"> Gerrit-Change-Number: 22251 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 18 Jan 2021 12:34:37 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>