All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Adds virtio_net as the default netcard for boston board
@ 2019-04-01  5:25 Tommy Jin
  2019-04-01  5:26 ` [Qemu-devel] [PATCH] " Tommy Jin
  0 siblings, 1 reply; 3+ messages in thread
From: Tommy Jin @ 2019-04-01  5:25 UTC (permalink / raw)
  To: qemu-devel

Hi,

This is a patch for Mips Boston board.
Currently, Boston didn't bring up any netcard by default, this is not so convenient for users who are verifying network related functionalities on this board.
As the linux kernel has already supported virtio_net, now add a virtio netcard for boston, to make virtio work properly, please:
1. set virtio net options in linux kernel, saying CONFIG_VIRTIO && CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET
2. specify model=virtio when you start boston in qemu.

Best regards,
Tommy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH] Adds virtio_net as the default netcard for boston board
  2019-04-01  5:25 [Qemu-devel] Adds virtio_net as the default netcard for boston board Tommy Jin
@ 2019-04-01  5:26 ` Tommy Jin
  2019-04-01  9:22   ` no-reply
  0 siblings, 1 reply; 3+ messages in thread
From: Tommy Jin @ 2019-04-01  5:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Tommy Jin

Boston didn't bring up any netcard by default, this is not so convenient.
As the linux kernel has supported virtio_net, now add a virtio netcard for boston.
To make virtio work properly, please:
1. set virtio net options in linux kernel, saying CONFIG_VIRTIO && CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET
2. specify model=virtio when you start netcard in qemu.

Signed-off-by: tjin <tjin@wavecomp.com>
---
 hw/mips/boston.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index e5bab3c..930bb9d 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -32,6 +32,7 @@
 #include "hw/mips/cps.h"
 #include "hw/mips/cpudevs.h"
 #include "hw/pci-host/xilinx-pcie.h"
+#include "hw/virtio/virtio-pci.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/log.h"
@@ -422,6 +423,20 @@ xilinx_pcie_init(MemoryRegion *sys_mem, uint32_t bus_nr,
     return XILINX_PCIE_HOST(dev);
 }
 
+/* Plug network card  in pcie slot.*/
+static void network_init(PCIBus *bus)
+{
+	PCIDevice *eth;
+
+	/*Please set CONFIG_VIRTIO && CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET
+	of Linux kernel.*/
+	eth = pci_create(bus,
+					 PCI_DEVFN(0, 1), "virtio-net-pci");
+
+	qdev_set_nic_properties(&eth->qdev, &nd_table[0]);
+	qdev_init_nofail(&eth->qdev);
+}
+
 static void boston_mach_init(MachineState *machine)
 {
     DeviceState *dev;
@@ -545,6 +560,9 @@ static void boston_mach_init(MachineState *machine)
         error_printf("Please provide either a -kernel or -bios argument\n");
         exit(1);
     }
+
+	/* Network card */
+	network_init(&PCI_BRIDGE(&pcie2->root)->sec_bus);
 }
 
 static void boston_mach_class_init(MachineClass *mc)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Adds virtio_net as the default netcard for boston board
  2019-04-01  5:26 ` [Qemu-devel] [PATCH] " Tommy Jin
@ 2019-04-01  9:22   ` no-reply
  0 siblings, 0 replies; 3+ messages in thread
From: no-reply @ 2019-04-01  9:22 UTC (permalink / raw)
  To: tjin; +Cc: fam, qemu-devel

Patchew URL: https://patchew.org/QEMU/1554096222-29539-2-git-send-email-tjin@wavecomp.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 1554096222-29539-2-git-send-email-tjin@wavecomp.com
Subject: [Qemu-devel] [PATCH] Adds virtio_net as the default netcard for boston board
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/1554096222-29539-2-git-send-email-tjin@wavecomp.com -> patchew/1554096222-29539-2-git-send-email-tjin@wavecomp.com
Switched to a new branch 'test'
ec8fb94aea Adds virtio_net as the default netcard for boston board

=== OUTPUT BEGIN ===
ERROR: code indent should never use tabs
#35: FILE: hw/mips/boston.c:429:
+^IPCIDevice *eth;$

ERROR: code indent should never use tabs
#37: FILE: hw/mips/boston.c:431:
+^I/*Please set CONFIG_VIRTIO && CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET$

WARNING: Block comments use a leading /* on a separate line
#37: FILE: hw/mips/boston.c:431:
+       /*Please set CONFIG_VIRTIO && CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET

ERROR: code indent should never use tabs
#38: FILE: hw/mips/boston.c:432:
+^Iof Linux kernel.*/$

WARNING: Block comments use * on subsequent lines
#38: FILE: hw/mips/boston.c:432:
+       /*Please set CONFIG_VIRTIO && CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET
+       of Linux kernel.*/

WARNING: Block comments use a trailing */ on a separate line
#38: FILE: hw/mips/boston.c:432:
+       of Linux kernel.*/

ERROR: code indent should never use tabs
#39: FILE: hw/mips/boston.c:433:
+^Ieth = pci_create(bus,$

ERROR: code indent should never use tabs
#40: FILE: hw/mips/boston.c:434:
+^I^I^I^I^I PCI_DEVFN(0, 1), "virtio-net-pci");$

ERROR: code indent should never use tabs
#42: FILE: hw/mips/boston.c:436:
+^Iqdev_set_nic_properties(&eth->qdev, &nd_table[0]);$

ERROR: code indent should never use tabs
#43: FILE: hw/mips/boston.c:437:
+^Iqdev_init_nofail(&eth->qdev);$

ERROR: code indent should never use tabs
#54: FILE: hw/mips/boston.c:564:
+^I/* Network card */$

ERROR: code indent should never use tabs
#55: FILE: hw/mips/boston.c:565:
+^Inetwork_init(&PCI_BRIDGE(&pcie2->root)->sec_bus);$

total: 9 errors, 3 warnings, 36 lines checked

Commit ec8fb94aeabb (Adds virtio_net as the default netcard for boston board) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/1554096222-29539-2-git-send-email-tjin@wavecomp.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-01  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01  5:25 [Qemu-devel] Adds virtio_net as the default netcard for boston board Tommy Jin
2019-04-01  5:26 ` [Qemu-devel] [PATCH] " Tommy Jin
2019-04-01  9:22   ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.