Commit Graph

1119 Commits

Author SHA1 Message Date
Ouyang Changchun
b94a06c1b4 ixgbe/base: support qsfp and lco
- Implement functions to do I2C byte read and write
- Support 82599_QSFP_SF_QP and 82599_LS

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
[Thomas: split patch]
2014-10-07 15:56:39 +02:00
Ouyang Changchun
4ef84d5a22 ixgbe/base: move phy sfp detection in a function
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
[Thomas: split patch]
2014-10-07 15:56:15 +02:00
Ouyang Changchun
d66791389c ixgbe/base: rework semaphore
- Store lan_id and physical semaphore mask into hardware physical information,
and use them to control read and write physical registers in IXGBE base code.
- Extend mask from 16 bits to 32 bits for releasing or acquiring SWFW semaphore
in IXGBE base code. It is used in reading and writing I2C byte.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
[Thomas: merge dependent patches]
2014-10-07 15:43:27 +02:00
Ouyang Changchun
df0799e764 ixgbe/base: remove unnecessary delay
Remove unnecessary delay when setting up physical link and negotiating
in IXGBE base code.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-10-07 15:43:27 +02:00
Ouyang Changchun
dc7508f1fa ixgbe/base: wait longer while polling X540 flash update
It need wait for 5 ms for polling EEC register in IXGBE X540 base code.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-10-07 15:43:27 +02:00
Ouyang Changchun
6a236f9625 ixgbe/base: wait longer for VF link status
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
[Thomas: split patch]
2014-10-07 15:43:27 +02:00
Ouyang Changchun
c2a4a29795 ixgbe/base: fix flow control comment
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
[Thomas: split patch]
2014-10-07 15:43:27 +02:00
Ouyang Changchun
36f43e8679 ixgbe/base: refactor manageability block communication
Introduce a new argument to let caller determine if it need read and
return data or not after executing host interface command in IXGBE base code.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-10-07 15:33:34 +02:00
Ouyang Changchun
fb42f38ee8 ixgbe/base: refactor eeprom checksum calculation
Refines function to let eeprom checksum calculation return
either a negative error code on error, or the 16-bit checksum
in IXGBE base code.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-10-07 15:33:16 +02:00
Ouyang Changchun
c313c942fe ixgbe/base: factorize fdir command complete check
Implements a function to check command complete for flow director in
IXGBE base code, and replaces related code snippet with this function.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-10-07 15:32:58 +02:00
Ouyang Changchun
c8fb5832be ixgbe/base: move manageability function
Manageability query is a common routine (not specific to 82599).

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
[Thomas: split patch]
2014-10-07 15:14:03 +02:00
Ouyang Changchun
0b6683fa75 ixgbe/base: new error types
This patch defines new error type in IXGBE base code; they are
used to report different kinds of error.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-10-07 15:14:03 +02:00
Ouyang Changchun
66ae737285 ixgbe/base: various clean up
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-10-03 14:45:24 +02:00
Ouyang Changchun
6fe00c9490 ixgbe/base: minor changes
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-10-03 14:45:23 +02:00
Damjan Marion
d68e2ae56b virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated
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>
2014-10-01 11:47:56 +02:00
Daniel Mrzyglod
e88c3b0a59 kni: fix build on Ubuntu 12.04.5
Recent Ubuntu 12.04.5 LTS is shipped with 3.13.0-36.63 as the only
supported kernel.
So skb_set_hash has been backported and is conflicting with kni kcompat one.
Commit a09b359dac ("fix build on Ubuntu 14.04") describes the initial problem.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
[Thomas: reorder conditions to ease reading]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-30 18:02:20 +02:00
Bruce Richardson
c6d8b70a30 ixgbe: fix build with clang
Clang fails with an error about a variable being used uninitialized:

lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c:67:30:
error: variable 'dma_addr0' is uninitialized
      when used here [-Werror,-Wuninitialized]
                        dma_addr0 = _mm_xor_si128(dma_addr0, dma_addr0);
                                                  ^~~~~~~~~

This error can be fixed by replacing the call to xor which
takes two parameters, by a call to setzero, which does not take any.

Reported-by: Keith Wiles <keith.wiles@windriver.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-30 17:34:17 +02:00
Thomas Monjalon
522b837939 version: 1.8.0-rc1
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 22:03:21 +02:00
Ouyang Changchun
3111eae26e ethdev: rename flag for queue start and stop
Rename start_?x_per_q to ?x_deferred_start
and add comments.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 19:30:12 +02:00
Thomas Monjalon
b66a2ca91e doc: apply one comment to all members of a group
A doxygen group begins with /**@{*/ and ends with /**@}*/.
By enabling DISTRIBUTE_GROUP_DOC, the first comment is applied
to each undocumented member of the group.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 16:34:58 +02:00
Saori Usami
e35d434667 pcap: set port id in received mbuf
The port parameter in mbuf should be set with an input port id
because DPDK apps may use it to know where each packet came from.

