~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/smc/smc_stats.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /net/smc/smc_stats.h (Architecture sparc) and /net/smc/smc_stats.h (Architecture alpha)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*                                                  2 /*
  3  * Shared Memory Communications over RDMA (SMC      3  * Shared Memory Communications over RDMA (SMC-R) and RoCE
  4  *                                                  4  *
  5  * Macros for SMC statistics                        5  * Macros for SMC statistics
  6  *                                                  6  *
  7  * Copyright IBM Corp. 2021                         7  * Copyright IBM Corp. 2021
  8  *                                                  8  *
  9  * Author(s):  Guvenc Gulce                         9  * Author(s):  Guvenc Gulce
 10  */                                                10  */
 11                                                    11 
 12 #ifndef NET_SMC_SMC_STATS_H_                       12 #ifndef NET_SMC_SMC_STATS_H_
 13 #define NET_SMC_SMC_STATS_H_                       13 #define NET_SMC_SMC_STATS_H_
 14 #include <linux/init.h>                            14 #include <linux/init.h>
 15 #include <linux/mutex.h>                           15 #include <linux/mutex.h>
 16 #include <linux/percpu.h>                          16 #include <linux/percpu.h>
 17 #include <linux/ctype.h>                           17 #include <linux/ctype.h>
 18 #include <linux/smc.h>                             18 #include <linux/smc.h>
 19                                                    19 
 20 #include "smc_clc.h"                               20 #include "smc_clc.h"
 21                                                    21 
 22 #define SMC_MAX_FBACK_RSN_CNT 36                   22 #define SMC_MAX_FBACK_RSN_CNT 36
 23                                                    23 
 24 enum {                                             24 enum {
 25         SMC_BUF_8K,                                25         SMC_BUF_8K,
 26         SMC_BUF_16K,                               26         SMC_BUF_16K,
 27         SMC_BUF_32K,                               27         SMC_BUF_32K,
 28         SMC_BUF_64K,                               28         SMC_BUF_64K,
 29         SMC_BUF_128K,                              29         SMC_BUF_128K,
 30         SMC_BUF_256K,                              30         SMC_BUF_256K,
 31         SMC_BUF_512K,                              31         SMC_BUF_512K,
 32         SMC_BUF_1024K,                             32         SMC_BUF_1024K,
 33         SMC_BUF_G_1024K,                           33         SMC_BUF_G_1024K,
 34         SMC_BUF_MAX,                               34         SMC_BUF_MAX,
 35 };                                                 35 };
 36                                                    36 
 37 struct smc_stats_fback {                           37 struct smc_stats_fback {
 38         int     fback_code;                        38         int     fback_code;
 39         u16     count;                             39         u16     count;
 40 };                                                 40 };
 41                                                    41 
 42 struct smc_stats_rsn {                             42 struct smc_stats_rsn {
 43         struct  smc_stats_fback srv[SMC_MAX_FB     43         struct  smc_stats_fback srv[SMC_MAX_FBACK_RSN_CNT];
 44         struct  smc_stats_fback clnt[SMC_MAX_F     44         struct  smc_stats_fback clnt[SMC_MAX_FBACK_RSN_CNT];
 45         u64                     srv_fback_cnt;     45         u64                     srv_fback_cnt;
 46         u64                     clnt_fback_cnt     46         u64                     clnt_fback_cnt;
 47 };                                                 47 };
 48                                                    48 
 49 struct smc_stats_rmbcnt {                          49 struct smc_stats_rmbcnt {
 50         u64     buf_size_small_peer_cnt;           50         u64     buf_size_small_peer_cnt;
 51         u64     buf_size_small_cnt;                51         u64     buf_size_small_cnt;
 52         u64     buf_full_peer_cnt;                 52         u64     buf_full_peer_cnt;
 53         u64     buf_full_cnt;                      53         u64     buf_full_cnt;
 54         u64     reuse_cnt;                         54         u64     reuse_cnt;
 55         u64     alloc_cnt;                         55         u64     alloc_cnt;
 56         u64     dgrade_cnt;                        56         u64     dgrade_cnt;
 57 };                                                 57 };
 58                                                    58 
 59 struct smc_stats_memsize {                         59 struct smc_stats_memsize {
 60         u64     buf[SMC_BUF_MAX];                  60         u64     buf[SMC_BUF_MAX];
 61 };                                                 61 };
 62                                                    62 
 63 struct smc_stats_tech {                            63 struct smc_stats_tech {
 64         struct smc_stats_memsize tx_rmbsize;       64         struct smc_stats_memsize tx_rmbsize;
 65         struct smc_stats_memsize rx_rmbsize;       65         struct smc_stats_memsize rx_rmbsize;
 66         struct smc_stats_memsize tx_pd;            66         struct smc_stats_memsize tx_pd;
 67         struct smc_stats_memsize rx_pd;            67         struct smc_stats_memsize rx_pd;
 68         struct smc_stats_rmbcnt rmb_tx;            68         struct smc_stats_rmbcnt rmb_tx;
 69         struct smc_stats_rmbcnt rmb_rx;            69         struct smc_stats_rmbcnt rmb_rx;
 70         u64                     clnt_v1_succ_c     70         u64                     clnt_v1_succ_cnt;
 71         u64                     clnt_v2_succ_c     71         u64                     clnt_v2_succ_cnt;
 72         u64                     srv_v1_succ_cn     72         u64                     srv_v1_succ_cnt;
 73         u64                     srv_v2_succ_cn     73         u64                     srv_v2_succ_cnt;
 74         u64                     urg_data_cnt;      74         u64                     urg_data_cnt;
 75         u64                     splice_cnt;        75         u64                     splice_cnt;
 76         u64                     cork_cnt;          76         u64                     cork_cnt;
 77         u64                     ndly_cnt;          77         u64                     ndly_cnt;
 78         u64                     rx_bytes;          78         u64                     rx_bytes;
 79         u64                     tx_bytes;          79         u64                     tx_bytes;
 80         u64                     rx_cnt;            80         u64                     rx_cnt;
 81         u64                     tx_cnt;            81         u64                     tx_cnt;
 82         u64                     rx_rmbuse;         82         u64                     rx_rmbuse;
 83         u64                     tx_rmbuse;         83         u64                     tx_rmbuse;
 84 };                                                 84 };
 85                                                    85 
 86 struct smc_stats {                                 86 struct smc_stats {
 87         struct smc_stats_tech   smc[2];            87         struct smc_stats_tech   smc[2];
 88         u64                     clnt_hshake_er     88         u64                     clnt_hshake_err_cnt;
 89         u64                     srv_hshake_err     89         u64                     srv_hshake_err_cnt;
 90 };                                                 90 };
 91                                                    91 
 92 #define SMC_STAT_PAYLOAD_SUB(_smc_stats, _tech     92 #define SMC_STAT_PAYLOAD_SUB(_smc_stats, _tech, key, _len, _rc) \
 93 do { \                                             93 do { \
 94         typeof(_smc_stats) stats = (_smc_stats     94         typeof(_smc_stats) stats = (_smc_stats); \
 95         typeof(_tech) t = (_tech); \               95         typeof(_tech) t = (_tech); \
 96         typeof(_len) l = (_len); \                 96         typeof(_len) l = (_len); \
 97         int _pos; \                                97         int _pos; \
 98         typeof(_rc) r = (_rc); \                   98         typeof(_rc) r = (_rc); \
 99         int m = SMC_BUF_MAX - 1; \                 99         int m = SMC_BUF_MAX - 1; \
100         this_cpu_inc((*stats).smc[t].key ## _c    100         this_cpu_inc((*stats).smc[t].key ## _cnt); \
101         if (r <= 0 || l <= 0) \                   101         if (r <= 0 || l <= 0) \
102                 break; \                          102                 break; \
103         _pos = fls64((l - 1) >> 13); \            103         _pos = fls64((l - 1) >> 13); \
104         _pos = (_pos <= m) ? _pos : m; \          104         _pos = (_pos <= m) ? _pos : m; \
105         this_cpu_inc((*stats).smc[t].key ## _p    105         this_cpu_inc((*stats).smc[t].key ## _pd.buf[_pos]); \
106         this_cpu_add((*stats).smc[t].key ## _b    106         this_cpu_add((*stats).smc[t].key ## _bytes, r); \
107 } \                                               107 } \
108 while (0)                                         108 while (0)
109                                                   109 
110 #define SMC_STAT_TX_PAYLOAD(_smc, length, rcod    110 #define SMC_STAT_TX_PAYLOAD(_smc, length, rcode) \
111 do { \                                            111 do { \
112         typeof(_smc) __smc = _smc; \              112         typeof(_smc) __smc = _smc; \
113         struct net *_net = sock_net(&__smc->sk    113         struct net *_net = sock_net(&__smc->sk); \
114         struct smc_stats __percpu *_smc_stats     114         struct smc_stats __percpu *_smc_stats = _net->smc.smc_stats; \
115         typeof(length) _len = (length); \         115         typeof(length) _len = (length); \
116         typeof(rcode) _rc = (rcode); \            116         typeof(rcode) _rc = (rcode); \
117         bool is_smcd = !__smc->conn.lnk; \        117         bool is_smcd = !__smc->conn.lnk; \
118         if (is_smcd) \                            118         if (is_smcd) \
119                 SMC_STAT_PAYLOAD_SUB(_smc_stat    119                 SMC_STAT_PAYLOAD_SUB(_smc_stats, SMC_TYPE_D, tx, _len, _rc); \
120         else \                                    120         else \
121                 SMC_STAT_PAYLOAD_SUB(_smc_stat    121                 SMC_STAT_PAYLOAD_SUB(_smc_stats, SMC_TYPE_R, tx, _len, _rc); \
122 } \                                               122 } \
123 while (0)                                         123 while (0)
124                                                   124 
125 #define SMC_STAT_RX_PAYLOAD(_smc, length, rcod    125 #define SMC_STAT_RX_PAYLOAD(_smc, length, rcode) \
126 do { \                                            126 do { \
127         typeof(_smc) __smc = _smc; \              127         typeof(_smc) __smc = _smc; \
128         struct net *_net = sock_net(&__smc->sk    128         struct net *_net = sock_net(&__smc->sk); \
129         struct smc_stats __percpu *_smc_stats     129         struct smc_stats __percpu *_smc_stats = _net->smc.smc_stats; \
130         typeof(length) _len = (length); \         130         typeof(length) _len = (length); \
131         typeof(rcode) _rc = (rcode); \            131         typeof(rcode) _rc = (rcode); \
132         bool is_smcd = !__smc->conn.lnk; \        132         bool is_smcd = !__smc->conn.lnk; \
133         if (is_smcd) \                            133         if (is_smcd) \
134                 SMC_STAT_PAYLOAD_SUB(_smc_stat    134                 SMC_STAT_PAYLOAD_SUB(_smc_stats, SMC_TYPE_D, rx, _len, _rc); \
135         else \                                    135         else \
136                 SMC_STAT_PAYLOAD_SUB(_smc_stat    136                 SMC_STAT_PAYLOAD_SUB(_smc_stats, SMC_TYPE_R, rx, _len, _rc); \
137 } \                                               137 } \
138 while (0)                                         138 while (0)
139                                                   139 
140 #define SMC_STAT_RMB_SIZE_SUB(_smc_stats, _tec    140 #define SMC_STAT_RMB_SIZE_SUB(_smc_stats, _tech, k, _is_add, _len) \
141 do { \                                            141 do { \
142         typeof(_smc_stats) stats = (_smc_stats    142         typeof(_smc_stats) stats = (_smc_stats); \
143         typeof(_is_add) is_a = (_is_add); \       143         typeof(_is_add) is_a = (_is_add); \
144         typeof(_len) _l = (_len); \               144         typeof(_len) _l = (_len); \
145         typeof(_tech) t = (_tech); \              145         typeof(_tech) t = (_tech); \
146         int _pos; \                               146         int _pos; \
147         int m = SMC_BUF_MAX - 1; \                147         int m = SMC_BUF_MAX - 1; \
148         if (_l <= 0) \                            148         if (_l <= 0) \
149                 break; \                          149                 break; \
150         if (is_a) { \                             150         if (is_a) { \
151                 _pos = fls((_l - 1) >> 13); \     151                 _pos = fls((_l - 1) >> 13); \
152                 _pos = (_pos <= m) ? _pos : m;    152                 _pos = (_pos <= m) ? _pos : m; \
153                 this_cpu_inc((*stats).smc[t].k    153                 this_cpu_inc((*stats).smc[t].k ## _rmbsize.buf[_pos]); \
154                 this_cpu_add((*stats).smc[t].k    154                 this_cpu_add((*stats).smc[t].k ## _rmbuse, _l); \
155         } else { \                                155         } else { \
156                 this_cpu_sub((*stats).smc[t].k    156                 this_cpu_sub((*stats).smc[t].k ## _rmbuse, _l); \
157         } \                                       157         } \
158 } \                                               158 } \
159 while (0)                                         159 while (0)
160                                                   160 
161 #define SMC_STAT_RMB_SUB(_smc_stats, type, t,     161 #define SMC_STAT_RMB_SUB(_smc_stats, type, t, key) \
162         this_cpu_inc((*(_smc_stats)).smc[t].rm    162         this_cpu_inc((*(_smc_stats)).smc[t].rmb ## _ ## key.type ## _cnt)
163                                                   163 
164 #define SMC_STAT_RMB_SIZE(_smc, _is_smcd, _is_    164 #define SMC_STAT_RMB_SIZE(_smc, _is_smcd, _is_rx, _is_add, _len) \
165 do { \                                            165 do { \
166         struct net *_net = sock_net(&(_smc)->s    166         struct net *_net = sock_net(&(_smc)->sk); \
167         struct smc_stats __percpu *_smc_stats     167         struct smc_stats __percpu *_smc_stats = _net->smc.smc_stats; \
168         typeof(_is_add) is_add = (_is_add); \     168         typeof(_is_add) is_add = (_is_add); \
169         typeof(_is_smcd) is_d = (_is_smcd); \     169         typeof(_is_smcd) is_d = (_is_smcd); \
170         typeof(_is_rx) is_r = (_is_rx); \         170         typeof(_is_rx) is_r = (_is_rx); \
171         typeof(_len) l = (_len); \                171         typeof(_len) l = (_len); \
172         if ((is_d) && (is_r)) \                   172         if ((is_d) && (is_r)) \
173                 SMC_STAT_RMB_SIZE_SUB(_smc_sta    173                 SMC_STAT_RMB_SIZE_SUB(_smc_stats, SMC_TYPE_D, rx, is_add, l); \
174         if ((is_d) && !(is_r)) \                  174         if ((is_d) && !(is_r)) \
175                 SMC_STAT_RMB_SIZE_SUB(_smc_sta    175                 SMC_STAT_RMB_SIZE_SUB(_smc_stats, SMC_TYPE_D, tx, is_add, l); \
176         if (!(is_d) && (is_r)) \                  176         if (!(is_d) && (is_r)) \
177                 SMC_STAT_RMB_SIZE_SUB(_smc_sta    177                 SMC_STAT_RMB_SIZE_SUB(_smc_stats, SMC_TYPE_R, rx, is_add, l); \
178         if (!(is_d) && !(is_r)) \                 178         if (!(is_d) && !(is_r)) \
179                 SMC_STAT_RMB_SIZE_SUB(_smc_sta    179                 SMC_STAT_RMB_SIZE_SUB(_smc_stats, SMC_TYPE_R, tx, is_add, l); \
180 } \                                               180 } \
181 while (0)                                         181 while (0)
182                                                   182 
183 #define SMC_STAT_RMB(_smc, type, _is_smcd, _is    183 #define SMC_STAT_RMB(_smc, type, _is_smcd, _is_rx) \
184 do { \                                            184 do { \
185         struct net *net = sock_net(&(_smc)->sk    185         struct net *net = sock_net(&(_smc)->sk); \
186         struct smc_stats __percpu *_smc_stats     186         struct smc_stats __percpu *_smc_stats = net->smc.smc_stats; \
187         typeof(_is_smcd) is_d = (_is_smcd); \     187         typeof(_is_smcd) is_d = (_is_smcd); \
188         typeof(_is_rx) is_r = (_is_rx); \         188         typeof(_is_rx) is_r = (_is_rx); \
189         if ((is_d) && (is_r)) \                   189         if ((is_d) && (is_r)) \
190                 SMC_STAT_RMB_SUB(_smc_stats, t    190                 SMC_STAT_RMB_SUB(_smc_stats, type, SMC_TYPE_D, rx); \
191         if ((is_d) && !(is_r)) \                  191         if ((is_d) && !(is_r)) \
192                 SMC_STAT_RMB_SUB(_smc_stats, t    192                 SMC_STAT_RMB_SUB(_smc_stats, type, SMC_TYPE_D, tx); \
193         if (!(is_d) && (is_r)) \                  193         if (!(is_d) && (is_r)) \
194                 SMC_STAT_RMB_SUB(_smc_stats, t    194                 SMC_STAT_RMB_SUB(_smc_stats, type, SMC_TYPE_R, rx); \
195         if (!(is_d) && !(is_r)) \                 195         if (!(is_d) && !(is_r)) \
196                 SMC_STAT_RMB_SUB(_smc_stats, t    196                 SMC_STAT_RMB_SUB(_smc_stats, type, SMC_TYPE_R, tx); \
197 } \                                               197 } \
198 while (0)                                         198 while (0)
199                                                   199 
200 #define SMC_STAT_BUF_REUSE(smc, is_smcd, is_rx    200 #define SMC_STAT_BUF_REUSE(smc, is_smcd, is_rx) \
201         SMC_STAT_RMB(smc, reuse, is_smcd, is_r    201         SMC_STAT_RMB(smc, reuse, is_smcd, is_rx)
202                                                   202 
203 #define SMC_STAT_RMB_ALLOC(smc, is_smcd, is_rx    203 #define SMC_STAT_RMB_ALLOC(smc, is_smcd, is_rx) \
204         SMC_STAT_RMB(smc, alloc, is_smcd, is_r    204         SMC_STAT_RMB(smc, alloc, is_smcd, is_rx)
205                                                   205 
206 #define SMC_STAT_RMB_DOWNGRADED(smc, is_smcd,     206 #define SMC_STAT_RMB_DOWNGRADED(smc, is_smcd, is_rx) \
207         SMC_STAT_RMB(smc, dgrade, is_smcd, is_    207         SMC_STAT_RMB(smc, dgrade, is_smcd, is_rx)
208                                                   208 
209 #define SMC_STAT_RMB_TX_PEER_FULL(smc, is_smcd    209 #define SMC_STAT_RMB_TX_PEER_FULL(smc, is_smcd) \
210         SMC_STAT_RMB(smc, buf_full_peer, is_sm    210         SMC_STAT_RMB(smc, buf_full_peer, is_smcd, false)
211                                                   211 
212 #define SMC_STAT_RMB_TX_FULL(smc, is_smcd) \      212 #define SMC_STAT_RMB_TX_FULL(smc, is_smcd) \
213         SMC_STAT_RMB(smc, buf_full, is_smcd, f    213         SMC_STAT_RMB(smc, buf_full, is_smcd, false)
214                                                   214 
215 #define SMC_STAT_RMB_TX_PEER_SIZE_SMALL(smc, i    215 #define SMC_STAT_RMB_TX_PEER_SIZE_SMALL(smc, is_smcd) \
216         SMC_STAT_RMB(smc, buf_size_small_peer,    216         SMC_STAT_RMB(smc, buf_size_small_peer, is_smcd, false)
217                                                   217 
218 #define SMC_STAT_RMB_TX_SIZE_SMALL(smc, is_smc    218 #define SMC_STAT_RMB_TX_SIZE_SMALL(smc, is_smcd) \
219         SMC_STAT_RMB(smc, buf_size_small, is_s    219         SMC_STAT_RMB(smc, buf_size_small, is_smcd, false)
220                                                   220 
221 #define SMC_STAT_RMB_RX_SIZE_SMALL(smc, is_smc    221 #define SMC_STAT_RMB_RX_SIZE_SMALL(smc, is_smcd) \
222         SMC_STAT_RMB(smc, buf_size_small, is_s    222         SMC_STAT_RMB(smc, buf_size_small, is_smcd, true)
223                                                   223 
224 #define SMC_STAT_RMB_RX_FULL(smc, is_smcd) \      224 #define SMC_STAT_RMB_RX_FULL(smc, is_smcd) \
225         SMC_STAT_RMB(smc, buf_full, is_smcd, t    225         SMC_STAT_RMB(smc, buf_full, is_smcd, true)
226                                                   226 
227 #define SMC_STAT_INC(_smc, type) \                227 #define SMC_STAT_INC(_smc, type) \
228 do { \                                            228 do { \
229         typeof(_smc) __smc = _smc; \              229         typeof(_smc) __smc = _smc; \
230         bool is_smcd = !(__smc)->conn.lnk; \      230         bool is_smcd = !(__smc)->conn.lnk; \
231         struct net *net = sock_net(&(__smc)->s    231         struct net *net = sock_net(&(__smc)->sk); \
232         struct smc_stats __percpu *smc_stats =    232         struct smc_stats __percpu *smc_stats = net->smc.smc_stats; \
233         if ((is_smcd)) \                          233         if ((is_smcd)) \
234                 this_cpu_inc(smc_stats->smc[SM    234                 this_cpu_inc(smc_stats->smc[SMC_TYPE_D].type); \
235         else \                                    235         else \
236                 this_cpu_inc(smc_stats->smc[SM    236                 this_cpu_inc(smc_stats->smc[SMC_TYPE_R].type); \
237 } \                                               237 } \
238 while (0)                                         238 while (0)
239                                                   239 
240 #define SMC_STAT_CLNT_SUCC_INC(net, _aclc) \      240 #define SMC_STAT_CLNT_SUCC_INC(net, _aclc) \
241 do { \                                            241 do { \
242         typeof(_aclc) acl = (_aclc); \            242         typeof(_aclc) acl = (_aclc); \
243         bool is_v2 = (acl->hdr.version == SMC_    243         bool is_v2 = (acl->hdr.version == SMC_V2); \
244         bool is_smcd = (acl->hdr.typev1 == SMC    244         bool is_smcd = (acl->hdr.typev1 == SMC_TYPE_D); \
245         struct smc_stats __percpu *smc_stats =    245         struct smc_stats __percpu *smc_stats = (net)->smc.smc_stats; \
246         if (is_v2 && is_smcd) \                   246         if (is_v2 && is_smcd) \
247                 this_cpu_inc(smc_stats->smc[SM    247                 this_cpu_inc(smc_stats->smc[SMC_TYPE_D].clnt_v2_succ_cnt); \
248         else if (is_v2 && !is_smcd) \             248         else if (is_v2 && !is_smcd) \
249                 this_cpu_inc(smc_stats->smc[SM    249                 this_cpu_inc(smc_stats->smc[SMC_TYPE_R].clnt_v2_succ_cnt); \
250         else if (!is_v2 && is_smcd) \             250         else if (!is_v2 && is_smcd) \
251                 this_cpu_inc(smc_stats->smc[SM    251                 this_cpu_inc(smc_stats->smc[SMC_TYPE_D].clnt_v1_succ_cnt); \
252         else if (!is_v2 && !is_smcd) \            252         else if (!is_v2 && !is_smcd) \
253                 this_cpu_inc(smc_stats->smc[SM    253                 this_cpu_inc(smc_stats->smc[SMC_TYPE_R].clnt_v1_succ_cnt); \
254 } \                                               254 } \
255 while (0)                                         255 while (0)
256                                                   256 
257 #define SMC_STAT_SERV_SUCC_INC(net, _ini) \       257 #define SMC_STAT_SERV_SUCC_INC(net, _ini) \
258 do { \                                            258 do { \
259         typeof(_ini) i = (_ini); \                259         typeof(_ini) i = (_ini); \
260         bool is_smcd = (i->is_smcd); \            260         bool is_smcd = (i->is_smcd); \
261         u8 version = is_smcd ? i->smcd_version    261         u8 version = is_smcd ? i->smcd_version : i->smcr_version; \
262         bool is_v2 = (version & SMC_V2); \        262         bool is_v2 = (version & SMC_V2); \
263         typeof(net->smc.smc_stats) smc_stats =    263         typeof(net->smc.smc_stats) smc_stats = (net)->smc.smc_stats; \
264         if (is_v2 && is_smcd) \                   264         if (is_v2 && is_smcd) \
265                 this_cpu_inc(smc_stats->smc[SM    265                 this_cpu_inc(smc_stats->smc[SMC_TYPE_D].srv_v2_succ_cnt); \
266         else if (is_v2 && !is_smcd) \             266         else if (is_v2 && !is_smcd) \
267                 this_cpu_inc(smc_stats->smc[SM    267                 this_cpu_inc(smc_stats->smc[SMC_TYPE_R].srv_v2_succ_cnt); \
268         else if (!is_v2 && is_smcd) \             268         else if (!is_v2 && is_smcd) \
269                 this_cpu_inc(smc_stats->smc[SM    269                 this_cpu_inc(smc_stats->smc[SMC_TYPE_D].srv_v1_succ_cnt); \
270         else if (!is_v2 && !is_smcd) \            270         else if (!is_v2 && !is_smcd) \
271                 this_cpu_inc(smc_stats->smc[SM    271                 this_cpu_inc(smc_stats->smc[SMC_TYPE_R].srv_v1_succ_cnt); \
272 } \                                               272 } \
273 while (0)                                         273 while (0)
274                                                   274 
275 int smc_nl_get_stats(struct sk_buff *skb, stru    275 int smc_nl_get_stats(struct sk_buff *skb, struct netlink_callback *cb);
276 int smc_nl_get_fback_stats(struct sk_buff *skb    276 int smc_nl_get_fback_stats(struct sk_buff *skb, struct netlink_callback *cb);
277 int smc_stats_init(struct net *net);              277 int smc_stats_init(struct net *net);
278 void smc_stats_exit(struct net *net);             278 void smc_stats_exit(struct net *net);
279                                                   279 
280 #endif /* NET_SMC_SMC_STATS_H_ */                 280 #endif /* NET_SMC_SMC_STATS_H_ */
281                                                   281 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php