Skip to content

Commit a5b7ab6

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: set skb mark for listen socket
This patch adds support to set the skb mark value for the DLM listen tcp and sctp sockets. The mark value will be offered as cluster configuration. At creation time of the listen socket it will be set as socket option. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent 84d1c61 commit a5b7ab6

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

fs/dlm/config.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct dlm_cluster {
7373
unsigned int cl_log_debug;
7474
unsigned int cl_log_info;
7575
unsigned int cl_protocol;
76+
unsigned int cl_mark;
7677
unsigned int cl_timewarn_cs;
7778
unsigned int cl_waitwarn_us;
7879
unsigned int cl_new_rsb_count;
@@ -96,6 +97,7 @@ enum {
9697
CLUSTER_ATTR_LOG_DEBUG,
9798
CLUSTER_ATTR_LOG_INFO,
9899
CLUSTER_ATTR_PROTOCOL,
100+
CLUSTER_ATTR_MARK,
99101
CLUSTER_ATTR_TIMEWARN_CS,
100102
CLUSTER_ATTR_WAITWARN_US,
101103
CLUSTER_ATTR_NEW_RSB_COUNT,
@@ -168,6 +170,7 @@ CLUSTER_ATTR(scan_secs, 1);
168170
CLUSTER_ATTR(log_debug, 0);
169171
CLUSTER_ATTR(log_info, 0);
170172
CLUSTER_ATTR(protocol, 0);
173+
CLUSTER_ATTR(mark, 0);
171174
CLUSTER_ATTR(timewarn_cs, 1);
172175
CLUSTER_ATTR(waitwarn_us, 0);
173176
CLUSTER_ATTR(new_rsb_count, 0);
@@ -183,6 +186,7 @@ static struct configfs_attribute *cluster_attrs[] = {
183186
[CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug,
184187
[CLUSTER_ATTR_LOG_INFO] = &cluster_attr_log_info,
185188
[CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol,
189+
[CLUSTER_ATTR_MARK] = &cluster_attr_mark,
186190
[CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs,
187191
[CLUSTER_ATTR_WAITWARN_US] = &cluster_attr_waitwarn_us,
188192
[CLUSTER_ATTR_NEW_RSB_COUNT] = &cluster_attr_new_rsb_count,
@@ -855,6 +859,7 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
855859
#define DEFAULT_LOG_DEBUG 0
856860
#define DEFAULT_LOG_INFO 1
857861
#define DEFAULT_PROTOCOL 0
862+
#define DEFAULT_MARK 0
858863
#define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */
859864
#define DEFAULT_WAITWARN_US 0
860865
#define DEFAULT_NEW_RSB_COUNT 128
@@ -871,6 +876,7 @@ struct dlm_config_info dlm_config = {
871876
.ci_log_debug = DEFAULT_LOG_DEBUG,
872877
.ci_log_info = DEFAULT_LOG_INFO,
873878
.ci_protocol = DEFAULT_PROTOCOL,
879+
.ci_mark = DEFAULT_MARK,
874880
.ci_timewarn_cs = DEFAULT_TIMEWARN_CS,
875881
.ci_waitwarn_us = DEFAULT_WAITWARN_US,
876882
.ci_new_rsb_count = DEFAULT_NEW_RSB_COUNT,

fs/dlm/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct dlm_config_info {
3131
int ci_log_debug;
3232
int ci_log_info;
3333
int ci_protocol;
34+
int ci_mark;
3435
int ci_timewarn_cs;
3536
int ci_waitwarn_us;
3637
int ci_new_rsb_count;

fs/dlm/lowcomms.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,8 @@ static struct socket *tcp_create_listen_sock(struct connection *con,
11111111
goto create_out;
11121112
}
11131113

1114+
sock_set_mark(sock->sk, dlm_config.ci_mark);
1115+
11141116
/* Turn off Nagle's algorithm */
11151117
tcp_sock_set_nodelay(sock->sk);
11161118

@@ -1185,6 +1187,7 @@ static int sctp_listen_for_all(void)
11851187
}
11861188

11871189
sock_set_rcvbuf(sock->sk, NEEDED_RMEM);
1190+
sock_set_mark(sock->sk, dlm_config.ci_mark);
11881191
sctp_sock_set_nodelay(sock->sk);
11891192

11901193
write_lock_bh(&sock->sk->sk_callback_lock);

0 commit comments

Comments
 (0)