linux/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

/*
 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#include <linux/highmem.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/mlx5/driver.h>
#include <linux/xarray.h>
#include "mlx5_core.h"
#include "lib/eq.h"
#include "lib/tout.h"

enum {};

struct mlx5_pages_req {};

struct fw_page {};

enum {};

static u32 get_function(u16 func_id, bool ec_function)
{}

static u16 func_id_to_type(struct mlx5_core_dev *dev, u16 func_id, bool ec_function)
{}

static u32 mlx5_get_ec_function(u32 function)
{}

static u32 mlx5_get_func_id(u32 function)
{}

static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 function)
{}

static int insert_page(struct mlx5_core_dev *dev, u64 addr, struct page *page, u32 function)
{}

static struct fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr,
				    u32 function)
{}

static int mlx5_cmd_query_pages(struct mlx5_core_dev *dev, u16 *func_id,
				s32 *npages, int boot)
{}

static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr, u32 function)
{}

#define MLX5_U64_4K_PAGE_MASK

static void free_fwp(struct mlx5_core_dev *dev, struct fw_page *fwp,
		     bool in_free_list)
{}

static void free_4k(struct mlx5_core_dev *dev, u64 addr, u32 function)
{}

static int alloc_system_page(struct mlx5_core_dev *dev, u32 function)
{}

static void page_notify_fail(struct mlx5_core_dev *dev, u16 func_id,
			     bool ec_function)
{}

static int give_pages(struct mlx5_core_dev *dev, u16 func_id, int npages,
		      int event, bool ec_function)
{}

static void release_all_pages(struct mlx5_core_dev *dev, u16 func_id,
			      bool ec_function)
{}

static u32 fwp_fill_manage_pages_out(struct fw_page *fwp, u32 *out, u32 index,
				     u32 npages)
{}

static int reclaim_pages_cmd(struct mlx5_core_dev *dev,
			     u32 *in, int in_size, u32 *out, int out_size)
{}

static int reclaim_pages(struct mlx5_core_dev *dev, u16 func_id, int npages,
			 int *nclaimed, bool event, bool ec_function)
{}

static void pages_work_handler(struct work_struct *work)
{}

enum {};

static int req_pages_handler(struct notifier_block *nb,
			     unsigned long type, void *data)
{}

int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot)
{}

enum {};

static int optimal_reclaimed_pages(void)
{}

static int mlx5_reclaim_root_pages(struct mlx5_core_dev *dev,
				   struct rb_root *root, u32 function)
{}

int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev)
{}

int mlx5_pagealloc_init(struct mlx5_core_dev *dev)
{}

void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev)
{}

void mlx5_pagealloc_start(struct mlx5_core_dev *dev)
{}

void mlx5_pagealloc_stop(struct mlx5_core_dev *dev)
{}

int mlx5_wait_for_pages(struct mlx5_core_dev *dev, int *pages)
{}