Commit Graph

19 Commits

Author SHA1 Message Date
Pablo de Lara
bae696ebd4 drivers: remove static driver names
Since now the PMD_REGISTER_DRIVER macro sets the driver names,
there is no need to have the rte_driver structure setting it
statically, as it will get overridden.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
1586ff4cef drivers: revert vdev driver names to original
In order to avoid API breakage, the driver names of the virtual devices
have been renamed to their original name, before the modification
of the PMD_REGISTER_DRIVER macro, which sets now the driver names.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Neil Horman
cb6696d220 drivers: update registration macro usage
Modify the PMD_REGISTER_DRIVER macro, adding a name argument to it.  The
addition of a name argument creates a token that can be used for subsequent
macros in the creation of unique symbol names to export additional bits of
information for use by the pmdinfogen tool.  For example:

PMD_REGISTER_DRIVER(ena_driver, ena);

registers the ena_driver struct as it always did, and creates a symbol
const char this_pmd_name0[] __attribute__((used)) = "ena";

which pmdinfogen can search for and extract.  The subsequent macro

DRIVER_REGISTER_PCI_TABLE(ena, ena_pci_id_map);

creates a symbol const char ena_pci_tbl_export[] __attribute__((used)) =
"ena_pci_id_map";

Which allows pmdinfogen to find the pci table of this driver

Using this pattern, we can export arbitrary bits of information.

pmdinfo uses this information to extract hardware support from an object
file and create a json string to make hardware support info discoverable
later.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-06 23:21:40 +02:00
Reshma Pattan
e07f80c850 net/pcap: fix crash on close
Testpmd application will crash in fclose() upon quit after running
the below command.

"sudo gdb --args ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf0 -n 4
          --vdev 'eth_pcap0,tx_iface=enp1s0f1,rx_pcap=/tmp/test.pcap' --
          --port-topology=chained -i"

The reason is, pcap vdev creation with tx stream type as "iface"
as in above command doesn't need member "dumpers" of
"struct tx_pcaps", hence will not have memory allocated for it.
It contains a garbage values, as local object of struct tx_pcaps
is not initialized to 0 inside rte_pmd_pcap_dev_init().
So calling pcap_dump_close() on dumper as part of eth_dev_stop()
is causing segfault in fclose().

Fix is to initialize local object of struct tx_pcaps to 0.
Also initialize local object of struct rx_pcaps to 0.
So during eth_dev_stop(), pcap_dump_close() will not be called if dumper
is NULL.

Fixes: 4c173302c3 ("pcap: add new driver")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-06-15 17:13:56 +02:00
Thomas Monjalon
f8e9cbe2aa mk: fix internal dependencies
Some libraries were missing their dependency on eal, mbuf, mempool,
ring and kvargs.
It is revealed by the linker option "-z defs".

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-06-29 13:33:01 +02:00
Christian Ehrhardt
6cbf4f75e0 mk: fix missing internal dependencies
This patch adds missing DEPDIRS to avoid any library referring to
symbols they are not linked against.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2016-06-13 16:17:56 +02:00
Marc Sune
82113036e4 ethdev: redesign link speed config
This patch redesigns the API to set the link speed/s configuration
of an ethernet port. Specifically:

- it allows to define a set of advertised speeds for
  auto-negociation.
- it allows to disable link auto-negociation (single fixed speed).
- default: auto-negociate all supported speeds.

A flag autoneg in struct rte_eth_link indicates if link speed was a
result of auto-negociation or was fixed by configuration.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-04-01 21:38:34 +02:00
Marc Sune
39fd068a27 ethdev: rename link speed constants
The speed numbers ETH_LINK_SPEED_ are renamed ETH_SPEED_NUM_.
The prefix ETH_LINK_SPEED_ is kept for AUTONEG and will be used
for bit flags in next patch.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
2016-04-01 21:38:34 +02:00
Thomas Monjalon
09419f235e ethdev: use constants for link state
Define and use ETH_LINK_UP and ETH_LINK_DOWN where appropriate.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-04-01 21:38:34 +02:00
Ferruh Yigit
77e14d2271 pcap: reduce duplication
1- Remove duplicate nb_rx/tx_queues fields from internals
2- Move duplicate code into a common function

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Nicolás Pernas Maradei <nicolas.pernas.maradei@emutex.com>
2016-03-16 19:05:47 +01:00
Dror Birkman
c6fb0e5558 pcap: fix captured frame length
The actual captured length is header.caplen, whereas header.len is
the original length on the wire.

Fixes: 4c173302c3 ("pcap: add new driver")

Signed-off-by: Dror Birkman <dror.birkman@lightcyber.com>
Acked-by: Nicolás Pernas Maradei <nicolas.pernas.maradei@emutex.com>
2016-03-16 19:05:47 +01:00
Panu Matilainen
5f9115e58c mk: fix shared library dependencies of drivers
Similar to commit 113c8e13c4, but
for bnx2x, pcap, sze2data and xenvirt PMDs.

Requiring applications to know about library internal details like
dependencies to external helper libraries is a limitation of
static linkage, shared libraries should always know their own
dependencies for sane operation. This is especially highlighted
with dlopen()'ed items, having applications link against about plugin
internal dependencies goes on the side of absurd.

Note that linking with a shared combined library still requires to
know the internal dependencies.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-12-06 22:15:14 +01:00
Bernard Iremonger
1328f33e2b pcap: remove fake pci interface
remove rte_pcap_pmd and pci_dev.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-11-03 18:47:42 +01:00
Bernard Iremonger
8fb9e2bbf9 drivers: copy fake PCI device info to ethdev data
Initialise dev_flags, driver, kdrv, drv_name and numa_node fields
in eth_dev data.

for the following vdevs:
null
ring
pcap
af_packet
xenvirt
mpipe
bonding

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-11-03 18:39:42 +01:00
Sergio Gonzalez Monroy
2f9d47013e mem: move librte_malloc to eal/common
Move malloc inside eal and create a new section in MAINTAINERS file for
Memory Allocation in EAL.

Create a dummy malloc library to avoid breaking applications that have
librte_malloc in their DT_NEEDED entries.

This is the first step towards using malloc to allocate memory directly
from memsegs. Thus, memzones would allocate memory through malloc,
allowing to free memzones.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-07-16 13:44:48 +02:00
Klaus Degner
2269e7e815 pcap: add Rx and Tx byte counters
Added RX and TX bytes counter support to the PCAP statistics.
Added TX counter support for pcap dumper and interface functions.
Renamed RX and TX packet counters for consistency.

Signed-off-by: Klaus Degner <kd@allegro-packets.com>
Tested-by: John McNamara <john.mcnamara@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-07-13 19:31:58 +02:00
Tero Aho
6db141c91e pcap: support jumbo frames
Extend eth_pcap rx and tx to support jumbo frames.

On the receive side read large packets into multiple mbufs and
on the transmit side convert them back to a single pcap buffer.

Signed-off-by: Tero Aho <tero.aho@coriant.com>
Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-07-10 23:14:47 +02:00
Stephen Hemminger
a84b014cb5 drivers: fix whitespace
Note: ignored whitespace issues in base (external code).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-12 11:10:10 +02:00
Bruce Richardson
232771c793 pcap: move drivers/net/
Move pcap pmd to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:22 +02:00