blob: 3f24756c4807c7f8858e73658e45e97d9762a71a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
/*
*
* Copyright (c) 2018 Huawei Technologies Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __STACKX_INSTANCE_H__
#define __STACKX_INSTANCE_H__
#include "stackx/spl_tcpip.h"
#include "netif.h"
#include "lwip/ip4_frag.h"
#include "stackx/spl_pbuf.h"
#include "arch/sys_arch.h"
#include "arch/queue.h"
#include "stackx_tx_box.h"
#include "nsfw_msg.h"
#include "stackx_app_res.h"
#include "ip_module_api.h"
#include "tcp.h"
#include "udp.h"
#define PKT_BURST 32
#define TASK_BURST 16
#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif
#define MAX_NETBUFS 1024*2 //define for C10M
#define TOTAL_MSG_QUEUE_NUM (MSG_PRIO_QUEUE_NUM+1) /* three priority queue and one primary queue */
struct stackx_stat
{
struct rti_queue primary_stat; //primary box stat
u64_t extend_member_bit;
};
struct stackx_stack
{
struct queue primary_mbox;
struct queue priority_mbox[MSG_PRIO_QUEUE_NUM]; //0-highest; 1-medium; 2-lowest
//stackx_apis stackx_api;
};
struct disp_netif_list
{
struct disp_netif_list *next;
struct netif *netif;
};
typedef struct stackx_instance
{
uint16_t rss_queue_id;
mpool_handle mp_tx;
//mring_handle mp_seg;
mring_handle cpcb_seg;
mring_handle lmsg_pool;
struct stackx_stack lstack;
struct stackx_stat lstat; //point to p_stackx_table->lstat[i];
/**
* Header of the input packet currently being processed.
*/
/* global variables */
struct disp_netif_list *netif_list;
} stackx_instance;
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#endif /* __STACKX_INSTANCE_H__ */
|