From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6FD7FA054F; Tue, 16 Mar 2021 10:38:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 58C232428F7; Tue, 16 Mar 2021 10:38:41 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 4A0062428D4 for ; Tue, 16 Mar 2021 10:38:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615887518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RDDfKrC52RGU2DYR8fL05Q/+jiil7Zsn/JMKPUCJcq0=; b=ZRozl/fbfbTXrpzAjdP9YIbn7czNYH0IKKr6bTgNov6vJpJNFpYV3fsY93jw91Hidg9F81 FvtGcN+Lx9LprwrEiBqBu5HXNHc06wVkA5/6ly+AiGbtJDfjeIQhhUHCArVrEWLqv/fPy1 Qy5JsDhuckvgM7Sp+UyTeEbQ3gSWRRk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-35-IlkuVZP7Osi3f96bG6NNvQ-1; Tue, 16 Mar 2021 05:38:36 -0400 X-MC-Unique: IlkuVZP7Osi3f96bG6NNvQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BEFC3100C665; Tue, 16 Mar 2021 09:38:35 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id D683D60C0F; Tue, 16 Mar 2021 09:38:27 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com, david.marchand@redhat.com, olivier.matz@6wind.com, bnemeth@redhat.com Cc: Maxime Coquelin Date: Tue, 16 Mar 2021 10:38:21 +0100 Message-Id: <20210316093825.478723-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH v4 0/4] net/virtio: make virtqueue struct cache-friendly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This series optimizes the cache usage of virtqueue struct, by making a "fake" mbuf being dynamically allocated in Rx virtnet struct, by removing a useless virtuque pointer into the virtnet structs and by moving a few fields to pack holes. With these 3 patches, the virtqueue struct size goes from 576 bytes (9 cachelines) to 248 bytes (4 cachelines). Changes in v4: ============== - Fix ARM build failure after rebase (0-day robot) - Fix fake_mbuf freeing (David) - Applied David R-by Changes in v3: ============== - Use rte_zmalloc_socket for fake mbuf alloc (David) - Fix typos in commit messages - Remove superfluous pointer check befor freeing (David) - Fix checkpatch warnings Changes in v2: ============== - Rebase on latest main - Improve error path in virtio_init_queue - Fix various typos in commit messages Maxime Coquelin (4): net/virtio: remove reference to virtqueue in vrings net/virtio: improve queue init error path net/virtio: allocate fake mbuf in Rx queue net/virtio: pack virtqueue struct drivers/net/virtio/virtio_ethdev.c | 64 +++++++++++-------- drivers/net/virtio/virtio_rxtx.c | 37 +++++------ drivers/net/virtio/virtio_rxtx.h | 5 +- drivers/net/virtio/virtio_rxtx_packed.c | 4 +- drivers/net/virtio/virtio_rxtx_packed.h | 6 +- drivers/net/virtio/virtio_rxtx_packed_avx.h | 4 +- drivers/net/virtio/virtio_rxtx_packed_neon.h | 4 +- drivers/net/virtio/virtio_rxtx_simple.h | 2 +- .../net/virtio/virtio_rxtx_simple_altivec.c | 2 +- drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +- drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +- .../net/virtio/virtio_user/virtio_user_dev.c | 4 +- drivers/net/virtio/virtio_user_ethdev.c | 2 +- drivers/net/virtio/virtqueue.h | 24 ++++--- 14 files changed, 87 insertions(+), 75 deletions(-) -- 2.29.2