Commit Graph

175 Commits

Author SHA1 Message Date
Xiao Wang
6a1db11448 net/fm10k: fix pointer cast
The device specific data is located at dev->data->dev_private.

Fixes: 162f32290a ("fm10k: move parameters initialization")
Fixes: 039991bc28 ("fm10k: add vector pre-condition check")
Fixes: 77a8ab47eb ("fm10k: select best Rx function")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-04-04 19:02:49 +02:00
Qi Zhang
42936846b1 net/fm10k/base: add base driver information
Add base driver information in Makefile.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
756101d42d net/fm10k/base: request reset on mailbox state change
Multiple IES API resets can cause a race condition where the mailbox
interrupt request bits can be cleared before being handled. This can
leave certain mailbox messages from the PF to be untreated and the PF
will enter in some inactive state. If this situation occurs, the IES API
will initiate a mailbox version reset which, then, trigger a mailbox
state change. Once this mailbox transition occurs (from OPEN to CONNECT
state), a request for reset will be returned.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
ab0fa5457f net/fm10k/base: replace macros
Other shared code bases are planning on using
IS_MULTICAST_ETHER_ADDR and friends without leaving the driver
name in the macro.
Remove reference to FM10K here so that we can re-use the specific
compat flags from Linux.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
a94bceb1e3 net/fm10k/base: improve re-map queues handle
Avoid potential FUM fault errors on a VF when updating MAC address
and VLAN information. Only use the register flow when the mailbox is
disconnected, by checking if the enqueue_tx returns
FM10K_MBX_ERR_NO_MBX. If the mailbox message can be sent, there is no
reason to bother with the register writes which are only intended to
be used during VF driver initialization.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
e448248229 net/fm10k/base: add macro for geneve tunnel offload
add necessary macro to support geneve tunnel offload.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
52f962141b net/fm10k/base: do not stop reset
Don't report FM10K_ERR_REQUESTS_PENDING when we fail to disable queues
within the timeout. This can occur due to a hardware Tx hang, or when
the switch ethernet fabric is resetting while we are transmitting
traffic. It can sometimes take up to 500ms before the Tx DMA engine
gives up. Instead, just skip the DMA engine check and perform
a data-path reset anyways. Add a statistic counter to keep track of the
number of resets occurring while we have pending DMA on the rings.

In order to prevent having to assign err = FM10K_SUCCESS, re-order the
last few items of the reset_hw_pf function so that we don't perform
"return err" at the end.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
e9861ae847 net/fm10k/base: add macros for global interrupt
Add two macros for global interrupt.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
60028b4bdf net/fm10k/base: enable lport map request
If the fm10k interface is brought up, but the switch manager software is
not running, the driver will continuously request the lport map every
few seconds in the base driver watchdog routine. Eventually after
several minutes the switch mailbox Tx fifo will fill up and the mailbox
will timeout, resulting in a reset. This reset will appear as if for no
reason, and occurs regularly every few minutes until the switch manager
software is loaded.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
a5db0e8004 net/fm10k/base: improve VF multi-bit VLAN update requests
The VF uses a multi-bit update request to clear unused VLANs whenever it
resets. However, an accident in a previous refactor broke multi-bit
updates for VFs, due to misreading a comment in fm10k_vf.c and
attempting to reduce code duplication. The problem occurs because
a multi-bit request has a non-zero length, and the PF would simply drop
any request with the upper 16 bits set. In addition, a multi-bit vlan
update does not have a concept for "VLAN 0" as the single bit update
does.

