Changeset 331 for EcnlProtoTool/trunk/asp3_dcre/tinet/net/net_buf.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/net/net_buf.c
r321 r331 2 2 * TINET (TCP/IP Protocol Stack) 3 3 * 4 * Copyright (C) 2001-20 09by Dep. of Computer Science and Engineering4 * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * … … 57 57 #include <net/ethernet.h> 58 58 #include <net/net.h> 59 #include <net/net_endian.h> 59 60 #include <net/net_buf.h> 60 61 #include <net/net_count.h> … … 62 63 #include <netinet/in.h> 63 64 #include <netinet/in_var.h> 64 #include <netinet6/in6.h>65 65 #include <netinet/ip.h> 66 66 #include <netinet/ip_var.h> 67 #include <netinet/ip6.h>68 #include <netinet6/ip6_var.h>69 67 #include <netinet/tcp.h> 70 #include <netinet/tcp_timer.h>71 68 #include <netinet/tcp_var.h> 72 69 … … 98 95 99 96 #if defined(NUM_MPF_NET_BUF6_REASSM) && NUM_MPF_NET_BUF6_REASSM > 0 97 100 98 { 101 99 MPF_NET_BUF_REASSM, … … 109 107 110 108 }, 111 #endif /* of #if defined(NUM_MPF_NET_BUF6_REASSM) && NUM_MPF_NET_BUF6_REASSM > 0 */ 109 110 #else /* of #if defined(NUM_MPF_NET_BUF6_REASSM) && NUM_MPF_NET_BUF6_REASSM > 0 */ 112 111 113 112 #if defined(NUM_MPF_NET_BUF4_REASSM) && NUM_MPF_NET_BUF4_REASSM > 0 113 114 114 { 115 115 MPF_NET_BUF_REASSM, … … 123 123 124 124 }, 125 125 126 #endif /* of #if defined(NUM_MPF_NET_BUF4_REASSM) && NUM_MPF_NET_BUF4_REASSM > 0 */ 127 128 #endif /* of #if defined(NUM_MPF_NET_BUF6_REASSM) && NUM_MPF_NET_BUF6_REASSM > 0 */ 126 129 127 130 #if defined(NUM_MPF_NET_BUF_IF_PDU) && NUM_MPF_NET_BUF_IF_PDU > 0 … … 223 226 #endif /* of #if defined(NUM_MPF_NET_BUF_128) && NUM_MPF_NET_BUF_128 > 0 */ 224 227 225 #if defined( SUPPORT_INET4)228 #if defined(_IP4_CFG) 226 229 227 230 #if defined(NUM_MPF_NET_BUF_64) && NUM_MPF_NET_BUF_64 > 0 … … 239 242 #endif /* of #if defined(NUM_MPF_NET_BUF_64) && NUM_MPF_NET_BUF_64 > 0 */ 240 243 241 #endif /* of #if defined( SUPPORT_INET4) */244 #endif /* of #if defined(_IP4_CFG) */ 242 245 243 246 #if defined(NUM_MPF_NET_BUF_CSEG) && NUM_MPF_NET_BUF_CSEG > 0 … … 308 311 (*buf)->len = (uint16_t)minlen; 309 312 (*buf)->flags = 0; 313 314 #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF 310 315 NET_COUNT_NET_BUF(net_buf_table[ix].allocs, 1); 316 net_buf_table[ix].busies ++; 317 #endif 311 318 return error; 312 319 } … … 316 323 } 317 324 318 syslog(LOG_WARNING, "[NET BUF] busy, index=%d, len=%4d.", (uint16_t)req_ix, minlen); 325 syslog(LOG_WARNING, "[BUF] busy, up index:%d,%d[%4d], len:%4d.", 326 (uint16_t)req_ix, ix, net_buf_table[req_ix].size, minlen); 319 327 *buf = NULL; 320 328 NET_COUNT_NET_BUF(net_buf_table[req_ix].errors, 1); … … 346 354 (*buf)->len = net_buf_table[ix].size; 347 355 (*buf)->flags = 0; 356 357 #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF 348 358 NET_COUNT_NET_BUF(net_buf_table[ix].allocs, 1); 359 net_buf_table[ix].busies ++; 360 #endif 349 361 return error; 350 362 } … … 354 366 } 355 367 356 syslog(LOG_WARNING, "[NET BUF] busy, index=%d, len=%4d.", (uint16_t)req_ix, maxlen); 368 syslog(LOG_WARNING, "[BUF] busy, down index:%d,%d[%4d], len:%4d.", 369 (uint16_t)req_ix, ix, net_buf_table[req_ix].size, minlen); 357 370 *buf = NULL; 358 371 NET_COUNT_NET_BUF(net_buf_table[req_ix].errors, 1); … … 380 393 } 381 394 395 #if defined(SUPPORT_TCP) && defined(TCP_CFG_SWBUF_CSAVE) 396 382 397 /* TCP で予約したネットワークバッファを取り出す。*/ 383 398 if ((nbatr & NBA_RESERVE_TCP) != 0) { … … 386 401 } 387 402 } 403 404 #endif /* of #if defined(SUPPORT_TCP) && defined(TCP_CFG_SWBUF_CSAVE) */ 388 405 389 406 if ((nbatr & NBA_SEARCH_DESCENT) != 0) … … 423 440 else { 424 441 442 #if defined(SUPPORT_TCP) && defined(TCP_CFG_SWBUF_CSAVE) 443 425 444 /* TCP で、ネットワークバッファを予約する。*/ 426 445 if (TCP_PUSH_RES_NBUF(buf) == NULL) 427 446 return E_OK; 428 447 448 #endif /* of #if defined(SUPPORT_TCP) && defined(TCP_CFG_SWBUF_CSAVE) */ 449 429 450 /* 固定メモリプールに返す。*/ 430 if ((error = rel_mpf((ID)net_buf_table[buf->idix].index, buf)) != E_OK) 451 452 #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF 453 net_buf_table[buf->idix].busies --; 454 #endif 455 if ((error = rel_mpf((ID)net_buf_table[buf->idix].index, buf)) != E_OK) { 431 456 syslog(LOG_WARNING, "[NET BUF] %s, ID=%d.", itron_strerror(error), buf->idix); 457 } 432 458 } 433 459 return error;
Note:
See TracChangeset
for help on using the changeset viewer.