Since commit 13ce5e7eb9 ("virtio: mergeable buffers"),
this driver has the capability of receiving and transmitting jumbo frame.
So update max Rx packet length.
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Tested-by: Jingguo Fu <jingguox.fu@intel.com>
Fix one issue in virtio TX: it needs one more vring descriptor to hold the virtio
header when transmitting packets, it is used later to determine whether to free
more entries from used vring.
It fixes failing to transmit any packet with 1 segment in the circumstance of only
1 descriptor in the vring free list.
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL
Signed-off-by: Damjan Marion <damarion@cisco.com>
Acked-by: Changchun Ouyang <Changchun.ouyang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
There is no need for ioport access for applications that won't use virtio pmds.
Make rte_eal_iopl_init() non-static so that it is called from pmds that need it.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
The mbuf structure already contains a pointer to the beginning of the
buffer (m->buf_addr). It is not needed to use 8 bytes again to store
another pointer to the beginning of the data.
Using a 16 bits unsigned integer is enough as we know that a mbuf is
never longer than 64KB. We gain 6 bytes in the structure thanks to
this modification.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
* Updated to apply to latest on mainline.
* Disabled vector PMD in config as it relies heavily on the mbuf layout
This will be re-enabled in a subsequent commit once vPMD has been
reworked to take account of mbuf changes.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
In some cases we may want to tag a packet for a particular destination
or output port, so rename the "in_port" field in the mbuf to just "port"
so that it can be re-used for this purpose if an application needs it.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
The rte_pktmbuf structure was initially included in the rte_mbuf
structure. This was needed when there was 2 types of mbuf (ctrl and
packet). As the control mbuf has been removed, we can merge the
rte_pktmbuf into the rte_mbuf structure.
Advantages of doing this:
- the access to mbuf fields is easier (ex: m->data instead of m->pkt.data)
- make the structure more consistent: for instance, there was no reason
to have the ol_flags field in rte_mbuf
- it will allow a deeper reorganization of the rte_mbuf structure in the
next commits, allowing to gain several bytes in it
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
[Bruce: updated for latest code and new example apps]
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The initial role of rte_ctrlmbuf is to carry generic messages (data
pointer + data length) but it's not used by the DPDK or it applications.
Keeping it implies:
- loosing 1 byte in the rte_mbuf structure
- having some dead code rte_mbuf.[ch]
This patch removes this feature. Thanks to it, it is now possible to
simplify the rte_mbuf structure by merging the rte_pktmbuf structure
in it. This is done in next commit.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
* Updated patch to HEAD.
* Modified patch to retain the old function names for ctrl mbufs as
macros. This helps with app compatibility, and allows the concept
of a control mbuf to be reintroduced via a single-bit flag in
a future change.
* Updated the packet framework ip_pipeline example application to
work following this change.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
This patch supports mergeable buffer feature in DPDK based virtio PMD,
which can receive jumbo frame with larger size, like 3K, 4K or even 9K.
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
Tested-by: Jingguo Fu <jingguox.fu@intel.com>
Fix 2 compilation issues in virtio PMD when dump option is enabled.
These errors were introduced by commits
f37cdfde46 (remove unused virtqueue name)
and ce65e697c6 (simplify the hardware structure).
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
The host_features are never used after negotiation.
The PCI information is unused (and available in rte_pci if needed).
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
This flag was set to zero (but was already zero)
and never used.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
vq_name is only used when setting up queue, and does not need
to be saved.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
This driver does not support receive IP checksum offload,
therefore must check and return error if configured incorrectly.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
This driver does not support transmit checksum or vlan offload
therefore check for this when device is configured.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
This driver has lots of functions marked always inline which is actually
counterproductive with modern compilers. Better to move the functions to
the one file they are used (proper scope) and let compiler decide.
For trivial functions leave them as static inline.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
PMD_INIT_LOG macro already adds a newline, no need to double space.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
Avoid cache collision and thrashing of the software statistics
by keeping them per-queue in the driver.
Signed-off-by: Stephen Hemminger <shemming@brocade.com>
Acked-by: Alan Carew <alan.carew@intel.com>
virtio_net_hdr_mem member within virtqueue structure stores a
physical address and is defined as void ptr. When 32bit pmd is used
with 64bit kernel this leads to truncation of 64bit physical address
and pkt i/o does not work.
Changed virtio_net_hdr_mem to phys_addr_t type and
removed the typecasts
Signed-off-by: Vijayakumar Muthuvel Manickam <mmvijay@gmail.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Suggested-by: Neil Horman <nhorman@tuxdriver.com>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Alan Carew <alan.carew@intel.com>
The commit 591a9d7985 (add FILE argument to debug functions) didn't
compile if CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP is enabled.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The function rte_snprintf serves no useful purpose. It is the
same as snprintf() for all valid inputs. Deprecate it and
replace all uses in current code.
Leave the tests for the deprecated function in place.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Rename the RTE_PCI_DRV_NEED_IGB_UIO to be more generic.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This fixes style problems reported by checkpatch including:
* extra whitespace
* spaces before tabs
* strings broken across lines
* excessively long lines
* missing spaces after keywords
* unnecessary paren's in return statements
Signed-off-by: Stephen Hemminger <shemming@brocade.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
This commit removes trailing whitespace from lines in files. Almost all
files are affected, as the BSD license copyright header had trailing
whitespace on 4 lines in it [hence the number of files reporting 8 lines
changed in the diffstat].
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: remove spaces before tabs in libs]
[Thomas: remove more trailing spaces in non-C files]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This patch supports multiple queues feature in DPDK based virtio-net frontend.
It firstly gets max queue number of virtio-net from virtio PCI configuration and
then send command to negotiate the queue number with backend; When receiving and
transmitting packets, it negotiates multiple virtio-net queues which serve RX/TX;
To utilize this feature, the backend also need support multiple queues feature
and enable it.
Signed-off-by: Ouyang Changchun <changchun.ouyang@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This patch cleanups some coding style issue, and fixes some errors and warnings
reported by checkpatch.pl.
Signed-off-by: Ouyang Changchun <changchun.ouyang@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Convert the virtio pmd driver to use the PMD_REGISTER_DRIVER macro.
This means that the test applications now have no reference to the virtio library
when building DSO's and must specify its use on the command line with the -d
option. Static linking will still initalize the driver automatically.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
virtio-uio does not need eal to map bars from uio device, so remove flag
RTE_PCI_DRV_NEED_IGB_UIO.
Then, move virtio-uio workaround out of generic eal_pci.c for linux
implementation.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Since commit 10ed994 (pci: use igb_uio mapping only when needed),
the flag RTE_PCI_DRV_NEED_IGB_UIO must be set even if RTE_EAL_UNBIND_PORTS
is disabled.
It was not the case for virtio_uio and vmxnet3_uio so the uio resources were
not mapped when RTE_EAL_UNBIND_PORTS was not defined.
Specifically, pci_uio_map_resource() was not called so
pci_dev->mem_resource was not mapped.
Signed-off-by: Daniel Kan <dan@nyansa.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
In order to distinguish clearly this implementation from the extension
virtio-net-pmd, it is renamed to reflect its usage of uio framework.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Chris Wright <chrisw@redhat.com>
Changes to allow compilation and use on FreeBSD. Includes:
* contigmem and nic_uio driver for FreeBSD
* new EAL instance
* new "bsdapp" compilation target
* various compilation fixes due to differences between linux and freebsd
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>