From: Haren Myneni <haren@linux.ibm.com>
To: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,
npiggin@gmail.com, nathanl@linux.ibm.com
Subject: [PATCH v5 1/9] powerpc/pseries/vas: Use common names in VAS capability structure
Date: Sun, 27 Feb 2022 23:34:21 -0800 [thread overview]
Message-ID: <f35fbb424668cff4e5a8eac348ad8809c3e62332.camel@linux.ibm.com> (raw)
In-Reply-To: <ccd9c0f85005c56b4d011d5c2384444ae71bda69.camel@linux.ibm.com>
nr_total/nr_used_credits provides credits usage to user space
via sysfs and the same interface can be used on PowerNV in
future. Changed with proper naming so that applicable on both
pseries and PowerNV.
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/platforms/pseries/vas.c | 10 +++++-----
arch/powerpc/platforms/pseries/vas.h | 5 ++---
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c
index d243ddc58827..18aae037ffe9 100644
--- a/arch/powerpc/platforms/pseries/vas.c
+++ b/arch/powerpc/platforms/pseries/vas.c
@@ -310,8 +310,8 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags,
cop_feat_caps = &caps->caps;
- if (atomic_inc_return(&cop_feat_caps->used_lpar_creds) >
- atomic_read(&cop_feat_caps->target_lpar_creds)) {
+ if (atomic_inc_return(&cop_feat_caps->nr_used_credits) >
+ atomic_read(&cop_feat_caps->nr_total_credits)) {
pr_err("Credits are not available to allocate window\n");
rc = -EINVAL;
goto out;
@@ -385,7 +385,7 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags,
free_irq_setup(txwin);
h_deallocate_vas_window(txwin->vas_win.winid);
out:
- atomic_dec(&cop_feat_caps->used_lpar_creds);
+ atomic_dec(&cop_feat_caps->nr_used_credits);
kfree(txwin);
return ERR_PTR(rc);
}
@@ -445,7 +445,7 @@ static int vas_deallocate_window(struct vas_window *vwin)
}
list_del(&win->win_list);
- atomic_dec(&caps->used_lpar_creds);
+ atomic_dec(&caps->nr_used_credits);
mutex_unlock(&vas_pseries_mutex);
put_vas_user_win_ref(&vwin->task_ref);
@@ -521,7 +521,7 @@ static int __init get_vas_capabilities(u8 feat, enum vas_cop_feat_type type,
}
caps->max_lpar_creds = be16_to_cpu(hv_caps->max_lpar_creds);
caps->max_win_creds = be16_to_cpu(hv_caps->max_win_creds);
- atomic_set(&caps->target_lpar_creds,
+ atomic_set(&caps->nr_total_credits,
be16_to_cpu(hv_caps->target_lpar_creds));
if (feat == VAS_GZIP_DEF_FEAT) {
caps->def_lpar_creds = be16_to_cpu(hv_caps->def_lpar_creds);
diff --git a/arch/powerpc/platforms/pseries/vas.h b/arch/powerpc/platforms/pseries/vas.h
index 4ecb3fcabd10..d6ea8ab8b07a 100644
--- a/arch/powerpc/platforms/pseries/vas.h
+++ b/arch/powerpc/platforms/pseries/vas.h
@@ -72,9 +72,8 @@ struct vas_cop_feat_caps {
};
/* Total LPAR available credits. Can be different from max LPAR */
/* credits due to DLPAR operation */
- atomic_t target_lpar_creds;
- atomic_t used_lpar_creds; /* Used credits so far */
- u16 avail_lpar_creds; /* Remaining available credits */
+ atomic_t nr_total_credits; /* Total credits assigned to LPAR */
+ atomic_t nr_used_credits; /* Used credits so far */
};
/*
--
2.27.0
next prev parent reply other threads:[~2022-02-28 7:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-28 7:32 [PATCH v5 0/9] powerpc/pseries/vas: NXGZIP support with DLPAR Haren Myneni
2022-02-28 7:34 ` Haren Myneni [this message]
2022-02-28 7:35 ` [PATCH v5 2/9] powerpc/pseries/vas: Save PID in pseries_vas_window struct Haren Myneni
2022-02-28 7:35 ` [PATCH v5 3/9] powerpc/vas: Add paste address mmap fault handler Haren Myneni
2022-02-28 17:35 ` kernel test robot
2022-02-28 7:36 ` [PATCH v5 4/9] powerpc/vas: Return paste instruction failure if no active window Haren Myneni
2022-02-28 7:41 ` Haren Myneni
2022-02-28 7:42 ` [PATCH v5 5/9] powerpc/vas: Map paste address only if window is active Haren Myneni
2022-02-28 7:42 ` [PATCH v5 6/9] powerpc/pseries/vas: Close windows with DLPAR core removal Haren Myneni
2022-02-28 7:43 ` [PATCH v5 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add Haren Myneni
2022-02-28 7:44 ` [PATCH v5 8/9] powerpc/pseries/vas: sysfs interface to export capabilities Haren Myneni
2022-02-28 7:44 ` [PATCH v5 9/9] powerpc/pseries/vas: Add 'update_total_credits' entry for QoS capabilities Haren Myneni
2022-02-28 7:47 ` [PATCH v5 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add Haren Myneni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f35fbb424668cff4e5a8eac348ad8809c3e62332.camel@linux.ibm.com \
--to=haren@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nathanl@linux.ibm.com \
--cc=npiggin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).