Commit Graph

35 Commits

Author SHA1 Message Date
Wang Xiao W
115c91b89a 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>
2015-10-07 13:25:06 +02:00
Wang Xiao W
2fce599022 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>
2015-10-02 18:59:51 +02:00
Thomas Monjalon
ab351fe1c9 mbuf: remove packet type from offload flags
The extended unified packet type is now part of the standard ABI.
As mbuf struct is changed, the mbuf library version is incremented.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-09-03 19:22:48 +02:00
Wang Xiao W
55a3fb5f7c fm10k: fix Tx queue cleaning after start error
When a Tx queue fails to start in fm10k_dev_start, all Rx queues
and Tx queues that are started should be cleaned before the
function returns an error.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-08-03 16:53:07 +02:00
Wang Xiao W
aa86864085 fm10k: fix queue disabling
In Rx and Tx queue_disable functions, the index of queue should
be qnum other than i which is the iteration of time expiration.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-08-03 16:50:21 +02:00
Stephen Hemminger
7cf90aeb8d drivers: allow pruning log during build
Some drivers was not following DPDK convention and
was leaving logging always in even if LOG_LEVEL was configured
to disable debug logs.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: apply same fix to i40e, fm10k and bnx2x]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-07-30 20:16:04 +02:00
Chen Jing D(Mark)
4dfda7fb3c fm10k: expose Tx checksum capability
fm10k has the capability to do checksum offload in TX side. This
change will expose the capability to application in infos_get
function.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
2015-07-27 14:43:45 +02:00
Stephen Hemminger
5fd61965ef fm10k: fix interrupt fault handling
The fm10k driver was reading the interrupt cause register but then
using the interrupt mask register defines to look at the bits.
The result is that if a fault happens, the driver would never clear
the fault and would get into an infinite cycle of interrupts.

Note: I don't work for Intel or have the hardware manuals (probably
requires NDA anyway), but this looks logical and matches how the
known working Linux driver handles these bits.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-07-22 12:46:43 +02:00
Stephen Hemminger
28d0cf90e0 fm10k: remove useless code
The return in fm10k_dev_handle_fault has useless conditional
since it always returns 0 here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-07-22 12:44:41 +02:00
Stephen Hemminger
f577a753f0 fm10k: fix missing newline in debug log
If FM10K_DEBUG_DRIVER is enabled, then the log messages about
function entry are missing newline causing extremely long lines.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-07-22 12:42:44 +02:00
Michael Qiu
456d36e6b1 fm10k: support port hotplug
Add hotplug support for fm10k.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-07-19 22:24:41 +02:00
Michael Qiu
2cb9c53449 fm10k: free queue memory when closing
When close a port, lots of memory should be released,
such as software rings, queues, etc.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
2015-07-19 22:24:41 +02:00
Sergio Gonzalez Monroy
2f9d47013e mem: move librte_malloc to eal/common
Move malloc inside eal and create a new section in MAINTAINERS file for
Memory Allocation in EAL.

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

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

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-07-16 13:44:48 +02:00
Helin Zhang
7578327b9d fm10k: replace some offload flags with packet type
To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-16 00:57:28 +02:00
Chen Jing D(Mark)
0a5311e7ef fm10k: fix RETA table initialization
fm10k has 128 RETA entries in 32 registers, but it only initialized
first 32 when doing multiple rx queue configurations. This fix will
initialize all 128 entries instead.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-07-10 22:41:03 +02:00
Shaopeng He
0681a1424d fm10k: fix error when adding default vlan
The default MAC address is read from hardware and copied to
Device Ethernet Link address array in the device initialization phase,
which bypasses fm10k MAC address number check mechanism,
and will cause an error message when adding default VLAN:
	"MAC address number not match"

Fix it by moving default MAC address registration to device
initialize phase.

Fixes: f5c1a236a2 ("fm10k: fix default mac/vlan in switch")

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-07-10 22:26:16 +02:00
Helin Zhang
8208e85a22 ethdev: add the hash key size per device
To support querying hash key size per port, an new field of
'hash_key_size' was added in 'struct rte_eth_dev_info' for storing
hash key size in bytes.

The correct hash key size in bytes should be filled into the
'struct rte_eth_dev_info', to support querying it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-09 01:14:51 +02:00
Zoltan Kiss
72514b5d55 ethdev: fix check of threshold for Tx freeing
The parameter tx_free_thresh is not consistent between the drivers:
some use it as rte_eth_tx_burst() requires, some release buffers when
the number of free descriptors drop below this value.
Let's use it as most fast-path code does, which is the latter, and update
comments throughout the code to reflect that.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-07 16:31:48 +02:00
Shaopeng He
6ffefc4c8f fm10k: support Xen domain0
fm10k was failing to run in XEN domain0, as the physical
memory for DMA should be allocated and translated
in a different way for XEN domain0. So
rte_memzone_reserve_bounded() should be used for DMA
memory allocation, and rte_mem_phy2mch() should be used
for DMA memory address translation to support running
fm10k PMD in XEN domain0.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
2015-07-01 12:39:20 +02:00
Shaopeng He
5e73a1269b fm10k: fix mac/vlan filtering
This patch includes 3 changes related to MAC/VLAN address table
when the system (e.g. testpmd) is started and closed:
 - remove default MAC address with fixed VLAN 0 which was for the
   debug purpose before the MAC/VLAN filter function was implemented.
 - enable VF MAC/VLAN filter for the first valid MAC address
   and first valid VLAN ID. This is needed for system (e.g. testpmd)
   to setup default MAC address and default VLAN for VF.
   Later attempt to change these default value will be refused by
   under layer shared code and PF host functions.
 - un-register any combination of VLAN and MAC address from fm10k
   switch side MAC table when the system (e.g. testpmd) is closed.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:59 +02:00
