dpdk.git
8 years agoeal: fix io permission for virtio interrupt handler
David Marchand [Wed, 14 Oct 2015 09:50:49 +0000 (11:50 +0200)]
eal: fix io permission for virtio interrupt handler

For virtio-net pmd, the interrupt management thread must be created after
this driver has initialised so that iopl() has been properly called and
its effects are inherited by all eal children threads.

Before this change, changing link status on a virtio-net device would
trigger a segfault in the interrupt thread :

$ mkdir -p /mnt/huge
$ echo 256 > /proc/sys/vm/nr_hugepages
$ mount -t hugetlbfs none /mnt/huge
$ lspci |grep Ethernet
00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
$ modprobe uio
$ insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
$ echo 0000:00:03.0 > /sys/bus/pci/devices/0000\:00\:03.0/driver/unbind
$ echo 1af4 1000 > /sys/bus/pci/drivers/igb_uio/new_id
$ ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 3 -w 0000:00:03.0 -- -i --txqflags=0xf01 --total-num-mbufs 2048
[snip]
EAL: PCI device 0000:00:03.0 on NUMA socket -1
EAL:   probe driver: 1af4:1000 rte_virtio_pmd
Interactive-mode selected
Configuring Port 0 (socket 0)
Port 0: DE:AD:DE:01:02:03
Checking link statuses...
Port 0 Link Up - speed 10000 Mbps - full-duplex
Done
testpmd>

Then, from qemu monitor:
(qemu) set_link virtio-net-pci.0 off

testpmd> Segmentation fault

Fixes: 565b85dcd9f4 ("eal: set iopl only when needed")

Reported-by: Stephen Hemminger <shemming@brocade.com>
Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
8 years agomlx4: do not expose broadcast address in MAC list
Didier Pallard [Mon, 5 Oct 2015 17:50:08 +0000 (19:50 +0200)]
mlx4: do not expose broadcast address in MAC list

Use the last array entry to store the broadcast address and keep it hidden
by not reporting the entire array size.

This is done to prevent DPDK applications from attempting to modify or
remove it.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
8 years agomlx4: save bound interface
Francesco Santoro [Mon, 5 Oct 2015 17:50:07 +0000 (19:50 +0200)]
mlx4: save bound interface

Allows applications to retrieve the name of the related netdevice.

Signed-off-by: Francesco Santoro <francesco.santoro@6wind.com>
8 years agomlx4: fix missing offload flags in scattered Rx
Adrien Mazarguil [Mon, 5 Oct 2015 17:50:06 +0000 (19:50 +0200)]
mlx4: fix missing offload flags in scattered Rx

They were dropped by mistake in the commit below.

Fixes: ab351fe1c95c ("mbuf: remove packet type from offload flags")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agoenic: fix hash creation when not using first numa node
David Marchand [Fri, 11 Sep 2015 08:02:31 +0000 (10:02 +0200)]
enic: fix hash creation when not using first numa node

If dpdk is run with memory only available on socket != 0, then hash
creation will fail and flow director feature won't be available.
Fix this by asking for allocation on caller socket.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked by: Sujith Sankar <ssujith@cisco.com>

8 years agoenic: fix allocation when not using first numa node
David Marchand [Fri, 11 Sep 2015 08:02:30 +0000 (10:02 +0200)]
enic: fix allocation when not using first numa node

Seen by code review.

If dpdk is run with memory only available on socket != 0, then enic pmd
refuses to initialize ports as this pmd requires some memory on socket 0.
Fix this by setting socket to SOCKET_ID_ANY, so that allocations happen on
the caller socket.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked by: Sujith Sankar <ssujith@cisco.com>

8 years agocxgbe: allow to change mtu
Rahul Lakkireddy [Thu, 8 Oct 2015 13:46:09 +0000 (19:16 +0530)]
cxgbe: allow to change mtu

Add a mtu_set() eth_dev_ops to allow DPDK apps to modify device mtu.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
8 years agocxgbe: receive jumbo frames
Rahul Lakkireddy [Thu, 8 Oct 2015 13:46:08 +0000 (19:16 +0530)]
cxgbe: receive jumbo frames

Ensure jumbo mode is enabled and that the mbuf data room size can
accommodate jumbo size.  If the mbuf data room size can't accommodate
jumbo size, chain mbufs to jumbo size.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
8 years agocxgbe: transmit jumbo frames
Rahul Lakkireddy [Thu, 8 Oct 2015 13:46:07 +0000 (19:16 +0530)]
cxgbe: transmit jumbo frames

Add a non-coalesce path.  Skip coalescing for Jumbo Frames, and send the
packet through non-coalesced path if there are enough credits.  Also,
free these non-coalesced packets while reclaiming credits.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
8 years agocxgbe: enable jumbo frames
Rahul Lakkireddy [Thu, 8 Oct 2015 13:46:06 +0000 (19:16 +0530)]
cxgbe: enable jumbo frames

Increase max_rx_pktlen to accommodate jumbo frame size. Perform sanity
checks and enable jumbo mode in rx queue setup. Set link mtu based on
max_rx_pktlen.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
8 years agocxgbe: optimize forwarding performance for 40G
Rahul Lakkireddy [Thu, 8 Oct 2015 13:46:05 +0000 (19:16 +0530)]
cxgbe: optimize forwarding performance for 40G

