All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, frankja@linux.ibm.com,
	david@redhat.com, cohuck@redhat.com, drjones@redhat.com
Subject: Re: [kvm-unit-tests PATCH v13 9/9] s390x: css: ssch/tsch with sense and interrupt
Date: Thu, 16 Jul 2020 10:58:06 +0200	[thread overview]
Message-ID: <83702244-22df-35c9-4154-7f6113e4393d@linux.ibm.com> (raw)
In-Reply-To: <d60336e9-9038-89b3-f1d6-82c9ee4b3aaa@redhat.com>



On 2020-07-16 10:46, Thomas Huth wrote:
> On 16/07/2020 10.23, Pierre Morel wrote:
>> After a channel is enabled we start a SENSE_ID command using
>> the SSCH instruction to recognize the control unit and device.
>>
>> This tests the success of SSCH, the I/O interruption and the TSCH
>> instructions.
>>
>> The SENSE_ID command response is tested to report 0xff inside
>> its reserved field and to report the same control unit type
>> as the cu_type kernel argument.
>>
>> Without the cu_type kernel argument, the test expects a device
>> with a default control unit type of 0x3832, a.k.a virtio-net-ccw.
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
> [...]
>> +/*
>> + * css_residual_count
>> + * Return the residual count, if it is valid.
>> + *
>> + * Return value:
>> + * Success: the residual count
>> + * Not meaningful: -1 (-1 can not be a valid count)
>> + */
>> +int css_residual_count(unsigned int schid)
>> +{
>> +
>> +	if (!(irb.scsw.ctrl & (SCSW_SC_PENDING | SCSW_SC_PRIMARY)))
>> +		goto invalid;
>> +
>> +	if (irb.scsw.dev_stat)
>> +		if (irb.scsw.sch_stat & ~(SCSW_SCHS_PCI | SCSW_SCHS_IL))
>> +			goto invalid;
>> +
>> +	return irb.scsw.count;
>> +
>> +invalid:
>> +	return -1;
>> +}
> 
> I still think this would look nicer without gotos. Anyway,

You are right.
Thanks to let me modify this later.

> 
> Acked-by: Thomas Huth <thuth@redhat.com>
> 

Thanks,
Pierre

-- 
Pierre Morel
IBM Lab Boeblingen

  reply	other threads:[~2020-07-16  8:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  8:23 [kvm-unit-tests PATCH v13 0/9] s390x: Testing the Channel Subsystem I/O Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 1/9] s390x: saving regs for interrupts Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 2/9] s390x: I/O interrupt registration Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 3/9] s390x: export the clock get_clock_ms() utility Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 4/9] s390x: clock and delays calculations Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 5/9] s390x: define function to wait for interrupt Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 6/9] s390x: Library resources for CSS tests Pierre Morel
2020-07-16 11:15   ` Janosch Frank
2020-07-16 11:27     ` Pierre Morel
2020-07-16 11:31       ` Janosch Frank
2020-07-16 13:02         ` [PATCH v14 " Pierre Morel
2020-07-16 13:02           ` [PATCH v14 7/9] s390x: css: stsch, enumeration test Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 " Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 8/9] s390x: css: msch, enable test Pierre Morel
2020-07-16  8:23 ` [kvm-unit-tests PATCH v13 9/9] s390x: css: ssch/tsch with sense and interrupt Pierre Morel
2020-07-16  8:46   ` Thomas Huth
2020-07-16  8:58     ` Pierre Morel [this message]
2020-07-16 13:04     ` [PATCH v14 " Pierre Morel
2020-07-16  9:07   ` [kvm-unit-tests PATCH v13 " Cornelia Huck
2020-07-21 13:11 ` [kvm-unit-tests PATCH v13 0/9] s390x: Testing the Channel Subsystem I/O Janosch Frank

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=83702244-22df-35c9-4154-7f6113e4393d@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=drjones@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.