Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it possible to bind laddr to lcore by adding laddr_lcore_mapping #513

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/dpvs.bond.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,5 @@ ipvs_defs {
! sa_pool config
sa_pool {
pool_hash_size 16
pool_mode laddr_lcore_mapping
}
1 change: 1 addition & 0 deletions conf/dpvs.conf.items
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,5 @@ ipvs_defs {

sa_pool {
<init> pool_hash_size 16 <16, 1-128>
<init> pool_mode laddr_lcore_mapping
}
1 change: 1 addition & 0 deletions conf/dpvs.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,5 @@ ipvs_defs {
! sa_pool config
sa_pool {
pool_hash_size 16
pool_mode laddr_lcore_mapping
}
1 change: 1 addition & 0 deletions conf/dpvs.conf.single-bond.sample
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,5 @@ ipvs_defs {
! sa_pool config
sa_pool {
pool_hash_size 16
pool_mode laddr_lcore_mapping
}
1 change: 1 addition & 0 deletions conf/dpvs.conf.single-nic.sample
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,5 @@ ipvs_defs {
! sa_pool config
sa_pool {
pool_hash_size 16
pool_mode laddr_lcore_mapping
}
9 changes: 9 additions & 0 deletions include/ipvs/service.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@

rte_rwlock_t __dp_vs_svc_lock;

struct laddr_list_pre_lcore {
struct list_head laddr_list; /* local address (LIP) pool */
struct list_head *laddr_curr;
uint32_t num_laddrs;
};

/* virtual service */
struct dp_vs_service {
struct list_head s_list; /* node for normal service table */
Expand Down Expand Up @@ -88,6 +94,9 @@ struct dp_vs_service {
rte_rwlock_t laddr_lock;
uint32_t num_laddrs;

struct laddr_list_pre_lcore pre_list[RTE_MAX_LCORE];
#define this_pre_list pre_list[rte_lcore_id()]

/* ... flags, timer ... */
} __rte_cache_aligned;
#endif
Expand Down
11 changes: 11 additions & 0 deletions include/sa_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,23 @@
#ifndef __DPVS_SA_POOL__
#define __DPVS_SA_POOL__

#define SAPOOL
#define RTE_LOGTYPE_SAPOOL RTE_LOGTYPE_USER1

enum {
LADDR_LCORE_MAPPING_POOL_MODE,
LPORT_LCORE_MAPPING_POOL_MODE,
};

struct sa_pool_stats {
uint32_t used_cnt;
uint32_t free_cnt;
uint32_t miss_cnt;
};

extern uint8_t sa_pool_mode;
#define SA_POOL_MODE sa_pool_mode

int sa_pool_init(void);
int sa_pool_term(void);

Expand Down
Loading