Commit Graph

3090 Commits

Author SHA1 Message Date
Harish Patil
9a6d30ae6d net/qede: refactoring vport handling code
The refactoring is mainly for two reasons:

- To remove an additional layer of internal callbacks for all vport
  related operations from the struct qed_eth_ops_pass. Instead, we
  can invoke base APIs directly.

- Splitting a single large vport-update configuration into multiple and
  independent vport-update operations. Each configuration would touch
  only the required config bits that needs an update.

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-06-12 10:41:29 +01:00
Ajit Khaparde
4cfe399f65 net/bnxt: support to set VF rxmode
This patch adds support to configure the VF L2 Rx settings.
The per VF setting is maintained in bnxt_child_vf_info.l2_rx_mask

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:29 +01:00
Ajit Khaparde
18c2854b96 net/bnxt: configure a default VF VLAN
This patch adds code to insert a default VF VLAN.
Also track the current default VLAN per vnic for the VF.
When setting the default VLAN, avoid setting it to the current value.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:29 +01:00
Ajit Khaparde
7a5b087444 net/bnxt: support to add a VF MAC address
This patch adds support to allocate a filter and program
it in the hardware for every MAC address added to the specified
function.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:29 +01:00
Ajit Khaparde
ff63ebbb67 net/bnxt: determine the Rx status of VF
This patch adds code to determine the Rx status of a VF.
It adds the rte_pmd_bnxt_get_vf_rx_status call, which calculates
the VNIC count of the function to get the Rx status.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
dd46c6bbd5 net/bnxt: support get and clear VF specific stats
This patch adds code to get and clear VF stats.

It also adds the necessary HWRM structures to send the command
to the firmware.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
36735a932c net/bnxt: support set VF QOS and MAC anti spoof
This patch adds support to
1) enable VF MAC anti spoof.
2) QOS configuration for specified VF.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
49947a13ba net/bnxt: support Tx loopback, set VF MAC and queues drop
Add functions rte_pmd_bnxt_set_tx_loopback,
rte_pmd_bnxt_set_all_queues_drop_en and
rte_pmd_bnxt_set_vf_mac_addr to configure tx_loopback,
queue_drop and VF MAC address setting in the hardware.
It also adds the necessary functions to send the HWRM commands
to the firmware.

Signed-off-by: Steeven Li <steeven.li@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
bb81e07323 net/bnxt: support LED on/off
This patch adds support for dev_led_on/off dev_ops

HWRM calls added:
bnxt_hwrm_port_led_qcaps()
bnxt_hwrm_port_led_cfg()

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
577d3dced0 net/bnxt: refactor the query stats
1) Use hwrm_stat_ctx_query command to query statistics
   Using hwrm_stat_ctx_query command will allow polling
   the statistics from hardware instead of using the current push
   model from the hardware which does a DMA of the stats to the host
   at fixed intervals.

2) Use the rx_mbuf_alloc_fail to track mbuf alloc failures.

3) We were wrongly incrementing hwrm_cmd_seq in bnxt_hwrm_stat_clear
   and bnxt_hwrm_stat_ctx_alloc functions.  This patch fixes that.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
3e12fdb78e net/bnxt: support VLAN pvid
This patch adds code to support vlan_pvid_set dev_op

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
2fc201884b net/bnxt: support rxq/txq get information
Add support for txq_info_get and rxq_info_get dev_ops

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
0958d8b643 net/bnxt: support LRO
This patch adds support to enable and disable LRO
To support this feature, the driver creates an aggregator ring.
When the hardware starts doing LRO, it sends a tpa_start completion.
When the driver receives a tpa_end completion, it indicates that the
LRO chaining is complete.

Signed-off-by: Steeven Li <steeven.li@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
daef48efe5 net/bnxt: support set MTU
This patch adds support to modify MTU using the set_mtu dev_op.
To support frames > 2k, the PMD creates an aggregator ring.
When a frame greater than 2k is received, it is fragmented
and the resulting fragments are DMA'ed to the aggregator ring.
Now the driver can support jumbo frames upto 9500 bytes.

Signed-off-by: Steeven Li <steeven.li@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
e2652b0a20 net/bnxt: support get FW version
This patch adds support for fw_version_get dev_op

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
d69851df12 net/bnxt: support multicast filter and set MAC addr
This patch adds support for set_mc_addr_list and
mac_addr_set dev_ops

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
7fe5668d2e net/bnxt: support VLAN filter and strip
This patch adds VLAN strip and offload callbacks.
To add a VLAN filter:
    For each VNIC and each associated filter(s)
        if VLAN exists:
            if VLAN matches vlan_id
                VLAN filter already exists, just skip and continue
            else
                add a new MAC+VLAN filter
        else
            Remove the old MAC only filter
            Add a new MAC+VLAN filter

To remove a VLAN filter:
    For each VNIC and each associated filter(s)
        if VLAN exists && VLAN matches vlan_id
            remove the MAC+VLAN filter
            add a new MAC only filter
        else
            VLAN filter doesn't exist, just skip and continue

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
bfb9c2260b net/bnxt: support xstats get/reset
This patch adds support to get and reset xstats dev_ops

dev_ops added:
xstats_get, xstats_get_name, xstats_reset

HWRM commands added:
hwrm_port_qstats, hwrm_port_clr_stats

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
10d074b202 net/bnxt: support tunneling
Add support for udp_tunnel_port_add/del dev_ops to configure a UDP port
for VXLAN and Geneve Tunnel protocols.

The HWRM supports only one global destination port for a tunnel type,
use a reference counter to keep track of its usage.
Cache the configured VXLAN/Geneve ports and use that value to check
if the right UDP port is being freed up.
Skip calling bnxt_hwrm_tunnel_dst_port_alloc if the same UDP port is
being programmed.
Skip calling bnxt_hwrm_tunnel_dst_port_free if no UDP port has been
configured.

Also update tx offload capabilities

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
ccba2af2db net/bnxt: add additional HWRM debug info
Add the cmd_err and opaque_0 and opaque_1 fields to HWRM error
messages.  These allow better debugging of some classes of HWRM
errors.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
84f2c526d3 net/bnxt: support lack of huge pages
rte_malloc_virt2phy() does not return a physical address if huge pages
aren't in use.  Further, rte_memzone->phys_addr is not a physical address.

Use rte_mem_virt2phy() and manually lock pages to support lack of
huge pages.

Also check the return value of rte_mem_virt2phy()

Verify the function returns an address. Otherwise return an error and
log a message.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
4535cad395 net/bnxt: handle VF/PF initialization appropriately
1) For a VF, query the firmware to determine if a MAC address is
   already configured. If not configure a random default MAC address.

2) Do not initialize the default completion ring in
   bnxt_alloc_hwrm_rings().

3) While registering for async events with the firmware,
   use func_vf_cfg for a VF and use func_cfg for a PF.

4) Query the VNIC plcmode config using the bnxt_hwrm_vnic_plcmodes_qcfg
   before a VNIC is updated. Reconfigure the VNIC with the plcmode
   configuration queried earlier. Not doing this could overwrite
   the plcmodes in some cases.

5) Reorg the bnxt_handle_fwd_req to properly handle the forwarded
   requests. The previous code did not handle it completely.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
b7778e8a1c net/bnxt: refactor to properly allocate resources for PF/VF
1) Move the function reset to bnxt_dev_init.
   On the same lines, setup, enable and request interrupt to init path.
   Memory allocation is also being done in the init path.

2) After a function reset, configure the VFs.  Distribute resources
   evenly between all functions (PF and VF) for now. In the future, this
   should be controllable.

3) The bnxt_vf_info and bnxt_pf_info had lot of duplication. Move the
   common items to struct bnxt. And only unique items specific to PF
   remain in the struct bnxt_pf_info.

4) Program the firmware to allow certain commands sent by a VF.
   Disallowing these will prevent clean VF driver cleanup.