Signed-off-by: Saori Usami <susami@igel.co.jp>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 16:34:50 +02:00
Thomas Monjalon
b10eef348d pci: remove flag for multiple devices with single id
The flag RTE_PCI_DRV_MULTIPLE was used to register an eth_driver allowing
multiples devices with a single PCI id.
It is now possible to register a pci_driver and create ethdev objects
using rte_eth_dev_allocate().

Suggested-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 15:05:00 +02:00
Thomas Monjalon
3185322809 eal: remove rte_snprintf
The function rte_snprintf() was deprecated in version 1.7.0
(commit 6f41fe75e2).
It's now totally removed.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-29 15:04:55 +02:00
David Marchand
accf99308b eal: remove unused flags field
This field is not used anymore, remove it.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 14:39:09 +02:00
David Marchand
565b85dcd9 eal: set iopl only when needed
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>
2014-09-29 14:39:09 +02:00
David Marchand
8a312224bc eal/bsd: fix fd leak
From man(4) io:
"The initial implementation simply raised the IOPL of the current thread
when open(2) was called on the device. This behaviour is retained in the
current implementation as legacy support for both i386 and amd64."
    http://www.freebsd.org/cgi/man.cgi?query=io&sektion=4

Nothing prevents from closing it just after.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 14:39:09 +02:00
Thomas Monjalon
68fa37e021 examples: do not probe pci twice
Since commit a155d43011 ("support link bonding device initialization"),
rte_eal_pci_probe() is called in rte_eal_init().
So it doesn't have to be called by application anymore.
It has been fixed for testpmd in commit 2950a76931,
and this patch remove it from other applications.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-29 13:08:53 +02:00
David Marchand
6bc2415c33 eal: revert link bonding specific initialization
Revert commit a155d43011 ("support link bonding device initialization"),
except PCI probing at rte_eal_init time.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: merge revert with PCI probing restore]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 11:56:19 +02:00
David Marchand
78aecefed9 bond: move param parsing in configure step
Rework bond pmd initialisation so that we don't need to modify eal
for this pmd to work.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 11:56:19 +02:00
Thomas Monjalon
aa1a048729 ixgbe: allow unsupported SFP
No need to restrict usage of non Intel SFP.
If (hw->phy.type == ixgbe_phy_sfp_intel) is false,
a warning will be logged.
It was disabled for ixgbe and enabled but unused for i40e.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-29 11:56:19 +02:00
Balazs Nemeth
eb6cabe100 ixgbe: fix crash caused by bulk allocation failure
Since the introduction of vector PMD, a bug in ixgbe_rxq_rearm could
cause a crash. As long as the memory pool allocated to the RX queue
has mbufs available, there is no problem. After allocation of _all_
mbufs from the memory pool, previously returned mbufs by
rte_eth_rx_burst could be accessed by subsequent calls to the PMD and
could be returned by subsequent calls to rte_eth_rx_burst. From the
perspective of the application, the means that fields within the mbuf
could change and that previously allocated mbufs could appear multiple
times.

After failure of mbuf allocation, the dd bits should indicate that the
packets are not ready. For this, this patch adds code to reset the dd
bits in the first RTE_IXGBE_DESCS_PER_LOOP packets of the next
RTE_IXGBE_RXQ_REARM_THRESH packets only if the next
RTE_IXGBE_RXQ_REARM_THRESH packets that will be accessed contain
previously allocated packets.

Setting the bits is not enough. The bits are checked _after_ setting
the mbuf fields, thus a mechanism is needed to prevent the previously
used mbuf pointers from being accessed during the speculative load of
the mbuf fields. For this reason, not only the dd bits are reset, but
also the mbufs associated to those descriptors are set to point to a
"fake" mbuf.

Signed-off-by: Balazs Nemeth <balazs.nemeth@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2014-09-29 08:19:40 +02:00
Pawel Wodkowski
23fcffe8ff ixgbe: fix id and hash with flow director
When Flow Director was used together with bulk alloc, id and hash
was swapped when packet matches flow director filter due to improper
fdir field initialization.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Helin Zhang <helin.zhang@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: merged with mbuf changes]
2014-09-25 22:24:27 +02:00
Sergey Mironov
ce5abac145 igb: fix i211 support
igb_ethdev.c contains function eth_igb_infos_get() which should set
number of tx/rx queues supported by the hardware. It contains huge
[switch] but there is no i211 case!
Also, there are few other places which mention i210, but not mention i211.

