Commit Graph

18 Commits

Author SHA1 Message Date
Rasesh Mody
25ffc78946 net/bnx2x: fix Rx mode configuration
Check if promisc mode was set when setting allmulti mode and vice-versa.
Introduced BNX2X_RX_MODE_ALLMULTI_PROMISC for the same. If check is
absent the filter configuration gets over written.

Fixes: 540a211084 ("bnx2x: driver core")
Fixes: 5dbc53d7e5 ("net/bnx2x: restrict Rx mask flags sent to the PF")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-30 22:18:26 +01:00
Santosh Shukla
458a4a7aff net/bnx2x: use I/O device memory read/write API
Replace the raw I/O device memory read/write access with eal abstraction
for I/O device memory read/write access to fix portability issues across
different architectures.

CC: Harish Patil <harish.patil@cavium.com>
CC: Rasesh Mody <rasesh.mody@cavium.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-01-18 17:18:27 +01:00
Chas Williams
dc687592ac net/bnx2x: merge debug register operations into headers
The register read/writes should just be static inline instead of
alternately defined as routines or macros depending on the status of
debugging.

Fix bnx2x_reg_read32() returning 0 during debug unaligned reads.

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

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2016-10-13 15:30:59 +02:00
Chas Williams
cf32c2e541 net/bnx2x: serialize access to VF mailbox
The pf2vf mailbox can only be used by one thread at a time.

Fixes: 540a211084 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2016-10-13 15:30:59 +02:00
Chas Williams
5dbc53d7e5 net/bnx2x: restrict Rx mask flags sent to the PF
Don't use bnx2x_fill_accept_flags() to fill the RX mask in the VF
since the PF only handles a subset of the existing flags.  now,
bnx2x_fill_accept_flags() can be static.

Fixes: 540a211084 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2016-10-13 15:30:59 +02:00
Chas Williams
a518584d1f net/bnx2x: get cache line size from build configuration
Correctly hint the cache line size.  Remove unused macros associated
with the cache line size.

Fixes: 540a211084 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2016-10-13 15:30:59 +02:00
Charles (Chas) Williams
fe63783466 net/bnx2x: set random MAC address if none assigned
If the PF hasn't assigned an address, assign one randomly.  While here,
convert to use DPDK's ether address utility routines.

Fixes: 540a211084 ("bnx2x: driver core")

Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-04 15:19:55 +02:00
Rasesh Mody
3570f700b3 net/bnx2x: use single doorbell for Tx
Change the Tx routine to ring the doorbell once per burst
and not on every Tx packet. This driver-level optimization
is necessary to achieve line rates for larger frame
sizes (1k or more).

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-06-15 17:13:55 +02:00
Rasesh Mody
827ed2a118 net/bnx2x: restructure Tx routine
- Process Tx completions based on configured Tx free threshold and
  determine how much TX BDs are required before invoking bnx2x_tx_encap()
- Change bnx2x_tx_encap() to void function as it can now never fail

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-06-15 17:13:55 +02:00
Stephen Hemminger
52be0607bf bnx2x: remove unused variable
The mbuf_alloc_size is leftover from BSD or some other code base.
It is set but never used in DPDK driver.  After that the related defines
can also be eliminated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2016-03-16 16:49:15 +01:00
Ravi Kerur
d6b324c00f mbuf: get DMA address
Macros RTE_MBUF_DATA_DMA_ADDR and RTE_MBUF_DATA_DMA_ADDR_DEFAULT
are defined in each PMD driver file. Convert macros to inline
functions and move them to common lib/librte_mbuf/rte_mbuf.h file.
PMD drivers include rte_mbuf.h file directly/indirectly hence no
additioanl header file inclusion is necessary.

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-03-04 16:01:15 +01:00
Huawei Xie
693f715da4 remove extra parentheses in return statement
fix the error reported by checkpatch:
  "ERROR: return is not a function, parentheses are not required"

remove parentheses in return like:
  "return (logical expressions)"

remove parentheses in return a function like:
  "return (rte_mempool_lookup(...))"

Fixes: 6307b909b8 ("lib: remove extra parenthesis after return")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2016-02-10 15:47:50 +01:00
Rasesh Mody
99d47f445e bnx2x: fix 32-bit build
Compile tested.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2015-12-13 01:58:10 +01:00
Rasesh Mody
5a1d76f9c2 bnx2x: fix build on FreeBSD
Compile tested.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2015-12-13 01:58:10 +01:00
Rasesh Mody
059113cced bnx2x: add license file
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2015-12-13 01:58:10 +01:00
Harish Patil
8dc08a093a bnx2x: add periodic debug option
The periodic debug option is used to collect periodic
events like statistics, register access etc and won't
interfere with user-level messages.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2015-12-13 01:55:12 +01:00
Thomas Monjalon
87b1faa0e0 bnx2x: fix part of 32-bit build
Example of errors:
	error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
	error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t
	error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘unsigned int’

Only 2 files are fixed. The others errors are left as exercise to the authors.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-08-03 17:39:11 +02:00
Stephen Hemminger
540a211084 bnx2x: driver core
This is the first of several parts for a new driver supporting
Broadcom/Qlogic NetXtremeII 10 gigabit devices.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2015-07-27 04:27:05 +02:00