5) Since PF/VF need to allocate resources from a pool in the hardware,
   use func_qcaps and func_qcfg to appropriately query the capabilities
   and available resources.

6) If a PF is being initialized and no VFs are allocated, explicitly
   call func_cfg to allocate the resources.

7) Once resources are requested from the firmware, update local copy
   of resource count in struct bnxt only after sending the func_qcfg to
   make sure the allocation request in the firmware went through.

The changes in this patch will be used by the subsequent patches
to allow proper initialization of PF/VF instance.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
655a007238 net/bnxt: update to HWRM version 1.7.7
This patch updates the Broadcom bnxt PMD to version 1.7.7
Most of the changes in the patch are in the hsi_struct_def_dpdk.h - an
autogenerated file. The changes in the *.c files are because of changes
in the macro names.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Qi Zhang
98abce237b net/i40e: fix VF statistics
CRC bytes should be excluded, so rx/tx bytes of VF stats is aligned
with PF stats.

Fixes: 9aace75fc8 ("i40e: fix statistics")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-06-12 10:41:28 +01:00
Wei Zhao
37c11ed57d net/e1000: add support 2-tuple filter on i210/i211
Add support of i210 and i211 type nic in 2-tuple filter.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:28 +01:00
Qi Zhang
0bcdc44510 net/i40e: exclude internal packet's byte count
Tx/Rx byte counts of internal managed packet should be
excluded from the total rx/tx bytes.

Fixes: 9aace75fc8 ("i40e: fix statistics")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-06-12 10:41:28 +01:00
Qi Zhang
f35fec63dd net/ixgbe: enable flex bytes for generic flow API
Add fdir flex byte support for rte_flow APIs.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:28 +01:00
Qi Zhang
8d702249d5 net/ixgbe: fix fdir mask not be reset
When the last fdir flow be destroyed, the flag "mask_added"
should be reset, so the remain mask info will not take effect
when a new flow be added.

Fixes: a14de8b498 ("net/ixgbe: destroy consistent filter")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:27 +01:00
Qi Zhang
0601d85d90 net/ixgbe: remove redundant code
Remove redundant code.
item->type != RTE_FLOW_ITEM_TYPE_END already cover
item->type == RTE_FLOW_ITEM_TYPE_VLAN.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:27 +01:00
Beilei Xing
7cf5491b7b net/i40e: update actions for FDIR
This commit adds support of FLAG action and PASSTHRU
action for flow director.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-06-12 10:41:27 +01:00
Radu Nicolau
e261265e42 ethdev: move bypass functions to ixgbe PMD
Move all bypass functions to ixgbe pmd and remove function
pointers from the eth_dev_ops struct.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:27 +01:00
Wei Zhao
760110abd6 net/igb: fix checksum valid flags
To enable L4 checksum offload for SCTP packets, E1000_RXCSUM_CRCOFL
should be set.

Otherwise, for SCTP packets even L4 checksum not calculated, it will
return PKT_RX_L4_CKSUM_GOOD.

Fixes: af75078fec ("first public release")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:27 +01:00
Yongseok Koh
c80711c3fb net/mlx5: fix redundant free of Tx buffer
SW completion ring of Tx (txq->elts) stores individual mbufs even if a
multi-segmented packet is sent. rte_pktmbuf_free_seg() must be used when
cleaning up the completion ring. Otherwise, chained mbufs are redundantly
freed and finally it would cause a crash.

Fixes: 1d88ba1719 ("net/mlx5: refactor Tx data path")
CC: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-06-12 10:41:27 +01:00
Yongseok Koh
70aee77ec6 net/mlx5: fix exception handling
A sanity check is required in priv_fdir_disable(). If resizing Rx queue
fails, this can cause a crash by referencing a NULL pointer.

Fixes: 76f5c99e68 ("mlx5: support flow director")
Fixes: 0cdddf4d06 ("net/mlx5: split Rx queue structure")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-06-12 10:41:27 +01:00
Andrew Rybchenko
21233dd6c7 net/sfc: rely on one desc is one mbuf in simple EF10 Tx reap
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: David Riddoch <driddoch@solarflare.com>
2017-06-12 10:41:27 +01:00
Andrew Rybchenko
3fd7797fcd net/sfc: check added but not completed descs on EF10 Tx reap
There is not point to check other Tx descriptors.
It is important if Tx datapath does not reset Tx descriptor
mbuf pointer to NULL on completion (EF10 simple Tx will do).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: David Riddoch <driddoch@solarflare.com>
2017-06-12 10:41:27 +01:00
Chas Williams
96b00e3a6a net/ring: fix adding MAC addresses
When .mac_addr_add() was changed to allow a return code, ring was changed
to return -ENOTSUP.  This changes the behavior of the rte_ring driver in
a way that does not maintain backward compatibility.  Additionally, if
the intent is to return -ENOTSUP, you could simply not define the stubs.

Fixes: 6d01e580ac ("ethdev: fix adding invalid MAC address")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <ciwillia@brocade.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-06-12 10:41:27 +01:00
Nélio Laranjeiro
d6ed7be7b4 net/mlx5: remove already initialised mbuf fields
Since commit 8f094a9ac5 ("mbuf: set mbuf fields while in pool"), some
fields are already initialised and do not need to be modified by the PMD
anymore.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-06-12 10:41:27 +01:00
Nélio Laranjeiro
c8ffb8a9cc net/mlx5: fix flow application order on stop/start
Flow rules must be applied in the same order as they have been created and
thus destroyed in the reverse order.

Fixes: 2097d0d1e2 ("net/mlx5: support basic flow items and actions")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-06-12 10:41:27 +01:00
Wei Dai
09049d5266 net/ixgbe/base: update shared code version to 2017.05.16
* Remove PHY access for some 1G ports
* Disable X550EM-x 1GBASE-T led switch support

Signed-off-by: Wei Dai <wei.dai@intel.com>
2017-06-12 10:41:27 +01:00
Wei Dai
667af1981f net/ixgbe/base: disable X550EM-x 1GBASE-T led switch support
This patch disables X550EM_X 1Gbase-t led_[on|off] support since
the LEDs are wired to the PHY and the driver can not access the
PHY. led_[on|off]

Support is disabled by setting the function pointer to NULL.
init_led_link_act is also set to NULL.

Signed-off-by: Wei Dai <wei.dai@intel.com>
2017-06-12 10:41:27 +01:00
Wei Dai
91b0fdf44e net/ixgbe/base: remove PHY access for some 1G ports
This patch removes some some 1GBASE-T PHY access since the FW
configures the PHY. SW shall not configure or initialize link.
Accessing the PHY would require the use of MDI clause 22 which
should be avoided in high layer driver code.

Signed-off-by: Wei Dai <wei.dai@intel.com>
2017-06-12 10:41:27 +01:00
Andrew Rybchenko
69fbd1e923 net/sfc: handle already flushed Tx queue gracefully
Tx queue may be already flushed because of previous Tx error or
MC reboot.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:27 +01:00
Andrew Rybchenko
a47c6d6246 net/sfc: add Tx queue flush failed flag for sanity
Avoid usage of flushing state when Tx queue flush init failed.

Fixes: fed9aeb46c ("net/sfc: implement transmit path start / stop")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:27 +01:00
Andrew Rybchenko
69d753f483 net/sfc: handle already flushed Rx queue gracefully
Rx queue may be already flushed because of previous Rx error or
MC reboot.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:27 +01:00
Andy Moreton
af39bcc612 net/sfc/base: let caller know that queue is already flushed
Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or
MC reboot. Caller needs to know that the queue is already flushed to
avoid waiting for flush done event.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:27 +01:00
Andy Moreton
7236d2bfe0 net/sfc/base: fix error code usage in common code
MCDI results returned in req.emr_rc have already been translated
from MC_CMD_ERR_* to errno names, so using an MC_CMD_ERR_* value
is incorrect.

