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 C6405A0A02; Fri, 15 Jan 2021 12:01:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B25D8140F0F; Fri, 15 Jan 2021 12:01:28 +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 1AE16140F0E for ; Fri, 15 Jan 2021 12:01:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610708486; 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: in-reply-to:in-reply-to:references:references; bh=a8fwxYeW9zQYVLC0wRzz81Au5Rk6sjdQW3Ko0G1wZLY=; b=dWO+SzAs5PvtPXls8BBaEojNimNgD5hA2Op4yM2dmo8lI6dz/W5LXz0aUW5gVUdhH4MY0w hVcNeeOxdhlDFQ9Bi+KLkPsTBJtKSRl5viAoFLyTx//l9Dvs1zjVkx6JCfSIR2ap/yDpiN E77IPui2gmxj/M21a6BPFADwSJb16c8= 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-165-YfUl-R8SM_GBU8wUiMUcLQ-1; Fri, 15 Jan 2021 06:01:25 -0500 X-MC-Unique: YfUl-R8SM_GBU8wUiMUcLQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7586C8030A0; Fri, 15 Jan 2021 11:01:23 +0000 (UTC) Received: from [10.36.110.24] (unknown [10.36.110.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FA4710074E1; Fri, 15 Jan 2021 11:01:18 +0000 (UTC) To: David Marchand Cc: dev , "Xia, Chenbo" , Olivier Matz , Adrian Moreno Zapata References: <20201220211405.313012-1-maxime.coquelin@redhat.com> <20201220211405.313012-20-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <62641a53-63e7-0a23-0dd6-1989e1f9c342@redhat.com> Date: Fri, 15 Jan 2021 12:01:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 19/40] net/virtio: move config definitions to generic header 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" On 1/6/21 5:01 PM, David Marchand wrote: > On Sun, Dec 20, 2020 at 10:15 PM Maxime Coquelin > wrote: >> diff --git a/drivers/net/virtio/virtio.h b/drivers/net/virtio/virtio.h >> index eeeb5dba4f..5169436c9f 100644 >> --- a/drivers/net/virtio/virtio.h >> +++ b/drivers/net/virtio/virtio.h >> @@ -106,6 +106,50 @@ >> #define VIRTIO_MAX_VIRTQUEUE_PAIRS 8 >> #define VIRTIO_MAX_VIRTQUEUES (VIRTIO_MAX_VIRTQUEUE_PAIRS * 2 + 1) >> >> +/* VirtIO device IDs. */ >> +#define VIRTIO_ID_NETWORK 0x01 >> +#define VIRTIO_ID_BLOCK 0x02 >> +#define VIRTIO_ID_CONSOLE 0x03 >> +#define VIRTIO_ID_ENTROPY 0x04 >> +#define VIRTIO_ID_BALLOON 0x05 >> +#define VIRTIO_ID_IOMEMORY 0x06 >> +#define VIRTIO_ID_9P 0x09 >> + >> +/* Status byte for guest to report progress. */ >> +#define VIRTIO_CONFIG_STATUS_RESET 0x00 >> +#define VIRTIO_CONFIG_STATUS_ACK 0x01 >> +#define VIRTIO_CONFIG_STATUS_DRIVER 0x02 >> +#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04 >> +#define VIRTIO_CONFIG_STATUS_FEATURES_OK 0x08 >> +#define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET 0x40 >> +#define VIRTIO_CONFIG_STATUS_FAILED 0x80 >> + >> +/* >> + * This structure is just a reference to read >> + * net device specific config space; it just a chodu structure > > chodu ? :-) I guess shadow was meant here, given the start of the sentence. Will fix it. >> + * >> + */ >> +struct virtio_net_config { >> + /* The config defining mac address (if VIRTIO_NET_F_MAC) */ >> + uint8_t mac[RTE_ETHER_ADDR_LEN]; >> + /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ >> + uint16_t status; >> + uint16_t max_virtqueue_pairs; >> + uint16_t mtu; >> + /* >> + * speed, in units of 1Mb. All values 0 to INT_MAX are legal. >> + * Any other value stands for unknown. >> + */ >> + uint32_t speed; >> + /* >> + * 0x00 - half duplex >> + * 0x01 - full duplex >> + * Any other value stands for unknown. >> + */ >> + uint8_t duplex; >> + >> +} __rte_packed; >> + >> struct virtio_hw { >> struct virtqueue **vqs; >> uint64_t guest_features; >> @@ -159,7 +203,7 @@ struct virtio_ops { >> /* >> * While virtio_hw is stored in shared memory, this structure stores >> * some infos that may vary in the multiple process model locally. >> - * For example, the vtpci_ops pointer. >> + * For example, the virtio_ops pointer. > > It should be in a previous patch (I suggested removing this comment earlier). Yes, I guess it was squashed here by mistake during a rebase. I didn't remove the comment