svn commit: r322146 - stable/11/sys/dev/mlx5/mlx5_core
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Aug 7 12:41:07 UTC 2017
Author: hselasky
Date: Mon Aug 7 12:41:06 2017
New Revision: 322146
URL: https://svnweb.freebsd.org/changeset/base/322146
Log:
MFC r312879:
Rename struct fw_page into struct mlx5_fw_page as a preparation step
for adding busdma support.
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:38:04 2017 (r322145)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Aug 7 12:41:06 2017 (r322146)
@@ -38,7 +38,7 @@ struct mlx5_pages_req {
struct work_struct work;
};
-struct fw_page {
+struct mlx5_fw_page {
struct rb_node rb_node;
u64 addr;
struct page *page;
@@ -77,13 +77,13 @@ static int insert_page(struct mlx5_core_dev *dev, u64
struct rb_root *root = &dev->priv.page_root;
struct rb_node **new = &root->rb_node;
struct rb_node *parent = NULL;
- struct fw_page *nfp;
- struct fw_page *tfp;
+ struct mlx5_fw_page *nfp;
+ struct mlx5_fw_page *tfp;
int i;
while (*new) {
parent = *new;
- tfp = rb_entry(parent, struct fw_page, rb_node);
+ tfp = rb_entry(parent, struct mlx5_fw_page, rb_node);
if (tfp->addr < addr)
new = &parent->rb_left;
else if (tfp->addr > addr)
@@ -108,15 +108,15 @@ static int insert_page(struct mlx5_core_dev *dev, u64
return 0;
}
-static struct fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr)
+static struct mlx5_fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr)
{
struct rb_root *root = &dev->priv.page_root;
struct rb_node *tmp = root->rb_node;
- struct fw_page *result = NULL;
- struct fw_page *tfp;
+ struct mlx5_fw_page *result = NULL;
+ struct mlx5_fw_page *tfp;
while (tmp) {
- tfp = rb_entry(tmp, struct fw_page, rb_node);
+ tfp = rb_entry(tmp, struct mlx5_fw_page, rb_node);
if (tfp->addr < addr) {
tmp = tmp->rb_left;
} else if (tfp->addr > addr) {
@@ -156,13 +156,13 @@ static int mlx5_cmd_query_pages(struct mlx5_core_dev *
static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr)
{
- struct fw_page *fp;
+ struct mlx5_fw_page *fp;
unsigned n;
if (list_empty(&dev->priv.free_list))
return -ENOMEM;
- fp = list_entry(dev->priv.free_list.next, struct fw_page, list);
+ fp = list_entry(dev->priv.free_list.next, struct mlx5_fw_page, list);
n = find_first_bit(&fp->bitmask, 8 * sizeof(fp->bitmask));
if (n >= MLX5_NUM_4K_IN_PAGE) {
mlx5_core_warn(dev, "alloc 4k bug\n");
@@ -180,7 +180,7 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *ad
static void free_4k(struct mlx5_core_dev *dev, u64 addr)
{
- struct fw_page *fwp;
+ struct mlx5_fw_page *fwp;
int n;
fwp = find_fw_page(dev, addr & PAGE_MASK);
@@ -466,7 +466,7 @@ static int optimal_reclaimed_pages(void)
int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev)
{
int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS);
- struct fw_page *fwp;
+ struct mlx5_fw_page *fwp;
struct rb_node *p;
int nclaimed = 0;
int err;
@@ -474,7 +474,7 @@ int mlx5_reclaim_startup_pages(struct mlx5_core_dev *d
do {
p = rb_first(&dev->priv.page_root);
if (p) {
- fwp = rb_entry(p, struct fw_page, rb_node);
+ fwp = rb_entry(p, struct mlx5_fw_page, rb_node);
err = reclaim_pages(dev, fwp->func_id,
optimal_reclaimed_pages(),
&nclaimed);
More information about the svn-src-stable-11
mailing list