MINOR: stick-table: make skttable_data_cast to use only std types

This patch replaces all advanced data type aliases on
stktable_data_cast calls by standard types.

This way we could call the same stktable_data_cast
regardless of the used advanced data type as long they
are using the same std type.

It also removes all the advanced data type aliases.
This commit is contained in:
Emeric Brun 2021-06-30 17:18:28 +02:00 committed by Willy Tarreau
parent 08b0f6780c
commit 0e3457b63a
8 changed files with 90 additions and 114 deletions

View File

@ -60,8 +60,8 @@ static inline void session_store_counters(struct session *sess)
if (ptr) { if (ptr) {
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (stktable_data_cast(ptr, conn_cur) > 0) if (stktable_data_cast(ptr, std_t_uint) > 0)
stktable_data_cast(ptr, conn_cur)--; stktable_data_cast(ptr, std_t_uint)--;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);

View File

@ -118,30 +118,6 @@ union stktable_data {
unsigned long long std_t_ull; unsigned long long std_t_ull;
struct freq_ctr std_t_frqp; struct freq_ctr std_t_frqp;
struct dict_entry *std_t_dict; struct dict_entry *std_t_dict;
/* types of each storable data */
int server_id;
struct dict_entry *server_key;
unsigned int gpt0;
unsigned int gpc0;
struct freq_ctr gpc0_rate;
unsigned int gpc1;
struct freq_ctr gpc1_rate;
unsigned int conn_cnt;
struct freq_ctr conn_rate;
unsigned int conn_cur;
unsigned int sess_cnt;
struct freq_ctr sess_rate;
unsigned int http_req_cnt;
struct freq_ctr http_req_rate;
unsigned int http_err_cnt;
struct freq_ctr http_err_rate;
unsigned long long bytes_in_cnt;
struct freq_ctr bytes_in_rate;
unsigned long long bytes_out_cnt;
struct freq_ctr bytes_out_rate;
unsigned int http_fail_cnt;
struct freq_ctr http_fail_rate;
}; };
/* known data types */ /* known data types */

View File

@ -232,11 +232,11 @@ static inline int stkctr_inc_http_req_ctr(struct stkctr *stkctr)
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_REQ_CNT); ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_REQ_CNT);
if (ptr1) if (ptr1)
stktable_data_cast(ptr1, http_req_cnt)++; stktable_data_cast(ptr1, std_t_uint)++;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_REQ_RATE); ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_REQ_RATE);
if (ptr2) if (ptr2)
update_freq_ctr_period(&stktable_data_cast(ptr2, http_req_rate), update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1); stkctr->table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -264,11 +264,11 @@ static inline int stkctr_inc_http_err_ctr(struct stkctr *stkctr)
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_ERR_CNT); ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_ERR_CNT);
if (ptr1) if (ptr1)
stktable_data_cast(ptr1, http_err_cnt)++; stktable_data_cast(ptr1, std_t_uint)++;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_ERR_RATE); ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_ERR_RATE);
if (ptr2) if (ptr2)
update_freq_ctr_period(&stktable_data_cast(ptr2, http_err_rate), update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1); stkctr->table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -296,11 +296,11 @@ static inline int stkctr_inc_http_fail_ctr(struct stkctr *stkctr)
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_FAIL_CNT); ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_FAIL_CNT);
if (ptr1) if (ptr1)
stktable_data_cast(ptr1, http_fail_cnt)++; stktable_data_cast(ptr1, std_t_uint)++;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_FAIL_RATE); ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_FAIL_RATE);
if (ptr2) if (ptr2)
update_freq_ctr_period(&stktable_data_cast(ptr2, http_fail_rate), update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u, 1); stkctr->table->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u, 1);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -327,11 +327,11 @@ static inline int stkctr_inc_bytes_in_ctr(struct stkctr *stkctr, unsigned long l
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_IN_CNT); ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_IN_CNT);
if (ptr1) if (ptr1)
stktable_data_cast(ptr1, bytes_in_cnt) += bytes; stktable_data_cast(ptr1, std_t_ull) += bytes;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_IN_RATE); ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_IN_RATE);
if (ptr2) if (ptr2)
update_freq_ctr_period(&stktable_data_cast(ptr2, bytes_in_rate), update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes); stkctr->table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -358,11 +358,11 @@ static inline int stkctr_inc_bytes_out_ctr(struct stkctr *stkctr, unsigned long
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_OUT_CNT); ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_OUT_CNT);
if (ptr1) if (ptr1)
stktable_data_cast(ptr1, bytes_out_cnt) += bytes; stktable_data_cast(ptr1, std_t_ull) += bytes;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_OUT_RATE); ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_OUT_RATE);
if (ptr2) if (ptr2)
update_freq_ctr_period(&stktable_data_cast(ptr2, bytes_out_rate), update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes); stkctr->table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);

