A host bus adapter may have many ports. A port may have a number of TCBs allocated for performing I/O operations. When an I/O request is received by the port then those allocated TCBs are used to service the I/O request. If the port runs out of TCBs to service those I/O requests then requests are queued till a TCB is freed up. Certain mechanisms for the allocation of TCBs to ports use a primarily static allocation in which each port has set of dedicated TCBs and the remaining TCBs are shared. Shared TCBs are moved to different ports based on the need for TCBs. A problem with the above mechanisms is that the mechanisms do not take into account a lot of factors which leads to some ports having an excessive number of TCBs with not much I/O being performed, and some ports having an excess of I/O requests that are queued. Such mechanisms may also lack the ability to predict when a port is likely to run out of TCBs.
In certain embodiments, a machine learning module is used to determine the best allocation mechanism for resources to a component, device, or interface for performing one or more tasks in a storage controller. In certain embodiments, the machine learning module is a neural network. The neural network may be used for error analysis where numerous inputs are available and various allocation of resources are available, to determine the optimal allocation to resources. The neural network may be continually trained via adjustment of weights and biases within the neural network to improve the predictive accuracy of determining the best allocation of resources. As a result of determining the best allocation mechanism of resources, improvements are made to the operations of one or more storage controllers.