• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/devif/backends/net/mlx4/drivers/infiniband/core/

Lines Matching refs:cache

76  struct ib_gid_cache *cache;
83 read_lock_irqsave(&device->cache.lock, flags);
85 cache = device->cache.gid_cache[port_num - start_port(device)];
87 if (index < 0 || index >= cache->table_len)
90 *gid = cache->table[index];
92 read_unlock_irqrestore(&device->cache.lock, flags);
103 struct ib_gid_cache *cache;
112 read_lock_irqsave(&device->cache.lock, flags);
115 cache = device->cache.gid_cache[p];
116 for (i = 0; i < cache->table_len; ++i) {
117 if (!memcmp(gid, &cache->table[i], sizeof *gid)) {
127 read_unlock_irqrestore(&device->cache.lock, flags);
138 struct ib_pkey_cache *cache;
145 read_lock_irqsave(&device->cache.lock, flags);
147 cache = device->cache.pkey_cache[port_num - start_port(device)];
149 if (index < 0 || index >= cache->table_len)
152 *pkey = cache->table[index];
154 read_unlock_irqrestore(&device->cache.lock, flags);
165 struct ib_pkey_cache *cache;
173 read_lock_irqsave(&device->cache.lock, flags);
175 cache = device->cache.pkey_cache[port_num - start_port(device)];
179 for (i = 0; i < cache->table_len; ++i)
180 if ((cache->table[i] & 0x7fff) == (pkey & 0x7fff)) {
186 read_unlock_irqrestore(&device->cache.lock, flags);
202 read_lock_irqsave(&device->cache.lock, flags);
203 *lmc = device->cache.lmc_cache[port_num - start_port(device)];
204 read_unlock_irqrestore(&device->cache.lock, flags);
260 /*write_lock_irq(&device->cache.lock);*/
262 old_pkey_cache = device->cache.pkey_cache[port - start_port(device)];
263 old_gid_cache = device->cache.gid_cache[port - start_port(device)];
265 device->cache.pkey_cache[port - start_port(device)] = pkey_cache;
266 device->cache.gid_cache[port - start_port(device)] = gid_cache;
268 device->cache.lmc_cache[port - start_port(device)] = tprops->lmc;
270 /*write_unlock_irq(&device->cache.lock);*/
316 /*rwlock_init(&device->cache.lock);*/
318 device->cache.pkey_cache = malloc(
319 sizeof *device->cache.pkey_cache
321 device->cache.gid_cache = malloc(
322 sizeof *device->cache.gid_cache
325 device->cache.lmc_cache = malloc(
326 sizeof *device->cache.lmc_cache
329 if (!device->cache.pkey_cache || !device->cache.gid_cache
330 || !device->cache.lmc_cache) {
331 printf("Couldn't allocate cache "
340 device->cache.pkey_cache[p] = NULL;
341 device->cache.gid_cache[p] = NULL;
345 /*INIT_IB_EVENT_HANDLER(&device->cache.event_handler, device, ib_cache_event);
346 if (ib_register_event_handler(&device->cache.event_handler))
352 free(device->cache.pkey_cache[p]);
353 free(device->cache.gid_cache[p]);
356 err: free(device->cache.pkey_cache);
357 free(device->cache.gid_cache);
358 free(device->cache.lmc_cache);
365 ib_unregister_event_handler(&device->cache.event_handler);
369 kfree(device->cache.pkey_cache[p]);
370 kfree(device->cache.gid_cache[p]);
373 kfree(device->cache.pkey_cache);
374 kfree(device->cache.gid_cache);
375 kfree(device->cache.lmc_cache);
379 .name = "cache",