Lines Matching refs:entry
38 in_cache_entry *entry;
41 entry = client->in_cache;
42 while (entry != NULL) {
43 if (entry->ctrl_info.in_dst_ip == dst_ip) {
44 refcount_inc(&entry->use);
46 return entry;
48 entry = entry->next;
59 in_cache_entry *entry;
62 entry = client->in_cache;
63 while (entry != NULL) {
64 if ((entry->ctrl_info.in_dst_ip & mask) == (dst_ip & mask)) {
65 refcount_inc(&entry->use);
67 return entry;
69 entry = entry->next;
80 in_cache_entry *entry;
83 entry = client->in_cache;
84 while (entry != NULL) {
85 if (entry->shortcut == vcc) {
86 refcount_inc(&entry->use);
88 return entry;
90 entry = entry->next;
100 in_cache_entry *entry = kzalloc(sizeof(in_cache_entry), GFP_KERNEL);
102 if (entry == NULL) {
107 dprintk("adding an ingress entry, ip = %pI4\n", &dst_ip);
109 refcount_set(&entry->use, 1);
112 entry->next = client->in_cache;
113 entry->prev = NULL;
115 client->in_cache->prev = entry;
116 client->in_cache = entry;
118 memcpy(entry->MPS_ctrl_ATM_addr, client->mps_ctrl_addr, ATM_ESA_LEN);
119 entry->ctrl_info.in_dst_ip = dst_ip;
120 entry->time = ktime_get_seconds();
121 entry->retry_time = client->parameters.mpc_p4;
122 entry->count = 1;
123 entry->entry_state = INGRESS_INVALID;
124 entry->ctrl_info.holding_time = HOLDING_TIME_DEFAULT;
125 refcount_inc(&entry->use);
130 return entry;
133 static int cache_hit(in_cache_entry *entry, struct mpoa_client *mpc)
138 entry->count++;
139 if (entry->entry_state == INGRESS_RESOLVED && entry->shortcut != NULL)
142 if (entry->entry_state == INGRESS_REFRESHING) {
143 if (entry->count > mpc->parameters.mpc_p1) {
145 msg.content.in_info = entry->ctrl_info;
147 qos = atm_mpoa_search_qos(entry->ctrl_info.in_dst_ip);
151 entry->reply_wait = ktime_get_seconds();
152 entry->entry_state = INGRESS_RESOLVING;
154 if (entry->shortcut != NULL)
159 if (entry->entry_state == INGRESS_RESOLVING && entry->shortcut != NULL)
162 if (entry->count > mpc->parameters.mpc_p1 &&
163 entry->entry_state == INGRESS_INVALID) {
165 mpc->dev->name, &entry->ctrl_info.in_dst_ip);
166 entry->entry_state = INGRESS_RESOLVING;
169 msg.content.in_info = entry->ctrl_info;
170 qos = atm_mpoa_search_qos(entry->ctrl_info.in_dst_ip);
174 entry->reply_wait = ktime_get_seconds();
180 static void in_cache_put(in_cache_entry *entry)
182 if (refcount_dec_and_test(&entry->use)) {
183 kfree_sensitive(entry);
190 static void in_cache_remove_entry(in_cache_entry *entry,
196 vcc = entry->shortcut;
197 dprintk("removing an ingress entry, ip = %pI4\n",
198 &entry->ctrl_info.in_dst_ip);
200 if (entry->prev != NULL)
201 entry->prev->next = entry->next;
203 client->in_cache = entry->next;
204 if (entry->next != NULL)
205 entry->next->prev = entry->prev;
206 client->in_ops->put(entry);
228 in_cache_entry *entry, *next_entry;
234 entry = client->in_cache;
235 while (entry != NULL) {
236 entry->count = 0;
237 next_entry = entry->next;
238 if ((now - entry->time) > entry->ctrl_info.holding_time) {
240 &entry->ctrl_info.in_dst_ip);
241 client->in_ops->remove_entry(entry, client);
243 entry = next_entry;
253 in_cache_entry *entry;
260 entry = client->in_cache;
261 while (entry != NULL) {
262 if (entry->entry_state == INGRESS_RESOLVING) {
264 if ((now - entry->hold_down)
266 entry = entry->next; /* Entry in hold down */
269 if ((now - entry->reply_wait) > entry->retry_time) {
270 entry->retry_time = MPC_C1 * (entry->retry_time);
273 * put entry in hold down.
275 if (entry->retry_time > client->parameters.mpc_p5) {
276 entry->hold_down = ktime_get_seconds();
277 entry->retry_time = client->parameters.mpc_p4;
278 entry = entry->next;
282 memset(&entry->hold_down, 0, sizeof(time64_t));
285 msg.content.in_info = entry->ctrl_info;
286 qos = atm_mpoa_search_qos(entry->ctrl_info.in_dst_ip);
290 entry->reply_wait = ktime_get_seconds();
293 entry = entry->next;
302 struct in_cache_entry *entry = client->in_cache;
308 while (entry != NULL) {
309 if (entry->entry_state == INGRESS_RESOLVED) {
310 if (!(entry->refresh_time))
311 entry->refresh_time = (2 * (entry->ctrl_info.holding_time))/3;
312 if ((now - entry->reply_wait) >
313 entry->refresh_time) {
314 dprintk("refreshing an entry.\n");
315 entry->entry_state = INGRESS_REFRESHING;
319 entry = entry->next;
335 eg_cache_entry *entry;
338 entry = mpc->eg_cache;
339 while (entry != NULL) {
340 if (entry->ctrl_info.cache_id == cache_id) {
341 refcount_inc(&entry->use);
343 return entry;
345 entry = entry->next;
356 eg_cache_entry *entry;
359 entry = mpc->eg_cache;
360 while (entry != NULL) {
361 if (entry->ctrl_info.tag == tag) {
362 refcount_inc(&entry->use);
364 return entry;
366 entry = entry->next;
378 eg_cache_entry *entry;
381 entry = mpc->eg_cache;
382 while (entry != NULL) {
383 if (entry->shortcut == vcc) {
384 refcount_inc(&entry->use);
386 return entry;
388 entry = entry->next;
398 eg_cache_entry *entry;
401 entry = mpc->eg_cache;
402 while (entry != NULL) {
403 if (entry->latest_ip_addr == ipaddr) {
404 refcount_inc(&entry->use);
406 return entry;
408 entry = entry->next;
415 static void eg_cache_put(eg_cache_entry *entry)
417 if (refcount_dec_and_test(&entry->use)) {
418 kfree_sensitive(entry);
425 static void eg_cache_remove_entry(eg_cache_entry *entry,
431 vcc = entry->shortcut;
432 dprintk("removing an egress entry.\n");
433 if (entry->prev != NULL)
434 entry->prev->next = entry->next;
436 client->eg_cache = entry->next;
437 if (entry->next != NULL)
438 entry->next->prev = entry->prev;
439 client->eg_ops->put(entry);
459 eg_cache_entry *entry = kzalloc(sizeof(eg_cache_entry), GFP_KERNEL);
461 if (entry == NULL) {
466 dprintk("adding an egress entry, ip = %pI4, this should be our IP\n",
469 refcount_set(&entry->use, 1);
472 entry->next = client->eg_cache;
473 entry->prev = NULL;
475 client->eg_cache->prev = entry;
476 client->eg_cache = entry;
478 memcpy(entry->MPS_ctrl_ATM_addr, client->mps_ctrl_addr, ATM_ESA_LEN);
479 entry->ctrl_info = msg->content.eg_info;
480 entry->time = ktime_get_seconds();
481 entry->entry_state = EGRESS_RESOLVED;
483 ntohl(entry->ctrl_info.cache_id));
484 dprintk("mps_ip = %pI4\n", &entry->ctrl_info.mps_ip);
485 refcount_inc(&entry->use);
490 return entry;
493 static void update_eg_cache_entry(eg_cache_entry *entry, uint16_t holding_time)
495 entry->time = ktime_get_seconds();
496 entry->entry_state = EGRESS_RESOLVED;
497 entry->ctrl_info.holding_time = holding_time;
502 eg_cache_entry *entry, *next_entry;
509 entry = client->eg_cache;
510 while (entry != NULL) {
511 next_entry = entry->next;
512 if ((now - entry->time) > entry->ctrl_info.holding_time) {
514 msg.content.eg_info = entry->ctrl_info;
516 ntohl(entry->ctrl_info.cache_id));
518 client->eg_ops->remove_entry(entry, client);
520 entry = next_entry;