static inline
uint32_t tile_fast_tcp_seed(uint32_t saddr, uint32_t daddr, uint16_t size)
{
uint32_t cs = 0;
cs = __insn_sadh_u(__insn_bytex(saddr), 0);
cs = __insn_sadh_u(cs, 0);
cs = cs + __insn_sadh_u(__insn_sadh_u(__insn_bytex(daddr), 0), 0);
cs = __insn_sadh_u(cs, 0);
cs = cs + __insn_sadh_u(__insn_sadh_u((size << 16) | 0x0006, 0), 0);
cs = __insn_sadh_u(cs, 0);
return cs;
}
利用tile SIMD指令加速计算TCP伪头校验和
最新推荐文章于 2020-11-19 11:07:45 发布