Commit Graph

172 Commits

Author SHA1 Message Date
Olivier Matz
cbc12b0a96 mk: do not generate LDLIBS from directory dependencies
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-10-24 02:14:57 +02:00
Zhiyong Yang
3320acbf4b net/bnxt: fix port id type
Fixes: f8244c6399 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-10-13 01:17:49 +01:00
Matan Azrad
d5b0924ba6 ethdev: add return value to stats get dev op
The stats_get dev op API doesn't include return value, so PMD cannot
return an error in case of failure at stats getting process time.

Since PCI devices can be removed and there is a time between the
physical removal to the RMV interrupt, the user may get invalid stats
without any indication.

This patch changes the stats_get API return value to be int instead of
void.

All the net PMDs stats_get dev ops are adjusted by this patch.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-12 01:52:49 +01:00
Ajit Khaparde
75cd6fb1d9 net/bnxt: fix the association of a MACVLAN per VNIC
We were not associating a MAC+VLAN per VNIC filter correctly.
This patch fixes that. Also set the VLAN type appropriately.

Fixes: f92735db1e ("net/bnxt: add L2 filter alloc/init/free")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-12 01:52:49 +01:00
Ajit Khaparde
2d64da097a net/bnxt: support FDIR
This patch brings support for Flow Director.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-12 01:52:49 +01:00
Ajit Khaparde
18b54a7e88 net/bnxt: prevent programming a duplicate flow
Match a flow against existing flows programmed in the HW
and prevent overlapping entries. Also change log level of
some logs to DEBUG.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-12 01:52:49 +01:00
Ajit Khaparde
dc0bdeb4fa net/bnxt: fix cleanup if a filter allocation fails
We are not checking if a filter allocation succeeded.
And we end up accessing a null pointer after that.
Also invalidate the fw_l2_filter_id to prevent unnecessary
HW access and hence HWRM command failures during exit.

Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-12 01:52:49 +01:00
Mark Kavanagh
08731368c9 net/bnxt: fix build
For gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7),
As of 5ef3b79fdf, compilation of DPDK fails with the following
ERROR MESSAGE:
"bnxt_filter.c:960:117: error: ‘vnic’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]".

Resolve this by initializing 'vnic' to NULL;

Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
2017-10-12 01:36:58 +01:00
Zhiyong Yang
f8244c6399 ethdev: increase port id range
Extend port_id definition from uint8_t to uint16_t in lib and drivers
data structures, specifically rte_eth_dev_data. Modify the APIs,
drivers and app using port_id at the same time.

Fix some checkpatch issues from the original code and remove some
unnecessary cast operations.

release_17_11 and deprecation docs have been updated in this patch.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 18:23:25 +02:00
Olivier Matz
4a671fdea9 net/bnxt: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC rte_pmd_bnxt.o
  rte_pmd_bnxt.c: In function ‘rte_pmd_bnxt_set_all_queues_drop_en’:
  rte_pmd_bnxt.c:116:6: error: ‘rc’ may be used uninitialized in this
                        function [-Werror=maybe-uninitialized]
    int rc;
        ^~

This can happen if both bp->nr_vnics and bp->pf.active_vfs are 0.
Fix it by initializing rc to -EINVAL.

Fixes: 49947a13ba ("net/bnxt: support Tx loopback, set VF MAC and queues drop")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-10-06 02:49:50 +02:00
Ajit Khaparde
a2033fda22 net/bnxt: fix number of MAC addresses for VMDq
We were hardcoding the max MAC addresses to 32, while the HW
can support more than that. This was restricting the number of VMDQ
pools that we could support. Use the value obtained from FW instead.