A previous revision of this patch resolved the issue by simply removing
the upper 16 bit check and the iov_select_vid checks. However, this would
remove the checks for default VID and for ensuring no other VLANs can be
enabled except pf_vid when it has been set. To resolve that issue, this
revision uses the iov_select_vid when we have a single-bit update, and
denies any multi-bit update when the VLAN was administratively set by
the PF. This should be ok since the PF properly updates VLAN_TABLE when
it assigns the PF vid. This ensures that requests to add or "remove" the
PF vid work as expected, but a rogue VF could not use the multi-bit
update as a loophole to attempt receiving traffic on other VLANs.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
c631e94842 net/fm10k/base: update comment regarding reserved bits check
The original comment may be read incorrectly as referring to checking
the *entire* length is zero. However, it merely checks only the reserved
bits of both length and reserved in a small amount of code. Update the
comment to indicate this is a clever trick and clearly spell out that it
only checks the reserve bits.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
99cb088c1e net/fm10k/base: use different name for override bit
Use a new #define FM10K_VLAN_OVERRIDE even though we're using
the exact same bit. The reason for this is clarity in the code,
otherwise you can read FM10K_VLAN_CLEAR and think it should be
removed. Also add a comment explaining why the FM10K_VLAN_OVERRIDE
bit is set.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
65afffe6e3 net/fm10k/base: update comment to use 8 bit notation
The diagram represents bit layout of the multi-bit VLAN update
message format. Re-draw the numbers using base 8, and mark the
bit values every 8 bits at the top. This should make it more
easy to grasp the table quickly.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
7cc79a91f3 net/fm10k/base: add new item to lport msg attr
Add FM10K_PF_ATTR_ID_ERR, since it is possible for the switch manager
to send out an error message indicating status of the LPORT_MAP due to
zero allocated bandwidth.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
890fc30fbf net/fm10k/base: clean up the logic
Clean up the logic in fm10k_tlv_attr_parse, we
should not reply on that FM10K_NOT_IMPLEMENTED is
greater than zero, as this can easily cause confusion.
The patch also correct a minor document error.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
0de9c88abb net/fm10k/base: add error code
Add API error code for when PEP is not scheduled.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
883a735c69 net/fm10k/base: expose macros needed by DPDK
Add back macros that DPDK required and remove the redundant ones
in fm10k_osdep.h.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
22025588e4 net/fm10k/base: reset multicast mode when deleting lport
Deleting lport when multicast mod is configured to
FM10K_XCAST_MODE_ALLMULTI or FM10K_XCAST_MODE_PROMISC will
result in generating orphaned multicast-group entries in the
switch manager.
Before deleting the lport, reset multicast mode to
FM10K_XCAST_MODE_NONE to flush out these multicast-group
entries.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Qi Zhang
43f8858078 net/fm10k/base: add a flag to indicate VF trust mode
Adds boolean flag in fm10k_vf_info to support configuring
a VF to be trusted.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 15:52:52 +02:00
Olivier Matz
feb9f680cd mk: optimize directory dependencies
Before this patch, the management of dependencies between directories
had several issues:

- the generation of .depdirs, done at configuration is slow: it can take
  more than one minute on some slow targets (usually ~10s on a standard
  PC without -j).

- for instance, it is possible to express a dependency like:
  - app/foo depends on lib/librte_foo
  - and lib/librte_foo depends on app/bar
  But this won't work because the directories are traversed with a
  depth-first algorithm, so we have to choose between doing 'app' before
  or after 'lib'.

- the script depdirs-rule.sh is too complex.

- we cannot use "make -d" for debug, because the output of make is used for
  the generation of .depdirs.

This patch moves the DEPDIRS-* variables in the upper Makefile, making
the dependencies much easier to calculate. A DEPDIRS variable is still
used to process library dependencies in LDLIBS.

After this commit, "make config" is almost immediate.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Robin Jarry <robin.jarry@6wind.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-03-27 23:28:43 +02:00
Jeff Guo
45f4dd1adc drivers/net: fix device configuration
dev_flags is wrongly overwritten with RTE_ETH_DEV_DETACHABLE value
in drivers after rte_eth_copy_pci_info().

Previous values of the dev_flags set in rte_eth_copy_pci_info(),
like RTE_ETH_DEV_INTR_LSC, are get lost. That will fail the device
configuration.

Fix by preventing dev_flags overwritten.

Fixes: 22dda618c0 ("pci: separate detaching ethernet ports from PCI devices")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Jeff Guo <jia.guo@intel.com>
2017-02-10 12:25:49 +01:00
Santosh Shukla
57043b7ce2 net/fm10k: use I/O device memory read/write API
Replace the raw I/O device memory read/write access with eal
abstraction for I/O device memory read/write access to fix
portability issues across different architectures.

