utils.c (448cc2fb3a7b327823a9afd374808c37b8e6194f) | utils.c (117697cc935b0ab04ec66274d8e64ccfebd7d0d2) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB 2/* Copyright (c) 2015 - 2021 Intel Corporation */ 3#include "main.h" 4 5/** 6 * irdma_arp_table -manage arp table 7 * @rf: RDMA PCI function 8 * @ip_addr: ip address for device --- 2225 unchanged lines hidden (view full) --- 2234{ 2235 u64 sizeofbitmap; 2236 2237 if (pchunk->size & 0xfff) 2238 return IRDMA_ERR_PARAM; 2239 2240 sizeofbitmap = (u64)pchunk->size >> pprm->pble_shift; 2241 | 1// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB 2/* Copyright (c) 2015 - 2021 Intel Corporation */ 3#include "main.h" 4 5/** 6 * irdma_arp_table -manage arp table 7 * @rf: RDMA PCI function 8 * @ip_addr: ip address for device --- 2225 unchanged lines hidden (view full) --- 2234{ 2235 u64 sizeofbitmap; 2236 2237 if (pchunk->size & 0xfff) 2238 return IRDMA_ERR_PARAM; 2239 2240 sizeofbitmap = (u64)pchunk->size >> pprm->pble_shift; 2241 |
2242 pchunk->bitmapmem.size = sizeofbitmap >> 3; 2243 pchunk->bitmapmem.va = kzalloc(pchunk->bitmapmem.size, GFP_KERNEL); 2244 2245 if (!pchunk->bitmapmem.va) | 2242 pchunk->bitmapbuf = bitmap_zalloc(sizeofbitmap, GFP_KERNEL); 2243 if (!pchunk->bitmapbuf) |
2246 return IRDMA_ERR_NO_MEMORY; 2247 | 2244 return IRDMA_ERR_NO_MEMORY; 2245 |
2248 pchunk->bitmapbuf = pchunk->bitmapmem.va; 2249 bitmap_zero(pchunk->bitmapbuf, sizeofbitmap); 2250 | |
2251 pchunk->sizeofbitmap = sizeofbitmap; 2252 /* each pble is 8 bytes hence shift by 3 */ 2253 pprm->total_pble_alloc += pchunk->size >> 3; 2254 pprm->free_pble_cnt += pchunk->size >> 3; 2255 2256 return 0; 2257} 2258 --- 235 unchanged lines hidden --- | 2246 pchunk->sizeofbitmap = sizeofbitmap; 2247 /* each pble is 8 bytes hence shift by 3 */ 2248 pprm->total_pble_alloc += pchunk->size >> 3; 2249 pprm->free_pble_cnt += pchunk->size >> 3; 2250 2251 return 0; 2252} 2253 --- 235 unchanged lines hidden --- |