Commit 38a22db9 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

rte_virtio: remove virtio_pci.h



virtio_hw struct definition is now hidden
in virtio_pci.c. The API to enumerate all
PCI devices is available through virtio_dev.h.

Change-Id: Ib9c968732d9f78204e9664c426ad99542cfe8c93
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/385425


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f69d819f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1081,7 +1081,7 @@ bdev_virtio_process_config(void)

	enable_pci = spdk_conf_section_get_boolval(sp, "Enable", false);
	if (enable_pci) {
		rc = vtpci_enumerate_pci();
		rc = virtio_enumerate_pci();
	}

out:
+5 −0
Original line number Diff line number Diff line
@@ -379,6 +379,11 @@ vtpci_with_feature(struct virtio_dev *dev, uint64_t bit)

void vtpci_dump_json_config(struct virtio_dev *hw, struct spdk_json_write_ctx *w);

/**
 * Init all compatible Virtio PCI devices.
 */
int virtio_enumerate_pci(void);

extern const struct virtio_pci_ops virtio_user_ops;

#endif /* _VIRTIO_DEV_H_ */
+21 −2
Original line number Diff line number Diff line
@@ -39,7 +39,26 @@
#include "spdk/string.h"
#include "spdk/env.h"

#include "virtio_pci.h"
#include "virtio_dev.h"

struct virtio_hw {
	uint8_t	    use_msix;
	uint32_t    notify_off_multiplier;
	uint8_t     *isr;
	uint16_t    *notify_base;

	struct {
		/** Mem-mapped resources from given PCI BAR */
		void        *vaddr;

		/** Length of the address space */
		uint32_t    len;
	} pci_bar[6];

	struct virtio_pci_common_cfg *common_cfg;
	struct spdk_pci_device *pci_dev;
	struct virtio_scsi_config *dev_cfg;
};

/*
 * Following macros are derived from linux/pci_regs.h, however,
@@ -472,7 +491,7 @@ err:
}

int
vtpci_enumerate_pci(void)
virtio_enumerate_pci(void)
{
	if (!spdk_process_is_primary()) {
		SPDK_WARNLOG("virtio_pci secondary process support is not implemented yet.\n");
+0 −67
Original line number Diff line number Diff line
/*-
 *   BSD LICENSE
 *
 *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
 *   All rights reserved.
 *
 *   Redistribution and use in source and binary forms, with or without
 *   modification, are permitted provided that the following conditions
 *   are met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in
 *       the documentation and/or other materials provided with the
 *       distribution.
 *     * Neither the name of Intel Corporation nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _VIRTIO_PCI_H_
#define _VIRTIO_PCI_H_

#include "spdk/stdinc.h"

#include "virtio_dev.h"

struct virtqueue;

struct virtio_hw {
	uint8_t	    use_msix;
	uint32_t    notify_off_multiplier;
	uint8_t     *isr;
	uint16_t    *notify_base;

	struct {
		/** Mem-mapped resources from given PCI BAR */
		void        *vaddr;

		/** Length of the address space */
		uint32_t    len;
	} pci_bar[6];

	struct virtio_pci_common_cfg *common_cfg;
	struct spdk_pci_device *pci_dev;
	struct virtio_scsi_config *dev_cfg;
};

/**
 * Init all compatible Virtio PCI devices.
 */
int vtpci_enumerate_pci(void);

#endif /* _VIRTIO_PCI_H_ */
+0 −1
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@
#include <rte_alarm.h>

#include "virtio_dev.h"
#include "virtio_pci.h"
#include "virtio_user/virtio_user_dev.h"

#include "spdk/string.h"
Loading