CC: Jing Chen <jing.d.chen@intel.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-01-18 17:18:26 +01:00
Ben Walker
22dda618c0 pci: separate detaching ethernet ports from PCI devices
Attaching and detaching ethernet ports from an application
is not the same thing as physically removing a PCI device,
so clarify the flags indicating support. All PCI devices
are assumed to be physically removable, so no flag is
necessary in the PCI layer.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-12 15:48:54 +01:00
Tomasz Kulasek
9b134aa397 net/fm10k: add Tx preparation
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-01-04 20:40:24 +01:00
Olivier Matz
513c78ae3f ethdev: fix extended statistics name index
The function rte_eth_xstats_get() return an array of tuples (id,
value). The value is the statistic counter, while the id references a
name in the array returned by rte_eth_xstats_get_name().

Today, each 'id' returned by rte_eth_xstats_get() is equal to the index
in the returned array, making this value useless. It also prevents a
driver from having different indexes for names and value, like in the
example below:

  rte_eth_xstats_get_name() returns:
    0: "rx0_stat"
    1: "rx1_stat"
    2: ...
    7: "rx7_stat"
    8: "tx0_stat"
    9: "tx1_stat"
    ...
    15: "tx7_stat"

  rte_eth_xstats_get() returns:
    0: id=0, val=<stat>    ("rx0_stat")
    1: id=1, val=<stat>    ("rx1_stat")
    2: id=8, val=<stat>    ("tx0_stat")
    3: id=9, val=<stat>    ("tx1_stat")

This patch fixes the drivers to set the 'id' in their ethdev->xstats_get()
(except e1000 which was already doing it), and fixes ethdev by not setting
the 'id' field to the index of the table for pmd-specific stats: instead,
they should just be shifted by the max number of generic statistics.

Fixes: bd6aa172cf ("ethdev: fetch extended statistics with integer ids")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2017-01-04 19:04:30 +01:00
Jan Blunck
eac901ce29 ethdev: decouple from PCI device
This makes struct rte_eth_dev independent of struct rte_pci_device by
replacing it with a pointer to the generic struct rte_device.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-12-25 23:30:19 +01:00
Jan Blunck
ae34410a8a ethdev: move info filling of PCI into drivers
Only the drivers itself can decide if it could fill PCI information fields
of dev_info.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-12-25 23:25:42 +01:00
Jan Blunck
b9866505d8 net/fm10k: localize mapping of ethdev to PCI device
This simplifies later changes to ethdev.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
2016-12-25 23:14:39 +01:00
Olivier Matz
0880c40113 drivers: advertise kmod dependencies in pmdinfo
Add a new macro RTE_PMD_REGISTER_KMOD_DEP() that allows a driver to
declare the list of kernel modules required to run properly.

Today, most PCI drivers require uio/vfio.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-12-20 18:26:00 +01:00
Xiao Wang
2c448da6aa net/fm10k: fix VF Tx queue initialization
The SGLORT (Source Global Resource Tag) of the VF queues should be
assigned by PF driver, VF driver should not set these registers.

Fixes: 3b845bf6bc ("fm10k: fix switch manager high CPU usage")

Reported-by: Sarath Somasekharan <sarathx.somasekharan@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
2016-10-26 19:38:18 +02:00
Qi Zhang
0876c8b821 net/fm10k: fix out of order Rx read
In vPMD, when we load Rx desc with _mm_loadu_si128, the volatile
modifier will be cast away, allowing the compiler to reorder the
load instructions.

The Rx recv function's correctness is relying on these load
instructions following a strict sequence, reading the descriptors
in reverse order, so we add compiler barrier to prevent compiler
reorder.