Update sge initialization with respect to free-list manager configuration
and ingress arbiter. Also update refill logic to refill mbufs only after
a certain threshold for rx.  Optimize tx packet prefetch.

Approx. 3 MPPS improvement seen in forwarding performance after the
optimization.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
8 years agocxgbe: update documentation
Rahul Lakkireddy [Thu, 8 Oct 2015 13:46:10 +0000 (19:16 +0530)]
cxgbe: update documentation

- Add a missed step to mount huge pages in Linux.
- Re-structure Sample Application Notes.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
8 years agoaf_packet: check Tx error
John W. Linville [Thu, 27 Aug 2015 17:50:50 +0000 (13:50 -0400)]
af_packet: check Tx error

Coverity CID # 13200

If sendto fails, the packets will not get transmitted.  Return 0 as
the number of packets transmitted.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
8 years agoaf_packet: refactor error handling to avoid NULL pointer dereference
John W. Linville [Thu, 27 Aug 2015 17:17:13 +0000 (13:17 -0400)]
af_packet: refactor error handling to avoid NULL pointer dereference

Coverity CID # 13321

Checking *internals != NULL before accessing req is not good enough,
because **internals is a function argument and the function doesn't
really know what is passed-in.  We can close our eyes and ignore the
warning on the basis of controlling all the calling code, or we can
refactor the error exit to avoid the issue entirely...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
8 years agoport: move metadata offset reference at mbuf head
Fan Zhang [Fri, 11 Sep 2015 13:35:45 +0000 (14:35 +0100)]
port: move metadata offset reference at mbuf head

This patch relates to ABI change proposed for librte_port. Macros to
access the packet meta-data stored within the packet buffer has been
adjusted to cover the packet mbuf structure.

The LIBABIVER number is incremented.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoapps: add name to LPM parameters
Jasvinder Singh [Thu, 17 Sep 2015 16:03:20 +0000 (17:03 +0100)]
apps: add name to LPM parameters

LPM table and pipeline apps have been modified to
include name parameter of the lpm table.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agotable: add name to LPM parameters
Jasvinder Singh [Thu, 17 Sep 2015 16:03:19 +0000 (17:03 +0100)]
table: add name to LPM parameters

This patch relates to ABI change proposed for librte_table
(lpm table). A new parameter to hold the table name has
been added to the LPM table parameter structures
rte_table_lpm_params and rte_table_lpm_ipv6_params.

The LIBABIVER number is incremented. The release notes
is updated and the deprecation announcement is removed.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoip_frag: fix bit-fields in ipv6 fragment extension
Piotr Azarewicz [Thu, 10 Sep 2015 07:09:17 +0000 (09:09 +0200)]
ip_frag: fix bit-fields in ipv6 fragment extension

Previous implementation won't work on every environment. The order of
allocation of bit-fields within a unit (high-order to low-order or
low-order to high-order) is implementation-defined.
Solution: used bytes instead of bit fields.

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agofm10k/base: add FM10420 device ids
Wang Xiao W [Thu, 10 Sep 2015 04:38:32 +0000 (12:38 +0800)]
fm10k/base: add FM10420 device ids

Add the device ID for Boulder Rapids and Atwood Channel to enable
drivers to support those devices.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: pack TLV overlay structures
Wang Xiao W [Thu, 10 Sep 2015 04:38:21 +0000 (12:38 +0800)]
fm10k/base: pack TLV overlay structures

This patch adds #pragma pack(push, 1) around some structures which are passed
via TLV messages. These structures must not be left unpacked as GCC and
other compilers are wont to do. Otherwise, we get invalid message
responses from the Switch Manager software since it sends 20 bytes and
we expect 24.

