From patchwork Tue Dec 4 00:48:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bijan Mottahedeh X-Patchwork-Id: 10710989 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F55013BF for ; Tue, 4 Dec 2018 00:48:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B21F2A88F for ; Tue, 4 Dec 2018 00:48:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DF452A997; Tue, 4 Dec 2018 00:48:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B06D92A88F for ; Tue, 4 Dec 2018 00:48:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726070AbeLDAsm (ORCPT ); Mon, 3 Dec 2018 19:48:42 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:60788 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbeLDAsl (ORCPT ); Mon, 3 Dec 2018 19:48:41 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB40ingK103467; Tue, 4 Dec 2018 00:48:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=/rwltnG7kj227cxEe70Z4/S1eSDsZpk/GYgpKfKkMbc=; b=Bl06kN6xDMzdnQ8CjqtEtZp/iyjWhWs5q5XqdI47zU+oK31IhNizYmNvcXoPYqbJ4oan +wjL/4b6L22fzgGzBUDbw/ssTgI45EpRGR2RYQgLOnvwW38e1F1OLRGE0QYsTb8w+Vg/ XYKpXP+WvcdkCD/rrgGIqc8MQ82XT89rJPkPmUsU95ev6g4zADq4B8yH9hpL21SEg35K giyaig6TRh4ykv8ZRrVZ6THbGnDLsLGEp3e3uggCqb9p6JeixEp4PORnqfbD69ZLFLjS phfDM334sNmBnJZTzwpjWZJk0Ol+t0VI554DZQSi+YeBgcmCf8uEQTxfSJxXDJU0VHmr ag== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2p3j8q9k6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Dec 2018 00:48:38 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wB40mXFM027808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Dec 2018 00:48:33 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wB40mWCf001236; Tue, 4 Dec 2018 00:48:32 GMT Received: from ca-ldom147.us.oracle.com (/10.129.68.131) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 03 Dec 2018 16:48:31 -0800 From: Bijan Mottahedeh To: kvm@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com Cc: jasowang@redhat.com, silviu.smarandache@oracle.com, bijan.mottahedeh@oracle.com Subject: [PATCH v2 0/4] vhost/scsi: Respond to control queue operations Date: Mon, 3 Dec 2018 16:48:19 -0800 Message-Id: <1543884503-32281-1-git-send-email-bijan.mottahedeh@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9096 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=6 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=6 mlxscore=6 mlxlogscore=121 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812040003 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP v1 -> v2: - Use copy_to_iter() to send control queue response This patch series causes vhost-scsi control queue TMF requests to be explicitly rejected rather than implicitly ignored in order to prevent a guest virito-scsi driver to wait indefinitely for a response to a SCSI TMF request. In addition, control queue address notification operations (VIRTIO_SCSI_T_AN_*) get an effective no-op response. Patch 1/4 implements a control queue handler modeled after the existing request queue handler. There is no commonality between the two handlers. Patch 2/4 factors out the common processing code from the control queue handler into separate routines. Patch 3/4 modifies the request handler to use the common processing routines. Patch 4/4 uses copy_to_iter() to send back control queue responses. Bijan Mottahedeh (4): vhost/scsi: Respond to control queue operations vhost/scsi: Extract common handling code from control queue handler vhost/scsi: Use common handling code in request queue handler vhost/scsi: Use copy_to_iter() to send control queue response drivers/vhost/scsi.c | 426 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 330 insertions(+), 96 deletions(-)