Fixes: e7cd430c86 ("net/sfc/base: import SFN7xxx family support")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
ee606d9278 net/cxgbe: configure PCIe extended tags
Add support to configure minimum and maximum PCIe extended tag.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
c12974c54c net/cxgbe: remove rmb bottleneck in Rx path
rmb before determining rsp_type is a bottleneck.
Once we determine rsp-type is FL, we can directly go ahead and read
packets based on q->stat->pidx and budget_left.

This removes bottleneck of rmb once per every RX packet.
Now, rmb exists once per RX batch.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
d87ba24d1a net/cxgbe: fix rxq default params for ports under same PF
Enabling rx queues with default interrupt parameters doesn't happen
for other ports under same PF due to FULL_INIT_DONE flag being set
by the first port.

Fix is to to allow each port to enable its own rx queues with default
parameters.

Fixes: 0462d11544 ("cxgbe: add device related operations")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
6c2809628c net/cxgbe: improve latency for slow traffic
TX coalescing waits for ETH_COALESCE_PKT_NUM packets to be coalesced
across bursts before transmitting them.  For slow traffic, such as
100 PPS, this approach increases latency since packets are received
one at a time and tx coalescing has to wait for ETH_COALESCE_PKT
number of packets to arrive before transmitting.

To fix this:

- Update rx path to use status page instead and only receive packets
  when either the ingress interrupt timer threshold (5 us) or
  the ingress interrupt packet count threshold (32 packets) fires.
  (i.e. whichever happens first).

- If number of packets coalesced is <= number of packets sent
  by tx burst function, stop coalescing and transmit these packets
  immediately.

Also added compile time option to favor throughput over latency by
default.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
4dee49c1d4 net/cxgbe: remove LSB interrupt support
Remove RTE_PCI_DRV_INTR_LSC from driver flags, since LSC interrupts
are currently not supported.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
ea6a99c077 net/cxgbe: fix port statistics
Do not count pause frames as part of normal TX/RX Frame/Byte counts.
Also, switch to using software counters rather than hardware for RX
stats.

Fixes: 856505d303 ("cxgbe: add port statistics")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
cd9ce8c373 net/cxgbe: add compressed error vector
Add support for compressed error vector available in cpl_rx_pkt for
Chelsio T6.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
edd04c6196 net/cxgbe: update Rx path for Chelsio T6
Update RX path to reflect Chelsio T6 register value changes.
Update ingress pack boundary value based on maximum payload size
that can be accommodated by underlying PCI.  Update ingress pad
boundary value based on smallest memory controller bus width
possible.  Enforce alignment for free list pointer start address.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
10c6d94761 net/cxgbe: update RXQ channel mapping for Chelsio T6
Update MPS buffer groups and TP ingress channel congestion map to
correct RXQ allocation for Chelsio T6.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
f146dd8863 net/cxgbe: update Tx path for Chelsio T6
Update TX path to reflect Chelsio T6 changes.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
c962618cc3 net/cxgbe: update hardware info prints
Update informational prints pertaining to underlying hardware.
Add bootstrap firmware version and expansion ROM version prints.
Move the prints to a single function.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
69aed04230 net/cxgbe/base: add forward error correction support
Add forward error correction (FEC) support and update link
configuration.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
9da2a69417 net/cxgbe: update link speeds and port modules
Add 25G and 100G link speeds and update supported port modules.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
5eb55bf8a4 net/cxgbe: grab available ports after firmware reset
Move code to get the available ports from the firmware after it had
been reset.  This ensures that driver uses the latest info on available
ports after firmware reset.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:27 +01:00
Rahul Lakkireddy
516306a2dd net/cxgbe/base: update flash part information
Update flash part identification and decoding to accommodate new
flash parts.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:26 +01:00
Rahul Lakkireddy
42be1b98da net/cxgbe/base: update register dump
Add Chelsio T6 registers to register dump.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:26 +01:00
Rahul Lakkireddy
04868e5bfd net/cxgbe: add support to run Chelsio T6 cards
Add code to detect and run T6 devices.  Update PCI ID Device table
with Chelsio T6 device ids and update documentation.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-06-12 10:41:26 +01:00
Ferruh Yigit
0362b7294d net/avp: remove redundant assignment
dev_info->driver_name is assigned by rte_eth_dev_info_get()
and existing value overwritten, removing assignment.

Fixes: 1a85922369 ("net/avp: add device configuration")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
2017-06-12 10:41:26 +01:00
Pascal Mazon
8ae3023387 net/tap: add Rx/Tx checksum offload support
This patch adds basic offloading support, widely expected in a PMD.

Verify IPv4 and UDP/TCP checksums upon packet reception, and set
ol_flags accordingly.

On Tx, set IPv4 and UDP/TCP checksums when required, considering
ol_flags.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-06-12 10:41:26 +01:00
Pascal Mazon
f96fe1ab35 net/tap: fix some flow collision
The following two flow rules (testpmd syntax) should not collide:
flow create 0 priority 1 ingress pattern eth / ipv4 / end actions drop / end
flow create 0 priority 1 ingress pattern eth / ipv6 / end actions drop / end

But the eth_type in the associated TC rule was set to either "ip" or
"ipv6".  For TC, they could thus not have the same priority.

Use ETH_P_ALL only in the TC message to make sure those rules can
coexist.

Fixes: de96fe68ae ("net/tap: add basic flow API patterns and actions")
Cc: stable@dpdk.org

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
748eccb97c net/dpaa2: add support for firmware version get
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
e164084994 net/dpaa2: configure jumbo frames
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
977d0006ad net/dpaa2: add support for flow control
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
a1f3a12cd5 net/dpaa2: add link status config support
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
d20e6e600b net/dpaa2: add support for VLAN strip
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
3ce294f223 net/dpaa2: add support for VLAN filter and offload
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
5d5aeeedab net/dpaa2: add support for multicast promiscuous mode
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
b4d97b7d31 net/dpaa2: add support for MAC address filtering
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
23d6a87ee2 net/dpaa2: add support for tail drop on queue
This will help in limiting the size of queues and avoid
them growing practically infinite.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
7ae777d064 net/dpaa2: add support for congestion notification
In case of HW egress FQ is congested, skip further
transmission of frames.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
5c6942fdb9 net/dpaa2: support parallel Rx
Typically when the PMD issues a Rx command to DPAA2 hardware,
the HW writes the available descriptors into the given memory.
The RX function then processes the frames and prepare them as
mbufs.

This patch adds support to issue another pull request to hardware
in another memory location, before we start processing the output
of the first request. This help in controlling the CPU cycles
wasted during the wait for the hardware to write the descriptors.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
d4984046b5 net/dpaa2: improve the error handling in dev init
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
9464dbe9c9 net/dpaa2: stop using software annotation
The DPAA2 driver is not using the DPAA2 frame descriptor
software annotation area. This patch reduces the
PTA length to zero and adjust the RX Buffer Layout
accordingly.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
19b7dc6a26 net/dpaa2: remove port level buffer layout definition
This code in device init is not required, as the buffer
layout setting is also being programmed during queue configuration.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Andrew Rybchenko
e71ec16bbb net/sfc: advertise that device is detachable
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:26 +01:00
Shijith Thotton
37ba0b9001 net/liquidio: set device speed capability info
Add subsystem device id of CN23xx cards and expose speed capability of
devices. Update liquidio feature file to mark support.

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
2017-06-12 10:41:26 +01:00
Markus Theil
167e7b9ae5 net/igb: fix add/delete of flex filters
Before this patch, flex_filter->index was always zero when it was read
and used after rte_zmalloc. The corresponding code was therefore moved
into the add and delete parts of the if/else statement.

