Data Fields | |
int(* | rss_hash_fn )(struct snf_recv_req *r, void *context, uint32_t *hashval) |
void * | rss_context |
User-defined RSS hashing function parameters. Users that provide their own callbacks can generate their own hash based on the contents of a received packet. NOTE This feature is available only in the SNF kernel API
void* snf_rss_mode_function::rss_context |
User context that is reflected when the user-provided rss_hash_fn is called.
int(* snf_rss_mode_function::rss_hash_fn)(struct snf_recv_req *r, void *context, uint32_t *hashval) |
User-provided hash function. The callback is provided with a valid snf_recv_req structure which contains a packet as received by Sniffer. It is up to the user to inspect and parse the packet to produce a unique 32-bit hash. The implementation will map the 32-bit into one of the rings allocated in snf_open. The function must return one of three values
In the example below, we replace the default hash function with a hash function that sends packets to different rings at every interval of 500 packets. This approach ignores the actual packet contents and the importance of flow affinity, we just want to spread the packet analysis to different rings and threads.