summaryrefslogtreecommitdiff
path: root/drivers/net/bnxt/bnxt_rxr.c
AgeCommit message (Collapse)Author
2019-11-20net/bnxt: fix IP checksum error indicationKalesh AP
Update "mbuf->ol_flags" correctly for 'Checksum Unknown' errors for both tunneled and non-tunneled IP packets. Fixes: b875339622a3 ("net/bnxt: fix L4 checksum indication in non-vector Rx") Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2019-11-08net/bnxt: fix L4 checksum indication in non-vector RxKalesh AP
Update "mbuf->ol_flags" correctly for inner and ourter ip checksum errors in case of tunnel and non-tunnel packets. Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags") Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-10-25net/bnxt: add more checks during firmware resetKalesh AP
Added check for fw reset or fw errors in few more routines. While processing the events, if it is fw fatal or non-fatal event, there is no need to process the remaining events as driver triggers recovery mechanism. Also added a check for fw reset or fatal error in bnxt_disable_int() to avoid bar access in case of fatal error. Fixes: be14720def9c ("net/bnxt: support FW reset") Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-10-23net/bnxt: fix dereference before null checkKalesh AP
This patch fixes potential null pointer access in bnxt_alloc_ag_data(). Fix to return an error if null check is true. Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-10-23net/bnxt: remove redundant header file inclusionKalesh AP
bnxt.h header includes bnxt_cpr.h and bnxt_util.h. There is no need to include these headers file explicitly. This commit does not cause any functional change. Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-10-08net/bnxt: use common NQ ringLance Richardson
Thor queue scaling is currently limited by the number of NQs that can be allocated. Fix by using a common NQ for all receive/transmit rings instead of allocating a separate NQ for each ring. Fixes: f8168ca0e690 ("net/bnxt: support thor controller") Cc: stable@dpdk.org Signed-off-by: Lance Richardson <lance.richardson@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2019-10-08net/bnxt: support LRO on Thor adaptersLance Richardson
Add support for LRO for adapters based on Thor (BCM57508). Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-10-08net/bnxt: fix Rx queue start/stopKalesh AP
Driver should not change "deferred_start" state of the rx queues. It should get the state in queue_setup_op() and use that value. Since the deferred start state was being used in the packet receive functions to determine whether a stopped rx ring should be polled, introduced a per-rxq flag to track queue stopped/started state. Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop") Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-10-08net/bnxt: fix forwarding with higher mbuf sizeSantoshkumar Karanappa Rastapur
Maximum frame length supported by hw is 9600 bytes. When user launches testpmd with --mbuf-size=9729, we are posting buffer descriptors of size 9601 to the ring. This was causing packets getting discarded. Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: stable@dpdk.org Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2019-10-08net/bnxt: support PTP for ThorKalesh AP
On Thor, direct access to PTP registers (via GRC) is not supported. Driver must use HWRM to access the timestamp information. Vectorized Rx/Tx cannot be enabled if RTE_LIBRTE_IEEE1588=y. Remove the PTP flags handling code from the vector Rx path. Add support to read tx timestamp value and the time from the timesync clock. On Thor, Rx timestamps are provided directly in the Rx completion records to the driver. Only 32 bits of the timestamp is present in the completion. Driver needs to read the current 48 bit free running timer using the HWRM_PORT_TS_QUERY command and combine the upper 16 bits from the HWRM response with the lower 32 bits in the Rx completion to produce the 48 bit timestamp for the Rx packet. Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-10-08net/bnxt: prevent device access when device is in resetKalesh AP
Refactor init and uninit functions so that the driver can fail the eth_dev_ops callbacks and accessing Tx and Rx queues when device is in reset or in error state. Transmit and receive queues are freed during reset cleanup and reallocated during recovery. So we block all data path handling in this state. The eth_dev dev_started field is updated depending on the status of the device. Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2019-07-25net/bnxt: use dedicated CPR for async eventsLance Richardson
This commit enables the creation of a dedicated completion ring for asynchronous event handling instead of handling these events on a receive completion ring. For the stingray platform and other platforms needing tighter control of resource utilization, we retain the ability to process async events on a receive completion ring. For Thor-based adapters, we use a dedicated NQ (notification queue) ring for async events (async events can't currently be received on a completion ring due to a firmware limitation). Rename "def_cp_ring" to "async_cp_ring" to better reflect its purpose (async event notifications) and to avoid confusion with VNIC default receive completion rings. Allow rxq 0 to be stopped when not being used for async events. Signed-off-by: Lance Richardson <lance.richardson@broadcom.com> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-07-23net/bnxt: fix L4 checksum error indication in RxRahul Gupta
Update ol_flags correctly for checksum errors in case of tunnel and non-tunnel packet. Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags") Cc: stable@dpdk.org Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13net/bnxt: support thor controllerLance Richardson
This commit adds support to the bnxt PMD for devices based on the BCM57508 "thor" Ethernet controller. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
2019-06-13net/bnxt: refactor doorbell handlingLance Richardson
Reduce code duplication and prepare for newer controllers that use different doorbell protocols by refactoring doorbell handling code. Signed-off-by: Lance Richardson <lance.richardson@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-05-24net: add rte prefix to ether definesOlivier Matz
Add 'RTE_' prefix to defines: - rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN. - rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN. - rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN. - rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN. - rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN. - rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN. - rename ETHER_MTU as RTE_ETHER_MTU. - rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN. - rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID. - rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN. - rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU. - rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR. - rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR. - rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4. - rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6. - rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP. - rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN. - rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP. - rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ. - rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG. - rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588. - rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW. - rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB. - rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP. - rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS. - rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM. - rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN. - rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE. - rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4. - rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6. - rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH. - rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH. - rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS. - rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP. - rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG. - rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-03-29net/bnxt: fix Rx VLAN offload flagsStephen Hemminger
The bnxt driver is not correctly setting the receive VLAN offload flags. When VLAN is offloaded the driver must set the PKT_RX_VLAN_STRIPPED flag. Actually, several drivers have the same bug, only most of the Intel drivers look right. Any driver that sets vlan_tci is probably stripping the tag, and should be setting RX_VLAN_STRIPPED. To quote rte_mbuf.h: /** * The RX packet is a 802.1q VLAN packet, and the tci has been * saved in in mbuf->vlan_tci. * If the flag PKT_RX_VLAN_STRIPPED is also present, the VLAN * header has been stripped from mbuf data, else it is still * present. */ Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-11-05net/bnxt: fix uninitialized variable accessFerruh Yigit
ag_cons is used uninitialized, it is used when DEBUG enabled, remove debug code. Fixes: 0958d8b6435d ("net/bnxt: support LRO") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-07-03net/bnxt: fix queue start/stop operationsAjit Khaparde
Packets destined to the to-be-stopped queue should not be dropped (neither in HW nor in the driver), so re-program the RSS Table without this queue on stop and add it back to the table on start unless it is a Representor VF. Since 0th entry is used for default ring, use fw_grp_id + 1 to change the RSS table population logic by programming valid IDs instead of the default zeroth entry in case of an invalid fw_grp_id. Destroy and recreate the trio of Rx rings(compl, Rx, AG) every time in start so that HW is in sync with software. Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-07-03net/bnxt: optimize Rx processingAjit Khaparde
1) Use nb_rx_pkts instead of checking producer indices of Rx and aggregator rings to decide if any Rx completions were processed. 2) Post Rx buffers early in Rx processing instead of waiting for the budgeted burst quota. 3) Ring Rx CQ DB after Rx buffers are posted. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-05-23net/bnxt: fix Rx checksum flagsAjit Khaparde
For frames where the hardware is not able to calculate checksum we are indicating such frames to be bad. And that is incorrect. Indicate PKT_RX_IP_CKSUM_UNKNOWN or PKT_RX_L4_CKSUM_UNKNOWN for such frames. Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-05-23net/bnxt: use first completion ring for fwd and async eventAjit Khaparde
In order to save completion resource, use the first completion ring from PF or VF as the default completion ring for async event & HWRM forward response handling. Add bnxt_hwrm_set_async_event_cr() to set async_event_cr for either PF or VF. Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification") Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-05-14net/bnxt: update HWRM to version 1.9.2Ajit Khaparde
Update HWRM structures to version 1.9.2 Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27net/bnxt: fix mbuf data offset initializationAjit Khaparde
Initialize mbuf->data_off to RTE_PKTMBUF_HEADROOM after allocation. Without this, it might be possible that the DMA address provided to the HW may not be in sync to what is indicated to the application in bnxt_rx_pkt. Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27net/bnxt: maintain mbuf alloc failure counter per queueAjit Khaparde
Currently we have a single counter for mbuf alloc failure. Make it per RxQ instead. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27net/bnxt: set padding flags in Rx descriptorAjit Khaparde
Set the RX_PROD_PKT_BD_FLAGS_EOP_PAD in Rx buffer descriptors. Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-14net/bnxt: convert to SPDX license tagScott Branden
Update the license header on bnxt files to be the standard BSD-3-Clause license used for the rest of DPDK, bring the files in compliance with the DPDK licensing policy. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-02-08net/bnxt: fix packet typeOlivier Matz
The hw flags are not read correctly: the defines RX_PKT_CMPL_FLAGS_ITYPE_* are not bits but values, so the should not be tested with if (value & X) but with if ((value & MASK) == X). This was resulting in a wrong packet type. For instance, an IPv4/ICMP packet was returning a value of 7 for the layer 4, which is undefined. This patch rework the way packet types are processed, to ensure that only valid packet types will be advertised. Fixes: 3d2a6644eb05 ("net/bnxt: support getting ptypes") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-02-08net/bnxt: fix Rx checksum flagsOlivier Matz
Fix the Rx offload flags when the IP or L4 checksum is seen as incorrect by the hardware. In this case, the proper value is PKT_RX_IP_CKSUM_BAD. PKT_RX_IP_CKSUM_NONE means that the checksum may be incorrect in the packet headers, but the integrity of the IP header is verified. This is mostly useful for virtual drivers. Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-02-06net/bnxt: fix missing timestamp flag in mbufSomnath Kotur
The timestamp flag needs to be set in the offload flags for the received pkt in case of PTP offload. Fixes: b11cceb83a34 ("net/bnxt: support timesync") Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
2018-01-29net/bnxt: support Rx/Tx queue start/stopAjit Khaparde
Currently this is implemented entirely in the PMD as there is no explicit support in the HW. Re-program the RSS Table without this queue on stop and add it back to the table on start. Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29net/bnxt: use dynamic log typeAjit Khaparde
This patch implements driver specific log type doing away with usage of RTE_LOG() for logging. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-16net/bnxt: fix headroom initializationOlivier Matz
When allocating a new mbuf for Rx, the value of m->data_off should not be reset to its default value (RTE_PKTMBUF_HEADROOM), instead of reusing the previous undefined value, which could cause the packet to have a too small or too high headroom. Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-16net/bnxt: use new API to get IOVA addressOlivier Matz
Replace internal functions to get DMA address them with their generic IOVA version. Also rename the 'data' variable to 'mbuf' for more readability. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-16net/bnxt: support timesyncSomnath Kotur
Implemented the 'time_sync' related APIs for supporting the PTP protocol. Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26mbuf: rename deprecated VLAN flagsOlivier Matz
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while. As explained in [1], these flags were kept to let the applications and PMDs move to the new flag. There is also a need to support Rx vlan offload without vlan strip (at least for the ixgbe driver). This patch renames the old flags for this feature, knowing that some PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that the vlan tci has been saved in the mbuf structure. It is likely that some PMDs do not set the proper flags when doing vlan offload, and it would be worth making a pass on all of them. Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26net/bnxt: fix a pointer deref before null checkAjit Khaparde
Coverity issue: 158634 Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26net/bnxt: update HWRM to 1.8.2Ajit Khaparde
This patch updates the HWRM API to version 1.8.2 Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06net/bnxt: support getting ptypesAjit Khaparde
This patch adds support for dev_supported_ptypes_get Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06net/bnxt: support Rx queue countAjit Khaparde
add support for rx_queue_count dev_op Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06net/bnxt: update status of Rx IP/L4 CKSUMAjit Khaparde
update ol_flags with the appropriate status of IP/L4 cksum in Rx path. Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06net/bnxt: fix Rx handling and buffer allocation logicAjit Khaparde
Even when rx buffer allocation fails, we are wrongly updating the producer index. This patch fixes that. Also in case of a buffer allocation failure, reattempt buffer allocation before the rx handler exits. Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12net/bnxt: refactor the query statsAjit Khaparde
1) Use hwrm_stat_ctx_query command to query statistics Using hwrm_stat_ctx_query command will allow polling the statistics from hardware instead of using the current push model from the hardware which does a DMA of the stats to the host at fixed intervals. 2) Use the rx_mbuf_alloc_fail to track mbuf alloc failures. 3) We were wrongly incrementing hwrm_cmd_seq in bnxt_hwrm_stat_clear and bnxt_hwrm_stat_ctx_alloc functions. This patch fixes that. Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12net/bnxt: support LROAjit Khaparde
This patch adds support to enable and disable LRO To support this feature, the driver creates an aggregator ring. When the hardware starts doing LRO, it sends a tpa_start completion. When the driver receives a tpa_end completion, it indicates that the LRO chaining is complete. Signed-off-by: Steeven Li <steeven.li@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12net/bnxt: support set MTUAjit Khaparde
This patch adds support to modify MTU using the set_mtu dev_op. To support frames > 2k, the PMD creates an aggregator ring. When a frame greater than 2k is received, it is fragmented and the resulting fragments are DMA'ed to the aggregator ring. Now the driver can support jumbo frames upto 9500 bytes. Signed-off-by: Steeven Li <steeven.li@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2016-06-20net/bnxt: allocate Rx/Tx and completion ringsAjit Khaparde
Perform allocation and free()ing of ring and information structures for the TX, RX, and completion rings. The previous patches had so far provided top level stubs and generic ring support, while this patch does the real allocation and freeing of the memory specific to each different type of generic ring. For example bnxt_init_tx_ring_struct() or bnxt_init_rx_ring_struct() is now allocating memory based on the socked_id being provided. bnxt_tx_queue_setup_op() or bnxt_rx_queue_setup_op() have gone through some reformatting to perform a graceful cleanup in case memory allocation fails. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com> Reviewed-by: David Christensen <david.christensen@broadcom.com>
2016-06-20net/bnxt: add initial Rx codeAjit Khaparde
This patch adds initial implementation of rx_pkt_burst() function for Rx. bnxt_recv_pkts() is the top level function for doing Rx. This patch also adds code to allocate rings in the ASIC. For each Rx queue allocated in the PMD driver, a corresponding ring in hardware will be created. Every time a frame is received a Rx ring is selected based on the hardware configuration like RSS, MAC or VLAN, COS and such. The hardware uses a completion ring to indicate the availability of a packet. This patch also brings in functions like bnxt_init_one_rx_ring() bnxt_init_rx_ring_struct() which initializes various structures before a Rx can begin. bnxt_init_rxbds() initializes the Rx Buffer Descriptors while bnxt_alloc_rx_data() allocates a buffer in the host to receive the incoming packet. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com> Reviewed-by: David Christensen <david.christensen@broadcom.com>