Fixes: 231d43909a ("igb: migrate flex filter to new API")
Cc: stable@dpdk.org

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:26 +01:00
Markus Theil
2764556a84 net/igb: support flex filters on i210/i211
i210/i211 also support flex filters. Tested on i210.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:26 +01:00
Shahaf Shuler
626e8bfb84 net/mlx5: fix completion buffer size
Completion buffer size was computed wrongly, causing
completion polling to wraparound too early and miss entries.

Fixing it by using Direct Verbs to query the CQ info.

Fixes: 6218063b39 ("net/mlx5: refactor Rx data path")
Fixes: 1d88ba1719 ("net/mlx5: refactor Tx data path")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-06-12 10:41:26 +01:00
Chas Williams
74b7fc0a0f net/af_packet: fix packet bytes counting
On error, we also need to zero the bytes transmitted.

Fixes: f4ff17a465 ("net/af_packet: guard against buffer overruns in Tx path")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <ciwillia@brocade.com>
2017-06-12 10:41:26 +01:00
Chas Williams
92656e96dd net/af_packet: handle possible null pointer
Fixes: 1b93c2aa81 ("net/af_packet: add interface name to internals")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <ciwillia@brocade.com>
2017-06-12 10:41:26 +01:00
Andrew Rybchenko
f28ede500c net/sfc: support multi-process
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-06-12 10:41:26 +01:00
Andrew Rybchenko
b7be9f4349 net/sfc: use locally stored data for logging
Required to be able to use logging in the secondary process
where Ethernet device pointer stored in sfc_adapter is invalid.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-06-12 10:41:26 +01:00
Andrew Rybchenko
35870e506d net/sfc: carefully cleanup on init failure and shutdown
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-06-12 10:41:26 +01:00
John Daley
936a9b9975 net/enic: flow API debug
Added a debug function to print enic filters and actions when
rte_validate_flow is called. Compiled in CONFIG_RTE_LIBRTE_ENIC_DEBUG_FLOW
is enabled and log level is INFO.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2017-06-12 10:41:26 +01:00
John Daley
aa3d2ff821 net/enic: flow API for Legacy NICs
5-tuple exact Flow support for 1200 series adapters. This allows:
Attributes: ingress
Items: ipv4, ipv6, udp, tcp (must exactly match src/dst IP
       addresses and ports and all must be specified).
Actions: queue and void
Selectors: 'is'

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2017-06-12 10:41:26 +01:00
John Daley
26faa126d8 net/enic: flow API for NICs with advanced filters disabled
Flow support for 1300 series adapters with the 'Advanced Filter'
mode disabled via the UCS management interface. This allows:
Attributes: ingress
Items: Outer eth, ipv4, ipv6, udp, sctp, tcp, vxlan. Inner eth, ipv4,
       ipv6, udp, tcp.
Actions: queue and void
Selectors: 'is', 'spec' and 'mask'. 'last' is not supported

With advanced filters disabled, an IPv4 or IPv6 item must be specified
in the pattern.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2017-06-12 10:41:26 +01:00
John Daley
2bbfbd48b7 net/enic: flow API mark and flag support
For VICs with filter tagging, support the MARK and FLAG actions
by setting appropriate mbuf ol_flags if there is a filter match.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2017-06-12 10:41:26 +01:00
John Daley
6ced137607 net/enic: flow API for NICs with advanced filters enabled
Flow support for 1300 series adapters with the 'Advanced Filter'
mode enabled via the UCS management interface. This enables:
Attributes: ingress
Items: Outer eth, ipv4, ipv6, udp, sctp, tcp, vxlan. Inner eth, ipv4,
       ipv6, udp, tcp.
Actions: queue, and void
Selectors: 'is', 'spec' and 'mask'. 'last' is not supported

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2017-06-12 10:41:26 +01:00
John Daley
0f76668039 net/enic: flow API skeleton
Stub callbacks for the generic flow API and a new FLOW debug define.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2017-06-12 10:41:26 +01:00
John Daley
322b355f21 net/enic/base: bring NIC interface functions up to date
Update the base functions for the Cisco VIC. These files are mostly
common with other VIC drivers so are left alone is as much as possible.
Includes in a new filter/action interface which is needed for Generic
Flow API PMD support. Update FDIR code to use the new interface.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2017-06-12 10:41:25 +01:00
Wenzhuo Lu
bc9ee862ba net/i40e/base: fix Tx error stats on VF
Unfortunately the datasheet has a mistake. The
address of the TX error counter is wrong.

Fixes: 8db9e2a1b2 ("i40e: base driver")
CC: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:25 +01:00
Markus Theil
3d8ae69732 net/igb: support MAC filters for i210 and i211 chips
i210 and i211 also support unicast MAC filters.
The patch was tested on i210 based hw, for i211
support was looked up in the specs.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:25 +01:00
Michael Lilja
68d19b480e net/i40e: improve FDIR programming times
Previously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of
22usec with a max of 60usec .

Signed-off-by: Michael Lilja <ml@napatech.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-06-12 10:41:25 +01:00
John Miller
2f3b88fbab net/ark: fix return value of null not checked
Coverity issue: 144517
Fixes: 1131cbf0fb ("net/ark: stub PMD for Atomic Rules Arkville")
Cc: stable@dpdk.org

Signed-off-by: John Miller <john.miller@atomicrules.com>
2017-06-12 10:41:25 +01:00
John Miller
bc10f22b6d net/ark: fix null pointer dereference
Coverity issue: 144520
Fixes: 727b3fe292 ("net/ark: integrate PMD")
Cc: stable@dpdk.org

Signed-off-by: John Miller <john.miller@atomicrules.com>
2017-06-12 10:41:25 +01:00
John Miller
d1434c0479 net/ark: fix return code not checked
Coverity issue: 144514
Fixes: 727b3fe292 ("net/ark: integrate PMD")
Cc: stable@dpdk.org

Signed-off-by: John Miller <john.miller@atomicrules.com>
2017-06-12 10:41:25 +01:00
John Miller
79a158130f net/ark: fix buffer not null terminated
Coverity issue: 144512
Coverity issue: 144513
Fixes: 9c7188a68d ("net/ark: provide API for hardware modules pktchkr and pktgen")
Cc: stable@dpdk.org

Signed-off-by: John Miller <john.miller@atomicrules.com>
2017-06-12 10:41:25 +01:00
Ferruh Yigit
c0802544d9 drivers/net: add generic ethdev macro to get PCI device
Instead of many PMD define their own macro, define a generic one in
ethdev and use that in PMDs.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:25 +01:00
Ferruh Yigit
dd2c630a5f drivers/net: remove unnecessary macro for unused variables
remove __rte_unused instances that are not required.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:25 +01:00
Pascal Mazon
460bf26fd8 net/tap: do not set remote MAC if not necessary
Check for the current MAC address on both the remote and the tap
netdevices before setting a new value.

While there, remove wrong empty lines and ensure tap_ioctl() return
value is negative, just like what is done throughout this code.

Fixes: 2bc06869cd ("net/tap: add remote netdevice traffic capture")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-06-12 10:41:25 +01:00
Pascal Mazon
bf7b7f437b net/tap: create netdevice during probing
This has three main benefits:
 - tun_alloc is now generic again for any queue,
 - mtu no longer needs to be handled in tap_setup_queue(),
 - an actual netdevice is created as soon as the device is probed.

On top of it, code in eth_dev_tap_create() has been reworked to have a
more logical behavior; initialization can now fail if a remote is
requested but cannot be set up.