View File

@ -126,8 +126,8 @@ static inline void stream_store_counters(struct stream *s)
if (ptr) { if (ptr) {
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (stktable_data_cast(ptr, conn_cur) > 0) if (stktable_data_cast(ptr, std_t_uint) > 0)
stktable_data_cast(ptr, conn_cur)--; stktable_data_cast(ptr, std_t_uint)--;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -165,8 +165,8 @@ static inline void stream_stop_content_counters(struct stream *s)
if (ptr) { if (ptr) {
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (stktable_data_cast(ptr, conn_cur) > 0) if (stktable_data_cast(ptr, std_t_uint) > 0)
stktable_data_cast(ptr, conn_cur)--; stktable_data_cast(ptr, std_t_uint)--;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -190,15 +190,15 @@ static inline void stream_start_counters(struct stktable *t, struct stksess *ts)
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR);
if (ptr) if (ptr)
stktable_data_cast(ptr, conn_cur)++; stktable_data_cast(ptr, std_t_uint)++;
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT);
if (ptr) if (ptr)
stktable_data_cast(ptr, conn_cnt)++; stktable_data_cast(ptr, std_t_uint)++;
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_RATE);
if (ptr) if (ptr)
update_freq_ctr_period(&stktable_data_cast(ptr, conn_rate), update_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_CONN_RATE].u, 1); t->data_arg[STKTABLE_DT_CONN_RATE].u, 1);
if (tick_isset(t->expire)) if (tick_isset(t->expire))
ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire)); ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire));

View File

@ -2011,19 +2011,19 @@ static enum act_return http_action_track_sc(struct act_rule *rule, struct proxy
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (ptr1) if (ptr1)
stktable_data_cast(ptr1, http_req_cnt)++; stktable_data_cast(ptr1, std_t_uint)++;
if (ptr2) if (ptr2)
update_freq_ctr_period(&stktable_data_cast(ptr2, http_req_rate), update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1); t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
if (ptr3) if (ptr3)
stktable_data_cast(ptr3, http_err_cnt)++; stktable_data_cast(ptr3, std_t_uint)++;
if (ptr4) if (ptr4)
update_freq_ctr_period(&stktable_data_cast(ptr4, http_err_rate), update_freq_ctr_period(&stktable_data_cast(ptr4, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1); t->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
if (ptr5) if (ptr5)
stktable_data_cast(ptr5, http_fail_cnt)++; stktable_data_cast(ptr5, std_t_uint)++;
if (ptr6) if (ptr6)
update_freq_ctr_period(&stktable_data_cast(ptr6, http_fail_rate), update_freq_ctr_period(&stktable_data_cast(ptr6, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u, 1); t->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u, 1);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);

View File

@ -119,11 +119,11 @@ static void session_count_new(struct session *sess)
ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_SESS_CNT); ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_SESS_CNT);
if (ptr) if (ptr)
HA_ATOMIC_INC(&stktable_data_cast(ptr, sess_cnt)); HA_ATOMIC_INC(&stktable_data_cast(ptr, std_t_uint));
ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_SESS_RATE); ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_SESS_RATE);
if (ptr) if (ptr)
update_freq_ctr_period(&stktable_data_cast(ptr, sess_rate), update_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_SESS_RATE].u, 1); stkctr->table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
} }
} }

View File

