From patchwork Mon Jun 26 05:17:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shilpasri G Bhat X-Patchwork-Id: 780582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wwy4l70RLz9s81 for ; Mon, 26 Jun 2017 15:18:15 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wwy4l6BSMzDr2P for ; Mon, 26 Jun 2017 15:18:15 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wwy4S4SVTzDqjJ for ; Mon, 26 Jun 2017 15:18:00 +1000 (AEST) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v5Q5E00f080789 for ; Mon, 26 Jun 2017 01:17:57 -0400 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by mx0b-001b2d01.pphosted.com with ESMTP id 2bauhmgsx3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 26 Jun 2017 01:17:57 -0400 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 26 Jun 2017 15:17:54 +1000 Received: from d23relay07.au.ibm.com (202.81.31.226) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 26 Jun 2017 15:17:53 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v5Q5HqNm62783506 for ; Mon, 26 Jun 2017 15:17:52 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v5Q5Hol9005881 for ; Mon, 26 Jun 2017 15:17:50 +1000 Received: from oc4502181600.ibm.com ([9.195.41.67]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v5Q5HiV3005690; Mon, 26 Jun 2017 15:17:48 +1000 From: Shilpasri G Bhat To: skiboot@lists.ozlabs.org, cyrilbur@gmail.com, oohall@gmail.com Date: Mon, 26 Jun 2017 10:47:31 +0530 X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1498454253-5383-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> References: <1498454253-5383-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17062605-1617-0000-0000-000001EBCE19 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17062605-1618-0000-0000-000048332767 Message-Id: <1498454253-5383-2-git-send-email-shilpa.bhat@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-26_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706260089 Subject: [Skiboot] [PATCH V3 1/3] opal-msg: Add support to increase async completions and msg_free_list X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ego@linux.vnet.ibm.com MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Add support to increase the maximum async completions passed to kernel and also add helpers to increase the pre-allocation of free buffers in msg_free_list. Signed-off-by: Shilpasri G Bhat --- core/init.c | 2 ++ core/opal-msg.c | 22 ++++++++++++++++++++-- core/opal.c | 1 - include/opal-msg.h | 3 +++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/core/init.c b/core/init.c index b5f4f3d..3eb25d8 100644 --- a/core/init.c +++ b/core/init.c @@ -1044,6 +1044,8 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt) prd_register_reserved_memory(); + add_dt_max_async_completions(); + load_and_boot_kernel(false); } diff --git a/core/opal-msg.c b/core/opal-msg.c index 1971467..0ac891d 100644 --- a/core/opal-msg.c +++ b/core/opal-msg.c @@ -19,9 +19,12 @@ #include #include #include +#include #define OPAL_MAX_MSGS (OPAL_MSG_TYPE_MAX + OPAL_MAX_ASYNC_COMP - 1) +static int max_async_comp; + struct opal_msg_entry { struct list_node link; void (*consumed)(void *data); @@ -149,12 +152,12 @@ static int64_t opal_check_completion(uint64_t *buffer, uint64_t size, } opal_call(OPAL_CHECK_ASYNC_COMPLETION, opal_check_completion, 3); -void opal_init_msg(void) +void alloc_opal_msg_list(int num) { struct opal_msg_entry *entry; int i; - for (i = 0; i < OPAL_MAX_MSGS; i++, entry++) { + for (i = 0; i < num; i++, entry++) { entry = zalloc(sizeof(*entry)); if (!entry) goto err; @@ -170,3 +173,18 @@ err: } } +void add_dt_max_async_completions(void) +{ + dt_add_property_cells(opal_node, "opal-msg-async-num", max_async_comp); +} + +void update_max_async_completions(int num) +{ + max_async_comp += num; +} + +void opal_init_msg(void) +{ + max_async_comp = OPAL_MAX_ASYNC_COMP; + alloc_opal_msg_list(OPAL_MAX_MSGS); +} diff --git a/core/opal.c b/core/opal.c index 14357cc..a48c9a7 100644 --- a/core/opal.c +++ b/core/opal.c @@ -201,7 +201,6 @@ void add_opal_node(void) else dt_add_property_strings(opal_node, "compatible", "ibm,opal-v3"); - dt_add_property_cells(opal_node, "opal-msg-async-num", OPAL_MAX_ASYNC_COMP); dt_add_property_cells(opal_node, "opal-msg-size", sizeof(struct opal_msg)); dt_add_property_u64(opal_node, "opal-base-address", base); dt_add_property_u64(opal_node, "opal-entry-address", entry); diff --git a/include/opal-msg.h b/include/opal-msg.h index a75bc4e..982026e 100644 --- a/include/opal-msg.h +++ b/include/opal-msg.h @@ -37,5 +37,8 @@ int _opal_queue_msg(enum opal_msg_type msg_type, void *data, (u64[]) {__VA_ARGS__}); void opal_init_msg(void); +void alloc_opal_msg_list(int num); +void update_max_async_completions(int num); +void add_dt_max_async_completions(void); #endif /* __OPALMSG_H */