Fixes: 7092be8437 ("fm10k: add vector Rx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-10-26 19:38:18 +02:00
Shreyansh Jain
01f1922786 drivers: rename register macro prefix
All macros related to driver registeration renamed from DRIVER_*
to RTE_PMD_*

This includes:

 DRIVER_REGISTER_PCI -> RTE_PMD_REGISTER_PCI
 DRIVER_REGISTER_PCI_TABLE -> RTE_PMD_REGISTER_PCI_TABLE
 DRIVER_REGISTER_VDEV -> RTE_PMD_REGISTER_VDEV
 DRIVER_REGISTER_PARAM_STRING -> RTE_PMD_REGISTER_PARAM_STRING
 DRIVER_EXPORT_* -> RTE_PMD_EXPORT_*

Fix PMDINFOGEN tool to look for matches of RTE_PMD_REGISTER_*.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-10-14 01:49:32 +02:00
Xiao Wang
5a239126ed net/fm10k: implement new Rx checksum flag
Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.
Since vector Rx supports checksum offload, this patch removes the
hw_ip_checksum check in fm10k_rx_vec_condition_check().

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-10-14 01:41:12 +02:00
Xiao Wang
a8213185e9 net/fm10k: fix Rx checksum flags
A previous patch removed some necessary lines about Rx checksum offload
by mistake, this patch adds them back.

Fixes: 6046898f50 ("net/mbuf: remove unused Rx error flags")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-10-14 01:41:06 +02:00
Xiao Wang
b961fe9344 net/fm10k: fix MAC address removal from switch
When testpmd quits with two ports, the second port's MAC address
remains in the MAC table of switch manager.

There needs to be some time for HW to quiesce when closing a port,
otherwise a subsequent port close won't be handled correctly.

This patch adds a delay after turning off a logic port, just as
the kernel driver does.

Fixes: 8b5c9ec20b ("fm10k: support VMDQ in MAC/VLAN filter")

Reported-by: Xueqin Lin <xueqin.lin@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-09-30 12:27:18 +02:00
Yuanhan Liu
0af54f09d9 net: fix clang build
Interestingly, clang and gcc has different prototype for _mm_prefetch().
For gcc, we have

   _mm_prefetch (const void *__P, enum _mm_hint __I)

While for clang, it's

   #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel)))

That's how the following error comes with clang:

   error: cast from 'const void *' to 'void *' drops const qualifier
   [-Werror,-Wcast-qual]
           _mm_prefetch((const void *)rused, _MM_HINT_T0);
   /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/xmmintrin.h:684:58:
   note: expanded from macro '_mm_prefetch'
            #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a),
                                          0, (sel)))

What's weird is that the build was actaully Okay before. I met it while
apply Jerin's vector support for ARM patch set: he just move this piece
of code to another file, nothing else changed.

This patch fix the issue when Jerin's patchset is applied. Thus, I think
it's still needed.

Similarly, make the same change to other _mm_prefetch users, just in case
this weird issue shows up again somehow later.

Fixes: fc3d66212f ("virtio: add vector Rx")
Fixes: c95584dc2b ("ixgbe: new vectorized functions for Rx/Tx")
Fixes: 9ed94e5bb0 ("i40e: add vector Rx")
Fixes: 7092be8437 ("fm10k: add vector Rx")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-09-28 02:18:39 +02:00
Jan Viktorin
13a1317d3b pci: create device list and fallback on its members
Now that rte_device is available, drivers can start using its members
(numa, name) as well as link themselves into another rte_device list.

As of now no one is using this list, but can be used for moving over all
devices (pdev/vdev/Xdev) and perform bulk actions (like cleanup).

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
[Shreyansh: Reword commit log for extra rte_device list]
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-10-03 16:34:03 +02:00
Jan Viktorin
2f3193cf0f pci: inherit common driver in PCI driver
Remove the 'name' member from rte_pci_driver and move to generic
rte_driver.

Most of the PMD drivers were initially using DRIVER_REGISTER_PCI(<name>..)
as well as assigning a name to eth_driver.pci_drv.name member.
In this patch, only the original DRIVER_REGISTER_PCI(<name>..) name has
been populated into the rte_driver.name member - assignments through
eth_driver has been removed.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
[Shreyansh: Rebase and expand changes to newly added files]
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-10-03 16:33:55 +02:00
David Marchand
c830cb2954 drivers: use PCI registration macro
Simplify crypto and ethdev pci drivers init by using newly introduced
init macros and helpers.
Those drivers then don't need to register as "rte_driver"s anymore.

Exceptions:
- virtio and mlx* use RTE_INIT directly as they have custom initialization
  steps.
- VDEV devices are not modified - they continue to use PMD_REGISTER_DRIVER.

Update documentation for replacing an example referring to
PMD_REGISTER_DRIVER.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-10-03 16:33:23 +02:00
Pablo de Lara
2f45703c17 drivers: make driver names consistent
As discussed in the past release, driver names are modified
to be more consistent, and the future driver should follow
this new convention.