Shaopeng He
4f7d9e383e fm10k: update vlan offload features
Fm10k PF/VF does not support QinQ; VLAN strip and filter are always on
for PF/VF ports.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-06-22 17:27:59 +02:00
Shaopeng He
f28dd9f43b fm10k: add mac filtering
MAC filter function was newly added, each PF and VF can have up to
64 MAC addresses.
VF filter needs support from PF host, which is not available now.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-06-22 17:27:59 +02:00
Shaopeng He
2e58464ca9 fm10k: update mac table with vlan filtering
VLAN filter was updated to add/delete one static entry in MAC table for
each combination of VLAN and MAC address. More sanity checks were added.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-06-22 17:27:59 +02:00
Chen Jing D(Mark)
f5c1a236a2 fm10k: fix default mac/vlan in switch
Since the communication between PF/Switch Manager, VF/PF is
asynchronous through mailbox, it's hard to determine when Switch
Manager/PF host will send the default vlan to PF/VF. So, it's
necessary to set default vlan until the device is started.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:59 +02:00
Chen Jing D(Mark)
a66ce098e8 fm10k: check mac address
After acquiring MAC address from HW, it's necessary to validate
MAC address before use.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:59 +02:00
Chen Jing D(Mark)
13cbb05d89 fm10k: fix switch synchronization
In fm10k, PF driver needs to communicate with switch through
mailbox if it needs to add/delete MAC address.
This fix will validate if switch is ready before going forward.
Then, it is necessary to acquire LPORT_MAP info after issuing
MAC addr request to switch.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:59 +02:00
Chen Jing D(Mark)
bb9e1c066a fm10k: fix Tx multi-segment frame
In TX side, bit FM10K_TXD_FLAG_LAST in TX descriptor only is set
in the last descriptor for multi-segment packets. But current
implementation didn't set all the fields of TX descriptor, which
will cause descriptors processed now to re-use fields set in last
scroll. If FM10K_TXD_FLAG_LAST bit was set in the last round and
it happened this is not the last descriptor of a multi-segnment
packet, HW will send out the incomplete packet out and leads to
data intergrity issue.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
bd9ada24da fm10k: fix jumbo frame issue
fm10k can't receive frame greater than 1536 and Scatter RX
function can't work correctly. The root cause is
SRRCTL.FM10K_SRRCTL_BUFFER_CHAINING_EN bit is not enabled.

Test report: http://dpdk.org/ml/archives/dev/2015-June/019242.html

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
a6912bbf3e fm10k: fix Rx buffer size
As RX buffer is aligned to 512B within mbuf, some bytes are reserved
for this purpose, and the worst case could be 511B. But SRR reg
assumes all buffers have the same size. In order to fill the gap,
we'll have to consider the worst case and assume 512B is reserved.
If we don't do so, it's possible for HW to overwrite data to next
mbuf.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
829db9e181 fm10k: fix maximum queue number for VF
Both PF and VF shared code in function fm10k_stats_get().
The function works well with PF, but has problem with VF since
VF has less queues than PF.

Fixes: a6061d9e70 ("fm10k: register PF driver")

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
87afbbc7ca fm10k: remove mbuf size sanity check
Original implementation required mbuf size should be greater than
ETHER_MAX_VLAN_FRAME_LEN, which is not necessary. If it's less
than that value, scatter function will be selected and incoming
packets greater than mbuf size will be filled into several mbufs.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
df02ba8646 fm10k: support promiscuous mode
Add functions to support promiscuous/allmulticast enable and
disable.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Stephen Hemminger
6c52c126f2 drivers: explicit initialization of pci drivers
Upcoming drivers will need to be able to support other bus types.
This is a transparent change to how struct eth_driver is initialized.
It has not function or ABI layout impact, but makes adding a later
bus type (Xen, Hyper-V, ...) much easier.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-12 11:10:10 +02:00
Michael Qiu
bbd8a6f64a fm10k: fix maximum VF number
In DPDK, max_vfs means vf numbers created, not the max number vfs
the device supported.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-06-02 17:48:52 +02:00
Bruce Richardson
637bb7694d fm10k: move to drivers/net/
move fm10k PMD to drivers/net directory

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