Solaris (and other OS's) are not C99 compliant, so they are not able
to use the C99 style #pragma pack() code. Wrap with C99 tag for easy
stripping.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix ieee1588 adjustment direction
Wang Xiao W [Thu, 10 Sep 2015 04:38:22 +0000 (12:38 +0800)]
fm10k/base: fix ieee1588 adjustment direction

The SYSTIME_CFG.Adjust field has a Direction bit to indicate whether the
adjustment is positive or negative. However, we incorrectly read the
documentation and the direction bit should be set 1 when positive, not
when negative.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: add clock offset message
Wang Xiao W [Thu, 10 Sep 2015 04:38:37 +0000 (12:38 +0800)]
fm10k/base: add clock offset message

Add support for clock offset message from switch manager. Each PEP will
be responsible for notifying its own VFs, and the originating PEP must
notify its own VFs prior or in addition to sending, as it will not
receive a copy of its own message. Base drivers are expected to need
custom implementations so no message handler is provided in shared code.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: add ieee1588 clock owner message support
Wang Xiao W [Thu, 10 Sep 2015 04:38:35 +0000 (12:38 +0800)]
fm10k/base: add ieee1588 clock owner message support

Add support for tx timestamp mode response message. The switch manager
should send this message whenever the owner changes or when a new port
appears. To simplify logic, treat this as full clock ownership, and call
it the CLOCK_OWNER message. Implement this as a hw->flags field, so that
base driver may use it to disable any functions which modify the clock
including Tx timestamps, frequency adjustments, and offset adjustments.
This ensures only one PEP will be handling these at a time.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: remove 1588 VF API
Wang Xiao W [Thu, 10 Sep 2015 04:38:33 +0000 (12:38 +0800)]
fm10k/base: remove 1588 VF API

Remove support for VF transmit timestamps. VFs should not write the
timestamp bit in the Tx descriptor. Only one Tx timestamp can be
realistically handled at once. It is expected that the switch manager
use FFU logic to disable all timestamp requests except for those
originating from a specific virtual port. It is not possible to
correlate this timestamp accurately if more than one occurs out any
given EPL at a time. Since the primary purpose of Tx timestamps is to
implement PTP daemon, which also requires BAR4 access to change the
clock, do not allow VFs to transmit timestamp. Remove the PF<->VF
message for this behavior.

Note, the VF already didn't have ability to request Tx timestamp mode,
so it essentially wasn't allowed to timestamp before anyways under the
old API.

No longer support old API of request-response timestamp mode messages.
New API only sends timestamp-response when the switch decides which port
will be given control of timestamps. To simplify review of this code,
completely remove the support and re-add support for the response
message in a future patch.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: check VF has a queue
Wang Xiao W [Thu, 10 Sep 2015 04:38:31 +0000 (12:38 +0800)]
fm10k/base: check VF has a queue

It is possible that the PF has not yet assigned resources to the VF.
Although rare, this could result in the VF attempting to read queues it
does not own and result in FUM or THI faults in the PF. To prevent this,
check queue 0 before we continue in init_hw_vf.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix VF re-enabling
Wang Xiao W [Thu, 10 Sep 2015 04:38:24 +0000 (12:38 +0800)]
fm10k/base: fix VF re-enabling

When a VF issues an LPORT_STATE request to enable a port which is
already enabled, the PF will first disable the VF. Then it is supposed
to re-enable the VF again with new settings. This is primarily done in
order to ensure that the switch management software properly clears the
previous VF settings. (ie: switch flow rules and so forth). However,
there is a bug in the flow because we check if VF is enabled and don't
re-enable it at the end. The issue is that we disable the VF in order to
clear switch rules, and never follow-up with a re-enable. This results in
a call to enable the VF results in disabling the logical port.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix VF queues counting
Wang Xiao W [Thu, 10 Sep 2015 04:38:20 +0000 (12:38 +0800)]
fm10k/base: fix VF queues counting

During initialization, the VF counts its rings by walking the TQDLOC
registers. This only works if the TQMAP/RQMAP registers are set to map
the out-of-bound rings to the first one, so the VF driver can detect when
it has run out of queues cleanly. Update the PF to reset the empty
TQMAP/RQMAP registers post-VFLR to prevent innocent VF drivers from
triggering malicious events.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix VF multicast
Wang Xiao W [Thu, 10 Sep 2015 04:38:27 +0000 (12:38 +0800)]
fm10k/base: fix VF multicast

The VF will send a message to request multicast addresses with the
default vid. In the current code, if the PF has statically assigned a
VLAN to a VF, then the VF will not get the multicast addresses. Fix up
all of the various vlan messages to use identical checks (since each
check was different). Also use set as a variable, so that it simplifies
our check for whether vlan matches the pf_vid.

The new logic will allow set of a vlan if it is zero, automatically
converting to the default vid. Otherwise it will allow setting the PF
vid, or any VLAN if PF has not statically assigned a VLAN. This is
consistent behavior, and allows VF to request either 0 or the
default_vid without silently failing. Note that we need the check for
zero since VFs might not get the default VID message in time to actually
request non-zero VLANs.

Create a function, fm10k_iov_select_vid which implements the logic for
selecting a default vid. This helps us remove duplicate code and
streamlines location of this logic so that we don't make similar bugs in
the future.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix VF multicast update
Wang Xiao W [Thu, 10 Sep 2015 04:38:19 +0000 (12:38 +0800)]
fm10k/base: fix VF multicast update

VFs were being improperly added to the switch's multicast group. The
error stems from the fact that incorrect arguments were passed to the
"update_mc_addr" function. It would seem to be a copy paste error since
the parameters are similar to the "update_uc_addr" function.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: add mailbox counters
Wang Xiao W [Thu, 10 Sep 2015 04:38:26 +0000 (12:38 +0800)]
fm10k/base: add mailbox counters

A previous bug was uncovered by addition of a debug stat to indicate the
actual number of DWORDS we pulled from the mbmem. It turned out this was
not the same as the tx_dwords counter. While the previous bug fix should
have corrected this in all cases, add some debug stats that count the
number of DWORDs pushed or pulled from the mbmem. Base drivers can use
this in debug builds to help detect this problem in the future.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix mailbox connect
Wang Xiao W [Thu, 10 Sep 2015 04:38:30 +0000 (12:38 +0800)]
fm10k/base: fix mailbox connect

When we connect to the mailbox, we insert a fake disconnect header so
that the code does not see an error and thus instantly error every time
we bring up the mailbox. However, we incorrectly record the tail and
head from the local perspective. Since the remote end shouldn't have
anything for us, add a "create_fake_disconnect_hdr" function which
inverts the TAIL and HEAD fields. This enables us to connect without any
errors of either TAIL or HEAD incorrectness, and prevents creating
extraneous error messages. This is necessary now since mbx_reset_work
does not actually clear the Tx FIFO head and tail pointers.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix mailbox phantom messages
Wang Xiao W [Thu, 10 Sep 2015 04:38:29 +0000 (12:38 +0800)]
fm10k/base: fix mailbox phantom messages

The phantom messages were a result of incorrectly forgetting to drop
already transmitted messages. We would reset pulled, and tail_len but
left the head/tail pointers alone.

The correct fix is to loop through pulled and drop messages until we've
dropped at least as many bytes as we pulled (possibly dropping a message
we've only partially transmitted. However, we also have to account for
tail_len variable and the 'ack' value as in mbx_pull_head. This means
that we need to re-read the HEAD field of the mailbox header.

Based on testing, this resolves the phantom messages issue, as well as
correctly keeping messages which have yet to be transmitted at all in
the Tx FIFO. Thus, we will begin re-transmission once we have
re-connected.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: ignore oversized mailbox messages
Wang Xiao W [Thu, 10 Sep 2015 04:38:16 +0000 (12:38 +0800)]
fm10k/base: ignore oversized mailbox messages

When we call update_max_size, it does not drop all oversized messages.
This is due to the difficulty in performing this operation, since it is
a FIFO which makes updating anything other than head or tail very
difficult. To fix this, modify validate_msg_size to ensure that we error
out later when trying to transmit the message that could be oversized.
This will generally be a rare condition, as it requires the FIFO to
include a message larger than the max_size negotiated during mailbox
connect. Note that max_size is always smaller than rx.size, so it should
be safe to use here.

Also, update the update_max_size function header comment to clearly
indicate that it does not drop all oversized messages, but only those at
the head of the FIFO.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: avoid Tx drop increment during mailbox negotiation
Wang Xiao W [Thu, 10 Sep 2015 04:38:15 +0000 (12:38 +0800)]
fm10k/base: avoid Tx drop increment during mailbox negotiation

After shutting down the mailbox by force, we then go about resetting max
size to 0, and clearing all messages in the FIFO. However, we should
just reset the head pointer so that the FIFO will become empty, rather than
changing the max size to 0. This helps prevent increment in tx_dropped
counter during mailbox negotiation, which is confusing to viewers of
Linux ethtool statistics output.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: scale interrupt on PCIe link speed
Wang Xiao W [Thu, 10 Sep 2015 04:38:14 +0000 (12:38 +0800)]
fm10k/base: scale interrupt on PCIe link speed

Red Rock Canyon's interrupt throttle timers are based on the PCIe link
speed. Because of this, the value being programmed into the ITR
registers must be scaled.

For the PF, this is as simple as reading the PCIe link speed and storing
the result. However, in the case of SR-IOV, the VF's interrupt throttle
timers are based on the link speed of the PF. However, the VF is unable
to get the link speed information from its configuration space, so the
PF must inform it of what scale to use.

Rather than passing this scale via mailbox message, we take advantage of
unused bits in the TDLEN register to pass the scale. It is the
responsibility of the PF to program this for the VF while setting up the
VF queues and the responsibility of the VF to get the information
accordingly. This is preferable because it allows the VF to set up the
interrupts properly during initialization and matches how the MAC
address is passed in the TDBAL/TDBAH registers.

A VF unload followed by a reload incorrectly left this value as 0.
If the VF driver blindly trusted this value it could cause a divide by
zero failure.
Fix this by having stop_hw_vf reset the ITR scale as the device goes
down, similar to the way we handle the MAC address.

To prevent divide-by-zero issues, ensure that we always have an ITR
scale. Default to Gen3 scaling if we don't know the speed. Also ensure
the VF checks the register value and ensures we use Gen3 if we are
provided a zero value.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: set unlimited bandwidth for PF queues
Wang Xiao W [Thu, 10 Sep 2015 04:38:12 +0000 (12:38 +0800)]
fm10k/base: set unlimited bandwidth for PF queues

Set PF queues used for VMDq to unlimited bandwidth when virtualization
resources are assigned.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: add VF Tx timestamp mode no-op
Wang Xiao W [Thu, 10 Sep 2015 04:38:11 +0000 (12:38 +0800)]
fm10k/base: add VF Tx timestamp mode no-op

This patch resolves a bug in Linux where we called the
request_tx_timestamp_mode function that is undefined for VF. Implement a
no-op function that simply ensures that the mode is NONE, otherwise it
would fail with ERR_PARAM.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: add PF Tx timestamp mode handler
Wang Xiao W [Thu, 10 Sep 2015 04:38:10 +0000 (12:38 +0800)]
fm10k/base: add PF Tx timestamp mode handler

We need a handler function to be able to listen for Tx timestamp mode
responses. Without this, core driver code for PTP can't determine if the
Timestamp mode request was successful. This was overlooked in the
previous commit.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: add macros for ethernet address checks
Wang Xiao W [Thu, 10 Sep 2015 04:38:25 +0000 (12:38 +0800)]
fm10k/base: add macros for ethernet address checks

To keep consistency with ND team, I add macro definitions about
FM10K_IS_VALID_ETHER_ADD in fm10k_type.h, though they have already
been defined in fm10k_osdep.h.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: remove useless variable
Wang Xiao W [Thu, 10 Sep 2015 04:38:23 +0000 (12:38 +0800)]
fm10k/base: remove useless variable

The reference to err_no was left around after an old re-factor. We never
use this value again, and the macros called on the function appear to
have no relevant side effect I could see. Discovered via cppcheck
fm10k_mbx.c:1312: (style) Variable 'err_no' is assigned a value that is never used.

This occurred because a previous commit refactored and removed all used
references to err_no.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix debug typo
Wang Xiao W [Thu, 10 Sep 2015 04:38:36 +0000 (12:38 +0800)]
fm10k/base: fix debug typo

The function is specifically for the PF, but the DEBUGFUNC labeled it
with *_vf.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agofm10k/base: fix a comment
Wang Xiao W [Thu, 10 Sep 2015 04:38:13 +0000 (12:38 +0800)]
fm10k/base: fix a comment

The header comment included a miscopy of a C-code line, and also
mis-used Rx FIFO when it clearly meant Tx FIFO.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
8 years agoeal: add new i40e device id
Jingjing Wu [Sun, 6 Sep 2015 07:12:06 +0000 (15:12 +0800)]
eal: add new i40e device id

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add outer UDP checksum for X722
Jingjing Wu [Sun, 6 Sep 2015 07:11:56 +0000 (15:11 +0800)]
i40e/base: add outer UDP checksum for X722

Fixes a minor definition change in the Rx descriptor.
Also adds FortPark specific changes to the Descriptors.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add WOL/proxy capability parsing
Jingjing Wu [Sun, 6 Sep 2015 07:11:54 +0000 (15:11 +0800)]
i40e/base: add WOL/proxy capability parsing

Adds support to retrieve and parse WoL/Proxy capabilities from the
device/function list.
Also saves WR_CSR_PROT field from DEV/FUNC capabilities.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: support WOL config for X722
Jingjing Wu [Sun, 6 Sep 2015 07:11:53 +0000 (15:11 +0800)]
i40e/base: support WOL config for X722

Adds admin q function for "Set Wake on LAN Filter AQ"
and "Get Wake Up Reason AQ".

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: support proxy config for X722
Jingjing Wu [Sun, 6 Sep 2015 07:11:52 +0000 (15:11 +0800)]
i40e/base: support proxy config for X722

Adds admin q functions for "Set Proxying Configuration Command"
and "Set NS Proxy Table Entry Command".

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: support RSS for X722
Jingjing Wu [Sun, 6 Sep 2015 07:11:51 +0000 (15:11 +0800)]
i40e/base: support RSS for X722

Add AQ functions to handle RSS Key and LUT programming.
This is needed for FortPark RSS support.

FortPark has additional PCTYPES supported for RSS

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add X722 specific registers
Jingjing Wu [Sun, 6 Sep 2015 07:12:02 +0000 (15:12 +0800)]
i40e/base: add X722 specific registers

This patch adds registers and bit field definitions specific to FortPark.
Most of these new registers are related to PE (IWARP), Reset, NVM, RSS
and ATR changes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add X722 device
Jingjing Wu [Sun, 6 Sep 2015 07:11:50 +0000 (15:11 +0800)]
i40e/base: add X722 device

Add device ids for X722 devices

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: print FCoE capability
Jingjing Wu [Sun, 6 Sep 2015 07:11:59 +0000 (15:11 +0800)]
i40e/base: print FCoE capability

This is to allow quick check for FCoE capability is enabled or not
in device function before any SW overrides.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: support ESS
Jingjing Wu [Sun, 6 Sep 2015 07:11:58 +0000 (15:11 +0800)]
i40e/base: support ESS

Add some delays specific to ESS/Veloce system.
This patch requires driver changes to define ESS_SUPPORT.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add definition of GLINT_CTL register
Jingjing Wu [Sun, 6 Sep 2015 07:11:47 +0000 (15:11 +0800)]
i40e/base: add definition of GLINT_CTL register

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: support pre-allocated pages for pd
Jingjing Wu [Sun, 6 Sep 2015 07:11:44 +0000 (15:11 +0800)]
i40e/base: support pre-allocated pages for pd

The i40e_add_pd_table_entry() routine is being modified to handle both
cases where a backing page is passed and where backing page is allocated
in i40e_add_pd_table_entry().

For pble resource management, it is more efficient for it to manage its
backing pages. For VF, pble backing page addresses will be send to PF
driver for pble resource.

The i40e_remove_pd_bp() is also modified to not free pre-allocated pages and
free only ones which were allocated in i40e_add_pd_table_entry().

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add checks for CEE APP priority validity
Jingjing Wu [Sun, 6 Sep 2015 07:11:43 +0000 (15:11 +0800)]
i40e/base: add checks for CEE APP priority validity

The firmware has added additional status information to allow software
to determine if the APP priority for FCoE/iSCSI/FIP is valid or not in
CEE DCBX mode.

This patch adds to support those additional checks and will only add
applications to the software table that have oper and sync bits set
without any error.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: more Solaris config
Jingjing Wu [Sun, 6 Sep 2015 07:11:48 +0000 (15:11 +0800)]
i40e/base: more Solaris config

In order to support some extra Solaris features the Solaris VF drivers need
additional configuration data from the PF that aren't provided with the current
virtual channel commands.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: fix padding in struct
Jingjing Wu [Sun, 6 Sep 2015 07:11:41 +0000 (15:11 +0800)]
i40e/base: fix padding in struct

The struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with
word boundary layout issues, which most compilers deal with by silently
adding padding, making the actual struct larger than designed.
This patch adds an extra byte in fields reserved3 and reserved4 to directly
acknowledge that padding.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: remove useless assignments
Jingjing Wu [Sun, 6 Sep 2015 07:12:00 +0000 (15:12 +0800)]
i40e/base: remove useless assignments

The assignments of addr_high and addr_low were not only wrong because
they were assigning virtual addresses to a hardware accessed variable,
but they were shortly thereafter overwritten by the send_asq_command
call with a non-NULL third argument (buffer) with correctly formatted
data.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: minor clean up
Jingjing Wu [Sun, 6 Sep 2015 07:11:45 +0000 (15:11 +0800)]
i40e/base: minor clean up

Use INLINE macro for better cross-platform code management.

Clean up some unnecessary logic jumping and drop a variable.

There was one more __FUNCTION__ reference that wasn't needed.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add new link status defines
Jingjing Wu [Sun, 6 Sep 2015 07:11:40 +0000 (15:11 +0800)]
i40e/base: add new link status defines

Add the new Port link status bit and rename the link status to function
link status.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: explicitly assign index for VSI type
Jingjing Wu [Sun, 6 Sep 2015 07:12:05 +0000 (15:12 +0800)]
i40e/base: explicitly assign index for VSI type

The change is to explicitly assign enum index for each VSI type
so that PF and VF always reference to the same VSI type even if the
enum lists are different.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add more stats
Jingjing Wu [Sun, 6 Sep 2015 07:11:36 +0000 (15:11 +0800)]
i40e/base: add more stats

This will help us avoid a whole bunch of log messages when the driver
is running.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: update Flex-10 capabilities
Jingjing Wu [Sun, 6 Sep 2015 07:11:37 +0000 (15:11 +0800)]
i40e/base: update Flex-10 capabilities

The Flex10 device/function capability has been upgraded to revision 2
to include information needed to support Flex-10 DCC and DCI
configurations. This patch adds new fields to the i40e_hw_capabilities
structure and updates i40e_parse_discover_capabilities functions to
extract them from the AQ response. Naming convention has changed to use
flex10 mode instead of existing mfp_mode_1.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: store CEE DCBX config
Jingjing Wu [Sun, 6 Sep 2015 07:11:35 +0000 (15:11 +0800)]
i40e/base: store CEE DCBX config

This patch adds capability to query and store the CEE DCBX DesiredCfg
and RemoteCfg data from the LLDP MIB.
Added new member "desired_dcbx_config" in the i40e_hw data structure
to hold CEE only DesiredCfg data.

Store the CEE TLV status returned by firmware to allow drivers to dump that
for debug purposes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add PHY capabilities
Jingjing Wu [Sun, 6 Sep 2015 07:11:34 +0000 (15:11 +0800)]
i40e/base: add PHY capabilities

Remove unused members in the PHY structure and add a new member to store
all the capabilities the PHY has as reported by the FW. This information will
help us determine what speeds the device is capable of when link is
down.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: prepare local LLDP MIB in TLV
Jingjing Wu [Sun, 6 Sep 2015 07:11:33 +0000 (15:11 +0800)]
i40e/base: prepare local LLDP MIB in TLV

This patch prepares the LLDP MIB in IEEE TLV format based on
the local dcb config.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add parsing for CEE DCBX TLVs
Jingjing Wu [Sun, 6 Sep 2015 07:11:32 +0000 (15:11 +0800)]
i40e/base: add parsing for CEE DCBX TLVs

This patch adds parsing for CEE DCBX TLVs from the LLDP MIB.

While the driver gets the DCB CEE operational configuration from Firmware
using the "Get CEE DCBX Oper Config" AQ command there is a need to get
the CEE DesiredCfg Tx by firmware and DCB configuration Rx from peer; for
debug and other application purposes.

Also gets rid of unused locals variables.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: use bit shift macros
Jingjing Wu [Sun, 6 Sep 2015 07:11:31 +0000 (15:11 +0800)]
i40e/base: use bit shift macros

Use macros for abstracting (1 << foo) to BIT(foo)
and (1ULL << foo64) to BIT_ULL(foo64) in order to match
better with linux kernel requirements.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: increase PF reset max loop limit
Jingjing Wu [Sun, 6 Sep 2015 07:12:01 +0000 (15:12 +0800)]
i40e/base: increase PF reset max loop limit

With latest LANconf and NVMupdate tools, pf_reset failed due to Firmware not
being ready, so this patch increases I40E_PF_RESET_WAIT_COUNT to 200, using
original value defined for A0 silicon, in order to make sure that FW is ready.

Test result indicates that firmware became ready at the loop count of 114.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: wrap the register definitions for PF and VF
Jingjing Wu [Sun, 6 Sep 2015 07:11:38 +0000 (15:11 +0800)]
i40e/base: wrap the register definitions for PF and VF

There were quite a few issues when the wrong defines were getting used
in the VF driver. This patch defines a new #define PF_DRIVER.
All the PF specific register definitions are wrapped in it.

The drivers will have to be updated to use the define in the PF
driver builds. Makes for a very short register.h for VF drivers.

Also fixes the code where PF driver register fields were getting used for
VF driver.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add VF capabilities to virtual channel interface
Jingjing Wu [Sun, 6 Sep 2015 07:11:30 +0000 (15:11 +0800)]
i40e/base: add VF capabilities to virtual channel interface

To prepare for the changes coming up in the X722 device and future
devices, the virtual channel interface has to change slightly. The VF
driver can now report what its capable of supporting, which then informs
the PF driver when it sends the configuration information back to the
VF.

A 1.1 VF driver on a 1.0 PF driver should not send its capabilities.
Likewise, a 1.1 PF driver controlling a 1.0 VF driver should not expect
or depend upon receiving the VF capabilities.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add OEM post update
Jingjing Wu [Sun, 6 Sep 2015 07:11:29 +0000 (15:11 +0800)]
i40e/base: add OEM post update

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add debug dump internal data
Jingjing Wu [Sun, 6 Sep 2015 07:11:28 +0000 (15:11 +0800)]
i40e/base: add debug dump internal data

This patch adds support for "Debug Dump Internal Data" AQ command.
It is used to dump internal firmware or hardware data for debug
purposes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add workaround to drop all flow control frames
Jingjing Wu [Sun, 6 Sep 2015 07:11:27 +0000 (15:11 +0800)]
i40e/base: add workaround to drop all flow control frames

This patch adds a workaround to drop any flow control frames from being
transmitted from any VSI. FW can still send Flow control frames if Flow
control is enabled.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add promiscuous on VLAN
Jingjing Wu [Sun, 6 Sep 2015 07:11:26 +0000 (15:11 +0800)]
i40e/base: add promiscuous on VLAN

NFV use cases require the ability to steer packets to VSIs by VLAN tag
alone while being in promiscuous mode for multicast and unicast MAC
addresses.  These two new functions support that ability.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: allow per-device FW API version
Jingjing Wu [Sun, 6 Sep 2015 07:12:03 +0000 (15:12 +0800)]
i40e/base: allow per-device FW API version

Allow for unique FW API versions for different HW

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: get OEM version
Jingjing Wu [Sun, 6 Sep 2015 07:11:23 +0000 (15:11 +0800)]
i40e/base: get OEM version

This patch adds a member to the nvm_info struct for oem_ver info to be
output either by OID or ethtool.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: handle AQ timeout when releasing NVM
Jingjing Wu [Sun, 6 Sep 2015 07:11:46 +0000 (15:11 +0800)]
i40e/base: handle AQ timeout when releasing NVM

There are some rare cases where the release resource call will return an
admin Q timeout. In these cases the code needs to try to release the
resource again until it succeeds or it times out.

Also add little endian conversion for checksum

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add commands for NVM update
Jingjing Wu [Sun, 6 Sep 2015 07:11:25 +0000 (15:11 +0800)]
i40e/base: add commands for NVM update

Add a new GetStatus command so that the NVM update tool can query
the current status instead of doing fake write requests to probe for
readiness.
Add a facility to run AQ commands through the nvmupdate utility in order
to allow the update tools to interact with the FW and do special
commands needed for updates and configuration changes.
Add a facility to recover the result of a previously run AQ command.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add wait states to NVM state machine
Jingjing Wu [Sun, 6 Sep 2015 07:11:24 +0000 (15:11 +0800)]
i40e/base: add wait states to NVM state machine

This adds wait states to the NVM update state machine to signify when
waiting for an update operation to finish, whether we're in the middle
of a set of Write operations, or we're now idle but waiting.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add Tx scheduling related AQ commands
Jingjing Wu [Sun, 6 Sep 2015 07:11:42 +0000 (15:11 +0800)]
i40e/base: add Tx scheduling related AQ commands

This patch adds support for AQ commands related to Tx scheduling.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: save AQ write back descriptor
Jingjing Wu [Sun, 6 Sep 2015 07:11:22 +0000 (15:11 +0800)]
i40e/base: save AQ write back descriptor

Add the ability to save the AdminQ write back descriptor. If the writeback
descriptor buffer was previously created, this gives it to the AQ command
request to be used to save the results.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: grab AQ spinlocks before clearing registers
Jingjing Wu [Sun, 6 Sep 2015 07:11:21 +0000 (15:11 +0800)]
i40e/base: grab AQ spinlocks before clearing registers

Make sure we have the spinlocks before we clear the ARQ and ASQ management
registers.  Also, widen the locked portion and make a sanity check earlier
in the send function to be sure we're working with safe register values.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: save link module type
Jingjing Wu [Sun, 6 Sep 2015 07:11:20 +0000 (15:11 +0800)]
i40e/base: save link module type

Add a module_types variable to the link_info struct to save the module
information from get_phy_capabilities. This information can be used to
determine which speeds the module supports.

Also add a new function update_link_info which updates the module_types
parameter and then calls get_link_info. This function should be called
in place of get_link_info so that the module_types variable stays
up-to-date with the rest of the link information.

Also rework the function get_link_status to allow caller to get all
return values in the call chain bubbled back to the source, which keeps
information about failures from being lost.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: update AQ command header
Jingjing Wu [Sun, 6 Sep 2015 07:11:19 +0000 (15:11 +0800)]
i40e/base: update AQ command header

Update the admin queue command header for the Fortville SW 4 Release. As
part of this release the minor FW API version number is bumped to 4 so
that the FW API version for the FVLSW4 release will now be 1.4.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: reformat AQ debug output
Jingjing Wu [Sun, 6 Sep 2015 07:11:18 +0000 (15:11 +0800)]
i40e/base: reformat AQ debug output

Replace sprintf with i40e_debug.
Pad the line out with zeros to get to 16 bytes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: fix error code conversion type
Jingjing Wu [Sun, 6 Sep 2015 07:11:39 +0000 (15:11 +0800)]
i40e/base: fix error code conversion type

The error code sent into i40e_aq_rc_to_posix() are signed values, so we
really need to treat them as such.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add error status decoding
Jingjing Wu [Sun, 6 Sep 2015 07:11:17 +0000 (15:11 +0800)]
i40e/base: add error status decoding

Add status value to string decoding routines to be used in error reporting
in order to give more readable error messages rather than bare error
numbers.  This decodes both the i40e_status and the AQ error codes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: add new device id for 20Gb and Fort pond
Jingjing Wu [Sun, 6 Sep 2015 07:11:16 +0000 (15:11 +0800)]
i40e/base: add new device id for 20Gb and Fort pond

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoi40e/base: move device ids into a separate file
Jingjing Wu [Sun, 6 Sep 2015 07:11:15 +0000 (15:11 +0800)]
i40e/base: move device ids into a separate file

Due to desires to write userland drivers such as for DPDK support, and
other requests, without needing the rest of the include files, the device
ids are pulled out into a standalone file.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
8 years agoethdev: remove old flow director API
Jingjing Wu [Mon, 21 Sep 2015 07:34:09 +0000 (15:34 +0800)]
ethdev: remove old flow director API

Old flow director API have been replaced by rte_eth_dev_filter_ctrl
since release 2.0. And no driver in current code support these functions.
All the removed functions are listed below:
  - rte_eth_dev_fdir_add_perfect_filter;
  - rte_eth_dev_fdir_add_signature_filter;
  - rte_eth_dev_fdir_get_infos;
  - rte_eth_dev_fdir_remove_perfect_filter;
  - rte_eth_dev_fdir_remove_signature_filter;
  - rte_eth_dev_fdir_set_masks;
  - rte_eth_dev_fdir_update_perfect_filter;
  - rte_eth_dev_fdir_update_signature_filter;

The library version was already incremented in a previous patch.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
[Thomas: fix mlx4 and update release notes]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoenic: remove #ident lines
Sujith Sankar [Tue, 22 Sep 2015 05:15:02 +0000 (10:45 +0530)]
enic: remove #ident lines

This patch removes the #ident strings at the beginning of the source files.

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
8 years agovhost: inject only one interrupt for a batch of packets
Huawei Xie [Mon, 21 Sep 2015 08:16:14 +0000 (16:16 +0800)]
vhost: inject only one interrupt for a batch of packets

In merge-able RX path, vhost injects interrupts to guest for each packet.
This should degrade performance a lot.
This patch fixes this issue by injecting one interrupt for a batch of packets.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
8 years agovhost: fix wrong usage of eventfd_t
Yuanhan Liu [Wed, 9 Sep 2015 05:34:36 +0000 (13:34 +0800)]
vhost: fix wrong usage of eventfd_t

According to eventfd man page:

    typedef uint64_t eventfd_t;

    int eventfd_read(int fd, eventfd_t *value);
    int eventfd_write(int fd, eventfd_t value);

eventfd_t is defined for the second arg(value), but not for fd.

Here I redefine those fd fields to `int' type, which also removes
the redundant (int) cast. And as the man page stated, we should
cast 1 to eventfd_t type for eventfd_write().

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agovhost: get rid of duplicate code
Yuanhan Liu [Wed, 9 Sep 2015 05:34:35 +0000 (13:34 +0800)]
vhost: get rid of duplicate code

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agovhost: fix typo
Yuanhan Liu [Wed, 9 Sep 2015 05:34:34 +0000 (13:34 +0800)]
vhost: fix typo

_det => _dev

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agovhost: remove extra semicolon
Yuanhan Liu [Wed, 9 Sep 2015 05:34:33 +0000 (13:34 +0800)]
vhost: remove extra semicolon

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agodoc: update release notes
John McNamara [Thu, 24 Sep 2015 16:23:40 +0000 (17:23 +0100)]
doc: update release notes

Update the DPDK 2.2 release notes with recent fixes:

  9db649 eal/linux: fix epoll timeout
  d49e0f hash: fix memory allocation of cuckoo key table
  7fcd13 ixgbe: fix X550 DCB
  5e73f4 ixgbe: remove burst size restriction of vector Rx
  7e01e3 i40e: fix base driver allocation when not using first numa node
  d53364 vhost: fix qemu shutdown

The order of sections (and inside) is inspired from MAINTAINERS file.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agovhost: build eventfd_link module against specified kernel
Aaron Conole [Wed, 23 Sep 2015 20:03:36 +0000 (16:03 -0400)]
vhost: build eventfd_link module against specified kernel

The vHost eventlink driver is a kernel module that requires a kernel
source/build directory to build the ko. Convert the fixed kernel build
directory specifier to one which may be user specified on the command-line.

Signed-off-by: Aaron Conole <aconole@redhat.com>
8 years agovhost: fix qemu shutdown
Ouyang Changchun [Thu, 20 Aug 2015 04:01:10 +0000 (12:01 +0800)]
vhost: fix qemu shutdown

This patch originates from the patch:
"Patch for Qemu wrapper for US-VHost to ensure Qemu process ends when
VM is shutdown", http://dpdk.org/ml/archives/dev/2014-June/003606.html

Also update the vhost sample guide doc.

Signed-off-by: Claire Murphy <claire.k.murphy@intel.com>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>