Driver names consist of:
"driver category"_"driver folder name"_"optional extra name".

For example:
- Crypto null driver       -> "crypto_null"
- Network IXGBE VF driver  -> "net_ixgbe_vf"

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-09-16 11:55:59 +02:00
Xiao Wang
7a2c46695f net/fm10k: fix RSS hash config
Sometimes app just wants to update the RSS hash function and no RSS key
update is needed, but fm10k pmd will return EINVAL for this case.

If the rss_key is NULL, we don't need to check the rss_key_len.

Fixes: 57033cdf8f ("fm10k: add PF RSS")

Reported-by: Xueqin Lin <xueqin.lin@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
2016-07-22 11:53:32 +02:00
Xiao Wang
ddc592ede8 net/fm10k: fix FTAG mode with multiple queues
In multi-queue + FTAG use case, we need to turn tx_ftag_en on for all
the Tx queues.

Fixes: 7958b1310d ("fm10k: enable FTAG based forwarding")

Reported-by: Ricky Li <ricky.li@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
2016-07-15 22:58:18 +02:00
David Marchand
245421e0c5 net/fm10k: move PCI device ids to the driver
Reused defines from the driver.
Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11 17:39:44 +02:00
Xiao Wang
af15ee640d net/fm10k: fix Rx descriptor read timing
We find that when traffic is light, a small number of packets will have
wrong metadata (e.g. packet type), however this issue will not happen
when traffic is heavy.

The root cause is some fields in fm10k_rx_desc are read at the wrong time,
since the descriptor (being 16-bytes big) is not read as a single atomic
operation. When the input speed is slower than software's capability,
fm10k scalar Rx function accesses descriptors at about the same time
as HW writes them, so the scenario can occur: some fields like pkt_info
in fm10k_rx_desc are read before HW writeback but some fields like DD bit
are read after HW writeback, this will lead to the later packet parsing
function using incorrect value.

This patch fixes this issue by reading and parsing Rx descriptor only after
first checking that the DD bit is set.

Fixes: 4b61d3bfa9 ("fm10k: add receive and tranmit")
Fixes: c82dd0a7bf ("fm10k: add scatter receive")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-05 11:43:49 +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
Remy Horton
d085232a14 ethdev: remove redundant id field in xstats name lookup
For all drivers that currently implement xstats, the id field in the
rte_eth_stats_name structure equals the entry's array index. This
patch eliminates the redundant id field as a direct index lookup is
faster than a search for the matching id field.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-07-01 16:09:06 +02:00
Xiao Wang
2d2d6e3720 net/fm10k: fix promiscuous receive for VF
When app tries to change promisc/allmulti setting, fm10k will check if a
valid glort is acquired, and exit without doing anything if not.

For VFs, this glort value is not necessary, and so the check can be
removed. This saves having unnecessary failures of the API call, as well as
saving the time taken for the mailbox communication between VF and PF in
the case when the glort check passes.

Fixes: df02ba8646 ("fm10k: support promiscuous mode")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-06-20 17:21:53 +02:00
Olivier Matz
6046898f50 net/mbuf: remove unused Rx error flags
Following the discussions from:
http://dpdk.org/ml/archives/dev/2015-July/021721.html
http://dpdk.org/ml/archives/dev/2016-April/038143.html

The value of these flags is 0, making them useless. Today, no example
application checks them on Rx, and only few drivers sets them and
silently give wrong packets to the application, which should not happen.

This patch removes the unused flags from rte_mbuf and their use in the
drivers. The i40e and fm10k are kept as they are today and should be
fixed to drop bad packets. The enic driver is managed by its maintainer
in another patch.

Fixes: c22265f6 ("mbuf: add new packet flags for i40e")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-20 17:21:49 +02:00
Remy Horton
e2aae1c1ce ethdev: remove name from extended statistic fetch
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the test-pmd
and proc_info applications to use the new xstats API, and removes
deprecated code associated with the old API.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 18:12:00 +02:00
Remy Horton
1bf30e99cd net/fm10k: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the fm10k driver
to use the new API that seperates name string and value queries.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 17:57:15 +02:00