Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_rss.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Maximum key size used throughout. It's OK for hardware to use only the | * Maximum key size used throughout. It's OK for hardware to use only the | ||||
* first 16 bytes, which is all that's required for IPv4. | * first 16 bytes, which is all that's required for IPv4. | ||||
*/ | */ | ||||
#define RSS_KEYSIZE 40 | #define RSS_KEYSIZE 40 | ||||
/* | /* | ||||
* For RSS hash methods that do a software hash on an mbuf, the packet | |||||
* direction (ingress / egress) is required. | |||||
* | |||||
* The default direction (INGRESS) is the "receive into the NIC" - ie, | |||||
* what the hardware is hashing on. | |||||
*/ | |||||
#define RSS_HASH_PKT_INGRESS 0 | |||||
#define RSS_HASH_PKT_EGRESS 1 | |||||
/* | |||||
* Device driver interfaces to query RSS properties that must be programmed | * Device driver interfaces to query RSS properties that must be programmed | ||||
* into hardware. | * into hardware. | ||||
*/ | */ | ||||
u_int rss_getbits(void); | u_int rss_getbits(void); | ||||
u_int rss_getbucket(u_int hash); | u_int rss_getbucket(u_int hash); | ||||
u_int rss_get_indirection_to_bucket(u_int index); | u_int rss_get_indirection_to_bucket(u_int index); | ||||
u_int rss_getcpu(u_int bucket); | u_int rss_getcpu(u_int bucket); | ||||
void rss_getkey(uint8_t *key); | void rss_getkey(uint8_t *key); | ||||
Show All 16 Lines | |||||
/* | /* | ||||
* Network stack interface to query desired CPU affinity of a packet. | * Network stack interface to query desired CPU affinity of a packet. | ||||
*/ | */ | ||||
struct mbuf *rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid); | struct mbuf *rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid); | ||||
u_int rss_hash2cpuid(uint32_t hash_val, uint32_t hash_type); | u_int rss_hash2cpuid(uint32_t hash_val, uint32_t hash_type); | ||||
int rss_hash2bucket(uint32_t hash_val, uint32_t hash_type, | int rss_hash2bucket(uint32_t hash_val, uint32_t hash_type, | ||||
uint32_t *bucket_id); | uint32_t *bucket_id); | ||||
int rss_m2bucket(struct mbuf *m, uint32_t *bucket_id); | int rss_m2bucket(struct mbuf *m, uint32_t *bucket_id); | ||||
/* | |||||
* Functions to calculate a software RSS hash for a given mbuf or | |||||
* packet detail. | |||||
*/ | |||||
int rss_mbuf_software_hash_v4(const struct mbuf *m, int dir, | |||||
grehan: The naming seems redundant: rss_hash_v4 would seem sufficient. | |||||
Not Done Inline ActionsThe reason I have a verbose name is so stack/driver writers realise the function is actually doing a software hash if required, rather than just checking the hash value in the mbuf. For example, rss_m2cpuid() doesn't do a software hash calculation at the moment. adrian: The reason I have a verbose name is so stack/driver writers realise the function is actually… | |||||
uint32_t *hashval, uint32_t *hashtype); | |||||
int rss_proto_software_hash_v4(struct in_addr src, | |||||
Not Done Inline ActionsDitto with naming. grehan: Ditto with naming. | |||||
struct in_addr dst, u_short src_port, u_short dst_port, | |||||
int proto, int dir, uint32_t *hashval, | |||||
uint32_t *hashtype); | |||||
#endif /* !_NETINET_IN_RSS_H_ */ | #endif /* !_NETINET_IN_RSS_H_ */ |
The naming seems redundant: rss_hash_v4 would seem sufficient.