Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp583imm; Tue, 10 Jul 2018 19:29:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcu2dXw5Ou5euNrJ/lkpYM4ncQYYqeZ3ogzChAxLjkgW9tb6BsAOzgnkJTruFuvJi68pORg X-Received: by 2002:a62:6882:: with SMTP id d124-v6mr28045063pfc.122.1531276155274; Tue, 10 Jul 2018 19:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531276155; cv=none; d=google.com; s=arc-20160816; b=Et1c0VcwwWe3sNyjHyeMpJoFxUKHqnPhL6uCikS4Ev5tcOcQhXLTgJTXokh9lLs+qf kNCF2RALoVPuUdAmDn35ICQ9W4jSBsyMqyzMqTTbKyqQtFCRrjDcsemeyKlksix/ke5m alabLfR4mgj+9BJG4VNFjh8i65CHUv8TRFwG3UYVkzzUeCaKHwOIoTAGTFOrsOexJjtX RLLUEBd36Vr55CNfD4bv6RYIuDmA4jmGEOcqf/xJ7TYSSx8swvrb3Lfx2eWdT3GezR0o m2yjCtPGBRTfN/dZfVKWs4bA5fU3TYaFUloI3jU/GozzP8MRKv2TTr9RkyjCgZDqBw6/ q6JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=v622dN1D1RylS69Y6PZje0iR3mqdaJQt+B3Ui6CBEXg=; b=Ug7sXW1YuPV8wRhVOLThJ72A2qJOYRjAirbqS15wlTOyT/Wcv+tjbVwrUX6ZFLzSk0 8U8W0RlAL85oSAQUobf8WD6Tx5RG8DTiiFfTj7Bxozfvym9KRSmMqhfe5sz2NSafNHh2 qfJ2yv+hDMSwwj/5o3fwXZE2rZnGNamemC4RsA5gDHhfBMVfZiPhcUdZ5bm6qxvPIuLw zNLv3r6Yez3aVq2Wm9V9uUZ0pRs7J63oaxxuEnZavkif3IV4oYuf5ufF5h9VlcpH3O7q yCylI1EIAb7gvT/fYZMEwDe+60VV8w6w8sGETVRl8F7I/Axq2dsVjeKSVEILY41z3xWF Bdbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d35-v6si18405685pla.116.2018.07.10.19.29.00; Tue, 10 Jul 2018 19:29:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732846AbeGKC3n (ORCPT + 99 others); Tue, 10 Jul 2018 22:29:43 -0400 Received: from mga11.intel.com ([192.55.52.93]:24665 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732726AbeGKC3l (ORCPT ); Tue, 10 Jul 2018 22:29:41 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 19:27:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,336,1526367600"; d="scan'208";a="71744506" Received: from debian.sh.intel.com ([10.67.104.228]) by orsmga001.jf.intel.com with ESMTP; 10 Jul 2018 19:27:42 -0700 From: Tiwei Bie To: mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, virtio-dev@lists.oasis-open.org Cc: wexu@redhat.com, jfreimann@redhat.com, tiwei.bie@intel.com Subject: [PATCH net-next v2 5/5] virtio_ring: enable packed ring Date: Wed, 11 Jul 2018 10:27:11 +0800 Message-Id: <20180711022711.7090-6-tiwei.bie@intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180711022711.7090-1-tiwei.bie@intel.com> References: <20180711022711.7090-1-tiwei.bie@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Tiwei Bie --- drivers/s390/virtio/virtio_ccw.c | 14 ++++++++++++++ drivers/virtio/virtio_ring.c | 2 ++ 2 files changed, 16 insertions(+) diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index 8f5c1d7f751a..8654f3a94635 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c @@ -765,6 +765,17 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev) return rc; } +static void ccw_transport_features(struct virtio_device *vdev) +{ + /* + * Packed ring isn't enabled on virtio_ccw for now, + * because virtio_ccw uses some legacy accessors, + * e.g. virtqueue_get_avail() and virtqueue_get_used() + * which aren't available in packed ring currently. + */ + __virtio_clear_bit(vdev, VIRTIO_F_RING_PACKED); +} + static int virtio_ccw_finalize_features(struct virtio_device *vdev) { struct virtio_ccw_device *vcdev = to_vc_device(vdev); @@ -791,6 +802,9 @@ static int virtio_ccw_finalize_features(struct virtio_device *vdev) /* Give virtio_ring a chance to accept features. */ vring_transport_features(vdev); + /* Give virtio_ccw a chance to accept features. */ + ccw_transport_features(vdev); + features->index = 0; features->features = cpu_to_le32((u32)vdev->features); /* Write the first half of the feature bits to the host. */ diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index f79a1e17f7d1..807ed4b362c5 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1968,6 +1968,8 @@ void vring_transport_features(struct virtio_device *vdev) break; case VIRTIO_F_IOMMU_PLATFORM: break; + case VIRTIO_F_RING_PACKED: + break; default: /* We don't understand this bit. */ __virtio_clear_bit(vdev, i); -- 2.18.0