I didn't check it enough to say it is totally correct.
For now I see that it just able to send and receive some packets.

Signed-off-by: Sergey Mironov <grrwlf@gmail.com>
Reviewed-by: Helin Zhang <helin.zhang@intel.com>
[Thomas: fix indent]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-24 19:33:36 +02:00
Olivier Matz
bfd5051b43 app/testpmd: new command to get extended statistics
Add a new token in "show port" command to dump the extended statistics
of a device. It validates the new xstats framework added in previous commit.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-09-23 18:03:54 +02:00
Olivier Matz
ce757f5c9a ethdev: new method to retrieve extended statistics
This method can be implemented by a poll mode driver to provide
non-standard statistics (which are not part of the generic statistics
structure). Each statistic is returned in a generic form: "name" and
"value" and can be used to dump PMD-specific statistics in the same way
than ethtool in linux kernel.

If the PMD does not provide the xstats_get and xstats_set functions, the
ethdev API will return the generic statistics in the xstats format
(name, value).

This commit opens the door for a clean-up of the generic statistics
structure, only keeping statistics that are really common to all PMDs
and moving specific ones into the xstats API.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: fix some comments]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-23 17:31:15 +02:00
Bruce Richardson
fbe37a7385 kni: remove useless file for bsd
KNI applies only to linux, so there should be no need for any kni files to
be present in the bsdapp eal folder.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-09-23 15:33:59 +02:00
David Marchand
b6ee4f9823 eal: indent files
Indent files modified in previous commit.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-23 15:33:00 +02:00
David Marchand
d7cb626f1d eal: rework long options parsing
Identify all options through the getopt_long return value.
This way, we only need a big switch/case.

Indentation is broken to ease commit review (fixed in next commit).

Suggested-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-23 15:33:00 +02:00
David Marchand
489a9d6c9f eal: merge bsd and linux common options parsing
All common options are now in a single file.
Common usage() has been moved as well.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-23 15:33:00 +02:00
David Marchand
37e341970f eal: fix checkpatch issues before moving code
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-23 15:32:59 +02:00
David Marchand
58a0cae365 eal: remove duplicate handling of white/black list
We can handle both short and long options for those in the same case.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-23 15:32:59 +02:00
David Marchand
16460b4c13 eal: factorise unsupported option handling
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-23 15:32:59 +02:00
David Marchand
1ea1e7228e eal: remove unused --use-device option
Following commit cac6d08c8b and 4bf3fe634a
(replace --use-device option by --pci-whitelist and --vdev),
this option is not available anymore.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-09-23 15:32:59 +02:00
David Marchand
29f4b57385 eal: set log level from command line
Add a --log-level option to set the default eal log level.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-09-18 20:52:42 +02:00
David Marchand
3f764189a6 e1000: add a message when forcing scatter mode
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-09-18 20:52:42 +02:00
David Marchand
5b790c6bcb e1000: always log init messages
'init' messages should always be logged and filtered at runtime by rte_log.
All the more so as these messages are not in the datapath.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-09-18 20:52:42 +02:00
David Marchand
60bd481cec e1000: clean log messages
- remove leading \n in some messages,
- remove trailing \n in some messages,
- split multi lines messages,
- introduce PMD_INIT_FUNC_TRACE macro and use it instead of
  PMD_INIT_LOG(DEBUG, "some_func")

Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Jay Rolette <rolette@infiniteio.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-09-18 20:52:42 +02:00
David Marchand
9130b43c60 e1000: indent logs sections
Prepare for next commit, indent sections where log messages will be modified so
that next patch is only about \n.

Signed-off-by: David Marchand <david.marchand@6wind.com>
2014-09-18 20:52:42 +02:00
David Marchand
5723a8d8f3 e1000/base: add a raw log macro
Since base driver always add a trailing \n, add a PMD_DRV_LOG_RAW macro that
will not add one.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-09-18 20:52:42 +02:00
David Marchand
5c7eb32ab1 e1000: use the right debug macro
- We should not use DEBUGOUT* / DEBUGFUNC macros in pmd.
These macros come as compat wrappers for base driver.
- We should avoid calling RTE_LOG directly as pmd provides a wrapper for logs.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Jay Rolette <rolette@infiniteio.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-09-18 20:52:42 +02:00