Fixes: 2bc06869cd ("net/tap: add remote netdevice traffic capture")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-06-12 10:41:25 +01:00
Pascal Mazon
b32105eb1f net/tap: drop unnecessary nested block
This is cosmetic; the code is functionally equivalent.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-06-12 10:41:25 +01:00
Pascal Mazon
2e05e1d8c5 net/tap: remove unnecessary functions
These functions are only two lines each and are used only once.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-06-12 10:41:25 +01:00
Pascal Mazon
7748a4b441 net/tap: add debug messages
Print a detailed debug message inside tap_ioctl() directly. The caller
now only needs to check for return value.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-06-12 10:41:25 +01:00
Pascal Mazon
f6921783fe net/tap: add support for fixed MAC addresses
Support for a fixed MAC address for testing with the last octet
incrementing by one for each interface defined with the new 'mac=fixed'
string on the --vdev option. The default option is still to randomize
the MAC address for each tap interface.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2017-06-12 10:41:25 +01:00
Herakliusz Lipiec
799c5c602d net/i40e: add return value checks
Coverity issue: 1379362
Coverity issue: 1379365
Fixes: 71d35259ff ("i40e: tear down flow director")
Cc: stable@dpdk.org

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2017-06-12 10:41:25 +01:00
Ferruh Yigit
b46069d4b1 net/null: do not touch mbuf next or nb segs on Rx
mbuf next and nb_segs fields already have the default values when get
from mempool, no need to update them in PMD.

See: 8f094a9ac5 ("mbuf: set mbuf fields while in pool")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
2017-06-12 10:41:25 +01:00
Ferruh Yigit
7623f1f8b9 net/ixgbe: do not touch mbuf initialized fields
See: 8f094a9ac5 ("mbuf: set mbuf fields while in pool")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:25 +01:00
Jerin Jacob
95b097c803 net/thunderx: add compile-time checks
The thunderx PMD is sensitive to the layout of the mbuf on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-06-12 10:41:25 +01:00
Bruce Richardson
02c217b154 net/fm10k: add compile-time checks to vector driver
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-12 10:41:25 +01:00
Bruce Richardson
b25f49d8e1 net/i40e: add compile-time checks to vector driver
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-12 10:41:25 +01:00
Bruce Richardson
631a2f530b net/ixgbe: add compile-time checks to vector driver
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-12 10:41:25 +01:00
Jerin Jacob
c6dfeecb15 eal: introduce macro for no inline
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-06 22:31:45 +02:00
Jerin Jacob
c0583d98a9 eal: introduce macro for always inline
Different drivers use internal macros like force_inline for compiler
always inline feature.
Standardizing it through __rte_always_inline macro.

Verified the change by comparing the output binary file.
No difference found in the output binary file with this change.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-06 17:21:55 +02:00
David Marchand
06e81dc9b7 drivers/net: fix vfio kmod dependency
vfio is the kernel framework used by the vfio-pci kernel driver.
DPDK drivers do not rely solely on vfio, but rather on vfio-pci to gain
access to pci resources.

Fixes: 0880c40113 ("drivers: advertise kmod dependencies in pmdinfo")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-06-05 20:56:54 +02:00
Yongseok Koh
5e0fbcf9fb net/mlx5: fix rollback when starting device
In mlx5_dev_start(), the spinlock isn't released when returning error.

Fixes: c8d4ee50cc ("net/mlx5: fix startup when flow cannot be applied")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-05-10 21:41:25 +02:00
Rasesh Mody
8b3ee85efe net/qede: fix RSS table entries for 100G adapter
With the change in base APIs the logic for 100G handling needs to be
adjusted to pass cid values instead for queue ids. The current API
works assuming its queue id.

Fixes: 69d7ba88f1 ("net/qede/base: use L2-handles for RSS configuration")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-05-10 18:07:15 +02:00
Yongseok Koh
3730e6c6d7 net/mlx5: change error-prone code on Tx path
In the main loop of mlx5_tx_burst(), pointers/indexes are advanced at the
beginning. Therefore, those should be rolled back if checking resource
availability fails and breaks the loop. And some of them are even
redundant.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-05-10 18:05:18 +02:00
Yongseok Koh
ac180a21f6 net/mlx5: fix index handling for Tx ring
In case of resource deficiency on Tx, mlx5_tx_burst() breaks the loop
without rolling back consumed resources (txq->wqes[] and txq->elts[]). This
can make application crash because unposted mbufs can be freed while
processing completions. Other Tx functions don't have this issue.

Fixes: 3f13f8c23a ("net/mlx5: support hardware TSO")
Fixes: f04f1d5156 ("net/mlx5: fix Tx WQE corruption caused by starvation")
Cc: stable@dpdk.org

Reported-by: Hanoch Haim <hhaim@cisco.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-05-10 18:04:55 +02:00
Qi Zhang
491681ed63 net/ixgbe: fix LSC interrupt
There is a bug in previous fix for lsc interrupt.
lsc interrupt is not disabled before delayed handler,
that cause the delayed handler be re-entered.

Fixes: 9b66721070 ("net/ixgbe: fix blocked interrupts")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-10 17:33:07 +02:00
Wei Dai
0fcd5ef9eb net/ixgbe: fix calling null function of VF
hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
be called directly. It had better be replaced by calling
ixgbe_get_media_type( ) to avoid crash.

Fixes: c12d22f65b ("net/ixgbe: ensure link status is updated")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Laurent Hardy <laurent.hardy@6wind.com>
2017-05-10 17:18:12 +02:00
Bruce Richardson
6104a5224d net/ixgbe: add switch fall-through comments
Add a comment documenting explicitly that we are falling through the case
statements to the next one.

Fixes: f9072f8b90 ("ixgbe: migrate flow director filtering to new API")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 18:36:55 +02:00
Bruce Richardson
f91e80c66c net/bnx2x: add switch fall-through comments
Add in a comment for each switch fall-through indicating that it is
intentional. This will fix compiler warnings with GCC 7.

Fixes: b5bf771922 ("bnx2x: driver support routines")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-05-05 18:36:42 +02:00
Bruce Richardson
2fff4ff7b7 net/vmxnet3: fix build with gcc 7
GCC 7 flags a value as uninitialized before used. While it's a false
positive, there is little harm in providing an initial value for the
variable.

Fixes: bb1d14b87f ("vmxnet3: fix link state handling")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-05-05 18:36:42 +02:00
Bruce Richardson
803d48340c drivers/net: disable new gcc 7 warnings for base code
For base code in drivers shared with other projects, disable the new
warnings from gcc 7 about unlabelled fall-through in switch statements.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-05-05 18:27:09 +02:00
Ferruh Yigit
131fe44346 net/af_packet: prefer snprintf against strncpy
strncpy may left destination buffer not NULL terminated, switched using
snprintf to be sure destination buffer is NULL terminated.

Coverity issue: 1407495
Coverity issue: 1407498
Fixes: cc68ac4847 ("net/af_packet: support MTU change")
Fixes: 218259590e ("net/af_packet: support promiscuous")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-05-05 17:52:55 +02:00
Yongseok Koh
6839dae96c net/mlx5: fix crash on deleting flow drop queue
If mlx5_dev_start() fails, it tries to rollback data structures related to
rte_flow including drop queue. The destruction code doesn't assume the
structures are created but priv_flow_delete_drop_queue() never does sanity
check. This can cause a crash.

Fixes: 028761059a ("net/mlx5: use an RSS drop queue")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-05-05 17:46:26 +02:00
Shahaf Shuler
993b2455fb net/mlx5: fix Tx max inline with TSO
When TSO is enabled, Verbs layer aggregates the TSO
inline size with the txq inline size for the Tx creation,
while the PMD takes the maximum among them.

Fixing it by adjusting the max inline parameter before
passing to to Verbs.

