All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Pankaj Chauhan <pankaj.chauhan@nxp.com>
Cc: dev@dpdk.org, hemant.agrawal@nxp.com, jianfeng.tan@intel.com,
	maxime.coquelin@redhat.com,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Subject: Re: [RFC][PATCH V2 1/3] examples/vhost: Add vswitch (generic switch) framework
Date: Sun, 11 Sep 2016 20:21:42 +0800	[thread overview]
Message-ID: <20160911122142.GY23158@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <1473072871-16108-2-git-send-email-pankaj.chauhan@nxp.com>

On Mon, Sep 05, 2016 at 04:24:29PM +0530, Pankaj Chauhan wrote:
> Introduce support for a generic framework for handling of switching between
> physical and vhost devices. The vswitch framework introduces the following
> concept:
> 
> 1. vswitch_dev: Vswitch device is a logical switch which can have physical and
> virtio devices. The devices are operated/used using standard rte_eth API for
> physical devices and lib_vhost API for vhost devices, PMD API is not used
> for vhost devices.
> 
> 2. vswitch_port: Any physical or virtio device that is added to vswitch. The
> port can have its own tx/rx functions for doing data transfer, which are exposed
> to the framework using generic function pointers (vs_port->do_tx/do_rx). This way
> the generic code can do tx/rx without understanding the type of device (Physical or
> virtio). Similarly each port has its own functions to select tx/rx queues. The framework
> provides default tx/rx queue selection functions to the port when port is added
> (for both physical and vhost devices). But the framework allows the switch implementation
> to override the queue selection functions (vs_port->get_txq/rxq) if required.
> 
> 3. vswitch_ops: The ops is set of function pointers which are used to do operations
> like learning, unlearning, add/delete port, lookup_and_forward. The user of vswitch
> framework (vhost/main.[c,h])uses these function pointers to perform above mentioned
> operations, thus it remains agnostic of the underlying implementation.
> 
> Different switching logics can implement their vswitch_device and vswitch_ops, and
> register with the framework. This framework makes vhost-switch application scalable
> in terms of:
> 
> 1. Different switching logics (one of them is vmdq, vhost/vmdq.[c,h]
> 2. Number of ports.
> 3. Policies of selecting ports for rx and tx.
> 
> Signed-off-by: Pankaj Chauhan <pankaj.chauhan@nxp.com>

Hi,

FYI, my testrobot caught some errors when this patch is applied.
(And sorry for the late review; hopefully I can make it next week).

        --yliu

---
examples/vhost/main.c: In function 'virtio_xmit':
examples/vhost/main.c:815:41: error: 'struct vhost_dev' has no member named 'vs_port'
  struct vswitch_port *vs_port = dst_vdev->vs_port;
                                         ^
examples/vhost/main.c:822:15: error: dereferencing pointer to incomplete type 'struct vswitch_port'
  txq = vs_port->get_txq(vs_port, rte_lcore_id());
               ^
examples/vhost/main.c: In function 'do_drain_mbuf_table':
examples/vhost/main.c:952:12: error: implicit declaration of function 'vs_sched_tx_port' [-Werror=implicit-function-declaration]
  tx_port = vs_sched_tx_port(vswitch_dev_g, VSWITCH_PTYPE_PHYS,
            ^
examples/vhost/main.c:952:2: error: nested extern declaration of 'vs_sched_tx_port' [-Werror=nested-externs]
  tx_port = vs_sched_tx_port(vswitch_dev_g, VSWITCH_PTYPE_PHYS,
  ^
examples/vhost/main.c:952:29: error: 'vswitch_dev_g' undeclared (first use in this function)
  tx_port = vs_sched_tx_port(vswitch_dev_g, VSWITCH_PTYPE_PHYS,
                             ^
examples/vhost/main.c:952:29: note: each undeclared identifier is reported only once for each function it appears in
examples/vhost/main.c:952:44: error: 'VSWITCH_PTYPE_PHYS' undeclared (first use in this function)
  tx_port = vs_sched_tx_port(vswitch_dev_g, VSWITCH_PTYPE_PHYS,
                                            ^
examples/vhost/main.c:958:18: error: dereferencing pointer to incomplete type 'struct vswitch_port'
   count = tx_port->do_tx(tx_port, tx_q->txq_id, NULL, tx_q->m_table,
                  ^
examples/vhost/main.c:955:6: error: label 'out' used but not defined
      goto out;
      ^
examples/vhost/main.c: In function 'drain_eth_rx':
examples/vhost/main.c:1096:12: error: implicit declaration of function 'vs_sched_rx_port' [-Werror=implicit-function-declaration]
  rx_port = vs_sched_rx_port(vswitch_dev_g, VSWITCH_PTYPE_PHYS,
            ^
examples/vhost/main.c:1096:2: error: nested extern declaration of 'vs_sched_rx_port' [-Werror=nested-externs]
  rx_port = vs_sched_rx_port(vswitch_dev_g, VSWITCH_PTYPE_PHYS,
  ^
examples/vhost/main.c:1096:29: error: 'vswitch_dev_g' undeclared (first use in this function)
  rx_port = vs_sched_rx_port(vswitch_dev_g, VSWITCH_PTYPE_PHYS,
                             ^
examples/vhost/main.c:1096:44: error: 'VSWITCH_PTYPE_PHYS' undeclared (first use in this function)
  rx_port = vs_sched_rx_port(vswitch_dev_g, VSWITCH_PTYPE_PHYS,
                                            ^
examples/vhost/main.c:1105:15: error: dereferencing pointer to incomplete type 'struct vswitch_port'
  rxq = rx_port->get_rxq(rx_port, vdev, core_id);
               ^
examples/vhost/main.c:1099:6: error: label 'out' used but not defined
      goto out;
      ^
examples/vhost/main.c: In function 'drain_virtio_tx':
examples/vhost/main.c:1145:37: error: 'struct vhost_dev' has no member named 'vs_port'
  struct vswitch_port *vs_port = vdev->vs_port;
                                     ^
examples/vhost/main.c:1154:15: error: dereferencing pointer to incomplete type 'struct vswitch_port'
  rxq = vs_port->get_rxq(vs_port, NULL, core_id);
               ^
examples/vhost/main.c:1162:23: error: implicit declaration of function 'vs_learn_port' [-Werror=implicit-function-declaration]
   if (vdev->remove || vs_learn_port(vs_port, pkts, count))
                       ^
examples/vhost/main.c:1162:3: error: nested extern declaration of 'vs_learn_port' [-Werror=nested-externs]
   if (vdev->remove || vs_learn_port(vs_port, pkts, count))
   ^
examples/vhost/main.c:1166:2: error: implicit declaration of function 'vs_lookup_n_fwd' [-Werror=implicit-function-declaration]
  vs_lookup_n_fwd(vs_port, pkts, count, VIRTIO_RXQ);
  ^
examples/vhost/main.c:1166:2: error: nested extern declaration of 'vs_lookup_n_fwd' [-Werror=nested-externs]
examples/vhost/main.c: In function 'new_device':
examples/vhost/main.c:1310:19: error: implicit declaration of function 'vs_get_max_vdevs' [-Werror=implicit-function-declaration]
  device_num_min = vs_get_max_vdevs(vswitch_dev_g);
                   ^
examples/vhost/main.c:1310:2: error: nested extern declaration of 'vs_get_max_vdevs' [-Werror=nested-externs]
  device_num_min = vs_get_max_vdevs(vswitch_dev_g);
  ^
examples/vhost/main.c:1310:36: error: 'vswitch_dev_g' undeclared (first use in this function)
  device_num_min = vs_get_max_vdevs(vswitch_dev_g);
                                    ^
examples/vhost/main.c:1313:2: error: 'vs_port' undeclared (first use in this function)
  vs_port = vs_add_port(vswitch_dev_g, vid, VSWITCH_PTYPE_VIRTIO, vdev);
  ^
examples/vhost/main.c:1313:12: error: implicit declaration of function 'vs_add_port' [-Werror=implicit-function-declaration]
  vs_port = vs_add_port(vswitch_dev_g, vid, VSWITCH_PTYPE_VIRTIO, vdev);
            ^
examples/vhost/main.c:1313:2: error: nested extern declaration of 'vs_add_port' [-Werror=nested-externs]
  vs_port = vs_add_port(vswitch_dev_g, vid, VSWITCH_PTYPE_VIRTIO, vdev);
  ^
examples/vhost/main.c:1313:44: error: 'VSWITCH_PTYPE_VIRTIO' undeclared (first use in this function)
  vs_port = vs_add_port(vswitch_dev_g, vid, VSWITCH_PTYPE_VIRTIO, vdev);
                                            ^
examples/vhost/main.c:1319:6: error: 'struct vhost_dev' has no member named 'vs_port'
  vdev->vs_port = vs_port;
      ^
examples/vhost/main.c:1347:2: error: implicit declaration of function 'vs_port_start' [-Werror=implicit-function-declaration]
  vs_port_start(vs_port);
  ^
examples/vhost/main.c:1347:2: error: nested extern declaration of 'vs_port_start' [-Werror=nested-externs]
examples/vhost/main.c: In function 'get_vswitch_conf_flags':
examples/vhost/main.c:1479:20: error: 'VS_CNF_FLG_VM2VM_HARDWARE' undeclared (first use in this function)
   vs_conf_flags |= VS_CNF_FLG_VM2VM_HARDWARE;
                    ^
examples/vhost/main.c:1482:20: error: 'VS_CNF_FLG_VM2VM_SOFTWARE' undeclared (first use in this function)
   vs_conf_flags |= VS_CNF_FLG_VM2VM_SOFTWARE;
                    ^
examples/vhost/main.c:1485:20: error: 'VS_CNF_FLG_PROMISCOUS_EN' undeclared (first use in this function)
   vs_conf_flags |= VS_CNF_FLG_PROMISCOUS_EN;
                    ^
examples/vhost/main.c:1487:6: error: 'jumbo_frame_en' undeclared (first use in this function)
  if (jumbo_frame_en)
      ^
examples/vhost/main.c:1488:20: error: 'VS_CNF_FLG_JUMBO_EN' undeclared (first use in this function)
   vs_conf_flags |= VS_CNF_FLG_JUMBO_EN;
                    ^
examples/vhost/main.c:1491:20: error: 'VS_CNF_FLG_STATS_EN' undeclared (first use in this function)
   vs_conf_flags |= VS_CNF_FLG_STATS_EN;
                    ^
examples/vhost/main.c:1494:20: error: 'VS_CNF_FLG_VLAN_STRIP_EN' undeclared (first use in this function)
   vs_conf_flags |= VS_CNF_FLG_VLAN_STRIP_EN;
                    ^
examples/vhost/main.c: At top level:
examples/vhost/main.c:726:1: error: 'link_vmdq' defined but not used [-Werror=unused-function]
 link_vmdq(struct vhost_dev *vdev, struct rte_mbuf *m)
 ^
examples/vhost/main.c:1474:17: error: 'get_vswitch_conf_flags' defined but not used [-Werror=unused-function]
 static uint64_t get_vswitch_conf_flags(void)
                 ^
cc1: all warnings being treated as errors
make[1]: *** [main.o] Error 1
make: *** [all] Error 2
error: build examples/vhost failed
error: build failed

  parent reply	other threads:[~2016-09-11 12:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04 10:23 [RFC][PATCH V2 0/3] example/vhost: Introduce Vswitch Framework Pankaj Chauhan
2016-09-04 10:23 ` [RFC][PATCH V2 1/3] examples/vhost: Add vswitch (generic switch) framework Pankaj Chauhan
2016-09-09  8:56   ` Tan, Jianfeng
2016-09-12 10:55     ` Pankaj Chauhan
2016-09-13  6:51       ` Tan, Jianfeng
2016-09-15  9:00         ` Pankaj Chauhan
2016-09-19 12:42           ` Tan, Jianfeng
2016-09-27 11:26             ` Pankaj Chauhan
2016-09-19 14:43         ` Yuanhan Liu
2016-09-20  8:58           ` Pankaj Chauhan
2016-09-26  3:56             ` Yuanhan Liu
2016-09-27 11:35               ` Pankaj Chauhan
2016-09-27 12:10                 ` Yuanhan Liu
2016-09-11 12:21   ` Yuanhan Liu [this message]
2016-09-12 10:59     ` Pankaj Chauhan
2016-09-26  4:12   ` Yuanhan Liu
2016-09-27 11:44     ` Pankaj Chauhan
2016-09-27 12:03       ` Yuanhan Liu
2016-09-04 10:23 ` [RFC][PATCH V2 2/3] examples/vhost: Add vswitch command line options Pankaj Chauhan
2016-09-13 12:14   ` Yuanhan Liu
2016-09-15  9:11     ` Pankaj Chauhan
2016-09-04 10:24 ` [RFC][PATCH V2 3/3] examples/vhost: Add VMDQ vswitch device Pankaj Chauhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160911122142.GY23158@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jianfeng.tan@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=pankaj.chauhan@nxp.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.