| 268 | } |
| 269 | |
| 270 | struct inpcbgroup * |
| 271 | in_pcbgroup_bytuple(struct inpcbinfo *pcbinfo, struct in_addr laddr, |
| 272 | u_short lport, struct in_addr faddr, u_short fport) |
| 273 | { |
| 274 | uint32_t hash; |
| 275 | |
| 276 | /* |
| 277 | * RSS note: we pass foreign addr/port as source, and local addr/port |
| 278 | * as destination, as we want to align with what the hardware is |
| 279 | * doing. |
| 280 | */ |
| 281 | switch (pcbinfo->ipi_hashfields) { |
| 282 | case IPI_HASHFIELDS_4TUPLE: |
| 283 | #ifdef RSS |
| 284 | hash = rss_hash_ip4_4tuple(faddr, fport, laddr, lport); |
| 285 | #else |
| 286 | hash = faddr.s_addr ^ fport; |
| 287 | #endif |
| 288 | break; |
| 289 | |
| 290 | case IPI_HASHFIELDS_2TUPLE: |
| 291 | #ifdef RSS |
| 292 | hash = rss_hash_ip4_2tuple(faddr, laddr); |
| 293 | #else |
| 294 | hash = faddr.s_addr ^ laddr.s_addr; |
| 295 | #endif |
| 296 | break; |
| 297 | |
| 298 | default: |
| 299 | hash = 0; |
| 300 | } |
| 301 | return (&pcbinfo->ipi_pcbgroups[in_pcbgroup_getbucket(pcbinfo, |
| 302 | hash)]); |
| 303 | } |
| 304 | |
| 305 | struct inpcbgroup * |
| 306 | in_pcbgroup_byinpcb(struct inpcb *inp) |
no test coverage detected