Skip to content

Commit 3317785

Browse files
hfreudehcahca
authored andcommitted
s390/ap: Fix wrong APQN fill calculation
The upper limit of the firmware queue fill state for each APQN is reported by the hwinfo.qd field. This field shows the numbers 0-7 for 1-8 queue spaces available. But the exploiting code assumed the real boundary is stored there and thus stoppes queuing in messages one tick too early. Correct the limit calculation and thus offer a boost of 12.5% performance for high traffic on one APQN. Fixes: d4c53ae ("s390/ap: store TAPQ hwinfo in struct ap_card") Cc: stable@vger.kernel.org Reported-by: Ingo Franzki <ifranzki@linux.ibm.com> Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent d045e16 commit 3317785

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/s390/crypto/ap_card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static ssize_t depth_show(struct device *dev, struct device_attribute *attr,
4343
{
4444
struct ap_card *ac = to_ap_card(dev);
4545

46-
return sysfs_emit(buf, "%d\n", ac->hwinfo.qd);
46+
return sysfs_emit(buf, "%d\n", ac->hwinfo.qd + 1);
4747
}
4848

4949
static DEVICE_ATTR_RO(depth);

drivers/s390/crypto/ap_queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static enum ap_sm_wait ap_sm_write(struct ap_queue *aq)
285285
list_move_tail(&ap_msg->list, &aq->pendingq);
286286
aq->requestq_count--;
287287
aq->pendingq_count++;
288-
if (aq->queue_count < aq->card->hwinfo.qd) {
288+
if (aq->queue_count < aq->card->hwinfo.qd + 1) {
289289
aq->sm_state = AP_SM_STATE_WORKING;
290290
return AP_SM_WAIT_AGAIN;
291291
}

0 commit comments

Comments
 (0)