mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 12:35:26 +00:00
Hook up TCP cachehit stat
This commit hooks up the TCP cachehit stat to the PCB locality feature so that when a PCB is moved to the head of the list and a segment comes in, we consider this a cache hit This also matches the usage of the cachehit stat in UDP
This commit is contained in:
parent
f62022cdf3
commit
72b3f3f612
@ -226,6 +226,8 @@ tcp_input(struct pbuf *p, struct netif *inp)
|
||||
prev->next = pcb->next;
|
||||
pcb->next = tcp_active_pcbs;
|
||||
tcp_active_pcbs = pcb;
|
||||
} else {
|
||||
TCP_STATS_INC(tcp.cachehit);
|
||||
}
|
||||
LWIP_ASSERT("tcp_input: pcb->next != pcb (after cache)", pcb->next != pcb);
|
||||
break;
|
||||
@ -303,6 +305,8 @@ tcp_input(struct pbuf *p, struct netif *inp)
|
||||
lpcb->next = tcp_listen_pcbs.listen_pcbs;
|
||||
/* put this listening pcb at the head of the listening list */
|
||||
tcp_listen_pcbs.listen_pcbs = lpcb;
|
||||
} else {
|
||||
TCP_STATS_INC(tcp.cachehit);
|
||||
}
|
||||
|
||||
LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for LISTENing connection.\n"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user