@ -98,8 +98,8 @@ void stksess_free(struct stktable *t, struct stksess *ts)
void *data; void *data;
data = stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY); data = stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY);
if (data) { if (data) {
dict_entry_unref(&server_key_dict, stktable_data_cast(data, server_key)); dict_entry_unref(&server_key_dict, stktable_data_cast(data, std_t_dict));
stktable_data_cast(data, server_key) = NULL; stktable_data_cast(data, std_t_dict) = NULL;
} }
HA_SPIN_LOCK(STK_TABLE_LOCK, &t->lock); HA_SPIN_LOCK(STK_TABLE_LOCK, &t->lock);
__stksess_free(t, ts); __stksess_free(t, ts);
@ -1228,7 +1228,7 @@ static int sample_conv_table_bytes_in_rate(const struct arg *arg_p, struct sampl
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_IN_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_IN_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_BYTES_IN_RATE].u); t->data_arg[STKTABLE_DT_BYTES_IN_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -1265,7 +1265,7 @@ static int sample_conv_table_conn_cnt(const struct arg *arg_p, struct sample *sm
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, conn_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1301,7 +1301,7 @@ static int sample_conv_table_conn_cur(const struct arg *arg_p, struct sample *sm
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, conn_cur); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1337,7 +1337,7 @@ static int sample_conv_table_conn_rate(const struct arg *arg_p, struct sample *s
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_CONN_RATE].u); t->data_arg[STKTABLE_DT_CONN_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -1374,7 +1374,7 @@ static int sample_conv_table_bytes_out_rate(const struct arg *arg_p, struct samp
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_OUT_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_OUT_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u); t->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -1411,7 +1411,7 @@ static int sample_conv_table_gpt0(const struct arg *arg_p, struct sample *smp, v
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPT0); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPT0);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, gpt0); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1447,7 +1447,7 @@ static int sample_conv_table_gpc0(const struct arg *arg_p, struct sample *smp, v
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC0); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC0);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, gpc0); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1483,7 +1483,7 @@ static int sample_conv_table_gpc0_rate(const struct arg *arg_p, struct sample *s
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC0_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC0_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc0_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_GPC0_RATE].u); t->data_arg[STKTABLE_DT_GPC0_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -1520,7 +1520,7 @@ static int sample_conv_table_gpc1(const struct arg *arg_p, struct sample *smp, v
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC1); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC1);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, gpc1); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1556,7 +1556,7 @@ static int sample_conv_table_gpc1_rate(const struct arg *arg_p, struct sample *s
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC1_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC1_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc1_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_GPC1_RATE].u); t->data_arg[STKTABLE_DT_GPC1_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -1593,7 +1593,7 @@ static int sample_conv_table_http_err_cnt(const struct arg *arg_p, struct sample
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_ERR_CNT); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_ERR_CNT);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, http_err_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1629,7 +1629,7 @@ static int sample_conv_table_http_err_rate(const struct arg *arg_p, struct sampl
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_ERR_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_ERR_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u); t->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -1666,7 +1666,7 @@ static int sample_conv_table_http_fail_cnt(const struct arg *arg_p, struct sampl
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_FAIL_CNT); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_FAIL_CNT);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, http_fail_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1702,7 +1702,7 @@ static int sample_conv_table_http_fail_rate(const struct arg *arg_p, struct samp
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_FAIL_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_FAIL_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_fail_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u); t->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -1739,7 +1739,7 @@ static int sample_conv_table_http_req_cnt(const struct arg *arg_p, struct sample
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_REQ_CNT); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_REQ_CNT);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, http_req_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1775,7 +1775,7 @@ static int sample_conv_table_http_req_rate(const struct arg *arg_p, struct sampl
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_REQ_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_REQ_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u); t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -1812,7 +1812,7 @@ static int sample_conv_table_kbytes_in(const struct arg *arg_p, struct sample *s
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_IN_CNT); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_IN_CNT);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, bytes_in_cnt) >> 10; smp->data.u.sint = stktable_data_cast(ptr, std_t_ull) >> 10;
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1848,7 +1848,7 @@ static int sample_conv_table_kbytes_out(const struct arg *arg_p, struct sample *
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_OUT_CNT); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_OUT_CNT);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, bytes_out_cnt) >> 10; smp->data.u.sint = stktable_data_cast(ptr, std_t_ull) >> 10;
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1884,7 +1884,7 @@ static int sample_conv_table_server_id(const struct arg *arg_p, struct sample *s
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, server_id); smp->data.u.sint = stktable_data_cast(ptr, std_t_sint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1920,7 +1920,7 @@ static int sample_conv_table_sess_cnt(const struct arg *arg_p, struct sample *sm
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SESS_CNT); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SESS_CNT);
if (ptr) if (ptr)
smp->data.u.sint = stktable_data_cast(ptr, sess_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts); stktable_release(t, ts);
return !!ptr; return !!ptr;
@ -1956,7 +1956,7 @@ static int sample_conv_table_sess_rate(const struct arg *arg_p, struct sample *s
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SESS_RATE); ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SESS_RATE);
if (ptr) if (ptr)
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_SESS_RATE].u); t->data_arg[STKTABLE_DT_SESS_RATE].u);
stktable_release(t, ts); stktable_release(t, ts);
@ -2020,11 +2020,11 @@ static enum act_return action_inc_gpc0(struct act_rule *rule, struct proxy *px,
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (ptr1) if (ptr1)
update_freq_ctr_period(&stktable_data_cast(ptr1, gpc0_rate), update_freq_ctr_period(&stktable_data_cast(ptr1, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u, 1); stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u, 1);
if (ptr2) if (ptr2)
stktable_data_cast(ptr2, gpc0)++; stktable_data_cast(ptr2, std_t_uint)++;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -2102,11 +2102,11 @@ static enum act_return action_inc_gpc1(struct act_rule *rule, struct proxy *px,
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (ptr1) if (ptr1)
update_freq_ctr_period(&stktable_data_cast(ptr1, gpc1_rate), update_freq_ctr_period(&stktable_data_cast(ptr1, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u, 1); stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u, 1);
if (ptr2) if (ptr2)
stktable_data_cast(ptr2, gpc1)++; stktable_data_cast(ptr2, std_t_uint)++;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -2213,7 +2213,7 @@ static enum act_return action_set_gpt0(struct act_rule *rule, struct proxy *px,
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
stktable_data_cast(ptr, gpt0) = value; stktable_data_cast(ptr, std_t_uint) = value;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -2494,7 +2494,7 @@ smp_fetch_sc_get_gpt0(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, gpt0); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2535,7 +2535,7 @@ smp_fetch_sc_get_gpc0(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, gpc0); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2576,7 +2576,7 @@ smp_fetch_sc_get_gpc1(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, gpc1); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2616,7 +2616,7 @@ smp_fetch_sc_gpc0_rate(const struct arg *args, struct sample *smp, const char *k
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc0_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u); stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2657,7 +2657,7 @@ smp_fetch_sc_gpc1_rate(const struct arg *args, struct sample *smp, const char *k
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc1_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u); stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2702,13 +2702,13 @@ smp_fetch_sc_inc_gpc0(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
if (ptr1) { if (ptr1) {
update_freq_ctr_period(&stktable_data_cast(ptr1, gpc0_rate), update_freq_ctr_period(&stktable_data_cast(ptr1, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u, 1); stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u, 1);
smp->data.u.sint = (&stktable_data_cast(ptr1, gpc0_rate))->curr_ctr; smp->data.u.sint = (&stktable_data_cast(ptr1, std_t_frqp))->curr_ctr;
} }
if (ptr2) if (ptr2)
smp->data.u.sint = ++stktable_data_cast(ptr2, gpc0); smp->data.u.sint = ++stktable_data_cast(ptr2, std_t_uint);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2755,13 +2755,13 @@ smp_fetch_sc_inc_gpc1(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
if (ptr1) { if (ptr1) {
update_freq_ctr_period(&stktable_data_cast(ptr1, gpc1_rate), update_freq_ctr_period(&stktable_data_cast(ptr1, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u, 1); stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u, 1);
smp->data.u.sint = (&stktable_data_cast(ptr1, gpc1_rate))->curr_ctr; smp->data.u.sint = (&stktable_data_cast(ptr1, std_t_frqp))->curr_ctr;
} }
if (ptr2) if (ptr2)
smp->data.u.sint = ++stktable_data_cast(ptr2, gpc1); smp->data.u.sint = ++stktable_data_cast(ptr2, std_t_uint);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2807,8 +2807,8 @@ smp_fetch_sc_clr_gpc0(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, gpc0); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_data_cast(ptr, gpc0) = 0; stktable_data_cast(ptr, std_t_uint) = 0;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2851,8 +2851,8 @@ smp_fetch_sc_clr_gpc1(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, gpc1); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_data_cast(ptr, gpc1) = 0; stktable_data_cast(ptr, std_t_uint) = 0;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2891,7 +2891,7 @@ smp_fetch_sc_conn_cnt(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, conn_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2932,7 +2932,7 @@ smp_fetch_sc_conn_rate(const struct arg *args, struct sample *smp, const char *k
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_CONN_RATE].u); stkctr->table->data_arg[STKTABLE_DT_CONN_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -2983,7 +2983,7 @@ smp_fetch_src_updt_conn_cnt(const struct arg *args, struct sample *smp, const ch
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
smp->data.u.sint = ++stktable_data_cast(ptr, conn_cnt); smp->data.u.sint = ++stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@ -3024,7 +3024,7 @@ smp_fetch_sc_conn_cur(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, conn_cur); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3063,7 +3063,7 @@ smp_fetch_sc_sess_cnt(const struct arg *args, struct sample *smp, const char *kw
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, sess_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3101,7 +3101,7 @@ smp_fetch_sc_sess_rate(const struct arg *args, struct sample *smp, const char *k
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_SESS_RATE].u); stkctr->table->data_arg[STKTABLE_DT_SESS_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3141,7 +3141,7 @@ smp_fetch_sc_http_req_cnt(const struct arg *args, struct sample *smp, const char
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, http_req_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3180,7 +3180,7 @@ smp_fetch_sc_http_req_rate(const struct arg *args, struct sample *smp, const cha
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u); stkctr->table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3220,7 +3220,7 @@ smp_fetch_sc_http_err_cnt(const struct arg *args, struct sample *smp, const char
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, http_err_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3259,7 +3259,7 @@ smp_fetch_sc_http_err_rate(const struct arg *args, struct sample *smp, const cha
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u); stkctr->table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3299,7 +3299,7 @@ smp_fetch_sc_http_fail_cnt(const struct arg *args, struct sample *smp, const cha
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, http_fail_cnt); smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3338,7 +3338,7 @@ smp_fetch_sc_http_fail_rate(const struct arg *args, struct sample *smp, const ch
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_fail_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u); stkctr->table->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3378,7 +3378,7 @@ smp_fetch_sc_kbytes_in(const struct arg *args, struct sample *smp, const char *k
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, bytes_in_cnt) >> 10; smp->data.u.sint = stktable_data_cast(ptr, std_t_ull) >> 10;
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3417,7 +3417,7 @@ smp_fetch_sc_bytes_in_rate(const struct arg *args, struct sample *smp, const cha
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u); stkctr->table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3457,7 +3457,7 @@ smp_fetch_sc_kbytes_out(const struct arg *args, struct sample *smp, const char *
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = stktable_data_cast(ptr, bytes_out_cnt) >> 10; smp->data.u.sint = stktable_data_cast(ptr, std_t_ull) >> 10;
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@ -3496,7 +3496,7 @@ smp_fetch_sc_bytes_out_rate(const struct arg *args, struct sample *smp, const ch
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate), smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u); stkctr->table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);

View File

@ -1245,7 +1245,7 @@ static inline void sticking_rule_find_target(struct stream *s,
/* Look for the server name previously stored in <t> stick-table */ /* Look for the server name previously stored in <t> stick-table */
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &ts->lock);
ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY); ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY);
de = stktable_data_cast(ptr, server_key); de = stktable_data_cast(ptr, std_t_dict);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &ts->lock);
if (de) { if (de) {
@ -1271,7 +1271,7 @@ static inline void sticking_rule_find_target(struct stream *s,
/* Look for the server ID */ /* Look for the server ID */
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &ts->lock);
ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID); ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID);
node = eb32_lookup(&px->conf.used_server_id, stktable_data_cast(ptr, server_id)); node = eb32_lookup(&px->conf.used_server_id, stktable_data_cast(ptr, std_t_sint));
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &ts->lock);
if (!node) if (!node)
@ -1449,7 +1449,7 @@ static int process_store_rules(struct stream *s, struct channel *rep, int an_bit
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID); ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID);
stktable_data_cast(ptr, server_id) = __objt_server(s->target)->puid; stktable_data_cast(ptr, std_t_sint) = __objt_server(s->target)->puid;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
if (t->server_key_type == STKTABLE_SRV_NAME) if (t->server_key_type == STKTABLE_SRV_NAME)
@ -1463,7 +1463,7 @@ static int process_store_rules(struct stream *s, struct channel *rep, int an_bit
de = dict_insert(&server_key_dict, key); de = dict_insert(&server_key_dict, key);
if (de) { if (de) {
ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY); ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY);
stktable_data_cast(ptr, server_key) = de; stktable_data_cast(ptr, std_t_dict) = de;
} }
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock); HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);