US 12,079,136 B1
Cache look up during packet processing by uniformly caching non-uniform lengths of payload data in a dual-stage cache of packet processors
Shushan Wen, Pleasant Hill, CA (US); and Zhi Guo, San Jose, CA (US)
Assigned to Fortinet, Inc., Sunnyvale, CA (US)
Filed by Fortinet, Inc., Sunnyvale, CA (US)
Filed on Mar. 31, 2023, as Appl. No. 18/129,072.
Int. Cl. G06F 12/0897 (2016.01)
CPC G06F 12/0897 (2013.01) 4 Claims
OG exemplary drawing
 
1. A computer-implemented method in a dual-stage cache of a packet processor for cache look up during packet processing by uniformly caching non-uniform lengths of payload data that have various lengths of keys to the payload data, the method comprising:
receiving a data packet with a header and a payload at the packet processor, wherein metadata of the data packet includes a key and a type ID, wherein the packet processor comprises a dual-stage cache having an index table with uniform length entry size and having a content table with non-uniform length entry sizes to store different cached key data payload data;
calculating a unified hash value of various lengths of keys from type ID and key of packet header retrieved from the metadata;
at a first stage, searching cells of a row of the index table, using a portion of the unified hash value bits as index to identify the row of the index table, and identifying a pointer to the content table by comparing an index table tag of an entry of a cell with a calculated tag of the hash to identify a cell in the row, and
at a second stage, looking up a cell in the content table, responsive to a match of calculated tag of the hash and index table tag of entry, comparing the current full key value and the full key value in the content table entry, wherein the content table full key value is retrieved using a pointer from the cell of the index table to the content table from the cell entry, and
outputting a payload responsive a cache hit, responsive to a match of input full key value and content table full key value, and obtaining the payload data in the content table.