Fixes: 3f13f8c23a ("net/mlx5: support hardware TSO")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-05-05 17:43:34 +02:00
Qi Zhang
70fca51612 net/fm10k: fix memory overflow in 32-bit SSE Rx
Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: a6ce64a975 ("fm10k: introduce vector driver")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-05-05 17:40:21 +02:00
Qi Zhang
f4afa1a048 net/i40e: fix memory overflow in 32-bit SSE Rx
Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: 8e109464c0 ("i40e: allow vector Rx and Tx usage")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-05-05 17:40:21 +02:00
Qi Zhang
6d65eba145 net/ixgbe: fix memory overflow in 32-bit SSE Rx
Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: c95584dc2b ("ixgbe: new vectorized functions for Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-05-05 17:40:21 +02:00
Wenzhuo Lu
ff8282f4bb net/i40e: consider QinQ when setting MTU
When counting max packet length from MTU, count
VLAN tag length twice for QinQ packets.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-05-05 17:24:22 +02:00
Beilei Xing
b4325edd9a net/i40e: add LLDP check for ethertype filter
LLDP rule is not supported in ethertype filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-05-05 17:19:52 +02:00
Jia Yu
22d0e5aed3 net/ixgbe: fix setting MTU on stopped device
There exists case that software sets mtu (i.e jumbo frame) of
ixgbe device when it's stopped. Before the fix, scattered_rx
is cleared during device stop, and setting jumbo frame mtu
after device stop will always fail as scattered_rx is 0.

Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 17:17:09 +02:00
Wei Dai
b604589d57 net/ixgbe: fix VF Rx mode for allmulticast disabled
Some customers find that 82599 NIC DPDK VF PMD can't receive any
broadcast packets when it is bound to igb_uio in the first time
to run a DPDK application like testpmd. But when the application
is quited and run again, the DPDK VF PMD can receive broadcast
packets again. The associated PF is run by kernel driver when
the VF is driven by DPDK PMD.

Fixes: 260e2e22e2 ("net/ixgbe/base: move multicast mode update")
Fixes: 72dec9e37a ("ixgbe: support multicast promiscuous mode on VF")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 17:02:03 +02:00
Wenzhuo Lu
c53e2c6f92 net/ixgbe: fix default MAC setting
Pool 0 is not PF, it's VF 0. So the MAC is set for VF 0
but not PF.
The code introduced a weird issue. In the scenario PF + VF,
when only starting PF, the default PF MAC address is working.
But after starting a VF, the default PF MAC address becomes
the VF's address.

Use the pool which is not occupied by VFs for PF to fix it.

Fixes: 8164fe8284 ("ixgbe: add default mac address modifier")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 16:54:04 +02:00
Qiming Yang
10f28c196c net/igb: fix VF MAC address setting
We find that VF receive address register is not set
if MAC address is assigned by PF. This patch fixes it.

Fixes: d82170d279 ("igb: add VF support")
Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 16:53:49 +02:00
Qiming Yang
580b85f6ba net/igb: fix VF MAC address setting
VF default MAC address be added in PF Mac address list
instead of VF MAC address list, makes VF can't receive
packets. This patch fixes this issue.

Fixes: be2d648a2d ("igb: add PF support")
Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 16:52:59 +02:00
Wei Dai
6d01e580ac ethdev: fix adding invalid MAC address
Some customers find adding MAC addr to VF sometimes can fail,
but it is still stored in dev->data->mac_addrs[ ]. So this
can lead to some errors that assumes the non-zero entry in
dev->data->mac_addrs[ ] is valid.
Following acknowledgements are from specific NIC PMD
maintainer for their managing part.

This patch changes the ethdev internal API, it should not be
backported to a stable/LTS release so far.

Fixes: af75078fec ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 16:27:11 +02:00
Thomas Monjalon
2f6fec5390 vdev: remove eal prefix
The VDEV code will move to the bus drivers directory.
Rename functions from rte_eal_vdev_ to rte_vdev_
to prepare the move of the driver out of EAL.

The prefix rte_eal_vdrv_ is also renamed to rte_vdev_.
It was used for registration of vdev drivers.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2017-05-05 14:38:35 +02:00
Thomas Monjalon
3dcfe0390c pci: remove eal prefix
The PCI code will move to the bus drivers directory.
Rename functions from rte_eal_pci_ to rte_pci_
to prepare the move of the driver out of EAL.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2017-05-05 14:38:17 +02:00
Kuba Kozak
fca82a8acc net/ixgbe: support xstats by ID
To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
ixgbe_dev_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and ixgbe_dev_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
2017-05-01 23:48:39 +02:00
Kuba Kozak
484f8e407a net/igb: support xstats by ID
To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
eth_igb_xstats_get_by_id() which retrieve
values of statistics specified by ids array
and eth_igb_xstats_get_names_by_id() which retrieve
names of statistics specified by ids array.

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
2017-05-01 23:48:39 +02:00
Kuba Kozak
0a5beecf46 ethdev: revert xstats by ID
Revert patches to provide clear view for
upcoming changes. Reverted patches are listed below:
commit ea85e7d711 ("ethdev: retrieve xstats by ID")
commit a954495245 ("ethdev: get xstats ID by name")
commit 1223608adb ("app/proc-info: support xstats by ID")
commit 25e38f09af ("net/e1000: support xstats by ID")
commit 923419333f ("net/ixgbe: support xstats by ID")

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
2017-05-01 23:38:00 +02:00
Ferruh Yigit
0f31eb0cf2 net/ark: fix kvargs memory leak
Coverity issue: 1428042
Fixes: 1131cbf0fb ("net/ark: stub PMD for Atomic Rules Arkville")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: John Miller <john.miller@atomicrules.com>
2017-05-01 22:35:05 +02:00
Pascal Mazon
ec12df9504 net/tap: fix support for large Rx queues
Rx queues configured with more than 1023 descriptors cause readv() calls to
fail due to more iovec entries than permitted by the kernel. As a result,
no packets can be received.

Quietly limit internal Rx queue size to the maximum number of iovec entries
to fix this issue.

Fixes: 0781f5762c ("net/tap: support segmented mbufs")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-05-01 22:32:55 +02:00
Jerin Jacob
b31eb10546 net/thunderx: fix deadlock in Rx path
RBDR buffers are refilled when SW consumes the buffers from CQ.
This creates deadlock case when CQ buffers exhausted due to lack
of RBDR buffers. Fix is to refill the RBDR when rx_free_thresh
meet, irrespective of the number of CQ buffers consumed.

Fixes: e2d7fc9f0a ("net/thunderx: add single and multi-segment Rx")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-05-01 22:23:57 +02:00
Huanle Han
0e78cfddc0 net/virtio: fix crash when closing twice
This commit fixs segment fault when rte_eth_dev_close() is called on
a virtio dev more than once.  Assigning zero after free to avoids
freed memory to be accessed again.

Fixes: 69c80d4ef8 ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-28 07:01:22 +02:00
Jianfeng Tan
2c2201fb07 net/virtio-user: fix device type check
Segfault happens when using virtio-user after commit 7f0a669e7b
("ethdev: add allocation helper for virtual drivers").

It's due to we use ethdev->device to recognize physical devices,
but after above commit, this field is also filled for virtual
devices. Then we obtain the wrong pci_dev pointer and accessing
its field when copying pci info results in segfault.

To fix it, we use hw->virtio_user_dev to differentiate physical
devices from virtual devices.

Fixes: 6a7c0dfcdf ("net/virtio: do not depend on PCI device of ethdev")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-28 07:01:22 +02:00
Jianfeng Tan
58d9fe4000 net/virtio: fix link status always down
The virtio port link status will always be DOWN:

The commit aa9f060617 ("net/virtio: fix link status always being up")
introduces a flag to help checking the status. If this flag is not set,
status will be always down. However, in dev start, this flag is set
after link status update, then we miss the chance to change the status
to UP in dev start.

To fix this bug, we simply move the link status update after the flag
setting so that the status can be correctly updated.

Fixes: aa9f060617 ("net/virtio: fix link status always being up")
Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-28 07:01:22 +02:00
Jianfeng Tan
ee1843bd89 net/virtio: remove redundant MSI-X detection
As we already change to use capability list to detect MSI-X, remove
the redundant MSI-X detection in legacy devices.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-28 07:01:22 +02:00
Jianfeng Tan
a60a0c1507 net/virtio: fix LSC setting
LSC flag is set in several places, but only the last one takes effect;
so we remove the redundant ones and just keep the last one.

This also fixes the bug that dev_flags being overwritten by
rte_eth_copy_pci_info(), which resets it to 0 unconditionally.

Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-28 07:01:17 +02:00
Jianfeng Tan
554b6d3ef9 net/virtio: fix MSI-X for modern devices
The field, use_msix, in struct virtio_hw is not updated for modern
device, and is always zero. And now we depend on the status feature
and MSI-X to report LSC support (which is also not a correct
behavior). As a result, LSC is always disabled for modern devices.

To fix this, we just recognize MSI-X capability when going through
capability list, and update the info in virtio.

Fixes: 6ba1f63b5a ("virtio: support specification 1.0")
Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-28 06:41:52 +02:00
Ferruh Yigit
f353fbc596 net/avp: fix interrupt migration check
Bitwise OR within if statement is always true, fix bitwise operator.

Coverity issue: 1423906
Fixes: 82e140b849 ("net/avp: handle interrupt migration")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
2017-04-28 14:46:19 +02:00
Wei Zhao
cec7ddd290 net/ixgbe: fix ntuple filter for SCTP
Add the support of RTE_FLOW_ITEM_TYPE_SCTP type packet for
ixgbe ntuple filter.

Fixes: 672be56d76 ("net/ixgbe: parse n-tuple filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-28 14:46:19 +02:00
Laurent Hardy
c12d22f65b net/ixgbe: ensure link status is updated
In case of fiber and link speed set to 1Gb at peer side (with autoneg
or with defined speed), link status could be not properly updated at
time cable is plugged-in.
Indeed if cable was not plugged when device has been configured and
started then link status will not be updated properly with new speed
as no link setup will be triggered.

To avoid this issue, IXGBE_FLAG_NEED_LINK_CONFIG is set to try a link
setup each time link_update() is triggered and current link status is
down. When cable is plugged-in, link setup will be performed via
ixgbe_setup_link().

Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-04-28 14:46:19 +02:00
Wei Wang
210903803f net/bonding: fix updating slave link status
We need to update dev->data->dev_link before handling LSC event.
Otherwise it will still have the initial value after the startup of
the program before interrupt callback was executed.

Fixes: 414b202343 ("bonding: fix initial link status of slave")
Cc: stable@dpdk.org

Signed-off-by: Wei Wang <lnykww@gmail.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-28 14:46:18 +02:00
Wei Zhao
0e2fa44641 net/ixgbe: fix type check for flow type
The type check for flow_type should be IXGBE_ATR_FLOW_TYPE_IPV4
in special card not RTE_ETH_FLOW_NONFRAG_IPV4_OTHER.

Fixes: dc0c16105d ("ixgbe: fix X550 flow director check")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-28 14:46:18 +02:00
Wei Zhao
3d54a4d9ce net/ixgbe: remove useless item type check
Remove a useless item type check for fdir flow rule.

Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-28 14:46:18 +02:00
Alejandro Lucero
aaef1010af net/nfp: fix releasing muti-segment mbufs
If segments are used, just mbufs previously linked to head descriptor
of a mbuf chain are released. Other Tx descriptor are used for the
mbuf chain but they keep their linked mbufs without releasing them.

It is not a fatal issue because sooner or later those descriptors will
be head descriptors or just used for a single mbuf packet, then those
linked mbufs will be released.

However, this leads to apps needing bigger mbufs pools and some
confusion about memory requirements. Indeed, because larger pools, some
performance impact could also be expected due to cache misses.

With this patch all Tx descriptors will release linked mbufs inside the
xmit function, and rte_pktmbuf_seg_free is used instead of
rte_pktmbuf_free.

Fixes: 142854c621 ("nfp: fix freeing multi-mbuf packets")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-04-28 14:46:18 +02:00
Ajit Khaparde
3fab769440 net/bnxt: add new device ids
Add support for new device ids.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-04-28 14:46:18 +02:00
Matt Peters
09c04fbc8d net/i40e: fix mbuf alloc failed counter
When an mbuf alloc fails during the mempool get operation for the
i40e bulk alloc receive function, the rx_mbuf_alloc_failed counter
is not incremented to record the error.

This fix ensures consistency with the other i40e receive procedures and
other net drivers.

Signed-off-by: Matt Peters <matt.peters@windriver.com>
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2017-04-28 14:46:18 +02:00
Rasesh Mody
af785e475c net/qede: fix CFLAGS for base files
Changes included in this fix
 - limit CFLAGS to base files
 - fix to remove/mark unused members
 - add checks for debug config option
 - make qede_set_mtu() and qede_udp_dst_port_del() static and others
   non-static as appropriate
 - move local APIs qede_vlan_offload_set() and qede_rx_cqe_to_pkt_type()
 - initialize variables as required

Fixes: ec94dbc573 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Rasesh Mody
9a671097bc net/qede/base: fix find zero bit macro
Use appropriate operator for if condition

Coverity issue: 1379399
Coverity issue: 1379404
Fixes: ec94dbc573 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Rasesh Mody
f6c63e390d net/qede/base: fix macro ecore MFW set field
Fix ECORE_MFW_SET_FIELD macro

Coverity issue: 1423907
Coverity issue: 1423908
Fixes: 0b6bf70d7e ("net/qede/base: support previous driver unload")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Rasesh Mody
c2069af8f3 net/qede/base: fix code flow and remove unused code
Remove unused code to address coverity issues and
address a code flow issue.

Coverity issue: 1379468
Coverity issue: 1379521
Coverity issue: 1379522
Coverity issue: 1379523
Coverity issue: 1423918
Fixes: 86a2265e59 ("qede: add SRIOV support")
Fixes: ec94dbc573 ("qede: add base driver")
Fixes: 2ea6f76aff ("qede: add core driver")
Fixes: 29540be7ef ("net/qede: support LRO/TSO offloads")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Rasesh Mody
738f56d41a net/qede: fix FW version string for VF
In SRIOV testing, print adapter info shows firmware version used by PF,
this patch provides fix to populate correct firmware version used by VF.

Fixes: 86a2265e59 ("qede: add SRIOV support")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Harish Patil
e82b275b32 net/qede: remove IPv4/IPv6 as valid ntuple flows
Firmware supports ntuple configuration which is always based on 4-tuples.
So remove RTE_ETH_FLOW_FRAG_IPV4 and RTE_ETH_FLOW_FRAG_IPV6 as valid flows.
Also merge the two switch statements into one.

Fixes: 622075356e ("net/qede: support ntuple and flow director filter")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:18 +02:00
Harish Patil
a8ebf42f56 net/qede: use new stripped VLAN mbuf flags
Use new mbuf flags PKT_RX_VLAN_STRIPPED and PKT_RX_QINQ_STRIPPED
introduced by the patch:
commit b37b528d95 ("mbuf: add new Rx flags for stripped VLAN")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:18 +02:00
Harish Patil
15ccf70af9 net/qede: fix possible uninitialized pointer
This defect is a functional issue where the RX CQE pointer remains
uninitialized in the LRO code path which can cause null pointer exception
while accessing VLAN or RSS hash value from CQE.

Coverity issue: 143474
Fixes: 29540be7ef ("net/qede: support LRO/TSO offloads")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Harish Patil
680c850f7e net/qede: fix LRO handling
- Add a common routine to handle ETH_RX_CQE_TYPE_TPA_CONT and
ETH_RX_CQE_TYPE_TPA_END.
- Remove enum qede_agg_state since there is no need to maintain
aggregation state.
- Modify the segment chaining logic by tracking head and tail
TPA segments of each aggregation.
- Add more debug and comments.
- Mark the packet as PKT_RX_LRO.

Fixes: 29540be7ef ("net/qede: support LRO/TSO offloads")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Harish Patil
b3fb8c5ea0 net/qede: fix fastpath rings reset phase
Perform reset of the fastpath RX/TX rings after stopping device port and
not while starting the ports.

Fixes: cfe28a9885 ("net/qede: support unequal number of Rx/Tx queues")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Harish Patil
49d8b54e86 net/qede: fix default MAC address handling
- In qede_mac_addr_set(), in order to configure default MAC address we
first delete the existing MAC address before trying to add new one. During
init time, there is no MAC filter to begin with, so trying to remove a
non-existing MAC address causes a firmware exception. This can be prevented
by internally calling qede_mac_addr_add() which has the checks in place to
delete a MAC address only if it was added before.

- Remove setting of the default MAC address from within
qede_dev_configure() since rte_eth_dev_start() calls mac_addr_set() anyway.

Fixes: 2ea6f76aff ("qede: add core driver")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Nélio Laranjeiro
870ba73a64 net/mlx5: fix IPv6 flow pattern item
Only masked bits must be set in Verbs specification for a rule to be valid.

Fixes: 2097d0d1e2 ("net/mlx5: support basic flow items and actions")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-04-28 14:46:17 +02:00
Jingjing Wu
fe2b27c634 net/i40e: fix array bounds
Fix array bounds when set default ptype mapping.

Fixes: 62e94f7f66 ("net/i40e: configure packet type mapping")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-04-28 14:46:17 +02:00
Beilei Xing
c00f307f85 net/i40e: fix setup when bulk is disabled
Testpmd failed to start when CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
is disabled, the root cause is the length of sw_ring and queue are
incorrect with the above configuration.

Fixes: 0be2953129 ("net/i40e: fix compile error")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-28 14:46:17 +02:00
Andrew Rybchenko
edd69f7c21 net/sfc: fix LSC interrupt support for UIO cases
Recently link status change interrupt was enabled by default in testpmd,
it has opened the driver bug with not working LSC interrupt if either
igb_uio or uio_pci_generic kernel driver is used.

Fixes: 06bc197796 ("net/sfc: interrupts support sufficient for event queue init")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-28 14:46:17 +02:00
Andrew Rybchenko
b69862719e net/sfc: correct estimation of max DMA descriptors required
Previous too pessimistic estimation made completely impossible to send
packets with many segments (more than 100 with minimum Tx ring size).

Fixes: 8b00f426eb ("net/sfc: implement EF10 native Tx datapath")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-28 14:46:17 +02:00
Wei Dai
b826efba6d net/ixgbe: align register setting when RSC is disabled
When Receive Side Coalescing (RSC) is not used, the RSC Disable
(RSC_DIS) filed of register Receive Filter Control Register (RFCTL)
should be set according to ixgbe datasheet.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-28 14:46:17 +02:00
Wei Dai
bfe977683a net/ixgbe/base: update version to 2017.03.29
* Acquire PHY semaphore before device reset
* Add support for 2.5G KX physical layer
* Add MAC X550em/X557 LED on|off support

Signed-off-by: Wei Dai <wei.dai@intel.com>
2017-04-28 14:46:17 +02:00
Wei Dai
999566af0a net/ixgbe/base: support MAC X550em/X557 LED on/off
This patch updates ixgbe_led_[on|off]_t_X550em for MAC or PHY connected
LEDs. To support both MAC or PHY connected LEDs, both MAC and PHY led
control registers are configured.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2017-04-28 14:46:17 +02:00
Wei Dai
d53a80024a net/ixgbe/base: support 2.5G KX physical layer
Add another define for the 2.5G KX physical layer. This requires all
variables and support functions that deal with "physical_layer" to be
bumped to u64 as this is the 33rd define.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2017-04-28 14:46:17 +02:00
Wei Dai
c70a162ad4 net/ixgbe/base: acquire PHY semaphore before device reset
A recent firmware change fixed an issue to acquire the PHY semaphore
before accessing PHY registers. This led to a case where SW can issue
a device reset clearing the MDIO registers. This patch makes SW acquire
the PHY semaphore before issuing a device reset.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2017-04-28 14:46:16 +02:00
Adrien Mazarguil
80fcb5cad4 net/avp: fix exported headers
This commit addresses several errors related to missing includes such as:

 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_fifo.h:77:22: error: 'struct rte_avp_fifo' declared
    inside parameter list [-Werror]
 [...]
 build/include/rte_avp_fifo.h: In function 'avp_fifo_init':
 build/include/rte_avp_fifo.h:81:3: error: implicit declaration of function
    'rte_panic' [-Werror=implicit-function-declaration]
 [...]
 build/include/rte_avp_fifo.h:83:6: error: dereferencing pointer to
    incomplete type
 [...]
 build/include/rte_avp_fifo.h:109:2: error: implicit declaration of
    function 'rte_wmb' [-Werror=implicit-function-declaration]
 [...]
 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_common.h:104:2: error: unknown type name 'uint64_t'
 [...]
 build/include/rte_avp_common.h:386:15: error: 'ETHER_ADDR_LEN' undeclared
    here (not in a function)
 [...]

It addresses errors with strict compilation flags:

 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_common.h:122:3: error: ISO C99 doesn't support
    unnamed structs/unions [-Werror=pedantic]
 [...]
 build/include/rte_avp_common.h:136:17: error: ISO C forbids zero-size
    array 'buffer' [-Werror=pedantic]
 [...]

And also adds C++ awareness to both header files.

Fixes: 8e680655e2 ("net/avp: add public header files")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
2017-05-01 00:13:15 +02:00
Bruce Richardson
7e015a4794 net/ark: fix build on FreeBSD
On FreeBSD it's not necessary to use -ldl to link apps which use
dlopen. This error only showed up with a shared library gcc build,
not standard build using static libs.

Fixes: 1131cbf0fb ("net/ark: stub PMD for Atomic Rules Arkville")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John Miller <john.miller@atomicrules.com>
2017-04-21 16:19:40 +02:00
Gaetan Rivet
6dd7b7056d net/mlx4: support device removal event
Extend the LSC event handling to support the device removal as well. The
Verbs library will send several related events, that can conflict
with the LSC event itself.

The event handling has thus been made capable of receiving and signaling
several event types at once.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: Elad Persiko <eladpe@mellanox.com>
2017-04-21 01:01:47 +02:00
Jacek Piasecki
923419333f net/ixgbe: support xstats by ID
To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
ixgbe_dev_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and ixgbe_dev_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-20 22:30:26 +02:00
Jacek Piasecki
25e38f09af net/e1000: support xstats by ID
To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
eth_igb_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and eth_igb_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-20 22:30:26 +02:00
Gowrishankar Muthukrishnan
e4701c7a4e net/i40e: fix build on ppc64le
A typo introduced in i40e_rxtx_vec_altivec.c

Fixes: 67f0380766 ("net/i40e: enable per-device packet type mapping")

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
2017-04-20 10:21:59 +02:00
Zhiyong Yang
b7be4f461a net/virtio: support to turn on/off traffic flow
Current virtio_dev_stop only disables interrupt and marks link down,
When it is invoked, tx/rx traffic flows still work. This is a strange
behavior. The patch supports the switch of flow.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-04-19 10:49:06 +02:00
Jianfeng Tan
260aae9ad9 net/virtio-user: fix address on 32-bit system
virtio-user cannot work on 32-bit system as higher 32-bit of the
addr field (64-bit) in the desc is filled with non-zero value
which should not happen for a 32-bit system.

In case of virtio-user, we use buf_addr of mbuf to fill the
virtqueue desc addr. This is a regression bug. For 32-bit system,
the first 4 bytes of mbuf is buf_addr, with following 8 bytes for
buf_phyaddr. With below wrong definition, both buf_addr and lower
4 bytes buf_phyaddr are obtained to fill the virtqueue desc.
  #define VIRTIO_MBUF_ADDR(mb, vq) \
	(*(uint64_t *)((uintptr_t)(mb) + (vq)->offset))

Fixes: 25f80d1087 ("net/virtio: fix packet corruption")
Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-19 10:49:06 +02:00