Fixes: 804e746c7b ("net/bnxt: add hardware resource manager init code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:50 +02:00
Ajit Khaparde
b7435d660a net/bnxt: add ntuple filtering support
Add support for ntuple filtering.
Only RTE_5TUPLE_FLAGS is supported currently.
RTE_2TUPLE_FLAGS is not supported.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:50 +02:00
Somnath Kotur
1fe427fd08 net/bnxt: support enable/disable interrupt
Implement Rx Queue interrupt enable/disable functions

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Somnath Kotur
19e6af01bb net/bnxt: support get/set EEPROM
Add support for get/set_eeprom, get_eeprom_length dev_ops.
Defined the structures required to get/set the eeprom length/data
in hsi_struct_defs hdr file along with implementation.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
3d2a6644eb net/bnxt: support getting ptypes
This patch adds support for dev_supported_ptypes_get

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
f7ecea911e net/bnxt: fix interrupt handler
In some cases the interrupt handler is accessing cpr, which has
already been freed causing segfaults. This patch avoids such accesses.

Fixes: 7bc8e9a227 ("net/bnxt: support async link notification")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
86ff87b0ed net/bnxt: fix per queue stats display in xstats
While gathering per queue stats, we are overwriting some of the
stats. This causes some of the counters in xstats to be incorrect.

Fixes: 577d3dced0 ("net/bnxt: refactor the query stats")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
5ef3b79fdf net/bnxt: support flow filter ops
This patch adds support for flow validate/create/destroy/flush,
ethertype add/del ops

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
c6cca7760e net/bnxt: add new HWRM structs to support flow filtering
HWRM structs added:
hwrm_cfa_ntuple_filter_alloc, hwrm_cfa_ntuple_filter_free,
hwrm_cfa_ntuple_filter_cfg, hwrm_cfa_em_flow_alloc,
hwrm_cfa_em_flow_free, hwrm_cfa_em_flow_cfg

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
478ed3bb7b net/bnxt: support Tx descriptor status
Add support for tx_descriptor_status dev_op

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
0fe613bb87 net/bnxt: support Rx descriptor status
Add support for rx_descriptor_status dev_op

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
1b7ceba3e3 net/bnxt: support Rx queue count
add support for rx_queue_count dev_op

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
2ba07b7dbd net/bnxt: set the hash key size
We were not setting the dev_info.hash_key_size. Setting it now.

Fixes: 0a6d2a7200 ("net/bnxt: get device infos")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
1ebb765090 net/bnxt: fix config RSS update
We are not configuring the RSS settings updated by rss_hash_update().
Fixing it.

Fixes: fcc0aa1edc ("net/bnxt: add RSS hash configuration")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
8892013668 net/bnxt: support xstats get by id
This patch adds support for xstats_get_by_id/xstats_get_names_by_id.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
7ec39d8c52 net/bnxt: update status of Rx IP/L4 CKSUM
update ol_flags with the appropriate status of IP/L4 cksum in Rx path.

Fixes: 2eb53b134a ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
d644aa046a net/bnxt: set checksum offload flags correctly
We are not correctly setting hw checksum offload for all the
offload flags. This patch fixes that.

Fixes: 6eb3cc2294 ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
0714ee90de net/bnxt: fix usage of VMDq flags
Map ETH_VMDQ_ACCEPT_HASH_UC to the promiscuous bit.
Also, set ALLMULTI and MCAST when MCAST is set to ensure multicast traffic
is received regardless of the VF driver list.

Fixes: 4cfe399f65 ("net/bnxt: support to set VF rxmode")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
a01a07286d net/bnxt: fix an issue with broadcast traffic
In bnxt_hwrm_cfa_l2_set_rx_mask, we are ignoring the previous
setting of HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST and
setting it again, thereby wrongly enabling Broadcast.

Fixes: 244bc98b0d ("net/bnxt: set L2 Rx mask")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
d9dd0b29ed net/bnxt: fix Rx handling and buffer allocation logic
Even when rx buffer allocation fails, we are wrongly updating
the producer index. This patch fixes that.
Also in case of a buffer allocation failure, reattempt buffer
allocation before the rx handler exits.

Fixes: 2eb53b134a ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
4191bc8f79 net/bnxt: handle multi queue mode properly
We are currently not handling multi queue RX/RSS modes correctly.
If RSS is not requested, create one VNIC per RXQ.

Fixes: 6133f20797 ("net/bnxt: add Rx queue create/destroy")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
e28538f162 net/bnxt: fix calculation of number of pools
The calculation for number of pools is wrong.
We are wrongly overwriting the calculated value with ETH_64_POOLS.
Accordingly fix the size of ff_pools array.
Fix the log message as well.

Fixes: 4cfe399f65 ("net/bnxt: support to set VF rxmode")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
39464bd308 net/bnxt: fix an issue with group id calculation
start_grp_id is incremented wrongly. Fixing it.

Fixes: daef48efe5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
044bf6e93c net/bnxt: use 64-bits of address for VLAN table
We are wrongly using just 16 bits of address from rte_mem_virt2phy
while filling the vlan table address instead of 64-bytes.
Most likely a copy-paste error.

Fixes: 36735a932c ("net/bnxt: support set VF QOS and MAC anti spoof")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
cbcd375d37 net/bnxt: fix HWRM macros and locking
Obtain the spinlock in HWRM_PREP()
Eliminate two unnecessary arguments in HWRM_PREP().
Unlock the spinlock before returning in HWRM_ERROR_CHECK()
Add new HWRM_UNLOCK() macro
Update usage of the thre macros.

Fixes: 804e746c7b ("net/bnxt: add hardware resource manager init code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
ef17b12e6a net/bnxt: fix arguments to callback process
The callback arguments to _rte_eth_dev_callback_process() are swapped.
Fix them.

Fixes: d6af1a13d7 ("ethdev: add return values to callback process API")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
c037fc8732 net/bnxt: fix setting conflicting VLAN bits
Only set the vlanonly bit if vlan_nonvlan is clear. Also, allow the
VLAN table to be cleared when vlanonly is set.

Clearing the VLAN table when vlanonly is set will stop all traffic
since it requires all frames to have a VLAN tag, and that tag to be
in the zero-length table. This is still a valid use case though,
and has been seen in the wild.

Fixes: 36735a932c ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
980543f754 net/bnxt: fix setting VLAN anti spoof with same value
If the current VLAN anti spoof setting is same as the new value,
the firmware can return an error. Call the HWRM command to update
the new setting if it is different from the current value.

Fixes: 36735a932c ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
4cddfcb71b net/bnxt: free filter before reusing it
This patch sends the HWRM command to free a filter in the hardware,
before using it again.

Fixes: f92735db1e ("net/bnxt: add L2 filter alloc/init/free")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
778f6209bc net/bnxt: check invalid L2 filter id
Add code to check for invalid filter_id in bnxt_hwrm_clear_filter

Fixes: f92735db1e ("net/bnxt: add L2 filter alloc/init/free")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
910242bcf5 net/bnxt: fix VLAN antispoof configuration code
We are wrongly using a Rx side HWRM command set_rx_mask to configure
VLAN anti-spoof. This being a Tx side feature, this patch
tries to fix it.

Since the HWRM command to do it is available only in
the newer firmware versions, the patch verifies the firmware
version before attempting to send the HWRM command to
the firmware.

Fixes: 36735a932c ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
b5b6ff6190 net/bnxt: reset VF stats during initialization
This patch resets the VF stats during initialization

Fixes: b7778e8a1c ("net/bnxt: refactor to properly allocate resources for PF/VF")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
645ad4d586 net/bnxt: fix set link config
remove the unnecessary rte_delay in bnxt_set_hwrm_link_config

Fixes: 7bc8e9a227 ("net/bnxt: support async link notification")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
2bda4ec790 net/bnxt: fix vnic cleanup
Check if the vnic_id and rss_rule is not invalid before passing it
to the firmware to cleanup the VNIC. Log a message if the vnic_id
is invalid.

Fixes: db678d5c2b ("net/bnxt: add HWRM VNIC configure")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
31ded672aa net/bnxt: fix crash
Fix use of local variable to avoid segfault.
cnt was incorrectly tested and decremented in the loop that removes
a VLAN from the table.

Fixes: 36735a932c ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Ajit Khaparde
564be0240e net/bnxt: fix log levels for non error conditions
1) handle_async_event is a DEBUG level log message.
2) Log "Unable to get default VNIC for VF %d" at INFO level.

Fixes: 36735a932c ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-31 19:58:41 +02:00
Stephen Hemminger
7d47868c26 drivers/net: remove duplicate includes
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-16 17:30:24 +02:00
Gaetan Rivet
6477966c15 net/bnxt: include PCI header directly
In devargs rework, rte_pci.h won't be included
via rte_devargs.h anymore.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-07-09 00:02:11 +02:00
Ajit Khaparde
79f26987f9 net/bnxt: fix copy/pasted error message
Fix an error message. Probably a copy/paste error.

Fixes: 36735a932c ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-06 15:00:57 +02:00
Ajit Khaparde
63d499f0c4 net/bnxt: fix set link config
bnxt_hwrm_port_phy_cfg() was not setting enables appropriately.
This was causing undesired issues with link config.
This patch takes care of that.

Fixes: 7bc8e9a227 ("net/bnxt: support async link notification")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-07-06 15:00:57 +02:00