Legal claims defining the scope of protection, as filed with the USPTO.
1. A network processor comprising: a plurality of processing modules coupled to a system cache and at least one shared memory; a memory manager configured to allocate one or more blocks of the shared memory to a requesting one of the plurality of processing modules, wherein the one or more allocated blocks store data corresponding to one or more packets received by the network processor, wherein the memory manager comprises a reference counter configured to maintain, for each allocated memory block, a reference count value indicating a number of access requests of corresponding ones of the plurality of processing modules accessing the memory block; one of the plurality of processing modules, based on a pipeline identifier corresponding to each received packet, is configured to (i) read at least a portion of the data stored in the allocated blocks of the shared memory, (ii) store the read data to one or more corresponding entries of the system cache, (iii) operate on the data stored in the system cache, and (iv) upon completion of operation on the data stored in the system cache, send a request to the memory manager to decrement the reference counter of each of the one or more blocks in the shared memory; wherein, upon receiving the request to decrement the reference counter of each of the one or more blocks in the shared memory, the memory manager is configured to: (i) determine the reference count of the corresponding one or more blocks in the shared memory, and (ii) when the reference counter for a given memory block reaches a predetermined threshold value: (1) determine that the given memory block contains unneeded data; (2) invalidate the one or more entries in the system cache corresponding to the unneeded data, thereby making the one or more entries of the system cache available to store new data and preventing a write operation to write the unneeded data from the system cache to the shared memory; and (3) deallocate the given memory block, thereby making the given memory block available to be reallocated.
2. The network processor of claim 1 , wherein, upon completion of operation on the data stored in the system cache, the requesting one of the plurality of processing modules is further configured to: determine, based on the pipeline identifier corresponding to the one or more packets, whether a next one of the plurality of processing modules in the corresponding pipeline requires the data stored in the system cache; and if the next one of the plurality of processing modules requires the data stored in the system cache: suspend invalidating the one or more entries of the system cache, thereby retaining the data in the system cache for the next one of the plurality of processing modules; and maintain the allocated one or more corresponding blocks of shared memory.
3. The network processor of claim 2 , wherein, if the next one of the plurality of processing modules requires the data stored in the system cache, the system cache is further configured to: write valid data from the system cache to the corresponding one or more blocks of shared memory.
4. The network processor of claim 1 , wherein the memory manager is further configured to: wait for the one or more entries in the system cache to be invalidated before deallocating the one or more blocks in the shared memory, thereby preventing a data corruption.
5. The network processor of claim 1 , wherein the memory manager further comprises: a free block list configured to track availability of one or more memory blocks of the shared memory; wherein, when the reference counter for a given memory block reaches the predetermined threshold value, the memory manager is configured to place the given memory block in the free block list.
6. The network processor of claim 1 , wherein the reference counter maintains the reference count value of a given allocated memory block by incrementing the reference count value for each corresponding processing module accessing the given allocated memory block, and decrementing the reference count value when a corresponding processing module ends accessing the memory block.
7. The network processor of claim 1 , wherein the predetermined threshold value is zero.
8. The network processor of claim 1 , wherein the reference count value is located with data in the allocated memory block.
9. The network processor of claim 1 , wherein: one of the processing modules is configured to (1) request data for an operation from the system cache, wherein if the requested data is not stored in the system cache, the system cache is configured to (i) read the requested data from the shared memory and (ii) store the read data to one or more entries in the system cache, and (2) read the requested data from the system cache; if the system cache becomes full beyond a threshold, the system cache is configured to evict one or more entries from the system cache to store new data in the one or more entries; and if, upon receiving the request to decrement the reference counter of each of the one or more blocks in the shared memory, the one or more cache entries corresponding to the data read from the system cache have been evicted, the system cache is configured to ignore the request to invalidate the one or more entries in the system cache corresponding to the unneeded data.
10. The network processor of claim 1 , wherein the network processor is implemented in an integrated circuit.
11. A method of managing a shared memory of a network processor having a plurality of processing modules coupled to a system cache and at least one shared memory, the method comprising: allocating, by a memory manager of the network processor, one or more blocks of the shared memory to a requesting one of the plurality of processing modules, wherein the one or more allocated blocks store data corresponding to one or more packets received by the network processor; maintaining, by the memory manager, a reference count value for each allocated memory block, the reference count value indicating a number of access requests of corresponding ones of the plurality of processing modules accessing the memory block; by one of the plurality of processing modules: reading at least a portion of the data stored in the allocated blocks of the shared memory; storing the read data to one or more corresponding entries of the system cache; operating on the data stored in the system cache; and upon completion of operation on the data stored in the system cache, sending a request to the memory manager to decrement the reference counter of each of the one or more blocks in the shared memory; by the memory manager: upon receiving the request to decrement the reference counter of each of the one or more blocks in the shared memory: determining the reference count of the corresponding one or more blocks in the shared memory; when the reference counter for a given memory block reaches a predetermined threshold value: (1) determining that the given memory block contains unneeded data; (2) invalidating the one or more entries in the system cache corresponding to the unneeded data, thereby making the one or more entries of the system cache available to store new data and preventing a write operation to write the unneeded data from the system cache to the shared memory; and (3) deallocating the given memory block, thereby making the given memory block available to be reallocated.
12. The method of claim 11 , wherein, upon completion of operation on the data stored in the system cache, the method further comprises: by the requesting one of the plurality of processing modules: determining, based on a pipeline identifier corresponding to the one or more packets, whether a next one of the plurality of processing modules in the corresponding pipeline requires the data stored in the system cache; and if the next one of the plurality of processing modules requires the data stored in the system cache: suspending invalidating the one or more entries of the system cache, thereby retaining the data in the system cache for the next one of the plurality of processing modules; and maintaining the allocated one or more corresponding blocks of shared memory.
13. The method of claim 11 , wherein, if the next one of the plurality of processing modules requires the data stored in the system cache, the method further comprises: writing valid data from the system cache to the corresponding one or more blocks of shared memory.
14. The method of claim 11 , further comprising: waiting, by the memory manager, for the one or more entries in the system cache to be invalidated before deallocating the one or more blocks in the shared memory, thereby preventing data corruption.
15. The method of claim 11 , further comprising: tracking, by a free block list of the memory manager, availability of one or more memory blocks of the shared memory; when the reference counter for a given memory block reaches the predetermined threshold value: placing, by the memory manager, the given memory block in the free block list.
16. The method of claim 11 , further comprising: by the memory manager: incrementing the reference count value for each corresponding processing module accessing the given allocated memory block; and decrementing the reference count value when a corresponding processing module ends accessing the memory block.
17. The method of claim 11 , wherein the reference count value is located with data at the allocated memory block.
18. The method of claim 11 , wherein the predetermined threshold value is zero.
19. The method of claim 11 , further comprising: requesting, by one of the processing modules, data for an operation from the system cache; if the requested data is not stored in the system cache: reading, by the system cache, the requested data from the shared memory; and storing the read data to one or more entries in the system cache; reading, by the requesting processing module, the requested data from the system cache; if the system cache becomes full beyond a threshold: evicting, by the system cache, one or more entries from the system cache to store new data in the one or more entries; and if, upon receiving the request to decrement the reference counter of each of the one or more blocks in the shared memory, the one or more cache entries corresponding to the data read from the system cache have been evicted: ignoring, by the system cache, the request to invalidate the one or more entries in the system cache corresponding to the unneeded data.
20. A non-transitory machine-readable medium, having encoded thereon program code, wherein, when the program code is executed by a machine, the machine implements a method of managing a shared memory of a network processor having a plurality of processing modules coupled to a system cache and at least one shared memory, the method comprising: allocating, by a memory manager of the network processor, one or more blocks of the shared memory to a requesting one of the plurality of processing modules, wherein the one or more allocated blocks store data corresponding to one or more packets received by the network processor; maintaining, by the memory manager, a reference count value for each allocated memory block, the reference count value indicating a number of access requests of corresponding ones of the plurality of processing modules accessing the memory block; by one of the plurality of processing modules: reading at least a portion of the data stored in the allocated blocks of the shared memory; storing the read data to one or more corresponding entries of the system cache; operating on the data stored in the system cache; and upon completion of operation on the data stored in the system cache, sending a request to the memory manager to decrement the reference counter of each of the one or more blocks in the shared memory; by the memory manager: upon receiving the request to decrement the reference counter of each of the one or more blocks in the shared memory: determining the reference count of the corresponding one or more blocks in the shared memory; when the reference counter for a given memory block reaches a predetermined threshold value: (1) determining that the given memory block contains unneeded data; (2) invalidating the one or more entries in the system cache corresponding to the unneeded data, thereby making the one or more entries of the system cache available to store new data and preventing a write operation to write the unneeded data from the system cache to the shared memory; and (3) deallocating the given memory block, thereby making the given memory block available to be reallocated.
Unknown
March 18, 2014
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.