bnxt: new features, bug fixes and more
cover bnxt: new features, bug fixes and more
Apart from adding support for VF-PF/PF-VF communication, new dev_ops, few bug fixes and improve debug capabilities, this patchset updates the driver to the newer HWRM version 1.7.4
New dev_ops supported:set_mc_addr_list, xstats_get/reset, mac_addr_set, vlan_filter_set, vlan_strip_queue_set, vlan_offload_set, udp_tunnel_port_add/del
bug fixes:
use only long BDs in Tx path to avoid a potential bug in hardware, fix interrupt handler, set the VMDQ pool size correctly
Derived from an autogenerated file, the last patch updates the HWRM version to 1.7.4
Ajit Khaparde:
[01/28] bnxt: add hwrm_func_cfg_input/output structures [04/28] bnxt: add new HWRM commands
[06/28] bnxt: add new HWRM commands to query VNIC info [09/28] bnxt: add code to support VF QOS configuration [14/28] bnxt: Add support for udp_tunnel_port_add/del dev_ops [15/28] bnxt: Update tx offload capabilities [16/28] bnxt: add support for set VF MAC anti spoof [20/28] bnxt: Add support to set VF rxmode
[23/28] bnxt: Add support for VLAN filter and strip dev_ops [24/28] bnxt: Add support for mac_addr_set dev_op [25/28] bnxt: add support for xstats
[26/28] bnxt: use only long BDs in Tx path
[27/28] bnxt: add support for set_mc_addr_list dev_op [28/28] bnxt: update to HWRM version 1.7.4
Stephen Hurd:
[02/28] bnxt: add code to support PF, VF configuration [03/28] bnxt: add additonal HWRM debug info to error messages [05/28] bnxt: add support for PF/VF communications [10/28] bnxt: support for VF VLAN filtering
[11/28] bnxt: set the VMDQ pool size correctly [12/28] bnxt: improve some of the log messages [13/28] bnxt: fix interrupt handler
[17/28] bnxt: implement VF VLAN stripq functionality [18/28] bnxt: support lack of huge pages
[19/28] bnxt: add code to configure a default VF VLAN [21/28] bnxt: Add VF stats get/reset functions [22/28] bnxt: Add newlines to all RTE_LOG() format strings
Steeven Li:
[07/28] bnxt: add functions for tx_loopback and queues_drop_en [08/28] bnxt: support setting VF mac address
Please apply.
PATCH 1/28 bnxt: add hwrm_func_cfg_input/output structures
This patch adds hwrm_func_cfg API which allows the configuration of a child VF by its parent PF driver. It an also be used to configure a PF by its corresponding PF driver.
--- drivers/net/bnxt/hsi_struct_def_dpdk.h | 427 +++++++++++++++++++++++++++++++++ 1 file changed, 427 insertions(+)
drivers/net/bnxt/hsi_struct_def_dpdk.h +427 -0
@@ -88,6 +88,7 @@ struct ctx_hw_stats64 {#define HWRM_FUNC_RESET (UINT32_C(0x11))#define HWRM_FUNC_QCAPS (UINT32_C(0x15))#define HWRM_FUNC_QCFG (UINT32_C(0x16)) +#define HWRM_FUNC_CFG (UINT32_C(0x17))#define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))#define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))#define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
@@ -2261,6 +2262,432 @@ struct hwrm_func_qcfg_output {*/ } __attribute__((packed)); +/* hwrm_func_cfg */ +/* +* Description: This command allows configuration of a PF by the corresponding +* PF driver. This command also allows configuration of a child VF by its parent +* PF driver. The input FID value is used to indicate what function is being +* configured. This allows a PF driver to configure the PF owned by itself or a +* virtual function that is a child of the PF. This command allows to reserve +* resources for a VF by its parent PF. To reverse the process, the command +* should be called with all enables flags cleared for resources. This will free +* allocated resources for the VF and return them to the resource pool. If this +* command is requested by a VF driver to configure or reserve resources, then +* the HWRM shall fail this command. If default MAC address and/or VLAN are +* provided in this command, then the HWRM shall set up appropriate MAC/VLAN +* filters for the function that is being configured. If source properties +* checks are enabled and default MAC address and/or IP address are provided in +* this command, then the HWRM shall set appropriate source property checks +* based on provided MAC and/or IP addresses. The parent PF driver should not +* set MTU/MRU for a VF using this command. This is to allow MTU/MRU setting by +* the VF driver. If the MTU or MRU for a VF is set by the PF driver, then the +* HWRM should ignore it. A function's MTU/MRU should be set prior to allocating +* RX VNICs or TX rings. A PF driver calls hwrm_func_cfg to allocate resources +* for itself or its children VFs. All function drivers shall call hwrm_func_cfg +* to reserve resources. A request to hwrm_func_cfg may not be fully granted; +* that is, a request for resources may be larger than what can be supported by +* the device and the HWRM will allocate the best set of resources available, +* but that may be less than requested. If all the amounts requested could not +* be fulfilled, the HWRM shall allocate what it could and return a status code +* of success. A function driver should call hwrm_func_qcfg immediately after +* hwrm_func_cfg to determine what resources were assigned to the configured +* function. A call by a PF driver to hwrm_func_cfg to allocate resources for +* itself shall only allocate resources for the PF driver to use, not for its +* children VFs. Likewise, a call to hwrm_func_qcfg shall return the resources +* available for the PF driver to use, not what is available to its children +* VFs. +*/ +/* Input (88 bytes) */ +struct hwrm_func_cfg_input { +uint16_t req_type; +/* +* This value indicates what type of request this is. The format +* for the rest of the command is determined by this field. +*/ +uint16_t cmpl_ring; +/* +* This value indicates the what completion ring the request +* will be optionally completed on. If the value is -1, then no +* CR completion will be generated. Any other value must be a +* valid CR ring_id value for this function. +*/ +uint16_t seq_id; +/* This value indicates the command sequence number. */ +uint16_t target_id; +/* +* Target ID of this command. 0x0 - 0xFFF8 - Used for function +* ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF +* - HWRM +*/ +uint64_t resp_addr; +/* +* This is the host address where the response will be written +* when the request is complete. This area must be 16B aligned +* and must be cleared to zero before the request is made. +*/ +uint16_t fid; +/* +* Function ID of the function that is being configured. If set +* to 0xFF... (All Fs), then the the configuration is for the +* requesting function. +*/ +uint8_t unused_0; +uint8_t unused_1; +uint32_t flags; +/* +* When this bit is '1', the function is disabled with source +* MAC address check. This is an anti-spoofing check. If this +* flag is set, then the function shall be configured to +* disallow transmission of frames with the source MAC address +* that is configured for this function. +*/ +#define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \ + UINT32_C(0x1) +/* +* When this bit is '1', the function is enabled with source MAC +* address check. This is an anti-spoofing check. If this flag +* is set, then the function shall be configured to allow +* transmission of frames with the source MAC address that is +* configured for this function. +*/ +#define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \ + UINT32_C(0x2) +/* reserved */ +#define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK UINT32_C(0x1fc) +#define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT 2 +/* +* Standard TX Ring mode is used for the allocation of TX ring +* and underlying scheduling resources that allow bandwidth +* reservation and limit settings on the queried function. If +* set to 1, then standard TX ring mode is requested to be +* enabled on the function being configured. +*/ +#define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \ + UINT32_C(0x200) +/* +* Standard TX Ring mode is used for the allocation of TX ring +* and underlying scheduling resources that allow bandwidth +* reservation and limit settings on the queried function. If +* set to 1, then the standard TX ring mode is requested to be +* disabled on the function being configured. In this extended +* TX ring resource mode, the minimum and maximum bandwidth +* settings are not supported to allow the allocation of TX +* rings to span multiple scheduler nodes. +*/ +#define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \ + UINT32_C(0x400) +uint32_t enables; +/* This bit must be '1' for the mtu field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_MTU UINT32_C(0x1) +/* This bit must be '1' for the mru field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_MRU UINT32_C(0x2) +/* +* This bit must be '1' for the num_rsscos_ctxs field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS UINT32_C(0x4) +/* +* This bit must be '1' for the num_cmpl_rings field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS UINT32_C(0x8) +/* This bit must be '1' for the num_tx_rings field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS UINT32_C(0x10) +/* This bit must be '1' for the num_rx_rings field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS UINT32_C(0x20) +/* This bit must be '1' for the num_l2_ctxs field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS UINT32_C(0x40) +/* This bit must be '1' for the num_vnics field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS UINT32_C(0x80) +/* +* This bit must be '1' for the num_stat_ctxs field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS UINT32_C(0x100) +/* +* This bit must be '1' for the dflt_mac_addr field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x200) +/* This bit must be '1' for the dflt_vlan field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN UINT32_C(0x400) +/* This bit must be '1' for the dflt_ip_addr field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR UINT32_C(0x800) +/* This bit must be '1' for the min_bw field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW UINT32_C(0x1000) +/* This bit must be '1' for the max_bw field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW UINT32_C(0x2000) +/* +* This bit must be '1' for the async_event_cr field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4000) +/* +* This bit must be '1' for the vlan_antispoof_mode field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE UINT32_C(0x8000) +/* +* This bit must be '1' for the allowed_vlan_pris field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS UINT32_C(0x10000) +/* This bit must be '1' for the evb_mode field to be configured. */ +#define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE UINT32_C(0x20000) +/* +* This bit must be '1' for the num_mcast_filters field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS UINT32_C(0x40000) +/* +* This bit must be '1' for the num_hw_ring_grps field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS UINT32_C(0x80000) +uint16_t mtu; +/* +* The maximum transmission unit of the function. The HWRM +* should make sure that the mtu of the function does not exceed +* the mtu of the physical port that this function is associated +* with. In addition to configuring mtu per function, it is +* possible to configure mtu per transmit ring. By default, the +* mtu of each transmit ring associated with a function is equal +* to the mtu of the function. The HWRM should make sure that +* the mtu of each transmit ring that is assigned to a function +* has a valid mtu. +*/ +uint16_t mru; +/* +* The maximum receive unit of the function. The HWRM should +* make sure that the mru of the function does not exceed the +* mru of the physical port that this function is associated +* with. In addition to configuring mru per function, it is +* possible to configure mru per vnic. By default, the mru of +* each vnic associated with a function is equal to the mru of +* the function. The HWRM should make sure that the mru of each +* vnic that is assigned to a function has a valid mru. +*/ +uint16_t num_rsscos_ctxs; +/* The number of RSS/COS contexts requested for the function. */ +uint16_t num_cmpl_rings; +/* +* The number of completion rings requested for the function. +* This does not include the rings allocated to any children +* functions if any. +*/ +uint16_t num_tx_rings; +/* +* The number of transmit rings requested for the function. This +* does not include the rings allocated to any children +* functions if any. +*/ +uint16_t num_rx_rings; +/* +* The number of receive rings requested for the function. This +* does not include the rings allocated to any children +* functions if any. +*/ +uint16_t num_l2_ctxs; +/* The requested number of L2 contexts for the function. */ +uint16_t num_vnics; +/* The requested number of vnics for the function. */ +uint16_t num_stat_ctxs; +/* The requested number of statistic contexts for the function. */ +uint16_t num_hw_ring_grps; +/* +* The number of HW ring groups that should be reserved for this +* function. +*/ +uint8_t dflt_mac_addr[6 ]; +/* The default MAC address for the function being configured. */ +uint16_t dflt_vlan; +/* +* The default VLAN for the function being configured. This +* field's format is same as 802.1Q Tag's Tag Control +* Information (TCI) format that includes both Priority Code +* Point (PCP) and VLAN Identifier (VID). +*/ +uint32_t dflt_ip_addr[4 ]; +/* +* The default IP address for the function being configured. +* This address is only used in enabling source property check. +*/ +uint32_t min_bw; +/* +* Minimum BW allocated for this function. The HWRM will +* translate this value into byte counter and time interval used +* for the scheduler inside the device. +*/ +/* The bandwidth value. */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \ + UINT32_C(0xfffffff) +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT 0 +/* The granularity of the value (bits or bytes). */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE UINT32_C(0x10000000) +/* Value is in bits. */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28) +/* Value is in bytes. */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28) +#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \ + FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES +/* bw_value_unit is 3 b */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \ + UINT32_C(0xe0000000) +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT 29 +/* Value is in Mb or MB (base 10). */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \ + (UINT32_C(0x0) << 29) +/* Value is in Kb or KB (base 10). */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \ + (UINT32_C(0x2) << 29) +/* Value is in bits or bytes. */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \ + (UINT32_C(0x4) << 29) +/* Value is in Gb or GB (base 10). */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \ + (UINT32_C(0x6) << 29) +/* Value is in 1/100th of a percentage of total bandwidth. */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ + (UINT32_C(0x1) << 29) +/* Invalid unit */ +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \ + (UINT32_C(0x7) << 29) +#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \ + FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID +uint32_t max_bw; +/* +* Maximum BW allocated for this function. The HWRM will +* translate this value into byte counter and time interval used +* for the scheduler inside the device. +*/ +/* The bandwidth value. */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \ + UINT32_C(0xfffffff) +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT 0 +/* The granularity of the value (bits or bytes). */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE UINT32_C(0x10000000) +/* Value is in bits. */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28) +/* Value is in bytes. */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28) +#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \ + FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES +/* bw_value_unit is 3 b */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \ + UINT32_C(0xe0000000) +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29 +/* Value is in Mb or MB (base 10). */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \ + (UINT32_C(0x0) << 29) +/* Value is in Kb or KB (base 10). */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \ + (UINT32_C(0x2) << 29) +/* Value is in bits or bytes. */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \ + (UINT32_C(0x4) << 29) +/* Value is in Gb or GB (base 10). */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \ + (UINT32_C(0x6) << 29) +/* Value is in 1/100th of a percentage of total bandwidth. */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ + (UINT32_C(0x1) << 29) +/* Invalid unit */ +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \ + (UINT32_C(0x7) << 29) +#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \ + FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID +uint16_t async_event_cr; +/* +* ID of the target completion ring for receiving asynchronous +* event completions. If this field is not valid, then the HWRM +* shall use the default completion ring of the function that is +* being configured as the target completion ring for providing +* any asynchronous event completions for that function. If this +* field is valid, then the HWRM shall use the completion ring +* identified by this ID as the target completion ring for +* providing any asynchronous event completions for the function +* that is being configured. +*/ +uint8_t vlan_antispoof_mode; +/* VLAN Anti-spoofing mode. */ +/* No VLAN anti-spoofing checks are enabled */ +#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK UINT32_C(0x0) +/* Validate VLAN against the configured VLAN(s) */ +#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \ + UINT32_C(0x1) +/* Insert VLAN if it does not exist, otherwise discard */ +#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \ + UINT32_C(0x2) +/* +* Insert VLAN if it does not exist, override +* VLAN if it exists +*/ +#define \ +HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \ + UINT32_C(0x3) +uint8_t allowed_vlan_pris; +/* +* This bit field defines VLAN PRIs that are allowed on this +* function. If nth bit is set, then VLAN PRI n is allowed on +* this function. +*/ +uint8_t evb_mode; +/* +* The HWRM shall allow a PF driver to change EVB mode for the +* partition it belongs to. The HWRM shall not allow a VF driver +* to change the EVB mode. The HWRM shall take into account the +* switching of EVB mode from one to another and reconfigure +* hardware resources as appropriately. The switching from VEB +* to VEPA mode requires the disabling of the loopback traffic. +* Additionally, source knock outs are handled differently in +* VEB and VEPA modes. +*/ +/* No Edge Virtual Bridging (EVB) */ +#define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0) +/* Virtual Ethernet Bridge (VEB) */ +#define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB UINT32_C(0x1) +/* Virtual Ethernet Port Aggregator (VEPA) */ +#define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA UINT32_C(0x2) +uint8_t unused_2; +uint16_t num_mcast_filters; +/* +* The number of multicast filters that should be reserved for +* this function on the RX side. +*/ +} __attribute__((packed)); + +/* Output (16 bytes) */ +struct hwrm_func_cfg_output { +uint16_t error_code; +/* +* Pass/Fail or error type Note: receiver to verify the in +* parameters, and fail the call with an error when appropriate +*/ +uint16_t req_type; +/* This field returns the type of original request. */ +uint16_t seq_id; +/* This field provides original sequence number of the command. */ +uint16_t resp_len; +/* +* This field is the length of the response in bytes. The last +* byte of the response is a valid flag that will read as '1' +* when the command has been completely written to memory. +*/ +uint32_t unused_0; +uint8_t unused_1; +uint8_t unused_2; +uint8_t unused_3; +uint8_t valid; +/* +* This field is used in Output records to indicate that the +* output is completely written to RAM. This field should be +* read as '1' to indicate that the output has been completely +* written. When writing a command completion or response to an +* internal processor, the order of writes has to be such that +* this field is written last. +*/ +} __attribute__((packed)); +/* hwrm_func_drv_rgtr */ /* * Description: This command is used by the function driver to register its
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 2/28 bnxt: add code to support PF, VF configuration
In reply to Ajit KhapardeThis patch adds some code while also reorganizing some of the existing code to configure resources for a PCI function. Key changes in the patch:
1) Move the function reset HWRM call to init path from dev_start path.
2) Eliminate unused bnxt_vf_info structure.
3) Set aside resources like Tx, Rx rings, MAC adde count, stats context etc.. for VFs
4) Fix PF resource allocation when there are no VFs.
--- drivers/net/bnxt/bnxt.h | 34 ++--- drivers/net/bnxt/bnxt_ethdev.c | 65 ++++++--- drivers/net/bnxt/bnxt_filter.c | 30 +--- drivers/net/bnxt/bnxt_hwrm.c | 324 +++++++++++++++++++++++++++++++++++++---- drivers/net/bnxt/bnxt_hwrm.h | 2 + drivers/net/bnxt/bnxt_vnic.c | 40 +---- 6 files changed, 355 insertions(+), 140 deletions(-)
drivers/net/bnxt/bnxt.h +11 -23
@@ -54,41 +54,20 @@ enum bnxt_hw_context { HW_CONTEXT_IS_LB = 3, }; -struct bnxt_vf_info { -uint16_t fw_fid; -uint8_t mac_addr[ETHER_ADDR_LEN ]; -uint16_t max_rsscos_ctx; -uint16_t max_cp_rings; -uint16_t max_tx_rings; -uint16_t max_rx_rings; -uint16_t max_l2_ctx; -uint16_t max_vnics; -uint16_t vlan; -struct bnxt_pf_info *pf; -}; -struct bnxt_pf_info {#define BNXT_FIRST_PF_FID 1#define BNXT_MAX_VFS (bp) (bp->pf.max_vfs)#define BNXT_FIRST_VF_FID 128#define BNXT_PF_RINGS_USED (bp) bnxt_get_num_queues(bp)#define BNXT_PF_RINGS_AVAIL (bp) (bp->pf.max_cp_rings - BNXT_PF_RINGS_USED(bp)) -uint32_t fw_fid; +uint8_t port_id; -uint8_t mac_addr[ETHER_ADDR_LEN ]; -uint16_t max_rsscos_ctx; -uint16_t max_cp_rings; -uint16_t max_tx_rings; -uint16_t max_rx_rings; -uint16_t max_l2_ctx; -uint16_t max_vnics;uint16_t first_vf_id;uint16_t active_vfs;uint16_t max_vfs;void *vf_req_buf;phys_addr_t vf_req_buf_dma_addr;uint32_t vf_req_fwd[8 ]; -struct bnxt_vf_info *vf; };/* Max wait time is 10 * 100ms = 1s */
@@ -174,8 +153,17 @@ struct bnxt {struct bnxt_link_info link_info;struct bnxt_cos_queue_info cos_queue[BNXT_COS_QUEUE_COUNT ]; +uint16_t fw_fid; +uint8_t dflt_mac_addr[ETHER_ADDR_LEN ]; +uint16_t max_rsscos_ctx; +uint16_t max_cp_rings; +uint16_t max_tx_rings; +uint16_t max_rx_rings; +uint16_t max_l2_ctx; +uint16_t max_vnics; +uint16_t max_stat_ctx; +uint16_t vlan;struct bnxt_pf_info pf; -struct bnxt_vf_info vf;uint8_t port_partition_type;uint8_t dev_stopped; };
drivers/net/bnxt/bnxt_ethdev.c +42 -23
101 lines not on this page · raw message
drivers/net/bnxt/bnxt_filter.c +3 -27
@@ -73,15 +73,7 @@ void bnxt_init_filters(struct bnxt *bp)struct bnxt_filter_info *filter;int i, max_filters; -if (BNXT_PF (bp)) { -struct bnxt_pf_info *pf = &bp->pf; - - max_filters = pf->max_l2_ctx; - }else { -struct bnxt_vf_info *vf = &bp->vf; - - max_filters = vf->max_l2_ctx; - } + max_filters = bp->max_l2_ctx;STAILQ_INIT (&bp->free_filter_list);for (i =0 ; i < max_filters; i++) { filter = &bp->filter_info[i];
@@ -122,15 +114,7 @@ void bnxt_free_filter_mem(struct bnxt *bp)return ;/* Ensure that all filters are freed */ -if (BNXT_PF (bp)) { -struct bnxt_pf_info *pf = &bp->pf; - - max_filters = pf->max_l2_ctx; - }else { -struct bnxt_vf_info *vf = &bp->vf; - - max_filters = vf->max_l2_ctx; - } + max_filters = bp->max_l2_ctx;for (i =0 ; i < max_filters; i++) { filter = &bp->filter_info[i];if (filter->fw_l2_filter_id != ((uint64_t )-1 )) {
@@ -155,15 +139,7 @@ int bnxt_alloc_filter_mem(struct bnxt *bp)struct bnxt_filter_info *filter_mem;uint16_t max_filters; -if (BNXT_PF (bp)) { -struct bnxt_pf_info *pf = &bp->pf; - - max_filters = pf->max_l2_ctx; - }else { -struct bnxt_vf_info *vf = &bp->vf; - - max_filters = vf->max_l2_ctx; - } + max_filters = bp->max_l2_ctx;/* Allocate memory for VNIC pool and filter pool */ filter_mem = rte_zmalloc("bnxt_filter_info", max_filters * sizeof(struct bnxt_filter_info),
drivers/net/bnxt/bnxt_hwrm.c +293 -31
347 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.h +2 -0
@@ -101,5 +101,7 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp);int bnxt_get_hwrm_link_config (struct bnxt *bp,struct rte_eth_link *link);int bnxt_set_hwrm_link_config (struct bnxt *bp,bool link_up);int bnxt_hwrm_func_qcfg (struct bnxt *bp); +int bnxt_hwrm_allocate_pf_only (struct bnxt *bp); +int bnxt_hwrm_allocate_vfs (struct bnxt *bp,int num_vfs);#endif
drivers/net/bnxt/bnxt_vnic.c +4 -36
@@ -69,15 +69,7 @@ void bnxt_init_vnics(struct bnxt *bp)uint16_t max_vnics;int i, j; -if (BNXT_PF (bp)) { -struct bnxt_pf_info *pf = &bp->pf; - - max_vnics = pf->max_vnics; - }else { -struct bnxt_vf_info *vf = &bp->vf; - - max_vnics = vf->max_vnics; - } + max_vnics = bp->max_vnics;STAILQ_INIT (&bp->free_vnic_list);for (i =0 ; i < max_vnics; i++) { vnic = &bp->vnic_info[i];
@@ -181,15 +173,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)uint16_t max_vnics;int i; -if (BNXT_PF (bp)) { -struct bnxt_pf_info *pf = &bp->pf; - - max_vnics = pf->max_vnics; - }else { -struct bnxt_vf_info *vf = &bp->vf; - - max_vnics = vf->max_vnics; - } + max_vnics = bp->max_vnics;snprintf (mz_name,RTE_MEMZONE_NAMESIZE ,"bnxt_%04x:%02x:%02x:%02x_vnicattr" , pdev->addr.domain, pdev->addr.bus, pdev->addr.devid, pdev->addr.function);
@@ -232,15 +216,7 @@ void bnxt_free_vnic_mem(struct bnxt *bp)if (bp->vnic_info ==NULL )return ; -if (BNXT_PF (bp)) { -struct bnxt_pf_info *pf = &bp->pf; - - max_vnics = pf->max_vnics; - }else { -struct bnxt_vf_info *vf = &bp->vf; - - max_vnics = vf->max_vnics; - } + max_vnics = bp->max_vnics;for (i =0 ; i < max_vnics; i++) { vnic = &bp->vnic_info[i];if (vnic->fw_vnic_id != (uint16_t )HWRM_NA_SIGNATURE ) {
@@ -258,15 +234,7 @@ int bnxt_alloc_vnic_mem(struct bnxt *bp)struct bnxt_vnic_info *vnic_mem;uint16_t max_vnics; -if (BNXT_PF (bp)) { -struct bnxt_pf_info *pf = &bp->pf; - - max_vnics = pf->max_vnics; - }else { -struct bnxt_vf_info *vf = &bp->vf; - - max_vnics = vf->max_vnics; - } + max_vnics = bp->max_vnics;/* Allocate memory for VNIC pool and filter pool */ vnic_mem =rte_zmalloc ("bnxt_vnic_info" , max_vnics *sizeof (struct bnxt_vnic_info ),0 );
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 3/28 bnxt: add additonal HWRM debug info to error messages
In reply to Ajit KhapardeAdd the cmd_err and opaque_0 and opaque_1 fields to HWRM error messages. These allow better debugging of some classes of HWRM errors.
--- drivers/net/bnxt/bnxt_hwrm.c | 17 +++++++++++++++- drivers/net/bnxt/hsi_struct_def_dpdk.h | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_hwrm.c +16 -1
@@ -140,7 +140,22 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, uint32_t msg_len) } \if (resp->error_code) { \ rc =rte_le_to_cpu_16 (resp->error_code); \ -RTE_LOG (ERR ,PMD ,"%s error %d\n" , __func__, rc); \ +if (resp->resp_len >=16 ) { \ +struct hwrm_err_output *tmp_hwrm_err_op = \ + (void *)resp; \ +RTE_LOG (ERR ,PMD , \ +"%s error %d:%d:%08x:%04x\n" , \ + __func__, \ + rc, tmp_hwrm_err_op->cmd_err, \ +rte_le_to_cpu_32 (\ + tmp_hwrm_err_op->opaque_0), \ +rte_le_to_cpu_16 (\ + tmp_hwrm_err_op->opaque_1)); \ + } \ +else { \ +RTE_LOG (ERR ,PMD , \ +"%s error %d\n" , __func__, rc); \ + } \return rc; \ } \ }
drivers/net/bnxt/hsi_struct_def_dpdk.h +36 -0
@@ -1319,6 +1319,42 @@ struct output {*/ } __attribute__((packed)); +/* Output (16 bytes) */ +struct hwrm_err_output { +uint16_t error_code; +/* +* Pass/Fail or error type Note: receiver to verify the in parameters, +* and fail the call with an error when appropriate +*/ +uint16_t req_type; +/* This field returns the type of original request. */ +uint16_t seq_id; +/* This field provides original sequence number of the command. */ +uint16_t resp_len; +/* +* This field is the length of the response in bytes. The last byte of +* the response is a valid flag that will read as '1' when the command +* has been completely written to memory. +*/ +uint32_t opaque_0; +/* debug info for this error response. */ +uint16_t opaque_1; +/* debug info for this error response. */ +uint8_t cmd_err; +/* +* In the case of an error response, command specific error code is +* returned in this field. +*/ +uint8_t valid; +/* +* This field is used in Output records to indicate that the output is +* completely written to RAM. This field should be read as '1' to +* indicate that the output has been completely written. When writing a +* command completion or response to an internal processor, the order of +* writes has to be such that this field is written last. +*/ +} __attribute__((packed)); +/* hwrm_ver_get */ /* * Description: This function is called by a driver to determine the HWRM
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 4/28 bnxt: add new HWRM commands
In reply to Ajit KhapardeAdd support for the following HWRM commands:
- hwrm_func_buf_rgtr:
This command is used by the PF driver to register buffers used in the PF-VF communication with the HWRM. The PF driver uses this command to register buffers for each PF-VF channel. A parent PF may issue this command per child VF.
- hwrm_func_buf_unrgtr:
This command is used by the PF driver to unregister buffers used in the PF-VF communication with the HWRM/firmware. The PF driver uses this command to unregister buffers for PF-VF communication. A parent PF may issue this command to unregister buffers for communication between the PF and a specific VF.
- hwrm_reject_fwd_resp:
This command instructs the HWRM to reject a forwarded request and forward the error response of the encapsulated request to the location specified in the original request that is encapsulated.
- hwrm_exec_fwd_resp:
This command instructs the firmware to execute the forwarded request and forward the response of the encapsulated request to the location specified in the original request that is encapsulated.
These commands will be used in subsequent patches.
--- drivers/net/bnxt/hsi_struct_def_dpdk.h | 298 ++++++++++++++++++++++++++++++++- 1 file changed, 290 insertions(+), 8 deletions(-)
drivers/net/bnxt/hsi_struct_def_dpdk.h +290 -8
@@ -74,23 +74,25 @@ struct ctx_hw_stats64 {* Following is the signature for HWRM message field that indicates not * applicable (All F's). Need to cast it the size of the field if needed. */ -#define HWRM_NA_SIGNATURE ((uint32_t)(-1)) -#define HWRM_MAX_REQ_LEN (128)/* hwrm_func_buf_rgtr */ -#define HWRM_MAX_RESP_LEN (176)/* hwrm_func_qstats */ -#define HW_HASH_INDEX_SIZE 0x80/* 7 bit indirection table index. */ -#define HW_HASH_KEY_SIZE 40 -#define HWRM_RESP_VALID_KEY 1/* valid key for HWRM response */ +#define HWRM_NA_SIGNATURE ((uint32_t)(-1)) +#define HWRM_MAX_REQ_LEN 128/* hwrm_func_buf_rgtr */ +#define HWRM_MAX_RESP_LEN 176/* hwrm_func_qstats */ +#define HW_HASH_INDEX_SIZE 0x80/* 7 bit indirection table index. */ +#define HW_HASH_KEY_SIZE 40 +#define HWRM_RESP_VALID_KEY 1/* valid key for HWRM response */ /* * Request types */ #define HWRM_VER_GET (UINT32_C(0x0)) +#define HWRM_FUNC_BUF_UNRGTR (UINT32_C(0xe))#define HWRM_FUNC_RESET (UINT32_C(0x11))#define HWRM_FUNC_QCAPS (UINT32_C(0x15))#define HWRM_FUNC_QCFG (UINT32_C(0x16))#define HWRM_FUNC_CFG (UINT32_C(0x17))#define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))#define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d)) +#define HWRM_FUNC_BUF_RGTR (UINT32_C(0x1f))#define HWRM_PORT_PHY_CFG (UINT32_C(0x20))#define HWRM_PORT_PHY_QCFG (UINT32_C(0x27))#define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
@@ -112,10 +114,11 @@ struct ctx_hw_stats64 {#define HWRM_STAT_CTX_FREE (UINT32_C(0xb1))#define HWRM_STAT_CTX_CLR_STATS (UINT32_C(0xb3))#define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0)) +#define HWRM_REJECT_FWD_RESP (UINT32_C(0xd1))/* Return Codes */ -#define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2)) -#define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3)) +#define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2)) +#define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3))/* Short TX BD (16 bytes) */ struct tx_bd_short {
@@ -1649,6 +1652,84 @@ struct hwrm_ver_get_output {*/ } __attribute__((packed)); +/* hwrm_func_buf_unrgtr */ +/* +* Description: This command is used by the PF driver to unregister buffers used +* in the PF-VF communication with the HWRM. The PF driver uses this command to +* unregister buffers for PF-VF communication. A parent PF may issue this +* command to unregister buffers for communication between the PF and a specific +* VF. If the VF ID is not valid, then this command is used to unregister +* buffers used for communications with all children VFs of the PF. +*/ +/* Input (24 bytes) */ +struct hwrm_func_buf_unrgtr_input { +uint16_t req_type; +/* +* This value indicates what type of request this is. The format for the +* rest of the command is determined by this field. +*/ +uint16_t cmpl_ring; +/* +* This value indicates the what completion ring the request will be +* optionally completed on. If the value is -1, then no CR completion +* will be generated. Any other value must be a valid CR ring_id value +* for this function. +*/ +uint16_t seq_id; +/* This value indicates the command sequence number. */ +uint16_t target_id; +/* +* Target ID of this command. 0x0 - 0xFFF8 - Used for function ids +* 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM +*/ +uint64_t resp_addr; +/* +* This is the host address where the response will be written when the +* request is complete. This area must be 16B aligned and must be +* cleared to zero before the request is made. +*/ +uint32_t enables; +/* This bit must be '1' for the vf_id field to be configured. */ +#define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID (UINT32_C(0x1)) +uint16_t vf_id; +/* +* This value is used to identify a Virtual Function (VF). The scope of +* VF ID is local within a PF. +*/ +uint16_t unused_0; +} __attribute__((packed)); + +/* Output (16 bytes) */ +struct hwrm_func_buf_unrgtr_output { +uint16_t error_code; +/* +* Pass/Fail or error type Note: receiver to verify the in parameters, +* and fail the call with an error when appropriate +*/ +uint16_t req_type; +/* This field returns the type of original request. */ +uint16_t seq_id; +/* This field provides original sequence number of the command. */ +uint16_t resp_len; +/* +* This field is the length of the response in bytes. The last byte of +* the response is a valid flag that will read as '1' when the command +* has been completely written to memory. +*/ +uint32_t unused_0; +uint8_t unused_1; +uint8_t unused_2; +uint8_t unused_3; +uint8_t valid; +/* +* This field is used in Output records to indicate that the output is +* completely written to RAM. This field should be read as '1' to +* indicate that the output has been completely written. When writing a +* command completion or response to an internal processor, the order of +* writes has to be such that this field is written last. +*/ +} __attribute__((packed)); +/* hwrm_func_reset */ /* * Description: This command resets a hardware function (PCIe function) and
@@ -2879,6 +2960,119 @@ struct hwrm_func_drv_rgtr_output {*/ } __attribute__((packed)); +/* hwrm_func_buf_rgtr */ +/* +* Description: This command is used by the PF driver to register buffers used +* in the PF-VF communication with the HWRM. The PF driver uses this command to +* register buffers for each PF-VF channel. A parent PF may issue this command +* per child VF. If VF ID is not valid, then this command is used to register +* buffers for all children VFs of the PF. +*/ +/* Input (128 bytes) */ +struct hwrm_func_buf_rgtr_input { +uint16_t req_type; +/* +* This value indicates what type of request this is. The format for the +* rest of the command is determined by this field. +*/ +uint16_t cmpl_ring; +/* +* This value indicates the what completion ring the request will be +* optionally completed on. If the value is -1, then no CR completion +* will be generated. Any other value must be a valid CR ring_id value +* for this function. +*/ +uint16_t seq_id; +/* This value indicates the command sequence number. */ +uint16_t target_id; +/* +* Target ID of this command. 0x0 - 0xFFF8 - Used for function ids +* 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM +*/ +uint64_t resp_addr; +/* +* This is the host address where the response will be written when the +* request is complete. This area must be 16B aligned and must be +* cleared to zero before the request is made. +*/ +uint32_t enables; +/* This bit must be '1' for the vf_id field to be configured. */ +#define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID (UINT32_C(0x1)) +/* This bit must be '1' for the err_buf_addr field to be configured. */ +#define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR (UINT32_C(0x2)) +uint16_t vf_id; +/* +* This value is used to identify a Virtual Function (VF). The scope of +* VF ID is local within a PF. +*/ +uint16_t req_buf_num_pages; +/* +* This field represents the number of pages used for request buffer(s). +*/ +uint16_t req_buf_page_size; +/* This field represents the page size used for request buffer(s). */ +/* 16 bytes */ +#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B (UINT32_C(0x4)) +/* 4 Kbytes */ +#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K (UINT32_C(0xc)) +/* 8 Kbytes */ +#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K (UINT32_C(0xd)) +/* 64 Kbytes */ +#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K (UINT32_C(0x10)) +/* 2 Mbytes */ +#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M (UINT32_C(0x15)) +/* 4 Mbytes */ +#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M (UINT32_C(0x16)) +/* 1 Gbytes */ +#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G (UINT32_C(0x1e)) +uint16_t req_buf_len; +/* The length of the request buffer per VF in bytes. */ +uint16_t resp_buf_len; +/* The length of the response buffer in bytes. */ +uint8_t unused_0; +uint8_t unused_1; +/* This field represents the page addresses. */ +uint64_t req_buf_page_addr[10 ]; +uint64_t error_buf_addr; +/* +* This field is used to receive the error reporting from the chipset. +* Only applicable for PFs. +*/ +uint64_t resp_buf_addr; +/* This field is used to receive the response forwarded by the HWRM. */ +} __attribute__((packed)); + +/* Output (16 bytes) */ +struct hwrm_func_buf_rgtr_output { +uint16_t error_code; +/* +* Pass/Fail or error type Note: receiver to verify the in parameters, +* and fail the call with an error when appropriate +*/ +uint16_t req_type; +/* This field returns the type of original request. */ +uint16_t seq_id; +/* This field provides original sequence number of the command. */ +uint16_t resp_len; +/* +* This field is the length of the response in bytes. The last byte of +* the response is a valid flag that will read as '1' when the command +* has been completely written to memory. +*/ +uint32_t unused_0; +uint8_t unused_1; +uint8_t unused_2; +uint8_t unused_3; +uint8_t valid; +/* +* This field is used in Output records to indicate that the output is +* completely written to RAM. This field should be read as '1' to +* indicate that the output has been completely written. When writing a +* command completion or response to an internal processor, the order of +* writes has to be such that this field is written last. +*/ +} __attribute__((packed)); +/* hwrm_func_drv_unrgtr */ /* * Description: This command is used by the function driver to un register with
@@ -6503,4 +6697,92 @@ struct hwrm_exec_fwd_resp_output {*/ } __attribute__((packed)); + +/* hwrm_reject_fwd_resp */ +/* +* Description: This command is used to send an encapsulated request to the +* HWRM. This command instructs the HWRM to reject the request and forward the +* error response of the encapsulated request to the location specified in the +* original request that is encapsulated. The target id of this command shall be +* set to 0xFFFF (HWRM). The response location in this command shall be used to +* acknowledge the receipt of the encapsulated request and forwarding of the +* response. +*/ +/* Input (128 bytes) */ +struct hwrm_reject_fwd_resp_input { +uint16_t req_type; +/* +* This value indicates what type of request this is. The format +* for the rest of the command is determined by this field. +*/ +uint16_t cmpl_ring; +/* +* This value indicates the what completion ring the request +* will be optionally completed on. If the value is -1, then no +* CR completion will be generated. Any other value must be a +* valid CR ring_id value for this function. +*/ +uint16_t seq_id; +/* This value indicates the command sequence number. */ +uint16_t target_id; +/* +* Target ID of this command. 0x0 - 0xFFF8 - Used for function +* ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF +* - HWRM +*/ +uint64_t resp_addr; +/* +* This is the host address where the response will be written +* when the request is complete. This area must be 16B aligned +* and must be cleared to zero before the request is made. +*/ +uint32_t encap_request[26 ]; +/* +* This is an encapsulated request. This request should be +* rejected by the HWRM and the error response should be +* provided in the response buffer inside the encapsulated +* request. +*/ +uint16_t encap_resp_target_id; +/* +* This value indicates the target id of the response to the +* encapsulated request. 0x0 - 0xFFF8 - Used for function ids +* 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - +* HWRM +*/ +uint16_t unused_0[3 ]; +} __attribute__((packed)); + +/* Output (16 bytes) */ +struct hwrm_reject_fwd_resp_output { +uint16_t error_code; +/* +* Pass/Fail or error type Note: receiver to verify the in +* parameters, and fail the call with an error when appropriate +*/ +uint16_t req_type; +/* This field returns the type of original request. */ +uint16_t seq_id; +/* This field provides original sequence number of the command. */ +uint16_t resp_len; +/* +* This field is the length of the response in bytes. The last +* byte of the response is a valid flag that will read as '1' +* when the command has been completely written to memory. +*/ +uint32_t unused_0; +uint8_t unused_1; +uint8_t unused_2; +uint8_t unused_3; +uint8_t valid; +/* +* This field is used in Output records to indicate that the +* output is completely written to RAM. This field should be +* read as '1' to indicate that the output has been completely +* written. When writing a command completion or response to an +* internal processor, the order of writes has to be such that +* this field is written last. +*/ +} __attribute__((packed)); +#endif
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 5/28 bnxt: add support for PF/VF communications
In reply to Ajit KhapardeSet up interrupts and default completion ring during device init to allow VF communications.
Request most VF HWRM commands be forwarded to the PF driver. In the future, this should be configurable.
Fix reporting of active VFs.
Add a log message when a completion is ignored on the default completion ring since this will indicate support that needs to be added.
Do not initialize the default completion ring in bnxt_alloc_hwrm_rings(), but move it out to bnxt_dev_init().
Create a structure bnxt_child_vf_info for PF to cache VF specific info.
--- drivers/net/bnxt/bnxt.h | 9 +- drivers/net/bnxt/bnxt_cpr.c | 88 ++++++++++------- drivers/net/bnxt/bnxt_cpr.h | 1 + drivers/net/bnxt/bnxt_ethdev.c | 80 +++++++++++---- drivers/net/bnxt/bnxt_hwrm.c | 218 +++++++++++++++++++++++++++++++++-------- drivers/net/bnxt/bnxt_hwrm.h | 10 +- drivers/net/bnxt/bnxt_irq.c | 5 +- drivers/net/bnxt/bnxt_ring.c | 15 --- 8 files changed, 308 insertions(+), 118 deletions(-)
drivers/net/bnxt/bnxt.h +8 -1
@@ -54,6 +54,12 @@ enum bnxt_hw_context { HW_CONTEXT_IS_LB = 3, }; +struct bnxt_child_vf_info { +uint16_t fid; +uint32_t func_cfg_flags; +void *req_buf; +}; +struct bnxt_pf_info {#define BNXT_FIRST_PF_FID 1#define BNXT_MAX_VFS (bp) (bp->pf.max_vfs)
@@ -65,9 +71,10 @@ struct bnxt_pf_info {uint16_t first_vf_id;uint16_t active_vfs;uint16_t max_vfs; +uint32_t func_cfg_flags;void *vf_req_buf; -phys_addr_t vf_req_buf_dma_addr;uint32_t vf_req_fwd[8 ]; +struct bnxt_child_vf_info *vf_info; };/* Max wait time is 10 * 100ms = 1s */
drivers/net/bnxt/bnxt_cpr.c +54 -34
110 lines not on this page · raw message
drivers/net/bnxt/bnxt_cpr.h +1 -0
@@ -82,6 +82,7 @@ struct bnxt_cp_ring_info {struct bnxt ; +int bnxt_alloc_def_cp_ring (struct bnxt *bp);void bnxt_free_def_cp_ring (struct bnxt *bp);int bnxt_init_def_ring_struct (struct bnxt *bp,unsigned int socket_id);void bnxt_handle_async_event (struct bnxt *bp,struct cmpl_base *cmp);
drivers/net/bnxt/bnxt_ethdev.c +59 -21
135 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.c +176 -42
354 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.h +7 -3
@@ -52,10 +52,14 @@ int bnxt_hwrm_set_filter(struct bnxt *bp,struct bnxt_vnic_info *vnic, struct bnxt_filter_info *filter); -int bnxt_hwrm_exec_fwd_resp (struct bnxt *bp,void *fwd_cmd); +int bnxt_hwrm_exec_fwd_resp (struct bnxt *bp,uint16_t target_id, +void *encaped,size_t ec_size); +int bnxt_hwrm_reject_fwd_resp (struct bnxt *bp,uint16_t target_id, +void *encaped,size_t ec_size); -int bnxt_hwrm_func_driver_register (struct bnxt *bp,uint32_t flags, -uint32_t *vf_req_fwd); +int bnxt_hwrm_func_buf_rgtr (struct bnxt *bp); +int bnxt_hwrm_func_buf_unrgtr (struct bnxt *bp); +int bnxt_hwrm_func_driver_register (struct bnxt *bp);int bnxt_hwrm_func_qcaps (struct bnxt *bp);int bnxt_hwrm_func_reset (struct bnxt *bp);int bnxt_hwrm_func_driver_unregister (struct bnxt *bp,uint32_t flags);
drivers/net/bnxt/bnxt_irq.c +3 -2
@@ -67,11 +67,12 @@ static void bnxt_int_handler(struct rte_intr_handle *handle __rte_unused,/* Handle any async event */ bnxt_handle_async_event (bp, cmp);break ; -case CMPL_BASE_TYPE_HWRM_FWD_RESP : -/* Handle HWRM forwarded responses */ +case CMPL_BASE_TYPE_HWRM_FWD_REQ :bnxt_handle_fwd_req (bp, cmp);break ;default : +RTE_LOG (INFO ,PMD , +"Ignoring %02x completion\n" ,CMP_TYPE (cmp));/* Ignore any other events */ break ; }
drivers/net/bnxt/bnxt_ring.c +0 -15
@@ -213,21 +213,6 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)unsigned int i;int rc =0 ; -/* Default completion ring */ - { -struct bnxt_cp_ring_info *cpr = bp->def_cp_ring; -struct bnxt_ring *cp_ring = cpr->cp_ring_struct; - - rc =bnxt_hwrm_ring_alloc (bp, cp_ring, -HWRM_RING_ALLOC_INPUT_RING_TYPE_CMPL , -0 ,HWRM_NA_SIGNATURE ); -if (rc) - goto err_out; - cpr->cp_doorbell = pci_dev->mem_resource[2 ].addr; -B_CP_DIS_DB (cpr, cpr->cp_raw_cons); - bp->grp_info[0 ].cp_fw_ring_id = cp_ring->fw_ring_id; - } -for (i =0 ; i < bp->rx_cp_nr_rings; i++) {struct bnxt_rx_queue *rxq = bp->rx_queues[i];struct bnxt_cp_ring_info *cpr = rxq->cp_ring;
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 6/28 bnxt: add new HWRM commands to query VNIC info
In reply to Ajit KhapardeThis patch adds the following HWRM commands which will be used by the subsequent patches.
- hwrm_func_vf_vnic_ids_query:
This command is used to query vf vnic ids.
- hwrm_vnic_qcfg:
Query the RX VNIC structure. This function can be used by a PF or a VF driver to query its own VNIC resource or VNIC resource of its child VF.
--- drivers/net/bnxt/hsi_struct_def_dpdk.h | 217 ++++++++++++++++++++++++++++++++- 1 file changed, 216 insertions(+), 1 deletion(-)
drivers/net/bnxt/hsi_struct_def_dpdk.h +216 -1
@@ -91,6 +91,7 @@ struct ctx_hw_stats64 {#define HWRM_FUNC_QCFG (UINT32_C(0x16))#define HWRM_FUNC_CFG (UINT32_C(0x17))#define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a)) +#define HWRM_FUNC_VF_VNIC_IDS_QUERY (UINT32_C(0x1c))#define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))#define HWRM_FUNC_BUF_RGTR (UINT32_C(0x1f))#define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
@@ -99,6 +100,7 @@ struct ctx_hw_stats64 {#define HWRM_VNIC_ALLOC (UINT32_C(0x40))#define HWRM_VNIC_FREE (UINT32_C(0x41))#define HWRM_VNIC_CFG (UINT32_C(0x42)) +#define HWRM_VNIC_QCFG (UINT32_C(0x43))#define HWRM_VNIC_RSS_CFG (UINT32_C(0x46))#define HWRM_RING_ALLOC (UINT32_C(0x50))#define HWRM_RING_FREE (UINT32_C(0x51))
@@ -1179,7 +1181,7 @@ struct hwrm_fwd_req_cmpl {*/ uint32_t unused_0;/* unused1 is 32 b */ -uint32_t req_buf_addr_v[2 ]; +uint64_t req_buf_addr_v;/* Address of forwarded request. */ /* * This value is written by the NIC such that it will be
@@ -3148,6 +3150,82 @@ struct hwrm_func_drv_unrgtr_output {*/ } __attribute__((packed)); +/* hwrm_func_vf_vnic_ids_query */ +/* Description: This command is used to query vf vnic ids. */ +/* Input (32 bytes) */ +struct hwrm_func_vf_vnic_ids_query_input { +uint16_t req_type; +/* +* This value indicates what type of request this is. The format for the +* rest of the command is determined by this field. +*/ +uint16_t cmpl_ring; +/* +* This value indicates the what completion ring the request will be +* optionally completed on. If the value is -1, then no CR completion +* will be generated. Any other value must be a valid CR ring_id value +* for this function. +*/ +uint16_t seq_id; +/* This value indicates the command sequence number. */ +uint16_t target_id; +/* +* Target ID of this command. 0x0 - 0xFFF8 - Used for function ids +* 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM +*/ +uint64_t resp_addr; +/* +* This is the host address where the response will be written when the +* request is complete. This area must be 16B aligned and must be +* cleared to zero before the request is made. +*/ +uint16_t vf_id; +/* +* This value is used to identify a Virtual Function (VF). The scope of +* VF ID is local within a PF. +*/ +uint8_t unused_0; +uint8_t unused_1; +uint32_t max_vnic_id_cnt; +/* Max number of vnic ids in vnic id table */ +uint64_t vnic_id_tbl_addr; +/* This is the address for VF VNIC ID table */ +} __attribute__((packed)); + +/* Output (16 bytes) */ +struct hwrm_func_vf_vnic_ids_query_output { +uint16_t error_code; +/* +* Pass/Fail or error type Note: receiver to verify the in parameters, +* and fail the call with an error when appropriate +*/ +uint16_t req_type; +/* This field returns the type of original request. */ +uint16_t seq_id; +/* This field provides original sequence number of the command. */ +uint16_t resp_len; +/* +* This field is the length of the response in bytes. The last byte of +* the response is a valid flag that will read as '1' when the command +* has been completely written to memory. +*/ +uint32_t vnic_id_cnt; +/* +* Actual number of vnic ids Each VNIC ID is written as a 32-bit number. +*/ +uint8_t unused_0; +uint8_t unused_1; +uint8_t unused_2; +uint8_t valid; +/* +* This field is used in Output records to indicate that the output is +* completely written to RAM. This field should be read as '1' to +* indicate that the output has been completely written. When writing a +* command completion or response to an internal processor, the order of +* writes has to be such that this field is written last. +*/ +} __attribute__((packed)); +/* hwrm_port_phy_cfg */ /* * Description: This command configures the PHY device for the port. It allows
@@ -5023,6 +5101,143 @@ struct hwrm_vnic_cfg_output {*/ } __attribute__((packed)); +/* hwrm_vnic_qcfg */ +/* +* Description: Query the RX VNIC structure. This function can be used by a PF +* driver to query its own VNIC resource or VNIC resource of its child VF. This +* function can also be used by a VF driver to query its own VNIC resource. +*/ +/* Input (32 bytes) */ +struct hwrm_vnic_qcfg_input { +uint16_t req_type; +/* +* This value indicates what type of request this is. The format for the +* rest of the command is determined by this field. +*/ +uint16_t cmpl_ring; +/* +* This value indicates the what completion ring the request will be +* optionally completed on. If the value is -1, then no CR completion +* will be generated. Any other value must be a valid CR ring_id value +* for this function. +*/ +uint16_t seq_id; +/* This value indicates the command sequence number. */ +uint16_t target_id; +/* +* Target ID of this command. 0x0 - 0xFFF8 - Used for function ids +* 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM +*/ +uint64_t resp_addr; +/* +* This is the host address where the response will be written when the +* request is complete. This area must be 16B aligned and must be +* cleared to zero before the request is made. +*/ +uint32_t enables; +/* This bit must be '1' for the vf_id_valid field to be configured. */ +#define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1) +uint32_t vnic_id; +/* Logical vnic ID */ +uint16_t vf_id; +/* ID of Virtual Function whose VNIC resource is being queried. */ +uint16_t unused_0[3 ]; +}; + +/* Output (32 bytes) */ +struct hwrm_vnic_qcfg_output { +uint16_t error_code; +/* +* Pass/Fail or error type Note: receiver to verify the in parameters, +* and fail the call with an error when appropriate +*/ +uint16_t req_type; +/* This field returns the type of original request. */ +uint16_t seq_id; +/* This field provides original sequence number of the command. */ +uint16_t resp_len; +/* +* This field is the length of the response in bytes. The last byte of +* the response is a valid flag that will read as '1' when the command +* has been completely written to memory. +*/ +uint16_t dflt_ring_grp; +/* Default Completion ring for the VNIC. */ +uint16_t rss_rule; +/* +* RSS ID for RSS rule/table structure. 0xFF... (All Fs) if there is no +* RSS rule. +*/ +uint16_t cos_rule; +/* +* RSS ID for COS rule/table structure. 0xFF... (All Fs) if there is no +* COS rule. +*/ +uint16_t lb_rule; +/* +* RSS ID for load balancing rule/table structure. 0xFF... (All Fs) if +* there is no LB rule. +*/ +uint16_t mru; +/* The maximum receive unit of the vnic. */ +uint8_t unused_0; +uint8_t unused_1; +uint32_t flags; +/* +* When this bit is '1', the VNIC is the default VNIC for the function. +*/ +#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT UINT32_C(0x1) +/* +* When this bit is '1', the VNIC is configured to strip VLAN in the RX +* path. If set to '0', then VLAN stripping is disabled on this VNIC. +*/ +#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2) +/* +* When this bit is '1', the VNIC is configured to buffer receive +* packets in the hardware until the host posts new receive buffers. If +* set to '0', then bd_stall is disabled on this VNIC. +*/ +#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4) +/* +* When this bit is '1', the VNIC is configured to receive both RoCE and +* non-RoCE traffic. If set to '0', then this VNIC is not configured to +* operate in dual VNIC mode. +*/ +#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8) +/* +* When this flag is set to '1', the VNIC is configured to receive only +* RoCE traffic. When this flag is set to '0', the VNIC is not +* configured to receive only RoCE traffic. If roce_dual_vnic_mode flag +* and this flag both are set to '1', then it is an invalid +* configuration of the VNIC. The HWRM should not allow that type of +* mis-configuration by HWRM clients. +*/ +#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10) +/* +* When a VNIC uses one destination ring group for certain application +* (e.g. Receive Flow Steering) where exact match is used to direct +* packets to a VNIC with one destination ring group only, there is no +* need to configure RSS indirection table for that VNIC as only one +* destination ring group is used. When this bit is set to '1', then the +* VNIC is enabled in a mode where RSS is enabled in the VNIC using a +* RSS context for computing RSS hash but the RSS indirection table is +* not configured. +*/ +#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20) +uint32_t unused_2; +uint8_t unused_3; +uint8_t unused_4; +uint8_t unused_5; +uint8_t valid; +/* +* This field is used in Output records to indicate that the output is +* completely written to RAM. This field should be read as '1' to +* indicate that the output has been completely written. When writing a +* command completion or response to an internal processor, the order of +* writes has to be such that this field is written last. +*/ +}; +/* hwrm_vnic_rss_cfg */ /* Description: This function is used to enable RSS configuration. */ /* Input (48 bytes) */
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 7/28 bnxt: add functions for tx_loopback and queues_drop_en
In reply to Ajit KhapardeAdd functions rte_pmd_bnxt_set_tx_loopback and rte_pmd_bnxt_set_all_queues_drop_en to configure tx_loopback and queue_drop setting in the hardware.
This patch also adds code to testpmd app to call the appropriate function when the bnxt driver is in use.
--- app/test-pmd/cmdline.c | 13 ++- drivers/net/bnxt/Makefile | 2 + drivers/net/bnxt/bnxt.h | 8 ++ drivers/net/bnxt/bnxt_cpr.c | 41 ++++++--- drivers/net/bnxt/bnxt_ethdev.c | 1 + drivers/net/bnxt/bnxt_hwrm.c | 114 +++++++++++++++++++++++- drivers/net/bnxt/bnxt_hwrm.h | 4 + drivers/net/bnxt/bnxt_irq.c | 3 +- drivers/net/bnxt/bnxt_vnic.h | 3 + drivers/net/bnxt/rte_pmd_bnxt.c | 143 ++++++++++++++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt.h | 98 ++++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt_version.map | 7 +- 12 files changed, 417 insertions(+), 20 deletions(-) create mode 100644 drivers/net/bnxt/rte_pmd_bnxt.c create mode 100644 drivers/net/bnxt/rte_pmd_bnxt.h
app/test-pmd/cmdline.c +12 -1
@@ -94,6 +94,9 @@#ifdef RTE_LIBRTE_I40E_PMD #include <rte_pmd_i40e.h> #endif +#ifdef RTE_LIBRTE_BNXT_PMD +#include <rte_pmd_bnxt.h> +#endif #include "testpmd.h" static struct cmdline *testpmd_cl;
@@ -11353,6 +11356,9 @@ cmd_set_tx_loopback_parsed(if (ret == -ENOTSUP ) ret =rte_pmd_ixgbe_set_tx_loopback (res->port_id, is_on);#endif +#ifdef RTE_LIBRTE_BNXT_PMD + ret =rte_pmd_bnxt_set_tx_loopback (res->port_id, is_on); +#endif #ifdef RTE_LIBRTE_I40E_PMD if (ret == -ENOTSUP ) ret =rte_pmd_i40e_set_tx_loopback (res->port_id, is_on);
@@ -11441,7 +11447,12 @@ cmd_set_all_queues_drop_en_parsed(if (port_id_is_invalid (res->port_id,ENABLED_WARN ))return ; - ret =rte_pmd_ixgbe_set_all_queues_drop_en (res->port_id, is_on); +#ifdef RTE_LIBRTE_BNXT_PMD + ret =rte_pmd_bnxt_set_all_queues_drop_en (res->port_id, is_on); +#endif +#ifdef RTE_LIBRTE_IXGBE_PMD + ret =rte_pmd_ixgbe_set_all_queues_drop_en (res->port_id, is_on); +#endif switch (ret) {case 0 :break ;
drivers/net/bnxt/Makefile +2 -0
@@ -60,11 +60,13 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_txq.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_txr.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_vnic.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_irq.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c # # Export include files # SYMLINK-y-include += +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += rte_pmd_bnxt.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += lib/librte_mbuf
drivers/net/bnxt/bnxt.h +8 -0
@@ -74,7 +74,13 @@ struct bnxt_pf_info {uint32_t func_cfg_flags;void *vf_req_buf;uint32_t vf_req_fwd[8 ]; +uint16_t total_vnics;struct bnxt_child_vf_info *vf_info; +#define BNXT_EVB_MODE_NONE 0 +#define BNXT_EVB_MODE_VEB 1 +#define BNXT_EVB_MODE_VEPA 2 +uint8_t evb_mode; +uint16_t vnic_dflt_ring_group[340 ]; };/* Max wait time is 10 * 100ms = 1s */
@@ -177,4 +183,6 @@ struct bnxt {int bnxt_link_update_op (struct rte_eth_dev *eth_dev,int wait_to_complete); +int bnxt_rcv_msg_from_vf (struct bnxt *bp,uint16_t vf_id,void *msg); +#endif
drivers/net/bnxt/bnxt_cpr.c +28 -13
71 lines not on this page · raw message
drivers/net/bnxt/bnxt_ethdev.c +1 -0
@@ -52,6 +52,7 @@#include "bnxt_txr.h" #include "bnxt_vnic.h" #include "hsi_struct_def_dpdk.h" +#include "rte_pmd_bnxt.h" #define DRV_MODULE_NAME "bnxt" static const char bnxt_version[] =
drivers/net/bnxt/bnxt_hwrm.c +111 -3
160 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.h +4 -0
@@ -85,6 +85,8 @@ int bnxt_hwrm_ver_get(struct bnxt *bp);int bnxt_hwrm_vnic_alloc (struct bnxt *bp,struct bnxt_vnic_info *vnic);int bnxt_hwrm_vnic_cfg (struct bnxt *bp,struct bnxt_vnic_info *vnic); +int bnxt_hwrm_vnic_qcfg (struct bnxt *bp,struct bnxt_vnic_info *vnic, +int16_t fw_vf_id);int bnxt_hwrm_vnic_ctx_alloc (struct bnxt *bp,struct bnxt_vnic_info *vnic);int bnxt_hwrm_vnic_ctx_free (struct bnxt *bp,struct bnxt_vnic_info *vnic);int bnxt_hwrm_vnic_free (struct bnxt *bp,struct bnxt_vnic_info *vnic);
@@ -107,5 +109,7 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up);int bnxt_hwrm_func_qcfg (struct bnxt *bp);int bnxt_hwrm_allocate_pf_only (struct bnxt *bp);int bnxt_hwrm_allocate_vfs (struct bnxt *bp,int num_vfs); +int bnxt_hwrm_func_vf_stall (struct bnxt *bp,uint16_t vf,uint8_t on); +int bnxt_hwrm_pf_evb_mode (struct bnxt *bp);#endif
drivers/net/bnxt/bnxt_irq.c +2 -1
@@ -104,7 +104,8 @@ void bnxt_disable_int(struct bnxt *bp)struct bnxt_cp_ring_info *cpr = bp->def_cp_ring;/* Only the default completion ring */ -B_CP_DIS_DB (cpr, cpr->cp_raw_cons); +if (cpr !=NULL && cpr->cp_doorbell !=NULL ) +B_CP_DIS_DB (cpr, cpr->cp_raw_cons); }void bnxt_enable_int (struct bnxt *bp)
drivers/net/bnxt/bnxt_vnic.h +3 -0
@@ -51,6 +51,8 @@ struct bnxt_vnic_info {uint16_t start_grp_id;uint16_t end_grp_id;uint16_t fw_grp_ids[MAX_QUEUES_PER_VNIC ]; +uint16_t dflt_ring_grp; +uint16_t mru;uint16_t hash_type;phys_addr_t rss_table_dma_addr;uint16_t *rss_table;
@@ -62,6 +64,7 @@ struct bnxt_vnic_info {bool vlan_strip;bool func_default; +bool bd_stall; STAILQ_HEAD(, bnxt_filter_info) filter; };
drivers/net/bnxt/rte_pmd_bnxt.c new file +143 -0
143 lines not on this page · raw message
drivers/net/bnxt/rte_pmd_bnxt.h new file +98 -0
98 lines not on this page · raw message
drivers/net/bnxt/rte_pmd_bnxt_version.map +5 -2
@@ -1,4 +1,7 @@ -DPDK_16.04 { +DPDK_17.05 { + global: - local: *; + rte_pmd_bnxt_set_tx_loopback; + rte_pmd_bnxt_set_all_queues_drop_en; }; +
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 8/28 bnxt: support setting VF mac address
In reply to Ajit KhapardeAdd support to set a VF MAC address.
This patch also extends testpmd to call the appropriate vendor specific function to set the VF MAC address.
--- app/test-pmd/cmdline.c | 5 +++++ drivers/net/bnxt/bnxt_hwrm.c | 20 ++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 1 + drivers/net/bnxt/rte_pmd_bnxt.c | 29 +++++++++++++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt.h | 17 +++++++++++++++++ 5 files changed, 72 insertions(+)
app/test-pmd/cmdline.c +5 -0
@@ -11634,6 +11634,11 @@ cmd_set_vf_mac_addr_parsed( ret =rte_pmd_ixgbe_set_vf_mac_addr (res->port_id, res->vf_id, &res->mac_addr);#endif +#ifdef RTE_LIBRTE_BNXT_PMD +if (ret == -ENOTSUP ) + ret =rte_pmd_bnxt_set_vf_mac_addr (res->port_id, res->vf_id, + &res->mac_addr); +#endif #ifdef RTE_LIBRTE_I40E_PMD if (ret == -ENOTSUP ) ret = rte_pmd_i40e_set_vf_mac_addr(res->port_id, res->vf_id,
drivers/net/bnxt/bnxt_hwrm.c +20 -0
@@ -1072,6 +1072,26 @@ int bnxt_hwrm_func_vf_stall(struct bnxt *bp, uint16_t vf, uint8_t on)return rc; } +int bnxt_hwrm_func_vf_mac (struct bnxt *bp,uint16_t vf,uint8_t *mac_addr) +{ +struct hwrm_func_cfg_input req = {0 }; +struct hwrm_func_cfg_output *resp = bp->hwrm_cmd_resp_addr; +int rc; + + req.flags =rte_cpu_to_le_32 (bp->pf.vf_info[vf].func_cfg_flags); + req.enables = +rte_cpu_to_le_32 (HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR ); +memcpy (req.dflt_mac_addr, mac_addr,sizeof (req.dflt_mac_addr)); + req.fid =rte_cpu_to_le_16 (bp->pf.vf_info[vf].fid); + +HWRM_PREP (req,FUNC_CFG ,-1 , resp); + + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); +HWRM_CHECK_RESULT ; + +return rc; +} +int bnxt_hwrm_func_buf_rgtr (struct bnxt *bp) {int rc =0 ;
drivers/net/bnxt/bnxt_hwrm.h +1 -0
@@ -110,6 +110,7 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp);int bnxt_hwrm_allocate_pf_only (struct bnxt *bp);int bnxt_hwrm_allocate_vfs (struct bnxt *bp,int num_vfs);int bnxt_hwrm_func_vf_stall (struct bnxt *bp,uint16_t vf,uint8_t on); +int bnxt_hwrm_func_vf_mac (struct bnxt *bp,uint16_t vf,uint8_t *mac_addr);int bnxt_hwrm_pf_evb_mode (struct bnxt *bp);#endif
drivers/net/bnxt/rte_pmd_bnxt.c +29 -0
@@ -141,3 +141,32 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)return cb_param.retval ==RTE_PMD_BNXT_MB_EVENT_NOOP_ACK ? true : false; } + +int rte_pmd_bnxt_set_vf_mac_addr (uint8_t port,uint16_t vf, +struct ether_addr *mac_addr) +{ +struct rte_eth_dev *dev; +struct rte_eth_dev_info dev_info; +struct bnxt *bp; +int rc; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port, -ENODEV ); + + dev = &rte_eth_devices[port]; +rte_eth_dev_info_get (port, &dev_info); + bp = (struct bnxt *)dev->data->dev_private; + +if (vf >= dev_info.max_vfs || mac_addr ==NULL ) +return -EINVAL ; + +if (!BNXT_PF (bp)) { +RTE_LOG (ERR ,PMD , +"Attempt to set VF %d mac address on non-PF port %d!\n" , + vf, port); +return -ENOTSUP ; + } + + rc =bnxt_hwrm_func_vf_mac (bp, vf, (uint8_t *)mac_addr); + +return rc; +}
drivers/net/bnxt/rte_pmd_bnxt.h +17 -0
@@ -37,6 +37,23 @@#include <rte_ethdev.h> /** +* Set the VF MAC address. +* +* @param port +* The port identifier of the Ethernet device. +* @param vf +* VF id. +* @param mac_addr +* VF MAC address. +* @return +* - (0) if successful. +* - (-ENODEV) if *port* invalid. +* - (-EINVAL) if *vf* or *mac_addr* is invalid. +*/ +int rte_pmd_bnxt_set_vf_mac_addr (uint8_t port,uint16_t vf, +struct ether_addr *mac_addr); + +/** * Response sent back to bnxt driver from user app after callback */ enum rte_pmd_bnxt_mb_event_rsp {
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 9/28 bnxt: add code to support VF QOS configuration
In reply to Ajit KhapardeThis patch adds support to configure MAX Tx rate for the specified VF. It also extends the testpmd app to call rte_pmd_bnxt_set_vf_rate_limit when bnxt PMD is in use.
--- app/test-pmd/config.c | 16 ++++++++--- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 18 ++++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 3 +- drivers/net/bnxt/rte_pmd_bnxt.c | 48 +++++++++++++++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt.h | 18 ++++++++++++ drivers/net/bnxt/rte_pmd_bnxt_version.map | 1 + 7 files changed, 100 insertions(+), 5 deletions(-)
app/test-pmd/config.c +12 -4
@@ -97,6 +97,9 @@#ifdef RTE_LIBRTE_IXGBE_PMD #include <rte_pmd_ixgbe.h> #endif +#ifdef RTE_LIBRTE_BNXT_PMD +#include <rte_pmd_bnxt.h> +#endif #include "testpmd.h"
@@ -3046,17 +3049,22 @@ set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)return diag; } -#ifdef RTE_LIBRTE_IXGBE_PMD +#if defined(RTE_LIBRTE_IXGBE_PMD ) || (RTE_LIBRTE_BNXT_PMD )int set_vf_rate_limit (portid_t port_id,uint16_t vf,uint16_t rate,uint64_t q_msk) { +struct rte_eth_dev *dev = &rte_eth_devices[port_id];int diag; - diag =rte_pmd_ixgbe_set_vf_rate_limit (port_id, vf, rate, q_msk); +if (strcmp (dev->driver->pci_drv.driver.name,"net_bnxt" ) ==0 ) + diag =rte_pmd_bnxt_set_vf_rate_limit (port_id, vf, rate, + q_msk); +else + diag =rte_pmd_ixgbe_set_vf_rate_limit (port_id, vf, rate, + q_msk);if (diag ==0 )return diag; -printf ("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n" , - port_id, diag); +printf ("set_vf_rate_limit for port_id=%d failed %d\n" , port_id, diag);return diag; }#endif
drivers/net/bnxt/bnxt.h +1 -0
@@ -56,6 +56,7 @@ enum bnxt_hw_context {struct bnxt_child_vf_info {uint16_t fid; +uint16_t max_tx_rate;uint32_t func_cfg_flags;void *req_buf; };
drivers/net/bnxt/bnxt_hwrm.c +18 -0
@@ -2071,3 +2071,21 @@ int bnxt_hwrm_pf_evb_mode(struct bnxt *bp)return rc; } + +int bnxt_hwrm_func_bw_cfg (struct bnxt *bp,uint16_t vf, +uint16_t max_bw,uint16_t enables) +{ +struct hwrm_func_cfg_output *resp = bp->hwrm_cmd_resp_addr; +struct hwrm_func_cfg_input req = {0 }; +int rc; + +HWRM_PREP (req,FUNC_CFG ,-1 , resp); + req.fid =rte_cpu_to_le_16 (bp->pf.vf_info[vf].fid); + req.enables |=rte_cpu_to_le_32 (enables); + req.flags =rte_cpu_to_le_32 (bp->pf.vf_info[vf].func_cfg_flags); + req.max_bw =rte_cpu_to_le_32 (max_bw); + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); +HWRM_CHECK_RESULT ; + +return rc; +}
drivers/net/bnxt/bnxt_hwrm.h +2 -1
@@ -112,5 +112,6 @@ int bnxt_hwrm_allocate_vfs(struct bnxt *bp, int num_vfs);int bnxt_hwrm_func_vf_stall (struct bnxt *bp,uint16_t vf,uint8_t on);int bnxt_hwrm_func_vf_mac (struct bnxt *bp,uint16_t vf,uint8_t *mac_addr);int bnxt_hwrm_pf_evb_mode (struct bnxt *bp); - +int bnxt_hwrm_func_bw_cfg (struct bnxt *bp,uint16_t vf, +uint16_t max_bw,uint16_t enables);#endif
drivers/net/bnxt/rte_pmd_bnxt.c +48 -0
51 lines not on this page · raw message
drivers/net/bnxt/rte_pmd_bnxt.h +18 -0
@@ -112,4 +112,22 @@ int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on);*/ int rte_pmd_bnxt_set_all_queues_drop_en (uint8_t port,uint8_t on); +/** +* Set the VF rate limit. +* +* @param port +* The port identifier of the Ethernet device. +* @param vf +* VF id. +* @param tx_rate +* Tx rate for the VF +* @param q_msk +* Mask of the Tx queue +* @return +* - (0) if successful. +* - (-ENODEV) if *port* invalid. +* - (-EINVAL) if *vf* or *mac_addr* is invalid. +*/ +int rte_pmd_bnxt_set_vf_rate_limit (uint8_t port,uint16_t vf, +uint16_t tx_rate,uint64_t q_msk);#endif /* _PMD_BNXT_H_ */
drivers/net/bnxt/rte_pmd_bnxt_version.map +1 -0
@@ -3,5 +3,6 @@ DPDK_17.05 { rte_pmd_bnxt_set_tx_loopback; rte_pmd_bnxt_set_all_queues_drop_en; + rte_pmd_bnxt_set_vf_mac_addr; };
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 10/28 bnxt: support for VF VLAN filtering
In reply to Ajit KhapardeThis patch adds support to enable/disable hardware VF VLAN filtering of received VLAN packets tagged with a specified VLAN Tag Identifier.
This patch also modifies testpmd to call the appropriate function when bnxt PMD is in use.
--- app/test-pmd/cmdline.c | 5 +++++ drivers/net/bnxt/bnxt_hwrm.c | 18 ++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 1 + drivers/net/bnxt/rte_pmd_bnxt.c | 30 ++++++++++++++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt.h | 22 ++++++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt_version.map | 1 + 6 files changed, 77 insertions(+)
app/test-pmd/cmdline.c +5 -0
@@ -6919,6 +6919,11 @@ cmd_vf_rx_vlan_filter_parsed(void *parsed_result, ret =rte_pmd_ixgbe_set_vf_vlan_filter (res->port_id, res->vlan_id, res->vf_mask, is_add);#endif +#ifdef RTE_LIBRTE_BNXT_PMD +if (ret == -ENOTSUP ) + ret =rte_pmd_bnxt_set_vf_vlan_filter (res->port_id, + res->vlan_id, res->vf_mask, is_add); +#endif #ifdef RTE_LIBRTE_I40E_PMD if (ret == -ENOTSUP ) ret = rte_pmd_i40e_set_vf_vlan_filter(res->port_id,
drivers/net/bnxt/bnxt_hwrm.c +18 -0
@@ -2089,3 +2089,21 @@ int bnxt_hwrm_func_bw_cfg(struct bnxt *bp, uint16_t vf,return rc; } + +int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf,uint16_t vlan) +{ +struct hwrm_func_cfg_input req = {0 }; +struct hwrm_func_cfg_output *resp = bp->hwrm_cmd_resp_addr; +int rc =0 ; + +HWRM_PREP (req,FUNC_CFG ,-1 , resp); + req.flags =rte_cpu_to_le_32 (bp->pf.vf_info[vf].func_cfg_flags); + req.fid =rte_cpu_to_le_16 (bp->pf.vf_info[vf].fid); + req.enables |=rte_cpu_to_le_32 (HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN ); + req.dflt_vlan =rte_cpu_to_le_16 (vlan); + + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); +HWRM_CHECK_RESULT ; + +return rc; +}
drivers/net/bnxt/bnxt_hwrm.h +1 -0
@@ -112,6 +112,7 @@ int bnxt_hwrm_allocate_vfs(struct bnxt *bp, int num_vfs);int bnxt_hwrm_func_vf_stall (struct bnxt *bp,uint16_t vf,uint8_t on);int bnxt_hwrm_func_vf_mac (struct bnxt *bp,uint16_t vf,uint8_t *mac_addr);int bnxt_hwrm_pf_evb_mode (struct bnxt *bp); +int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf,uint16_t vlan);int bnxt_hwrm_func_bw_cfg (struct bnxt *bp,uint16_t vf,uint16_t max_bw,uint16_t enables);#endif
drivers/net/bnxt/rte_pmd_bnxt.c +30 -0
@@ -218,3 +218,33 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf,return rc; } +int rte_pmd_bnxt_set_vf_vlan_filter (uint8_t port,uint16_t vlan, +uint64_t vf_mask,uint8_t vlan_on) +{ +struct rte_eth_dev *eth_dev; +struct rte_eth_dev_info dev_info; +struct bnxt *bp; +int i; +int ret; +int rc =0 ; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port, -ENODEV ); + + eth_dev = &rte_eth_devices[port]; +rte_eth_dev_info_get (port, &dev_info); + bp = (struct bnxt *)eth_dev->data->dev_private; + +if (!bp->pf.vf_info) +return -EINVAL ; + +for (i =0 ; vf_mask; i++, vf_mask >>=1 ) { +if (vf_mask &1 ) { + ret =bnxt_hwrm_set_vf_vlan (bp, i, vlan_on ? vlan :0 ); +if (ret) + rc = ret; + } + } + +return rc; +} +
drivers/net/bnxt/rte_pmd_bnxt.h +22 -0
@@ -130,4 +130,26 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on);*/ int rte_pmd_bnxt_set_vf_rate_limit (uint8_t port,uint16_t vf,uint16_t tx_rate,uint64_t q_msk); + +/** +* Enable/Disable hardware VF VLAN filtering by an Ethernet device of +* received VLAN packets tagged with a given VLAN Tag Identifier. +* +* @param port +* The port identifier of the Ethernet device. +* @param vlan +* The VLAN Tag Identifier whose filtering must be enabled or disabled. +* @param vf_mask +* Bitmap listing which VFs participate in the VLAN filtering. +* @param vlan_on +* 1 - Enable VFs VLAN filtering. +* 0 - Disable VFs VLAN filtering. +* @return +* - (0) if successful. +* - (-ENOTSUP) if hardware doesn't support. +* - (-ENODEV) if *port_id* invalid. +* - (-EINVAL) if bad parameter. +*/ +int rte_pmd_bnxt_set_vf_vlan_filter (uint8_t port,uint16_t vlan, +uint64_t vf_mask,uint8_t vlan_on);#endif /* _PMD_BNXT_H_ */
drivers/net/bnxt/rte_pmd_bnxt_version.map +1 -0
@@ -4,5 +4,6 @@ DPDK_17.05 { rte_pmd_bnxt_set_tx_loopback; rte_pmd_bnxt_set_all_queues_drop_en; rte_pmd_bnxt_set_vf_mac_addr; + rte_pmd_bnxt_set_vf_vlan_filter; };
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 11/28 bnxt: set the VMDQ pool size correctly
In reply to Ajit KhapardeCalculate the VMDQ pool size correctly:
For PFs the VMDQ count needs to be the minimum of all used and available resources like vnic, l2 CTX, RSS CTX, or 64 (hard coded). For VFs restrict the number of VMDQs to 1.
If VFs are enabled, only allocate a single vnic to each function. This allows targeting a VF with a single L2 context.
In the future, we will enable VMDq on VFs.
We are essentially mapping VMDq pools to VNICs now. If there are no VFs, the PF can use all VNICs as VMDq pools. If there are VFs, each function (including the PF) will get a single VNIC.
--- drivers/net/bnxt/bnxt_hwrm.c | 23 +++++++++++++++++++---- drivers/net/bnxt/bnxt_rxq.c | 8 +++++--- 2 files changed, 24 insertions(+), 7 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +19 -4
@@ -312,7 +312,7 @@ int bnxt_hwrm_func_qcaps(struct bnxt *bp)if (BNXT_PF (bp)) { bp->pf.port_id = resp->port_id; bp->pf.first_vf_id =rte_le_to_cpu_16 (resp->first_vf_id); - new_max_vfs =rte_le_to_cpu_16 (resp->max_vfs); + new_max_vfs = bp->pdev->max_vfs;if (new_max_vfs != bp->pf.max_vfs) {if (bp->pf.vf_info)rte_free (bp->pf.vf_info);
@@ -331,7 +331,15 @@ int bnxt_hwrm_func_qcaps(struct bnxt *bp) bp->max_tx_rings =rte_le_to_cpu_16 (resp->max_tx_rings); bp->max_rx_rings =rte_le_to_cpu_16 (resp->max_rx_rings); bp->max_l2_ctx =rte_le_to_cpu_16 (resp->max_l2_ctxs); - bp->max_vnics =rte_le_to_cpu_16 (resp->max_vnics); +/* TODO: For now, do not support VMDq/RFS on VFs. */ +if (BNXT_PF (bp)) { +if (bp->pf.max_vfs) + bp->max_vnics =1 ; +else + bp->max_vnics =rte_le_to_cpu_16 (resp->max_vnics); + }else { + bp->max_vnics =1 ; + } bp->max_stat_ctx =rte_le_to_cpu_16 (resp->max_stat_ctx);if (BNXT_PF (bp)) bp->pf.total_vnics =rte_le_to_cpu_16 (resp->max_vnics);
@@ -1842,6 +1850,8 @@ static void populate_vf_func_cfg_req(struct bnxt *bp, req->num_rx_rings =rte_cpu_to_le_16 (bp->max_rx_rings / (num_vfs +1 )); req->num_l2_ctxs =rte_cpu_to_le_16 (bp->max_l2_ctx / (num_vfs +1 )); req->num_vnics =rte_cpu_to_le_16 (bp->max_vnics / (num_vfs +1 )); +/* TODO: For now, do not support VMDq/RFS on VFs. */ + req->num_vnics =rte_cpu_to_le_16 (1 ); req->num_hw_ring_grps =rte_cpu_to_le_16 (bp->max_ring_grps / (num_vfs +1 )); }
@@ -1904,7 +1914,11 @@ static void reserve_resources_from_vf(struct bnxt *bp, bp->max_tx_rings -=rte_le_to_cpu_16 (resp->max_tx_rings); bp->max_rx_rings -=rte_le_to_cpu_16 (resp->max_rx_rings); bp->max_l2_ctx -=rte_le_to_cpu_16 (resp->max_l2_ctxs); - bp->max_vnics -=rte_le_to_cpu_16 (resp->max_vnics); +/* TODO: +* While not supporting VMDq with VFs, max_vnics is always +* forced to 1 in this case +*/ +//bp->max_vnics -= rte_le_to_cpu_16(esp->max_vnics); bp->max_ring_grps -=rte_le_to_cpu_16 (resp->max_hw_ring_grps); }
@@ -2025,7 +2039,8 @@ int bnxt_hwrm_allocate_vfs(struct bnxt *bp, int num_vfs)RTE_LOG (ERR ,PMD ,"Failed to initizlie VF %d.\n" , i);RTE_LOG (ERR ,PMD , -"Not all VFs available.\n" ); +"Not all VFs available. (%d, %d)\n" , + rc, resp->error_code);break ; }
drivers/net/bnxt/bnxt_rxq.c +5 -3
@@ -121,9 +121,11 @@ int bnxt_mq_rx_configure(struct bnxt *bp) }/* For each pool, allocate MACVLAN CFA rule & VNIC */ if (!pools) { + pools =RTE_MIN (bp->max_vnics, +RTE_MIN (bp->max_l2_ctx, +RTE_MIN (bp->max_rsscos_ctx,ETH_64_POOLS )));RTE_LOG (ERR ,PMD , -"VMDq pool not set, defaulted to 64\n" ); - pools =ETH_64_POOLS ; +"VMDq pool not set, defaulted to %d\n" , pools); } nb_q_per_grp = bp->rx_cp_nr_rings / pools; start_grp_id =1 ;
@@ -134,7 +136,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp) vnic =bnxt_alloc_vnic (bp);if (!vnic) {RTE_LOG (ERR ,PMD , -"VNIC alloc failed\n" ); +"VNIC %d alloc failed\n" , i); rc = -ENOMEM ; goto err_out; }
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 12/28 bnxt: improve some of the log messages
In reply to Ajit KhapardeThis patch improves some of the log messages.
Log the VNIC ordinal to indicate the VNIC id, for which operation failed.
--- drivers/net/bnxt/bnxt_ethdev.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +13 -9
@@ -224,28 +224,32 @@ static int bnxt_init_chip(struct bnxt *bp) rc =bnxt_hwrm_vnic_alloc (bp, vnic);if (rc) { -RTE_LOG (ERR ,PMD ,"HWRM vnic alloc failure rc: %x\n" , - rc); +RTE_LOG (ERR ,PMD , +"HWRM vnic %d alloc failure rc: %x\n" , + i, rc); goto err_out; } rc =bnxt_hwrm_vnic_ctx_alloc (bp, vnic);if (rc) {RTE_LOG (ERR ,PMD , -"HWRM vnic ctx alloc failure rc: %x\n" , rc); +"HWRM vnic %d ctx alloc failure rc: %x\n" , + i, rc); goto err_out; } rc =bnxt_hwrm_vnic_cfg (bp, vnic);if (rc) { -RTE_LOG (ERR ,PMD ,"HWRM vnic cfg failure rc: %x\n" , rc); +RTE_LOG (ERR ,PMD , +"HWRM vnic %d cfg failure rc: %x\n" , i, rc); goto err_out; } rc =bnxt_set_hwrm_vnic_filters (bp, vnic);if (rc) { -RTE_LOG (ERR ,PMD ,"HWRM vnic filter failure rc: %x\n" , - rc); +RTE_LOG (ERR ,PMD , +"HWRM vnic %d filter failure rc: %x\n" , + i, rc); goto err_out; }if (vnic->rss_table && vnic->hash_type) {
@@ -265,8 +269,8 @@ static int bnxt_init_chip(struct bnxt *bp) rc =bnxt_hwrm_vnic_rss_cfg (bp, vnic);if (rc) {RTE_LOG (ERR ,PMD , -"HWRM vnic set RSS failure rc: %x\n" , - rc); +"HWRM vnic %d set RSS failure rc: %x\n" , + i, rc); goto err_out; } }
@@ -634,7 +638,7 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete) new.link_speed =ETH_LINK_SPEED_100M ; new.link_duplex =ETH_LINK_FULL_DUPLEX ;RTE_LOG (ERR ,PMD , -"Failed to retrieve link rc = 0x%x!" , rc); +"Failed to retrieve link rc = 0x%x!\n" , rc); goto out; }rte_delay_ms (BNXT_LINK_WAIT_INTERVAL );
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 13/28 bnxt: fix interrupt handler
In reply to Ajit Khapardebnxt_int_handler() wasn't updating the doorbell, meaning forward requests got repeated.
--- drivers/net/bnxt/bnxt_irq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/bnxt/bnxt_irq.c +2 -0
@@ -78,6 +78,8 @@ static void bnxt_int_handler(struct rte_intr_handle *handle __rte_unused, } raw_cons =NEXT_RAW_CMP (raw_cons); } + + cpr->cp_raw_cons = raw_cons;B_CP_DB_REARM (cpr, cpr->cp_raw_cons); }
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 14/28 bnxt: Add support for udp_tunnel_port_add/del dev_ops
In reply to Ajit KhapardeAdd 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 referene 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.
--- drivers/net/bnxt/bnxt.h | 6 ++ drivers/net/bnxt/bnxt_ethdev.c | 112 ++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.c | 57 ++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 5 + drivers/net/bnxt/bnxt_txr.c | 3 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 185 +++++++++++++++++++++++++++++++++ 6 files changed, 367 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt.h +6 -0
@@ -180,6 +180,12 @@ struct bnxt {struct bnxt_pf_info pf;uint8_t port_partition_type;uint8_t dev_stopped; +uint8_t vxlan_port_cnt; +uint8_t geneve_port_cnt; +uint16_t vxlan_port; +uint16_t geneve_port; +uint16_t vxlan_fw_dst_port_id; +uint16_t geneve_fw_dst_port_id; };int bnxt_link_update_op (struct rte_eth_dev *eth_dev,int wait_to_complete);
drivers/net/bnxt/bnxt_ethdev.c +112 -0
124 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.c +57 -0
75 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.h +5 -0
@@ -115,4 +115,9 @@ int bnxt_hwrm_pf_evb_mode(struct bnxt *bp);int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf,uint16_t vlan);int bnxt_hwrm_func_bw_cfg (struct bnxt *bp,uint16_t vf,uint16_t max_bw,uint16_t enables); +int bnxt_hwrm_tunnel_dst_port_alloc (struct bnxt *bp,uint16_t port, +uint8_t tunnel_type); +int bnxt_hwrm_tunnel_dst_port_free (struct bnxt *bp,uint16_t port, +uint8_t tunnel_type); +void bnxt_free_tunnel_ports (struct bnxt *bp);#endif
drivers/net/bnxt/bnxt_txr.c +2 -1
@@ -213,7 +213,8 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,/* TSO */ txbd1->lflags =TX_BD_LONG_LFLAGS_LSO ; txbd1->hdr_size = tx_pkt->l2_len + tx_pkt->l3_len + - tx_pkt->l4_len; + tx_pkt->l4_len + tx_pkt->outer_l2_len + + tx_pkt->outer_l3_len; txbd1->mss = tx_pkt->tso_segsz; } else if (tx_pkt->ol_flags & (PKT_TX_TCP_CKSUM |
drivers/net/bnxt/hsi_struct_def_dpdk.h +185 -0
197 lines not on this page · raw message
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 15/28 bnxt: Update tx offload capabilities
In reply to Ajit KhapardeUpdate the tx offload capabilities of the PMD.
--- drivers/net/bnxt/bnxt_ethdev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +6 -1
@@ -360,7 +360,12 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev, dev_info->tx_offload_capa =DEV_TX_OFFLOAD_IPV4_CKSUM |DEV_TX_OFFLOAD_TCP_CKSUM |DEV_TX_OFFLOAD_UDP_CKSUM | -DEV_TX_OFFLOAD_TCP_TSO ; +DEV_TX_OFFLOAD_TCP_TSO | +DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | +DEV_TX_OFFLOAD_VXLAN_TNL_TSO | +DEV_TX_OFFLOAD_GRE_TNL_TSO | +DEV_TX_OFFLOAD_IPIP_TNL_TSO | +DEV_TX_OFFLOAD_GENEVE_TNL_TSO ;/* *INDENT-OFF* */ dev_info->default_rxconf = (struct rte_eth_rxconf ) {
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 16/28 bnxt: add support for set VF MAC anti spoof
In reply to Ajit KhapardeThis patch adds support to enable VF MAC anti spoof.
It also adds code in testpmd to call the appropriate function while configuring this setting when the bnxt PMD is in use.
--- app/test-pmd/cmdline.c | 5 +++ drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 15 +++++++++ drivers/net/bnxt/bnxt_hwrm.h | 1 + drivers/net/bnxt/rte_pmd_bnxt.c | 51 +++++++++++++++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt.h | 17 +++++++++++ drivers/net/bnxt/rte_pmd_bnxt_version.map | 1 + 7 files changed, 91 insertions(+)
app/test-pmd/cmdline.c +5 -0
@@ -11071,6 +11071,11 @@ cmd_set_vf_mac_anti_spoof_parsed( ret =rte_pmd_ixgbe_set_vf_mac_anti_spoof (res->port_id, res->vf_id, is_on);#endif +#ifdef RTE_LIBRTE_IXGBE_PMD +if (ret == -ENOTSUP ) + ret =rte_pmd_bnxt_set_vf_mac_anti_spoof (res->port_id, + res->vf_id, is_on); +#endif #ifdef RTE_LIBRTE_I40E_PMD if (ret == -ENOTSUP ) ret = rte_pmd_i40e_set_vf_mac_anti_spoof(res->port_id,
drivers/net/bnxt/bnxt.h +1 -0
@@ -59,6 +59,7 @@ struct bnxt_child_vf_info {uint16_t max_tx_rate;uint32_t func_cfg_flags;void *req_buf; +uint8_t mac_spoof_en; };struct bnxt_pf_info {
drivers/net/bnxt/bnxt_hwrm.c +15 -0
@@ -2179,3 +2179,18 @@ int bnxt_hwrm_set_vf_vlan(struct bnxt *bp, int vf, uint16_t vlan)return rc; } + +int bnxt_hwrm_func_cfg_vf_set_flags (struct bnxt *bp,uint16_t vf) +{ +struct hwrm_func_cfg_output *resp = bp->hwrm_cmd_resp_addr; +struct hwrm_func_cfg_input req = {0 }; +int rc; + +HWRM_PREP (req,FUNC_CFG ,-1 , resp); + req.fid =rte_cpu_to_le_16 (bp->pf.vf_info[vf].fid); + req.flags =rte_cpu_to_le_32 (bp->pf.vf_info[vf].func_cfg_flags); + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); +HWRM_CHECK_RESULT ; + +return rc; +}
drivers/net/bnxt/bnxt_hwrm.h +1 -0
@@ -120,4 +120,5 @@ int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, uint16_t port,int bnxt_hwrm_tunnel_dst_port_free (struct bnxt *bp,uint16_t port,uint8_t tunnel_type);void bnxt_free_tunnel_ports (struct bnxt *bp); +int bnxt_hwrm_func_cfg_vf_set_flags (struct bnxt *bp,uint16_t vf);#endif
drivers/net/bnxt/rte_pmd_bnxt.c +51 -0
54 lines not on this page · raw message
drivers/net/bnxt/rte_pmd_bnxt.h +17 -0
@@ -152,4 +152,21 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf,*/ int rte_pmd_bnxt_set_vf_vlan_filter (uint8_t port,uint16_t vlan,uint64_t vf_mask,uint8_t vlan_on); +/** +* Enable/Disable VF MAC anti spoof +* +* @param port +* The port identifier of the Ethernet device. +* @param vf +* VF id. +* @param on +* 1 - Enable VF MAC anti spoof. +* 0 - Disable VF MAC anti spoof. +* +* @return +* - (0) if successful. +* - (-ENODEV) if *port* invalid. +* - (-EINVAL) if bad parameter. +*/ +int rte_pmd_bnxt_set_vf_mac_anti_spoof (uint8_t port,uint16_t vf,uint8_t on);#endif /* _PMD_BNXT_H_ */
drivers/net/bnxt/rte_pmd_bnxt_version.map +1 -0
@@ -5,5 +5,6 @@ DPDK_17.05 { rte_pmd_bnxt_set_all_queues_drop_en; rte_pmd_bnxt_set_vf_mac_addr; rte_pmd_bnxt_set_vf_vlan_filter; + rte_pmd_bnxt_set_vf_mac_anti_spoof; };
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 17/28 bnxt: implement VF VLAN stripq functionality
In reply to Ajit KhapardeThis patch adds code to configure VF VLAN stripping feature. Reorganize the bnxt_hwrm_func_vf_stall() to bnxt_hwrm_func_vf_vnic_cfg_do which will take a callback and use that for configuring with a VFs VNICs.
--- drivers/net/bnxt/bnxt_hwrm.c | 107 ++++++++++++++++-------------- drivers/net/bnxt/bnxt_hwrm.h | 4 +- drivers/net/bnxt/rte_pmd_bnxt.c | 49 +++++++++++++- drivers/net/bnxt/rte_pmd_bnxt.h | 20 ++++++ drivers/net/bnxt/rte_pmd_bnxt_version.map | 1 + 5 files changed, 129 insertions(+), 52 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +57 -50
@@ -1030,56 +1030,6 @@ int bnxt_hwrm_vnic_rss_cfg(struct bnxt *bp,return rc; } -int bnxt_hwrm_func_vf_stall (struct bnxt *bp,uint16_t vf,uint8_t on) -{ -struct hwrm_func_vf_vnic_ids_query_input req = {0 }; -struct hwrm_func_vf_vnic_ids_query_output *resp = - bp->hwrm_cmd_resp_addr; -struct bnxt_vnic_info vnic; -int rc; -uint32_t i, num_vnic_ids; -uint16_t *vnic_ids; - -/* First query all VNIC ids */ - - vnic_ids =rte_malloc ("bnxt_hwrm_vf_vnic_ids_query" , - bp->pf.total_vnics *sizeof (*vnic_ids), -RTE_CACHE_LINE_SIZE ); -if (vnic_ids ==NULL ) -return -ENOMEM ; - -HWRM_PREP (req,FUNC_VF_VNIC_IDS_QUERY ,-1 , resp_vf_vnic_ids); - - req.vf_id =rte_cpu_to_le_16 (bp->pf.first_vf_id + vf); - req.max_vnic_id_cnt =rte_cpu_to_le_32 (bp->pf.total_vnics); - req.vnic_id_tbl_addr =rte_malloc_virt2phy (vnic_ids); - - rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); -HWRM_CHECK_RESULT ; - - num_vnic_ids =rte_le_to_cpu_32 (resp->vnic_id_cnt); - -/* Retrieve VNIC, update bd_stall then update */ - -for (i =0 ; i < num_vnic_ids; i++) { -memset (&vnic,0 ,sizeof (struct bnxt_vnic_info )); - vnic.fw_vnic_id =rte_le_to_cpu_16 (vnic_ids[i]); - rc =bnxt_hwrm_vnic_qcfg (bp, &vnic, bp->pf.first_vf_id + vf); -if (rc) -break ; - - vnic.bd_stall = on; - - rc =bnxt_hwrm_vnic_cfg (bp, &vnic); -if (rc) -break ; - } - -rte_free (vnic_ids); - -return rc; -} -int bnxt_hwrm_func_vf_mac (struct bnxt *bp,uint16_t vf,uint8_t *mac_addr) {struct hwrm_func_cfg_input req = {0 };
@@ -2194,3 +2144,60 @@ int bnxt_hwrm_func_cfg_vf_set_flags(struct bnxt *bp, uint16_t vf)return rc; } + +int bnxt_hwrm_func_vf_vnic_cfg_do (struct bnxt *bp,uint16_t vf, +void (*vnic_cb)(struct bnxt_vnic_info *, +void *),void *cbdata) +{ +struct hwrm_func_vf_vnic_ids_query_input req = {0 }; +struct hwrm_func_vf_vnic_ids_query_output *resp = + bp->hwrm_cmd_resp_addr; +struct bnxt_vnic_info vnic; +int rc; +uint32_t i, num_vnic_ids; +uint16_t *vnic_ids; +size_t vnic_id_sz; + +/* First query all VNIC ids */ + + vnic_id_sz = bp->pf.total_vnics *sizeof (*vnic_ids); + vnic_ids =rte_malloc ("bnxt_hwrm_vf_vnic_ids_query" , vnic_id_sz, +RTE_CACHE_LINE_SIZE ); +if (vnic_ids ==NULL ) { + rc = -ENOMEM ; +return rc; + } +for (i =0 ; i < vnic_id_sz; i +=rte_eal_get_physmem_size ()) +rte_mem_lock_page (((char *)vnic_ids) + i); + +HWRM_PREP (req,FUNC_VF_VNIC_IDS_QUERY ,-1 , resp_vf_vnic_ids); + + req.vf_id =rte_cpu_to_le_16 (bp->pf.first_vf_id + vf); + req.max_vnic_id_cnt =rte_cpu_to_le_32 (bp->pf.total_vnics); + req.vnic_id_tbl_addr =rte_mem_virt2phy (vnic_ids); + + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); +HWRM_CHECK_RESULT ; + + num_vnic_ids =rte_le_to_cpu_32 (resp->vnic_id_cnt); + +/* Retrieve VNIC, update bd_stall then update */ + +for (i =0 ; i < num_vnic_ids; i++) { +memset (&vnic,0 ,sizeof (struct bnxt_vnic_info )); + vnic.fw_vnic_id =rte_le_to_cpu_16 (vnic_ids[i]); + rc =bnxt_hwrm_vnic_qcfg (bp, &vnic, bp->pf.first_vf_id + vf); +if (rc) +break ; + +vnic_cb (&vnic, cbdata); + + rc =bnxt_hwrm_vnic_cfg (bp, &vnic); +if (rc) +break ; + } + +rte_free (vnic_ids); + +return rc; +}
drivers/net/bnxt/bnxt_hwrm.h +3 -1
@@ -109,7 +109,6 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up);int bnxt_hwrm_func_qcfg (struct bnxt *bp);int bnxt_hwrm_allocate_pf_only (struct bnxt *bp);int bnxt_hwrm_allocate_vfs (struct bnxt *bp,int num_vfs); -int bnxt_hwrm_func_vf_stall (struct bnxt *bp,uint16_t vf,uint8_t on);int bnxt_hwrm_func_vf_mac (struct bnxt *bp,uint16_t vf,uint8_t *mac_addr);int bnxt_hwrm_pf_evb_mode (struct bnxt *bp);int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf,uint16_t vlan);
@@ -121,4 +120,7 @@ int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, uint16_t port, uint8_t tunnel_type);void bnxt_free_tunnel_ports (struct bnxt *bp);int bnxt_hwrm_func_cfg_vf_set_flags (struct bnxt *bp,uint16_t vf); +int bnxt_hwrm_func_vf_vnic_cfg_do (struct bnxt *bp,uint16_t vf, +void (*vnic_cb)(struct bnxt_vnic_info *, +void *),void *cbdata);#endif
drivers/net/bnxt/rte_pmd_bnxt.c +48 -1
64 lines not on this page · raw message
drivers/net/bnxt/rte_pmd_bnxt.h +20 -0
@@ -54,6 +54,26 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, struct ether_addr *mac_addr);/** +* Enable/Disable vf vlan strip for all queues in a pool +* +* @param port +* The port identifier of the Ethernet device. +* @param vf +* ID specifying VF. +* @param on +* 1 - Enable VF's vlan strip on RX queues. +* 0 - Disable VF's vlan strip on RX queues. +* +* @return +* - (0) if successful. +* - (-ENOTSUP) if hardware doesn't support this feature. +* - (-ENODEV) if *port* invalid. +* - (-EINVAL) if bad parameter. +*/ +int +rte_pmd_bnxt_set_vf_vlan_stripq (uint8_t port,uint16_t vf,uint8_t on); + +/** * Response sent back to bnxt driver from user app after callback */ enum rte_pmd_bnxt_mb_event_rsp {
drivers/net/bnxt/rte_pmd_bnxt_version.map +1 -0
@@ -6,5 +6,6 @@ DPDK_17.05 { rte_pmd_bnxt_set_vf_mac_addr; rte_pmd_bnxt_set_vf_vlan_filter; rte_pmd_bnxt_set_vf_mac_anti_spoof; + rte_pmd_bnxt_set_vf_vlan_stripq; };
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 18/28 bnxt: support lack of huge pages
In reply to Ajit Khaparderte_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.
--- drivers/net/bnxt/bnxt_hwrm.c | 64 +++++++++++++++++++++++++++++++------------- drivers/net/bnxt/bnxt_ring.c | 22 ++++++++++++--- drivers/net/bnxt/bnxt_vnic.c | 16 ++++++++++- 3 files changed, 78 insertions(+), 24 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +45 -19
@@ -477,8 +477,15 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) rc = -ENOMEM ; goto error; } +rte_mem_lock_page (bp->hwrm_cmd_resp_addr); bp->hwrm_cmd_resp_dma_addr = -rte_malloc_virt2phy (bp->hwrm_cmd_resp_addr); +rte_mem_virt2phy (bp->hwrm_cmd_resp_addr); +if (bp->hwrm_cmd_resp_dma_addr ==0 ) { +RTE_LOG (ERR ,PMD , +"Unable to map response buffer to physical memory.\n" ); + rc = -ENOMEM ; + goto error; + } bp->max_resp_len = max_resp_len; }
@@ -1065,6 +1072,11 @@ int bnxt_hwrm_func_buf_rgtr(struct bnxt *bp) req.req_buf_len =rte_cpu_to_le_16 (HWRM_MAX_REQ_LEN ); req.req_buf_page_addr[0 ] =rte_cpu_to_le_64 (rte_malloc_virt2phy (bp->pf.vf_req_buf)); +if (req.req_buf_page_addr[0 ] ==0 ) { +RTE_LOG (ERR ,PMD , +"unable to map buffer address to physical memory\n" ); +return -ENOMEM ; + } rc =bnxt_hwrm_send_message (bp, &req,sizeof (req));
@@ -1334,6 +1346,7 @@ int bnxt_alloc_all_hwrm_ring_grps(struct bnxt *bp)void bnxt_free_hwrm_resources (struct bnxt *bp) {/* Release memzone */ +/* TODO: unlock page?!?! */ rte_free (bp->hwrm_cmd_resp_addr); bp->hwrm_cmd_resp_addr =NULL ; bp->hwrm_cmd_resp_dma_addr =0 ;
@@ -1349,10 +1362,17 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp) bp->max_req_len =HWRM_MAX_REQ_LEN ; bp->max_resp_len =HWRM_MAX_RESP_LEN ; bp->hwrm_cmd_resp_addr =rte_malloc (type, bp->max_resp_len,0 ); +rte_mem_lock_page (bp->hwrm_cmd_resp_addr);if (bp->hwrm_cmd_resp_addr ==NULL )return -ENOMEM ; + bp->hwrm_cmd_resp_dma_addr = -rte_malloc_virt2phy (bp->hwrm_cmd_resp_addr); +rte_mem_virt2phy (bp->hwrm_cmd_resp_addr); +if (bp->hwrm_cmd_resp_dma_addr ==0 ) { +RTE_LOG (ERR ,PMD , +"unable to map response address to physical memory\n" ); +return -ENOMEM ; + }rte_spinlock_init (&bp->hwrm_lock);return 0 ;
@@ -1935,7 +1955,9 @@ int bnxt_hwrm_allocate_vfs(struct bnxt *bp, int num_vfs)struct hwrm_func_cfg_input req = {0 };struct hwrm_func_cfg_output *resp = bp->hwrm_cmd_resp_addr;int i; +unsigned int ui;int rc =0 ; +size_t req_buf_sz;if (!BNXT_PF (bp)) {RTE_LOG (ERR ,PMD ,"Attempt to allcoate VFs on a VF!\n" );
@@ -1967,14 +1989,18 @@ int bnxt_hwrm_allocate_vfs(struct bnxt *bp, int num_vfs)/* * Now, create and register a buffer to hold forwarded VF requests */ - bp->pf.vf_req_buf =rte_malloc ("bnxt_vf_fwd" , - num_vfs *HWRM_MAX_REQ_LEN , + req_buf_sz = num_vfs *HWRM_MAX_REQ_LEN ; + bp->pf.vf_req_buf =rte_malloc ("bnxt_vf_fwd" , req_buf_sz,page_roundup (num_vfs *HWRM_MAX_REQ_LEN ));if (bp->pf.vf_req_buf ==NULL ) { rc = -ENOMEM ; goto error_free; } + +for (ui =0 ; ui < req_buf_sz; ui +=rte_eal_get_physmem_size ()) +rte_mem_lock_page (((char *)bp->pf.vf_req_buf) + ui); +for (i =0 ; i < num_vfs; i++) bp->pf.vf_info[i].req_buf = ((char *)bp->pf.vf_req_buf) + (i *HWRM_MAX_REQ_LEN );
@@ -2130,21 +2156,6 @@ int bnxt_hwrm_set_vf_vlan(struct bnxt *bp, int vf, uint16_t vlan)return rc; } -int bnxt_hwrm_func_cfg_vf_set_flags (struct bnxt *bp,uint16_t vf) -{ -struct hwrm_func_cfg_output *resp = bp->hwrm_cmd_resp_addr; -struct hwrm_func_cfg_input req = {0 }; -int rc; - -HWRM_PREP (req,FUNC_CFG ,-1 , resp); - req.fid =rte_cpu_to_le_16 (bp->pf.vf_info[vf].fid); - req.flags =rte_cpu_to_le_32 (bp->pf.vf_info[vf].func_cfg_flags); - rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); -HWRM_CHECK_RESULT ; - -return rc; -} -int bnxt_hwrm_func_vf_vnic_cfg_do (struct bnxt *bp,uint16_t vf,void (*vnic_cb)(struct bnxt_vnic_info *,void *),void *cbdata)
@@ -2201,3 +2212,18 @@ int bnxt_hwrm_func_vf_vnic_cfg_do(struct bnxt *bp, uint16_t vf,return rc; } + +int bnxt_hwrm_func_cfg_vf_set_flags (struct bnxt *bp,uint16_t vf) +{ +struct hwrm_func_cfg_output *resp = bp->hwrm_cmd_resp_addr; +struct hwrm_func_cfg_input req = {0 }; +int rc; + +HWRM_PREP (req,FUNC_CFG ,-1 , resp); + req.fid =rte_cpu_to_le_16 (bp->pf.vf_info[vf].fid); + req.flags =rte_cpu_to_le_32 (bp->pf.vf_info[vf].func_cfg_flags); + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); +HWRM_CHECK_RESULT ; + +return rc; +}
drivers/net/bnxt/bnxt_ring.c +18 -4
@@ -96,6 +96,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,struct rte_pci_device *pdev = bp->pdev;const struct rte_memzone *mz =NULL ;char mz_name[RTE_MEMZONE_NAMESIZE ]; +phys_addr_t mz_phys_addr;int stats_len = (tx_ring_info || rx_ring_info) ?RTE_CACHE_LINE_ROUNDUP (sizeof (struct ctx_hw_stats64 )) :0 ;
@@ -144,13 +145,26 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,return -ENOMEM ; }memset (mz->addr,0 , mz->len); + mz_phys_addr = mz->phys_addr; +if ((phys_addr_t )mz->addr == mz_phys_addr) { +RTE_LOG (WARNING ,PMD , +"Memzone physical address same as virtual.\n" ); +RTE_LOG (WARNING ,PMD , +"Using rte_mem_virt2phy()\n" ); + mz_phys_addr =rte_mem_virt2phy (mz->addr); +if (mz_phys_addr ==0 ) { +RTE_LOG (ERR ,PMD , +"unable to map ring address to physical memory\n" ); +return -ENOMEM ; + } + }if (tx_ring_info) { tx_ring = tx_ring_info->tx_ring_struct; tx_ring->bd = ((char *)mz->addr + tx_ring_start); tx_ring_info->tx_desc_ring = (struct tx_bd_long *)tx_ring->bd; - tx_ring->bd_dma = mz->phys_addr + tx_ring_start; + tx_ring->bd_dma = mz_phys_addr + tx_ring_start; tx_ring_info->tx_desc_mapping = tx_ring->bd_dma; tx_ring->mem_zone = (const void *)mz;
@@ -170,7 +184,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, rx_ring->bd = ((char *)mz->addr + rx_ring_start); rx_ring_info->rx_desc_ring = (struct rx_prod_pkt_bd *)rx_ring->bd; - rx_ring->bd_dma = mz->phys_addr + rx_ring_start; + rx_ring->bd_dma = mz_phys_addr + rx_ring_start; rx_ring_info->rx_desc_mapping = rx_ring->bd_dma; rx_ring->mem_zone = (const void *)mz;
@@ -185,7 +199,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, } cp_ring->bd = ((char *)mz->addr + cp_ring_start); - cp_ring->bd_dma = mz->phys_addr + cp_ring_start; + cp_ring->bd_dma = mz_phys_addr + cp_ring_start; cp_ring_info->cp_desc_ring = cp_ring->bd; cp_ring_info->cp_desc_mapping = cp_ring->bd_dma; cp_ring->mem_zone = (const void *)mz;
@@ -196,7 +210,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, *cp_ring->vmem = ((char *)mz->addr + stats_len);if (stats_len) { cp_ring_info->hw_stats = mz->addr; - cp_ring_info->hw_stats_map = mz->phys_addr; + cp_ring_info->hw_stats_map = mz_phys_addr; } cp_ring_info->hw_stats_ctx_id =HWRM_NA_SIGNATURE ;return 0 ;
drivers/net/bnxt/bnxt_vnic.c +15 -1
@@ -172,6 +172,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) HW_HASH_KEY_SIZE);uint16_t max_vnics;int i; +phys_addr_t mz_phys_addr; max_vnics = bp->max_vnics; snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
@@ -188,6 +189,19 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)if (!mz)return -ENOMEM ; } + mz_phys_addr = mz->phys_addr; +if ((phys_addr_t )mz->addr == mz_phys_addr) { +RTE_LOG (WARNING ,PMD , +"Memzone physical address same as virtual.\n" ); +RTE_LOG (WARNING ,PMD , +"Using rte_mem_virt2phy()\n" ); + mz_phys_addr =rte_mem_virt2phy (mz->addr); +if (mz_phys_addr ==0 ) { +RTE_LOG (ERR ,PMD , +"unable to map vnic address to physical memory\n" ); +return -ENOMEM ; + } + }for (i =0 ; i < max_vnics; i++) { vnic = &bp->vnic_info[i];
@@ -197,7 +211,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) (void *)((char *)mz->addr + (entry_length * i));memset (vnic->rss_table,-1 , entry_length); - vnic->rss_table_dma_addr = mz->phys_addr + (entry_length * i); + vnic->rss_table_dma_addr = mz_phys_addr + (entry_length * i); vnic->rss_hash_key = (void *)((char *)vnic->rss_table +HW_HASH_INDEX_SIZE *sizeof (*vnic->rss_table));
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 19/28 bnxt: add code to configure a default VF VLAN
In reply to Ajit KhapardeThis patch adds code to insert a default VF VLAN. Also track the current default VLAN per vnic for the VF.
--- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 4 ++-- drivers/net/bnxt/bnxt_hwrm.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 33 ++++++++++++++++++++++++++++++- drivers/net/bnxt/rte_pmd_bnxt.h | 20 +++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt_version.map | 1 + 6 files changed, 57 insertions(+), 4 deletions(-)
drivers/net/bnxt/bnxt.h +1 -0
@@ -58,6 +58,7 @@ struct bnxt_child_vf_info {uint16_t fid;uint16_t max_tx_rate;uint32_t func_cfg_flags; +uint16_t dflt_vlan;void *req_buf;uint8_t mac_spoof_en; };
drivers/net/bnxt/bnxt_hwrm.c +2 -2
@@ -2138,7 +2138,7 @@ int bnxt_hwrm_func_bw_cfg(struct bnxt *bp, uint16_t vf,return rc; } -int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf,uint16_t vlan) +int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf) {struct hwrm_func_cfg_input req = {0 };struct hwrm_func_cfg_output *resp = bp->hwrm_cmd_resp_addr;
@@ -2148,7 +2148,7 @@ int bnxt_hwrm_set_vf_vlan(struct bnxt *bp, int vf, uint16_t vlan) req.flags =rte_cpu_to_le_32 (bp->pf.vf_info[vf].func_cfg_flags); req.fid =rte_cpu_to_le_16 (bp->pf.vf_info[vf].fid); req.enables |=rte_cpu_to_le_32 (HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN ); - req.dflt_vlan =rte_cpu_to_le_16 (vlan); + req.dflt_vlan =rte_cpu_to_le_16 (bp->pf.vf_info[vf].dflt_vlan); rc =bnxt_hwrm_send_message (bp, &req,sizeof (req));HWRM_CHECK_RESULT ;
drivers/net/bnxt/bnxt_hwrm.h +1 -1
@@ -111,7 +111,6 @@ int bnxt_hwrm_allocate_pf_only(struct bnxt *bp);int bnxt_hwrm_allocate_vfs (struct bnxt *bp,int num_vfs);int bnxt_hwrm_func_vf_mac (struct bnxt *bp,uint16_t vf,uint8_t *mac_addr);int bnxt_hwrm_pf_evb_mode (struct bnxt *bp); -int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf,uint16_t vlan);int bnxt_hwrm_func_bw_cfg (struct bnxt *bp,uint16_t vf,uint16_t max_bw,uint16_t enables); int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, uint16_t port,
@@ -119,6 +118,7 @@ int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, uint16_t port,int bnxt_hwrm_tunnel_dst_port_free (struct bnxt *bp,uint16_t port,uint8_t tunnel_type);void bnxt_free_tunnel_ports (struct bnxt *bp); +int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf);int bnxt_hwrm_func_cfg_vf_set_flags (struct bnxt *bp,uint16_t vf); int bnxt_hwrm_func_vf_vnic_cfg_do(struct bnxt *bp, uint16_t vf, void (*vnic_cb)(struct bnxt_vnic_info *,
drivers/net/bnxt/rte_pmd_bnxt.c +32 -1
@@ -247,7 +247,8 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan,for (i =0 ; vf_mask; i++, vf_mask >>=1 ) {if (vf_mask &1 ) { - ret =bnxt_hwrm_set_vf_vlan (bp, i, vlan_on ? vlan :0 ); + bp->pf.vf_info[i].dflt_vlan = vlan_on ? vlan :0 ; + ret =bnxt_hwrm_set_vf_vlan (bp, i);if (ret) rc = ret; }
@@ -346,3 +347,33 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)return rc; } + +int +rte_pmd_bnxt_set_vf_vlan_insert (uint8_t port,uint16_t vf, +uint16_t vlan_id) +{ +struct rte_eth_dev *dev; +struct rte_eth_dev_info dev_info; +struct bnxt *bp; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port, -ENODEV ); + + dev = &rte_eth_devices[port]; +rte_eth_dev_info_get (port, &dev_info); + bp = (struct bnxt *)dev->data->dev_private; + +if (vf >= dev_info.max_vfs) +return -EINVAL ; + +if (!BNXT_PF (bp)) { +RTE_LOG (ERR ,PMD , +"Attempt to set VF %d vlan insert on non-PF port %d\n" , + vf, port); +return -ENOTSUP ; + } + +if (vlan_id != bp->pf.vf_info[vf].dflt_vlan) +return -ENOTSUP ; + +return 0 ; +}
drivers/net/bnxt/rte_pmd_bnxt.h +20 -0
@@ -74,6 +74,26 @@ int rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);/** +* Enable/Disable vf vlan insert +* +* @param port +* The port identifier of the Ethernet device. +* @param vf +* ID specifying VF. +* @param vlan_id +* 0 - Disable VF's vlan insert. +* n - Enable; n is inserted as the vlan id. +* +* @return +* - (0) if successful. +* - (-ENODEV) if *port* invalid. +* - (-EINVAL) if bad parameter. +*/ +int +rte_pmd_bnxt_set_vf_vlan_insert (uint8_t port,uint16_t vf, +uint16_t vlan_id); + +/** * Response sent back to bnxt driver from user app after callback */ enum rte_pmd_bnxt_mb_event_rsp {
drivers/net/bnxt/rte_pmd_bnxt_version.map +1 -0
@@ -7,5 +7,6 @@ DPDK_17.05 { rte_pmd_bnxt_set_vf_vlan_filter; rte_pmd_bnxt_set_vf_mac_anti_spoof; rte_pmd_bnxt_set_vf_vlan_stripq; + rte_pmd_bnxt_set_vf_vlan_insert; };
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 20/28 bnxt: Add support to set VF rxmode
In reply to Ajit KhapardeThis patch adds support to configure the VF L2 Rx settings. It also adds code in testpmd to call the appropriate bnxt PMD function when this setting needs to be configured in the hardware.
--- app/test-pmd/cmdline.c | 8 ++++ drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 65 ++++++++++++++++++++----------- drivers/net/bnxt/bnxt_hwrm.h | 7 ++-- drivers/net/bnxt/bnxt_rxq.c | 3 ++ drivers/net/bnxt/bnxt_vnic.h | 5 +++ drivers/net/bnxt/rte_pmd_bnxt.c | 62 ++++++++++++++++++++++++++--- drivers/net/bnxt/rte_pmd_bnxt.h | 20 ++++++++++ drivers/net/bnxt/rte_pmd_bnxt_version.map | 1 + 9 files changed, 141 insertions(+), 31 deletions(-)
app/test-pmd/cmdline.c +8 -0
@@ -6744,7 +6744,9 @@ cmdline_parse_inst_t cmd_set_vf_traffic = { NULL, }, }; +#endif +#if defined(RTE_LIBRTE_IXGBE_PMD ) || defined(RTE_LIBRTE_BNXT_PMD )/* *** CONFIGURE VF RECEIVE MODE *** */ struct cmd_set_vf_rxmode { cmdline_fixed_string_t set;
@@ -6778,7 +6780,13 @@ cmd_set_vf_rxmode_parsed(void *parsed_result, rx_mode |=ETH_VMDQ_ACCEPT_MULTICAST ; } +#ifdef RTE_LIBRTE_BNXT_PMD + ret =rte_pmd_bnxt_set_vf_rxmode (res->port_id, res->vf_id, rx_mode, + (uint8_t )is_on); +#endif +#ifdef RTE_LIBRTE_IXGBE_PMD ret =rte_pmd_ixgbe_set_vf_rxmode (res->port_id, res->vf_id, rx_mode, (uint8_t )is_on); +#endif if (ret <0 )printf ("bad VF receive mode parameter, return code = %d \n" , ret);
drivers/net/bnxt/bnxt.h +1 -0
@@ -58,6 +58,7 @@ struct bnxt_child_vf_info {uint16_t fid;uint16_t max_tx_rate;uint32_t func_cfg_flags; +uint32_t l2_rx_mask;uint16_t dflt_vlan;void *req_buf;uint8_t mac_spoof_en;
drivers/net/bnxt/bnxt_hwrm.c +42 -23
88 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.h +4 -3
@@ -120,7 +120,8 @@ int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, uint16_t port,void bnxt_free_tunnel_ports (struct bnxt *bp);int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf);int bnxt_hwrm_func_cfg_vf_set_flags (struct bnxt *bp,uint16_t vf); -int bnxt_hwrm_func_vf_vnic_cfg_do (struct bnxt *bp,uint16_t vf, -void (*vnic_cb)(struct bnxt_vnic_info *, -void *),void *cbdata); +void vf_vnic_set_rxmask_cb (struct bnxt_vnic_info *vnic,void *flagp); +int bnxt_hwrm_func_vf_vnic_query_and_config (struct bnxt *bp,uint16_t vf, +void (*vnic_cb)(struct bnxt_vnic_info *,void *),void *cbdata, +int (*hwrm_cb)(struct bnxt *bp,struct bnxt_vnic_info *vnic));#endif
drivers/net/bnxt/bnxt_rxq.c +3 -0
@@ -76,6 +76,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp) rc = -ENOMEM ; goto err_out; } + vnic->flags |=BNXT_VNIC_INFO_BCAST ;STAILQ_INSERT_TAIL (&bp->ff_pool[0 ], vnic, next); bp->nr_vnics++;
@@ -140,6 +141,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp) rc = -ENOMEM ; goto err_out; } + vnic->flags |=BNXT_VNIC_INFO_BCAST ;STAILQ_INSERT_TAIL (&bp->ff_pool[i], vnic, next); bp->nr_vnics++;
@@ -180,6 +182,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp) rc = -ENOMEM ; goto err_out; } + vnic->flags |=BNXT_VNIC_INFO_BCAST ;/* Partition the rx queues for the single pool */ for (i =0 ; i < bp->rx_cp_nr_rings; i++) { rxq = bp->eth_dev->data->rx_queues[i];
drivers/net/bnxt/bnxt_vnic.h +5 -0
@@ -61,6 +61,11 @@ struct bnxt_vnic_info {uint32_t flags;#define BNXT_VNIC_INFO_PROMISC (1 << 0)#define BNXT_VNIC_INFO_ALLMULTI (1 << 1) +#define BNXT_VNIC_INFO_BCAST (1 << 2) +#define BNXT_VNIC_INFO_UCAST (1 << 3) +#define BNXT_VNIC_INFO_MCAST (1 << 4) +#define BNXT_VNIC_INFO_TAGGED (1 << 5) +#define BNXT_VNIC_INFO_UNTAGGED (1 << 6)bool vlan_strip;bool func_default;
drivers/net/bnxt/rte_pmd_bnxt.c +57 -5
77 lines not on this page · raw message
drivers/net/bnxt/rte_pmd_bnxt.h +20 -0
@@ -209,4 +209,24 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan,* - (-EINVAL) if bad parameter. */ int rte_pmd_bnxt_set_vf_mac_anti_spoof (uint8_t port,uint16_t vf,uint8_t on); + +/** +* Set RX L2 Filtering mode of a VF of an Ethernet device. +* +* @param port +* The port identifier of the Ethernet device. +* @param vf +* VF id. +* @param rx_mask +* The RX mode mask +* @param on +* 1 - Enable a VF RX mode. +* 0 - Disable a VF RX mode. +* @return +* - (0) if successful. +* - (-ENODEV) if *port_id* invalid. +* - (-EINVAL) if bad parameter. +*/ +int rte_pmd_bnxt_set_vf_rxmode (uint8_t port,uint16_t vf, +uint16_t rx_mask,uint8_t on);#endif /* _PMD_BNXT_H_ */
drivers/net/bnxt/rte_pmd_bnxt_version.map +1 -0
@@ -8,5 +8,6 @@ DPDK_17.05 { rte_pmd_bnxt_set_vf_mac_anti_spoof; rte_pmd_bnxt_set_vf_vlan_stripq; rte_pmd_bnxt_set_vf_vlan_insert; + rte_pmd_bnxt_set_vf_rxmode; };
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 21/28 bnxt: Add VF stats get/reset functions
In reply to Ajit KhapardeThis patch adds functions to get/reset VF stats.
It also adds the HWRM API needed to support this.
--- drivers/net/bnxt/bnxt_hwrm.c | 55 ++++++++ drivers/net/bnxt/bnxt_hwrm.h | 3 + drivers/net/bnxt/hsi_struct_def_dpdk.h | 219 ++++++++++++++++++++++++++++++ drivers/net/bnxt/rte_pmd_bnxt.c | 49 +++++++ drivers/net/bnxt/rte_pmd_bnxt.h | 33 +++++ drivers/net/bnxt/rte_pmd_bnxt_version.map | 2 + 6 files changed, 361 insertions(+)
drivers/net/bnxt/bnxt_hwrm.c +55 -0
@@ -1151,6 +1151,61 @@ int bnxt_hwrm_exec_fwd_resp(struct bnxt *bp, uint16_t target_id,return rc; } +int bnxt_hwrm_func_qstats (struct bnxt *bp,uint16_t fid, +struct rte_eth_stats *stats) +{ +int rc =0 ; +struct hwrm_func_qstats_input req = {.req_type =0 }; +struct hwrm_func_qstats_output *resp = bp->hwrm_cmd_resp_addr; + +HWRM_PREP (req,FUNC_QSTATS ,-1 , resp); + + req.fid =rte_cpu_to_le_16 (fid); + + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); + +HWRM_CHECK_RESULT ; + +memset (stats,0 ,sizeof (*stats)); + + stats->ipackets =rte_le_to_cpu_64 (resp->rx_ucast_pkts); + stats->ipackets +=rte_le_to_cpu_64 (resp->rx_mcast_pkts); + stats->ipackets +=rte_le_to_cpu_64 (resp->rx_bcast_pkts); + stats->ibytes =rte_le_to_cpu_64 (resp->rx_ucast_bytes); + stats->ibytes +=rte_le_to_cpu_64 (resp->rx_mcast_bytes); + stats->ibytes +=rte_le_to_cpu_64 (resp->rx_bcast_bytes); + + stats->opackets =rte_le_to_cpu_64 (resp->tx_ucast_pkts); + stats->opackets +=rte_le_to_cpu_64 (resp->tx_mcast_pkts); + stats->opackets +=rte_le_to_cpu_64 (resp->tx_bcast_pkts); + stats->obytes =rte_le_to_cpu_64 (resp->tx_ucast_bytes); + stats->obytes +=rte_le_to_cpu_64 (resp->tx_mcast_bytes); + stats->obytes +=rte_le_to_cpu_64 (resp->tx_bcast_bytes); + + stats->ierrors =rte_le_to_cpu_64 (resp->rx_err_pkts); + stats->oerrors =rte_le_to_cpu_64 (resp->tx_err_pkts); + stats->rx_nombuf =rte_le_to_cpu_64 (resp->rx_drop_pkts); + +return rc; +} + +int bnxt_hwrm_func_clr_stats (struct bnxt *bp,uint16_t fid) +{ +int rc =0 ; +struct hwrm_func_clr_stats_input req = {.req_type =0 }; +struct hwrm_func_clr_stats_output *resp = bp->hwrm_cmd_resp_addr; + +HWRM_PREP (req,FUNC_CLR_STATS ,-1 , resp); + + req.fid =rte_cpu_to_le_16 (fid); + + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); + +HWRM_CHECK_RESULT ; + +return rc; +} +/* * HWRM utility functions */
drivers/net/bnxt/bnxt_hwrm.h +3 -0
@@ -63,6 +63,9 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp);int bnxt_hwrm_func_qcaps (struct bnxt *bp);int bnxt_hwrm_func_reset (struct bnxt *bp);int bnxt_hwrm_func_driver_unregister (struct bnxt *bp,uint32_t flags); +int bnxt_hwrm_func_qstats (struct bnxt *bp,uint16_t fid, +struct rte_eth_stats *stats); +int bnxt_hwrm_func_clr_stats (struct bnxt *bp,uint16_t fid);int bnxt_hwrm_queue_qportcfg (struct bnxt *bp);
drivers/net/bnxt/hsi_struct_def_dpdk.h +219 -0
231 lines not on this page · raw message
drivers/net/bnxt/rte_pmd_bnxt.c +49 -0
52 lines not on this page · raw message
drivers/net/bnxt/rte_pmd_bnxt.h +33 -0
@@ -229,4 +229,37 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);*/ int rte_pmd_bnxt_set_vf_rxmode (uint8_t port,uint16_t vf,uint16_t rx_mask,uint8_t on); + +/** +* Get VF's statistics +* +* @param port +* The port identifier of the Ethernet device. +* @param vf_id +* VF on which to get. +* @param stats +* A pointer to a structure of type *rte_eth_stats* to be filled with +* the values of device counters supported statistics: +* @return +* - (0) if successful. +* - (-ENODEV) if *port* invalid. +* - (-EINVAL) if bad parameter. +*/ + +int rte_pmd_bnxt_get_vf_stats (uint8_t port,uint16_t vf_id, +struct rte_eth_stats *stats); + +/** +* Clear VF's statistics +* +* @param port +* The port identifier of the Ethernet device. +* @param vf_id +* VF on which to get. +* @return +* - (0) if successful. +* - (-ENODEV) if *port* invalid. +* - (-EINVAL) if bad parameter. +*/ +int rte_pmd_bnxt_reset_vf_stats (uint8_t port,uint16_t vf_id);#endif /* _PMD_BNXT_H_ */
drivers/net/bnxt/rte_pmd_bnxt_version.map +2 -0
@@ -9,5 +9,7 @@ DPDK_17.05 { rte_pmd_bnxt_set_vf_vlan_stripq; rte_pmd_bnxt_set_vf_vlan_insert; rte_pmd_bnxt_set_vf_rxmode; + rte_pmd_bnxt_get_vf_stats; + rte_pmd_bnxt_reset_vf_stats; };
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 22/28 bnxt: Add newlines to all RTE_LOG() format strings
In reply to Ajit KhapardeAdd newline to the RTE_LOG() messages for better readability.
--- drivers/net/bnxt/bnxt_ethdev.c | 10 +++++----- drivers/net/bnxt/bnxt_filter.c | 2 +- drivers/net/bnxt/bnxt_irq.c | 2 +- drivers/net/bnxt/bnxt_ring.c | 2 +- drivers/net/bnxt/bnxt_rxq.c | 7 ++++--- drivers/net/bnxt/bnxt_vnic.c | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +5 -5
@@ -881,7 +881,7 @@ static int bnxt_rss_hash_conf_get_op(struct rte_eth_dev *eth_dev, }if (hash_types) {RTE_LOG (ERR ,PMD , -"Unknwon RSS config from firmware (%08x), RSS disabled" , +"Unknwon RSS config from firmware (%08x), RSS disabled\n" , vnic->hash_type);return -ENOTSUP ; }
@@ -1071,7 +1071,7 @@ bnxt_udp_tunnel_port_del_op(struct rte_eth_dev *eth_dev, port = bp->geneve_fw_dst_port_id;break ;default : -RTE_LOG (ERR ,PMD ,"Tunnel type is not supported" ); +RTE_LOG (ERR ,PMD ,"Tunnel type is not supported\n" );return -ENOTSUP ; }
@@ -1181,7 +1181,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)int rc;if (version_printed++ ==0 ) -RTE_LOG (INFO ,PMD ,"%s" , bnxt_version); +RTE_LOG (INFO ,PMD ,"%s\n" , bnxt_version);rte_eth_copy_pci_info (eth_dev, pci_dev); eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ;
@@ -1231,7 +1231,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev) ETHER_ADDR_LEN * MAX_NUM_MAC_ADDR, 0);if (eth_dev->data->mac_addrs ==NULL ) {RTE_LOG (ERR ,PMD , -"Failed to alloc %u bytes needed to store MAC addr tbl" , +"Failed to alloc %u bytes needed to store MAC addr tbl\n" ,ETHER_ADDR_LEN *MAX_NUM_MAC_ADDR ); rc = -ENOMEM ; goto error_free;
@@ -1275,7 +1275,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev) rc =bnxt_hwrm_func_driver_register (bp);if (rc) {RTE_LOG (ERR ,PMD , -"Failed to register driver" ); +"Failed to register driver\n" ); rc = -EBUSY ; goto error_free; }
drivers/net/bnxt/bnxt_filter.c +1 -1
@@ -145,7 +145,7 @@ int bnxt_alloc_filter_mem(struct bnxt *bp) max_filters *sizeof (struct bnxt_filter_info ), 0);if (filter_mem ==NULL ) { -RTE_LOG (ERR ,PMD ,"Failed to alloc memory for %d filters" , +RTE_LOG (ERR ,PMD ,"Failed to alloc memory for %d filters\n" , max_filters);return -ENOMEM ; }
drivers/net/bnxt/bnxt_irq.c +1 -1
@@ -141,7 +141,7 @@ int bnxt_setup_int(struct bnxt *bp)return 0 ; setup_exit: -RTE_LOG (ERR ,PMD ,"bnxt_irq_tbl setup failed" ); +RTE_LOG (ERR ,PMD ,"bnxt_irq_tbl setup failed\n" );return rc; }
drivers/net/bnxt/bnxt_ring.c +1 -1
@@ -258,7 +258,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp) bp->grp_info[idx].rx_fw_ring_id = ring->fw_ring_id;B_RX_DB (rxr->rx_doorbell, rxr->rx_prod);if (bnxt_init_one_rx_ring (rxq)) { -RTE_LOG (ERR ,PMD ,"bnxt_init_one_rx_ring failed!" ); +RTE_LOG (ERR ,PMD ,"bnxt_init_one_rx_ring failed!\n" );bnxt_rx_queue_release_op (rxq);return -ENOMEM ; }
drivers/net/bnxt/bnxt_rxq.c +4 -3
@@ -278,7 +278,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,int rc =0 ;if (!nb_desc || nb_desc >MAX_RX_DESC_CNT ) { -RTE_LOG (ERR ,PMD ,"nb_desc %d is invalid" , nb_desc); +RTE_LOG (ERR ,PMD ,"nb_desc %d is invalid\n" , nb_desc); rc = -EINVAL ; goto out; }
@@ -291,7 +291,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, rxq =rte_zmalloc_socket ("bnxt_rx_queue" ,sizeof (struct bnxt_rx_queue ),RTE_CACHE_LINE_SIZE , socket_id);if (!rxq) { -RTE_LOG (ERR ,PMD ,"bnxt_rx_queue allocation failed!" ); +RTE_LOG (ERR ,PMD ,"bnxt_rx_queue allocation failed!\n" ); rc = -ENOMEM ; goto out; }
@@ -313,7 +313,8 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,/* Allocate RX ring hardware descriptors */ if (bnxt_alloc_rings (bp, queue_idx,NULL , rxq->rx_ring, rxq->cp_ring,"rxr" )) { -RTE_LOG (ERR ,PMD ,"ring_dma_zone_reserve for rx_ring failed!" ); +RTE_LOG (ERR ,PMD , +"ring_dma_zone_reserve for rx_ring failed!\n" );bnxt_rx_queue_release_op (rxq); rc = -ENOMEM ; goto out;
drivers/net/bnxt/bnxt_vnic.c +1 -1
@@ -253,7 +253,7 @@ int bnxt_alloc_vnic_mem(struct bnxt *bp) vnic_mem =rte_zmalloc ("bnxt_vnic_info" , max_vnics *sizeof (struct bnxt_vnic_info ),0 );if (vnic_mem ==NULL ) { -RTE_LOG (ERR ,PMD ,"Failed to alloc memory for %d VNICs" , +RTE_LOG (ERR ,PMD ,"Failed to alloc memory for %d VNICs\n" , max_vnics);return -ENOMEM ; }
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 23/28 bnxt: Add support for VLAN filter and strip dev_ops
In reply to Ajit KhapardeThis 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
--- drivers/net/bnxt/bnxt_ethdev.c | 246 +++++++++++++++++++++++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bnxt/bnxt_rxr.c | 2 +- 3 files changed, 248 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +246 -0
@@ -137,6 +137,7 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { ETH_RSS_NONFRAG_IPV6_TCP | \ ETH_RSS_NONFRAG_IPV6_UDP) +static void bnxt_vlan_offload_set_op (struct rte_eth_dev *dev,int mask);/***********************/ /*
@@ -484,6 +485,7 @@ static int bnxt_dev_lsc_intr_setup(struct rte_eth_dev *eth_dev)static int bnxt_dev_start_op (struct rte_eth_dev *eth_dev) {struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; +int vlan_mask =0 ;int rc; bp->dev_stopped =0 ;
@@ -493,6 +495,13 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) goto error;bnxt_link_update_op (eth_dev,0 ); + +if (eth_dev->data->dev_conf.rxmode.hw_vlan_filter) + vlan_mask |=ETH_VLAN_FILTER_MASK ; +if (eth_dev->data->dev_conf.rxmode.hw_vlan_strip) + vlan_mask |=ETH_VLAN_STRIP_MASK ; +bnxt_vlan_offload_set_op (eth_dev, vlan_mask); +return 0 ; error:
@@ -1087,6 +1096,240 @@ bnxt_udp_tunnel_port_del_op(struct rte_eth_dev *eth_dev,return rc; } +static int bnxt_del_vlan_filter (struct bnxt *bp,uint16_t vlan_id) +{ +struct bnxt_filter_info *filter, *temp_filter, *new_filter; +struct bnxt_vnic_info *vnic; +unsigned int i; +int rc =0 ; +uint32_t chk =HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN ; + +/* Cycle through all VNICs */ +for (i =0 ; i < bp->nr_vnics; i++) { +/* +* 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 +*/ + STAILQ_FOREACH(vnic, &bp->ff_pool[i], next) { + filter =STAILQ_FIRST (&vnic->filter); +while (filter) { + temp_filter =STAILQ_NEXT (filter, next); + +if (filter->enables & chk && + filter->l2_ovlan == vlan_id) { +/* Must delete the filter */ +STAILQ_REMOVE (&vnic->filter, filter, + bnxt_filter_info, next); +bnxt_hwrm_clear_filter (bp, filter); +STAILQ_INSERT_TAIL ( + &bp->free_filter_list, + filter, next); + +/* +* Need to examine to see if the MAC +* filter already existed or not before +* allocating a new one +*/ + + new_filter =bnxt_alloc_filter (bp); +if (!new_filter) { +RTE_LOG (ERR ,PMD , +"MAC/VLAN filter alloc failed\n" ); + rc = -ENOMEM ; + goto exit; + } +STAILQ_INSERT_TAIL (&vnic->filter, + new_filter, next); +/* Inherit MAC from previous filter */ + new_filter->mac_index = + filter->mac_index; +memcpy (new_filter->l2_addr, + filter->l2_addr,ETHER_ADDR_LEN ); +/* MAC only filter */ + rc =bnxt_hwrm_set_filter (bp, vnic, + new_filter); +if (rc) + goto exit; +RTE_LOG (INFO ,PMD , +"Del Vlan filter for %d\n" , + vlan_id); + } + filter = temp_filter; + } + } + } +exit: +return rc; +} + +static int bnxt_add_vlan_filter (struct bnxt *bp,uint16_t vlan_id) +{ +struct bnxt_filter_info *filter, *temp_filter, *new_filter; +struct bnxt_vnic_info *vnic; +unsigned int i; +int rc =0 ; +uint32_t en =HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN | +HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK ; +uint32_t chk =HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN ; + +/* Cycle through all VNICs */ +for (i =0 ; i < bp->nr_vnics; i++) { +/* +* 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 +*/ + STAILQ_FOREACH(vnic, &bp->ff_pool[i], next) { + filter =STAILQ_FIRST (&vnic->filter); +while (filter) { + temp_filter =STAILQ_NEXT (filter, next); + +if (filter->enables & chk) { +if (filter->l2_ovlan == vlan_id) + goto cont; + }else { +/* Must delete the MAC filter */ +STAILQ_REMOVE (&vnic->filter, filter, + bnxt_filter_info, next); +bnxt_hwrm_clear_filter (bp, filter); + filter->l2_ovlan =0 ; +STAILQ_INSERT_TAIL ( + &bp->free_filter_list, + filter, next); + } + new_filter =bnxt_alloc_filter (bp); +if (!new_filter) { +RTE_LOG (ERR ,PMD , +"MAC/VLAN filter alloc failed\n" ); + rc = -ENOMEM ; + goto exit; + } +STAILQ_INSERT_TAIL (&vnic->filter, new_filter, + next); +/* Inherit MAC from the previous filter */ + new_filter->mac_index = filter->mac_index; +memcpy (new_filter->l2_addr, filter->l2_addr, +ETHER_ADDR_LEN ); +/* MAC + VLAN ID filter */ + new_filter->l2_ovlan = vlan_id; + new_filter->l2_ovlan_mask =0xF000 ; + new_filter->enables |= en; + rc =bnxt_hwrm_set_filter (bp, vnic, new_filter); +if (rc) + goto exit; +RTE_LOG (INFO ,PMD , +"Added Vlan filter for %d\n" , vlan_id); +cont: + filter = temp_filter; + } + } + } +exit: +return rc; +} + +static int bnxt_vlan_filter_set_op (struct rte_eth_dev *eth_dev, +uint16_t vlan_id,int on) +{ +struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; + +/* These operations apply to ALL existing MAC/VLAN filters */ +if (on) +return bnxt_add_vlan_filter (bp, vlan_id); +else +return bnxt_del_vlan_filter (bp, vlan_id); +} + +static void bnxt_vlan_strip_queue_set_op (struct rte_eth_dev *eth_dev, +uint16_t rx_queue_id,int on) +{ +struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; +struct bnxt_rx_queue *rxq = eth_dev->data->rx_queues[rx_queue_id]; +struct bnxt_vnic_info *vnic; +int rc =0 ; + +/* VLAN strip at the VNIC level is supported */ +if (rxq ==NULL ) { +RTE_LOG (ERR ,PMD ,"Invalid Rx queue id %d!" , rx_queue_id); +return ; + } +if (rxq->vnic ==NULL ) { +RTE_LOG (ERR ,PMD ,"No VNIC associated with Rx queue id %d!" , + rx_queue_id); +return ; + } + + vnic = rxq->vnic; +if ((on && vnic->vlan_strip) || (!on && !vnic->vlan_strip)) { +RTE_LOG (INFO ,PMD , +"Rx queue %d already has VLAN strip set to %d" , + rx_queue_id, on); +return ; + } + vnic->vlan_strip = on ? true : false; + rc =bnxt_hwrm_vnic_cfg (bp, vnic); +if (rc) { +RTE_LOG (ERR ,PMD ,"HWRM vnic cfg failure rc: %x\n" , rc); +return ; + } + +/* +* TODO: If there are other rx queues that belong to the same VNIC, +* we have the following options: +* 1. Accept the change and silently force the same VLAN strip +* setting to all associated rx queues [current implementation] +* 2. Migrate any rx queues that are hanging on the same VNIC to +* a new VNIC +* 3. Reject the request if there are other rx queues using the +* same VNIC +*/ +} + +static void +bnxt_vlan_offload_set_op (struct rte_eth_dev *dev,int mask) +{ +struct bnxt *bp = (struct bnxt *)dev->data->dev_private; +unsigned int i; + +if (mask Ð_VLAN_FILTER_MASK ) { +if (!dev->data->dev_conf.rxmode.hw_vlan_filter) { +/* Remove any VLAN filters programmed */ +for (i =0 ; i <4095 ; i++) +bnxt_del_vlan_filter (bp, i); + } +RTE_LOG (INFO ,PMD ,"VLAN Filtering: %d\n" , + dev->data->dev_conf.rxmode.hw_vlan_filter); + } + +if (mask Ð_VLAN_STRIP_MASK ) { +/* Enable or disable VLAN stripping */ +for (i =0 ; i < bp->nr_vnics; i++) { +struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; +if (dev->data->dev_conf.rxmode.hw_vlan_strip) + vnic->vlan_strip = true; +else + vnic->vlan_strip = false; +bnxt_hwrm_vnic_cfg (bp, vnic); + } +RTE_LOG (INFO ,PMD ,"VLAN Strip Offload: %d\n" , + dev->data->dev_conf.rxmode.hw_vlan_strip); + } + +if (mask Ð_VLAN_EXTEND_MASK ) +RTE_LOG (ERR ,PMD ,"Extend VLAN Not supported\n" ); +} + +/* * Initialization */
@@ -1120,6 +1363,9 @@ static const struct eth_dev_ops bnxt_dev_ops = { .flow_ctrl_set = bnxt_flow_ctrl_set_op, .udp_tunnel_port_add = bnxt_udp_tunnel_port_add_op, .udp_tunnel_port_del = bnxt_udp_tunnel_port_del_op, + .vlan_filter_set = bnxt_vlan_filter_set_op, + .vlan_strip_queue_set = bnxt_vlan_strip_queue_set_op, + .vlan_offload_set = bnxt_vlan_offload_set_op, };static bool bnxt_vf_pciid (uint16_t id)
drivers/net/bnxt/bnxt_hwrm.c +1 -1
@@ -893,7 +893,7 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)int bnxt_hwrm_vnic_cfg (struct bnxt *bp,struct bnxt_vnic_info *vnic) {int rc =0 ; -struct hwrm_vnic_cfg_input req = {.req_type =0 }; +struct hwrm_vnic_cfg_input req = {0 };struct hwrm_vnic_cfg_output *resp = bp->hwrm_cmd_resp_addr;HWRM_PREP (req,VNIC_CFG ,-1 , resp);
drivers/net/bnxt/bnxt_rxr.c +1 -1
@@ -144,7 +144,7 @@ static uint16_t bnxt_rx_pkt(struct rte_mbuf **rx_pkt, (RX_PKT_CMPL_METADATA_VID_MASK |RX_PKT_CMPL_METADATA_DE |RX_PKT_CMPL_METADATA_PRI_MASK ); - mbuf->ol_flags |=PKT_RX_VLAN_PKT ; + mbuf->ol_flags |=PKT_RX_VLAN_PKT |PKT_RX_VLAN_STRIPPED ; } rx_buf->mbuf =NULL ;
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 24/28 bnxt: Add support for mac_addr_set dev_op
In reply to Ajit KhapardeThis patch adds support for the mac_addr_set dev_op. This feature is not supported for a VF device.
--- drivers/net/bnxt/bnxt_ethdev.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
drivers/net/bnxt/bnxt_ethdev.c +37 -0
@@ -1330,6 +1330,42 @@ bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask) } +static void +bnxt_set_default_mac_addr_op (struct rte_eth_dev *dev,struct ether_addr *addr) +{ +struct bnxt *bp = (struct bnxt *)dev->data->dev_private; +/* Default Filter is tied to VNIC 0 */ +struct bnxt_vnic_info *vnic = &bp->vnic_info[0 ]; +struct bnxt_filter_info *filter; +int rc; + +if (BNXT_VF (bp)) +return ; + +memcpy (bp->mac_addr, addr,sizeof (bp->mac_addr)); +memcpy (&dev->data->mac_addrs[0 ], bp->mac_addr,ETHER_ADDR_LEN ); + + STAILQ_FOREACH(filter, &vnic->filter, next) { +/* Default Filter is at Index 0 */ +if (filter->mac_index !=0 ) +continue ; + rc =bnxt_hwrm_clear_filter (bp, filter); +if (rc) +break ; +memcpy (filter->l2_addr, bp->mac_addr,ETHER_ADDR_LEN ); +memset (filter->l2_addr_mask,0xff ,ETHER_ADDR_LEN ); + filter->flags |=HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX ; + filter->enables |= +HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR | +HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK ; + rc =bnxt_hwrm_set_filter (bp, vnic, filter); +if (rc) +break ; + filter->mac_index =0 ; +RTE_LOG (DEBUG ,PMD ,"Set MAC addr\n" ); + } +} +/* * Initialization */
@@ -1366,6 +1402,7 @@ static const struct eth_dev_ops bnxt_dev_ops = { .vlan_filter_set = bnxt_vlan_filter_set_op, .vlan_strip_queue_set = bnxt_vlan_strip_queue_set_op, .vlan_offload_set = bnxt_vlan_offload_set_op, + .mac_addr_set = bnxt_set_default_mac_addr_op, };static bool bnxt_vf_pciid (uint16_t id)
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 25/28 bnxt: add support for xstats
In reply to Ajit KhapardeThis 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
--- drivers/net/bnxt/bnxt.h | 7 + drivers/net/bnxt/bnxt_ethdev.c | 90 ++++++ drivers/net/bnxt/bnxt_hwrm.c | 34 +++ drivers/net/bnxt/bnxt_hwrm.h | 2 + drivers/net/bnxt/bnxt_stats.c | 203 ++++++++++++++ drivers/net/bnxt/bnxt_stats.h | 12 + drivers/net/bnxt/hsi_struct_def_dpdk.h | 494 +++++++++++++++++++++++++++++++++ 7 files changed, 842 insertions(+)
drivers/net/bnxt/bnxt.h +7 -0
@@ -125,6 +125,7 @@ struct bnxt {uint32_t flags;#define BNXT_FLAG_REGISTERED (1 << 0)#define BNXT_FLAG_VF (1 << 1) +#define BNXT_FLAG_PORT_STATS (1 << 2)#define BNXT_PF (bp) (!((bp)->flags & BNXT_FLAG_VF))#define BNXT_VF (bp) ((bp)->flags & BNXT_FLAG_VF)#define BNXT_NPAR_ENABLED (bp) ((bp)->port_partition_type)
@@ -133,10 +134,16 @@ struct bnxt {unsigned int rx_nr_rings;unsigned int rx_cp_nr_rings;struct bnxt_rx_queue **rx_queues; +const void *rx_mem_zone; +struct rx_port_stats *hw_rx_port_stats; +phys_addr_t hw_rx_port_stats_map;unsigned int tx_nr_rings;unsigned int tx_cp_nr_rings;struct bnxt_tx_queue **tx_queues; +const void *tx_mem_zone; +struct tx_port_stats *hw_tx_port_stats; +phys_addr_t hw_tx_port_stats_map;/* Default completion ring */ struct bnxt_cp_ring_info *def_cp_ring;
drivers/net/bnxt/bnxt_ethdev.c +90 -0
127 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.c +34 -0
@@ -2301,3 +2301,37 @@ int bnxt_hwrm_func_vf_vnic_query_and_config(struct bnxt *bp, uint16_t vf,return rc; } + +int bnxt_hwrm_port_qstats (struct bnxt *bp) +{ +struct hwrm_port_qstats_input req = {0 }; +struct hwrm_port_qstats_output *resp = bp->hwrm_cmd_resp_addr; +struct bnxt_pf_info *pf = &bp->pf; +int rc; + +if (!(bp->flags &BNXT_FLAG_PORT_STATS )) +return 0 ; + +HWRM_PREP (req,PORT_QSTATS ,-1 , resp); + req.port_id =rte_cpu_to_le_16 (pf->port_id); + req.tx_stat_host_addr =rte_cpu_to_le_64 (bp->hw_tx_port_stats_map); + req.rx_stat_host_addr =rte_cpu_to_le_64 (bp->hw_rx_port_stats_map); + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); +HWRM_CHECK_RESULT ; +return rc; +} + +int bnxt_hwrm_port_clr_stats (struct bnxt *bp) +{ +struct hwrm_port_clr_stats_input req = {0 }; +struct hwrm_port_clr_stats_output *resp = bp->hwrm_cmd_resp_addr; +struct bnxt_pf_info *pf = &bp->pf; +int rc; + +HWRM_PREP (req,PORT_CLR_STATS ,-1 , resp); + req.port_id =rte_cpu_to_le_16 (pf->port_id); + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req)); +HWRM_CHECK_RESULT ; +return rc; +} +
drivers/net/bnxt/bnxt_hwrm.h +2 -0
@@ -127,4 +127,6 @@ void vf_vnic_set_rxmask_cb(struct bnxt_vnic_info *vnic, void *flagp);int bnxt_hwrm_func_vf_vnic_query_and_config (struct bnxt *bp,uint16_t vf,void (*vnic_cb)(struct bnxt_vnic_info *,void *),void *cbdata,int (*hwrm_cb)(struct bnxt *bp,struct bnxt_vnic_info *vnic)); +int bnxt_hwrm_port_qstats (struct bnxt *bp); +int bnxt_hwrm_port_clr_stats (struct bnxt *bp);#endif
drivers/net/bnxt/bnxt_stats.c +203 -0
212 lines not on this page · raw message
drivers/net/bnxt/bnxt_stats.h +12 -0
@@ -34,11 +34,23 @@#ifndef _BNXT_STATS_H_#define _BNXT_STATS_H_ +#include <inttypes.h> +#include <stdbool.h> #include <rte_ethdev.h> void bnxt_free_stats (struct bnxt *bp);void bnxt_stats_get_op (struct rte_eth_dev *eth_dev,struct rte_eth_stats *bnxt_stats);void bnxt_stats_reset_op (struct rte_eth_dev *eth_dev); +int bnxt_dev_xstats_get_names_op(__rte_unused struct rte_eth_dev *eth_dev, +struct rte_eth_xstat_name *xstats_names,__rte_unused unsigned limit); +int bnxt_dev_xstats_get_op (struct rte_eth_dev *eth_dev, +struct rte_eth_xstat *xstats,unsigned n); +void bnxt_dev_xstats_reset_op (struct rte_eth_dev *eth_dev); + +struct bnxt_xstats_name_off { +char name[RTE_ETH_XSTATS_NAME_SIZE ]; +uint64_t offset; +};#endif
drivers/net/bnxt/hsi_struct_def_dpdk.h +494 -0
512 lines not on this page · raw message
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 26/28 bnxt: use only long BDs in Tx path
In reply to Ajit KhapardeDevices before Cu+B1 cannot mix long and short buffer descriptors. Use the long BD in all cases.
--- drivers/net/bnxt/bnxt_txr.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/bnxt/bnxt_txr.c +4 -0
@@ -159,6 +159,10 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt, TX_BD_LONG_FLAGS_LHINT_LT2K }; +/* Devices before Cu+B1 need to avoid mixing long and short BDs +* Revisit this fix once Cu+B1 is available. +*/ + long_bd = true;if (tx_pkt->ol_flags & (PKT_TX_TCP_SEG |PKT_TX_TCP_CKSUM |PKT_TX_UDP_CKSUM |PKT_TX_IP_CKSUM |PKT_TX_VLAN_PKT ))
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 27/28 bnxt: add support for set_mc_addr_list dev_op
In reply to Ajit KhapardeThis patch adds set_mc_addr_list dev_ops to support adding Multicast addr. If the number of Multicast addresses is more than the maximum number of Multicast addresses that the hardware supports, the PMD will enable Multicast Promiscuous mode for the specified function.
--- drivers/net/bnxt/bnxt_ethdev.c | 31 +++++++++++++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.c | 13 +++++++++---- drivers/net/bnxt/bnxt_vnic.c | 7 ++++++- drivers/net/bnxt/bnxt_vnic.h | 6 +++++- 4 files changed, 51 insertions(+), 6 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +31 -0
@@ -1373,6 +1373,36 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, struct ether_addr *addr) } } +static int +bnxt_dev_set_mc_addr_list_op (struct rte_eth_dev *eth_dev, +struct ether_addr *mc_addr_set, +uint32_t nb_mc_addr) +{ +struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; +char *mc_addr_list = (char *)mc_addr_set; +struct bnxt_vnic_info *vnic; +uint32_t off =0 , i =0 ; + + vnic = &bp->vnic_info[0 ]; + +if (nb_mc_addr >BNXT_MAX_MC_ADDRS ) { + vnic->flags |=BNXT_VNIC_INFO_ALLMULTI ; + goto allmulti; + } + +/* TODO Check for Duplicate mcast addresses */ + vnic->flags &= ~BNXT_VNIC_INFO_ALLMULTI ; +for (i =0 ; i < nb_mc_addr; i++) { +memcpy (vnic->mc_list + off, &mc_addr_list[i],ETHER_ADDR_LEN ); + off +=ETHER_ADDR_LEN ; + } + + vnic->mc_addr_cnt = i; + +allmulti: +return bnxt_hwrm_cfa_l2_set_rx_mask (bp, vnic); +} +/* * Initialization */
@@ -1413,6 +1443,7 @@ static const struct eth_dev_ops bnxt_dev_ops = { .xstats_get = bnxt_dev_xstats_get_op, .xstats_get_names = bnxt_dev_xstats_get_names_op, .xstats_reset = bnxt_dev_xstats_reset_op, + .set_mc_addr_list = bnxt_dev_set_mc_addr_list_op, };static bool bnxt_vf_pciid (uint16_t id)
drivers/net/bnxt/bnxt_hwrm.c +9 -4
@@ -192,7 +192,7 @@ int bnxt_hwrm_cfa_l2_clear_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic)struct hwrm_cfa_l2_set_rx_mask_output *resp = bp->hwrm_cmd_resp_addr;HWRM_PREP (req,CFA_L2_SET_RX_MASK ,-1 , resp); - req.vnic_id =rte_cpu_to_le_16 (vnic->fw_vnic_id); + req.vnic_id =rte_cpu_to_le_32 (vnic->fw_vnic_id); req.mask =0 ; rc =bnxt_hwrm_send_message (bp, &req,sizeof (req));
@@ -226,6 +226,11 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic) mask |=HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST ;if (vnic->flags &BNXT_VNIC_INFO_MCAST ) mask |=HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST ; +if (vnic->mc_addr_cnt) { + mask |=HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST ; + req.num_mc_entries =rte_cpu_to_le_32 (vnic->mc_addr_cnt); + req.mc_tbl_addr =rte_cpu_to_le_64 (vnic->mc_list_dma_addr); + } req.mask =rte_cpu_to_le_32 (mask);
@@ -886,7 +891,7 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)HWRM_CHECK_RESULT ; - vnic->fw_vnic_id =rte_le_to_cpu_16 (resp->vnic_id); + vnic->fw_vnic_id =rte_le_to_cpu_32 (resp->vnic_id);return rc; }
@@ -903,7 +908,7 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)rte_cpu_to_le_32 (HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP |HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE |HWRM_VNIC_CFG_INPUT_ENABLES_MRU ); - req.vnic_id =rte_cpu_to_le_16 (vnic->fw_vnic_id); + req.vnic_id =rte_cpu_to_le_32 (vnic->fw_vnic_id); req.dflt_ring_grp =rte_cpu_to_le_16 (bp->grp_info[vnic->start_grp_id].fw_grp_id); req.rss_rule =rte_cpu_to_le_16 (vnic->fw_rss_cos_lb_ctx);
@@ -1010,7 +1015,7 @@ int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic)HWRM_PREP (req,VNIC_FREE ,-1 , resp); - req.vnic_id =rte_cpu_to_le_16 (vnic->fw_vnic_id); + req.vnic_id =rte_cpu_to_le_32 (vnic->fw_vnic_id); rc =bnxt_hwrm_send_message (bp, &req,sizeof (req));
drivers/net/bnxt/bnxt_vnic.c +6 -1
@@ -169,7 +169,8 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)char mz_name[RTE_MEMZONE_NAMESIZE ];uint32_t entry_length =RTE_CACHE_LINE_ROUNDUP (HW_HASH_INDEX_SIZE *sizeof (*vnic->rss_table) + -HW_HASH_KEY_SIZE ); +HW_HASH_KEY_SIZE + +BNXT_MAX_MC_ADDRS *ETHER_ADDR_LEN );uint16_t max_vnics;int i;phys_addr_t mz_phys_addr;
@@ -217,6 +218,10 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) vnic->rss_hash_key_dma_addr = vnic->rss_table_dma_addr +HW_HASH_INDEX_SIZE *sizeof (*vnic->rss_table); + vnic->mc_list = (void *)((char *)vnic->rss_hash_key + +HW_HASH_KEY_SIZE ); + vnic->mc_list_dma_addr = vnic->rss_hash_key_dma_addr + +HW_HASH_KEY_SIZE ; }return 0 ;
drivers/net/bnxt/bnxt_vnic.h +5 -1
@@ -41,7 +41,7 @@ struct bnxt_vnic_info {STAILQ_ENTRY (bnxt_vnic_info) next;uint8_t ff_pool_idx; -uint16_t fw_vnic_id;/* returned by Chimp during alloc */ +uint32_t fw_vnic_id;/* returned by Chimp during alloc */ uint16_t fw_rss_cos_lb_ctx;uint16_t ctx_is_rss_cos_lb;#define MAX_NUM_TRAFFIC_CLASSES 8
@@ -58,6 +58,10 @@ struct bnxt_vnic_info {uint16_t *rss_table;phys_addr_t rss_hash_key_dma_addr;void *rss_hash_key; +phys_addr_t mc_list_dma_addr; +char *mc_list; +uint32_t mc_addr_cnt; +#define BNXT_MAX_MC_ADDRS 16uint32_t flags;#define BNXT_VNIC_INFO_PROMISC (1 << 0)#define BNXT_VNIC_INFO_ALLMULTI (1 << 1)
Signature · 1 line
2.10.1 (Apple Git-78)
PATCH 28/28 bnxt: update to HWRM version 1.7.4
In reply to Ajit KhapardeThis patch updates the Broadcom bnxt PMD to version 1.7.4 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.
--- drivers/net/bnxt/bnxt_cpr.c | 2 +- drivers/net/bnxt/bnxt_hwrm.c | 10 +- drivers/net/bnxt/bnxt_ring.c | 4 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 5079 +++++++++++++++++--------------- 4 files changed, 2734 insertions(+), 2361 deletions(-)
drivers/net/bnxt/bnxt_cpr.c +1 -1
@@ -138,7 +138,7 @@ int bnxt_alloc_def_cp_ring(struct bnxt *bp)int rc; rc =bnxt_hwrm_ring_alloc (bp, cp_ring, -HWRM_RING_ALLOC_INPUT_RING_TYPE_CMPL , +HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL ,0 ,HWRM_NA_SIGNATURE );if (rc) goto err_out;
drivers/net/bnxt/bnxt_hwrm.c +5 -5
@@ -566,7 +566,7 @@ static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp, struct bnxt_link_info *conf) req.enables =rte_cpu_to_le_32 (enables); }else { req.flags = -rte_cpu_to_le_32 (HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DOWN ); +rte_cpu_to_le_32 (HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN );RTE_LOG (INFO ,PMD ,"Force Link Down\n" ); }
@@ -673,7 +673,7 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp, req.enables =rte_cpu_to_le_32 (rte_le_to_cpu_32 (req.enables) |HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID );break ; -case HWRM_RING_ALLOC_INPUT_RING_TYPE_CMPL : +case HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL : req.ring_type = ring_type;/* * TODO: Some HWRM versions crash with
@@ -694,7 +694,7 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,if (rc ==0 && resp->error_code) rc =rte_le_to_cpu_16 (resp->error_code);switch (ring_type) { -case HWRM_RING_FREE_INPUT_RING_TYPE_CMPL : +case HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL :RTE_LOG (ERR ,PMD ,"hwrm_ring_alloc cp failed. rc:%d\n" , rc);return rc;
@@ -735,7 +735,7 @@ int bnxt_hwrm_ring_free(struct bnxt *bp, rc =rte_le_to_cpu_16 (resp->error_code);switch (ring_type) { -case HWRM_RING_FREE_INPUT_RING_TYPE_CMPL : +case HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL :RTE_LOG (ERR ,PMD ,"hwrm_ring_free cp failed. rc:%d\n" , rc);return rc;
@@ -1318,7 +1318,7 @@ static void bnxt_free_cp_ring(struct bnxt *bp,struct bnxt_ring *cp_ring = cpr->cp_ring_struct;bnxt_hwrm_ring_free (bp, cp_ring, -HWRM_RING_FREE_INPUT_RING_TYPE_CMPL ); +HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL ); cp_ring->fw_ring_id =INVALID_HW_RING_ID ; bp->grp_info[idx].cp_fw_ring_id =INVALID_HW_RING_ID ; memset(cpr->cp_desc_ring, 0, cpr->cp_ring_struct->ring_size *
drivers/net/bnxt/bnxt_ring.c +2 -2
@@ -237,7 +237,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)/* Rx cmpl */ rc =bnxt_hwrm_ring_alloc (bp, cp_ring, -HWRM_RING_ALLOC_INPUT_RING_TYPE_CMPL , +HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL , idx,HWRM_NA_SIGNATURE );if (rc) goto err_out;
@@ -275,7 +275,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)/* Tx cmpl */ rc =bnxt_hwrm_ring_alloc (bp, cp_ring, -HWRM_RING_ALLOC_INPUT_RING_TYPE_CMPL , +HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL , idx,HWRM_NA_SIGNATURE );if (rc) goto err_out;
drivers/net/bnxt/hsi_struct_def_dpdk.h +2726 -2353
2,936 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.10.1 (Apple Git-78)
Part of the diff is not shown here. View the raw message.
Quoted 8 lines · Ajit Khaparde
Apart from adding support for VF-PF/PF-VF communication, new
dev_ops, few bug fixes and improve debug capabilities, this patchset updates the driver to the newer HWRM version 1.7.4New
dev_opssupported:set_mc_addr_list, xstats_get/reset,mac_addr_set,vlan_filter_set,vlan_strip_queue_set,vlan_offload_set, udp_tunnel_port_add/del
Quoted 6 lines
bug fixes:
use only long BDs in Tx path to avoid a potential bug in hardware, fix interrupt handler, set the VMDQ pool size correctlyDerived from an autogenerated file, the last patch updates the HWRM version to 1.7.4
Hi Ajit,
It looks like bnxt also started supporting PMD specific APIs in this patchset. Perhaps we should investigate them if are there common ones with other PMDs and if so move them to ethdev layer instead of PMD specific API.
BTW, There are new PMD features in this patchset, and patchset sent two days before integration deadline.
The process is, new feature patches sent before proposal deadline, which was March 3 for this release, and let patches reviewed and new versions sent until integration deadline. If patches acked before integration deadline, they are integrated.
So this patchset is too late for this release, will be considered for next release.
If you have urgent fixes, please separate them into another patchset, and we can work on them to get into this release, but still it is so close to integration deadline, no promises.
Thanks,
ferruh
Quoted 37 lines
Ajit Khaparde:
[01/28] bnxt: add hwrm_func_cfg_input/output structures [04/28] bnxt: add new HWRM commands
[06/28] bnxt: add new HWRM commands to query VNIC info [09/28] bnxt: add code to support VF QOS configuration [14/28] bnxt: Add support for udp_tunnel_port_add/deldev_ops[15/28] bnxt: Update tx offload capabilities [16/28] bnxt: add support for set VF MAC anti spoof [20/28] bnxt: Add support to set VF rxmode
[23/28] bnxt: Add support for VLAN filter and stripdev_ops[24/28] bnxt: Add support formac_addr_setdev_op[25/28] bnxt: add support for xstats
[26/28] bnxt: use only long BDs in Tx path
[27/28] bnxt: add support forset_mc_addr_listdev_op[28/28] bnxt: update to HWRM version 1.7.4Stephen Hurd:
[02/28] bnxt: add code to support PF, VF configuration [03/28] bnxt: add additonal HWRM debug info to error messages [05/28] bnxt: add support for PF/VF communications [10/28] bnxt: support for VF VLAN filtering
[11/28] bnxt: set the VMDQ pool size correctly [12/28] bnxt: improve some of the log messages [13/28] bnxt: fix interrupt handler
[17/28] bnxt: implement VF VLAN stripq functionality [18/28] bnxt: support lack of huge pages
[19/28] bnxt: add code to configure a default VF VLAN [21/28] bnxt: Add VF stats get/reset functions [22/28] bnxt: Add newlines to allRTE_LOG()format stringsSteeven Li:
[07/28] bnxt: add functions fortx_loopbackandqueues_drop_en[08/28] bnxt: support setting VF mac addressPlease apply.
Quoted 27 lines · Ferruh Yigit
Quoted 8 lines · Ajit Khaparde
Apart from adding support for VF-PF/PF-VF communication, new
dev_ops, few bug fixes and improve debug capabilities, this patchset updates the driver to the newer HWRM version 1.7.4New
dev_opssupported:set_mc_addr_list, xstats_get/reset,mac_addr_set,vlan_filter_set,vlan_strip_queue_set,vlan_offload_set, udp_tunnel_port_add/delQuoted 6 lines
bug fixes:
use only long BDs in Tx path to avoid a potential bug in hardware, fix interrupt handler, set the VMDQ pool size correctlyDerived from an autogenerated file, the last patch updates the HWRM version to 1.7.4
Hi Ajit,
It looks like bnxt also started supporting PMD specific APIs in this patchset. Perhaps we should investigate them if are there common ones with other PMDs and if so move them to ethdev layer instead of PMD specific API.
BTW, There are new PMD features in this patchset, and patchset sent two days before integration deadline.
Quoted 7 lines
The process is, new feature patches sent before proposal deadline, which was March 3 for this release, and let patches reviewed and new versions sent until integration deadline. If patches acked before integration deadline, they are integrated.
So this patchset is too late for this release, will be considered for next release.
For further usage, patchset gives build error for 32bit and shared library builds.
Quoted 7 lines
If you have urgent fixes, please separate them into another patchset, and we can work on them to get into this release, but still it is so close to integration deadline, no promises.
Thanks,
ferruh
Quoted 7 lines
The process is, new feature patches sent before proposal deadline, which was March 3 for this release, and let patches reviewed and new versions sent until integration deadline. If patches acked before integration deadline, they are integrated.
Quoted 7 lines
So this patchset is too late for this release, will be considered for next release.
If you have urgent fixes, please separate them into another patchset, and we can work on them to get into this release, but still it is so close to integration deadline, no promises.
Well, I posted the patches as they got ready. So I understand.
Thanks
Ajit
Re: [PATCH 05/28] bnxt: add support for PF/VF communications
In reply to Ajit KhapardeQuoted 11 lines · Ajit Khaparde
Set up interrupts and default completion ring during device init to allow VF communications.
Request most VF HWRM commands be forwarded to the PF driver. In the future, this should be configurable.
Fix reporting of active VFs.
Add a log message when a completion is ignored on the default completion ring since this will indicate support that needs to be added.
Quoted 7 lines
Do not initialize the default completion ring in
bnxt_alloc_hwrm_rings(), but move it out tobnxt_dev_init().Create a structure
bnxt_child_vf_infofor PF to cache VF specific info.Signed-off-by Stephen Hurd <[email protected]>Signed-off-by Ajit Khaparde <[email protected]>
Hi Ajit, Stephen,
This patch doesn't cleanly apply on top of latest next-net, can you please rebase the patchset?
Also as reminder, there was previously reported 32bit and shared library builds.
And there are some checkpatch warnings in patch 25 and 28.
Thanks,
ferruh
Re: [PATCH 05/28] bnxt: add support for PF/VF communications
Quoted 17 lines · Ferruh Yigit
Quoted 16 lines · Ajit Khaparde
Set up interrupts and default completion ring during device init to allow VF communications.
Request most VF HWRM commands be forwarded to the PF driver. In the future, this should be configurable.
Fix reporting of active VFs.
Add a log message when a completion is ignored on the default completion ring since this will indicate support that needs to be added.
Do not initialize the default completion ring in
bnxt_alloc_hwrm_rings(), but move it out tobnxt_dev_init().Create a structure
bnxt_child_vf_infofor PF to cache VF specific info.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Stephen Hurd <[email protected]>Signed-off-by Ajit Khaparde <[email protected]>Hi Ajit, Stephen,
This patch doesn't cleanly apply on top of latest next-net, can you please rebase the patchset?
Yes, Ferruh. I
am working on that.
Quoted 8 lines
Also as reminder, there was previously reported 32bit and shared library builds.
And there are some checkpatch
warnings in patch 25 and 28.
And these as well.
Quoted 4 lines
Thanks,
ferruh