OpenCloudOS-Kernel/drivers/thirdparty/bnxt/ChangeLog

22468 lines
927 KiB
Plaintext
Raw Permalink Normal View History

commit 1eb4ef12591348c440ac9d6efcf7521e73cf2b10
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Wed Jun 7 00:54:09 2023 -0700
bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks
As per the new udp tunnel framework, drivers which need to know the
details of a port entry (i.e. port type) when it gets deleted should
use the .set_port / .unset_port callbacks.
Implementing the current .udp_tunnel_sync callback would mean that the
deleted tunnel port entry would be all zeros. This used to work on
older firmware because it would not check the input when deleting a
tunnel port. With newer firmware, the delete will now fail and
subsequent tunnel port allocation will fail as a result.
Fixes: 442a35a5a7aa ("bnxt: convert to new udp_tunnel_nic infra")
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 319a7827df9784048abe072afe6b4fb4501d8de4
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Wed Jun 7 00:54:08 2023 -0700
bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event
The firmware can send PHC_RTC_UPDATE async event on a PF that may not
have PTP registered. In such a case, there will be a null pointer
deference for bp->ptp_cfg when we try to handle the event.
Fix it by not registering for this event with the firmware if !bp->ptp_cfg.
Also, check that bp->ptp_cfg is valid before proceeding when we receive
the event.
Fixes: 8bcf6f04d4a5 ("bnxt_en: Handle async event when the PHC is updated in RTC mode")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 83474a9b252ab23e6003865c2775024344cb9c09
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Wed Jun 7 00:54:07 2023 -0700
bnxt_en: Skip firmware fatal error recovery if chip is not accessible
Driver starts firmware fatal error recovery by detecting
heartbeat failure or fw reset count register changing. But
these checks are not reliable if the device is not accessible.
This can happen while DPC (Downstream Port containment) is in
progress. Skip firmware fatal recovery if pci_device_is_present()
returns false.
Fixes: acfb50e4e773 ("bnxt_en: Add FW fatal devlink_health_reporter.")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 1a9e4f501bc6ff1b6ecb60df54fbf2b54db43bfe
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Wed Jun 7 00:54:06 2023 -0700
bnxt_en: Query default VLAN before VNIC setup on a VF
We need to call bnxt_hwrm_func_qcfg() on a VF to query the default
VLAN that may be setup by the PF. If a default VLAN is enabled,
the VF cannot support VLAN acceleration on the receive side and
the VNIC must be setup to strip out the default VLAN tag. If a
default VLAN is not enabled, the VF can support VLAN acceleration
on the receive side. The VNIC should be set up to strip or not
strip the VLAN based on the RX VLAN acceleration setting.
Without this call to determine the default VLAN before calling
bnxt_setup_vnic(), the VNIC may not be set up correctly. For
example, bnxt_setup_vnic() may set up to strip the VLAN tag based
on stale default VLAN information. If RX VLAN acceleration is
not enabled, the VLAN tag will be incorrectly stripped and the
RX data path will not work correctly.
Fixes: cf6645f8ebc6 ("bnxt_en: Add function for VF driver to query default VLAN.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 1d997801c7cc6a7f542e46d5a6bf16f893ad3fe9
Author: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Date: Wed Jun 7 00:54:05 2023 -0700
bnxt_en: Don't issue AP reset during ethtool's reset operation
Only older NIC controller's firmware uses the PROC AP reset type.
Firmware on 5731X/5741X and newer chips does not support this reset
type. When bnxt_reset() issues a series of resets, this PROC AP
reset may actually fail on these newer chips because the firmware
is not ready to accept this unsupported command yet. Avoid this
unnecessary error by skipping this reset type on chips that don't
support it.
Fixes: 7a13240e3718 ("bnxt_en: fix ethtool_reset_flags ABI violations")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 095d5dc0c1d9f3284e3c575ccf4c0e8b04b548f8
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Wed Jun 7 00:54:04 2023 -0700
bnxt_en: Fix bnxt_hwrm_update_rss_hash_cfg()
We must specify the vnic id of the vnic in the input structure of this
firmware message. Otherwise we will get an error from the firmware.
Fixes: 98a4322b70e8 ("bnxt_en: update RSS config using difference algorithm")
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 649c3fed36730a53447d8f479c14e431363563b6
Author: Jakub Kicinski <kuba@kernel.org>
Date: Tue Jun 6 18:08:25 2023 -0700
eth: bnxt: fix the wake condition
The down condition should be the negation of the wake condition,
IOW when I moved it from:
if (cond && wake())
to
if (__netif_txq_completed_wake(cond))
Cond should have been negated. Flip it now.
This bug leads to occasional crashes with netconsole.
It may also lead to queue never waking up in case BQL is not enabled.
Reported-by: David Wei <davidhwei@meta.com>
Fixes: 08a096780d92 ("bnxt: use new queue try_stop/try_wake macros")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20230607010826.960226-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 278fda0d52f67244044384abd7dd5b3a5b3a5604
Author: Yunsheng Lin <linyunsheng@huawei.com>
Date: Thu May 11 09:12:13 2023 +0800
net: remove __skb_frag_set_page()
The remaining users calling __skb_frag_set_page() with
page being NULL seems to be doing defensive programming,
as shinfo->nr_frags is already decremented, so remove
them.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b51f4113ebb02011f0ca86abc3134b28d2071b6a
Author: Yunsheng Lin <linyunsheng@huawei.com>
Date: Thu May 11 09:12:12 2023 +0800
net: introduce and use skb_frag_fill_page_desc()
Most users use __skb_frag_set_page()/skb_frag_off_set()/
skb_frag_size_set() to fill the page desc for a skb frag.
Introduce skb_frag_fill_page_desc() to do that.
net/bpf/test_run.c does not call skb_frag_off_set() to
set the offset, "copy_from_user(page_address(page), ...)"
and 'shinfo' being part of the 'data' kzalloced in
bpf_test_init() suggest that it is assuming offset to be
initialized as zero, so call skb_frag_fill_page_desc()
with offset being zero for this case.
Also, skb_frag_set_page() is not used anymore, so remove
it.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8c154d272c3e03b100baaf1df473f22a78fa403e
Author: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Date: Tue Apr 18 13:25:11 2023 -0700
bnxt_en: fix free-runnig PHC mode
The patch in fixes changed the way real-time mode is chosen for PHC on
the NIC. Apparently there is one more use case of the check outside of
ptp part of the driver which was not converted to the new macro and is
making a lot of noise in free-running mode.
Fixes: 131db4991622 ("bnxt_en: reset PHC frequency in free-running mode")
Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://lore.kernel.org/r/20230418202511.1544735-1-vadfed@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 4f4e54b1041e60694117893cd986831153a3e719
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Sun Apr 16 23:58:19 2023 -0700
bnxt_en: Fix a possible NULL pointer dereference in unload path
In the driver unload path, the driver currently checks the valid
BNXT_FLAG_ROCE_CAP flag in bnxt_rdma_aux_device_uninit() before
proceeding. This is flawed because the flag may not be set initially
during driver load. It may be set later after the NVRAM setting is
changed followed by a firmware reset. Relying on the
BNXT_FLAG_ROCE_CAP flag may crash in bnxt_rdma_aux_device_uninit() if
the aux device was never initialized:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
PGD 8ae6aa067 P4D 0
Oops: 0000 [#1] SMP NOPTI
CPU: 39 PID: 42558 Comm: rmmod Kdump: loaded Tainted: G OE --------- - - 4.18.0-348.el8.x86_64 #1
Hardware name: Dell Inc. PowerEdge R750/0WT8Y6, BIOS 1.5.4 12/17/2021
RIP: 0010:device_del+0x1b/0x410
Code: 89 a5 50 03 00 00 4c 89 a5 58 03 00 00 eb 89 0f 1f 44 00 00 41 56 41 55 41 54 4c 8d a7 80 00 00 00 55 53 48 89 fb 48 83 ec 18 <48> 8b 2f 4c 89 e7 65 48 8b 04 25 28 00 00 00 48 89 44 24 10 31 c0
RSP: 0018:ff7f82bf469a7dc8 EFLAGS: 00010292
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000206 RDI: 0000000000000000
RBP: ff31b7cd114b0ac0 R08: 0000000000000000 R09: ffffffff935c3400
R10: ff31b7cd45bc3440 R11: 0000000000000001 R12: 0000000000000080
R13: ffffffffc1069f40 R14: 0000000000000000 R15: 0000000000000000
FS: 00007fc9903ce740(0000) GS:ff31b7d4ffac0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000992fee004 CR4: 0000000000773ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
bnxt_rdma_aux_device_uninit+0x1f/0x30 [bnxt_en]
bnxt_remove_one+0x2f/0x1f0 [bnxt_en]
pci_device_remove+0x3b/0xc0
device_release_driver_internal+0x103/0x1f0
driver_detach+0x54/0x88
bus_remove_driver+0x77/0xc9
pci_unregister_driver+0x2d/0xb0
bnxt_exit+0x16/0x2c [bnxt_en]
__x64_sys_delete_module+0x139/0x280
do_syscall_64+0x5b/0x1a0
entry_SYSCALL_64_after_hwframe+0x65/0xca
RIP: 0033:0x7fc98f3af71b
Fix this by modifying the check inside bnxt_rdma_aux_device_uninit()
to check for bp->aux_priv instead. We also need to make some changes
in bnxt_rdma_aux_device_init() to make sure that bp->aux_priv is set
only when the aux device is fully initialized.
Fixes: d80d88b0dfff ("bnxt_en: Add auxiliary driver support")
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 294e39e0d03449f32b0723d3fd99ab5c23881c05
Author: Jakub Kicinski <kuba@kernel.org>
Date: Wed Apr 12 21:26:05 2023 -0700
bnxt: hook NAPIs to page pools
bnxt has 1:1 mapping of page pools and NAPIs, so it's safe
to hoook them up together.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Tested-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 36647b206c014a0bf3ab17bc88f2c840eefd796c
Author: Jakub Kicinski <kuba@kernel.org>
Date: Tue Apr 11 18:50:37 2023 -0700
bnxt: use READ_ONCE/WRITE_ONCE for ring indexes
Eric points out that we should make sure that ring index updates
are wrapped in the appropriate READ_ONCE/WRITE_ONCE macros.
Suggested-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit f032d8a9c8b353806366cb3786512b80f478efab
Author: Ivan Vecera <ivecera@redhat.com>
Date: Tue Apr 11 14:04:42 2023 +0200
bnxt_en: Allow to set switchdev mode without existing VFs
Remove an inability of bnxt_en driver to set eswitch to switchdev
mode without existing VFs by:
1. Allow to set switchdev mode in bnxt_dl_eswitch_mode_set() so
representors are created only when num_vfs > 0 otherwise just
set bp->eswitch_mode
2. Do not automatically change bp->eswitch_mode during
bnxt_vf_reps_create() and bnxt_vf_reps_destroy() calls so
the eswitch mode is managed only by an user by devlink.
Just set temporarily bp->eswitch_mode to legacy to avoid
re-opening of representors during destroy.
3. Create representors in bnxt_sriov_enable() if current eswitch
mode is switchdev one
Tested by this sequence:
1. Set PF interface up
2. Set PF's eswitch mode to switchdev
3. Created N VFs
4. Checked that N representors were created
5. Set eswitch mode to legacy
6. Checked that representors were deleted
7. Set eswitch mode back to switchdev
8. Checked that representors exist again for VFs
9. Deleted all VFs
10. Checked that all representors were deleted as well
11. Checked that current eswitch mode is still switchdev
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Acked-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Link: https://lore.kernel.org/r/20230411120443.126055-1-ivecera@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 301f227fc860624d37ba5dae9da57dcf371268db
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Apr 6 18:25:36 2023 -0700
net: piggy back on the memory barrier in bql when waking queues
Drivers call netdev_tx_completed_queue() right before
netif_txq_maybe_wake(). If BQL is enabled netdev_tx_completed_queue()
should issue a memory barrier, so we can depend on that separating
the stop check from the consumer index update, instead of adding
another barrier in netif_txq_maybe_wake().
This matters more than the barriers on the xmit path, because
the wake condition is almost always true. So we issue the
consumer side barrier often.
Wrap netdev_tx_completed_queue() in a local helper to issue
the barrier even if BQL is disabled. Keep the same semantics
as netdev_tx_completed_queue() (barrier only if bytes != 0)
to make it clear that the barrier is conditional.
Plus since macro gets pkt/byte counts as arguments now -
we can skip waking if there were no packets completed.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 08a096780d9239e69909c48f4b1fcd99c860b2ef
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Apr 6 18:25:35 2023 -0700
bnxt: use new queue try_stop/try_wake macros
Convert bnxt to use new macros rather than open code the logic.
Two differences:
(1) bnxt_tx_int() will now only issue a memory barrier if it sees
enough space on the ring to wake the queue. This should be fine,
the mb() is between the writes to the ring pointers and checking
queue state.
(2) we'll start the queue instead of waking on race, this should
be safe inside the xmit handler.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a9a457f338e7711af391f618b60d8a4b15ba8050
Author: Selvin Xavier <selvin.xavier@broadcom.com>
Date: Thu Mar 30 02:45:34 2023 -0700
RDMA/bnxt_re: Update HW interface headers
Updating the HW structures to the latest version.
This is copied from the code maintained internally. No functionality
changes in this patch. Code is re-organized to match the file maintained
in the internal tree. Also, New HW interface structures are added, which
will be used by the drivers in future.
CC: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://lore.kernel.org/r/1680169540-10029-2-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
commit 581bce7bcb7e7f100908728e7b292e266c76895b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Mar 28 18:30:21 2023 -0700
bnxt_en: Add missing 200G link speed reporting
bnxt_fw_to_ethtool_speed() is missing the case statement for 200G
link speed reported by firmware. As a result, ethtool will report
unknown speed when the firmware reports 200G link speed.
Fixes: 532262ba3b84 ("bnxt_en: ethtool: support PAM4 link speeds up to 200G")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 62aad36ed31abc80f35db11e187e690448a79f7d
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Tue Mar 28 18:30:20 2023 -0700
bnxt_en: Fix typo in PCI id to device description string mapping
Fix 57502 and 57508 NPAR description string entries. The typos
caused these devices to not match up with lspci output.
Fixes: 49c98421e6ab ("bnxt_en: Add PCI IDs for 57500 series NPAR devices.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 83714dc3db0e4a088673601bc8099b079bc1a077
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Tue Mar 28 18:30:19 2023 -0700
bnxt_en: Fix reporting of test result in ethtool selftest
When the selftest command fails, driver is not reporting the failure
by updating the "test->flags" when bnxt_close_nic() fails.
Fixes: eb51365846bc ("bnxt_en: Add basic ethtool -t selftest support.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a02c33130709736f5a770a55e5bfeda871a8c1cc
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Tue Mar 21 07:44:49 2023 -0700
bnxt: Enforce PTP software freq adjustments only when in non-RTC mode
Currently driver performs software based frequency adjustments
when RTC capability is not discovered or when in shared PHC mode.
But there may be some old firmware versions that still support
hardware freq adjustments without RTC capability being exposed.
In this situation driver will use non-realtime mode even on single
host NICs.
Hence enforce software frequency adjustments only when running in
shared PHC mode. Make suitable changes for cyclecounter for the
same.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit edc5287315489ccc6d049efe46227cedc9ede673
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Tue Mar 21 07:44:48 2023 -0700
bnxt: Defer PTP initialization to after querying function caps
Driver uses the flag BNXT_FLAG_MULTI_HOST to determine whether
to use non-realtime mode PHC when running on a multi host NIC.
However when ptp initializes on a NIC with shared PHC, we still
don't have this flag set yet because HWRM_FUNC_QCFG is issued
much later.
Move the ptp initialization code after we have issued func_qcfg.
The next patch will use the BNXT_FLAG_MULTI_HOST flag during PTP
initialization.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a3a4e300439bde3517edd61d982d747000a9f212
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Tue Mar 21 07:44:47 2023 -0700
bnxt: Change fw_cap to u64 to accommodate more capability bits
The current fw_cap field (u32) has run out of bits to save any
new capability.
Change the field to u64.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 7c6dddc239abe660598c49ec95ea0ed6399a4b2a
Author: Maxim Korotkov <korotkov.maxim.s@gmail.com>
Date: Thu Mar 9 20:43:47 2023 +0300
bnxt: avoid overflow in bnxt_get_nvram_directory()
The value of an arithmetic expression is subject
of possible overflow due to a failure to cast operands to a larger data
type before performing arithmetic. Used macro for multiplication instead
operator for avoiding overflow.
Found by Security Code and Linux Verification
Center (linuxtesting.org) with SVACE.
Signed-off-by: Maxim Korotkov <korotkov.maxim.s@gmail.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://lore.kernel.org/r/20230309174347.3515-1-korotkov.maxim.s@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 131db499162274858bdbd7b5323a639da4aab86c
Author: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Date: Fri Mar 10 07:13:56 2023 -0800
bnxt_en: reset PHC frequency in free-running mode
When using a PHC in shared between multiple hosts, the previous
frequency value may not be reset and could lead to host being unable to
compensate the offset with timecounter adjustments. To avoid such state
reset the hardware frequency of PHC to zero on init. Some refactoring is
needed to make code readable.
Fixes: 85036aee1938 ("bnxt_en: Add a non-real time mode to access NIC clock")
Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://lore.kernel.org/r/20230310151356.678059-1-vadfed@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 5f29b73d4eba2926ab99d7bf5f2028810af3c66c
Author: Bjorn Helgaas <bhelgaas@google.com>
Date: Tue Mar 7 12:19:16 2023 -0600
bnxt: Drop redundant pci_enable_pcie_error_reporting()
pci_enable_pcie_error_reporting() enables the device to send ERR_*
Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is
native"), the PCI core does this for all devices during enumeration.
Remove the redundant pci_enable_pcie_error_reporting() call from the
driver. Also remove the corresponding pci_disable_pcie_error_reporting()
from the driver .remove() path.
Note that this only controls ERR_* Messages from the device. An ERR_*
Message may cause the Root Port to generate an interrupt, depending on the
AER Root Error Command register managed by the AER service driver.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 89b59a84cb166f1ab5b6de9830e61324937c661e
Author: Selvin Xavier <selvin.xavier@broadcom.com>
Date: Fri Mar 3 18:43:58 2023 -0800
bnxt_en: Fix the double free during device removal
Following warning reported by KASAN during driver unload
==================================================================
BUG: KASAN: double-free in bnxt_remove_one+0x103/0x200 [bnxt_en]
Free of addr ffff88814e8dd4c0 by task rmmod/17469
CPU: 47 PID: 17469 Comm: rmmod Kdump: loaded Tainted: G S 6.2.0-rc7+ #2
Hardware name: Dell Inc. PowerEdge R740/01YM03, BIOS 2.3.10 08/15/2019
Call Trace:
<TASK>
dump_stack_lvl+0x33/0x46
print_report+0x17b/0x4b3
? __call_rcu_common.constprop.79+0x27e/0x8c0
? __pfx_free_object_rcu+0x10/0x10
? __virt_addr_valid+0xe3/0x160
? bnxt_remove_one+0x103/0x200 [bnxt_en]
kasan_report_invalid_free+0x64/0xd0
? bnxt_remove_one+0x103/0x200 [bnxt_en]
? bnxt_remove_one+0x103/0x200 [bnxt_en]
__kasan_slab_free+0x179/0x1c0
? bnxt_remove_one+0x103/0x200 [bnxt_en]
__kmem_cache_free+0x194/0x350
bnxt_remove_one+0x103/0x200 [bnxt_en]
pci_device_remove+0x62/0x110
device_release_driver_internal+0xf6/0x1c0
driver_detach+0x76/0xe0
bus_remove_driver+0x89/0x160
pci_unregister_driver+0x26/0x110
? strncpy_from_user+0x188/0x1c0
bnxt_exit+0xc/0x24 [bnxt_en]
__x64_sys_delete_module+0x21f/0x390
? __pfx___x64_sys_delete_module+0x10/0x10
? __pfx_mem_cgroup_handle_over_high+0x10/0x10
? _raw_spin_lock+0x87/0xe0
? __pfx__raw_spin_lock+0x10/0x10
? __audit_syscall_entry+0x185/0x210
? ktime_get_coarse_real_ts64+0x51/0x80
? syscall_trace_enter.isra.18+0x126/0x1a0
do_syscall_64+0x37/0x90
entry_SYSCALL_64_after_hwframe+0x72/0xdc
RIP: 0033:0x7effcb6fd71b
Code: 73 01 c3 48 8b 0d 6d 17 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3d 17 2c 00 f7 d8 64 89 01 48
RSP: 002b:00007ffeada270b8 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
RAX: ffffffffffffffda RBX: 00005623660e0750 RCX: 00007effcb6fd71b
RDX: 000000000000000a RSI: 0000000000000800 RDI: 00005623660e07b8
RBP: 0000000000000000 R08: 00007ffeada26031 R09: 0000000000000000
R10: 00007effcb771280 R11: 0000000000000206 R12: 00007ffeada272e0
R13: 00007ffeada28bc4 R14: 00005623660e02a0 R15: 00005623660e0750
</TASK>
Auxiliary device structures are freed in bnxt_aux_dev_release. So avoid
calling kfree from bnxt_remove_one.
Also, set bp->edev to NULL before freeing the auxilary private structure.
Fixes: d80d88b0dfff ("bnxt_en: Add auxiliary driver support")
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit accd7e23693aaaa9aa0d3e9eca0ae77d1be80ab3
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Mar 3 18:43:57 2023 -0800
bnxt_en: Avoid order-5 memory allocation for TPA data
The driver needs to keep track of all the possible concurrent TPA (GRO/LRO)
completions on the aggregation ring. On P5 chips, the maximum number
of concurrent TPA is 256 and the amount of memory we allocate is order-5
on systems using 4K pages. Memory allocation failure has been reported:
NetworkManager: page allocation failure: order:5, mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null),cpuset=/,mems_allowed=0-1
CPU: 15 PID: 2995 Comm: NetworkManager Kdump: loaded Not tainted 5.10.156 #1
Hardware name: Dell Inc. PowerEdge R660/0M1CC5, BIOS 0.2.25 08/12/2022
Call Trace:
dump_stack+0x57/0x6e
warn_alloc.cold.120+0x7b/0xdd
? _cond_resched+0x15/0x30
? __alloc_pages_direct_compact+0x15f/0x170
__alloc_pages_slowpath.constprop.108+0xc58/0xc70
__alloc_pages_nodemask+0x2d0/0x300
kmalloc_order+0x24/0xe0
kmalloc_order_trace+0x19/0x80
bnxt_alloc_mem+0x1150/0x15c0 [bnxt_en]
? bnxt_get_func_stat_ctxs+0x13/0x60 [bnxt_en]
__bnxt_open_nic+0x12e/0x780 [bnxt_en]
bnxt_open+0x10b/0x240 [bnxt_en]
__dev_open+0xe9/0x180
__dev_change_flags+0x1af/0x220
dev_change_flags+0x21/0x60
do_setlink+0x35c/0x1100
Instead of allocating this big chunk of memory and dividing it up for the
concurrent TPA instances, allocate each small chunk separately for each
TPA instance. This will reduce it to order-0 allocations.
Fixes: 79632e9ba386 ("bnxt_en: Expand bnxt_tpa_info struct to support 57500 chips.")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2038cc592811209de20c4e094ca08bfb1e6fbc6c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Feb 10 12:31:55 2023 -0500
bnxt_en: Fix mqprio and XDP ring checking logic
In bnxt_reserve_rings(), there is logic to check that the number of TX
rings reserved is enough to cover all the mqprio TCs, but it fails to
account for the TX XDP rings. So the check will always fail if there
are mqprio TCs and TX XDP rings. As a result, the driver always fails
to initialize after the XDP program is attached and the device will be
brought down. A subsequent ifconfig up will also fail because the
number of TX rings is set to an inconsistent number. Fix the check to
properly account for TX XDP rings. If the check fails, set the number
of TX rings back to a consistent number after calling netdev_reset_tc().
Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.")
Reviewed-by: Hongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 66c0e13ad236c74ea88c7c1518f3cef7f372e3da
Author: Marek Majtyka <alardam@gmail.com>
Date: Wed Feb 1 11:24:18 2023 +0100
drivers: net (bnxt_en): turn on XDP features
A summary of the flags being set for various drivers is given below.
Note that XDP_F_REDIRECT_TARGET and XDP_F_FRAG_TARGET are features
that can be turned off and on at runtime. This means that these flags
may be set and unset under RTNL lock protection by the driver. Hence,
READ_ONCE must be used by code loading the flag value.
Also, these flags are not used for synchronization against the availability
of XDP resources on a device. It is merely a hint, and hence the read
may race with the actual teardown of XDP resources on the device. This
may change in the future, e.g. operations taking a reference on the XDP
resources of the driver, and in turn inhibiting turning off this flag.
However, for now, it can only be used as a hint to check whether device
supports becoming a redirection target.
Turn 'hw-offload' feature flag on for:
- netronome (nfp)
- netdevsim.
Turn 'native' and 'zerocopy' features flags on for:
- intel (i40e, ice, ixgbe, igc)
- mellanox (mlx5).
- stmmac
- netronome (nfp)
Turn 'native' features flags on for:
- amazon (ena)
- broadcom (bnxt)
...
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Link: https://lore.kernel.org/r/3eca9fafb308462f7edb1f58e451d59209aa07eb.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
commit 30343221132430c24b468493c861f71e2bad131f
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon Dec 12 10:36:29 2022 -0800
bnxt_en: Remove runtime interrupt vector allocation
Modified the bnxt_en code to create and pre-configure RDMA devices
with the right MSI-X vector count for the ROCE driver to use.
This is to align the ROCE driver to the auxiliary device model which
will simply bind the driver without getting into PCI-related handling.
All PCI-related logic will now be in the bnxt_en driver.
Suggested-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
commit a43c26fa2e6ca724360927856c326ebd3247b843
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue Dec 6 13:29:46 2022 -0800
RDMA/bnxt_re: Remove the sriov config callback
Remove the SRIOV config callback which the bnxt_en was calling
to reconfigure the chip resources for a PF device when VFs are
created. The code is now modified to provision the VF resources
based on the total VF count instead of the actual VF count.
This allows the SRIOV config callback to be removed from the
list of ulp_ops.
Suggested-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
commit 848dc857c8dee61972abdb05ce81f12f0d0e05e4
Author: Hongguang Gao <hongguang.gao@broadcom.com>
Date: Fri Oct 14 16:31:31 2022 -0700
bnxt_en: Remove struct bnxt access from RoCE driver
Decouple RoCE driver from directly accessing L2's private bnxt
structure. Move the fields needed by RoCE driver into bnxt_en_dev.
They'll be passed to RoCE driver by bnxt_rdma_aux_device_add()
function.
Signed-off-by: Hongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
commit 3b65e9456c29217429158203bfdce4361f45e0be
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Wed Sep 7 13:22:42 2022 -0700
bnxt_en: Use auxiliary bus calls over proprietary calls
Wherever possible use the function ops provided by auxiliary bus
instead of using proprietary ops.
Defined bnxt_re_suspend and bnxt_re_resume calls which can be
invoked by the bnxt_en driver instead of the ULP stop/start calls.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
commit 63669ab384eadebefd1e2a60a15a5431ee874fab
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon Sep 5 17:16:51 2022 -0700
bnxt_en: Use direct API instead of indirection
For a single ULP user there is no need for complicating function
indirection calls. Remove all this complexity in favour of direct
function calls exported by the bnxt_en driver. This allows to
simplify the code greatly. Also remove unused ulp_async_notifier.
Suggested-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
commit dafcdf5e2bd0bba594a51fe335694d4b44d8b8da
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Thu Sep 1 16:43:46 2022 -0700
bnxt_en: Remove usage of ulp_id
Since the driver continues to use the single ULP model,
the extra complexity and indirection is unnecessary.
Remove the usage of ulp_id from the code.
Suggested-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
commit 6d758147c7b80a46465f72e9e6294d244ee98a21
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Fri Oct 14 14:18:04 2022 -0700
RDMA/bnxt_re: Use auxiliary driver interface
Use auxiliary driver interface for driver load, unload ROCE driver.
The driver does not need to register the interface using the netdev
notifier anymore. Removed the bnxt_re_dev_list which is not needed.
Currently probe, remove and shutdown ops have been implemented for
the auxiliary device.
Also remove exccessve validation checks for rdev.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
commit d80d88b0dfff5829ab31030692672ba6fe9cde48
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Sun Mar 6 20:01:30 2022 -0800
bnxt_en: Add auxiliary driver support
Add auxiliary driver support.
An auxiliary device will be created if the hardware indicates
support for RDMA.
The bnxt_ulp_probe() function has been removed and a new
bnxt_rdma_aux_device_add() function has been added.
The bnxt_free_msix_vecs() and bnxt_req_msix_vecs() will now hold
the RTNL lock when they call the bnxt_close_nic()and bnxt_open_nic()
since the device close and open need to be protected under RTNL lock.
The operations between the bnxt_en and bnxt_re will be protected
using the en_ops_lock.
This will be used by the bnxt_re driver in a follow-on patch
to create ROCE interfaces.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
commit fb8421a94c5613fee86e192bab0892ecb1d56e4c
Author: Jiri Pirko <jiri@resnulli.us>
Date: Fri Jan 27 16:50:42 2023 +0100
devlink: remove devlink features
Devlink features were introduced to disallow devlink reload calls of
userspace before the devlink was fully initialized. The reason for this
workaround was the fact that devlink reload was originally called
without devlink instance lock held.
However, with recent changes that converted devlink reload to be
performed under devlink instance lock, this is redundant so remove
devlink features entirely.
Note that mlx5 used this to enable devlink reload conditionally only
when device didn't act as multi port slave. Move the multi port check
into mlx5_devlink_reload_down() callback alongside with the other
checks preventing the device from reload in certain states.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d3e599c090fc6977331150c5f0a69ab8ce87da21
Author: Kees Cook <keescook@chromium.org>
Date: Wed Jan 18 12:35:01 2023 -0800
bnxt: Do not read past the end of test names
Test names were being concatenated based on a offset beyond the end of
the first name, which tripped the buffer overflow detection logic:
detected buffer overflow in strnlen
[...]
Call Trace:
bnxt_ethtool_init.cold+0x18/0x18
Refactor struct hwrm_selftest_qlist_output to use an actual array,
and adjust the concatenation to use snprintf() rather than a series of
strncat() calls.
Reported-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Link: https://lore.kernel.org/lkml/Y8F%2F1w1AZTvLglFX@x1-carbon/
Tested-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Fixes: eb51365846bc ("bnxt_en: Add basic ethtool -t selftest support.")
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 97f5e03a4a27d27ee4fed0cdb1658c81cf2784db
Author: Jakub Kicinski <kuba@kernel.org>
Date: Tue Jan 10 20:25:47 2023 -0800
bnxt: make sure we return pages to the pool
Before the commit under Fixes the page would have been released
from the pool before the napi_alloc_skb() call, so normal page
freeing was fine (released page == no longer in the pool).
After the change we just mark the page for recycling so it's still
in the pool if the skb alloc fails, we need to recycle.
Same commit added the same bug in the new bnxt_rx_multi_page_skb().
Fixes: 1dc4c557bfed ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff")
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Link: https://lore.kernel.org/r/20230111042547.987749-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a056ebcc30e2f78451d66f615d2f6bdada3e6438
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Dec 26 22:19:40 2022 -0500
bnxt_en: Fix HDS and jumbo thresholds for RX packets
The recent XDP multi-buffer feature has introduced regressions in the
setting of HDS and jumbo thresholds. HDS was accidentally disabled in
the nornmal mode without XDP. This patch restores jumbo HDS placement
when not in XDP mode. In XDP multi-buffer mode, HDS should be disabled
and the jumbo threshold should be set to the usable page size in the
first page buffer.
Fixes: 32861236190b ("bnxt: change receive ring space parameters")
Reviewed-by: Mohammad Shuab Siddique <mohammad-shuab.siddique@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1abeacc1979fa4a756695f5030791d8f0fa934b9
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Dec 26 22:19:39 2022 -0500
bnxt_en: Fix first buffer size calculations for XDP multi-buffer
The size of the first buffer is always page size, and the useable
space is the page size minus the offset and the skb_shared_info size.
Make sure SKB and XDP buf sizes match so that the skb_shared_info
is at the same offset seen from the SKB and XDP_BUF.
build_skb() should be passed PAGE_SIZE. xdp_init_buff() should
be passed PAGE_SIZE as well. xdp_get_shared_info_from_buff() will
automatically deduct the skb_shared_info size if the XDP buffer
has frags. There is no need to keep bp->xdp_has_frags.
Change BNXT_PAGE_MODE_BUF_SIZE to BNXT_MAX_PAGE_MODE_MTU_SBUF
since this constant is really the MTU with ethernet header size
subtracted.
Also fix the BNXT_MAX_PAGE_MODE_MTU macro with proper parentheses.
Fixes: 32861236190b ("bnxt: change receive ring space parameters")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9b3e607871ea5ee90f10f5be3965fc07f2aa3ef7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Dec 26 22:19:38 2022 -0500
bnxt_en: Fix XDP RX path
The XDP program can change the starting address of the RX data buffer and
this information needs to be passed back from bnxt_rx_xdp() to
bnxt_rx_pkt() for the XDP_PASS case so that the SKB can point correctly
to the modified buffer address. Add back the data_ptr parameter to
bnxt_rx_xdp() to make this work.
Fixes: b231c3f3414c ("bnxt: refactor bnxt_rx_xdp to separate xdp_init_buff/xdp_prepare_buff")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bbfc17e50ba2ed18dfef46b1c433d50a58566bf1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Dec 26 22:19:37 2022 -0500
bnxt_en: Simplify bnxt_xdp_buff_init()
bnxt_xdp_buff_init() does not modify the data_ptr or the len parameters,
so no need to pass in the addresses of these parameters.
Fixes: b231c3f3414c ("bnxt: refactor bnxt_rx_xdp to separate xdp_init_buff/xdp_prepare_buff")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0020ae2a4aa81becd182231bf48acd66c86c86dd
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Mon Dec 26 22:19:36 2022 -0500
bnxt_en: fix devlink port registration to netdev
We don't register a devlink port in case of a VF so
avoid setting the devlink pointer to netdev.
Also, SET_NETDEV_DEVLINK_PORT has to be moved
so that we determine whether the device is PF/VF first.
This fixes the NULL pointer dereference of devlink_port->devlink
when creating VFs:
BUG: kernel NULL pointer dereference, address: 0000000000000160
PGD 0
Oops: 0000 [#1] PREEMPT SMP NOPTI
CPU: 14 PID: 388 Comm: kworker/14:1 Kdump: loaded Not tainted 6.1.0-rc8 #5
Hardware name: Dell Inc. PowerEdge R750/06V45N, BIOS 1.3.8 08/31/2021
Workqueue: events work_for_cpu_fn
RIP: 0010:devlink_nl_port_handle_size+0xb/0x50
Code: 83 c4 10 5b 5d c3 cc cc cc cc b8 a6 ff ff ff eb de e8 c9 59 21 00 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 53 48 8b 47 20 <48> 8b a8 60 01 00 00 48 8b 45 60 48 8b 38 e8 92 90 1a 00 48 8b 7d
RSP: 0018:ff4fe5394846fcd8 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000794 RCX: 0000000000000000
RDX: ff1f129683a30a40 RSI: 0000000000000008 RDI: ff1f1296bb496188
RBP: 0000000000000334 R08: 0000000000000cc0 R09: 0000000000000000
R10: ff1f1296bb494298 R11: ffffffffffffffc0 R12: 0000000000000000
R13: 0000000000000000 R14: ff1f1296bb494000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ff1f129e5fa00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000160 CR3: 000000131f610006 CR4: 0000000000771ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<TASK>
if_nlmsg_size+0x14a/0x220
rtmsg_ifinfo_build_skb+0x3c/0x100
rtmsg_ifinfo+0x9c/0xc0
register_netdevice+0x59d/0x670
register_netdev+0x1c/0x40
bnxt_init_one+0x674/0xa60 [bnxt_en]
local_pci_probe+0x42/0x80
work_for_cpu_fn+0x13/0x20
process_one_work+0x1e2/0x3b0
? rescuer_thread+0x390/0x390
worker_thread+0x1c4/0x3a0
? rescuer_thread+0x390/0x390
kthread+0xd6/0x100
? kthread_complete_and_exit+0x20/0x20
Fixes: ac73d4bf2cda ("net: make drivers to use SET_NETDEV_DEVLINK_PORT to set devlink_port")
Cc: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b6488b161ab2972a0b4f45490ea3aecef2b23256
Author: Coco Li <lixiaoyan@google.com>
Date: Sat Dec 10 04:16:46 2022 +0000
bnxt: Use generic HBH removal helper in tx path
Eric Dumazet implemented Big TCP that allowed bigger TSO/GRO packet sizes
for IPv6 traffic. See patch series:
'commit 89527be8d8d6 ("net: add IFLA_TSO_{MAX_SIZE|SEGS} attributes")'
This reduces the number of packets traversing the networking stack and
should usually improves performance. However, it also inserts a
temporary Hop-by-hop IPv6 extension header.
Using the HBH header removal method in the previous patch, the extra header
be removed in bnxt drivers to allow it to send big TCP packets (bigger
TSO packets) as well.
Tested:
Compiled locally
To further test functional correctness, update the GSO/GRO limit on the
physical NIC:
ip link set eth0 gso_max_size 181000
ip link set eth0 gro_max_size 181000
Note that if there are bonding or ipvan devices on top of the physical
NIC, their GSO sizes need to be updated as well.
Then, IPv6/TCP packets with sizes larger than 64k can be observed.
Signed-off-by: Coco Li <lixiaoyan@google.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20221210041646.3587757-2-lixiaoyan@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a802073d1c9ca2ffd757ab8df5afa9d73ba7e6b1
Author: Jakub Kicinski <kuba@kernel.org>
Date: Tue Nov 29 17:31:08 2022 -0800
bnxt: report FEC block stats via standard interface
I must have missed that these stats are only exposed
via the unstructured ethtool -S when they got merged.
Plumb in the structured form.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20221130013108.90062-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 226bf980550627c88549b112ac6c8fb40873afb4
Author: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Date: Tue Nov 29 18:51:38 2022 +0900
net: devlink: let the core report the driver name instead of the drivers
The driver name is available in device_driver::name. Right now,
drivers still have to report this piece of information themselves in
their devlink_ops::info_get callback function.
In order to factorize code, make devlink_nl_info_fill() add the driver
name attribute.
Now that the core sets the driver name attribute, drivers are not
supposed to call devlink_info_driver_name_put() anymore. Remove
devlink_info_driver_name_put() and clean-up all the drivers using this
function in their callback.
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Tested-by: Ido Schimmel <idosch@nvidia.com> # mlxsw
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 991aef4ee4f6eb999924f429b943441a32835c8f
Author: Gaosheng Cui <cuigaosheng1@huawei.com>
Date: Fri Nov 11 15:04:33 2022 +0800
bnxt_en: Remove debugfs when pci_register_driver failed
When pci_register_driver failed, we need to remove debugfs,
which will caused a resource leak, fix it.
Resource leak logs as follows:
[ 52.184456] debugfs: Directory 'bnxt_en' with parent '/' already present!
Fixes: cabfb09d87bd ("bnxt_en: add debugfs support for DIM")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a29c132f92ed5af6e7116966b7e9899d4c22783c
Author: Jacob Keller <jacob.e.keller@intel.com>
Date: Wed Nov 9 15:09:43 2022 -0800
ptp: bnxt: convert .adjfreq to .adjfine
When the BNXT_FW_CAP_PTP_RTC flag is not set, the bnxt driver implements
.adjfreq on a cyclecounter in terms of the straightforward "base * ppb / 1
billion" calculation. When BNXT_FW_CAP_PTP_RTC is set, the driver forwards
the ppb value to firmware for configuration.
Convert the driver to the newer .adjfine interface, updating the
cyclecounter calculation to use adjust_by_scaled_ppm to perform the
calculation. Use scaled_ppm_to_ppb when forwarding the correction to
firmware.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 85036aee1938d65da4be6ae1bc7e5e7e30b567b9
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Sun Nov 6 19:16:32 2022 -0500
bnxt_en: Add a non-real time mode to access NIC clock
When using a PHC that is shared between multiple hosts,
in order to achieve consistent timestamps across all hosts,
we need to isolate the PHC from any host making frequency
adjustments.
This patch adds a non-real time mode for this purpose.
The implementation is based on a free running NIC hardware timer
which is used as the timestamper time-base. Each host implements
individual adjustments to a local timecounter based on the NIC free
running timer.
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 98a4322b70e817f0663adb61b8272f7b995ed41a
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Nov 6 19:16:31 2022 -0500
bnxt_en: update RSS config using difference algorithm
Hardware is unable to realize all legal firmware interface state values
for hash_type. For example, if 4-tuple TCP_IPV4 hash is enabled,
4-tuple UDP_IPV4 hash must also be enabled. By providing the bits the
user intended to change instead of the possible illegal intermediate
states, the firmware is able to make better compromises when deciding
which bits to ignore.
With this new mechansim, we can now report the actual configured hash
back to the user. Add bnxt_hwrm_update_rss_hash_cfg() to report the
actual hash after user configuration.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 41d2dd42bfa17035c3b0429b6b0e46305607fcc7
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Nov 6 19:16:30 2022 -0500
bnxt_en: refactor VNIC RSS update functions
Extract common code into a new function. This will avoid duplication
in the next patch, which changes the update algorithm for both the P5
and legacy code paths.
No functional changes.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 9a0f830f80265bd1ef816e1541ac24bee80e9a3c
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Nov 4 12:01:25 2022 -0700
ethtool: linkstate: add a statistic for PHY down events
The previous attempt to augment carrier_down (see Link)
was not met with much enthusiasm so let's do the simple
thing of exposing what some devices already maintain.
Add a common ethtool statistic for link going down.
Currently users have to maintain per-driver mapping
to extract the right stat from the vendor-specific ethtool -S
stats. carrier_down does not fit the bill because it counts
a lot of software related false positives.
Add the statistic to the extended link state API to steer
vendors towards implementing all of it.
Implement for bnxt and all Linux-controlled PHYs. mlx5 and (possibly)
enic also have a counter for this but I leave the implementation
to their maintainers.
Link: https://lore.kernel.org/r/20220520004500.2250674-1-kuba@kernel.org
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20221104190125.684910-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
commit 02597d39145bb0aa81d04bf39b6a913ce9a9d465
Author: Alex Barba <alex.barba@broadcom.com>
Date: Thu Nov 3 19:33:27 2022 -0400
bnxt_en: fix potentially incorrect return value for ndo_rx_flow_steer
In the bnxt_en driver ndo_rx_flow_steer returns '0' whenever an entry
that we are attempting to steer is already found. This is not the
correct behavior. The return code should be the value/index that
corresponds to the entry. Returning zero all the time causes the
RFS records to be incorrect unless entry '0' is the correct one. As
flows migrate to different cores this can create entries that are not
correct.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reported-by: Akshay Navgire <anavgire@purestorage.com>
Signed-off-by: Alex Barba <alex.barba@broadcom.com>
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 6d81ea3765dfa6c8a20822613c81edad1c4a16a0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Nov 3 19:33:26 2022 -0400
bnxt_en: Fix possible crash in bnxt_hwrm_set_coal()
During the error recovery sequence, the rtnl_lock is not held for the
entire duration and some datastructures may be freed during the sequence.
Check for the BNXT_STATE_OPEN flag instead of netif_running() to ensure
that the device is fully operational before proceeding to reconfigure
the coalescing settings.
This will fix a possible crash like this:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
PGD 0 P4D 0
Oops: 0000 [#1] SMP NOPTI
CPU: 10 PID: 181276 Comm: ethtool Kdump: loaded Tainted: G IOE --------- - - 4.18.0-348.el8.x86_64 #1
Hardware name: Dell Inc. PowerEdge R740/0F9N89, BIOS 2.3.10 08/15/2019
RIP: 0010:bnxt_hwrm_set_coal+0x1fb/0x2a0 [bnxt_en]
Code: c2 66 83 4e 22 08 66 89 46 1c e8 10 cb 00 00 41 83 c6 01 44 39 b3 68 01 00 00 0f 8e a3 00 00 00 48 8b 93 c8 00 00 00 49 63 c6 <48> 8b 2c c2 48 8b 85 b8 02 00 00 48 85 c0 74 2e 48 8b 74 24 08 f6
RSP: 0018:ffffb11c8dcaba50 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8d168a8b0ac0 RCX: 00000000000000c5
RDX: 0000000000000000 RSI: ffff8d162f72c000 RDI: ffff8d168a8b0b28
RBP: 0000000000000000 R08: b6e1f68a12e9a7eb R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000037 R12: ffff8d168a8b109c
R13: ffff8d168a8b10aa R14: 0000000000000000 R15: ffffffffc01ac4e0
FS: 00007f3852e4c740(0000) GS:ffff8d24c0080000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000041b3ee003 CR4: 00000000007706e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
ethnl_set_coalesce+0x3ce/0x4c0
genl_family_rcv_msg_doit.isra.15+0x10f/0x150
genl_family_rcv_msg+0xb3/0x160
? coalesce_fill_reply+0x480/0x480
genl_rcv_msg+0x47/0x90
? genl_family_rcv_msg+0x160/0x160
netlink_rcv_skb+0x4c/0x120
genl_rcv+0x24/0x40
netlink_unicast+0x196/0x230
netlink_sendmsg+0x204/0x3d0
sock_sendmsg+0x4c/0x50
__sys_sendto+0xee/0x160
? syscall_trace_enter+0x1d3/0x2c0
? __audit_syscall_exit+0x249/0x2a0
__x64_sys_sendto+0x24/0x30
do_syscall_64+0x5b/0x1a0
entry_SYSCALL_64_after_hwframe+0x65/0xca
RIP: 0033:0x7f38524163bb
Fixes: 2151fe0830fd ("bnxt_en: Handle RESET_NOTIFY async event from firmware.")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 0cf736a18a1e804037839bd8df9e36f0efdb8745
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Thu Nov 3 19:33:25 2022 -0400
bnxt_en: fix the handling of PCIE-AER
Fix the sequence required for PCIE-AER. While slot reset occurs, firmware
might not be ready and the driver needs to check for its recovery. We
also need to remap the health registers for some chips and clear the
resource reservations. The resources will be allocated again during
bnxt_io_resume().
Fixes: fb1e6e562b37 ("bnxt_en: Fix AER recovery.")
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit b4c66425771ddb910316c7b4cd7fa0614098ec45
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Thu Nov 3 19:33:24 2022 -0400
bnxt_en: refactor bnxt_cancel_reservations()
Introduce bnxt_clear_reservations() to clear the reserved attributes only.
This will be used in the next patch to fix PCI AER handling.
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 77df1db80da384c565106321f5934967690da7dd
Author: Jiri Pirko <jiri@nvidia.com>
Date: Wed Nov 2 17:02:10 2022 +0100
net: remove unused ndo_get_devlink_port
Remove ndo_get_devlink_port which is no longer used alongside with the
implementations in drivers.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit ac73d4bf2cdaf2cb8a43df8ee4a5c066d2c5d7b4
Author: Jiri Pirko <jiri@nvidia.com>
Date: Wed Nov 2 17:02:04 2022 +0100
net: make drivers to use SET_NETDEV_DEVLINK_PORT to set devlink_port
Benefit from the previously implemented tracking of netdev events in
devlink code and instead of calling devlink_port_type_eth_set() and
devlink_port_type_clear() to set devlink port type and link to related
netdev, use SET_NETDEV_DEVLINK_PORT() macro to assign devlink_port
pointer to netdevice which is about to be registered.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 45034224623a5634e4ccc57b497ac825c260170f
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Fri Oct 21 02:37:23 2022 -0400
bnxt_en: check and resize NVRAM UPDATE entry before flashing
Resize of the UPDATE entry is required if the image to
be flashed is larger than the available space. Add this step,
otherwise flashing larger firmware images by ethtool or devlink
may fail.
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 7ef3d3901b99d9715840c9860082bec124beed83
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Fri Oct 21 02:37:22 2022 -0400
bnxt_en: add .get_module_eeprom_by_page() support
Add support for .get_module_eeprom_by_page() callback which
implements generic solution for module`s eeprom access.
v3: Add bnxt_get_module_status() to get a more specific extack error
string.
Return -EINVAL from bnxt_get_module_eeprom_by_page() when we
don't want to fallback to old method.
v2: Simplification suggested by Ido Schimmel
Link: https://lore.kernel.org/netdev/YzVJ%2FvKJugoz15yV@shredder/
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 84a911db83055e2d4c9d0171f116a47711014374
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Oct 21 02:37:21 2022 -0400
bnxt_en: Update firmware interface to 1.10.2.118
The main changes are PTM timestamp support, CMIS EEPROM support, and
asymmetric CoS queues support.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit ba077d683d45190afc993c1ce45bcdbfda741a40
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Mon Oct 17 11:32:22 2022 -0400
bnxt_en: fix memory leak in bnxt_nvm_test()
Free the kzalloc'ed buffer before returning in the success path.
Fixes: 5b6ff128fdf6 ("bnxt_en: implement callbacks for devlink selftests")
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1666020742-25834-1-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 197173db990cad244221ba73c43b1df6170ae278
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date: Wed Oct 5 17:49:46 2022 +0200
treewide: use get_random_bytes() when possible
The prandom_bytes() function has been a deprecated inline wrapper around
get_random_bytes() for several releases now, and compiles down to the
exact same code. Replace the deprecated wrapper with a direct call to
the real function. This was done as a basic find and replace.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Yury Norov <yury.norov@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> # powerpc
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
commit b48b89f9c189d24eb5e2b4a0ac067da5a24ee86d
Author: Jakub Kicinski <kuba@kernel.org>
Date: Tue Sep 27 06:27:53 2022 -0700
net: drop the weight argument from netif_napi_add
We tell driver developers to always pass NAPI_POLL_WEIGHT
as the weight to netif_napi_add(). This may be confusing
to newcomers, drop the weight argument, those who really
need to tweak the weight can use netif_napi_add_weight().
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> # for CAN
Link: https://lore.kernel.org/r/20220927132753.750069-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 8db3d514e96715c897fe793c4d5fc0fd86aca517
Author: Vadim Fedorenko <vfedorenko@novek.ru>
Date: Thu Sep 22 22:10:38 2022 +0300
bnxt_en: replace reset with config timestamps
Any change to the hardware timestamps configuration triggers nic restart,
which breaks transmition and reception of network packets for a while.
But there is no need to fully restart the device because while configuring
hardware timestamps. The code for changing configuration runs after all
of the initialisation, when the NIC is actually up and running. This patch
changes the code that ioctl will only update configuration registers and
will not trigger carrier status change, but in case of timestamps for
all rx packetes it fallbacks to close()/open() sequnce because of
synchronization issues in the hardware. Tested on BCM57504.
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20220922191038.29921-1-vfedorenko@novek.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit c31f26c8f69f776759cbbdfb38e40ea91aa0dd65
Author: Jakub Kicinski <kuba@kernel.org>
Date: Wed Sep 21 13:10:05 2022 -0700
bnxt: prevent skb UAF after handing over to PTP worker
When reading the timestamp is required bnxt_tx_int() hands
over the ownership of the completed skb to the PTP worker.
The skb should not be used afterwards, as the worker may
run before the rest of our code and free the skb, leading
to a use-after-free.
Since dev_kfree_skb_any() accepts NULL make the loss of
ownership more obvious and set skb to NULL.
Fixes: 83bb623c968e ("bnxt_en: Transmit and retrieve packet timestamps")
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20220921201005.335390-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit ae8ffba8baad651af706538e8c47d0a049d406c6
Author: Vadim Fedorenko <vfedorenko@novek.ru>
Date: Fri Sep 16 02:49:32 2022 +0300
bnxt_en: fix flags to check for supported fw version
The warning message of unsupported FW appears every time RX timestamps
are disabled on the interface. The patch fixes the flags to correct set
for the check.
Fixes: 66ed81dcedc6 ("bnxt_en: Enable packet timestamping for all RX packets")
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20220915234932.25497-1-vfedorenko@novek.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 366c304741729e64d778c80555d9eb422cf5cc89
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Mon Aug 22 11:06:54 2022 -0400
bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback
LRO/GRO_HW should be disabled if there is an attached XDP program.
BNXT_FLAG_TPA is the current setting of the LRO/GRO_HW. Using
BNXT_FLAG_TPA to disable LRO/GRO_HW will cause these features to be
permanently disabled once they are disabled.
Fixes: 1dc4c557bfed ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff")
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 09a89cc59ad67794a11e1d3dd13c5b3172adcc51
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Mon Aug 22 11:06:53 2022 -0400
bnxt_en: fix NQ resource accounting during vf creation on 57500 chips
There are 2 issues:
1. We should decrement hw_resc->max_nqs instead of hw_resc->max_irqs
with the number of NQs assigned to the VFs. The IRQs are fixed
on each function and cannot be re-assigned. Only the NQs are being
assigned to the VFs.
2. vf_msix is the total number of NQs to be assigned to the VFs. So
we should decrement vf_msix from hw_resc->max_nqs.
Fixes: b16b68918674 ("bnxt_en: Add SR-IOV support for 57500 chips.")
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 574b2bb9692fd3d45ed631ac447176d4679f3010
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Mon Aug 22 11:06:52 2022 -0400
bnxt_en: set missing reload flag in devlink features
Add missing devlink_set_features() API for callbacks reload_down
and reload_up to function.
Fixes: 228ea8c187d8 ("bnxt_en: implement devlink dev reload driver_reinit")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 7dd3de7cb1d657a918c6b2bc673c71e318aa0c05
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Mon Aug 22 11:06:51 2022 -0400
bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in use
Using BNXT_PAGE_MODE_BUF_SIZE + offset as buffer length value is not
sufficient when running single buffer XDP programs doing redirect
operations. The stack will complain on missing skb tail room. Fix it
by using PAGE_SIZE when calling xdp_init_buff() for single buffer
programs.
Fixes: b231c3f3414c ("bnxt: refactor bnxt_rx_xdp to separate xdp_init_buff/xdp_prepare_buff")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit ddde5412fdaa5048bbca31529d46cb8da882870c
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Mon Jul 11 22:26:18 2022 -0400
bnxt_en: Fix bnxt_refclk_read()
The upper 32-bit PHC register is not latched when reading the lower
32-bit PHC register. Current code leaves a small window where we may
not read correct higher order bits if the lower order bits are just about
to wrap around.
This patch fixes this by reading higher order bits twice and makes
sure that final value is correctly paired with its lower 32 bits.
Fixes: 30e96f487f64 ("bnxt_en: Do not read the PTP PHC during chip reset")
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 53f8c2d37efb5b03b9527ad04332df3bb889f0fa
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 11 22:26:17 2022 -0400
bnxt_en: Fix and simplify XDP transmit path
Fix the missing length hint in the TX BD for the XDP transmit path. The
length hint is required on legacy chips.
Also, simplify the code by eliminating the first_buf local variable.
tx_buf contains the same value. The opaque value only needs to be set
on the first BD. Fix this also for correctness.
Fixes: a7559bc8c17c ("bnxt: support transmit and free of aggregation buffers")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 619b9b1622c283cc5ca86f4c487db266a8f55dab
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Mon Jul 11 22:26:16 2022 -0400
bnxt_en: fix livepatch query
In the livepatch query fw_target BNXT_FW_SRT_PATCH is
applicable for P5 chips only.
Fixes: 3c4153394e2c ("bnxt_en: implement firmware live patching")
Reviewed-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 4279414bff8af9898e8c53ae6c5bc17f68ad67b7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 11 22:26:15 2022 -0400
bnxt_en: Fix bnxt_reinit_after_abort() code path
bnxt_reinit_after_abort() is called during ifup when a previous
FW reset sequence has aborted or a previous ifup has failed after
detecting FW reset. In all cases, it is safe to assume that a
previous FW reset has completed and the driver may not have fully
reinitialized.
Prior to this patch, it is assumed that the
FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE flag will always be
set by the firmware in bnxt_hwrm_if_change(). This may not be true if
the driver has already attempted to register with the firmware. The
firmware may not set the RESET_DONE flag again after the driver has
registered, assuming that the driver has seen the flag already.
Fix it to always go through the FW reset initialization path if
the BNXT_STATE_FW_RESET_DET flag is set. This flag is always set
by the driver after successfully going through bnxt_reinit_after_abort().
Fixes: 6882c36cf82e ("bnxt_en: attempt to reinitialize after aborted reset")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit c5b744d38c36a407a41e918602eec4d89730787b
Author: Kashyap Desai <kashyap.desai@broadcom.com>
Date: Mon Jul 11 22:26:14 2022 -0400
bnxt_en: reclaim max resources if sriov enable fails
If bnxt_sriov_enable() fails after some resources have been reserved
for the VFs, the current code is not unwinding properly and the
reserved resources become unavailable afterwards. Fix it by
properly unwinding with a call to bnxt_hwrm_func_qcaps() to
reset all maximum resources.
Also, add the missing bnxt_ulp_sriov_cfg() call to let the RDMA
driver know to abort.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 45262522d0027269dbece119f1cb89e25f5de965
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Tue Jul 5 22:22:59 2022 +0200
bnxt: Use the bitmap API to allocate bitmaps
Use bitmap_zalloc()/bitmap_free() instead of hand-writing them.
It is less verbose and it improves the semantic.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/d508f3adf7e2804f4d3793271b82b196a2ccb940.1657052562.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 504148fedb854299972d164b001357b888a9193e
Author: Eric Dumazet <edumazet@google.com>
Date: Thu Jun 30 15:07:50 2022 +0000
net: add skb_[inner_]tcp_all_headers helpers
Most drivers use "skb_transport_offset(skb) + tcp_hdrlen(skb)"
to compute headers length for a TCP packet, but others
use more convoluted (but equivalent) ways.
Add skb_tcp_all_headers() and skb_inner_tcp_all_headers()
helpers to harmonize this a bit.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c909e7ca494f397f51648048252d00d3dd61cefd
Author: Jiang Jian <jiangjian@cdjrlc.com>
Date: Wed Jun 22 22:45:26 2022 +0800
bnxt: Fix typo in comments
Remove the repeated word 'and' from comments
Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Link: https://lore.kernel.org/r/20220622144526.20659-1-jiangjian@cdjrlc.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit dbb2f362c7835660a4e39eadd7481563e2e176b7
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu May 19 23:19:55 2022 -0700
eth: bnxt: make ulp_id unsigned to make GCC 12 happy
GCC array bounds checking complains that ulp_id is validated
only against upper bound. Make it unsigned.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20220520061955.2312968-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit ab0bed4bf6fae8a42cf3b08b38e1fffb1a79193a
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Thu May 12 22:40:24 2022 -0400
bnxt_en: parse and report result field when NVRAM package install fails
Instead of always returning -ENOPKG, decode the firmware error
code further when the HWRM_NVM_INSTALL_UPDATE firmware call fails.
Return a more suitable error code to userspace and log an error
in dmesg.
This is version 2 of the earlier patch that was reverted:
02acd399533e ("bnxt_en: parse result field when NVRAM package install fails")
In this new version, if the call is made through devlink instead of
ethtool, we'll also set the error message in extack.
Link: https://lore.kernel.org/netdev/20220307141358.4d52462e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 66ed81dcedc665bf8c7dfc3867d425f50eba219e
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Thu May 12 22:40:23 2022 -0400
bnxt_en: Enable packet timestamping for all RX packets
Add driver support to enable timestamping on all RX packets
that are received by the NIC. This capability can be requested
by the applications using SIOCSHWTSTAMP ioctl with filter type
HWTSTAMP_FILTER_ALL.
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 11862689e8f117e4702f55000790d7bce6859e84
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Thu May 12 22:40:22 2022 -0400
bnxt_en: Configure ptp filters during bnxt open
For correctness, we need to configure the packet filters for timestamping
during bnxt_open. This way they are always configured after firmware
reset or chip reset. We should not assume that the filters will always
be retained across resets.
This patch modifies the ioctl handler and always configures the PTP
filters in the bnxt_open() path.
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ad04cc058d644acc6c903d8da4b8d59aa2b6335e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu May 12 22:40:21 2022 -0400
bnxt_en: Update firmware interface to 1.10.2.95
The main changes are timestamp support for all RX packets and new PCIe
statistics.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 195af57914d15229186658ed26dab24b9ada4122
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 2 21:13:12 2022 -0400
bnxt_en: Fix unnecessary dropping of RX packets
In bnxt_poll_p5(), we first check cpr->has_more_work. If it is true,
we are in NAPI polling mode and we will call __bnxt_poll_cqs() to
continue polling. It is possible to exhanust the budget again when
__bnxt_poll_cqs() returns.
We then enter the main while loop to check for new entries in the NQ.
If we had previously exhausted the NAPI budget, we may call
__bnxt_poll_work() to process an RX entry with zero budget. This will
cause packets to be dropped unnecessarily, thinking that we are in the
netpoll path. Fix it by breaking out of the while loop if we need
to process an RX NQ entry with no budget left. We will then exit
NAPI and stay in polling mode.
Fixes: 389a877a3b20 ("bnxt_en: Process the NQ under NAPI continuous polling.")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 2b156fb57d8f0d28f2207edc646751f4717cf20d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 2 21:13:11 2022 -0400
bnxt_en: Initiallize bp->ptp_lock first before using it
bnxt_ptp_init() calls bnxt_ptp_init_rtc() which will acquire the ptp_lock
spinlock. The spinlock is not initialized until later. Move the
bnxt_ptp_init_rtc() call after the spinlock is initialized.
Fixes: 24ac1ecd5240 ("bnxt_en: Add driver support to use Real Time Counter for PTP")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 13ba794397e45e52893cfc21d7a69cb5f341b407
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Mon May 2 21:13:10 2022 -0400
bnxt_en: Fix possible bnxt_open() failure caused by wrong RFS flag
bnxt_open() can fail in this code path, especially on a VF when
it fails to reserve default rings:
bnxt_open()
__bnxt_open_nic()
bnxt_clear_int_mode()
bnxt_init_dflt_ring_mode()
RX rings would be set to 0 when we hit this error path.
It is possible for a subsequent bnxt_open() call to potentially succeed
with a code path like this:
bnxt_open()
bnxt_hwrm_if_change()
bnxt_fw_init_one()
bnxt_fw_init_one_p3()
bnxt_set_dflt_rfs()
bnxt_rfs_capable()
bnxt_hwrm_reserve_rings()
On older chips, RFS is capable if we can reserve the number of vnics that
is equal to RX rings + 1. But since RX rings is still set to 0 in this
code path, we may mistakenly think that RFS is supported for 0 RX rings.
Later, when the default RX rings are reserved and we try to enable
RFS, it would fail and cause bnxt_open() to fail unnecessarily.
We fix this in 2 places. bnxt_rfs_capable() will always return false if
RX rings is not yet set. bnxt_init_dflt_ring_mode() will call
bnxt_set_dflt_rfs() which will always clear the RFS flags if RFS is not
supported.
Fixes: 20d7d1c5c9b1 ("bnxt_en: reliably allocate IRQ table on reset to avoid crash")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 9f4b28301ce6a594a692a0abc2002d0bb912f2b7
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:59:06 2022 -0400
bnxt: XDP multibuffer enablement
Allow aggregation buffers to be in place in the receive path and
allow XDP programs to be attached when using a larger than 4k MTU.
v3: Add a check to sure XDP program supports multipage packets.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a7559bc8c17c3f9a91dcbeefe8642ba757fd09e8
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:59:05 2022 -0400
bnxt: support transmit and free of aggregation buffers
This patch adds the following features:
- Support for XDP_TX and XDP_DROP action when using xdp_buff
with frags
- Support for freeing all frags attached to an xdp_buff
- Cleanup of TX ring buffers after transmits complete
- Slight change in definition of bnxt_sw_tx_bd since nr_frags
and RX producer may both need to be used
- Clear out skb_shared_info at the end of the buffer
v2: Fix uninitialized variable warning in bnxt_xdp_buff_frags_free().
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1dc4c557bfedfcdf7fc0c46795857773b7ad66e7
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:59:04 2022 -0400
bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff
Since we have an xdp_buff with frags there needs to be a way to
convert that into a valid sk_buff in the event that XDP_PASS is
the resulting operation. This adds a new rx_skb_func when the
netdev has an MTU that prevents the packets from sitting in a
single page.
This also make sure that GRO/LRO stay disabled even when using
the aggregation ring for large buffers.
v3: Use BNXT_PAGE_MODE_BUF_SIZE for build_skb
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9a6aa3504885331a2fbf843c8cb7fa6be49a3d40
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:59:03 2022 -0400
bnxt: add page_pool support for aggregation ring when using xdp
If we are using aggregation rings with XDP enabled, allocate page
buffers for the aggregation rings from the page_pool.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 32861236190bf1247d18e245cee0814603d2c29f
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:59:02 2022 -0400
bnxt: change receive ring space parameters
Modify ring header data split and jumbo parameters to account
for the fact that the design for XDP multibuffer puts close to
the first 4k of data in a page and the remaining portions of
the packet go in the aggregation ring.
v3: Simplified code around initial buffer size calculation
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 31b9998bf225eca51f0d9f8d694d807495bf80a8
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:59:01 2022 -0400
bnxt: set xdp_buff pfmemalloc flag if needed
Set the pfmemaloc flag in the xdp buff so that this can be
copied to the skb if needed for an XDP_PASS action.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4c6c123c9af9c94be4726134ca72ba5a0be0ebd0
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:59:00 2022 -0400
bnxt: adding bnxt_rx_agg_pages_xdp for aggregated xdp
This patch adds a new function that will read pages from the
aggregation ring and create an xdp_buff with frags based on
the entries in the aggregation ring.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 23e4c0469ad03f695993cceccb50cbddf9ef8963
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:58:59 2022 -0400
bnxt: rename bnxt_rx_pages to bnxt_rx_agg_pages_skb
Clarify that this is reading buffers from the aggregation ring.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ca1df2dd8e2f2c18a90d21e59ad56d43c2e9322e
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:58:58 2022 -0400
bnxt: refactor bnxt_rx_pages operate on skb_shared_info
Rather than operating on an sk_buff, add frags from the aggregation
ring into the frags of an skb_shared_info. This will allow the
caller to use either an sk_buff or xdp_buff.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ee536dcbdce4966009b4ea15f03cba045161249a
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:58:57 2022 -0400
bnxt: add flag to denote that an xdp program is currently attached
This will be used to determine if bnxt_rx_xdp should be called
rather than calling it every time.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b231c3f3414cfc7bf8fb1e246ed5a3d523616520
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 8 03:58:56 2022 -0400
bnxt: refactor bnxt_rx_xdp to separate xdp_init_buff/xdp_prepare_buff
Move initialization of xdp_buff outside of bnxt_rx_xdp to prepare
for allowing bnxt_rx_xdp to operate on multibuffer xdp_buffs.
v2: Fix uninitalized variables warning in bnxt_xdp.c.
v3: Add new define BNXT_PAGE_MODE_BUF_SIZE
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 27d4073f8d9af0340362554414f4961643a4f4de
Author: Ray Jui <ray.jui@broadcom.com>
Date: Fri Apr 1 20:21:12 2022 -0400
bnxt_en: Prevent XDP redirect from running when stopping TX queue
Add checks in the XDP redirect callback to prevent XDP from running when
the TX ring is undergoing shutdown.
Also remove redundant checks in the XDP redirect callback to validate the
txr and the flag that indicates the ring supports XDP. The modulo
arithmetic on 'tx_nr_rings_xdp' already guarantees the derived TX
ring is an XDP ring. txr is also guaranteed to be valid after checking
BNXT_STATE_OPEN and within RCU grace period.
Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support")
Reviewed-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit facc173cf700e55b2ad249ecbd3a7537f7315691
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Apr 1 20:21:11 2022 -0400
bnxt_en: reserve space inside receive page for skb_shared_info
Insufficient space was being reserved in the page used for packet
reception, so the interface MTU could be set too large to still have
room for the contents of the packet when doing XDP redirect. This
resulted in the following message when redirecting a packet between
3520 and 3822 bytes with an MTU of 3822:
[311815.561880] XDP_WARN: xdp_update_frame_from_buff(line:200): Driver BUG: missing reserved tailroom
Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4f81def272de17dc4bbd89ac38f49b2676c9b3d2
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Fri Apr 1 20:21:10 2022 -0400
bnxt_en: Synchronize tx when xdp redirects happen on same ring
If there are more CPUs than the number of TX XDP rings, multiple XDP
redirects can select the same TX ring based on the CPU on which
XDP redirect is called. Add locking when needed and use static
key to decide whether to take the lock.
Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dcf500065fabe27676dfe7b4ba521a4f1e0fc8ac
Author: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Date: Mon Mar 28 15:27:08 2022 +0900
net: bnxt_ptp: fix compilation error
The Broadcom bnxt_ptp driver does not compile with GCC 11.2.2 when
CONFIG_WERROR is enabled. The following error is generated:
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c: In function bnxt_ptp_enable:
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:400:43: error: array
subscript 255 is above array bounds of struct pps_pin[4]
[-Werror=array-bounds]
400 | ptp->pps_info.pins[pin_id].event = BNXT_PPS_EVENT_EXTERNAL;
| ~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:20:
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h:75:24: note: while
referencing pins
75 | struct pps_pin pins[BNXT_MAX_TSIO_PINS];
| ^~~~
cc1: all warnings being treated as errors
This is due to the function ptp_find_pin() returning a pin ID of -1 when
a valid pin is not found and this error never being checked.
Change the TSIO_PIN_VALID() function to also check that a pin ID is not
negative and use this macro in bnxt_ptp_enable() to check the result of
the calls to ptp_find_pin() to return an error early for invalid pins.
This fixes the compilation error.
Cc: <stable@vger.kernel.org>
Fixes: 9e518f25802c ("bnxt_en: 1PPS functions to configure TSIO pins")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20220328062708.207079-1-damien.lemoal@opensource.wdc.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 625788b5844511cf4c30cffa7fa0bc3a69cebc82
Author: Eric Dumazet <edumazet@google.com>
Date: Thu Mar 10 21:14:20 2022 -0800
net: add per-cpu storage and net->core_stats
Before adding yet another possibly contended atomic_long_t,
it is time to add per-cpu storage for existing ones:
dev->tx_dropped, dev->rx_dropped, and dev->rx_nohandler
Because many devices do not have to increment such counters,
allocate the per-cpu storage on demand, so that dev_get_stats()
does not have to spend considerable time folding zero counters.
Note that some drivers have abused these counters which
were supposed to be only used by core networking stack.
v4: should use per_cpu_ptr() in dev_get_stats() (Jakub)
v3: added a READ_ONCE() in netdev_core_stats_alloc() (Paolo)
v2: add a missing include (reported by kernel test robot <lkp@intel.com>)
Change in netdev_core_stats_alloc() (Jakub)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: jeffreyji <jeffreyji@google.com>
Reviewed-by: Brian Vazquez <brianvv@google.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/20220311051420.2608812-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit f16a9169286691d23906a1bb1c8e07e53113586c
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sat Mar 5 03:54:40 2022 -0500
bnxt_en: Do not destroy health reporters during reset
Health reporter state should be maintained over resets. Previously
reporters were destroyed if the device capabilities changed, but
since none of the reporters depend on capabilities anymore, this
logic should be removed.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7c492a2530c1f05441da541307c2534230dfd59b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 5 03:54:39 2022 -0500
bnxt_en: Eliminate unintended link toggle during FW reset
If the flow control settings have been changed, a subsequent FW reset
may cause the ethernet link to toggle unnecessarily. This link toggle
will increase the down time by a few seconds.
The problem is caused by bnxt_update_phy_setting() detecting a false
mismatch in the flow control settings between the stored software
settings and the current FW settings after the FW reset. This mismatch
is caused by the AUTONEG bit added to link_info->req_flow_ctrl in an
inconsistent way in bnxt_set_pauseparam() in autoneg mode. The AUTONEG
bit should not be added to link_info->req_flow_ctrl.
Reviewed-by: Colin Winegarden <colin.winegarden@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9a3bc77ec65efa3d58e4da0d0e64cefdd9c1692e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 5 03:54:38 2022 -0500
bnxt_en: Properly report no pause support on some cards
Some cards are configured to never support link pause or PFC. Discover
these cards and properly report no pause support to ethtool. Disable
PFC settings from DCBNL if PFC is unsupported.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0f5a4841f2ec504fba753c86f824a23ed8d0df1f
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sat Mar 5 03:54:37 2022 -0500
bnxt_en: introduce initial link state of unknown
This will force link state to always be logged for initial NIC open.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 54ff1e3e8fc3aad09d5dfc426bb462e261c37a1b
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Sat Mar 5 03:54:35 2022 -0500
bnxt_en: add more error checks to HWRM_NVM_INSTALL_UPDATE
FW returns error code "NVM_INSTALL_UPDATE_CMD_ERR_CODE_ANTI_ROLLBACK"
in the response to indicate that HWRM_NVM_INSTALL_UPDATE command has
failed due to Anti-rollback feature. Parse the error and return an
appropriate error code to the user.
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8e42aef0b7307c024bedf8716628392977f27f55
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Sat Mar 5 03:54:34 2022 -0500
bnxt_en: refactor error handling of HWRM_NVM_INSTALL_UPDATE
This is in anticipation of handling more "cmd_err" from FW in the next
patch.
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1278d17a1fb860e7eab4bc3ff4b026a87cbf5105
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Sun Feb 20 04:05:53 2022 -0500
bnxt_en: Fix devlink fw_activate
To install a livepatch, first flash the package to NVM, and then
activate the patch through the "HWRM_FW_LIVEPATCH" fw command.
To uninstall a patch from NVM, flash the removal package and then
activate it through the "HWRM_FW_LIVEPATCH" fw command.
The "HWRM_FW_LIVEPATCH" fw command has to consider following scenarios:
1. no patch in NVM and no patch active. Do nothing.
2. patch in NVM, but not active. Activate the patch currently in NVM.
3. patch is not in NVM, but active. Deactivate the patch.
4. patch in NVM and the patch active. Do nothing.
Fix the code to handle these scenarios during devlink "fw_activate".
To install and activate a live patch:
devlink dev flash pci/0000:c1:00.0 file thor_patch.pkg
devlink -f dev reload pci/0000:c1:00.0 action fw_activate limit no_reset
To remove and deactivate a live patch:
devlink dev flash pci/0000:c1:00.0 file thor_patch_rem.pkg
devlink -f dev reload pci/0000:c1:00.0 action fw_activate limit no_reset
Fixes: 3c4153394e2c ("bnxt_en: implement firmware live patching")
Reviewed-by: Vikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b891106da52b2c12dbaf73400f6d225b06a38d80
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 20 04:05:52 2022 -0500
bnxt_en: Increase firmware message response DMA wait time
When polling for the firmware message response, we first poll for the
response message header. Once the valid length is detected in the
header, we poll for the valid bit at the end of the message which
signals DMA completion. Normally, this poll time for DMA completion
is extremely short (0 to a few usec). But on some devices under some
rare conditions, it can be up to about 20 msec.
Increase this delay to 50 msec and use udelay() for the first 10 usec
for the common case, and usleep_range() beyond that.
Also, change the error message to include the above delay time when
printing the timeout value.
Fixes: 3c8c20db769c ("bnxt_en: move HWRM API implementation into separate file")
Reviewed-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0e0e3c5358470cbad10bd7ca29f84a44d179d286
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Sun Feb 20 04:05:51 2022 -0500
bnxt_en: Restore the resets_reliable flag in bnxt_open()
During ifdown, we call bnxt_inv_fw_health_reg() which will clear
both the status_reliable and resets_reliable flags if these
registers are mapped. This is correct because a FW reset during
ifdown will clear these register mappings. If we detect that FW
has gone through reset during the next ifup, we will remap these
registers.
But during normal ifup with no FW reset, we need to restore the
resets_reliable flag otherwise we will not show the reset counter
during devlink diagnose.
Fixes: 8cc95ceb7087 ("bnxt_en: improve fw diagnose devlink health messages")
Reviewed-by: Vikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8cdb15924252e27af16c4a8fe0fc606ce5fd04dc
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Sun Feb 20 04:05:50 2022 -0500
bnxt_en: Fix incorrect multicast rx mask setting when not requested
We should setup multicast only when net_device flags explicitly
has IFF_MULTICAST set. Otherwise we will incorrectly turn it on
even when not asked. Fix it by only passing the multicast table
to the firmware if IFF_MULTICAST is set.
Fixes: 7d2837dd7a32 ("bnxt_en: Setup multicast properly after resetting device.")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cfcab3b3b61584a02bb523ffa99564eafa761dfe
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 20 04:05:49 2022 -0500
bnxt_en: Fix occasional ethtool -t loopback test failures
In the current code, we setup the port to PHY or MAC loopback mode
and then transmit a test broadcast packet for the loopback test. This
scheme fails sometime if the port is shared with management firmware
that can also send packets. The driver may receive the management
firmware's packet and the test will fail when the contents don't
match the test packet.
Change the test packet to use it's own MAC address as the destination
and setup the port to only receive it's own MAC address. This should
filter out other packets sent by management firmware.
Fixes: 91725d89b97a ("bnxt_en: Add PHY loopback to ethtool self-test.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6758f937669dba14c6aac7ca004edda42ec1b18d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 20 04:05:48 2022 -0500
bnxt_en: Fix offline ethtool selftest with RDMA enabled
For offline (destructive) self tests, we need to stop the RDMA driver
first. Otherwise, the RDMA driver will run into unrecoverable errors
when destructive firmware tests are being performed.
The irq_re_init parameter used in the half close and half open
sequence when preparing the NIC for offline tests should be set to
true because the RDMA driver will free all IRQs before the offline
tests begin.
Fixes: 55fd0cf320c3 ("bnxt_en: Add external loopback test to ethtool selftest.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Ben Li <ben.li@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 84d3c83e6ea7d46cf3de3a54578af73eb24a64f2
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Sun Feb 20 04:05:47 2022 -0500
bnxt_en: Fix active FEC reporting to ethtool
ethtool --show-fec <interface> does not show anything when the Active
FEC setting in the chip is set to None. Fix it to properly return
ETHTOOL_FEC_OFF in that case.
Fixes: 8b2775890ad8 ("bnxt_en: Report FEC settings to ethtool.")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b370517e5233c42925911d1ac805e512c47dbc01
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Jan 27 10:43:00 2022 -0800
bnxt: report header-data split state
Aggregation rings imply header-data split.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8bcf6f04d4a531d2efd9b51f13d903aa03985ac6
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Tue Jan 25 23:40:13 2022 -0500
bnxt_en: Handle async event when the PHC is updated in RTC mode
In Multi-host environment, when the PHC is updated by one host,
an async message from firmware will be sent to other hosts.
Re-initialize the timecounter when the driver receives this
async message.
Cc: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e7b0afb69083ff7199dec51e7b9b1646e799943b
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Tue Jan 25 23:40:12 2022 -0500
bnxt_en: Implement .adjtime() for PTP RTC mode
The adjusted time is set in the PHC in RTC mode. We also need to
update the snapshots ptp->current_time and ptp->old_time when the
time is adjusted.
Cc: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 24ac1ecd524065cdcf8c27dc85ae37eccce8f2f6
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Tue Jan 25 23:40:11 2022 -0500
bnxt_en: Add driver support to use Real Time Counter for PTP
Add support for RTC mode if it is supported by firmware. In RTC
mode, the PHC is set to the 64-bit clock. Because the legacy interface
is 48-bit, the driver still has to keep track of the upper 16 bits and
handle the rollover.
Cc: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 740c342e399981babdd62d0d5beb7c8ec9503a9a
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Tue Jan 25 23:40:10 2022 -0500
bnxt_en: PTP: Refactor PTP initialization functions
Making the ptp free and timecounter initialization code into separate
functions so that later patches can use them.
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2895c1531056903a8e22df565664ade106e29426
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jan 25 23:40:09 2022 -0500
bnxt_en: Update firmware interface to 1.10.2.73
The main changes are PTP support for RTC, additional NVM error codes,
backing store v2 firmware APIs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8c6f36d93449e8de7b49a67727e3d09b67c73126
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Jan 9 18:54:45 2022 -0500
bnxt_en: improve firmware timeout messaging
While it has always been possible to infer that an HWRM command was
abandoned due to an unhealthy firmware status by the shortened timeout
reported, this change improves the log messaging to account for this
case explicitly. In the interests of further clarity, the firmware
status is now also reported in these new messages.
v2: Remove inline keyword for hwrm_wait_must_abort() in .c file.
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit bce9a0b7900836df223ab638090df0cb8430d9e8
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Jan 9 18:54:44 2022 -0500
bnxt_en: use firmware provided max timeout for messages
Some older devices cannot accommodate the 40 seconds timeout
cap for long running commands (such as NVRAM commands) due to
hardware limitations. Allow these devices to request more time for
these long running commands, but print a warning, since the longer
timeout may cause the hung task watchdog to trigger. In the case of a
firmware update operation, this is preferable to failing outright.
v2: Use bp->hwrm_cmd_max_timeout directly without the constants.
Fixes: 881d8353b05e ("bnxt_en: Add an upper bound for all firmware command timeouts.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 662c9b22f5b568fe79e69b06f3c926cad965bfd2
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Jan 9 18:54:43 2022 -0500
bnxt_en: improve VF error messages when PF is unavailable
The current driver design relies on the PF netdev being open in order
to intercept the following HWRM commands from a VF:
- HWRM_FUNC_VF_CFG
- HWRM_CFA_L2_FILTER_ALLOC
- HWRM_PORT_PHY_QCFG (only if FW_CAP_LINK_ADMIN is not supported)
If the PF is closed, then VFs are subjected to rather inscrutable error
messages in response to any configuration requests involving the above
command types. Recent firmware distinguishes this problem case from
other errors by returning HWRM_ERR_CODE_PF_UNAVAILABLE. In most cases,
the appropriate course of action is still to fail, but this can now be
accomplished with the aid of more user informative log messages. For L2
filter allocations that are already asynchronous, an automatic retry
seems more appropriate.
v2: Delete extra newline.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 8fa4219dba8e621aa1e78dfa7eeab10f55acb3c0
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Jan 9 18:54:42 2022 -0500
bnxt_en: add dynamic debug support for HWRM messages
Add logging of firmware messages. These can be useful for diagnosing
issues in the field, but due to their verbosity are only appropriate
at a debug message level.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit b6459415b384cb829f0b2a4268f211c789f6cf0b
Author: Jakub Kicinski <kuba@kernel.org>
Date: Tue Dec 28 16:49:13 2021 -0800
net: Don't include filter.h from net/sock.h
sock.h is pretty heavily used (5k objects rebuilt on x86 after
it's touched). We can drop the include of filter.h from it and
add a forward declaration of struct sk_filter instead.
This decreases the number of rebuilt objects when bpf.h
is touched from ~5k to ~1k.
There's a lot of missing includes this was masking. Primarily
in networking tho, this time.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/bpf/20211229004913.513372-1-kuba@kernel.org
commit 720908e5f816d56579e098e32bd3b56bad2be8f0
Author: Jakub Kicinski <kuba@kernel.org>
Date: Mon Dec 27 03:00:32 2021 -0500
bnxt_en: Use page frag RX buffers for better software GRO performance
If NETIF_F_GRO_HW is disabled, the existing driver code uses kmalloc'ed
data for RX buffers. This causes inefficient SW GRO performance
because the GRO data is merged using the less efficient frag_list.
Use netdev_alloc_frag() and friends instead so that GRO data can be
merged into skb_shinfo(skb)->frags for better performance.
[Use skb_free_frag() - Vikas Gupta]
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b976969bed83e90fffb9e750e1d1562956500cd9
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon Dec 27 03:00:31 2021 -0500
bnxt_en: convert to xdp_do_flush
The xdp_do_flush_map function has been replaced with the more general
xdp_do_flush().
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3fcbdbd5d8d51d14ad5687a253990e89da9b7661
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Dec 27 03:00:30 2021 -0500
bnxt_en: Support CQE coalescing mode in ethtool
Support showing and setting the CQE mode in ethtool.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit df78ea22460b6c625bd2079686bec0d834e56946
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Dec 27 03:00:29 2021 -0500
bnxt_en: Support configurable CQE coalescing mode
CQE coalescing mode is the same as the timer reset coalescing mode
on Broadcom devices. Currently this mode is always enabled if it
is supported by the device. Restructure the code slightly to support
dynamically changing this mode.
Add a flags field to struct bnxt_coal. Initially, the CQE flag will
be set for the RX and TX side if the device supports it. We need to
move bnxt_init_dflt_coal() to set up default coalescing until the
capability is determined.
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dc1f5d1ebc5c7f70cd352b2b71097f972b244c94
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Mon Dec 27 03:00:28 2021 -0500
bnxt_en: enable interrupt sampling on 5750X for DIM
5750X (P5) chips handle receiving packets on the NQ rather than the main
completion queue so we need to get and set stats from the correct spots
for dynamic interrupt moderation.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0fb8582ae5b9bf0dc5a4fededabe7db16a8b430a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Dec 27 03:00:27 2021 -0500
bnxt_en: Log error report for dropped doorbell
Log the unrecognized error report type value as well.
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5a717f4a8e00f563962b736961a12b6798c839a0
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Mon Dec 27 03:00:26 2021 -0500
bnxt_en: Add event handler for PAUSE Storm event
FW has been modified to send a new async event when it detects
a pause storm. Register for this new event and log it upon receipt.
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 144d4c9e800da1230d817bbd50068a22e4cc688e
Author: Baowen Zheng <baowen.zheng@corigine.com>
Date: Fri Dec 17 19:16:18 2021 +0100
flow_offload: reject to offload tc actions in offload drivers
A follow-up patch will allow users to offload tc actions independent of
classifier in the software datapath.
In preparation for this, teach all drivers that support offload of the flow
tables to reject such configuration as currently none of them support it.
Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9c9211a3fc7aa41b2952765b62000443b3bb6f23
Author: Hangbin Liu <liuhangbin@gmail.com>
Date: Fri Dec 10 16:59:58 2021 +0800
net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX
Since commit 94dd016ae538 ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP
ioctl to active device") the user could get bond active interface's
PHC index directly. But when there is a failover, the bond active
interface will change, thus the PHC index is also changed. This may
break the user's program if they did not update the PHC timely.
This patch adds a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX.
When the user wants to get the bond active interface's PHC, they need to
add this flag and be aware the PHC index may be changed.
With the new flag. All flag checks in current drivers are removed. Only
the checking in net_hwtstamp_validate() is kept.
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c8064e5b4adac5e1255cf4f3b374e75b5376e7ca
Author: Paolo Abeni <pabeni@redhat.com>
Date: Tue Nov 30 11:08:07 2021 +0100
bpf: Let bpf_warn_invalid_xdp_action() report more info
In non trivial scenarios, the action id alone is not sufficient to
identify the program causing the warning. Before the previous patch,
the generated stack-trace pointed out at least the involved device
driver.
Let's additionally include the program name and id, and the relevant
device name.
If the user needs additional infos, he can fetch them via a kernel
probe, leveraging the arguments added here.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/ddb96bb975cbfddb1546cf5da60e77d5100b533c.1638189075.git.pabeni@redhat.com
commit 7462494408cd3de8b0bc1e79670bf213288501d0
Author: Hao Chen <chenhao288@hisilicon.com>
Date: Thu Nov 18 20:12:43 2021 +0800
ethtool: extend ringparam setting/getting API with rx_buf_len
Add two new parameters kernel_ringparam and extack for
.get_ringparam and .set_ringparam to extend more ring params
through netlink.
Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9f5363916a5099e618e6e40606e91b8ce0833754
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Nov 16 14:26:10 2021 -0500
bnxt_en: Fix compile error regression when CONFIG_BNXT_SRIOV is not set
bp->sriov_cfg is not defined when CONFIG_BNXT_SRIOV is not set. Fix
it by adding a helper function bnxt_sriov_cfg() to handle the logic
with or without the config option.
Fixes: 46d08f55d24e ("bnxt_en: extend RTNL to VF check in devlink driver_reinit")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1637090770-22835-1-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 4721031c3559db8eae61df305f10c00099a7c1d0
Author: Eric Dumazet <edumazet@google.com>
Date: Mon Nov 15 09:05:51 2021 -0800
net: move gro definitions to include/net/gro.h
include/linux/netdevice.h became too big, move gro stuff
into include/net/gro.h
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b0757491a118ae5727cf9f1c3a11544397d46596
Author: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Date: Mon Nov 15 02:38:01 2021 -0500
bnxt_en: reject indirect blk offload when hw-tc-offload is off
The driver does not check if hw-tc-offload is enabled for the device
before offloading a flow in the context of indirect block callback.
Fix this by checking NETIF_F_HW_TC in the features flag and rejecting
the offload request. This will avoid unnecessary dmesg error logs when
hw-tc-offload is disabled, such as these:
bnxt_en 0000:19:00.1 eno2np1: dev(ifindex=294) not on same switch
bnxt_en 0000:19:00.1 eno2np1: Error: bnxt_tc_add_flow: cookie=0xffff8dace1c88000 error=-22
bnxt_en 0000:19:00.0 eno1np0: dev(ifindex=294) not on same switch
bnxt_en 0000:19:00.0 eno1np0: Error: bnxt_tc_add_flow: cookie=0xffff8dace1c88000 error=-22
Reported-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Fixes: 627c89d00fb9 ("bnxt_en: flow_offload: offload tunnel decap rules via indirect callbacks")
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b68a1a933fe4a52a8316d214e3421f2a89bc113e
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon Nov 15 02:38:00 2021 -0500
bnxt_en: fix format specifier in live patch error message
This fixes type mismatch warning.
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 3c4153394e2c ("bnxt_en: implement firmware live patching")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 46d08f55d24e69e921456b5a40717da09199267b
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon Nov 15 02:37:59 2021 -0500
bnxt_en: extend RTNL to VF check in devlink driver_reinit
The fixes the race condition between configuring SR-IOV and devlink
reload. The SR-IOV configure logic already takes the RTNL lock,
setting sriov_cfg under the lock while changes are underway. Extend
the lock scope in devlink driver_reinit to cover the VF check and
don't run concurrently with SR-IOV configure.
Reported-by: Leon Romanovsky <leon@kernel.org>
Fixes: 228ea8c187d8 ("bnxt_en: implement devlink dev reload driver_reinit")
Cc: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6ab9f57a648953e2326b9ad000783c122d133c9d
Author: Wan Jiabing <wanjiabing@vivo.com>
Date: Mon Nov 1 22:03:12 2021 -0400
bnxt_en: avoid newline at end of message in NL_SET_ERR_MSG_MOD
Fix following coccicheck warning:
./drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:446:8-56: WARNING
avoid newline at end of message in NL_SET_ERR_MSG_MOD.
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20211102020312.16567-1-wanjiabing@vivo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 63185eb3aa267f2844580bbd8c9c1c97516f5dbb
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Fri Oct 29 03:47:55 2021 -0400
bnxt_en: Provide stored devlink "fw" version on older firmware
On older firmware that doesn't support the HWRM_NVM_GET_DEV_INFO
command that returns detailed stored firmware versions, fallback
to use the same firmware package version that is reported to ethtool.
Refactor bnxt_get_pkgver() in bnxt_ethtool.c so that devlink can call
and get the package version.
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3c4153394e2c749b415947b86eb560114ec0f64d
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:54 2021 -0400
bnxt_en: implement firmware live patching
Live patches are activated by using the 'limit no_reset' option when
performing a devlink dev reload fw_activate operation. These packages
must first be installed on the device in the usual way. For example,
via devlink dev flash or ethtool -f.
The devlink device info has also been enhanced to render stored and
running live patch versions.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 21e70778d0d4e677bf4b1882a3280cd05c80d559
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Oct 29 03:47:53 2021 -0400
bnxt_en: Update firmware interface to 1.10.2.63
The main changes are firmware live patch support and 2 additional FEC
standard counters.
Add the matching FEC counters to ethtool counter array. Firmware older
than 220 does not return the proper size of the extended RX counters so
we need to cap it at the smaller legacy size. Otherwise the new FEC
counters may show up with garbage values.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 188876db04a3524aa81ced7475686e7c44ca1a5e
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:52 2021 -0400
bnxt_en: implement dump callback for fw health reporter
Populate the dump with firmware 'live' coredump data. This includes
the information stored in NVRAM by the firmware exception handler
prior to recovery. Thus, the live dump includes the desired crash
context.
Firmware does not support HWRM calls after RESET_NOTIFY, so there is
no supported way to capture a coredump during the auto dump phase.
Detect this and abort when called from devlink_health_report().
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4e59f0600790cc205192203570a677375671d1d7
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:51 2021 -0400
bnxt_en: extract coredump command line from current task
Tools other than 'ethtool -w' may be used to produce a coredump. For
devlink health, such dumps could even be driver initiated in response
to a health event. In these cases, the kernel thread information will
be placed in the coredump record instead.
v2: use min_t() instead of min() to fix the mismatched type warning
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 80194db9f53bc8877468f96734133b7a8d28aa4c
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Oct 29 03:47:50 2021 -0400
bnxt_en: Retrieve coredump and crashdump size via FW command
Recent firmware provides coredump and crashdump size info via
DBG_QCFG command. Read the dump sizes from firmware, instead of
computing in the driver. This patch reduces the time taken
to collect the dump via ethtool.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 80f62ba9d53d40e7a71b79543026e8e20afe4ec1
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Oct 29 03:47:49 2021 -0400
bnxt_en: Add compression flags information in coredump segment header
Firmware sets compression flags for each segment, add this information
while filling segment header.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b032228e58ea2477955058ad4d70a636ce1dec51
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:48 2021 -0400
bnxt_en: move coredump functions into dedicated file
Change bnxt_get_coredump() and bnxt_get_coredump_length() to non-static
functions.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9a575c8c25ae2372112db6d6b3e553cd90e9f02b
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:47 2021 -0400
bnxt_en: Refactor coredump functions
The coredump functionality will be used by devlink health. Refactor
these functions that get coredump and coredump length. There is no
functional change, but the following checkpatch warnings were
addressed:
- strscpy is preferred over strlcpy.
- sscanf results should be checked, with an additional warning.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8cc95ceb7087d6910050286301d05f4824a0bf59
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:46 2021 -0400
bnxt_en: improve fw diagnose devlink health messages
Add firmware event counters as well as health state severity. In
the unhealthy state, recommend a remedy and inform the user as to
its impact.
Readability of the devlink tool's output is negatively impacted by
adding these fields to the diagnosis. The single line of text, as
rendered by devlink health diagnose, benefits from more terse
descriptions, which can be substituted without loss of clarity, even
in pretty printed JSON mode.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2bb21b8db5c0e515549d7d1d0de5dc905a32a338
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:45 2021 -0400
bnxt_en: consolidate fw devlink health reporters
Merge 'fw' and 'fw_fatal' health reporters. There is no longer a need
to distinguish between firmware reporters. Only bonafide errors are
reported now and no reports were being generated for the 'fw' reporter.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit aadb0b1a0b3628291dff2dab8c8af1b63df1cae9
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:44 2021 -0400
bnxt_en: remove fw_reset devlink health reporter
Firmware resets initiated by the user are not errors and should not
be reported via devlink. Once only unsolicited resets remain, it is no
longer sensible to maintain a separate fw_reset reporter.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1596847d0f7b00147c4cb01158325d72c096cdde
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:43 2021 -0400
bnxt_en: improve error recovery information messages
The recovery election messages are often mistaken for errors. Improve
the wording to clarify the meaning of these frequent and expected
events. Also, take the first step towards more inclusive language.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 892a662f04736ba40e241c794b15f1b2ee489dc3
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:42 2021 -0400
bnxt_en: add enable_remote_dev_reset devlink parameter
The reported parameter value should not take into account the state
of remote drivers. Firmware will reject remote resets as appropriate,
thus it is not strictly necessary to check HOT_RESET_ALLOWED before
attempting to initiate a reset. But we add the check so that we can
provide more intuitive messages when reset is not permitted.
This firmware setting needs to be restored from all functions after
a firmware reset.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8f6c5e4d1470499b8feff98353eb2920bd81635a
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:41 2021 -0400
bnxt_en: implement devlink dev reload fw_activate
Similar to reload driver_reinit, the RTNL lock is held across reload
down and up to prevent interleaving state changes. But we need to
subsequently release the RTNL lock while waiting for firmware reset
to complete.
Also keep a statistic on fw_activate resets initiated remotely from
other functions.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 228ea8c187d814e1b8e369086e640dfc1d42974f
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:40 2021 -0400
bnxt_en: implement devlink dev reload driver_reinit
The RTNL lock must be held between down and up to prevent interleaving
state changes, especially since external state changes might release
and allocate different driver resource subsets that would otherwise
need to be tracked and carefully handled. If the down function fails,
then devlink will not call the corresponding up function, thus the
lock is released in the down error paths.
v2: Don't use devlink_reload_disable() and devlink_reload_enable().
Instead, check that the netdev is not in unregistered state before
proceeding with reload.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-Off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d900aadd86b0c9ddb8b78e5fa512fb4133b30559
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:39 2021 -0400
bnxt_en: refactor cancellation of resource reservations
Resource reservations will also need to be reset after FUNC_DRV_UNRGTR
in the following devlink driver_reinit patch. Extract this logic into a
reusable function.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c7dd4a5b0a155c4db0ff9758668235651c2ebf22
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Oct 29 03:47:38 2021 -0400
bnxt_en: refactor printing of device info
The device info logged during probe will be reused by the devlink
driver_reinit code in a following patch. Extract this logic into
the new bnxt_print_device_info() function. The board index needs
to be saved in the driver context so that the board information
can be retrieved at a later time, outside of the probe function.
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 766607570becbd26cab6d66a544dd8d0d964df5a
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Oct 14 07:24:31 2021 -0700
ethernet: constify references to netdev->dev_addr in drivers
This big patch sprinkles const on local variables and
function arguments which may refer to netdev->dev_addr.
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Some of the changes here are not strictly required - const
is sometimes cast off but pointer is not used for writing.
It seems like it's still better to add the const in case
the code changes later or relevant -W flags get enabled
for the build.
No functional changes.
Link: https://lore.kernel.org/r/20211014142432.449314-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 4b70dce2c1b93930fe4728a221a8d8e674c271c5
Author: Juhee Kang <claudiajkang@gmail.com>
Date: Sun Oct 10 13:03:27 2021 +0900
bnxt: use netif_is_rxfh_configured instead of open code
The open code which is dev->priv_flags & IFF_RXFH_CONFIGURED is defined as
a helper function on netdevice.h. So use netif_is_rxfh_configured()
function instead of open code. This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a05e4c0af490ca7c22fc77120aafebebdeaaf537
Author: Jakub Kicinski <kuba@kernel.org>
Date: Mon Oct 4 09:05:21 2021 -0700
ethernet: use eth_hw_addr_set() for dev->addr_len cases
Convert all Ethernet drivers from memcpy(... dev->addr_len)
to eth_hw_addr_set():
@@
expression dev, np;
@@
- memcpy(dev->dev_addr, np, dev->addr_len)
+ eth_hw_addr_set(dev, np)
In theory addr_len may not be ETH_ALEN, but we don't expect
non-Ethernet devices to live under this directory, and only
the following cases of setting addr_len exist:
- cxgb4 for mgmt device,
and the drivers which set it to ETH_ALEN: s2io, mlx4, vxge.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f3956ebb3bf06ab2266ad5ee2214aed46405810c
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Oct 1 14:32:23 2021 -0700
ethernet: use eth_hw_addr_set() instead of ether_addr_copy()
Convert Ethernet from ether_addr_copy() to eth_hw_addr_set():
@@
expression dev, np;
@@
- ether_addr_copy(dev->dev_addr, np)
+ eth_hw_addr_set(dev, np)
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a96d317fb1a30b9f323548eb2ff05d4e4600ead9
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Oct 1 14:32:20 2021 -0700
ethernet: use eth_hw_addr_set()
Convert all Ethernet drivers from memcpy(... ETH_ADDR)
to eth_hw_addr_set():
@@
expression dev, np;
@@
- memcpy(dev->dev_addr, np, ETH_ALEN)
+ eth_hw_addr_set(dev, np)
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5df290e7a70367d476406420d19c4dea14d45dd1
Author: Leon Romanovsky <leon@kernel.org>
Date: Sat Sep 25 14:22:42 2021 +0300
bnxt_en: Register devlink instance at the end devlink configuration
Move devlink_register() to be last command in devlink configuration
sequence, so no user space access will be possible till devlink instance
is fully operable. As part of this change, the devlink_params_publish
call is removed as not needed.
This change fixes forgotten devlink_params_unpublish() too.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 61415c3db3d98c74bfe8f9e8688b6e40b4c3e1d4
Author: Leon Romanovsky <leon@kernel.org>
Date: Thu Sep 23 21:12:49 2021 +0300
bnxt_en: Properly remove port parameter support
This driver doesn't have any port parameters and registers
devlink port parameters with empty table. Remove the useless
calls to devlink_port_params_register and _unregister.
Fixes: da203dfa89ce ("Revert "devlink: Add a generic wake_on_lan port parameter"")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e624c70e1131e145bd0510b8a700b5e2d112e377
Author: Leon Romanovsky <leon@kernel.org>
Date: Thu Sep 23 21:12:48 2021 +0300
bnxt_en: Check devlink allocation and registration status
devlink is a software interface that doesn't depend on any hardware
capabilities. The failure in SW means memory issues, wrong parameters,
programmer error e.t.c.
Like any other such interface in the kernel, the returned status of
devlink APIs should be checked and propagated further and not ignored.
Fixes: 4ab0c6a8ffd7 ("bnxt_en: add support to enable VF-representors")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit db4278c55fa53760893266538e86e638330b03bb
Author: Leon Romanovsky <leon@kernel.org>
Date: Wed Sep 22 11:58:03 2021 +0300
devlink: Make devlink_register to be void
devlink_register() can't fail and always returns success, but all drivers
are obligated to check returned status anyway. This adds a lot of boilerplate
code to handle impossible flow.
Make devlink_register() void and simplify the drivers that use that
API call.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Vladimir Oltean <olteanv@gmail.com> # dsa
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5bed8b0704c9ecccc8f4a2c377d7c8e21090a82e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 20 02:51:52 2021 -0400
bnxt_en: Fix TX timeout when TX ring size is set to the smallest
The smallest TX ring size we support must fit a TX SKB with MAX_SKB_FRAGS
+ 1. Because the first TX BD for a packet is always a long TX BD, we
need an extra TX BD to fit this packet. Define BNXT_MIN_TX_DESC_CNT with
this value to make this more clear. The current code uses a minimum
that is off by 1. Fix it using this constant.
The tx_wake_thresh to determine when to wake up the TX queue is half the
ring size but we must have at least BNXT_MIN_TX_DESC_CNT for the next
packet which may have maximum fragments. So the comparison of the
available TX BDs with tx_wake_thresh should be >= instead of > in the
current code. Otherwise, at the smallest ring size, we will never wake
up the TX queue and will cause TX timeout.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7c3a0a018e672a9723a79b128227272562300055
Author: Eli Cohen <elic@nvidia.com>
Date: Wed Sep 15 07:47:27 2021 +0300
net/{mlx5|nfp|bnxt}: Remove unnecessary RTNL lock assert
Remove the assert from the callback priv lookup function since it does
not require RTNL lock and is already protected by flow_indr_block_lock.
This will avoid warnings from being emitted to dmesg if the driver
registers its callback after an ingress qdisc was created for a
netdevice.
The warnings started after the following patch was merged:
commit 74fc4f828769 ("net: Fix offloading indirect devices dependency on qdisc order creation")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 985941e1dd5e996311c29688ca0d3aa1ff8eb0b6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 12 12:34:49 2021 -0400
bnxt_en: Clean up completion ring page arrays completely
We recently changed the completion ring page arrays to be dynamically
allocated to better support the expanded range of ring depths. The
cleanup path for this was not quite complete. It might cause the
shutdown path to crash if we need to abort before the completion ring
arrays have been allocated and initialized.
Fix it by initializing the ring_mem->pg_arr to NULL after freeing the
completion ring page array. Add a check in bnxt_free_ring() to skip
referencing the rmem->pg_arr if it is NULL.
Fixes: 03c7448790b8 ("bnxt_en: Don't use static arrays for completion ring pages")
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1affc01fdc6035189a5ab2a24948c9419ee0ecf2
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 12 12:34:48 2021 -0400
bnxt_en: make bnxt_free_skbs() safe to call after bnxt_free_mem()
The call to bnxt_free_mem(..., false) in the bnxt_half_open_nic() error
path will deallocate ring descriptor memory via bnxt_free_?x_rings(),
but because irq_re_init is false, the ring info itself is not freed.
To simplify error paths, deallocation functions have generally been
written to be safe when called on unallocated memory. It should always
be safe to call dev_close(), which calls bnxt_free_skbs() a second time,
even in this semi- allocated ring state.
Calling bnxt_free_skbs() a second time with the rings already freed will
cause NULL pointer dereference. Fix it by checking the rings are valid
before proceeding in bnxt_free_tx_skbs() and
bnxt_free_one_rx_ring_skbs().
Fixes: 975bc99a4a39 ("bnxt_en: Refactor bnxt_free_rx_skbs().")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit eca4cf12acda306f851f6d2a05b1c9ef62cf0e81
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 12 12:34:47 2021 -0400
bnxt_en: Fix error recovery regression
The recent patch has introduced a regression by not reading the reset
count in the ERROR_RECOVERY async event handler. We may have just
gone through a reset and the reset count has just incremented. If
we don't update the reset count in the ERROR_RECOVERY event handler,
the health check timer will see that the reset count has changed and
will initiate an unintended reset.
Restore the unconditional update of the reset count in
bnxt_async_event_process() if error recovery watchdog is enabled.
Also, update the reset count at the end of the reset sequence to
make it even more robust.
Fixes: 1b2b91831983 ("bnxt_en: Fix possible unintended driver initiated error recovery")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1b2b91831983aeac3adcbb469aa8b0dc71453f89
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 5 14:10:59 2021 -0400
bnxt_en: Fix possible unintended driver initiated error recovery
If error recovery is already enabled, bnxt_timer() will periodically
check the heartbeat register and the reset counter. If we get an
error recovery async. notification from the firmware (e.g. change in
primary/secondary role), we will immediately read and update the
heartbeat register and the reset counter. If the timer for the next
health check expires soon after this, we may read the heartbeat register
again in quick succession and find that it hasn't changed. This will
trigger error recovery unintentionally.
The likelihood is small because we also reset fw_health->tmr_counter
which will reset the interval for the next health check. But the
update is not protected and bnxt_timer() can miss the update and
perform the health check without waiting for the full interval.
Fix it by only reading the heartbeat register and reset counter in
bnxt_async_event_process() if error recovery is trasitioning to the
enabled state. Also add proper memory barriers so that when enabling
for the first time, bnxt_timer() will see the tmr_counter interval and
perform the health check after the full interval has elapsed.
Fixes: 7e914027f757 ("bnxt_en: Enable health monitoring.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7ae9dc356f247ad9f9634b3da61a45eb72968b2e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 5 14:10:58 2021 -0400
bnxt_en: Fix UDP tunnel logic
The current logic assumes that when the driver sends the message to the
firmware to add the VXLAN or Geneve port, the firmware will never fail
the operation. The UDP ports are always stored and are used to check
the tunnel packets in .ndo_features_check(). These tunnnel packets
will fail to offload on the transmit side if firmware fails the call to
add the UDP ports.
To fix the problem, bp->vxlan_port and bp->nge_port will only be set to
the offloaded ports when the HWRM_TUNNEL_DST_PORT_ALLOC firmware call
succeeds. When deleting a UDP port, we check that the port was
previously added successfuly first by checking the FW ID.
Fixes: 1698d600b361 ("bnxt_en: Implement .ndo_features_check().")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6fdab8a3ade2adc123bbf5c4fdec3394560b1fb1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 5 14:10:57 2021 -0400
bnxt_en: Fix asic.rev in devlink dev info command
The current asic.rev is incomplete and does not include the metal
revision. Add the metal revision and decode the complete asic
revision into the more common and readable form (A0, B0, etc).
Fixes: 7154917a12b2 ("bnxt_en: Refactor bnxt_dl_info_get().")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit beb55fcf950f5454715df05234bb2b2914bc97ac
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 5 14:10:56 2021 -0400
bnxt_en: fix read of stored FW_PSID version on P5 devices
P5 devices store NVM arrays using a different internal representation.
This implementation detail permeates into the HWRM API, requiring the
caller to explicitly index the array elements in HWRM_NVM_GET_VARIABLE
on these devices. Conversely, older devices do not support the indexed
mode of operation and require reading the raw NVM content.
Fixes: db28b6c77f40 ("bnxt_en: Fix devlink info's stored fw.psid version format.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1656db67233e4259281d2ac35b25f712edbbc20b
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 5 14:10:55 2021 -0400
bnxt_en: fix stored FW_PSID version masks
The FW_PSID version components are 8 bits wide, not 4.
Fixes: db28b6c77f40 ("bnxt_en: Fix devlink info's stored fw.psid version format.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5240118f08a07669537677be19edbf008682f8bd
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Wed Sep 1 11:53:15 2021 -0700
bnxt_en: fix kernel doc warnings in bnxt_hwrm.c
Parameter names in the comments did not match the function arguments.
Fixes: 213808170840 ("bnxt_en: add support for HWRM request slices")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Reported-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20210901185315.57137-1-edwin.peer@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit c6132f6f2e682c958f7022ecfd8bec35723a1a9d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Aug 31 21:15:23 2021 -0400
bnxt_en: Fix 64-bit doorbell operation on 32-bit kernels
The driver requires 64-bit doorbell writes to be atomic on 32-bit
architectures. So we redefined writeq as a new macro with spinlock
protection on 32-bit architectures. This created a new warning when
we added a new file in a recent patchset. writeq is defined on many
32-bit architectures to do the memory write non-atomically and it
generated a new macro redefined warning. This warning was fixed
incorrectly in the recent patch.
Fix this properly by adding a new bnxt_writeq() function that will
do the non-atomic write under spinlock on 32-bit systems. All callers
in the driver will now call bnxt_writeq() instead.
v2: Need to pass in bp to bnxt_writeq()
Use lo_hi_writeq() [suggested by Florian]
Reported-by: kernel test robot <lkp@intel.com>
Fixes: f9ff578251dc ("bnxt_en: introduce new firmware message API based on DMA pools")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 68f684e257d7f3a6303b0e838bfa982c74f2c8da
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:35:06 2021 -0400
bnxt_en: support multiple HWRM commands in flight
Add infrastructure to maintain a pending list of HWRM commands awaiting
completion and reduce the scope of the hwrm_cmd_lock mutex so that it
protects only the request mailbox. The mailbox is free to use for one
or more concurrent commands after receiving deferred response events.
For uniformity and completeness, use the same pending list for
collecting completions for commands that respond via a completion ring.
These commands are only used for freeing rings and for IRQ test and
we only support one such command in flight.
Note deferred responses are also only supported on the main channel.
The secondary channel (KONG) does not support deferred responses.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b34695a894b88e50e16dd3dcb1098fe919023f14
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:35:05 2021 -0400
bnxt_en: remove legacy HWRM interface
There are no longer any callers relying on the old API.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bbf33d1d9805fc3a59ded637ab6555fb20edb5d2
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:35:04 2021 -0400
bnxt_en: update all firmware calls to use the new APIs
The conversion follows this general pattern for most of the calls:
1. The input message is changed from a stack variable initialized
using bnxt_hwrm_cmd_hdr_init() to a pointer allocated and intialized
using hwrm_req_init().
2. If we don't need to read the firmware response, the hwrm_send_message()
call is replaced with hwrm_req_send().
3. If we need to read the firmware response, the mutex lock is replaced
by hwrm_req_hold() to hold the response. When the response is read, the
mutex unlock is replaced by hwrm_req_drop().
If additional DMA buffers are needed for firmware response data, the
hwrm_req_dma_slice() is used instead of calling dma_alloc_coherent().
Some minor refactoring is also done while doing these conversions.
v2: Fix unintialized variable warnings in __bnxt_hwrm_get_tx_rings()
and bnxt_approve_mac()
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3c10ed497fa87780a9ee8c31092373e5f1e20f64
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:35:03 2021 -0400
bnxt_en: use link_lock instead of hwrm_cmd_lock to protect link_info
We currently use the hwrm_cmd_lock to serialize the update of the
firmware's link status response data and the copying of link status data
to the VF. This won't work when we update the firmware message APIs, so
we use the link_lock mutex instead. All link_info data should be
updated under the link_lock mutex. Also add link_lock to functions that
touch link_info in __bnxt_open_nic() and bnxt_probe_phy(). The locking
is probably not strictly necessary during probe, but it's more consistent.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2138081708405fb9c16a76a9b6ef46c35d3f17a9
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:35:02 2021 -0400
bnxt_en: add support for HWRM request slices
Slices are a mechanism for suballocating DMA mapped regions from the
request buffer. Such regions can be used for indirect command data
instead of creating new mappings with dma_alloc_coherent().
The advantage of using a slice is that the lifetime of the slice is
bound to the request and will be automatically unmapped when the
request is consumed.
A single external region is also supported. This allows for regions
that will not fit inside the spare request buffer space such that
the same API can be used consistently even for larger mappings.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ecddc29d928d0ecccbc8f339b59ed75e5c8e8ecf
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:35:01 2021 -0400
bnxt_en: add HWRM request assignment API
hwrm_req_replace() provides an assignment like operation to replace a
managed HWRM request object with data from a pre-built source. This is
useful for handling request data provided by higher layer HWRM clients.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 02b9aa1068682319508f9a1678e993ad958a8a4f
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:35:00 2021 -0400
bnxt_en: discard out of sequence HWRM responses
During firmware crash recovery, it is possible for firmware to respond
to stale HWRM commands that have already timed out. Because response
buffers may be reused, any out of sequence responses need to be ignored
and only the matching seq_id should be accepted.
Also, READ_ONCE should be used for the reads from the DMA buffer to
ensure that the necessary loads are scheduled.
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f9ff578251dc2f1cf5b9b007e050033d8414829d
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:34:59 2021 -0400
bnxt_en: introduce new firmware message API based on DMA pools
This change constitutes a major step towards supporting multiple
firmware commands in flight by maintaining a separate response buffer
for the duration of each request. These firmware commands are also
known as Hardware Resource Manager (HWRM) commands. Using separate
response buffers requires an API change in order for callers to be
able to free the buffer when done.
It is impossible to keep the existing APIs unchanged. The existing
usage for a simple HWRM message request such as the following:
struct input req = {0};
bnxt_hwrm_cmd_hdr_init(bp, &req, REQ_TYPE, -1, -1);
rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
if (rc)
/* error */
changes to:
struct input *req;
rc = hwrm_req_init(bp, req, REQ_TYPE);
if (rc)
/* error */
rc = hwrm_req_send(bp, req); /* consumes req */
if (rc)
/* error */
The key changes are:
1. The req is no longer allocated on the stack.
2. The caller must call hwrm_req_init() to allocate a req buffer and
check for a valid buffer.
3. The req buffer is automatically released when hwrm_req_send() returns.
4. If the caller wants to check the firmware response, the caller must
call hwrm_req_hold() to take ownership of the response buffer and
release it afterwards using hwrm_req_drop(). The caller is no longer
required to explicitly hold the hwrm_cmd_lock mutex to read the
response.
5. Because the firmware commands and responses all have different sizes,
some safeguards are added to the code.
This patch maintains legacy API compatibiltiy, implementing the old
API in terms of the new. The follow-on patches will convert all
callers to use the new APIs.
v2: Fix redefined writeq with parisc .config
Fix "cast from pointer to integer of different size" warning in
hwrm_calc_sentinel()
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3c8c20db769cd68e299b487035825e026b1a6ce9
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:34:58 2021 -0400
bnxt_en: move HWRM API implementation into separate file
Move all firmware messaging functions and definitions to new
bnxt_hwrm.[ch]. The follow-on patches will make major modifications
to these APIs.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7b370ad77392455dccd77c121b48bc9f76a14cbe
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:34:57 2021 -0400
bnxt_en: Refactor the HWRM_VER_GET firmware calls
Refactor the code so that __bnxt_hwrm_ver_get() does not call
bnxt_hwrm_do_send_msg() directly. The new APIs will not expose this
internal call. Add a new bnxt_hwrm_poll() to poll the HWRM_VER_GET
firmware call silently. The other bnxt_hwrm_ver_get() function will
send the HWRM_VER_GET message directly with error logs enabled.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6c172d59ad79d3973e393ba49d819ed6f0417202
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Aug 29 03:34:56 2021 -0400
bnxt_en: remove DMA mapping for KONG response
The additional response buffer serves no useful purpose. There can
be only one firmware command in flight due to the hwrm_cmd_lock mutex,
which is taken for the entire duration of any command completion,
KONG or otherwise. It is thus safe to share a single DMA buffer.
Removing the code associated with the additional mapping will simplify
matters in the next patch, which allocates response buffers from DMA
pools on a per request basis.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 907fd4a294dbb9ce12d9e47cb6fcf4dcc7b2a5f3
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Aug 27 08:27:45 2021 -0700
bnxt: count discards due to memory allocation errors
Count packets dropped due to buffer or skb allocation errors.
Report as part of rx_dropped.
v2: drop the ethtool -S entry [Vladimir]
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 40bedf7cb2ac949052bf9741ccb9d673d782ae2c
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Aug 27 08:27:44 2021 -0700
bnxt: count packets discarded because of netpoll
bnxt may discard packets if Rx completions are consumed
in an attempt to let netpoll make progress. It should be
extremely rare in practice but nonetheless such events
should be counted.
Since completion ring memory is allocated dynamically use
a similar scheme to what is done for HW stats to save them.
Report the stats in rx_dropped and per-netdev ethtool
counter. Chances that users care which ring dropped are
very low.
v3: only save the stat to rx_dropped on reset,
rx_total_netpoll_discards will now only show drops since
last reset, similar to other "total_discard" counters.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 0ff25f6a17c76d50e5d4bdd29bb69ad173a3cde1
Author: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun Aug 22 15:56:24 2021 +0200
bnxt: Search VPD with pci_vpd_find_ro_info_keyword()
Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to
simplify the code.
Link: https://lore.kernel.org/r/f062921c-ad33-3b3e-8ada-b53427a9cd4a@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
commit 550cd7c1b45b568ccac28fd46663799f1ff8a62d
Author: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun Aug 22 15:55:23 2021 +0200
bnxt: Read VPD with pci_vpd_alloc()
Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and
read the full VPD data into it.
This simplifies the code, and we no longer have to make assumptions about
VPD size.
Link: https://lore.kernel.org/r/62522a24-f39a-2b35-1577-1fbb41695bed@gmail.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
commit f3ccfda1931977b80267ba54070a1aeafa18f6ca
Author: Yufeng Mo <moyufeng@huawei.com>
Date: Fri Aug 20 15:35:18 2021 +0800
ethtool: extend coalesce setting uAPI with CQE mode
In order to support more coalesce parameters through netlink,
add two new parameter kernel_coal and extack for .set_coalesce
and .get_coalesce, then some extra info can return to user with
the netlink API.
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit df70303dd14623829a4acdec539c929accb92e0e
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Sun Aug 22 07:59:44 2021 +0200
net: broadcom: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.
The patch has been generated with the coccinelle script below.
It has been compile tested.
@@
@@
- PCI_DMA_BIDIRECTIONAL
+ DMA_BIDIRECTIONAL
@@
@@
- PCI_DMA_TODEVICE
+ DMA_TO_DEVICE
@@
@@
- PCI_DMA_FROMDEVICE
+ DMA_FROM_DEVICE
@@
@@
- PCI_DMA_NONE
+ DMA_NONE
@@
expression e1, e2, e3;
@@
- pci_alloc_consistent(e1, e2, e3)
+ dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
@@
expression e1, e2, e3;
@@
- pci_zalloc_consistent(e1, e2, e3)
+ dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
@@
expression e1, e2, e3, e4;
@@
- pci_free_consistent(e1, e2, e3, e4)
+ dma_free_coherent(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_map_single(e1, e2, e3, e4)
+ dma_map_single(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_single(e1, e2, e3, e4)
+ dma_unmap_single(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4, e5;
@@
- pci_map_page(e1, e2, e3, e4, e5)
+ dma_map_page(&e1->dev, e2, e3, e4, e5)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_page(e1, e2, e3, e4)
+ dma_unmap_page(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_map_sg(e1, e2, e3, e4)
+ dma_map_sg(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_sg(e1, e2, e3, e4)
+ dma_unmap_sg(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+ dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_single_for_device(e1, e2, e3, e4)
+ dma_sync_single_for_device(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+ dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+ dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
@@
expression e1, e2;
@@
- pci_dma_mapping_error(e1, e2)
+ dma_mapping_error(&e1->dev, e2)
@@
expression e1, e2;
@@
- pci_set_dma_mask(e1, e2)
+ dma_set_mask(&e1->dev, e2)
@@
expression e1, e2;
@@
- pci_set_consistent_dma_mask(e1, e2)
+ dma_set_coherent_mask(&e1->dev, e2)
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 828affc27ed43441bd1efdaf4e07e96dd43a0362
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 15 16:15:37 2021 -0400
bnxt_en: Add missing DMA memory barriers
Each completion ring entry has a valid bit to indicate that the entry
contains a valid completion event. The driver's main poll loop
__bnxt_poll_work() has the proper dma_rmb() to make sure the valid
bit of the next entry has been checked before proceeding further.
But when we call bnxt_rx_pkt() to process the RX event, the RX
completion event consists of two completion entries and only the
first entry has been checked to be valid. We need the same barrier
after checking the next completion entry. Add missing dma_rmb()
barriers in bnxt_rx_pkt() and other similar locations.
Fixes: 67a95e2022c7 ("bnxt_en: Need memory barrier when processing the completion ring.")
Reported-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 976e52b718c3de9077fff8f3f674afb159c57fb1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 15 16:15:36 2021 -0400
bnxt_en: Disable aRFS if running on 212 firmware
212 firmware broke aRFS, so disable it. Traffic may stop after ntuple
filters are inserted and deleted by the 212 firmware.
Fixes: ae10ae740ad2 ("bnxt_en: Add new hardware RFS mode.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fb9f7190092d2bbd1f8f0b1cc252732cbe99a87e
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Aug 12 14:42:42 2021 -0700
bnxt: count Tx drops
Drivers should count packets they are dropping.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit e8d8c5d80f5e9d4586c68061b62c642752289095
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Aug 12 14:42:41 2021 -0700
bnxt: make sure xmit_more + errors does not miss doorbells
skbs are freed on error and not put on the ring. We may, however,
be in a situation where we're freeing the last skb of a batch,
and there is a doorbell ring pending because of xmit_more() being
true earlier. Make sure we ring the door bell in such situations.
Since errors are rare don't pay attention to xmit_more() and just
always flush the pending frames.
The busy case should be safe to be left alone because it can
only happen if start_xmit races with completions and they
both enable the queue. In that case the kick can't be pending.
Noticed while reading the code.
Fixes: 4d172f21cefe ("bnxt_en: Implement xmit_more.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 01cca6b9330ac7460de44eeeb3a0607f8aae69ff
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Aug 12 14:42:40 2021 -0700
bnxt: disable napi before canceling DIM
napi schedules DIM, napi has to be disabled first,
then DIM canceled.
Noticed while reading the code.
Fixes: 0bc0b97fca73 ("bnxt_en: cleanup DIM work on device shutdown")
Fixes: 6a8788f25625 ("bnxt_en: add support for software dynamic interrupt moderation")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 3c603136c9f82833813af77185618de5af67676c
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Aug 12 14:42:39 2021 -0700
bnxt: don't lock the tx queue from napi poll
We can't take the tx lock from the napi poll routine, because
netpoll can poll napi at any moment, including with the tx lock
already held.
The tx lock is protecting against two paths - the disable
path, and (as Michael points out) the NETDEV_TX_BUSY case
which may occur if NAPI completions race with start_xmit
and both decide to re-enable the queue.
For the disable/ifdown path use synchronize_net() to make sure
closing the device does not race we restarting the queues.
Annotate accesses to dev_state against data races.
For the NAPI cleanup vs start_xmit path - appropriate barriers
are already in place in the main spot where Tx queue is stopped
but we need to do the same careful dance in the TX_BUSY case.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 919d13a7e455c2e7676042d7a5f94c164e859d8a
Author: Leon Romanovsky <leon@kernel.org>
Date: Sun Aug 8 21:57:43 2021 +0300
devlink: Set device as early as possible
All kernel devlink implementations call to devlink_alloc() during
initialization routine for specific device which is used later as
a parent device for devlink_register().
Such late device assignment causes to the situation which requires us to
call to device_register() before setting other parameters, but that call
opens devlink to the world and makes accessible for the netlink users.
Any attempt to move devlink_register() to be the last call generates the
following error due to access to the devlink->dev pointer.
[ 8.758862] devlink_nl_param_fill+0x2e8/0xe50
[ 8.760305] devlink_param_notify+0x6d/0x180
[ 8.760435] __devlink_params_register+0x2f1/0x670
[ 8.760558] devlink_params_register+0x1e/0x20
The simple change of API to set devlink device in the devlink_alloc()
instead of devlink_register() fixes all this above and ensures that
prior to call to devlink_register() everything already set.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 92529df76db5ab184b82674cf7a4eef4b665b40e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Aug 7 15:03:15 2021 -0400
bnxt_en: Use register window 6 instead of 5 to read the PHC
Some older Broadcom debug tools use window 5 and may conflict, so switch
to use window 6 instead.
Fixes: 118612d519d8 ("bnxt_en: Add PTP clock APIs, ioctls, and ethtool methods")
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9e26680733d5c6538ba2e7a111fb49c9ac2dc16a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Aug 7 15:03:14 2021 -0400
bnxt_en: Update firmware call to retrieve TX PTP timestamp
New firmware interface requires the PTP sequence ID header offset to
be passed to the firmware to properly find the matching timestamp
for all protocols.
Fixes: 83bb623c968e ("bnxt_en: Transmit and retrieve packet timestamps")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fbfee25796e2688004d58ad4d0673279366b97dd
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Aug 7 15:03:13 2021 -0400
bnxt_en: Update firmware interface to 1.10.2.52
The key change is the firmware call to retrieve the PTP TX timestamp.
The header offset for the PTP sequence number field is now added.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c1129b51ca0e6d261df7b49388af7962c8e9a19e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Aug 2 10:52:39 2021 -0400
bnxt_en: Increase maximum RX ring size if jumbo ring is not used
The current maximum RX ring size is defined assuming the RX jumbo ring
(aka aggregation ring) is used. The RX jumbo ring is automicatically used
when the MTU exceeds a threshold or when rx-gro-hw/lro is enabled. The RX
jumbo ring is automatically sized up to 4 times the size of the RX ring
size.
The BNXT_MAX_RX_DESC_CNT constant is the upper limit on the size of the
RX ring whether or not the RX jumbo ring is used. Obviously, the
maximum amount of RX buffer space is significantly less when the RX jumbo
ring is not used.
To increase flexibility for the user who does not use the RX jumbo ring,
we now define a bigger maximum RX ring size when the RX jumbo ring is not
used. The maximum RX ring size is now up to 8K when the RX jumbo ring
is not used. The maximum completion ring size also needs to be scaled
up to accomodate the larger maximum RX ring size.
Note that when the RX jumbo ring is re-enabled, the RX ring size will
automatically drop if it exceeds the maximum.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 03c7448790b87cec82a2f1406ff40dd1a8861170
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Aug 2 10:52:38 2021 -0400
bnxt_en: Don't use static arrays for completion ring pages
We currently store these page addresses and DMA addreses in static
arrays. On systems with 4K pages, we support up to 64 pages per
completion ring. The actual number of pages for each completion ring
may be much less than 64. For example, when the RX ring size is set
to the default 511 entries, only 16 completion ring pages are needed
per ring.
In the next patch, we'll be doubling the maximum number of completion
pages. So we convert to allocate these arrays as needed instead of
declaring them statically.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit abf90ac2c292410c22bbce4dfedeb49b9b0295ff
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Wed Jul 28 14:11:45 2021 -0400
bnxt_en: Log if an invalid signal detected on TSIO pin
FW can report to driver via ASYNC event if it encountered an
invalid signal on any TSIO PIN. Driver will log this event
for the user to take corrective action.
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Arvind Susarla <arvind.susarla@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 099fdeda659d2071a97753a6479d13342ff2b285
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Wed Jul 28 14:11:44 2021 -0400
bnxt_en: Event handler for PPS events
Once the PPS pins are configured, the FW can report
PPS values using ASYNC event. This patch adds the
ASYNC event handler and subsequent reporting of the
events to kernel.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9e518f25802cc13adcdb26adaaccfc7e9de80d44
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Wed Jul 28 14:11:43 2021 -0400
bnxt_en: 1PPS functions to configure TSIO pins
Application will send ioctls to set/clear PPS pin functions
based on user input. This patch implements the driver
callbacks that will configure the TSIO pins using firmware
commands. After firmware reset, the TSIO pins will be reconfigured
again.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit caf3eedbcd8d326c9b789cc270b9ddcce254e0ce
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Wed Jul 28 14:11:42 2021 -0400
bnxt_en: 1PPS support for 5750X family chips
1PPS (One Pulse Per Second) is a signal generated either
by the NIC PHC or an external timing source.
Integrating the support to configure and use 1PPS using
the TSIO pins along with PTP timestamps will add Grand
Master capability to the 5750X family chipsets.
This patch initializes the driver data structures and
registers the 1PPS with kernel, based on the TSIO pins'
capability in the hardware. This will create a /dev/ppsX
device which applications can use to receive PPS events.
Later patches will define functions to configure and use
the pins.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 30e96f487f64c60b2884e37b9dabf287c9d048aa
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 28 14:11:41 2021 -0400
bnxt_en: Do not read the PTP PHC during chip reset
During error recovery or hot firmware upgrade, the chip may be under
reset and the PHC register read cycles may cause completion timeouts.
Check that the chip is not under reset condition before proceeding
to read the PHC by checking the flag BNXT_STATE_IN_FW_RESET. We also
need to take the ptp_lock before we set this flag to prevent race
conditions.
We need this logic because the PHC now will stay registered after
bnxt_close().
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a521c8a01d267bc1732ee83fdbf3ad2e02240d63
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 28 14:11:40 2021 -0400
bnxt_en: Move bnxt_ptp_init() from bnxt_open() back to bnxt_init_one()
It was pointed out by Richard Cochran that registering the PHC during
probe is better than during ifup, so move bnxt_ptp_init() back to
bnxt_init_one(). In order to work correctly after firmware reset which
may result in PTP config. changes, we modify bnxt_ptp_init() to return
if the PHC has been registered earlier. If PTP is no longer supported
by the new firmware, we will unregister the PHC and clean up.
This partially reverts:
d7859afb6880 ("bnxt_en: Move bnxt_ptp_init() to bnxt_open()")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a76053707dbf0dc020a73b4d90cd952409ef3691
Author: Arnd Bergmann <arnd@arndb.de>
Date: Tue Jul 27 15:45:13 2021 +0200
dev_ioctl: split out ndo_eth_ioctl
Most users of ndo_do_ioctl are ethernet drivers that implement
the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware
timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP.
Separate these from the few drivers that use ndo_do_ioctl to
implement SIOCBOND, SIOCBR and SIOCWANDEV commands.
This is a purely cosmetic change intended to help readers find
their way through the implementation.
Cc: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Vladimir Oltean <olteanv@gmail.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 758684e49f4c7ea2a75e249e486659f0950cd63e
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Mon Jul 26 14:52:48 2021 -0400
bnxt_en: Fix static checker warning in bnxt_fw_reset_task()
Now that we return when bnxt_open() fails in bnxt_fw_reset_task(),
there is no need to check for 'rc' value again before invoking
bnxt_reenable_sriov().
Fixes: 3958b1da725a ("bnxt_en: fix error path of FW reset")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 89bc7f456cd40e0be7b94f4fdae9186f22b76a05
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jul 23 17:53:48 2021 -0400
bnxt_en: Add missing periodic PHC overflow check
We use the timecounter APIs for the 48-bit PHC and packet timestamps.
We must periodically update the timecounter at roughly half the
overflow interval. The overflow interval is about 78 hours, so
update it every 19 hours (1/4 interval) for some extra margins.
Fixes: 390862f45c85 ("bnxt_en: Get the full 48-bit hardware timestamp periodically")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit de5bf19414fec860168f05d00d574562bd9d86d1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jul 18 15:36:33 2021 -0400
bnxt_en: Fix PTP capability discovery
The current PTP initialization logic does not account for firmware
reset that may cause PTP capability to change. The valid pointer
bp->ptp_cfg is used to indicate that the device is capable of PTP
and that it has been initialized. So we must clean up bp->ptp_cfg
and free it if the firmware after reset does not support PTP.
Fixes: 93cb62d98e9c ("bnxt_en: Enable hardware PTP support")
Cc: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d7859afb6880249039b178fdfb1bef94fd954cf2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jul 18 15:36:32 2021 -0400
bnxt_en: Move bnxt_ptp_init() to bnxt_open()
The device needs to be in ifup state for PTP to function, so move
bnxt_ptp_init() to bnxt_open(). This means that the PHC will be
registered during bnxt_open().
This also makes firmware reset work correctly. PTP configurations
may change after firmware upgrade or downgrade. bnxt_open() will
be called after firmware reset, so it will work properly.
bnxt_ptp_start() is now incorporated into bnxt_ptp_init(). We now
also need to call bnxt_ptp_clear() in bnxt_close().
Fixes: 93cb62d98e9c ("bnxt_en: Enable hardware PTP support")
Cc: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 11a39259ff79b74bc99f8b7c44075a2d6d5e7ab1
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Sun Jul 18 15:36:31 2021 -0400
bnxt_en: Check abort error state in bnxt_half_open_nic()
bnxt_half_open_nic() is called during during ethtool self test and is
protected by rtnl_lock. Firmware reset can be happening at the same
time. Only critical portions of the entire firmware reset sequence
are protected by the rtnl_lock. It is possible that bnxt_half_open_nic()
can be called when the firmware reset sequence is aborting. In that
case, bnxt_half_open_nic() needs to check if the ABORT_ERR flag is set
and abort if it is. The ethtool self test will fail but the NIC will be
brought to a consistent IF_DOWN state.
Without this patch, if bnxt_half_open_nic() were to continue in this
error state, it may crash like this:
bnxt_en 0000:82:00.1 enp130s0f1np1: FW reset in progress during close, FW reset will be aborted
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
...
Process ethtool (pid: 333327, stack limit = 0x0000000046476577)
Call trace:
bnxt_alloc_mem+0x444/0xef0 [bnxt_en]
bnxt_half_open_nic+0x24/0xb8 [bnxt_en]
bnxt_self_test+0x2dc/0x390 [bnxt_en]
ethtool_self_test+0xe0/0x1f8
dev_ethtool+0x1744/0x22d0
dev_ioctl+0x190/0x3e0
sock_ioctl+0x238/0x480
do_vfs_ioctl+0xc4/0x758
ksys_ioctl+0x84/0xb8
__arm64_sys_ioctl+0x28/0x38
el0_svc_handler+0xb0/0x180
el0_svc+0x8/0xc
Fixes: a1301f08c5ac ("bnxt_en: Check abort error state in bnxt_open_nic().")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 96bdd4b9ea7ef9a12db8fdd0ce90e37dffbd3703
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jul 18 15:36:30 2021 -0400
bnxt_en: Validate vlan protocol ID on RX packets
Only pass supported VLAN protocol IDs for stripped VLAN tags to the
stack. The stack will hit WARN() if the protocol ID is unsupported.
Existing firmware sets up the chip to strip 0x8100, 0x88a8, 0x9100.
Only the 1st two protocols are supported by the kernel.
Fixes: a196e96bb68f ("bnxt_en: clean up VLAN feature bit handling")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3958b1da725a477b4a222183d16a14d85445d4b6
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Sun Jul 18 15:36:29 2021 -0400
bnxt_en: fix error path of FW reset
When bnxt_open() fails in the firmware reset path, the driver needs to
gracefully abort, but it is executing code that should be invoked only
in the success path. Define a function to abort FW reset and
consolidate all error paths to call this new function.
Fixes: dab62e7c2de7 ("bnxt_en: Implement faster recovery for firmware fatal error.")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6cd657cb3ee6f4de57e635b126ffbe0e51d00f1a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jul 18 15:36:28 2021 -0400
bnxt_en: Add missing check for BNXT_STATE_ABORT_ERR in bnxt_fw_rset_task()
In the BNXT_FW_RESET_STATE_POLL_VF state in bnxt_fw_reset_task() after all
VFs have unregistered, we need to check for BNXT_STATE_ABORT_ERR after
we acquire the rtnl_lock. If the flag is set, we need to abort.
Fixes: 230d1f0de754 ("bnxt_en: Handle firmware reset.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2c9f046bc377efd1f5e26e74817d5f96e9506c86
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jul 18 15:36:27 2021 -0400
bnxt_en: Refresh RoCE capabilities in bnxt_ulp_probe()
The capabilities can change after firmware upgrade/downgrade, so we
should get the up-to-date RoCE capabilities everytime bnxt_ulp_probe()
is called.
Fixes: 2151fe0830fd ("bnxt_en: Handle RESET_NOTIFY async event from firmware.")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c08c59653415201ac46ab791c936ae804c45a11b
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Jul 18 15:36:26 2021 -0400
bnxt_en: reject ETS settings that will starve a TC
ETS proportions are presented to HWRM_QUEUE_COS2BW_CFG as minimum
bandwidth constraints. Thus, zero is a legal value for a given TC.
However, if all the other TCs sum up to 100%, then at least one
hardware queue will starve, resulting in guaranteed TX timeouts.
Reject such nonsensical configurations.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c81cfb6256d90ea5ba4a6fb280ea3b171be4e05c
Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Sun Jul 18 15:36:25 2021 -0400
bnxt_en: don't disable an already disabled PCI device
If device is already disabled in reset path and PCI io error is
detected before the device could be enabled, driver could
call pci_disable_device() for already disabled device. Fix this
problem by calling pci_disable_device() only if the device is already
enabled.
Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 93cb62d98e9c3d8c94cc09a15b9ab1faf342c392
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jun 27 13:19:50 2021 -0400
bnxt_en: Enable hardware PTP support
Call bnxt_ptp_init() to initialize and register with the clock driver
to enable PTP support. Call bnxt_ptp_free() to unregister and clean
up during shutdown.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 83bb623c968e7351aee5111547693f95f330dc5a
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Sun Jun 27 13:19:49 2021 -0400
bnxt_en: Transmit and retrieve packet timestamps
Setup the TXBD to enable TX timestamp if requested. At TX packet DMA
completion, if we requested TX timestamp on that packet, we defer to
.do_aux_work() to obtain the TX timestamp from the firmware before we
free the TX SKB.
v2: Use .do_aux_work() to get the TX timestamp from firmware.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7f5515d19cd7aa02a866fd86622a022f12e06f0f
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Sun Jun 27 13:19:48 2021 -0400
bnxt_en: Get the RX packet timestamp
If the RX packet is timestamped by the hardware, the RX completion
record will contain the lower 32-bit of the timestamp. This needs
to be combined with the upper 16-bit of the periodic timestamp that
we get from the timer. The previous snapshot in ptp->old_timer is
used to make sure that the snapshot is not ahead of the RX timestamp
and we adjust for wrap-around if needed.
v2: Make ptp->old_time read access safe on 32-bit CPUs.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 390862f45c85b8ebbf9c5c09192bf413a8fb72f8
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Sun Jun 27 13:19:47 2021 -0400
bnxt_en: Get the full 48-bit hardware timestamp periodically
From the bnxt_timer(), read the 48-bit hardware running clock
periodically and store it in ptp->current_time. The previous snapshot
of the clock will be stored in ptp->old_time. The old_time snapshot
will be used in the next patches to compute the RX packet timestamps.
v2: Use .do_aux_work() to read the timer periodically.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 118612d519d83b98ead11195a5c818f5e8904654
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jun 27 13:19:46 2021 -0400
bnxt_en: Add PTP clock APIs, ioctls, and ethtool methods
Add the clock APIs to set/get/adjust the hw clock, and the related
ioctls and ethtool methods.
v2: Propagate error code from ptp_clock_register().
Add spinlock to serialize access to the timecounter. The
timecounter is accessed in process context and the RX datapath.
Read the PHC using direct registers.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ae5c42f0b92ca0abefe2e3930a14fc2e716c81a2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jun 27 13:19:45 2021 -0400
bnxt_en: Get PTP hardware capability from firmware
Store PTP hardware info in a structure if hardware and firmware support PTP.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 78eeadb8fea6d1a37d5060fe2ea0a0b45f8d8860
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jun 27 13:19:44 2021 -0400
bnxt_en: Update firmware interface to 1.10.2.47
Adding the PTP related firmware interface is the main change.
There is also a name change for admin_mtu, requiring code fixup.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 158c1399fc45c5178a3f2b8b68ff2faa2e36a52d
Author: Toke Høiland-Jørgensen <toke@redhat.com>
Date: Thu Jun 24 18:05:58 2021 +0200
bnxt: Remove rcu_read_lock() around XDP program invocation
The bnxt driver has rcu_read_lock()/rcu_read_unlock() pairs around XDP
program invocations. However, the actual lifetime of the objects referred
by the XDP program invocation is longer, all the way through to the call to
xdp_do_flush(), making the scope of the rcu_read_lock() too small. This
turns out to be harmless because it all happens in a single NAPI poll
cycle (and thus under local_bh_disable()), but it makes the rcu_read_lock()
misleading.
Rather than extend the scope of the rcu_read_lock(), just get rid of it
entirely. With the addition of RCU annotations to the XDP_REDIRECT map
types that take bh execution into account, lockdep even understands this to
be safe, so there's really no reason to keep it around.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/bpf/20210624160609.292325-9-toke@redhat.com
commit 03400aaa69f916a376e11526cf591901a96a3a5c
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Fri Jun 18 02:07:27 2021 -0400
bnxt_en: Call bnxt_ethtool_free() in bnxt_init_one() error path
bnxt_ethtool_init() may have allocated some memory and we need to
call bnxt_ethtool_free() to properly unwind if bnxt_init_one()
fails.
Fixes: 7c3809181468 ("bnxt_en: Refactor bnxt_init_one() and turn on TPA support on 57500 chips.")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c12e1643d2738bcd4e26252ce531878841dd3f38
Author: Rukhsana Ansari <rukhsana.ansari@broadcom.com>
Date: Fri Jun 18 02:07:26 2021 -0400
bnxt_en: Fix TQM fastpath ring backing store computation
TQM fastpath ring needs to be sized to store both the requester
and responder side of RoCE QPs in TQM for supporting bi-directional
tests. Fix bnxt_alloc_ctx_mem() to multiply the RoCE QPs by a factor of
2 when computing the number of entries for TQM fastpath ring. This
fixes an RX pipeline stall issue when running bi-directional max
RoCE QP tests.
Fixes: c7dd7ab4b204 ("bnxt_en: Improve TQM ring context memory sizing formulas.")
Signed-off-by: Rukhsana Ansari <rukhsana.ansari@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0afd6a4e8028cc487c240b6cfe04094e45a306e4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jun 18 02:07:25 2021 -0400
bnxt_en: Rediscover PHY capabilities after firmware reset
There is a missing bnxt_probe_phy() call in bnxt_fw_init_one() to
rediscover the PHY capabilities after a firmware reset. This can cause
some PHY related functionalities to fail after a firmware reset. For
example, in multi-host, the ability for any host to configure the PHY
settings may be lost after a firmware reset.
Fixes: ec5d31e3c15d ("bnxt_en: Handle firmware reset status during IF_UP.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cc9fd18032efada6433712f52de8d98dfbd00fd2
Author: Gustavo A. R. Silva <gustavoars@kernel.org>
Date: Fri Nov 20 12:27:50 2020 -0600
bnxt_en: Fix fall-through warnings for Clang
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a break statement instead of just letting the code
fall through to the next case.
Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
commit 702279d2ce4650000bb6302013630304e359dc13
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat May 15 03:25:19 2021 -0400
bnxt_en: Fix context memory setup for 64K page size.
There was a typo in the code that checks for 64K BNXT_PAGE_SHIFT in
bnxt_hwrm_set_pg_attr(). Fix it and make the code more understandable
with a new macro BNXT_SET_CTX_PAGE_ATTR().
Fixes: 1b9394e5a2ad ("bnxt_en: Configure context memory on new devices.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ab21494be9dc7d62736c5fcd06be65d49df713ee
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Sat May 15 03:25:18 2021 -0400
bnxt_en: Include new P5 HV definition in VF check.
Otherwise, some of the recently added HyperV VF IDs would not be
recognized as VF devices and they would not initialize properly.
Fixes: 7fbf359bb2c1 ("bnxt_en: Add PCI IDs for Hyper-V VF devices.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit aa473d6ceb821d7c568c64cca7fff3e86ba9d789
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 11 19:10:50 2021 -0400
bnxt_en: Fix and improve .ndo_features_check().
Jakub Kicinski pointed out that we need to handle ipv6 extension headers
and to explicitly check for supported tunnel types in
.ndo_features_check().
For ipv6 extension headers, the hardware supports up to 2 ext. headers
and each must be <= 64 bytes. For tunneled packets, the supported
packets are UDP with supported VXLAN and Geneve ports, GRE, and IPIP.
v3: More improvements based on Alexander Duyck's valuable feedback -
Remove the jump lable in bnxt_features_check() and restructure it
so that the TCP/UDP is check is consolidated in bnxt_exthdr_check().
v2: Add missing step to check inner ipv6 header for UDP and GRE tunnels.
Check TCP/UDP next header after skipping ipv6 ext headers for
non-tunneled packets and for inner ipv6.
(Both feedback from Alexander Duyck)
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Fixes: 1698d600b361 ("bnxt_en: Implement .ndo_features_check().")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4cf0abbce69bde3d07757dfa9be6420407fdbc45
Author: Heiner Kallweit <hkallweit1@gmail.com>
Date: Thu Apr 1 18:43:15 2021 +0200
PCI/VPD: Remove pci_vpd_find_tag() 'offset' argument
All callers pass 0 as offset. Therefore remove the parameter and use a
fixed offset 0 in pci_vpd_find_tag().
Link: https://lore.kernel.org/r/f62e6e19-5423-2ead-b2bd-62844b23ef8f@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
commit 1698d600b361915fbe5eda63a613da55c435bd34
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 25 13:45:27 2021 -0400
bnxt_en: Implement .ndo_features_check().
For UDP encapsultions, we only support the offloaded Vxlan port and
Geneve port. All other ports included FOU and GUE are not supported so
we need to turn off TSO and checksum features.
v2: Reverse the check for supported UDP ports to be more straight forward.
Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dade5e15fade59a789c30bc47abfe926ddd856d6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 25 13:45:26 2021 -0400
bnxt_en: Support IFF_SUPP_NOFCS feature to transmit without ethernet FCS.
If firmware is capable, set the IFF_SUPP_NOFCS flag to support the
sockets option to transmit packets without FCS. This is mainly used
for testing.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7fbf359bb2c19c824cbb1954020680824f6ee5a5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 25 13:45:25 2021 -0400
bnxt_en: Add PCI IDs for Hyper-V VF devices.
Support VF device IDs used by the Hyper-V hypervisor.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 92923cc71012535cc5d760b1319675ad4c404c08
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 25 13:45:24 2021 -0400
bnxt_en: Call bnxt_approve_mac() after the PF gives up control of the VF MAC.
When the PF is no longer enforcing an assigned MAC address on a VF, the
VF needs to call bnxt_approve_mac() to tell the PF what MAC address it is
now using. Otherwise it gets out of sync and the PF won't know what
MAC address the VF wants to use. Ultimately the VF will fail when it
tries to setup the L2 MAC filter for the vnic.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7b3c8e27d67e2b04c1ce099261469c12d09c13d4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 25 13:45:23 2021 -0400
bnxt_en: Move bnxt_approve_mac().
Move it before bnxt_update_vf_mac(). In the next patch, we need to call
bnxt_approve_mac() from bnxt_update_mac() under some conditions. This
will avoid forward declaration.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6b7027689890c590373fc58f362fae43d0517e21
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Apr 25 13:45:22 2021 -0400
bnxt_en: allow VF config ops when PF is closed
It is perfectly legal for the stack to query and configure VFs via PF
NDOs while the NIC is administratively down. Remove the unnecessary
check for the PF to be in open state.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dd85fc0ab5b4daa496bd3e2832b51963022182d0
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Apr 25 13:45:21 2021 -0400
bnxt_en: allow promiscuous mode for trusted VFs
Firmware previously only allowed promiscuous mode for VFs associated with
a default VLAN. It is now possible to enable promiscuous mode for a VF
having no VLAN configured provided that it is trusted. In such cases the
VF will see all packets received by the PF, irrespective of destination
MAC or VLAN.
Note, it is necessary to query firmware at the time of bnxt_promisc_ok()
instead of in bnxt_hwrm_func_qcfg() because the trusted status might be
altered by the PF after the VF has been configured. This check must now
also be deferred because the firmware call sleeps.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d5ca99054f8e25384390d41c0123d930eed510b6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 25 13:45:20 2021 -0400
bnxt_en: Add support for fw managed link down feature.
In the current code, the driver will not shutdown the link during
IFDOWN if there are still VFs sharing the port. Newer firmware will
manage the link down decision when the port is shared by VFs, so
we can just call firmware to shutdown the port unconditionally and
let firmware make the final decision.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b0d28207ced88b3909547d8299f679353a87fd35
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 25 13:45:19 2021 -0400
bnxt_en: Add a new phy_flags field to the main driver structure.
Copy the phy related feature flags from the firmware call
HWRM_PORT_PHY_QCAPS to this new field. We can also remove the flags
field in the bnxt_test_info structure. It's cleaner to have all PHY
related flags in one location, directly copied from the firmware.
To keep the BNXT_PHY_CFG_ABLE() macro logic the same, we need to make
a slight adjustment to check that it is a PF.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1d2deb61f095a7df231cc394c06d07a2893ac9eb
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Apr 25 13:45:18 2021 -0400
bnxt_en: report signal mode in link up messages
Firmware reports link signalling mode for certain speeds. In these
cases, print the signalling modes in kernel log link up messages.
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bbd6f0a948139970f4a615dff189d9a503681a39
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Apr 23 18:13:19 2021 -0400
bnxt_en: Fix RX consumer index logic in the error path.
In bnxt_rx_pkt(), the RX buffers are expected to complete in order.
If the RX consumer index indicates an out of order buffer completion,
it means we are hitting a hardware bug and the driver will abort all
remaining RX packets and reset the RX ring. The RX consumer index
that we pass to bnxt_discard_rx() is not correct. We should be
passing the current index (tmp_raw_cons) instead of the old index
(raw_cons). This bug can cause us to be at the wrong index when
trying to abort the next RX packet. It can crash like this:
#0 [ffff9bbcdf5c39a8] machine_kexec at ffffffff9b05e007
#1 [ffff9bbcdf5c3a00] __crash_kexec at ffffffff9b111232
#2 [ffff9bbcdf5c3ad0] panic at ffffffff9b07d61e
#3 [ffff9bbcdf5c3b50] oops_end at ffffffff9b030978
#4 [ffff9bbcdf5c3b78] no_context at ffffffff9b06aaf0
#5 [ffff9bbcdf5c3bd8] __bad_area_nosemaphore at ffffffff9b06ae2e
#6 [ffff9bbcdf5c3c28] bad_area_nosemaphore at ffffffff9b06af24
#7 [ffff9bbcdf5c3c38] __do_page_fault at ffffffff9b06b67e
#8 [ffff9bbcdf5c3cb0] do_page_fault at ffffffff9b06bb12
#9 [ffff9bbcdf5c3ce0] page_fault at ffffffff9bc015c5
[exception RIP: bnxt_rx_pkt+237]
RIP: ffffffffc0259cdd RSP: ffff9bbcdf5c3d98 RFLAGS: 00010213
RAX: 000000005dd8097f RBX: ffff9ba4cb11b7e0 RCX: ffffa923cf6e9000
RDX: 0000000000000fff RSI: 0000000000000627 RDI: 0000000000001000
RBP: ffff9bbcdf5c3e60 R8: 0000000000420003 R9: 000000000000020d
R10: ffffa923cf6ec138 R11: ffff9bbcdf5c3e83 R12: ffff9ba4d6f928c0
R13: ffff9ba4cac28080 R14: ffff9ba4cb11b7f0 R15: ffff9ba4d5a30000
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
Fixes: a1b0e4e684e9 ("bnxt_en: Improve RX consumer index validity check.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 27537929f30d3136a71ef29db56127a33c92dad7
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu Apr 22 12:10:28 2021 +0300
bnxt_en: fix ternary sign extension bug in bnxt_show_temp()
The problem is that bnxt_show_temp() returns long but "rc" is an int
and "len" is a u32. With ternary operations the type promotion is quite
tricky. The negative "rc" is first promoted to u32 and then to long so
it ends up being a high positive value instead of a a negative as we
intended.
Fix this by removing the ternary.
Fixes: d69753fa1ecb ("bnxt_en: return proper error codes in bnxt_show_temp")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 37434782d63f89de5b9c383a449b6a82dc3fa4fb
Author: Jakub Kicinski <kuba@kernel.org>
Date: Mon Apr 19 13:02:42 2021 -0700
bnxt: add more ethtool standard stats
Michael suggest a few more stats we can expose.
$ ethtool -S eth0 --groups eth-mac
Standard stats for eth0:
eth-mac-FramesTransmittedOK: 902623288966
eth-mac-FramesReceivedOK: 28727667047
eth-mac-FrameCheckSequenceErrors: 1
eth-mac-AlignmentErrors: 0
eth-mac-OutOfRangeLengthField: 0
$ ethtool -S eth0 | grep '\(fcs\|align\|oor\)'
rx_fcs_err_frames: 1
rx_align_err_frames: 0
tx_fcs_err_frames: 0
Suggested-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 782bc00affcd63dacaa34e9ab6da588605423312
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Apr 16 12:27:44 2021 -0700
bnxt: implement ethtool standard stats
Most of the names seem to strongly correlate with names from
the standard and RFC. Whether ..+good_frames are indeed Frames..OK
I'm the least sure of.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c9ca5c3aabafcaa934731b8a841f28f8df990b7f
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Apr 15 15:53:16 2021 -0700
bnxt: implement ethtool::get_fec_stats
Report corrected bits.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ac797ced1fd0faba285c460eb1f64d1296b9cfa4
Author: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Date: Sun Apr 11 20:18:15 2021 -0400
bnxt_en: Free and allocate VF-Reps during error recovery.
During firmware recovery, VF-Rep configuration in the firmware is lost.
Fix it by freeing and (re)allocating VF-Reps in FW at relevant points
during the error recovery process.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 90f4fd02968720bdeb38a16deeff96fa770206e4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 11 20:18:14 2021 -0400
bnxt_en: Refactor __bnxt_vf_reps_destroy().
Add a new helper function __bnxt_free_one_vf_rep() to free one VF rep.
We also reintialize the VF rep fields to proper initial values so that
the function can be used without freeing the VF rep data structure. This
will be used in subsequent patches to free and recreate VF reps after
error recovery.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ea2d37b2b3079a896bc3f44a1962d3f01aa81b7f
Author: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Date: Sun Apr 11 20:18:13 2021 -0400
bnxt_en: Refactor bnxt_vf_reps_create().
Add a new function bnxt_alloc_vf_rep() to allocate a VF representor.
This function will be needed in subsequent patches to recreate the
VF reps after error recovery.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 190eda1a9dbc47409073bec79b81f362e21973b6
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Apr 11 20:18:12 2021 -0400
bnxt_en: Invalidate health register mapping at the end of probe.
After probe is successful, interface may not be bought up in all
the cases and health register mapping could be invalid if firmware
undergoes reset. Fix it by invalidating the health register at the
end of probe. It will be remapped during ifup.
Fixes: 43a440c4007b ("bnxt_en: Improve the status_reliable flag in bp->fw_health.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 17e1be342d46eb0b7c3df4c7e623493483080b63
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 11 20:18:11 2021 -0400
bnxt_en: Treat health register value 0 as valid in bnxt_try_reover_fw().
The retry loop in bnxt_try_recover_fw() should not abort when the
health register value is 0. It is a valid value that indicates the
firmware is booting up.
Fixes: 861aae786f2f ("bnxt_en: Enhance retry of the first message to the firmware.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 861aae786f2f7e1cab7926f7bb7783cb893e7edb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 22 03:08:45 2021 -0400
bnxt_en: Enhance retry of the first message to the firmware.
Two enhancements:
1. Read the health status first before sending the first
HWRM_VER_GET message to firmware instead of the other way around.
This guarantees we got the accurate health status before we attempt
to send the message.
2. We currently only retry sending the first HWRM_VER_GET message to
the firmware if the firmware is in the process of booting. If the
firmware is in error state and is doing core dump for example, the
driver should also retry if the health register has the RECOVERING
flag set. This flag indicates the firmware will undergo recovery
soon. Modify the retry logic to retry for this case as well.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bae8a00379f4c1327c8e38a768083460b5ad5b12
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Mar 22 03:08:44 2021 -0400
bnxt_en: Remove the read of BNXT_FW_RESET_INPROG_REG after firmware reset.
Once the chip goes through reset, the register mapping may be lost
and any read of the mapped health registers may return garbage value
until the registers are mapped again in the init path.
Reading BNXT_FW_RESET_INPROG_REG after firmware reset will likely
return garbage value due to the above reason. Reading this register
is for information purpose only so remove it.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2924ad95cb51673ed3544cf371cafc66e2c76cc8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 22 03:08:43 2021 -0400
bnxt_en: Set BNXT_STATE_FW_RESET_DET flag earlier for the RDMA driver.
During ifup, if the driver detects that firmware has gone through a
reset, it will go through a re-probe sequence. If the RDMA driver is
loaded, the re-probe sequence includes calling the RDMA driver to stop.
We need to set the BNXT_STATE_FW_RESET_DET flag earlier so that it is
visible to the RDMA driver. The RDMA driver's stop sequence is
different if firmware has gone through a reset.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: P B S Naresh Kumar <nareshkumar.pbs@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 15a7deb895497e4c9496b98367e4a0671add03f1
Author: Scott Branden <scott.branden@broadcom.com>
Date: Mon Mar 22 03:08:42 2021 -0400
bnxt_en: check return value of bnxt_hwrm_func_resc_qcaps
Check return value of call to bnxt_hwrm_func_resc_qcaps in
bnxt_hwrm_if_change and return failure on error.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a2f3835cc68a2222d0ab97862187ed98e65fe682
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon Mar 22 03:08:41 2021 -0400
bnxt_en: don't fake firmware response success when PCI is disabled
The original intent here is to allow commands during reset to succeed
without error when the device is disabled, to ensure that cleanup
completes normally during NIC close, where firmware is not necessarily
expected to respond.
The problem with faking success during reset's PCI disablement is that
unrelated ULP commands will also see inadvertent success during reset
when failure would otherwise be appropriate. It is better to return
a different error result such that reset related code can detect
this unique condition and ignore as appropriate.
Note, the pci_disable_device() when firmware is fatally wounded in
bnxt_fw_reset_close() does not need to be addressed, as subsequent
commands are already expected to fail due to the BNXT_NO_FW_ACCESS()
check in bnxt_hwrm_do_send_msg().
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 80a9641f09f890a27a57e8ad30472553e0f769a6
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Mon Mar 22 03:08:40 2021 -0400
bnxt_en: Improve wait for firmware commands completion
In situations where FW has crashed, the bnxt_hwrm_do_send_msg() call
will have to wait until timeout for each firmware message. This
generally takes about half a second for each firmware message. If we
try to unload the driver n this state, the unload sequence will take
a long time to complete.
Improve this by checking the health register if it is available and
abort the wait for the firmware response if the register shows that
firmware is not healthy. The very first message HWRM_VER_GET is
excluded from this check because that message is used to poll for
firmware to come out of reset during error recovery.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 43a440c4007b28c473afba966e8410459db4975f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 22 03:08:39 2021 -0400
bnxt_en: Improve the status_reliable flag in bp->fw_health.
In order to read the firmware health status, we first need to determine
the register location and then the register may need to be mapped.
There are 2 code paths to do this. The first one is done early as a
best effort attempt by the function bnxt_try_map_fw_health_reg(). The
second one is done later in the function bnxt_map_fw_health_regs()
after establishing communications with the firmware. We currently
only set fw_health->status_reliable if we can successfully set up the
health register in the first code path.
Improve the scheme by setting the fw_health->status_reliable flag if
either (or both) code paths can successfully set up the health
register. This flag is relied upon during run-time when we need to
check the health status. So this will make it work better.
During ifdown, if the health register is mapped, we need to invalidate
the health register mapping because a potential fw reset will reset
the mapping. Similarly, we need to do the same after firmware reset
during recovery. We'll remap it during ifup.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fdc13979f91e664717f47eb8c49094e4b7f202e3
Author: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Mon Mar 8 12:06:58 2021 +0100
bpf, devmap: Move drop error path to devmap for XDP_REDIRECT
We want to change the current ndo_xdp_xmit drop semantics because it will
allow us to implement better queue overflow handling. This is working
towards the larger goal of a XDP TX queue-hook. Move XDP_REDIRECT error
path handling from each XDP ethernet driver to devmap code. According to
the new APIs, the driver running the ndo_xdp_xmit pointer, will break tx
loop whenever the hw reports a tx error and it will just return to devmap
caller the number of successfully transmitted frames. It will be devmap
responsibility to free dropped frames.
Move each XDP ndo_xdp_xmit capable driver to the new APIs:
- veth
- virtio-net
- mvneta
- mvpp2
- socionext
- amazon ena
- bnxt
- freescale (dpaa2, dpaa)
- xen-frontend
- qede
- ice
- igb
- ixgbe
- i40e
- mlx5
- ti (cpsw, cpsw-new)
- tun
- sfc
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Camelia Groza <camelia.groza@nxp.com>
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Shay Agroskin <shayagr@amazon.com>
Link: https://lore.kernel.org/bpf/ed670de24f951cfd77590decf0229a0ad7fd12f6.1615201152.git.lorenzo@kernel.org
commit 20d7d1c5c9b11e9f538ed4a2289be106de970d3e
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Fri Feb 26 04:43:10 2021 -0500
bnxt_en: reliably allocate IRQ table on reset to avoid crash
The following trace excerpt corresponds with a NULL pointer dereference
of 'bp->irq_tbl' in bnxt_setup_inta() on an Aarch64 system after many
device resets:
Unable to handle kernel NULL pointer dereference at ... 000000d
...
pc : string+0x3c/0x80
lr : vsnprintf+0x294/0x7e0
sp : ffff00000f61ba70 pstate : 20000145
x29: ffff00000f61ba70 x28: 000000000000000d
x27: ffff0000009c8b5a x26: ffff00000f61bb80
x25: ffff0000009c8b5a x24: 0000000000000012
x23: 00000000ffffffe0 x22: ffff000008990428
x21: ffff00000f61bb80 x20: 000000000000000d
x19: 000000000000001f x18: 0000000000000000
x17: 0000000000000000 x16: ffff800b6d0fb400
x15: 0000000000000000 x14: ffff800b7fe31ae8
x13: 00001ed16472c920 x12: ffff000008c6b1c9
x11: ffff000008cf0580 x10: ffff00000f61bb80
x9 : 00000000ffffffd8 x8 : 000000000000000c
x7 : ffff800b684b8000 x6 : 0000000000000000
x5 : 0000000000000065 x4 : 0000000000000001
x3 : ffff0a00ffffff04 x2 : 000000000000001f
x1 : 0000000000000000 x0 : 000000000000000d
Call trace:
string+0x3c/0x80
vsnprintf+0x294/0x7e0
snprintf+0x44/0x50
__bnxt_open_nic+0x34c/0x928 [bnxt_en]
bnxt_open+0xe8/0x238 [bnxt_en]
__dev_open+0xbc/0x130
__dev_change_flags+0x12c/0x168
dev_change_flags+0x20/0x60
...
Ordinarily, a call to bnxt_setup_inta() (not in trace due to inlining)
would not be expected on a system supporting MSIX at all. However, if
bnxt_init_int_mode() does not end up being called after the call to
bnxt_clear_int_mode() in bnxt_fw_reset_close(), then the driver will
think that only INTA is supported and bp->irq_tbl will be NULL,
causing the above crash.
In the error recovery scenario, we call bnxt_clear_int_mode() in
bnxt_fw_reset_close() early in the sequence. Ordinarily, we will
call bnxt_init_int_mode() in bnxt_hwrm_if_change() after we
reestablish communication with the firmware after reset. However,
if the sequence has to abort before we call bnxt_init_int_mode() and
if the user later attempts to re-open the device, then it will cause
the crash above.
We fix it in 2 ways:
1. Check for bp->irq_tbl in bnxt_setup_int_mode(). If it is NULL, call
bnxt_init_init_mode().
2. If we need to abort in bnxt_hwrm_if_change() and cannot complete
the error recovery sequence, set the BNXT_STATE_ABORT_ERR flag. This
will cause more drastic recovery at the next attempt to re-open the
device, including a call to bnxt_init_int_mode().
Fixes: 3bc7d4a352ef ("bnxt_en: Add BNXT_STATE_IN_FW_RESET state.")
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit d20cd745218cde1b268bef5282095ec6c95a3ea2
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Feb 26 04:43:09 2021 -0500
bnxt_en: Fix race between firmware reset and driver remove.
The driver's error recovery reset sequence can take many seconds to
complete and only the critical sections are protected by rtnl_lock.
A recent change has introduced a regression in this sequence.
bnxt_remove_one() may be called while the recovery is in progress.
Normally, unregister_netdev() would cause bnxt_close_nic() to be
called and this would cause the error recovery to safely abort
with the BNXT_STATE_ABORT_ERR flag set in bnxt_close_nic().
Recently, we added bnxt_reinit_after_abort() to allow the user to
reopen the device after an aborted recovery. This causes the
regression in the scenario described above because we would
attempt to re-open even after the netdev has been unregistered.
Fix it by checking the netdev reg_state in
bnxt_reinit_after_abort() and abort if it is unregistered.
Fixes: 6882c36cf82e ("bnxt_en: attempt to reinitialize after aborted reset")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit f4d95c3c194de04ae7b44f850131321c7ceb9312
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 14 18:05:01 2021 -0500
bnxt_en: Improve logging of error recovery settings information.
We currently only log the error recovery settings if it is enabled.
In some cases, firmware disables error recovery after it was
initially enabled. Without logging anything, the user will not be
aware of this change in setting.
Log it when error recovery is disabled. Also, change the reset count
value from hexadecimal to decimal.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit df97b34d3ace777f90df368efe5508ddd32c16d4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 14 18:05:00 2021 -0500
bnxt_en: Reply to firmware's echo request async message.
This is a new async message that the firmware can send to check if it
can communicate with the driver. This is an added error detection
scheme that firmware can use if it suspects errors in the PCIe
interface. When the driver receives this async message, it will reply
back echoing some data in the async message. If the firmware is not
getting the reply with the proper data after some retries, error
recovery will kick in.
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 41435c39400071904a9b569d7bfc053c7c644bc5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 14 18:04:59 2021 -0500
bnxt_en: Initialize "context kind" field for context memory blocks.
If firmware provides the offset to the "context kind" field of the
relevant context memory blocks, we'll initialize just that field for
each block instead of initializing all of context memory.
Populate the bnxt_mem_init structure with the proper offset returned
by firmware. If it is older firmware and the information is not
available, we set the offset to an invalid value and fall back to
the old behavior of initializing every byte. Otherwise, we initialize
only the "context kind" byte at the offset.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e9696ff33c79aed73ff76edb4961042a9b87d27b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 14 18:04:58 2021 -0500
bnxt_en: Add context memory initialization infrastructure.
Currently, the driver calls memset() to set all relevant context memory
used by the chip to the initial value. This can take many milliseconds
with the potentially large number of context pages allocated for the
chip.
To make this faster, we only need to initialize the "context kind" field
of each block of context memory. This patch sets up the infrastructure
to do that with the bnxt_mem_init structure. In the next patch, we'll
add the logic to obtain the offset of the "context kind" from the
firmware. This patch is not changing the current behavior of calling
memset() to initialize all relevant context memory.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dab62e7c2de7b035c928a8babee27a6127891fdf
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 14 18:04:57 2021 -0500
bnxt_en: Implement faster recovery for firmware fatal error.
During some fatal firmware error conditions, the PCI config space
register 0x2e which normally contains the subsystem ID will become
0xffff. This register will revert back to the normal value after
the chip has completed core reset. If we detect this condition,
we can poll this config register immediately for the value to revert.
Because we use config read cycles to poll this register, there is no
possibility of Master Abort if we happen to read it during core reset.
This speeds up recovery significantly as we don't have to wait for the
conservative min_time before polling MMIO to see if the firmware has
come out of reset. As soon as this register changes value we can
proceed to re-initialize the device.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit be6d755f3d0c7c76d07f980bca6dd7e70dcec452
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Feb 14 18:04:56 2021 -0500
bnxt_en: selectively allocate context memories
Newer devices may have local context memory instead of relying on the
host for backing store. In these cases, HWRM_FUNC_BACKING_STORE_QCAPS
will return a zero entry size to indicate contexts for which the host
should not allocate backing store.
Selectively allocate context memory based on device capabilities and
only enable backing store for the appropriate contexts.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 31f67c2ee0551f0fd0dd134f4a73c456c53ea015
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 14 18:04:55 2021 -0500
bnxt_en: Update firmware interface spec to 1.10.2.16.
The main changes are the echo request/response from firmware for error
detection and the NO_FCS feature to transmit frames without FCS.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit db28b6c77f4050f62599267a886b61fbd6504633
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Feb 11 02:24:24 2021 -0500
bnxt_en: Fix devlink info's stored fw.psid version format.
The running fw.psid version is in decimal format but the stored
fw.psid is in hex format. This can mislead the user to reset the
NIC to activate the stored version to become the running version.
Fix it to display the stored fw.psid in decimal format.
Fixes: 1388875b3916 ("bnxt_en: Add stored FW version info to devlink info_get cb.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 132e0b65dc2b8bfa9721bfce834191f24fd1d7ed
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Thu Feb 11 02:24:23 2021 -0500
bnxt_en: reverse order of TX disable and carrier off
A TX queue can potentially immediately timeout after it is stopped
and the last TX timestamp on that queue was more than 5 seconds ago with
carrier still up. Prevent these intermittent false TX timeouts
by bringing down carrier first before calling netif_tx_disable().
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 871127e6ab0d6abb904cec81fc022baf6953be1f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jan 26 01:20:24 2021 -0500
bnxt_en: Convert to use netif_level() helpers.
Use the various netif_level() helpers to simplify the C code. This was
suggested by Joe Perches.
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1611642024-3166-1-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 0da65f4932cee9f9698a2e1493d22b27c91841c9
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:21 2021 -0500
bnxt_en: Do not process completion entries after fatal condition detected.
Once the firmware fatal condition is detected, we should cease
comminication with the firmware and hardware quickly even if there
are many completion entries in the completion rings. This will
speed up the recovery process and prevent further I/Os that may
cause further exceptions.
Do not proceed in the NAPI poll function if fatal condition is
detected. Call napi_complete() and return without arming interrupts.
Cleanup of all rings and reset are imminent.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 5863b10aa86a5f5f69a25b55a5c15806c834471a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:20 2021 -0500
bnxt_en: Consolidate firmware reset event logging.
Combine the three netdev_warn() calls into a single call, printed at
the NETIF_MSG_HW log level.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 4f036b2e75986946117237a6baddc489dd2b3c34
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:19 2021 -0500
bnxt_en: Improve firmware fatal error shutdown sequence.
In the event of a fatal firmware error, firmware will notify the host
and then it will proceed to do core reset when it sees that all functions
have disabled Bus Master. To prevent Master Aborts and other hard
errors, we need to quiesce all activities in addition to disabling Bus
Master before the chip goes into core reset.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 38290e37297087f7ea3ef7904b8f185d77c42976
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:18 2021 -0500
bnxt_en: Modify bnxt_disable_int_sync() to be called more than once.
In the event of a fatal firmware error, we want to disable IRQ early
in the recovery sequence. This change will allow it to be called
safely again as part of the normal shutdown sequence.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit e340a5c4fbdde20fec8c16b83bce386aaad6b6eb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:17 2021 -0500
bnxt_en: Add a new BNXT_STATE_NAPI_DISABLED flag to keep track of NAPI state.
Up until now, we don't need to keep track of this state because NAPI
is always enabled once and disabled once during bring up and shutdown.
For better error recovery in subsequent patches, we want to quiesce
the device earlier during fatal error conditions. The normal shutdown
sequence will disable NAPI again and the flag will prevent disabling
NAPI twice.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 339eeb4bd9e477141280e46ea9433f3a10b54699
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:16 2021 -0500
bnxt_en: Add bnxt_fw_reset_timeout() helper.
This code to check if we have reached the maximum wait time after
firmware reset is used multiple times. Add a helper function to
do this.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 5d06eb5cb1f9da393eb47b8948d4367e69e48a62
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 25 02:08:15 2021 -0500
bnxt_en: Retry open if firmware is in reset.
Firmware may be in the middle of reset when the driver tries to do ifup.
In that case, firmware will return a special error code and the driver
will retry 10 times with 50 msecs delay after each retry.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 6882c36cf82ebb210f3977be7a3a0be0c64a44cb
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon Jan 25 02:08:14 2021 -0500
bnxt_en: attempt to reinitialize after aborted reset
Drawing a hard line on aborted resets prevents a NIC open in
some scenarios that may otherwise be recoverable. For example,
if a firmware recovery happened while a PF was down and an
attempt was made to bring up an associated VF in this state,
then it was impossible to ever bring up this VF without a
rebind or reload of its driver.
Attempt to reinitialize the firmware when an aborted reset (or
failed init after a reset) is discovered during open - it may
succeed. Also take care to allow the user to retry opening the
NIC even after an aborted reset.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a44daa8fcbcf572545c4c1a7908b3fbb38388048
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon Jan 25 02:08:13 2021 -0500
bnxt_en: log firmware debug notifications
Firmware is capable of generating asynchronous debug notifications.
The event data is opaque to the driver and is simply logged. Debug
notifications can be enabled by turning on hardware status messages
using the ethtool msglvl interface.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 881d8353b05e80d93db14b860581ceba14116422
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 25 02:08:12 2021 -0500
bnxt_en: Add an upper bound for all firmware command timeouts.
The timeout period for firmware messages is passed to the driver
from the firmware in the response of the first command. This
timeout period is multiplied by a factor for certain long
running commands such as NVRAM commands. In some cases, the
timeout period can become really long and it can cause hung task
warnings if firmware has crashed or is not responding. To avoid
such long delays, cap all firmware commands to a max timeout value
of 40 seconds.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 3e3c09b0e999f51d35875c3103c6ccb49290788f
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 25 02:08:11 2021 -0500
bnxt_en: Move reading VPD info after successful handshake with fw.
If firmware is in reset or in bad state, it won't be able to return
VPD data. Move bnxt_vpd_read_info() until after bnxt_fw_init_one_p1()
successfully returns. By then we would have established proper
communications with the firmware.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit d1cbd1659cac9b192f4677715becf937978b091a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:10 2021 -0500
bnxt_en: Retry sending the first message to firmware if it is under reset.
The first HWRM_VER_GET message to firmware during probe may timeout if
firmware is under reset. This can happen during hot-plug for example.
On P5 and newer chips, we can check if firmware is in the boot stage by
reading a status register. Retry 5 times if the status register shows
that firmware is not ready and not in error state.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit b187e4bae0aaa49958cc589af46f7059672980db
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon Jan 25 02:08:09 2021 -0500
bnxt_en: handle CRASH_NO_MASTER during bnxt_open()
Add missing support for handling NO_MASTER crashes while ports are
administratively down (ifdown). On some SoC platforms, the driver
needs to assist the firmware to recover from a crash via OP-TEE.
This is performed in a similar fashion to what is done during driver
probe.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit fe1b853572f17dcfdda93651c1ca3f41bbaf76f0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:08 2021 -0500
bnxt_en: Define macros for the various health register states.
Define macros to check for the various states in the lower 16 bits of
the health register. Replace the C code that checks for these values
with the newly defined macros.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 16db6323042f39b6f49148969e9d03d11265bc1b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 25 02:08:07 2021 -0500
bnxt_en: Update firmware interface to 1.10.2.11.
Updates to backing store APIs, QoS profiles, and push buffer initial
index support.
Since the new HWRM_FUNC_BACKING_STORE_CFG message size has increased,
we need to add some compat. logic to fall back to the smaller legacy
size if firmware cannot accept the larger message size. The new fields
added to the structure are not used yet.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 687487751814a493fba953efb9b1542b2f90614c
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Mon Jan 11 04:26:40 2021 -0500
bnxt_en: Clear DEFRAG flag in firmware message when retry flashing.
When the FW tells the driver to retry the INSTALL_UPDATE command after
it has cleared the NVM area, the driver is not clearing the previously
used ALLOWED_TO_DEFRAG flag. As a result the FW tries to defrag the NVM
area a second time in a loop and can fail the request.
Fixes: 1432c3f6a6ca ("bnxt_en: Retry installing FW package under NO_SPACE error condition.")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 869c4d5eb1e6fbda66aa790c48bdb946d71494a0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 11 04:26:39 2021 -0500
bnxt_en: Improve stats context resource accounting with RDMA driver loaded.
The function bnxt_get_ulp_stat_ctxs() does not count the stats contexts
used by the RDMA driver correctly when the RDMA driver is freeing the
MSIX vectors. It assumes that if the RDMA driver is registered, the
additional stats contexts will be needed. This is not true when the
RDMA driver is about to unregister and frees the MSIX vectors.
This slight error leads to over accouting of the stats contexts needed
after the RDMA driver has unloaded. This will cause some firmware
warning and error messages in dmesg during subsequent config. changes
or ifdown/ifup.
Fix it by properly accouting for extra stats contexts only if the
RDMA driver is registered and MSIX vectors have been successfully
requested.
Fixes: c027c6b4e91f ("bnxt_en: get rid of num_stat_ctxs variable")
Reviewed-by: Yongping Zhang <yongping.zhang@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit be9df4aff65f18caa79b35f88f42c3d5a43af14f
Author: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Tue Dec 22 22:09:29 2020 +0100
net, xdp: Introduce xdp_prepare_buff utility routine
Introduce xdp_prepare_buff utility routine to initialize per-descriptor
xdp_buff fields (e.g. xdp_buff pointers). Rely on xdp_prepare_buff() in
all XDP capable drivers.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Shay Agroskin <shayagr@amazon.com>
Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
Acked-by: Marcin Wojtas <mw@semihalf.com>
Link: https://lore.kernel.org/bpf/45f46f12295972a97da8ca01990b3e71501e9d89.1608670965.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
commit 43b5169d8355ccf26d726fbc75f083b2429113e4
Author: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Tue Dec 22 22:09:28 2020 +0100
net, xdp: Introduce xdp_init_buff utility routine
Introduce xdp_init_buff utility routine to initialize xdp_buff fields
const over NAPI iterations (e.g. frame_sz or rxq pointer). Rely on
xdp_init_buff in all XDP capable drivers.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Shay Agroskin <shayagr@amazon.com>
Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
Acked-by: Marcin Wojtas <mw@semihalf.com>
Link: https://lore.kernel.org/bpf/7f8329b6da1434dc2b05a77f2e800b29628a8913.1608670965.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
commit 30bfce109420912f201d4f295f9130ff44f04b41
Author: Jakub Kicinski <kuba@kernel.org>
Date: Wed Jan 6 13:06:36 2021 -0800
net: remove ndo_udp_tunnel_* callbacks
All UDP tunnel port management is now routed via udp_tunnel_nic
infra directly. Remove the old callbacks.
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 33dbcf60556a2a23b07f837e5954991925b72fd2
Author: Zheng Yongjun <zhengyongjun3@huawei.com>
Date: Tue Dec 29 21:52:46 2020 +0800
bnxt_en: Use kzalloc for allocating only one thing
Use kzalloc rather than kcalloc(1,...)
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
@@
- kcalloc(1,
+ kzalloc(
...)
// </smpl>
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a029a2fef5d11bb85587433c3783615442abac96
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 27 14:18:18 2020 -0500
bnxt_en: Check TQM rings for maximum supported value.
TQM rings are hardware resources that require host context memory
managed by the driver. The driver supports up to 9 TQM rings and
the number of rings to use is requested by firmware during run-time.
Cap this number to the maximum supported to prevent accessing beyond
the array. Future firmware may request more than 9 TQM rings. Define
macros to remove the magic number 9 from the C code.
Fixes: ac3158cb0108 ("bnxt_en: Allocate TQM ring context memory according to fw specification.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit fb1e6e562b37b39adfe251919c9abfdb3e01f921
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Dec 27 14:18:17 2020 -0500
bnxt_en: Fix AER recovery.
A recent change skips sending firmware messages to the firmware when
pci_channel_offline() is true during fatal AER error. To make this
complete, we need to move the re-initialization sequence to
bnxt_io_resume(), otherwise the firmware messages to re-initialize
will all be skipped. In any case, it is more correct to re-initialize
in bnxt_io_resume().
Also, fix the reverse x-mas tree format when defining variables
in bnxt_io_slot_reset().
Fixes: b340dc680ed4 ("bnxt_en: Avoid sending firmware messages when AER error is detected.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a86b313e18178b39fcca4850d4dfeb5af1e3dc7e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 13 06:51:46 2020 -0500
bnxt_en: Enable batch mode when using HWRM_NVM_MODIFY to flash packages.
The current scheme allocates a DMA buffer as big as the requested
firmware package file and DMAs the contents to firmware in one
operation. The buffer size can be several hundred kilo bytes and
the driver may not be able to allocate the memory. This will cause
firmware upgrade to fail.
Improve the scheme by using smaller DMA blocks and calling firmware to
DMA each block in a batch mode. Older firmware can cause excessive
NVRAM erases if the block size is too small so we try to allocate a
256K buffer to begin with and size it down successively if we cannot
allocate the memory.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 1432c3f6a6ca091db10b60c7b9078f34f4c5268d
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Sun Dec 13 06:51:45 2020 -0500
bnxt_en: Retry installing FW package under NO_SPACE error condition.
In bnxt_flash_package_from_fw_obj(), if firmware returns the NO_SPACE
error, call __bnxt_flash_nvram() to create the UPDATE directory and
then loop back and retry one more time.
Since the first try may fail, we use the silent version to send the
firmware commands.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 2e5fb428a61ce58f9db6ceccdeb6dc292248f1dc
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Sun Dec 13 06:51:44 2020 -0500
bnxt_en: Restructure bnxt_flash_package_from_fw_obj() to execute in a loop.
On NICs with a smaller NVRAM, FW installation may fail after multiple
updates due to fragmentation. The driver can retry when FW returns
a special error code. To faciliate the retry, we restructure the
logic that performs the flashing in a loop. The actual retry logic
will be added in the next patch.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a9094ba6072bfabe93f93b641a3858d9c91c2c86
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 13 06:51:43 2020 -0500
bnxt_en: Rearrange the logic in bnxt_flash_package_from_fw_obj().
This function will be modified in the next patch to retry flashing
the firmware in a loop. To facilate that, we rearrange the code so
that the steps that only need to be done once before the loop will be
moved to the top of the function.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 93ff343528ce034ef35e71d3b1d506df3cf85282
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Sun Dec 13 06:51:42 2020 -0500
bnxt_en: Refactor bnxt_flash_nvram.
Refactor bnxt_flash_nvram() into __bnxt_flash_nvram() that takes an
additional dir_item_len parameter. The new function will be used
in subsequent patches with the dir_item_len parameter set to create
the UPDATE directory during flashing.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit b02e5a0ebb172c8276cea3151942aac681f7a4a6
Author: Björn Töpel <bjorn.topel@intel.com>
Date: Mon Nov 30 19:52:01 2020 +0100
xsk: Propagate napi_id to XDP socket Rx path
Add napi_id to the xdp_rxq_info structure, and make sure the XDP
socket pick up the napi_id in the Rx path. The napi_id is used to find
the corresponding NAPI structure for socket busy polling.
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/bpf/20201130185205.196029-7-bjorn.topel@gmail.com
commit cc69837fcaf467426ca19e5790085c26146a2300
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Nov 20 14:50:52 2020 -0800
net: don't include ethtool.h from netdevice.h
linux/netdevice.h is included in very many places, touching any
of its dependecies causes large incremental builds.
Drop the linux/ethtool.h include, linux/netdevice.h just needs
a forward declaration of struct ethtool_ops.
Fix all the places which made use of this implicit include.
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Link: https://lore.kernel.org/r/20201120225052.1427503-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit c54bc3ced5106663c2f2b44071800621f505b00e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Nov 20 02:44:31 2020 -0500
bnxt_en: Release PCI regions when DMA mask setup fails during probe.
Jump to init_err_release to cleanup. bnxt_unmap_bars() will also be
called but it will do nothing if the BARs are not mapped yet.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1605858271-8209-1-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 3383176efc0fb0c0900a191026468a58668b4214
Author: Zhang Changzhong <zhangchangzhong@huawei.com>
Date: Thu Nov 19 21:30:21 2020 +0800
bnxt_en: fix error return code in bnxt_init_board()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Link: https://lore.kernel.org/r/1605792621-6268-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit b5f796b62c98cd8c219c4b788ecb6e1218e648cb
Author: Zhang Changzhong <zhangchangzhong@huawei.com>
Date: Wed Nov 18 20:17:31 2020 +0800
bnxt_en: fix error return code in bnxt_init_one()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: c213eae8d3cd ("bnxt_en: Improve VF/PF link change logic.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Link: https://lore.kernel.org/r/1605701851-20270-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 52cc5f3a166a33012ebca2cdefebf4c689110068
Author: Jacob Keller <jacob.e.keller@intel.com>
Date: Wed Nov 18 11:06:36 2020 -0800
devlink: move flash end and begin to core devlink
When performing a flash update via devlink, device drivers may inform
user space of status updates via
devlink_flash_update_(begin|end|timeout|status)_notify functions.
It is expected that drivers do not send any status notifications unless
they send a begin and end message. If a driver sends a status
notification without sending the appropriate end notification upon
finishing (regardless of success or failure), the current implementation
of the devlink userspace program can get stuck endlessly waiting for the
end notification that will never come.
The current ice driver implementation may send such a status message
without the appropriate end notification in rare cases.
Fixing the ice driver is relatively simple: we just need to send the
begin_notify at the start of the function and always send an end_notify
no matter how the function exits.
Rather than assuming driver authors will always get this right in the
future, lets just fix the API so that it is not possible to get wrong.
Make devlink_flash_update_begin_notify and
devlink_flash_update_end_notify static, and call them in devlink.c core
code. Always send the begin_notify just before calling the driver's
flash_update routine. Always send the end_notify just after the routine
returns regardless of success or failure.
Doing this makes the status notification easier to use from the driver,
as it no longer needs to worry about catching failures and cleaning up
by calling devlink_flash_update_end_notify. It is now no longer possible
to do the wrong thing in this regard. We also save a couple of lines of
code in each driver.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit b44cfd4f5b912454387a4bf735d42eb4e7078ca8
Author: Jacob Keller <jacob.e.keller@intel.com>
Date: Wed Nov 18 11:06:35 2020 -0800
devlink: move request_firmware out of driver
All drivers which implement the devlink flash update support, with the
exception of netdevsim, use either request_firmware or
request_firmware_direct to locate the firmware file. Rather than having
each driver do this separately as part of its .flash_update
implementation, perform the request_firmware within net/core/devlink.c
Replace the file_name parameter in the struct devlink_flash_update_params
with a pointer to the fw object.
Use request_firmware rather than request_firmware_direct. Although most
Linux distributions today do not have the fallback mechanism
implemented, only about half the drivers used the _direct request, as
compared to the generic request_firmware. In the event that
a distribution does support the fallback mechanism, the devlink flash
update ought to be able to use it to provide the firmware contents. For
distributions which do not support the fallback userspace mechanism,
there should be essentially no difference between request_firmware and
request_firmware_direct.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Acked-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 0ae0a779efb8840a0cdb2d6bd9a5d07663ac3ee2
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Nov 15 19:27:52 2020 -0500
bnxt_en: Avoid unnecessary NVM_GET_DEV_INFO cmd error log on VFs.
VFs do not have access permissions to issue NVM_GET_DEV_INFO
firmware command.
Fixes: 4933f6753b50 ("bnxt_en: Add bnxt_hwrm_nvm_get_dev_info() to query NVM info.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit fa97f303fa4cf8469fd3d1ef29da69c0a3f6ddc8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Nov 15 19:27:51 2020 -0500
bnxt_en: Fix counter overflow logic.
bnxt_add_one_ctr() adds a hardware counter to a software counter and
adjusts for the hardware counter wraparound against the mask. The logic
assumes that the hardware counter is always smaller than or equal to
the mask.
This assumption is mostly correct. But in some cases if the firmware
is older and does not provide the accurate mask, the driver can use
a mask that is smaller than the actual hardware mask. This can cause
some extra carry bits to be added to the software counter, resulting in
counters that far exceed the actual value. Fix it by masking the
hardware counter with the mask passed into bnxt_add_one_ctr().
Fixes: fea6b3335527 ("bnxt_en: Accumulate all counters.")
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit eba93de6d31c1734dee59909020a162de612e41e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Nov 15 19:27:50 2020 -0500
bnxt_en: Free port stats during firmware reset.
Firmware is unable to retain the port counters during any kind of
fatal or non-fatal resets, so we must clear the port counters to
avoid false detection of port counter overflow.
Fixes: fea6b3335527 ("bnxt_en: Accumulate all counters.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 4260330b32b14330cfe427d568ac5f5b29b5be3d
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Nov 15 19:27:49 2020 -0500
bnxt_en: read EEPROM A2h address using page 0
The module eeprom address range returned by bnxt_get_module_eeprom()
should be 256 bytes of A0h address space, the lower half of the A2h
address space, and page 0 for the upper half of the A2h address space.
Fix the firmware call by passing page_number 0 for the A2h slave address
space.
Fixes: 42ee18fe4ca2 ("bnxt_en: Add Support for ETHTOOL_GMODULEINFO and ETHTOOL_GMODULEEEPRO")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 825741b071722f1c8ad692cead562c4b5f5eaa93
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 26 00:18:21 2020 -0400
bnxt_en: Send HWRM_FUNC_RESET fw command unconditionally.
In the AER or firmware reset flow, if we are in fatal error state or
if pci_channel_offline() is true, we don't send any commands to the
firmware because the commands will likely not reach the firmware and
most commands don't matter much because the firmware is likely to be
reset imminently.
However, the HWRM_FUNC_RESET command is different and we should always
attempt to send it. In the AER flow for example, the .slot_reset()
call will trigger this fw command and we need to try to send it to
effect the proper reset.
Fixes: b340dc680ed4 ("bnxt_en: Avoid sending firmware messages when AER error is detected.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit a1301f08c5acf992d9c1fafddc84c3a822844b04
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Oct 26 00:18:20 2020 -0400
bnxt_en: Check abort error state in bnxt_open_nic().
bnxt_open_nic() is called during configuration changes that require
the NIC to be closed and then opened. This call is protected by
rtnl_lock. Firmware reset can be happening at the same time. Only
critical portions of the entire firmware reset sequence are protected
by the rtnl_lock. It is possible that bnxt_open_nic() can be called
when the firmware reset sequence is aborting. In that case,
bnxt_open_nic() needs to check if the ABORT_ERR flag is set and
abort if it is. The configuration change that resulted in the
bnxt_open_nic() call will fail but the NIC will be brought to a
consistent IF_DOWN state.
Without this patch, if bnxt_open_nic() were to continue in this error
state, it may crash like this:
[ 1648.659736] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 1648.659768] IP: [<ffffffffc01e9b3a>] bnxt_alloc_mem+0x50a/0x1140 [bnxt_en]
[ 1648.659796] PGD 101e1b3067 PUD 101e1b2067 PMD 0
[ 1648.659813] Oops: 0000 [#1] SMP
[ 1648.659825] Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter sunrpc dell_smbios dell_wmi_descriptor dcdbas amd64_edac_mod edac_mce_amd kvm_amd kvm irqbypass crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper vfat cryptd fat pcspkr ipmi_ssif sg k10temp i2c_piix4 wmi ipmi_si ipmi_devintf ipmi_msghandler tpm_crb acpi_power_meter sch_fq_codel ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_generic mgag200 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm ahci drm libahci megaraid_sas crct10dif_pclmul crct10dif_common
[ 1648.660063] tg3 libata crc32c_intel bnxt_en(OE) drm_panel_orientation_quirks devlink ptp pps_core dm_mirror dm_region_hash dm_log dm_mod fuse
[ 1648.660105] CPU: 13 PID: 3867 Comm: ethtool Kdump: loaded Tainted: G OE ------------ 3.10.0-1152.el7.x86_64 #1
[ 1648.660911] Hardware name: Dell Inc. PowerEdge R7515/0R4CNN, BIOS 1.2.14 01/28/2020
[ 1648.661662] task: ffff94e64cbc9080 ti: ffff94f55df1c000 task.ti: ffff94f55df1c000
[ 1648.662409] RIP: 0010:[<ffffffffc01e9b3a>] [<ffffffffc01e9b3a>] bnxt_alloc_mem+0x50a/0x1140 [bnxt_en]
[ 1648.663171] RSP: 0018:ffff94f55df1fba8 EFLAGS: 00010202
[ 1648.663927] RAX: 0000000000000000 RBX: ffff94e6827e0000 RCX: 0000000000000000
[ 1648.664684] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff94e6827e08c0
[ 1648.665433] RBP: ffff94f55df1fc20 R08: 00000000000001ff R09: 0000000000000008
[ 1648.666184] R10: 0000000000000d53 R11: ffff94f55df1f7ce R12: ffff94e6827e08c0
[ 1648.666940] R13: ffff94e6827e08c0 R14: ffff94e6827e08c0 R15: ffffffffb9115e40
[ 1648.667695] FS: 00007f8aadba5740(0000) GS:ffff94f57eb40000(0000) knlGS:0000000000000000
[ 1648.668447] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1648.669202] CR2: 0000000000000000 CR3: 0000001022772000 CR4: 0000000000340fe0
[ 1648.669966] Call Trace:
[ 1648.670730] [<ffffffffc01f1d5d>] ? bnxt_need_reserve_rings+0x9d/0x170 [bnxt_en]
[ 1648.671496] [<ffffffffc01fa7ea>] __bnxt_open_nic+0x8a/0x9a0 [bnxt_en]
[ 1648.672263] [<ffffffffc01f7479>] ? bnxt_close_nic+0x59/0x1b0 [bnxt_en]
[ 1648.673031] [<ffffffffc01fb11b>] bnxt_open_nic+0x1b/0x50 [bnxt_en]
[ 1648.673793] [<ffffffffc020037c>] bnxt_set_ringparam+0x6c/0xa0 [bnxt_en]
[ 1648.674550] [<ffffffffb8a5f564>] dev_ethtool+0x1334/0x21a0
[ 1648.675306] [<ffffffffb8a719ff>] dev_ioctl+0x1ef/0x5f0
[ 1648.676061] [<ffffffffb8a324bd>] sock_do_ioctl+0x4d/0x60
[ 1648.676810] [<ffffffffb8a326bb>] sock_ioctl+0x1eb/0x2d0
[ 1648.677548] [<ffffffffb8663230>] do_vfs_ioctl+0x3a0/0x5b0
[ 1648.678282] [<ffffffffb8b8e678>] ? __do_page_fault+0x238/0x500
[ 1648.679016] [<ffffffffb86634e1>] SyS_ioctl+0xa1/0xc0
[ 1648.679745] [<ffffffffb8b93f92>] system_call_fastpath+0x25/0x2a
[ 1648.680461] Code: 9e 60 01 00 00 0f 1f 40 00 45 8b 8e 48 01 00 00 31 c9 45 85 c9 0f 8e 73 01 00 00 66 0f 1f 44 00 00 49 8b 86 a8 00 00 00 48 63 d1 <48> 8b 14 d0 48 85 d2 0f 84 46 01 00 00 41 8b 86 44 01 00 00 c7
[ 1648.681986] RIP [<ffffffffc01e9b3a>] bnxt_alloc_mem+0x50a/0x1140 [bnxt_en]
[ 1648.682724] RSP <ffff94f55df1fba8>
[ 1648.683451] CR2: 0000000000000000
Fixes: ec5d31e3c15d ("bnxt_en: Handle firmware reset status during IF_UP.")
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit f75d9a0aa96721d20011cd5f8c7a24eb32728589
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 26 00:18:19 2020 -0400
bnxt_en: Re-write PCI BARs after PCI fatal error.
When a PCIe fatal error occurs, the internal latched BAR addresses
in the chip get reset even though the BAR register values in config
space are retained.
pci_restore_state() will not rewrite the BAR addresses if the
BAR address values are valid, causing the chip's internal BAR addresses
to stay invalid. So we need to zero the BAR registers during PCIe fatal
error to force pci_restore_state() to restore the BAR addresses. These
write cycles to the BAR registers will cause the proper BAR addresses to
latch internally.
Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 631ce27a3006fc0b732bfd589c6df505f62eadd9
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 26 00:18:18 2020 -0400
bnxt_en: Invoke cancel_delayed_work_sync() for PFs also.
As part of the commit b148bb238c02
("bnxt_en: Fix possible crash in bnxt_fw_reset_task()."),
cancel_delayed_work_sync() is called only for VFs to fix a possible
crash by cancelling any pending delayed work items. It was assumed
by mistake that the flush_workqueue() call on the PF would flush
delayed work items as well.
As flush_workqueue() does not cancel the delayed workqueue, extend
the fix for PFs. This fix will avoid the system crash, if there are
any pending delayed work items in fw_reset_task() during driver's
.remove() call.
Unify the workqueue cleanup logic for both PF and VF by calling
cancel_work_sync() and cancel_delayed_work_sync() directly in
bnxt_remove_one().
Fixes: b148bb238c02 ("bnxt_en: Fix possible crash in bnxt_fw_reset_task().")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 21d6a11e2cadfb8446265a3efff0e2aad206e15e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 26 00:18:17 2020 -0400
bnxt_en: Fix regression in workqueue cleanup logic in bnxt_remove_one().
A recent patch has moved the workqueue cleanup logic before
calling unregister_netdev() in bnxt_remove_one(). This caused a
regression because the workqueue can be restarted if the device is
still open. Workqueue cleanup must be done after unregister_netdev().
The workqueue will not restart itself after the device is closed.
Call bnxt_cancel_sp_work() after unregister_netdev() and
call bnxt_dl_fw_reporters_destroy() after that. This fixes the
regession and the original NULL ptr dereference issue.
Fixes: b16939b59cc0 ("bnxt_en: Fix NULL ptr dereference crash in bnxt_fw_reset_task()")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 1388875b391689459659335a1fdbe5c5d45f3500
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 12 05:10:54 2020 -0400
bnxt_en: Add stored FW version info to devlink info_get cb.
This patch adds FW versions stored in the flash to devlink info_get
callback. Return the correct fw.psid running version using the
newly added bp->nvm_cfg_ver.
v2:
Ensure stored pkg_name string is NULL terminated when copied to
devlink.
Return directly from the last call to bnxt_dl_info_put().
If the FW call to get stored version fails for any reason, return
success immediately to devlink without the stored versions.
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-10-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 7154917a12b20ea46b09097a22342bcdf6adac66
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 12 05:10:53 2020 -0400
bnxt_en: Refactor bnxt_dl_info_get().
Add a new function bnxt_dl_info_put() to simplify the code, as there
are more stored firmware version fields to be added in the next patch.
Also, rename fw_ver variable name to ncsi_ver for better naming while
copying to devlink info_get cb.
v2:
Ensure active_pkg_name string is NULL terminated when copied to
devlink.
Return directly from the last call to bnxt_dl_info_put().
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-9-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 4933f6753b50367b581084927bf19efa1bcaac86
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 12 05:10:52 2020 -0400
bnxt_en: Add bnxt_hwrm_nvm_get_dev_info() to query NVM info.
Add a new bnxt_hwrm_nvm_get_dev_info() to query firmware version
information via NVM_GET_DEV_INFO firmware command. Use it to
get the running version of the NVM configuration information.
This new function will also be used in subsequent patches to get the
stored firmware versions.
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-8-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 8eddb3e7ce124dd6375d3664f1aae13873318b0f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Oct 12 05:10:51 2020 -0400
bnxt_en: Log unknown link speed appropriately.
If the VF virtual link is set to always enabled, the speed may be
unknown when the physical link is down. The driver currently logs
the link speed as 4294967295 Mbps which is SPEED_UNKNOWN. Modify
the link up log message as "speed unknown" which makes more sense.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-7-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit c966c67c09921e117991b54a83e1e9ac6dbc3899
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Oct 12 05:10:50 2020 -0400
bnxt_en: Log event_data1 and event_data2 when handling RESET_NOTIFY event.
Log these values that contain useful firmware state information.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-6-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 03ab8ca1e920f6adb35fc7ea80e18006d652d465
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Oct 12 05:10:49 2020 -0400
bnxt_en: Simplify bnxt_async_event_process().
event_data1 and event_data2 are used when processing most events.
Store these in local variables at the beginning of the function to
simplify many of the case statements.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-5-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 8fb35cd302f74e63db4ce43a44e5e5fae44d80e3
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Oct 12 05:10:48 2020 -0400
bnxt_en: Set driver default message level.
Currently, bp->msg_enable has default value of 0. It is more useful
to have the commonly used NETIF_MSG_DRV and NETIF_MSG_HW enabled by
default.
v2: Change the fall back bnxt_reset_task() inside bnxt_rx_ring_reset()
to silent mode. With older fw, we would take the fall back path and
it would be very noisy.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-4-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 6896cb35eec5020e889f755b176c41951f5976c6
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 12 05:10:47 2020 -0400
bnxt_en: Enable online self tests for multi-host/NPAR mode.
Online self tests are not disruptive and can be run in NPAR mode
and in multi-host NIC as well.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-3-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit cf223bfaf791f4c6ab6a5c213b91b9311ac9f2bd
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 12 05:10:46 2020 -0400
bnxt_en: Return -EROFS to user space, if NVM writes are not permitted.
If NVRAM resources are locked, NVM writes are not permitted. In such
scenarios, firmware returns HWRM_ERR_CODE_RESOURCE_LOCKED error to
firmware commands.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-2-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 8d4bd96b54dcb5997d1035f4dfd300c04d07ec11
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 4 15:23:01 2020 -0400
bnxt_en: Eliminate unnecessary RX resets.
Currently, the driver will schedule RX ring reset when we get a buffer
error in the RX completion record. These RX buffer errors can be due
to normal out-of-buffer conditions or a permanent error in the RX
ring. Because the driver cannot distinguish between these 2
conditions, we assume all these buffer errors require reset.
This is very disruptive when it is just a normal out-of-buffer
condition. Newer firmware will now monitor the rings for the permanent
failure and will send a notification to the driver when it happens.
This allows the driver to reset only when such a notification is
received. In environments where we have predominently out-of-buffer
conditions, we now can avoid these unnecessary resets.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1b5c8b63d6a4a2a33ce279ff8d42e40dec3b04ce
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 4 15:23:00 2020 -0400
bnxt_en: Reduce unnecessary message log during RX errors.
There is logic in the RX path to detect unexpected handles in the
RX completion. We'll print a warning and schedule a reset. The
next expected handle is then set to 0xffff which is guaranteed to
not match any valid handle. This will force all remaining packets in
the ring to be discarded before the reset. There can be hundreds of
these packets remaining in the ring and there is no need to print the
warnings for these forced errors.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8a27d4b9e54cdc9e3f45d3d11b0c898e92dace39
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 4 15:22:59 2020 -0400
bnxt_en: Add a software counter for RX ring reset.
Add a per ring rx_resets counter to count these RX resets.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8fbf58e17dce8f250dda9ad6b0a49b3041f0af14
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 4 15:22:58 2020 -0400
bnxt_en: Implement RX ring reset in response to buffer errors.
On some older chips, it is necessary to do a reset when we get buffer
errors associated with an RX ring. These buffer errors may become
frequent if the RX ring underruns under heavy traffic. The current
code does a global reset of all reasources when this happens. This
works but creates a big disruption of all rings when one RX ring is
having problem. This patch implements a localized RX ring reset of
just the RX ring having the issue. All other rings including all
TX rings will not be affected by this single RX ring reset.
Only the older chips prior to the P5 class supports this reset.
Because it is not a global reset, packets may still be arriving
while we are calling firmware to reset that ring. We need to be
sure that we don't post any buffers during this time while the
ring is undergoing reset. After firmware completes successfully,
the ring will be in the reset state with no buffers and we can start
filling it with new buffers and posting them.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7737d325f867faa5e809c607699d2253dfb6ab09
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 4 15:22:57 2020 -0400
bnxt_en: Refactor bnxt_init_one_rx_ring().
bnxt_init_one_rx_ring() includes logic to initialize the BDs for one RX
ring and to allocate the buffers. Separate the allocation logic into a
new bnxt_alloc_one_rx_ring() function. The allocation function will be
used later to allocate new buffers for one specified RX ring when we
reset that RX ring.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 975bc99a4a397d1b1584a99b4adb7948b6e6944b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 4 15:22:56 2020 -0400
bnxt_en: Refactor bnxt_free_rx_skbs().
bnxt_free_rx_skbs() frees all the allocated buffers and SKBs for
every RX ring. Refactor this function by calling a new function
bnxt_free_one_rx_ring_skbs() to free these buffers on one specified
RX ring at a time. This is preparation work for resetting one RX
ring during run-time.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fc8864e0b6ee2120d9b438f411159afe99348ff0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 4 15:22:55 2020 -0400
bnxt_en: Log FW health status info, if reset is aborted.
If firmware does not come out of reset, log FW health status info
to provide more information on firmware status.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 87f7ab8d6f88cc594e3417fd0a7238b9c72e88eb
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Oct 4 15:22:54 2020 -0400
bnxt_en: perform no master recovery during startup
The NS3 SoC platforms require assistance from the OP-TEE to recover
firmware if a crash occurs while no driver is bound. The
CRASHED_NO_MASTER condition is recorded in the firmware status register
during the crash to indicate when driver intervension is needed to
coordinate a firmware reload. This condition is detected during early
driver initialization in order to effect a firmware fastboot on
supported platforms when necessary.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ba02629ff6cbadce2c6452a4942ccacef658e5c0
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Oct 4 15:22:53 2020 -0400
bnxt_en: log firmware status on firmware init failure
Firmware now supports device independent discovery of the status
register location. This status register can provide more detailed
information about firmware errors, especially if problems occur
before the HWRM interface is functioning. Attempt to map this
register if it is present and report the firmware status on firmware
init failures.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3e9ec2bb932d746b0ae65aba79697457e7c83f90
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Oct 4 15:22:52 2020 -0400
bnxt_en: refactor bnxt_alloc_fw_health()
The allocator for the firmware health structure conflates allocation
and capability checks, limiting the reusability of the code. This patch
separates out the capability check and disablement and improves the
warning message to better describe the consequences of an allocation
failure.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 424174f14eeccfea747d9f078a41bd393ffe0bde
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Oct 4 15:22:51 2020 -0400
bnxt_en: Update firmware interface spec to 1.10.1.68.
Main changes is to extend hwrm_nvm_get_dev_info_output() for stored
firmware versions and a new flag is added to fw_status_reg.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4301304b04cc79f7b79bc982469fce16397f949f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 27 13:42:20 2020 -0400
bnxt_en: Improve preset max value for ethtool -l.
The current logic that calculates the preset maximum value for combined
channel does not take into account the rings used for XDP and mqprio
TCs. Each of these features will reduce the number of TX rings. Add
the logic to divide the TX rings accordingly based on whether the
device is currently in XDP mode and whether TCs are in use.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ccd6a9dcab79dc98d8d93d5aa3f68d71494f93fe
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 27 13:42:19 2020 -0400
bnxt_en: Implement ethtool set_fec_param() method.
This feature allows the user to set the different FEC modes on the NIC
port. Any new setting will take effect immediately after a link toggle.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2046e3c356fd18f577cd0180a299cddd10fe5752
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 27 13:42:18 2020 -0400
bnxt_en: Report Active FEC encoding during link up.
The current code is reporting the FEC configured settings during link up.
Change it to report the more useful active FEC encoding that may be
negotiated or auto detected.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8b2775890ad88d20a8f968aa88dbae487961240f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 27 13:42:17 2020 -0400
bnxt_en: Report FEC settings to ethtool.
Implement .get_fecparam() method to report the configured and active FEC
settings. Also report the supported and advertised FEC settings to
the .get_link_ksettings() method.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 745b5c653913829ede6d4466f36b35426d6e1823
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 27 13:42:16 2020 -0400
bnxt_en: avoid link reset if speed is not changed
PORT_PHY_CONFIG is always sent with REQ_FLAGS_RESET_PHY set. This flag
must be set in order for the firmware to institute the requested PHY
change immediately, but it results in a link flap. This is unnecessary
and results in an improved user experience if the PHY reconfiguration
is avoided when the user requested speed does not constitute a change.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3128e811b134128aadcf8582dded81b70980f23a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 27 13:42:15 2020 -0400
bnxt_en: Handle ethernet link being disabled by firmware.
On some 200G dual port NICs, if one port is configured to 200G,
firmware will disable the ethernet link on the other port. Firmware
will send notification to the driver for the disabled port when this
happens. Define a new field in the link_info structure to keep track
of this state. The new phy_state field replaces the unused loop_back
field.
Log a message when the phy_state changes state. In the disabled state,
disallow any PHY configurations on the disabled port as the firmware
will fail all calls to configure the PHY in this state.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 532262ba3b84fe77d7d420a24fa66b167bb0d93e
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 27 13:42:14 2020 -0400
bnxt_en: ethtool: support PAM4 link speeds up to 200G
Add ethtool PAM4 link modes for:
50000baseCR_Full
100000baseCR2_Full
200000baseCR4_Full
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d058426ea84fff2bb941ecb7291a876571860dd2
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 27 13:42:13 2020 -0400
bnxt_en: add basic infrastructure to support PAM4 link speeds
The firmware interface has added support for new link speeds using
PAM4 modulation. Expand the bnxt_link_info structure to closely
mirror the new firmware structures. Add logic to copy the PAM4
capabilities and settings from the firmware.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f00530bf3c9828d22a15043da5bc142760197fc2
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 27 13:42:12 2020 -0400
bnxt_en: refactor bnxt_get_fw_speed()
It will be necessary to update more than one field in the link_info
structure when PAM4 speeds are added in a later patch. Instead of
merely translating ethtool speed values to firmware speed values,
change the responsiblity of this function to update all the necessary
link_info fields required to force the speed change to the desired
ethtool value. This also reduces code duplication somewhat at the two
call sites, which otherwise both have to independently update link_info
fields to turn off auto negotiation advertisements.
Also use the appropriate REQ_FORCE_LINK_SPEED definitions. These happen
to have the same values, but req_link_speed is utilimately passed as
force_link_speed in HWRM_PORT_PHY_CFG which is not defined in terms of
REQ_AUTO_LINK_SPEED.
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c916062a8917463a469539eccee50d31e63c91c1
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 27 13:42:11 2020 -0400
bnxt_en: refactor code to limit speed advertising
Extract the code for determining an advertised speed is no longer
supported into a separate function. This will avoid some code
duplication in a later patch when supporting PAM4 speeds, since
these speeds are specified in a separate field.
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9d6b648c3112012dac6d804d331cdd3a2247765c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 27 13:42:10 2020 -0400
bnxt_en: Update firmware interface spec to 1.10.1.65.
The main changes include FEC, ECN statistics, HWRM_PORT_PHY_QCFG
response size reduction, and a new counter added to
ctx_hw_stats_ext struct to support the new 58818 chip.
The ctx_hw_stats_ext structure is now the superset supporting the new
58818 chips and the prior P5 chips. Add a new flag to identify the new
chip and use constants for the chip specific ring statistics sizes
instead of the size of the structure.
Because the HWRM_PORT_PHY_QCFG response structure size has shrunk back
to 96 bytes, the workaround added earlier to limit the size of this
message for forwarding to the VF can be removed.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bc75c054f04048517e0b153ab38d973bbcdcef59
Author: Jacob Keller <jacob.e.keller@intel.com>
Date: Fri Sep 25 13:46:06 2020 -0700
devlink: convert flash_update to use params structure
The devlink core recently gained support for checking whether the driver
supports a flash_update parameter, via `supported_flash_update_params`.
However, parameters are specified as function arguments. Adding a new
parameter still requires modifying the signature of the .flash_update
callback in all drivers.
Convert the .flash_update function to take a new `struct
devlink_flash_update_params` instead. By using this structure, and the
`supported_flash_update_params` bit field, a new parameter to
flash_update can be added without requiring modification to existing
drivers.
As before, all parameters except file_name will require driver opt-in.
Because file_name is a necessary field to for the flash_update to make
sense, no "SUPPORTED" bitflag is provided and it is always considered
valid. All future additional parameters will require a new bit in the
supported_flash_update_params bitfield.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Bin Luo <luobin9@huawei.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Ido Schimmel <idosch@mellanox.com>
Cc: Danielle Ratson <danieller@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 22ec3d232f8511b21355fcdb6fb2a4eced3decd8
Author: Jacob Keller <jacob.e.keller@intel.com>
Date: Fri Sep 25 13:46:05 2020 -0700
devlink: check flash_update parameter support in net core
When implementing .flash_update, drivers which do not support
per-component update are manually checking the component parameter to
verify that it is NULL. Without this check, the driver might accept an
update request with a component specified even though it will not honor
such a request.
Instead of having each driver check this, move the logic into
net/core/devlink.c, and use a new `supported_flash_update_params` field
in the devlink_ops. Drivers which will support per-component update must
now specify this by setting DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT in
the supported_flash_update_params in their devlink_ops.
This helps ensure that drivers do not forget to check for a NULL
component if they do not support per-component update. This also enables
a slightly better error message by enabling the core stack to set the
netlink bad attribute message to indicate precisely the unsupported
attribute in the message.
Going forward, any new additional parameter to flash update will require
a bit in the supported_flash_update_params bitfield.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Bin Luo <luobin9@huawei.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Ido Schimmel <idosch@mellanox.com>
Cc: Danielle Ratson <danieller@mellanox.com>
Cc: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c07fa08f02f4053b51dae1a6ee08bc644dc7846d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 20 21:08:59 2020 -0400
bnxt_en: Fix wrong flag value passed to HWRM_PORT_QSTATS_EXT fw call.
The wrong flag value caused the firmware call to return actual port
counters instead of the counter masks. This messed up the counter
overflow logic and caused erratic extended port counters to be
displayed under ethtool -S.
Fixes: 531d1d269c1d ("bnxt_en: Retrieve hardware masks for port counters.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d2b42d010f2941c2a85d970500b9d4ba79765593
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 20 21:08:58 2020 -0400
bnxt_en: Fix HWRM_FUNC_QSTATS_EXT firmware call.
Fix it to set the required fid input parameter. The firmware call
fails without this patch.
Fixes: d752d0536c97 ("bnxt_en: Retrieve hardware counter masks from firmware if available.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f0f47b2f8cbc22e6e611ef6cc988f5452e5aec3f
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Sep 20 21:08:57 2020 -0400
bnxt_en: Return -EOPNOTSUPP for ETHTOOL_GREGS on VFs.
Debug firmware commands are not supported on VFs to read registers.
This patch avoids logging unnecessary access_denied error on VFs
when user calls ETHTOOL_GREGS.
By returning error in get_regs_len() method on the VF, the get_regs()
method will not be called.
Fixes: b5d600b027eb ("bnxt_en: Add support for 'ethtool -d'")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a53906908148d64423398a62c4435efb0d09652c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Sep 20 21:08:56 2020 -0400
bnxt_en: Protect bnxt_set_eee() and bnxt_set_pauseparam() with mutex.
All changes related to bp->link_info require the protection of the
link_lock mutex. It's not sufficient to rely just on RTNL.
Fixes: 163e9ef63641 ("bnxt_en: Fix race when modifying pause settings.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d69753fa1ecb3218b56b022722f7a5822735b876
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Sep 20 21:08:55 2020 -0400
bnxt_en: return proper error codes in bnxt_show_temp
Returning "unknown" as a temperature value violates the hwmon interface
rules. Appropriate error codes should be returned via device_attribute
show instead. These will ultimately be propagated to the user via the
file system interface.
In addition to the corrected error handling, it is an even better idea to
not present the sensor in sysfs at all if it is known that the read will
definitely fail. Given that temp1_input is currently the only sensor
reported, ensure no hwmon registration if TEMP_MONITOR_QUERY is not
supported or if it will fail due to access permissions. Something smarter
may be needed if and when other sensors are added.
Fixes: 12cce90b934b ("bnxt_en: fix HWRM error when querying VF temperature")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 492adcf481292521ee8df1a482dc12acdb28aa15
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Sep 20 21:08:54 2020 -0400
bnxt_en: Use memcpy to copy VPD field info.
Using strlcpy() to copy from VPD is not correct because VPD strings
are not necessarily NULL terminated. Use memcpy() to copy the VPD
length up to the destination buffer size - 1. The destination is
zeroed memory so it will always be NULL terminated.
Fixes: a0d0fd70fed5 ("bnxt_en: Read partno and serialno of the board from VPD")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 423cffcf6c70031cb2265d0476087450ed89db59
Author: Jakub Kicinski <kuba@kernel.org>
Date: Mon Sep 14 17:11:56 2020 -0700
bnxt: add pause frame stats
These stats are already reported in ethtool -S.
Michael confirms they are equivalent to standard stats.
v2: - fix sparse warning about endian by using the macro
- use u64 for pointer type
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5198d545dba8ad893f5e5a029ca8d43ee7bcf011
Author: Jakub Kicinski <kuba@kernel.org>
Date: Wed Sep 9 10:37:51 2020 -0700
net: remove napi_hash_del() from driver-facing API
We allow drivers to call napi_hash_del() before calling
netif_napi_del() to batch RCU grace periods. This makes
the API asymmetric and leaks internal implementation details.
Soon we will want the grace period to protect more than just
the NAPI hash table.
Restructure the API and have drivers call a new function -
__netif_napi_del() if they want to take care of RCU waits.
Note that only core was checking the return status from
napi_hash_del() so the new helper does not report if the
NAPI was actually deleted.
Some notes on driver oddness:
- veth observed the grace period before calling netif_napi_del()
but that should not matter
- myri10ge observed normal RCU flavor
- bnx2x and enic did not actually observe the grace period
(unless they did so implicitly)
- virtio_net and enic only unhashed Rx NAPIs
The last two points seem to indicate that the calls to
napi_hash_del() were a left over rather than an optimization.
Regardless, it's easy enough to correct them.
This patch may introduce extra synchronize_net() calls for
interfaces which set NAPI_STATE_NO_BUSY_POLL and depend on
free_netdev() to call netif_napi_del(). This seems inevitable
since we want to use RCU for netpoll dev->napi_list traversal,
and almost no drivers set IFF_DISABLE_NETPOLL.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b16939b59cc00231a75d224fd058d22c9d064976
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Sep 5 22:55:37 2020 -0400
bnxt_en: Fix NULL ptr dereference crash in bnxt_fw_reset_task()
bnxt_fw_reset_task() which runs from a workqueue can race with
bnxt_remove_one(). For example, if firmware reset and VF FLR are
happening at about the same time.
bnxt_remove_one() already cancels the workqueue and waits for it
to finish, but we need to do this earlier before the devlink
reporters are destroyed. This will guarantee that
the devlink reporters will always be valid when bnxt_fw_reset_task()
is still running.
Fixes: b148bb238c02 ("bnxt_en: Fix possible crash in bnxt_fw_reset_task().")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit b340dc680ed48dcc05b56e1ebe1b9535813c3ee0
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Sep 5 22:55:36 2020 -0400
bnxt_en: Avoid sending firmware messages when AER error is detected.
When the driver goes through PCIe AER reset in error state, all
firmware messages will timeout because the PCIe bus is no longer
accessible. This can lead to AER reset taking many minutes to
complete as each firmware command takes time to timeout.
Define a new macro BNXT_NO_FW_ACCESS() to skip these firmware messages
when either firmware is in fatal error state or when
pci_channel_offline() is true. It now takes a more reasonable 20 to
30 seconds to complete AER recovery.
Fixes: b4fff2079d10 ("bnxt_en: Do not send firmware messages if firmware is in error state.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 96ecdcc992eb7f468b2cf829b0f5408a1fad4668
Author: Jakub Kicinski <kuba@kernel.org>
Date: Wed Aug 26 12:40:07 2020 -0700
bnxt: don't enable NAPI until rings are ready
Netpoll can try to poll napi as soon as napi_enable() is called.
It crashes trying to access a doorbell which is still NULL:
BUG: kernel NULL pointer dereference, address: 0000000000000000
CPU: 59 PID: 6039 Comm: ethtool Kdump: loaded Tainted: G S 5.9.0-rc1-00469-g5fd99b5d9950-dirty #26
RIP: 0010:bnxt_poll+0x121/0x1c0
Code: c4 20 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 41 8b 86 a0 01 00 00 41 23 85 18 01 00 00 49 8b 96 a8 01 00 00 0d 00 00 00 24 <89> 02
41 f6 45 77 02 74 cb 49 8b ae d8 01 00 00 31 c0 c7 44 24 1a
netpoll_poll_dev+0xbd/0x1a0
__netpoll_send_skb+0x1b2/0x210
netpoll_send_udp+0x2c9/0x406
write_ext_msg+0x1d7/0x1f0
console_unlock+0x23c/0x520
vprintk_emit+0xe0/0x1d0
printk+0x58/0x6f
x86_vector_activate.cold+0xf/0x46
__irq_domain_activate_irq+0x50/0x80
__irq_domain_activate_irq+0x32/0x80
__irq_domain_activate_irq+0x32/0x80
irq_domain_activate_irq+0x25/0x40
__setup_irq+0x2d2/0x700
request_threaded_irq+0xfb/0x160
__bnxt_open_nic+0x3b1/0x750
bnxt_open_nic+0x19/0x30
ethtool_set_channels+0x1ac/0x220
dev_ethtool+0x11ba/0x2240
dev_ioctl+0x1cf/0x390
sock_do_ioctl+0x95/0x130
Reported-by: Rob Sherwood <rsher@fb.com>
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b43b9f53fbb06faa4f2fcdbf235db3289026e2e4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Aug 26 01:08:39 2020 -0400
bnxt_en: Setup default RSS map in all scenarios.
The recent changes to support user-defined RSS map assume that RX
rings are always reserved and the default RSS map is set after the
RX rings are successfully reserved. If the firmware spec is older
than 1.6.1, no ring reservations are required and the default RSS
map is not setup at all. In another scenario where the fw Resource
Manager is older, RX rings are not reserved and we also end up with
no valid RSS map.
Fix both issues in bnxt_need_reserve_rings(). In both scenarios
described above, we don't need to reserve RX rings so we need to
call this new function bnxt_check_rss_map_no_rmgr() to setup the
default RSS map when needed.
Without valid RSS map, the NIC won't receive packets properly.
Fixes: 1667cbf6a4eb ("bnxt_en: Add logical RSS indirection table structure.")
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5fa65524f6e0b9528c6ceac3f33f7e8f0c3a084a
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Wed Aug 26 01:08:38 2020 -0400
bnxt_en: init RSS table for Minimal-Static VF reservation
There are no VF rings available during probe when the device is configured
using the Minimal-Static reservation strategy. In this case, the RSS
indirection table can only be initialized later, during bnxt_open_nic().
However, this was not happening because the rings will already have been
reserved via bnxt_init_dflt_ring_mode(), causing bnxt_need_reserve_rings()
to return false in bnxt_reserve_rings() and bypass the RSS table init.
Solve this by pushing the call to bnxt_set_dflt_rss_indir_tbl() into
__bnxt_reserve_rings(), which is common to both paths and is called
whenever ring configuration is changed. After doing this, the RSS table
init that must be called from bnxt_init_one() happens implicitly via
bnxt_set_default_rings(), necessitating doing the allocation earlier in
order to avoid a null pointer dereference.
Fixes: bd3191b5d87d ("bnxt_en: Implement ethtool -X to set indirection table.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 12cce90b934bf2b0ed9c339b4d5503e69954351a
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Wed Aug 26 01:08:37 2020 -0400
bnxt_en: fix HWRM error when querying VF temperature
Firmware returns RESOURCE_ACCESS_DENIED for HWRM_TEMP_MONITORY_QUERY for
VFs. This produces unpleasing error messages in the log when temp1_input
is queried via the hwmon sysfs interface from a VF.
The error is harmless and expected, so silence it and return unknown as
the value. Since the device temperature is not particularly sensitive
information, provide flexibility to change this policy in future by
silencing the error rather than avoiding the HWRM call entirely for VFs.
Fixes: cde49a42a9bb ("bnxt_en: Add hwmon sysfs support to read temperature")
Cc: Marc Smith <msmith626@gmail.com>
Reported-by: Marc Smith <msmith626@gmail.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b148bb238c02f0c7797efed026e9bba5892d2172
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Aug 26 01:08:36 2020 -0400
bnxt_en: Fix possible crash in bnxt_fw_reset_task().
bnxt_fw_reset_task() is run from a delayed workqueue. The current
code is not cancelling the workqueue in the driver's .remove()
method and it can potentially crash if the device is removed with
the workqueue still pending.
The fix is to clear the BNXT_STATE_IN_FW_RESET flag and then cancel
the delayed workqueue in bnxt_remove_one(). bnxt_queue_fw_reset_work()
also needs to check that this flag is set before scheduling. This
will guarantee that no rescheduling will be done after it is cancelled.
Fixes: 230d1f0de754 ("bnxt_en: Handle firmware reset.")
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit df3875ec550396974b1d8a518bd120d034738236
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Wed Aug 26 01:08:35 2020 -0400
bnxt_en: Fix PCI AER error recovery flow
When a PCI error is detected the PCI state could be corrupt, save
the PCI state after initialization and restore it after the slot
reset.
Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7de651490c27ebc5edb5c7224c368bd0cd5b3862
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Aug 26 01:08:34 2020 -0400
bnxt_en: Fix ethtool -S statitics with XDP or TCs enabled.
We are returning the wrong count for ETH_SS_STATS in get_sset_count()
when XDP or TCs are enabled. In a recent commit, we got rid of
irrelevant counters when the ring is RX only or TX only, but we
did not make the proper adjustments for the count. As a result,
when we have XDP or TCs enabled, we are returning an excess count
because some of the rings are TX only. This causes ethtool -S to
display extra counters with no counter names.
Fix bnxt_get_num_ring_stats() by not assuming that all rings will
always have RX and TX counters in combined mode.
Fixes: 125592fbf467 ("bnxt_en: show only relevant ethtool stats for a TX or RX ring")
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dbbfa96ad920c50d58bcaefa57f5f33ceef9d00e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Wed Aug 26 01:08:33 2020 -0400
bnxt_en: Check for zero dir entries in NVRAM.
If firmware goes into unstable state, HWRM_NVM_GET_DIR_INFO firmware
command may return zero dir entries. Return error in such case to
avoid zero length dma buffer request.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c1c2d77408022a398a1a7c51cf20488c922629de
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Wed Aug 26 01:08:32 2020 -0400
bnxt_en: Don't query FW when netif_running() is false.
In rare conditions like two stage OS installation, the
ethtool's get_channels function may be called when the
device is in D3 state, leading to uncorrectable PCI error.
Check netif_running() first before making any query to FW
which involves writing to BAR.
Fixes: db4723b3cd2d ("bnxt_en: Check max_tx_scheduler_inputs value from firmware.")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit df561f6688fef775baa341a0f5d960becd248b11
Author: Gustavo A. R. Silva <gustavoars@kernel.org>
Date: Sun Aug 23 17:36:59 2020 -0500
treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.
[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
commit b5d600b027eb2733a1d7d253b84efb96c40f6a9d
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jul 27 05:40:45 2020 -0400
bnxt_en: Add support for 'ethtool -d'
Add support to dump PXP registers and PCIe statistics.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a0c30621c28c6d8e9c572cd6139881f15c806792
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 27 05:40:44 2020 -0400
bnxt_en: Switch over to use the 64-bit software accumulated counters.
Now we can report all the full 64-bit CPU endian software accumulated
counters instead of the hw counters, some of which may be less than
64-bit wide. Define the necessary macros to access the software
counters.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fea6b3335527f41bc729466fb2a95e48a98827ac
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 27 05:40:43 2020 -0400
bnxt_en: Accumulate all counters.
Now that we have the infrastructure in place, add the new function
bnxt_accumulate_all_stats() to periodically accumulate and check for
counter rollover of all ring stats and port stats.
A chip bug was also discovered that could cause some ring counters to
become 0 during DMA. Workaround by ignoring zeros on the affected
chips.
Some older frimware will reset port counters during ifdown. We need
to check for that and free the accumulated port counters during ifdown
to prevent bogus counter overflow detection during ifup.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 531d1d269c1d432d691026c82d04b7bb5f1ae318
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 27 05:40:42 2020 -0400
bnxt_en: Retrieve hardware masks for port counters.
If supported by newer firmware, make the firmware call to query all
the port counter masks. If not supported, assume 40-bit port
counter masks.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d752d0536c979068084e0c60ff506c07e1cf613e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 27 05:40:41 2020 -0400
bnxt_en: Retrieve hardware counter masks from firmware if available.
Newer firmware has a new call HWRM_FUNC_QSTATS_EXT to retrieve the
masks of all ring counters. Make this call when supported to
initialize the hardware masks of all ring counters. If the call
is not available, assume 48-bit ring counter masks on P5 chips.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a37120b22e540b4eb068addf9be3f63b64dca690
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 27 05:40:40 2020 -0400
bnxt_en: Allocate additional memory for all statistics blocks.
Some of these DMAed hardware counters are not full 64-bit counters and
so we need to accumulate them as they overflow. Allocate copies of these
DMA statistics memory blocks with the same size for accumulation. The
hardware counter widths are also counter specific so we allocate
memory for masks that correspond to each counter.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 177a6cde47fcf23e5826c6224fc53038480451c2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 27 05:40:39 2020 -0400
bnxt_en: Refactor statistics code and structures.
The driver manages multiple statistics structures of different sizes.
They are all allocated, freed, and handled practically the same. Define
a new bnxt_stats_mem structure and common allocation and free functions
for all staistics memory blocks.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 24c93443fe21ca3ec87b7b121548daa3b57a34af
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 27 05:40:38 2020 -0400
bnxt_en: Use macros to define port statistics size and offset.
The port statistics structures have hard coded padding and offset.
Define macros to make this look cleaner.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bfc6e5fbcbbf75967a7f673ad67fa227d77f2541
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 27 05:40:37 2020 -0400
bnxt_en: Update firmware interface to 1.10.1.54.
Main changes are 200G support and fixing the definitions of discard and
error counters to match the hardware definitions.
Because the HWRM_PORT_PHY_QCFG message size has now exceeded the max.
encapsulated response message size of 96 bytes from the PF to the VF,
we now need to cap this message to 96 bytes for forwarding. The forwarded
response only needs to contain the basic link status and speed information
and can be capped without adding the new information.
v2: Fix bnxt_re compile error.
Cc: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dfe64de974f8c8391776a376cc01c582064e8a46
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jul 27 05:40:36 2020 -0400
bnxt_en: Remove PCIe non-counters from ethtool statistics
Remove PCIe non-counters display from ethtool statistics, as
they are not simple counters but register dump. The next few
patches will add logic to detect counter roll-over and it won't
work with these PCIe non-counters.
There will be a follow up patch to get PCIe information via
ethtool register dump.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e8407fdeb9a6866784e249881f6c786a0835faba
Author: Andrii Nakryiko <andriin@fb.com>
Date: Tue Jul 21 23:46:02 2020 -0700
bpf, xdp: Remove XDP_QUERY_PROG and XDP_QUERY_PROG_HW XDP commands
Now that BPF program/link management is centralized in generic net_device
code, kernel code never queries program id from drivers, so
XDP_QUERY_PROG/XDP_QUERY_PROG_HW commands are unnecessary.
This patch removes all the implementations of those commands in kernel, along
the xdp_attachment_query().
This patch was compile-tested on allyesconfig.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200722064603.3350758-10-andriin@fb.com
commit 18c7015cc65ab62a161291b863225db5cfc717a4
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Jul 17 13:59:58 2020 -0700
net: bnxt: don't complain if TC flower can't be supported
The fact that NETIF_F_HW_TC is not set should be a sufficient
indication to the user that TC offloads are not supported.
No need to bother users of older firmware versions with
pointless warnings on every boot.
Also, since the support is optional, bnxt_init_tc() should not
return an error in case FW is old, similarly to how error
is not returned when CONFIG_BNXT_FLOWER_OFFLOAD is not set.
With that we can add an error message to the caller, to warn
about actual unexpected failures.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c40f4e50b6cfc7c66f69d12c6b3fbcd954f1ded5
Author: Petr Machata <petrm@mellanox.com>
Date: Sat Jul 11 00:55:03 2020 +0300
net: sched: Pass qdisc reference in struct flow_block_offload
Previously, shared blocks were only relevant for the pseudo-qdiscs ingress
and clsact. Recently, a qevent facility was introduced, which allows to
bind blocks to well-defined slots of a qdisc instance. RED in particular
got two qevents: early_drop and mark. Drivers that wish to offload these
blocks will be sent the usual notification, and need to know which qdisc it
is related to.
To that end, extend flow_block_offload with a "sch" pointer, and initialize
as appropriate. This prompts changes in the indirect block facility, which
now tracks the scheduler in addition to the netdevice. Update signatures of
several functions similarly.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 27640ce68d21e556b66bc5fa022aacd26e53c947
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Jul 11 20:48:25 2020 -0400
bnxt_en: Fix completion ring sizing with TPA enabled.
The current completion ring sizing formula is wrong with TPA enabled.
The formula assumes that the number of TPA completions are bound by the
RX ring size, but that's not true. TPA_START completions are immediately
recycled so they are not bound by the RX ring size. We must add
bp->max_tpa to the worst case maximum RX and TPA completions.
The completion ring can overflow because of this mistake. This will
cause hardware to disable the completion ring when this happens,
leading to RX and TX traffic to stall on that ring. This issue is
generally exposed only when the RX ring size is set very small.
Fix the formula by adding bp->max_tpa to the number of RX completions
if TPA is enabled.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.");
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ca0c753815fe4786b79a80abf0412eb5d52090b8
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Jul 11 20:48:24 2020 -0400
bnxt_en: Init ethtool link settings after reading updated PHY configuration.
In a shared port PHY configuration, async event is received when any of the
port modifies the configuration. Ethtool link settings should be
initialised after updated PHY configuration from firmware.
Fixes: b1613e78e98d ("bnxt_en: Add async. event logic for PHY configuration changes.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 163e9ef63641a02de4c95cd921577265c52e1ce2
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Jul 11 20:48:23 2020 -0400
bnxt_en: Fix race when modifying pause settings.
The driver was modified to not rely on rtnl lock to protect link
settings about 2 years ago. The pause setting was missed when
making that change. Fix it by acquiring link_lock mutex before
calling bnxt_hwrm_set_pause().
Fixes: e2dc9b6e38fa ("bnxt_en: Don't use rtnl lock to protect link change logic in workqueue.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c8b1d7436045d3599bae56aef1682813ecccaad7
Author: Davide Caratti <dcaratti@redhat.com>
Date: Fri Jul 10 12:55:08 2020 +0200
bnxt_en: fix NULL dereference in case SR-IOV configuration fails
we need to set 'active_vfs' back to 0, if something goes wrong during the
allocation of SR-IOV resources: otherwise, further VF configurations will
wrongly assume that bp->pf.vf[x] are valid memory locations, and commands
like the ones in the following sequence:
# echo 2 >/sys/bus/pci/devices/${ADDR}/sriov_numvfs
# ip link set dev ens1f0np0 up
# ip link set dev ens1f0np0 vf 0 trust on
will cause a kernel crash similar to this:
bnxt_en 0000:3b:00.0: not enough MMIO resources for SR-IOV
BUG: kernel NULL pointer dereference, address: 0000000000000014
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [#1] SMP PTI
CPU: 43 PID: 2059 Comm: ip Tainted: G I 5.8.0-rc2.upstream+ #871
Hardware name: Dell Inc. PowerEdge R740/08D89F, BIOS 2.2.11 06/13/2019
RIP: 0010:bnxt_set_vf_trust+0x5b/0x110 [bnxt_en]
Code: 44 24 58 31 c0 e8 f5 fb ff ff 85 c0 0f 85 b6 00 00 00 48 8d 1c 5b 41 89 c6 b9 0b 00 00 00 48 c1 e3 04 49 03 9c 24 f0 0e 00 00 <8b> 43 14 89 c2 83 c8 10 83 e2 ef 45 84 ed 49 89 e5 0f 44 c2 4c 89
RSP: 0018:ffffac6246a1f570 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000000b
RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff98b28f538900
RBP: ffff98b28f538900 R08: 0000000000000000 R09: 0000000000000008
R10: ffffffffb9515be0 R11: ffffac6246a1f678 R12: ffff98b28f538000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffffffc05451e0
FS: 00007fde0f688800(0000) GS:ffff98baffd40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000014 CR3: 000000104bb0a003 CR4: 00000000007606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
do_setlink+0x994/0xfe0
__rtnl_newlink+0x544/0x8d0
rtnl_newlink+0x47/0x70
rtnetlink_rcv_msg+0x29f/0x350
netlink_rcv_skb+0x4a/0x110
netlink_unicast+0x21d/0x300
netlink_sendmsg+0x329/0x450
sock_sendmsg+0x5b/0x60
____sys_sendmsg+0x204/0x280
___sys_sendmsg+0x88/0xd0
__sys_sendmsg+0x5e/0xa0
do_syscall_64+0x47/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.")
Reported-by: Fei Liu <feliu@redhat.com>
CC: Jonathan Toppins <jtoppins@redhat.com>
CC: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Jonathan Toppins <jtoppins@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 442a35a5a7aa7277ace9a2671260dbff1a04e029
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Jul 9 17:42:52 2020 -0700
bnxt: convert to new udp_tunnel_nic infra
Convert to new infra, taking advantage of sleeping in callbacks.
v2:
- use bp->*_fw_dst_port_id != INVALID_HW_RING_ID as indication
that the offload is active.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 71ad8d55f8e5ea101069b552422f392655e2ffb6
Author: Danielle Ratson <danieller@mellanox.com>
Date: Thu Jul 9 16:18:16 2020 +0300
devlink: Replace devlink_port_attrs_set parameters with a struct
Currently, devlink_port_attrs_set accepts a long list of parameters,
that most of them are devlink port's attributes.
Use the devlink_port_attrs struct to replace the relevant parameters.
Signed-off-by: Danielle Ratson <danieller@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1da63ddd0e155277bf613dfc7062af95d90452f2
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Wed Jul 8 07:54:01 2020 -0400
bnxt_en: allow firmware to disable VLAN offloads
Bare-metal use cases require giving firmware and the embedded
application processor control over VLAN offloads. The driver should
not attempt to override or utilize this feature in such scenarios
since it will not work as expected.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a196e96bb68fbc7a319f45df1d529b807216a03a
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Wed Jul 8 07:54:00 2020 -0400
bnxt_en: clean up VLAN feature bit handling
The hardware VLAN offload feature on our NIC does not have separate
knobs for handling customer and service tags on RX. Either offloading
of both must be enabled or both must be disabled. Introduce definitions
for the combined feature set in order to clean up the code and make
this constraint more clear. Technically these features can be separately
enabled on TX, however, since the default is to turn both on, the
combined TX feature set is also introduced for code consistency.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bd3191b5d87d5ebc1d4149bbbb42a64ec3d469bf
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 8 07:53:59 2020 -0400
bnxt_en: Implement ethtool -X to set indirection table.
With the new infrastructure in place, we can now support the setting of
the indirection table from ethtool.
When changing channels, in a rare case that firmware cannot reserve the
rings that were promised, we will still try to keep the RSS map and only
revert to default when absolutely necessary.
v4: Revert RSS map to default during ring change only when absolutely
necessary.
v3: Add warning messages when firmware cannot reserve the requested RX
rings, and when the RSS table entries have to change to default.
v2: When changing channels, if the RSS table size changes and RSS map
is non-default, return error.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit adc38ac66745949ce12c1861c1a25f3ef93df1f8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 8 07:53:58 2020 -0400
bnxt_en: Return correct RSS indirection table entries to ethtool -x.
Now that we have the logical indirection table, we can return these
proper logical indices directly to ethtool -x instead of the physical
IDs.
Reported-by: Jakub Kicinski <kicinski@fb.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f33a305d09388880ec92db8de3c38448db36b629
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 8 07:53:57 2020 -0400
bnxt_en: Fill HW RSS table from the RSS logical indirection table.
Now that we have the logical table, we can fill the HW RSS table
using the logical table's entries and converting them to the HW
specific format. Re-initialize the logical table to standard
distribution if the number of RX rings changes during ring reservation.
v4: Use bnxt_get_rxfh_indir_size() to get the RSS table size.
v2: Use ALIGN() to roundup the RSS table size.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f9f6a3fbb5eb89e738ebdf16ac56437177537b28
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 8 07:53:56 2020 -0400
bnxt_en: Add helper function to return the number of RSS contexts.
On some chips, this varies based on the number of RX rings. Add this
helper function and refactor the existing code to use it.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1667cbf6a4ebe0901bd93ef0d6defd35006fd2be
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 8 07:53:55 2020 -0400
bnxt_en: Add logical RSS indirection table structure.
The driver currently does not keep track of the logical RSS indirection
table. The hardware RSS table is set up with standard default ring
distribution when initializing the chip. This makes it difficult to
support user sepcified indirection table entries. As a first step, add
the logical table in the main bnxt structure and allocate it according
to chip specific table size. Add a function that sets up default
RSS distribution based on the number of RX rings.
v4: Use bnxt_get_rxfh_indir_size() for the current RSS table size.
v2: Use kmalloc_array() since we init. all entries afterwards.
Use ALIGN() to roundup the RSS table size.
Use ethtool_rxfh_indir_default() to init. the default entries.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b73c1d08a0ec33f2ddafdd21d3a48614da4e6853
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 8 07:53:54 2020 -0400
bnxt_en: Fix up bnxt_get_rxfh_indir_size().
Fix up bnxt_get_rxfh_indir_size() to return the proper current RSS
table size for P5 chips. Change it to non-static so that bnxt.c
can use it to get the table size.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 34370d2435f9853ac882056faa98f3263c537c36
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 8 07:53:53 2020 -0400
bnxt_en: Set up the chip specific RSS table size.
Currently, we allocate one page for the hardware DMA RSS indirection
table. While the size is currently big enough for all chips, future
chip variations may support bigger sizes, so it is better to calculate
and store the chip specific size and allocate accordingly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c55e28a8b43fcd7dc71868bd165705bc7741a7ca
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Tue Jun 23 19:01:38 2020 -0400
bnxt_en: Read VPD info only for PFs
Virtual functions does not have VPD information. This patch modifies
calling bnxt_read_vpd_info() only for PFs and avoids an unnecessary
error log.
Fixes: a0d0fd70fed5 ("bnxt_en: Read partno and serialno of the board from VPD")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c2dec363feb41544a76c8083aca2378990e17166
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jun 23 19:01:37 2020 -0400
bnxt_en: Fix statistics counters issue during ifdown with older firmware.
On older firmware, the hardware statistics are not cleared when the
driver frees the hardware stats contexts during ifdown. The driver
expects these stats to be cleared and saves a copy before freeing
the stats contexts. During the next ifup, the driver will likely
allocate the same hardware stats contexts and this will cause a big
increase in the counters as the old counters are added back to the
saved counters.
We fix it by making an additional firmware call to clear the counters
before freeing the hw stats contexts when the firmware is the older
20.x firmware.
Fixes: b8875ca356f1 ("bnxt_en: Save ring statistics before reset.")
Reported-by: Jakub Kicinski <kicinski@fb.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Jakub Kicinski <kicinski@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fed7edd18143c68c63ea049999a7e861123de6de
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jun 23 19:01:36 2020 -0400
bnxt_en: Do not enable legacy TX push on older firmware.
Older firmware may not support legacy TX push properly and may not
be disabling it. So we check certain firmware versions that may
have this problem and disable legacy TX push unconditionally.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d0ad2ea2bc185835f8a749302ad07b70528d2a09
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jun 23 19:01:35 2020 -0400
bnxt_en: Store the running firmware version code.
We currently only store the firmware version as a string for ethtool
and devlink info. Store it also as a version code. The next 2
patches will need to check the firmware major version to determine
some workarounds.
We also use the 16-bit firmware version fields if the firmware is newer
and provides the 16-bit fields.
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9bf88b9fc8a4a8dd38992a7a065e459c645c9545
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Jun 20 22:01:57 2020 +0530
bnxt_en: Add board.serial_number field to info_get cb
Add board.serial_number field info to info_get cb via devlink,
if driver can fetch the information from the device.
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a1db217861f33b8d9ea8171bcacee51186e2d5ba
Author: wenxu <wenxu@ucloud.cn>
Date: Thu Jun 18 20:49:10 2020 +0800
net: flow_offload: fix flow_indr_dev_unregister path
If the representor is removed, then identify the indirect flow_blocks
that need to be removed by the release callback and the port representor
structure. To identify the port representor structure, a new
indr.cb_priv field needs to be introduced. The flow_block also needs to
be removed from the driver list from the cleanup path.
Fixes: 1fac52da5942 ("net: flow_offload: consolidate indirect flow_block infrastructure")
Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 66f1939a1b705305df820d65f4d9a8457d05759c
Author: wenxu <wenxu@ucloud.cn>
Date: Thu Jun 18 20:49:09 2020 +0800
flow_offload: use flow_indr_block_cb_alloc/remove function
Prepare fix the bug in the next patch. use flow_indr_block_cb_alloc/remove
function and remove the __flow_block_indr_binding.
Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4b61d3e8d3daebbde7ec02d593f84248fdf8bec2
Author: Po Liu <Po.Liu@nxp.com>
Date: Fri Jun 19 14:01:07 2020 +0800
net: qos offload add flow status with dropped count
This patch adds a drop frames counter to tc flower offloading.
Reporting h/w dropped frames is necessary for some actions.
Some actions like police action and the coming introduced stream gate
action would produce dropped frames which is necessary for user. Status
update shows how many filtered packets increasing and how many dropped
in those packets.
v2: Changes
- Update commit comments suggest by Jiri Pirko.
Signed-off-by: Po Liu <Po.Liu@nxp.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e000940473d1423a42ef9c823fb23ccffe3f07ea
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Jun 14 19:57:10 2020 -0400
bnxt_en: Return from timer if interface is not in open state.
This will avoid many uneccessary error logs when driver or firmware is
in reset.
Fixes: 230d1f0de754 ("bnxt_en: Handle firmware reset.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6e2f83884c099de0e87b15a820736e522755d074
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jun 14 19:57:09 2020 -0400
bnxt_en: Fix AER reset logic on 57500 chips.
AER reset should follow the same steps as suspend/resume. We need to
free context memory during AER reset and allocate new context memory
during recovery by calling bnxt_hwrm_func_qcaps(). We also need
to call bnxt_reenable_sriov() to restore the VFs.
Fixes: bae361c54fb6 ("bnxt_en: Improve AER slot reset.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 59ae210173ff86256fa0cdba4ea4d608c61e123d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jun 14 19:57:08 2020 -0400
bnxt_en: Re-enable SRIOV during resume.
If VFs are enabled, we need to re-configure them during resume because
firmware has been reset while resuming. Otherwise, the VFs won't
work after resume.
Fixes: c16d4ee0e397 ("bnxt_en: Refactor logic to re-enable SRIOV after firmware reset detected.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2084ccf6259cc95e0575f0fafc93595d0219a9f6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Jun 14 19:57:07 2020 -0400
bnxt_en: Simplify bnxt_resume().
The separate steps we do in bnxt_resume() can be done more simply by
calling bnxt_hwrm_func_qcaps(). This change will add an extra
__bnxt_hwrm_func_qcaps() call which is needed anyway on older
firmware.
Fixes: f9b69d7f6279 ("bnxt_en: Fix suspend/resume path on 57500 chips")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e445e30cf7e6d68566db775ce186cbe63ef286e9
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Fri May 29 02:25:40 2020 +0200
bnxt_tc: update indirect block support
Register ndo callback via flow_indr_dev_register() and
flow_indr_dev_unregister().
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2a5a8800fa915bd9bc272c91ca64728e6aa84c0a
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon May 25 17:41:19 2020 -0400
bnxt_en: fix firmware message length endianness
The explicit mask and shift is not the appropriate way to parse fields
out of a little endian struct. The length field is internally __le16
and the strategy employed only happens to work on little endian machines
because the offset used is actually incorrect (length is at offset 6).
Also remove the related and no longer used definitions from bnxt.h.
Fixes: 845adfe40c2a ("bnxt_en: Improve valid bit checking in firmware response message.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 95ec1f470b976858264d7635a6ef76bc33c3875b
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon May 25 17:41:18 2020 -0400
bnxt_en: Fix return code to "flash_device".
When NVRAM directory is not found, return the error code
properly as per firmware command failure instead of the hardcode
-ENOBUFS.
Fixes: 3a707bed13b7 ("bnxt_en: Return -EAGAIN if fw command returns BUSY")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b8056e8434b037fdab08158fea99ed7bc8ef3a74
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 25 17:41:17 2020 -0400
bnxt_en: Fix accumulation of bp->net_stats_prev.
We have logic to maintain network counters across resets by storing
the counters in bp->net_stats_prev before reset. But not all resets
will clear the counters. Certain resets that don't need to change
the number of rings do not clear the counters. The current logic
accumulates the counters before all resets, causing big jumps in
the counters after some resets, such as ethtool -G.
Fix it by only accumulating the counters during reset if the irq_re_init
parameter is set. The parameter signifies that all rings and interrupts
will be reset and that means that the counters will also be reset.
Reported-by: Vijayendra Suman <vijayendra.suman@oracle.com>
Fixes: b8875ca356f1 ("bnxt_en: Save ring statistics before reset.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 63fe91ab3d1c5c0b4497b993b8eeaa54f6688d53
Author: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Thu May 14 12:49:07 2020 +0200
bnxt: Add XDP frame size to driver
This driver uses full PAGE_SIZE pages when XDP is enabled.
In case of XDP uses driver uses __bnxt_alloc_rx_page which does full
page DMA-map. Thus, xdp_adjust_tail grow is DMA compliant for XDP_TX
action that does DMA-sync.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Link: https://lore.kernel.org/bpf/158945334769.97035.13437970179897613984.stgit@firesoul
commit ba42580019560ed9c54f87c3c4e852ce26869c5d
Author: Jason Yan <yanaijie@huawei.com>
Date: Tue May 5 15:46:08 2020 +0800
net: bnxt: Remove Comparison to bool in bnxt_ethtool.c
Fix the following coccicheck warning:
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:1991:5-46: WARNING:
Comparison to bool
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:1993:10-54: WARNING:
Comparison to bool
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2380:5-38: WARNING:
Comparison to bool
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 125592fbf467d1a70312006bbaf29724d0ba5897
Author: Rajesh Ravi <rajesh.ravi@broadcom.com>
Date: Mon May 4 04:50:41 2020 -0400
bnxt_en: show only relevant ethtool stats for a TX or RX ring
Currently, ethtool -S shows all TX/RX ring counters whether the
channel is combined, RX, or TX. The unused counters will always be
zero. Improve it by showing only the relevant counters if the channel
is RX or TX. If the channel is combined, the counters will be shown
exactly the same as before.
[ MChan: Lots of cleanups and simplifications on Rajesh's original
code]
Signed-off-by: Rajesh Ravi <rajesh.ravi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3316d50905f0e551d4786767d827589960a8cb83
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:40 2020 -0400
bnxt_en: Split HW ring statistics strings into RX and TX parts.
This will allow the RX and TX ring statistics to be separated if needed.
In the next patch, we'll be able to only display RX or TX statistcis if
the channel is RX only or TX only.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9d8b5f05529c619b63d68b0dd26a1dfe35a4fab2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:39 2020 -0400
bnxt_en: Refactor the software ring counters.
We currently have 3 software ring counters, rx_l4_csum_errors,
rx_buf_errors, and missed_irqs. The 1st two are RX counters and the
last one is a common counter. Organize them into 2 structures
bnxt_rx_sw_stats and bnxt_cmn_sw_stats.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 098286ff930ca752e4c9295ea65840dd55f5f290
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:38 2020 -0400
bnxt_en: Add doorbell information to bnxt_en_dev struct.
The purpose of this is to inform the RDMA driver the size of the doorbell
BAR that the L2 driver has mapped and the portion that is mapped
uncacheable. The unchaeable portion is shared with the RoCE driver.
Any remaining unmapped doorbell BAR can be used by the RDMA driver for
its own purpose. Currently, the entire L2 portion is mapped uncacheable.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8ae2473842bdbb95bfb451b130dad6a650b3ad1b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:37 2020 -0400
bnxt_en: Add support for L2 doorbell size.
Read the L2 doorbell size from the firmware and only map the portion
of the doorbell BAR for L2 use. This will leave the remaining doorbell
BAR available for the RoCE driver to use. The RoCE driver can map
the remaining portion as write-combining to support the push feature.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e93b30d56fc0670e508456afc59f16d70fe1f83f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:36 2020 -0400
bnxt_en: Set the db_offset on 57500 chips for the RDMA MSIX entries.
The driver provides completion ring or NQ doorbell offset for each
MSIX entry requested by the RDMA driver. The NQ offset on 57500
chips is different than legacy chips. Set it correctly based on
chip type for correctness. The RDMA driver is ignoring this field
for the 57500 chips so it is not causing any problem.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ebdf73dc595b6711dbfaf3007d513909bd814940
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:35 2020 -0400
bnxt_en: Define the doorbell offsets on 57500 chips.
Define the 57500 chip doorbell offsets instead of using the magic
values in the C file.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8cec0940803c255f501d4b9f4764cd47fc206ad4
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon May 4 04:50:34 2020 -0400
bnxt_en: Improve kernel log messages related to ethtool reset.
Kernel log messages for failed AP reset commands should be suppressed.
These are expected to fail on devices that do not have an AP. Add
missing driver reload message after AP reset and log it in a common
way without duplication.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7a13240e371891d90cd51e3ea55ea04f4b2065dc
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon May 4 04:50:33 2020 -0400
bnxt_en: fix ethtool_reset_flags ABI violations
The ethtool ABI specifies that the reset operation should only clear
the flags that were actually reset. Setting the flags to zero after
a chip reset violates this because it does not include resetting the
application processor complex. Similarly, components that are not yet
defined are also not necessarily being reset.
The fact that chip reset does not cover the AP also means that it is
inappropriate to treat these two components exclusively of one another.
The ABI provides a mechanism to report a failure to reset independent
components via the returned bitmask, so it is also wrong to fail hard
if one of a set of independent resets is not possible.
It is incorrect to rely on the passed by reference flags in bnxt_reset(),
which are being updated as components are reset. The initially requested
value should be used instead so that hard errors do not propagate if any
earlier components could have been reset successfully.
Note, AP and chip resets are global in nature. Dedicated resets are
thus not currently supported.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 94f17e89c956553606d5c7cf4f40ce6012529d48
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon May 4 04:50:32 2020 -0400
bnxt_en: refactor ethtool firmware reset types
The case statement in bnxt_firmware_reset() dangerously mixes types.
This patch separates the application processor and whole chip resets
from the rest such that the selection is performed on a pure type.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 95fec034fd440b4882701df3e84d2b76af4e627d
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Mon May 4 04:50:31 2020 -0400
bnxt_en: prepare to refactor ethtool reset types
Extract bnxt_hwrm_firmware_reset() for performing firmware reset
operations. This new helper function will be used in a subsequent
patch to separate unrelated reset types out of bnxt_firmware_reset().
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d0b82c5461c9b9bfcb572fe0b50d8e2662e281f1
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon May 4 04:50:30 2020 -0400
bnxt_en: Do not include ETH_FCS_LEN in the max packet length sent to fw.
The firmware does not expect the CRC to be included in the length
passed from the driver. The firmware always configures the chip
to strip out the CRC.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c7dd7ab4b204ac0142e0d05e71e05e71ae6cb270
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:29 2020 -0400
bnxt_en: Improve TQM ring context memory sizing formulas.
The current formulas to calculate the TQM slow path and fast path ring
context memory sizes are not quite correct. TQM slow path entry is
array index 0 of ctx->tqm_mem[]. The other array entries are for fast
path. Fix these sizes according to latest firmware spec. for 57500 and
newer chips.
Fixes: 3be8136ce14e ("bnxt_en: Initialize context memory to the value specified by firmware.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ac3158cb01084aa654222f1ad970b6c1af3cef98
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:28 2020 -0400
bnxt_en: Allocate TQM ring context memory according to fw specification.
Newer firmware spec. will specify the number of TQM rings to allocate
context memory for. Use the firmware specified value and fall back
to the old value derived from bp->max_q if it is not available.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 460c2577aaf349f4e49eaf2b9ec3d8c52a619ef5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 4 04:50:27 2020 -0400
bnxt_en: Update firmware spec. to 1.10.1.33.
Changes include additional statistics, ECN support, context memory
interface change for better TQM context memory sizing, firmware
health status definitions, etc.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c72cb303aa6c2ae7e4184f0081c6d11bf03fb96b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 26 16:24:42 2020 -0400
bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features().
The current logic in bnxt_fix_features() will inadvertently turn on both
CTAG and STAG VLAN offload if the user tries to disable both. Fix it
by checking that the user is trying to enable CTAG or STAG before
enabling both. The logic is supposed to enable or disable both CTAG and
STAG together.
Fixes: 5a9f6b238e59 ("bnxt_en: Enable and disable RX CTAG and RX STAG VLAN acceleration together.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bbf211b1ecb891c7e0cc7888834504183fc8b534
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 26 16:24:41 2020 -0400
bnxt_en: Return error when allocating zero size context memory.
bnxt_alloc_ctx_pg_tbls() should return error when the memory size of the
context memory to set up is zero. By returning success (0), the caller
may proceed normally and may crash later when it tries to set up the
memory.
Fixes: 08fe9d181606 ("bnxt_en: Add Level 2 context memory paging support.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bae361c54fb6ac6eba3b4762f49ce14beb73ef13
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 26 16:24:40 2020 -0400
bnxt_en: Improve AER slot reset.
Improve the slot reset sequence by disabling the device to prevent bad
DMAs if slot reset fails. Return the proper result instead of always
PCI_ERS_RESULT_RECOVERED to the caller.
Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9e68cb0359b20f99c7b070f1d3305e5e0a9fae6d
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Apr 26 16:24:39 2020 -0400
bnxt_en: Reduce BNXT_MSIX_VEC_MAX value to supported CQs per PF.
Broadcom adapters support only maximum of 512 CQs per PF. If user sets
MSIx vectors more than supported CQs, firmware is setting incorrect value
for msix_vec_per_pf_max parameter. Fix it by reducing the BNXT_MSIX_VEC_MAX
value to 512, even though the maximum # of MSIx vectors supported by adapter
are 1280.
Fixes: f399e8497826 ("bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink params.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c71c4e49afe173823a2a85b0cabc9b3f1176ffa2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Apr 26 16:24:38 2020 -0400
bnxt_en: Fix VF anti-spoof filter setup.
Fix the logic that sets the enable/disable flag for the source MAC
filter according to firmware spec 1.7.1.
In the original firmware spec. before 1.7.1, the VF spoof check flags
were not latched after making the HWRM_FUNC_CFG call, so there was a
need to keep the func_flags so that subsequent calls would perserve
the VF spoof check setting. A change was made in the 1.7.1 spec
so that the flags became latched. So we now set or clear the anti-
spoof setting directly without retrieving the old settings in the
stored vf->func_flags which are no longer valid. We also remove the
unneeded vf->func_flags.
Fixes: 8eb992e876a8 ("bnxt_en: Update firmware interface spec to 1.7.6.2.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ba7d16c7794213b591a0ea415d975858d6a7dfd8
Author: Eran Ben Elisha <eranbe@mellanox.com>
Date: Sun Mar 29 14:05:54 2020 +0300
devlink: Implicitly set auto recover flag when registering health reporter
When health reporter is registered to devlink, devlink will implicitly set
auto recover if and only if the reporter has a recover method. No reason
to explicitly get the auto recover flag from the driver.
Remove this flag from all drivers that called
devlink_health_reporter_create.
All existing health reporters set auto recovery to true if they have a
recover method.
Yet, administrator can unset auto recover via netlink command as prior to
this patch.
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 93a129eb8c520b032e1823447b2e1badcc650666
Author: Jiri Pirko <jiri@mellanox.com>
Date: Sat Mar 28 16:37:43 2020 +0100
net: sched: expose HW stats types per action used by drivers
It may be up to the driver (in case ANY HW stats is passed) to select
which type of HW stats he is going to use. Add an infrastructure to
expose this information to user.
$ tc filter add dev enp3s0np1 ingress proto ip handle 1 pref 1 flower dst_ip 192.168.1.1 action drop
$ tc -s filter show dev enp3s0np1 ingress
filter protocol ip pref 1 flower chain 0
filter protocol ip pref 1 flower chain 0 handle 0x1
eth_type ipv4
dst_ip 192.168.1.1
in_hw in_hw_count 2
action order 1: gact action drop
random type none pass val 0
index 1 ref 1 bind 1 installed 10 sec used 10 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
used_hw_stats immediate <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2013d03827dbc2d4b3110ea96f805c5ab035ab15
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Mar 27 15:05:51 2020 +0530
bnxt_en: Fix "fw.mgmt" and "fw.nsci" info via devlink info_get cb
Fix macro names to report fw.mgmt and fw.ncsi versions to match the
devlink documentation.
Example display after fixes:
$ devlink dev info pci/0000:af:00.0
pci/0000:af:00.0:
driver bnxt_en
serial_number B0-26-28-FF-FE-25-84-20
versions:
fixed:
board.id BCM957454A4540
asic.id C454
asic.rev 1
running:
fw 216.1.154.0
fw.psid 0.0.0
fw.mgmt 216.1.146.0
fw.mgmt.api 1.10.1
fw.ncsi 864.0.44.0
fw.roce 216.1.16.0
Fixes: 9599e036b161 ("bnxt_en: Add support for devlink info command")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 56d69c784d36bee693e950de37fe1751e99fda57
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Mar 27 15:05:50 2020 +0530
bnxt_en: Add partno to devlink info_get cb
Add part number info from the vital product data to info_get command
via devlink tool. Update bnxt.rst documentation as well.
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a0d0fd70fed5cc4f1e2dd98b801be63b07b4d6ac
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Mar 27 15:05:49 2020 +0530
bnxt_en: Read partno and serialno of the board from VPD
Store the part number and serial number information from VPD in
the bnxt structure. Follow up patch will add the support to display
the information via devlink command.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b7a444f078592921fa6f83f44b42dd88c08955ee
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Mar 27 15:04:52 2020 +0530
bnxt_en: Add fw.mgmt.api version to devlink info_get cb.
Display the minimum version of firmware interface spec supported
between driver and firmware. Also update bnxt.rst documentation file.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5d765a5e4bd7c368e564e11402bba74cf7f03ac1
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Mar 22 16:40:05 2020 -0400
bnxt_en: Reset rings if ring reservation fails during open()
If ring counts are not reset when ring reservation fails,
bnxt_init_dflt_ring_mode() will not be called again to reinitialise
IRQs when open() is called and results in system crash as napi will
also be not initialised. This patch fixes it by resetting the ring
counts.
Fixes: 47558acd56a7 ("bnxt_en: Reserve rings at driver open if none was reserved at probe time.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 62bfb932a51f6d08eb409248e69f8d6428c2cabd
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Mar 22 16:40:04 2020 -0400
bnxt_en: Free context memory after disabling PCI in probe error path.
Other shutdown code paths will always disable PCI first to shutdown DMA
before freeing context memory. Do the same sequence in the error path
of probe to be safe and consistent.
Fixes: c20dc142dd7b ("bnxt_en: Disable bus master during PCI shutdown and driver unload.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0b5b561cea32d5bb1e0a82d65b755a3cb5212141
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Mar 22 16:40:03 2020 -0400
bnxt_en: Return error if bnxt_alloc_ctx_mem() fails.
The current code ignores the return value from
bnxt_hwrm_func_backing_store_cfg(), causing the driver to proceed in
the init path even when this vital firmware call has failed. Fix it
by propagating the error code to the caller.
Fixes: 1b9394e5a2ad ("bnxt_en: Configure context memory on new devices.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 62d4073e86e62e316bea2c53e77db10418fd5dd7
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Mar 22 16:40:02 2020 -0400
bnxt_en: fix memory leaks in bnxt_dcbnl_ieee_getets()
The allocated ieee_ets structure goes out of scope without being freed,
leaking memory. Appropriate result codes should be returned so that
callers do not rely on invalid data passed by reference.
Also cache the ETS config retrieved from the device so that it doesn't
need to be freed. The balance of the code was clearly written with the
intent of having the results of querying the hardware cached in the
device structure. The commensurate store was evidently missed though.
Fixes: 7df4ae9fe855 ("bnxt_en: Implement DCBNL to support host-based DCBX.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a24ec3220f369aa0b94c863b6b310685a727151c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Mar 22 16:40:01 2020 -0400
bnxt_en: Fix Priority Bytes and Packets counters in ethtool -S.
There is an indexing bug in determining these ethtool priority
counters. Instead of using the queue ID to index, we need to
normalize by modulo 10 to get the index. This index is then used
to obtain the proper CoS queue counter. Rename bp->pri2cos to
bp->pri2cos_idx to make this more clear.
Fixes: e37fed790335 ("bnxt_en: Add ethtool -S priority counters.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 53eca1f3479f355ec17b2e86a6b0680510292833
Author: Jakub Kicinski <kuba@kernel.org>
Date: Mon Mar 16 18:42:11 2020 -0700
net: rename flow_action_hw_stats_types* -> flow_action_hw_stats*
flow_action_hw_stats_types_check() helper takes one of the
FLOW_ACTION_HW_STATS_*_BIT values as input. If we align
the arguments to the opening bracket of the helper there
is no way to call this helper and stay under 80 characters.
Remove the "types" part from the new flow_action helpers
and enum values.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0fcfc7a1c3d14fd5d80e3c615efbd581381a138b
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Mar 8 18:45:54 2020 -0400
bnxt_en: Call devlink_port_type_clear() in remove()
Similar to other drivers, properly clear the devlink port type when
removing the device before unregistration.
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3a707bed13b77dd7773867bee156164d730c24e0
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Mar 8 18:45:53 2020 -0400
bnxt_en: Return -EAGAIN if fw command returns BUSY
If firmware command returns error code as HWRM_ERR_CODE_BUSY, which
means it cannot handle the command due to a conflicting command
from another function, convert it to -EAGAIN. If it is an ethtool
operation, this error code will be returned to userspace.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3d0615911d33b81da64d75031490859b4513a19b
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Mar 8 18:45:52 2020 -0400
bnxt_en: Modify some bnxt_hwrm_*_free() functions to void.
Return code is not needed in some of these functions, as the return
code from firmware message is ignored. Remove the unused rc variable
and also convert functions to void.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9f90445c14bedaea20e64cbe5838450ca377cc85
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Mar 8 18:45:51 2020 -0400
bnxt_en: Remove unnecessary assignment of return code
As part of converting error code in firmware message to standard
code, checking for firmware return code is removed in most of the
places. Remove the assignment of return code where the function
can directly return.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 843d699d79a1ca7fc5d61bf4cf7a85b5879a8ff6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Mar 8 18:45:50 2020 -0400
bnxt_en: Clear DCB settings after firmware reset.
The driver stores a copy of the DCB settings that have been applied to
the firmware. After firmware reset, the firmware settings are gone and
will revert back to default. Clear the driver's copy so that if there
is a DCBNL request to get the settings, the driver will retrieve the
current settings from the firmware. lldpad keeps the DCB settings in
userspace and will re-apply the settings if it is running.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 389a877a3b20c1bc058143dfc4d95fd754fb0240
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Mar 8 18:45:49 2020 -0400
bnxt_en: Process the NQ under NAPI continuous polling.
When we are in continuous NAPI polling mode, the current code in
bnxt_poll_p5() will only process the completion rings and will not
process the NQ until interrupt is re-enabled. Tis logic works and
will not cause RX or TX starvation, but async events in the NQ may
be delayed for the duration of continuous NAPI polling. These
async events may be firmware or VF events.
Continue to handle the NQ after we are done polling the completion
rings. This actually simplies the code in bnxt_poll_p5().
Acknowledge the NQ so these async events will not overflow.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 340ac85eabce302aeb3ae7e1817a8bbd4ffd09b2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Mar 8 18:45:48 2020 -0400
bnxt_en: Simplify __bnxt_poll_cqs_done().
Simplify the function by removing tha 'all' parameter. In the current
code, the caller has to specify whether to update/arm both completion
rings with the 'all' parameter.
Instead of this, we can just update/arm all the completion rings
that have been polled. By setting cpr->had_work_done earlier in
__bnxt_poll_work(), we know which completion ring has been polled
and can just update/arm all the completion rings with
cpr->had_work_done set.
This simplifies the function with one less parameter and works just
as well.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 54a9062f6909bed8667984c1726bce8183c72118
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Mar 8 18:45:47 2020 -0400
bnxt_en: Handle all NQ notifications in bnxt_poll_p5().
In bnxt_poll_p5(), the logic polls for up to 2 completion rings (RX and
TX) for work. In the current code, if we reach budget polling the
first completion ring, we will stop. If the other completion ring
has work to do, we will handle it when NAPI calls us back.
This is not optimal. We potentially leave an unproceesed entry in
the NQ. When we are finally done with NAPI polling and re-enable
interrupt, the remaining entry in the NQ will cause interrupt to
be triggered immediately for no reason.
Modify the code in bnxt_poll_p5() to keep looping until all NQ
entries are handled even if the first completion ring has reached
budget.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 319a1d19471ec49b8a91a7f6a3fe2c4535e5c279
Author: Jiri Pirko <jiri@mellanox.com>
Date: Sat Mar 7 12:40:13 2020 +0100
flow_offload: check for basic action hw stats type
Introduce flow_action_basic_hw_stats_types_check() helper and use it
in drivers. That sanitizes the drivers which do not have support
for action HW stats types.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8d85b75b4e08ab41e55dbb43cb1b82b5b35f22c5
Author: Jacob Keller <jacob.e.keller@intel.com>
Date: Mon Mar 2 18:25:01 2020 -0800
bnxt_en: Use pci_get_dsn()
Replace the open-coded implementation for reading the PCIe DSN with
pci_get_dsn().
Use of put_unaligned_le64 should be correct. pci_get_dsn() will perform
two pci_read_config_dword calls. The first dword will be placed in the
first 32 bits of the u64, while the second dword will be placed in the
upper 32 bits of the u64.
On Little Endian systems, the least significant byte comes first, which
will be the least significant byte of the first dword, followed by the
least significant byte of the second dword. Since the _le32 variations
do not perform byte swapping, we will correctly copy the dwords into the
dsn[] array in the same order as before.
On Big Endian systems, the most significant byte of the second dword
will come first. put_unaligned_le64 will perform a CPU_TO_LE64, which
will swap things correctly before copying. This should also end up with
the correct bytes in the dsn[] array.
While at it, fix a small typo in the netdev_info error message when the
DSN cannot be read.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f704d24371a4cd7009cb776b55463462f2326493
Author: Jakub Kicinski <kuba@kernel.org>
Date: Wed Mar 4 21:15:39 2020 -0800
bnxt: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
v3: adjust commit message for new member name
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 22630e28f9c2b55abd217869cc0696def89f2284
Author: Edwin Peer <edwin.peer@broadcom.com>
Date: Sun Mar 1 22:07:18 2020 -0500
bnxt_en: fix error handling when flashing from file
After bnxt_hwrm_do_send_message() was updated to return standard error
codes in a recent commit, a regression in bnxt_flash_package_from_file()
was introduced. The return value does not properly reflect all
possible firmware errors when calling firmware to flash the package.
Fix it by consolidating all errors in one local variable rc instead
of having 2 variables for different errors.
Fixes: d4f1420d3656 ("bnxt_en: Convert error code in firmware message response to standard code.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a9b952d267e59a3b405e644930f46d252cea7122
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Mar 1 22:07:17 2020 -0500
bnxt_en: reinitialize IRQs when MTU is modified
MTU changes may affect the number of IRQs so we must call
bnxt_close_nic()/bnxt_open_nic() with the irq_re_init parameter
set to true. The reason is that a larger MTU may require
aggregation rings not needed with smaller MTU. We may not be
able to allocate the required number of aggregation rings and
so we reduce the number of channels which will change the number
of IRQs. Without this patch, it may crash eventually in
pci_disable_msix() when the IRQs are not properly unwound.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9a005c3898aa07cd5cdca77b7096814e6c478c92
Author: Jonathan Lemon <jonathan.lemon@gmail.com>
Date: Mon Feb 24 15:29:09 2020 -0800
bnxt_en: add newline to netdev_*() format strings
Add missing newlines to netdev_* format strings so the lines
aren't buffered by the printk subsystem.
Nitpicked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8743db4a9acfd51f805ac0c87bcaae92c42d1061
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Feb 20 17:26:35 2020 -0500
bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs.
If crashed kernel does not shutdown the NIC properly, PCIe FLR
is required in the kdump kernel in order to initialize all the
functions properly.
Fixes: d629522e1d66 ("bnxt_en: Reduce memory usage when running in kdump kernel.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5567ae4a8d569d996d0d88d0eceb76205e4c7ce5
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Feb 20 17:26:34 2020 -0500
bnxt_en: Improve device shutdown method.
Especially when bnxt_shutdown() is called during kexec, we need to
disable MSIX and disable Bus Master to completely quiesce the device.
Make these 2 calls unconditionally in the shutdown method.
Fixes: c20dc142dd7b ("bnxt_en: Disable bus master during PCI shutdown and driver unload.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 18e4960c18f484ac288f41b43d0e6c4c88e6ea78
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 2 02:41:38 2020 -0500
bnxt_en: Fix TC queue mapping.
The driver currently only calls netdev_set_tc_queue when the number of
TCs is greater than 1. Instead, the comparison should be greater than
or equal to 1. Even with 1 TC, we need to set the queue mapping.
This bug can cause warnings when the number of TCs is changed back to 1.
Fixes: 7809592d3e2e ("bnxt_en: Enable MSIX early in bnxt_init_one().")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit d407302895d3f3ca3a333c711744a95e0b1b0150
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Feb 2 02:41:37 2020 -0500
bnxt_en: Fix logic that disables Bus Master during firmware reset.
The current logic that calls pci_disable_device() in __bnxt_close_nic()
during firmware reset is flawed. If firmware is still alive, we're
disabling the device too early, causing some firmware commands to
not reach the firmware.
Fix it by moving the logic to bnxt_reset_close(). If firmware is
in fatal condition, we call pci_disable_device() before we free
any of the rings to prevent DMA corruption of the freed rings. If
firmware is still alive, we call pci_disable_device() after the
last firmware message has been sent.
Fixes: 3bc7d4a352ef ("bnxt_en: Add BNXT_STATE_IN_FW_RESET state.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 12de2eadf87825c3990c1aa68b5e93101ca2f043
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 2 02:41:36 2020 -0500
bnxt_en: Fix RDMA driver failure with SRIOV after firmware reset.
bnxt_ulp_start() needs to be called before SRIOV is re-enabled after
firmware reset. Re-enabling SRIOV may consume all the resources and
may cause the RDMA driver to fail to get MSIX and other resources.
Fix it by calling bnxt_ulp_start() first before calling
bnxt_reenable_sriov().
We re-arrange the logic so that we call bnxt_ulp_start() and
bnxt_reenable_sriov() in proper sequence in bnxt_fw_reset_task() and
bnxt_open(). The former is the normal coordinated firmware reset sequence
and the latter is firmware reset while the function is down. This new
logic is now more straight forward and will now fix both scenarios.
Fixes: f3a6d206c25a ("bnxt_en: Call bnxt_ulp_stop()/bnxt_ulp_start() during error recovery.")
Reported-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit c16d4ee0e397163fe7ceac281eaa952e63fadec7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 2 02:41:35 2020 -0500
bnxt_en: Refactor logic to re-enable SRIOV after firmware reset detected.
Put the current logic in bnxt_open() to re-enable SRIOV after detecting
firmware reset into a new function bnxt_reenable_sriov(). This call
needs to be invoked in the firmware reset path also in the next patch.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
commit 9599e036b161243d7c62399a1b6c250573e08a43
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 27 04:56:26 2020 -0500
bnxt_en: Add support for devlink info command
Display the following information via devlink info command:
- Driver name
- Board id
- Broad revision
- Board Serial number
- Board FW version
- FW parameter set version
- FW App version
- FW management version
- FW RoCE version
Standard output example:
$ devlink dev info pci/0000:3b:00.0
pci/0000:3b:00.0:
driver bnxt_en
serial_number 00-10-18-FF-FE-AD-05-00
versions:
fixed:
asic.id D802
asic.rev 1
running:
fw 216.1.124.0
fw.psid 0.0.0
fw.app 216.1.122.0
fw.mgmt 864.0.32.0
fw.roce 216.1.15.0
[ This version has incorporated changes suggested by Jakub Kicinski to
use generic devlink version tags. ]
v2: Use fw.psid
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b014232f7f56f6db10b8540b0b97ae8c7eeef28e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 27 04:56:24 2020 -0500
bnxt_en: Rename switch_id to dsn
Instead of switch_id, renaming it to dsn will be more meaningful
so that it can be used to display device serial number in follow up
patch via devlink_info command.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8159cbe3e0b24489f97ca0fb7df7a1710f03a26b
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 27 04:56:23 2020 -0500
bnxt_en: Add support to update progress of flash update
This patch adds status notification to devlink flash update
while flashing is in progress.
$ devlink dev flash pci/0000:05:00.0 file 103.pkg
Preparing to flash
Flashing done
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cda2cab0771183932d6ba73c5ac63bb63decdadf
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 27 04:56:22 2020 -0500
bnxt_en: Move devlink_register before registering netdev
Latest kernels get the phys_port_name via devlink, if
ndo_get_phys_port_name is not defined. To provide the phys_port_name
correctly, register devlink before registering netdev.
Also call devlink_port_type_eth_set() after registering netdev as
devlink port updates the netdev structure and notifies user.
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 002870ebdabb75809d753e3c171c68c4e70a0e91
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 27 04:56:21 2020 -0500
bnxt_en: Register devlink irrespective of firmware spec version
This will allow to register for devlink port and use port features.
Also register params only if firmware spec version is at least 0x10600
which will support reading/setting numbered variables in NVRAM.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d6292ade7f6f109bffe9e1065de37f688fa0107f
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 27 04:56:20 2020 -0500
bnxt_en: Refactor bnxt_dl_register()
Define bnxt_dl_params_register() and bnxt_dl_params_unregister()
functions and move params register/unregister code to these newly
defined functions. This patch is in preparation to register
devlink irrespective of firmware spec. version in the next patch.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5313845f491f22761c675f7009dd77b5ae64172d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 27 04:56:19 2020 -0500
bnxt_en: Disable workaround for lost interrupts on 575XX B0 and newer chips.
The hardware bug has been fixed on B0 and newer chips, so disable the
workaround on these chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 87d67f59d6a33f741b5c6a42fa01b99ea2b14b7d
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Mon Jan 27 04:56:18 2020 -0500
bnxt_en: Periodically check and remove aged-out ntuple filters
Currently the only time we check and remove expired filters is
when we are inserting new filters.
Improving the aRFS expiry handling by adding code to do the above
work periodically.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f47d0e19ae99329177423db80f86a601f8cd8e3e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 27 04:56:17 2020 -0500
bnxt_en: Do not accept fragments for aRFS flow steering.
In bnxt_rx_flow_steer(), if the dissected packet is a fragment, do not
proceed to create the ntuple filter and return error instead. Otherwise
we would create a filter with 0 source and destination ports because
the dissected ports would not be available for fragments.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c66c06c5e28a55920c87b386876461c139aa1878
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 27 04:56:16 2020 -0500
bnxt_en: Support UDP RSS hashing on 575XX chips.
575XX (P5) chips have the same UDP RSS hashing capability as P4 chips,
so we can enable it on P5 chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1d86859fdf31a0d50cc82b5d0d6bfb5fe98f6c00
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 27 04:56:15 2020 -0500
bnxt_en: Remove the setting of dev_port.
The dev_port is meant to distinguish the network ports belonging to
the same PCI function. Our devices only have one network port
associated with each PCI function and so we should not set it for
correctness.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 43a5107dc1acbf88a8a194beb9ff4e8563a2c7a3
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 27 04:56:14 2020 -0500
bnxt_en: Improve bnxt_probe_phy().
If the 2nd parameter fw_dflt is not set, we are calling bnxt_probe_phy()
after the firmware has reset. There is no need to query the current
PHY settings from firmware as these settings may be different from
the ethtool settings that the driver will re-establish later. So
return earlier in bnxt_probe_phy() to save one firmware call.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 83d8f5e92d034a4c4a04d780107e73af31a38504
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jan 27 04:56:13 2020 -0500
bnxt_en: Improve link up detection.
In bnxt_update_phy_setting(), ethtool_get_link_ksettings() and
bnxt_disable_an_for_lpbk(), we inconsistently use netif_carrier_ok()
to determine link. Instead, we should use bp->link_info.link_up
which has the true link state. The netif_carrier state may be off
during self-test and while the device is being reset and may not always
reflect the true link state.
By always using bp->link_info.link_up, the code is now more
consistent and more correct. Some unnecessary link toggles are
now prevented with this patch.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d061b2411d5f3d6272187ab734ce0640827fca13
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jan 17 00:32:47 2020 -0500
bnxt_en: Do not treat DSN (Digital Serial Number) read failure as fatal.
DSN read can fail, for example on a kdump kernel without PCIe extended
config space support. If DSN read fails, don't set the
BNXT_FLAG_DSN_VALID flag and continue loading. Check the flag
to see if the stored DSN is valid before using it. Only VF reps
creation should fail without valid DSN.
Fixes: 03213a996531 ("bnxt: move bp->switch_id initialization to PF probe")
Reported-by: Marc Smith <msmith626@gmail.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6fc7caa84e713f7627e171ab1e7c4b5be0dc9b3d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jan 17 00:32:46 2020 -0500
bnxt_en: Fix ipv6 RFS filter matching logic.
Fix bnxt_fltr_match() to match ipv6 source and destination addresses.
The function currently only checks ipv4 addresses and will not work
corrently on ipv6 filters.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ceb3284c588eee5ea256c70e4d8d7cf399b8134e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jan 17 00:32:45 2020 -0500
bnxt_en: Fix NTUPLE firmware command failures.
The NTUPLE related firmware commands are sent to the wrong firmware
channel, causing all these commands to fail on new firmware that
supports the new firmware channel. Fix it by excluding the 3
NTUPLE firmware commands from the list for the new firmware channel.
Fixes: 760b6d33410c ("bnxt_en: Add support for 2nd firmware message channel.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3071c51783b39d6a676d02a9256c3b3f87804285
Author: Jonathan Lemon <jonathan.lemon@gmail.com>
Date: Thu Jan 9 11:35:42 2020 -0800
bnxt: Detach page from page pool before sending up the stack
When running in XDP mode, pages come from the page pool, and should
be freed back to the same pool or specifically detached. Currently,
when the driver re-initializes, the page pool destruction is delayed
forever since it thinks there are oustanding pages.
Fixes: 322b87ca55f2 ("bnxt_en: add page_pool support")
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 737d7a6c55964955604b9de398dac3791bab5a64
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Thu Jan 2 21:18:11 2020 +0530
bnxt_en: Call recovery done after reset is successfully done
Return EINPROGRESS to devlink health reporter recover as we are not yet
done and call devlink_health_reporter_recovery_done once reset is
successfully completed from workqueue context.
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6adc4601c2a1ac87b4ab8ed0cb55db6efd0264e8
Author: Jonathan Lemon <jonathan.lemon@gmail.com>
Date: Tue Dec 10 08:39:46 2019 -0800
bnxt: apply computed clamp value for coalece parameter
After executing "ethtool -C eth0 rx-usecs-irq 0", the box becomes
unresponsive, likely due to interrupt livelock. It appears that
a minimum clamp value for the irq timer is computed, but is never
applied.
Fix by applying the corrected clamp value.
Fixes: 74706afa712d ("bnxt_en: Update interrupt coalescing logic.")
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit 0290bd291cc0e0488e35e66bf39efcd7d9d9122b
Author: Michael S. Tsirkin <mst@redhat.com>
Date: Tue Dec 10 09:23:51 2019 -0500
netdev: pass the stuck queue to the timeout handler
This allows incrementing the correct timeout statistic without any mess.
Down the road, devices can learn to reset just the specific queue.
The patch was generated with the following script:
use strict;
use warnings;
our $^I = '.bak';
my @work = (
["arch/m68k/emu/nfeth.c", "nfeth_tx_timeout"],
["arch/um/drivers/net_kern.c", "uml_net_tx_timeout"],
["arch/um/drivers/vector_kern.c", "vector_net_tx_timeout"],
["arch/xtensa/platforms/iss/network.c", "iss_net_tx_timeout"],
["drivers/char/pcmcia/synclink_cs.c", "hdlcdev_tx_timeout"],
["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
["drivers/message/fusion/mptlan.c", "mpt_lan_tx_timeout"],
["drivers/misc/sgi-xp/xpnet.c", "xpnet_dev_tx_timeout"],
["drivers/net/appletalk/cops.c", "cops_timeout"],
["drivers/net/arcnet/arcdevice.h", "arcnet_timeout"],
["drivers/net/arcnet/arcnet.c", "arcnet_timeout"],
["drivers/net/arcnet/com20020.c", "arcnet_timeout"],
["drivers/net/ethernet/3com/3c509.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c515.c", "corkscrew_timeout"],
["drivers/net/ethernet/3com/3c574_cs.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c589_cs.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
["drivers/net/ethernet/3com/typhoon.c", "typhoon_tx_timeout"],
["drivers/net/ethernet/8390/8390.h", "ei_tx_timeout"],
["drivers/net/ethernet/8390/8390.h", "eip_tx_timeout"],
["drivers/net/ethernet/8390/8390.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/8390p.c", "eip_tx_timeout"],
["drivers/net/ethernet/8390/ax88796.c", "ax_ei_tx_timeout"],
["drivers/net/ethernet/8390/axnet_cs.c", "axnet_tx_timeout"],
["drivers/net/ethernet/8390/etherh.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/hydra.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/mac8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/mcf8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/lib8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/ne2k-pci.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/pcnet_cs.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/smc-ultra.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/wd.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/zorro8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/adaptec/starfire.c", "tx_timeout"],
["drivers/net/ethernet/agere/et131x.c", "et131x_tx_timeout"],
["drivers/net/ethernet/allwinner/sun4i-emac.c", "emac_timeout"],
["drivers/net/ethernet/alteon/acenic.c", "ace_watchdog"],
["drivers/net/ethernet/amazon/ena/ena_netdev.c", "ena_tx_timeout"],
["drivers/net/ethernet/amd/7990.h", "lance_tx_timeout"],
["drivers/net/ethernet/amd/7990.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/a2065.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/am79c961a.c", "am79c961_timeout"],
["drivers/net/ethernet/amd/amd8111e.c", "amd8111e_tx_timeout"],
["drivers/net/ethernet/amd/ariadne.c", "ariadne_tx_timeout"],
["drivers/net/ethernet/amd/atarilance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/au1000_eth.c", "au1000_tx_timeout"],
["drivers/net/ethernet/amd/declance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/lance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/mvme147.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/ni65.c", "ni65_timeout"],
["drivers/net/ethernet/amd/nmclan_cs.c", "mace_tx_timeout"],
["drivers/net/ethernet/amd/pcnet32.c", "pcnet32_tx_timeout"],
["drivers/net/ethernet/amd/sunlance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/xgbe/xgbe-drv.c", "xgbe_tx_timeout"],
["drivers/net/ethernet/apm/xgene-v2/main.c", "xge_timeout"],
["drivers/net/ethernet/apm/xgene/xgene_enet_main.c", "xgene_enet_timeout"],
["drivers/net/ethernet/apple/macmace.c", "mace_tx_timeout"],
["drivers/net/ethernet/atheros/ag71xx.c", "ag71xx_tx_timeout"],
["drivers/net/ethernet/atheros/alx/main.c", "alx_tx_timeout"],
["drivers/net/ethernet/atheros/atl1c/atl1c_main.c", "atl1c_tx_timeout"],
["drivers/net/ethernet/atheros/atl1e/atl1e_main.c", "atl1e_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl.c", "atlx_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl1.c", "atlx_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl2.c", "atl2_tx_timeout"],
["drivers/net/ethernet/broadcom/b44.c", "b44_tx_timeout"],
["drivers/net/ethernet/broadcom/bcmsysport.c", "bcm_sysport_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2.c", "bnx2_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnxt/bnxt.c", "bnxt_tx_timeout"],
["drivers/net/ethernet/broadcom/genet/bcmgenet.c", "bcmgenet_timeout"],
["drivers/net/ethernet/broadcom/sb1250-mac.c", "sbmac_tx_timeout"],
["drivers/net/ethernet/broadcom/tg3.c", "tg3_tx_timeout"],
["drivers/net/ethernet/calxeda/xgmac.c", "xgmac_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_main.c", "liquidio_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_vf_main.c", "liquidio_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c", "lio_vf_rep_tx_timeout"],
["drivers/net/ethernet/cavium/thunder/nicvf_main.c", "nicvf_tx_timeout"],
["drivers/net/ethernet/cirrus/cs89x0.c", "net_timeout"],
["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
["drivers/net/ethernet/cortina/gemini.c", "gmac_tx_timeout"],
["drivers/net/ethernet/davicom/dm9000.c", "dm9000_timeout"],
["drivers/net/ethernet/dec/tulip/de2104x.c", "de_tx_timeout"],
["drivers/net/ethernet/dec/tulip/tulip_core.c", "tulip_tx_timeout"],
["drivers/net/ethernet/dec/tulip/winbond-840.c", "tx_timeout"],
["drivers/net/ethernet/dlink/dl2k.c", "rio_tx_timeout"],
["drivers/net/ethernet/dlink/sundance.c", "tx_timeout"],
["drivers/net/ethernet/emulex/benet/be_main.c", "be_tx_timeout"],
["drivers/net/ethernet/ethoc.c", "ethoc_tx_timeout"],
["drivers/net/ethernet/faraday/ftgmac100.c", "ftgmac100_tx_timeout"],
["drivers/net/ethernet/fealnx.c", "fealnx_tx_timeout"],
["drivers/net/ethernet/freescale/dpaa/dpaa_eth.c", "dpaa_tx_timeout"],
["drivers/net/ethernet/freescale/fec_main.c", "fec_timeout"],
["drivers/net/ethernet/freescale/fec_mpc52xx.c", "mpc52xx_fec_tx_timeout"],
["drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c", "fs_timeout"],
["drivers/net/ethernet/freescale/gianfar.c", "gfar_timeout"],
["drivers/net/ethernet/freescale/ucc_geth.c", "ucc_geth_timeout"],
["drivers/net/ethernet/fujitsu/fmvj18x_cs.c", "fjn_tx_timeout"],
["drivers/net/ethernet/google/gve/gve_main.c", "gve_tx_timeout"],
["drivers/net/ethernet/hisilicon/hip04_eth.c", "hip04_timeout"],
["drivers/net/ethernet/hisilicon/hix5hd2_gmac.c", "hix5hd2_net_timeout"],
["drivers/net/ethernet/hisilicon/hns/hns_enet.c", "hns_nic_net_timeout"],
["drivers/net/ethernet/hisilicon/hns3/hns3_enet.c", "hns3_nic_net_timeout"],
["drivers/net/ethernet/huawei/hinic/hinic_main.c", "hinic_tx_timeout"],
["drivers/net/ethernet/i825xx/82596.c", "i596_tx_timeout"],
["drivers/net/ethernet/i825xx/ether1.c", "ether1_timeout"],
["drivers/net/ethernet/i825xx/lib82596.c", "i596_tx_timeout"],
["drivers/net/ethernet/i825xx/sun3_82586.c", "sun3_82586_timeout"],
["drivers/net/ethernet/ibm/ehea/ehea_main.c", "ehea_tx_watchdog"],
["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
["drivers/net/ethernet/ibm/ibmvnic.c", "ibmvnic_tx_timeout"],
["drivers/net/ethernet/intel/e100.c", "e100_tx_timeout"],
["drivers/net/ethernet/intel/e1000/e1000_main.c", "e1000_tx_timeout"],
["drivers/net/ethernet/intel/e1000e/netdev.c", "e1000_tx_timeout"],
["drivers/net/ethernet/intel/fm10k/fm10k_netdev.c", "fm10k_tx_timeout"],
["drivers/net/ethernet/intel/i40e/i40e_main.c", "i40e_tx_timeout"],
["drivers/net/ethernet/intel/iavf/iavf_main.c", "iavf_tx_timeout"],
["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
["drivers/net/ethernet/intel/igb/igb_main.c", "igb_tx_timeout"],
["drivers/net/ethernet/intel/igbvf/netdev.c", "igbvf_tx_timeout"],
["drivers/net/ethernet/intel/ixgb/ixgb_main.c", "ixgb_tx_timeout"],
["drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c", "adapter->netdev->netdev_ops->ndo_tx_timeout(adapter->netdev);"],
["drivers/net/ethernet/intel/ixgbe/ixgbe_main.c", "ixgbe_tx_timeout"],
["drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c", "ixgbevf_tx_timeout"],
["drivers/net/ethernet/jme.c", "jme_tx_timeout"],
["drivers/net/ethernet/korina.c", "korina_tx_timeout"],
["drivers/net/ethernet/lantiq_etop.c", "ltq_etop_tx_timeout"],
["drivers/net/ethernet/marvell/mv643xx_eth.c", "mv643xx_eth_tx_timeout"],
["drivers/net/ethernet/marvell/pxa168_eth.c", "pxa168_eth_tx_timeout"],
["drivers/net/ethernet/marvell/skge.c", "skge_tx_timeout"],
["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
["drivers/net/ethernet/mediatek/mtk_eth_soc.c", "mtk_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx5/core/en_main.c", "mlx5e_tx_timeout"],
["drivers/net/ethernet/micrel/ks8842.c", "ks8842_tx_timeout"],
["drivers/net/ethernet/micrel/ksz884x.c", "netdev_tx_timeout"],
["drivers/net/ethernet/microchip/enc28j60.c", "enc28j60_tx_timeout"],
["drivers/net/ethernet/microchip/encx24j600.c", "encx24j600_tx_timeout"],
["drivers/net/ethernet/natsemi/sonic.h", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/sonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/jazzsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/macsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/natsemi.c", "ns_tx_timeout"],
["drivers/net/ethernet/natsemi/ns83820.c", "ns83820_tx_timeout"],
["drivers/net/ethernet/natsemi/xtsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/neterion/s2io.h", "s2io_tx_watchdog"],
["drivers/net/ethernet/neterion/s2io.c", "s2io_tx_watchdog"],
["drivers/net/ethernet/neterion/vxge/vxge-main.c", "vxge_tx_watchdog"],
["drivers/net/ethernet/netronome/nfp/nfp_net_common.c", "nfp_net_tx_timeout"],
["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
["drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c", "pch_gbe_tx_timeout"],
["drivers/net/ethernet/packetengines/hamachi.c", "hamachi_tx_timeout"],
["drivers/net/ethernet/packetengines/yellowfin.c", "yellowfin_tx_timeout"],
["drivers/net/ethernet/pensando/ionic/ionic_lif.c", "ionic_tx_timeout"],
["drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c", "netxen_tx_timeout"],
["drivers/net/ethernet/qlogic/qla3xxx.c", "ql3xxx_tx_timeout"],
["drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c", "qlcnic_tx_timeout"],
["drivers/net/ethernet/qualcomm/emac/emac.c", "emac_tx_timeout"],
["drivers/net/ethernet/qualcomm/qca_spi.c", "qcaspi_netdev_tx_timeout"],
["drivers/net/ethernet/qualcomm/qca_uart.c", "qcauart_netdev_tx_timeout"],
["drivers/net/ethernet/rdc/r6040.c", "r6040_tx_timeout"],
["drivers/net/ethernet/realtek/8139cp.c", "cp_tx_timeout"],
["drivers/net/ethernet/realtek/8139too.c", "rtl8139_tx_timeout"],
["drivers/net/ethernet/realtek/atp.c", "tx_timeout"],
["drivers/net/ethernet/realtek/r8169_main.c", "rtl8169_tx_timeout"],
["drivers/net/ethernet/renesas/ravb_main.c", "ravb_tx_timeout"],
["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
["drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c", "sxgbe_tx_timeout"],
["drivers/net/ethernet/seeq/ether3.c", "ether3_timeout"],
["drivers/net/ethernet/seeq/sgiseeq.c", "timeout"],
["drivers/net/ethernet/sfc/efx.c", "efx_watchdog"],
["drivers/net/ethernet/sfc/falcon/efx.c", "ef4_watchdog"],
["drivers/net/ethernet/sgi/ioc3-eth.c", "ioc3_timeout"],
["drivers/net/ethernet/sgi/meth.c", "meth_tx_timeout"],
["drivers/net/ethernet/silan/sc92031.c", "sc92031_tx_timeout"],
["drivers/net/ethernet/sis/sis190.c", "sis190_tx_timeout"],
["drivers/net/ethernet/sis/sis900.c", "sis900_tx_timeout"],
["drivers/net/ethernet/smsc/epic100.c", "epic_tx_timeout"],
["drivers/net/ethernet/smsc/smc911x.c", "smc911x_timeout"],
["drivers/net/ethernet/smsc/smc9194.c", "smc_timeout"],
["drivers/net/ethernet/smsc/smc91c92_cs.c", "smc_tx_timeout"],
["drivers/net/ethernet/smsc/smc91x.c", "smc_timeout"],
["drivers/net/ethernet/stmicro/stmmac/stmmac_main.c", "stmmac_tx_timeout"],
["drivers/net/ethernet/sun/cassini.c", "cas_tx_timeout"],
["drivers/net/ethernet/sun/ldmvsw.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/niu.c", "niu_tx_timeout"],
["drivers/net/ethernet/sun/sunbmac.c", "bigmac_tx_timeout"],
["drivers/net/ethernet/sun/sungem.c", "gem_tx_timeout"],
["drivers/net/ethernet/sun/sunhme.c", "happy_meal_tx_timeout"],
["drivers/net/ethernet/sun/sunqe.c", "qe_tx_timeout"],
["drivers/net/ethernet/sun/sunvnet.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/sunvnet_common.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/sunvnet_common.h", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/synopsys/dwc-xlgmac-net.c", "xlgmac_tx_timeout"],
["drivers/net/ethernet/ti/cpmac.c", "cpmac_tx_timeout"],
["drivers/net/ethernet/ti/cpsw.c", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/cpsw_priv.c", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/cpsw_priv.h", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/davinci_emac.c", "emac_dev_tx_timeout"],
["drivers/net/ethernet/ti/netcp_core.c", "netcp_ndo_tx_timeout"],
["drivers/net/ethernet/ti/tlan.c", "tlan_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_net.h", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_net.c", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_wireless.c", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/spider_net.c", "spider_net_tx_timeout"],
["drivers/net/ethernet/toshiba/tc35815.c", "tc35815_tx_timeout"],
["drivers/net/ethernet/via/via-rhine.c", "rhine_tx_timeout"],
["drivers/net/ethernet/wiznet/w5100.c", "w5100_tx_timeout"],
["drivers/net/ethernet/wiznet/w5300.c", "w5300_tx_timeout"],
["drivers/net/ethernet/xilinx/xilinx_emaclite.c", "xemaclite_tx_timeout"],
["drivers/net/ethernet/xircom/xirc2ps_cs.c", "xirc_tx_timeout"],
["drivers/net/fjes/fjes_main.c", "fjes_tx_retry"],
["drivers/net/slip/slip.c", "sl_tx_timeout"],
["include/linux/usb/usbnet.h", "usbnet_tx_timeout"],
["drivers/net/usb/aqc111.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/ax88172a.c", "usbnet_tx_timeout"],
["drivers/net/usb/ax88179_178a.c", "usbnet_tx_timeout"],
["drivers/net/usb/catc.c", "catc_tx_timeout"],
["drivers/net/usb/cdc_mbim.c", "usbnet_tx_timeout"],
["drivers/net/usb/cdc_ncm.c", "usbnet_tx_timeout"],
["drivers/net/usb/dm9601.c", "usbnet_tx_timeout"],
["drivers/net/usb/hso.c", "hso_net_tx_timeout"],
["drivers/net/usb/int51x1.c", "usbnet_tx_timeout"],
["drivers/net/usb/ipheth.c", "ipheth_tx_timeout"],
["drivers/net/usb/kaweth.c", "kaweth_tx_timeout"],
["drivers/net/usb/lan78xx.c", "lan78xx_tx_timeout"],
["drivers/net/usb/mcs7830.c", "usbnet_tx_timeout"],
["drivers/net/usb/pegasus.c", "pegasus_tx_timeout"],
["drivers/net/usb/qmi_wwan.c", "usbnet_tx_timeout"],
["drivers/net/usb/r8152.c", "rtl8152_tx_timeout"],
["drivers/net/usb/rndis_host.c", "usbnet_tx_timeout"],
["drivers/net/usb/rtl8150.c", "rtl8150_tx_timeout"],
["drivers/net/usb/sierra_net.c", "usbnet_tx_timeout"],
["drivers/net/usb/smsc75xx.c", "usbnet_tx_timeout"],
["drivers/net/usb/smsc95xx.c", "usbnet_tx_timeout"],
["drivers/net/usb/sr9700.c", "usbnet_tx_timeout"],
["drivers/net/usb/sr9800.c", "usbnet_tx_timeout"],
["drivers/net/usb/usbnet.c", "usbnet_tx_timeout"],
["drivers/net/vmxnet3/vmxnet3_drv.c", "vmxnet3_tx_timeout"],
["drivers/net/wan/cosa.c", "cosa_net_timeout"],
["drivers/net/wan/farsync.c", "fst_tx_timeout"],
["drivers/net/wan/fsl_ucc_hdlc.c", "uhdlc_tx_timeout"],
["drivers/net/wan/lmc/lmc_main.c", "lmc_driver_timeout"],
["drivers/net/wan/x25_asy.c", "x25_asy_timeout"],
["drivers/net/wimax/i2400m/netdev.c", "i2400m_tx_timeout"],
["drivers/net/wireless/intel/ipw2x00/ipw2100.c", "ipw2100_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/main.c", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/orinoco_usb.c", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/orinoco.h", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_dev.c", "islpci_eth_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_eth.c", "islpci_eth_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_eth.h", "islpci_eth_tx_timeout"],
["drivers/net/wireless/marvell/mwifiex/main.c", "mwifiex_tx_timeout"],
["drivers/net/wireless/quantenna/qtnfmac/core.c", "qtnf_netdev_tx_timeout"],
["drivers/net/wireless/quantenna/qtnfmac/core.h", "qtnf_netdev_tx_timeout"],
["drivers/net/wireless/rndis_wlan.c", "usbnet_tx_timeout"],
["drivers/net/wireless/wl3501_cs.c", "wl3501_tx_timeout"],
["drivers/net/wireless/zydas/zd1201.c", "zd1201_tx_timeout"],
["drivers/s390/net/qeth_core.h", "qeth_tx_timeout"],
["drivers/s390/net/qeth_core_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
["drivers/staging/ks7010/ks_wlan_net.c", "ks_wlan_tx_timeout"],
["drivers/staging/qlge/qlge_main.c", "qlge_tx_timeout"],
["drivers/staging/rtl8192e/rtl8192e/rtl_core.c", "_rtl92e_tx_timeout"],
["drivers/staging/rtl8192u/r8192U_core.c", "tx_timeout"],
["drivers/staging/unisys/visornic/visornic_main.c", "visornic_xmit_timeout"],
["drivers/staging/wlan-ng/p80211netdev.c", "p80211knetdev_tx_timeout"],
["drivers/tty/n_gsm.c", "gsm_mux_net_tx_timeout"],
["drivers/tty/synclink.c", "hdlcdev_tx_timeout"],
["drivers/tty/synclink_gt.c", "hdlcdev_tx_timeout"],
["drivers/tty/synclinkmp.c", "hdlcdev_tx_timeout"],
["net/atm/lec.c", "lec_tx_timeout"],
["net/bluetooth/bnep/netdev.c", "bnep_net_timeout"]
);
for my $p (@work) {
my @pair = @$p;
my $file = $pair[0];
my $func = $pair[1];
print STDERR $file , ": ", $func,"\n";
our @ARGV = ($file);
while (<ARGV>) {
if (m/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/) {
print STDERR "found $1+$2 in $file\n";
}
if (s/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/$1, unsigned int txqueue$2/) {
print STDERR "$func found in $file\n";
}
print;
}
}
where the list of files and functions is simply from:
git grep ndo_tx_timeout, with manual addition of headers
in the rare cases where the function is from a header,
then manually changing the few places which actually
call ndo_tx_timeout.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Martin Habets <mhabets@solarflare.com>
changes from v9:
fixup a forward declaration
changes from v9:
more leftovers from v3 change
changes from v8:
fix up a missing direct call to timeout
rebased on net-next
changes from v7:
fixup leftovers from v3 change
changes from v6:
fix typo in rtl driver
changes from v5:
add missing files (allow any net device argument name)
changes from v4:
add a missing driver header
changes from v3:
change queue # to unsigned
Changes from v2:
added headers
Changes from v1:
Fix errors found by kbuild:
generalize the pattern a bit, to pick up
a couple of instances missed by the previous
version.
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7e334fc8003c7a38372cc98e7be6082670a47d29
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Tue Dec 10 02:49:13 2019 -0500
bnxt_en: Add missing devlink health reporters for VFs.
The VF driver also needs to create the health reporters since
VFs are also involved in firmware reset and recovery. Modify
bnxt_dl_register() and bnxt_dl_unregister() so that they can
be called by the VFs to register/unregister devlink. Only the PF
will register the devlink parameters. With devlink registered,
we can now create the health reporters on the VFs.
Fixes: 6763c779c2d8 ("bnxt_en: Add new FW devlink_health_reporter")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 937f188c1f4f89b3fa93ba31fc8587dc1fb14a22
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Tue Dec 10 02:49:12 2019 -0500
bnxt_en: Fix the logic that creates the health reporters.
Fix the logic to properly check the fw capabilities and create the
devlink health reporters only when needed. The current code creates
the reporters unconditionally as long as bp->fw_health is valid, and
that's not correct.
Call bnxt_dl_fw_reporters_create() directly from the init and reset
code path instead of from bnxt_dl_register(). This allows the
reporters to be adjusted when capabilities change. The same
applies to bnxt_dl_fw_reporters_destroy().
Fixes: 6763c779c2d8 ("bnxt_en: Add new FW devlink_health_reporter")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0797c10d2d1fa0d6f14612404781b348fc757c3e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Tue Dec 10 02:49:11 2019 -0500
bnxt_en: Remove unnecessary NULL checks for fw_health
After fixing the allocation of bp->fw_health in the previous patch,
the driver will not go through the fw reset and recovery code paths
if bp->fw_health allocation fails. So we can now remove the
unnecessary NULL checks.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8280b38e01f71e0f89389ccad3fa43b79e57c604
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Tue Dec 10 02:49:10 2019 -0500
bnxt_en: Fix bp->fw_health allocation and free logic.
bp->fw_health needs to be allocated for either the firmware initiated
reset feature or the driver initiated error recovery feature. The
current code is not allocating bp->fw_health for all the necessary cases.
This patch corrects the logic to allocate bp->fw_health correctly when
needed. If allocation fails, we clear the feature flags.
We also add the the missing kfree(bp->fw_health) when the driver is
unloaded. If we get an async reset message from the firmware, we also
need to make sure that we have a valid bp->fw_health before proceeding.
Fixes: 07f83d72d238 ("bnxt_en: Discover firmware error recovery capabilities.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c74751f4c39232c31214ec6a3bc1c7e62f5c728b
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Tue Dec 10 02:49:09 2019 -0500
bnxt_en: Return error if FW returns more data than dump length
If any change happened in the configuration of VF in VM while
collecting live dump, there could be a race and firmware can return
more data than allocated dump length. Fix it by keeping track of
the accumulated core dump length copied so far and abort the copy
with error code if the next chunk of core dump will exceed the
original dump length.
Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 325f85f37e5b35807d86185bdf2c64d2980c44ba
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Dec 10 02:49:08 2019 -0500
bnxt_en: Free context memory in the open path if firmware has been reset.
This will trigger new context memory to be rediscovered and allocated
during the re-probe process after a firmware reset. Without this, the
newly reset firmware does not have valid context memory and the driver
will eventually fail to allocate some resources.
Fixes: ec5d31e3c15d ("bnxt_en: Handle firmware reset status during IF_UP.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0c722ec0a289c7f6b53f89bad1cfb7c4db3f7a62
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Dec 10 02:49:07 2019 -0500
bnxt_en: Fix MSIX request logic for RDMA driver.
The logic needs to check both bp->total_irqs and the reserved IRQs in
hw_resc->resv_irqs if applicable and see if both are enough to cover
the L2 and RDMA requested vectors. The current code is only checking
bp->total_irqs and can fail in some code paths, such as the TX timeout
code path with the RDMA driver requesting vectors after recovery. In
this code path, we have not reserved enough MSIX resources for the
RDMA driver yet.
Fixes: 75720e6323a1 ("bnxt_en: Keep track of reserved IRQs.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d168f328fecc9f401b54db18ff4ddd4bca7b161d
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Nov 23 22:30:50 2019 -0500
bnxt_en: Add support for flashing the device via devlink
Use the same bnxt_flash_package_from_file() function to support
devlink flash operation.
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit c7e457f42c02066e49a6e03028c889aefbb8999b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Nov 23 22:30:49 2019 -0500
bnxt_en: Allow PHY settings on multi-function or NPAR PFs if allowed by FW.
Currently, the driver does not allow PHY settings on a multi-function or
NPAR NIC whose port is shared by more than one function. Newer
firmware now allows PHY settings on some of these NICs. Check for
this new firmware setting and allow the user to set the PHY settings
accordingly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit b1613e78e98d065fd3356d0b93df665b0740f652
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Nov 23 22:30:48 2019 -0500
bnxt_en: Add async. event logic for PHY configuration changes.
If the link settings have been changed by another function sharing the
port, firmware will send us an async. message. In response, we will
call the new bnxt_init_ethtool_link_settings() function to update
the current settings.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit 8119e49b68fa1ec778f9ec8be05b5492046100b2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Nov 23 22:30:47 2019 -0500
bnxt_en: Refactor the initialization of the ethtool link settings.
Refactor this logic in bnxt_probe_phy() into a separate function
bnxt_init_ethtool_link_settings(). It used to be that the settable
link settings will never be changed without going through ethtool.
So we only needed to do this once in bnxt_probe_phy(). Now, another
function sharing the port may change it and we may need to re-initialize
the ethtool settings again in run-time.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit 8a60efd1decbaf9ef71d4296b75ff262e653bd34
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Nov 23 22:30:46 2019 -0500
bnxt_en: Skip disabling autoneg before PHY loopback when appropriate.
New firmware allows PHY loopback to be set without disabling autoneg
first. Check this capability and skip disabling autoneg when
it is supported by firmware. Using this scheme, loopback will
always work even if the PHY only supports autoneg.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit 1acefc9aedb3179fc9add0a21fa62c0aca08efc4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Nov 23 22:30:45 2019 -0500
bnxt_en: Assign more RSS context resources to the VFs.
The driver currently only assignes 1 RSS context to each VF. This works
for the Linux VF driver. But other drivers, such as DPDK, can make use
of additional RSS contexts. Modify the code to divide up and assign
RSS contexts to VFs just like other resources.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit 3be8136ce14ea12c7b40f7ad20a5ff8aec339289
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Nov 23 22:30:44 2019 -0500
bnxt_en: Initialize context memory to the value specified by firmware.
Some chips that need host context memory as a backing store requires
the memory to be initialized to a non-zero value. Query the
value from firmware and initialize the context memory accordingly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit f9b69d7f62796b33657c98e0d3ca3be763f70fa4
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Nov 23 22:30:43 2019 -0500
bnxt_en: Fix suspend/resume path on 57500 chips
Driver calls HWRM_FUNC_RESET firmware call while resuming the device
which clears the context memory backing store. Because of which
allocating firmware resources would eventually fail. Fix it by freeing
all context memory during suspend and reallocate the memory during resume.
Call bnxt_hwrm_queue_qportcfg() in resume path. This firmware call
is needed on the 57500 chips so that firmware will set up the proper
queue mapping in relation to the context memory.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit f92335d830059f3f9db950f0af49405d287924d5
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Nov 23 22:30:42 2019 -0500
bnxt_en: Send FUNC_RESOURCE_QCAPS command in bnxt_resume()
After driver unregister, firmware is erasing the information that
driver supports new resource management. Send FUNC_RESOURCE_QCAPS
command to inform the firmware that driver supports new resource
management while resuming from hibernation. Otherwise, we fallback
to the older resource allocation scheme.
Also, move driver register after sending FUNC_RESOURCE_QCAPS command
to be consistent with the normal initialization sequence.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit 2e882468fce263afef4a77ea4fe40808baaddae7
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Nov 23 22:30:41 2019 -0500
bnxt_en: Combine 2 functions calling the same HWRM_DRV_RGTR fw command.
Everytime driver registers with firmware, driver is required to
register for async event notifications as well. These 2 calls
are done using the same firmware command and can be combined.
We are also missing the 2nd step to register for async events
in the suspend/resume path and this will fix it. Prior to this,
we were getting only default notifications.
ULP can register for additional async events for the RDMA driver,
so we add a parameter to the new function to only do step 2 when
it is called from ULP.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit bdb3860236b3ec8bb0f55ddef6d62666a8b3b23e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Nov 23 22:30:40 2019 -0500
bnxt_en: Do driver unregister cleanup in bnxt_init_one() failure path.
In the bnxt_init_one() failure path, if the driver has already called
firmware to register the driver, it is not undoing the driver
registration. Add this missing step to unregister for correctness,
so that the firmware knows that the driver has unloaded.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit ef02af8c8ece3d6fb01fe267c1c7622399bc34f6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Nov 23 22:30:39 2019 -0500
bnxt_en: Disable/enable Bus master during suspend/resume.
Disable Bus master during suspend to prevent DMAs after the device
goes into D3hot state. The new 57500 devices may continue to DMA
from context memory after the system goes into D3hot state. This
may cause some PCIe errors on some system. Re-enable it during resume.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit fb4cd81e4c03efa54b82e81e2a4afc092c061384
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Nov 23 22:30:38 2019 -0500
bnxt_en: Add chip IDs for 57452 and 57454 chips.
Fix BNXT_CHIP_NUM_5645X() to include 57452 and 56454 chip IDs, so
that these chips will be properly classified as P4 chips to take
advantage of the P4 fixes and features.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit 642aebdee4a1f53b713becb3b7df8896fbaeda33
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Mon Nov 18 03:56:43 2019 -0500
bnxt_en: Abort waiting for firmware response if there is no heartbeat.
This is especially beneficial during the NVRAM related firmware
commands that have longer timeouts. If the BNXT_STATE_FW_FATAL_COND
flag gets set while waiting for firmware response, abort and return
error.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a2b31e27f6269af8bbda4be2199c2af7c4dcb5a3
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Nov 18 03:56:42 2019 -0500
bnxt_en: Add a warning message for driver initiated reset
During loss of heartbeat, log this warning message.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 05069dd4c577f9b143dfd243d55834333c4470c5
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Nov 18 03:56:41 2019 -0500
bnxt_en: Return proper error code for non-existent NVM variable
For NVM params that are not supported in the current NVM
configuration, return the error as -EOPNOTSUPP.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e4e38237d7e39e84d4db4a5cf0aa1ce7fbfaa5d6
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Nov 18 03:56:40 2019 -0500
bnxt_en: Report health status update after reset is done
Report health status update to devlink health reporter, once
reset is completed.
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e633a32935a315b8e1f742622dcb254076a42352
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Nov 18 03:56:39 2019 -0500
bnxt_en: Set MASTER flag during driver registration.
The Linux driver is capable of being the master function to handle
resets, so we set the flag to let firmware know. Some other
drivers, such as DPDK, is not capable and will not set the flag.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0a3f4e4f342c070312d799f7998d2f916c502c6e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Nov 18 03:56:38 2019 -0500
bnxt_en: Extend ETHTOOL_RESET to hot reset driver.
If firmware supports hot reset, extend ETHTOOL_RESET to support
hot reset driver which does not require a driver reload after
ETHTOOL_RESET. The driver will go through the same coordinated
reset sequence as a firmware initiated fatal/non-fatal reset.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5b306bde2b46964d604924ec085d619ffc331e09
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Nov 18 03:56:37 2019 -0500
bnxt_en: Increase firmware response timeout for coredump commands.
Use the larger HWRM_COREDUMP_TIMEOUT value for coredump related
data response from the firmware. These commands take longer than
normal commands.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 19b3751ffa713d04290effb26fe01009010f2206
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Nov 18 03:56:36 2019 -0500
bnxt_en: Improve RX buffer error handling.
When hardware reports RX buffer errors, the latest 57500 chips do not
require reset. The packet is discarded by the hardware and the
ring will continue to operate.
Also, add an rx_buf_errors counter for this type of error. It can help
the user to identify if the aggregation ring is too small.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 41136ab35888c4007c6aad2f86e35afb97003e69
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Nov 18 03:56:35 2019 -0500
bnxt_en: Update firmware interface spec to 1.10.1.12.
The aRFS ring table interface has changed for the 57500 chips. Updating
it accordingly so it will work with the latest production firmware.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 85192dbf4de08795afe2b88e52a36fc6abfc3dba
Author: Andrii Nakryiko <andriin@fb.com>
Date: Sun Nov 17 09:28:03 2019 -0800
bpf: Convert bpf_prog refcnt to atomic64_t
Similarly to bpf_map's refcnt/usercnt, convert bpf_prog's refcnt to atomic64
and remove artificial 32k limit. This allows to make bpf_prog's refcounting
non-failing, simplifying logic of users of bpf_prog_add/bpf_prog_inc.
Validated compilation by running allyesconfig kernel build.
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191117172806.2195367-3-andriin@fb.com
commit 3128aad163d36d99247fc76b4efbbba2d5465cc4
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Wed Nov 13 13:51:19 2019 -0500
bnxt_en: Fix array overrun in bnxt_fill_l2_rewrite_fields().
Fix the array overrun while keeping the eth_addr and eth_addr_mask
pointers as u16 to avoid unaligned u16 access. These were overlooked
when modifying the code to use u16 pointer for proper alignment.
Fixes: 90f906243bf6 ("bnxt_en: Add support for L2 rewrite")
Reported-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6a68749dbd777b832e1d84265bd6d8b39d1843ac
Author: Pavan Chebbi <pavan.chebbi@broadcom.com>
Date: Thu Oct 31 01:07:51 2019 -0400
bnxt_en: Call bnxt_ulp_stop()/bnxt_ulp_start() during suspend/resume.
Inform the RDMA driver to stop/start during suspend/resume. The
RDMA driver needs to stop and start just like error recovery.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f3a6d206c25ad9490f3a3c6d62baba9504227a75
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 31 01:07:50 2019 -0400
bnxt_en: Call bnxt_ulp_stop()/bnxt_ulp_start() during error recovery.
Notify the RDMA driver by calling the bnxt_ulp_stop()/bnxt_ulp_start()
hooks during error recovery. The current ULP IRQ start/stop
sequence in error recovery (which is insufficient) is replaced with the
full reset sequence when we call bnxt_ulp_stop()/bnxt_ulp_start().
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit aa46dffff452f7c6d907c4e6a0062e2c53a87fc0
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 31 01:07:49 2019 -0400
bnxt_en: Improve bnxt_ulp_stop()/bnxt_ulp_start() call sequence.
We call bnxt_ulp_stop() to notify the RDMA driver that some error or
imminent reset is about to happen. After that we always call
some variants of bnxt_close().
In the next patch, we will integrate the recently added error
recovery with the RDMA driver. In response to ulp_stop, the
RDMA driver may free MSIX vectors and that will also trigger
bnxt_close(). To avoid bnxt_close() from being called twice,
we set a new flag after ulp_stop is called. If the RDMA driver
frees MSIX vectors while the new flag is set, we will not call
bnxt_close(), knowing that it will happen in due course.
With this change, we must make sure that the bnxt_close() call
after ulp_stop will reset IRQ. Modify bnxt_reset_task()
accordingly if we call ulp_stop.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 627c89d00fb969f9b3b4f3156716149631d2796c
Author: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Date: Thu Oct 31 01:07:48 2019 -0400
bnxt_en: flow_offload: offload tunnel decap rules via indirect callbacks
The decap (VXLAN tunnel) flow rules are not getting offloaded with
upstream kernel. This is because TC block callback infrastructure has
been updated to use indirect callbacks to get offloaded rules from
other higher level devices (such as tunnels), instead of ndo_setup_tc().
Since the decap rules are applied to the tunnel devices (e.g, vxlan_sys),
the driver should register for indirect TC callback with tunnel devices
to get the rules for offloading. This patch updates the driver to
register and process indirect TC block callbacks from VXLAN tunnels.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9b9eb518e3383d94c8b81ff403d524f2cee5b6b9
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Thu Oct 31 01:07:47 2019 -0400
bnxt_en: Add support for NAT(L3/L4 rewrite)
Provides support for modifying L3/L4 Header parameters to support NAT.
Sets the appropriate fields/bits in cfa_flow_alloc cmd.
Sample cmd for offloading an IPv4 flow with SNAT:
ovs-ofctl add-flow ovsbr0 "ip,nw_src=192.168.201.44 \
actions=mod_nw_src:203.31.220.144,output:p7p1"
Replace 'nw_src' with 'nw_dst' in above cmd for DNAT with IPv4
Sample cmd for offloading an IPv4 flow with SNAPT:
ovs-ofctl add-flow ovsbr0 "ip,nw_src=192.168.201.44 \
actions=mod_nw_src:203.31.220.144, mod_tp_src:6789,output:p7p1"
Similar to DNAT, replace 'tp_src' with 'tp_dst' for offloading flow
with DNAPT
Sample cmd for offloading an IPv6 flow with SNAT:
ovs-ofctl add-flow ovsbr0 "ipv6, ipv6_src=2001:5c0:9168::2/64 \
actions=load:0x1->NXM_NX_IPV6_SRC[0..63], \
load:0x20010db801920000->NXM_NX_IPV6_SRC[64..127],output:p7p1"
Replace 'SRC' with DST' above for IPv6 DNAT
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 08f8280e8788202a67a359952cd436707f8789bd
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Thu Oct 31 01:07:46 2019 -0400
bnxt: Avoid logging an unnecessary message when a flow can't be offloaded
For every single case where bnxt_tc_can_offload() can fail, we are
logging a user friendly descriptive message anyway, but because of the
path it would take in case of failure, another redundant error message
would get logged. Just freeing the node and returning from the point of
failure should suffice.
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 90f906243bf633f07757467506dfab3422b43ca2
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Thu Oct 31 01:07:45 2019 -0400
bnxt_en: Add support for L2 rewrite
This patch adds support for packet edit offload of L2 fields (src mac &
dst mac, also referred as L2 rewrite). Only when the mask is fully exact
match for a field, the command is sent down to the adapter to offload
such a flow. Otherwise, an error is returned.
v2: Fix pointer alignment issue in bnxt_fill_l2_rewrite_fields() [MChan]
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0b0eacf3c83cb292c6eef55c76d5138c9302dc20
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 31 15:38:52 2019 +0530
bnxt_en: Add support to collect crash dump via ethtool
Driver supports 2 types of core dumps.
1. Live dump - Firmware dump when system is up and running.
2. Crash dump - Dump which is collected during firmware crash
that can be retrieved after recovery.
Crash dump is currently supported only on specific 58800 chips
which can be retrieved using OP-TEE API only, as firmware cannot
access this region directly.
User needs to set the dump flag using following command before
initiating the dump collection:
$ ethtool -W|--set-dump eth0 N
Where N is "0" for live dump and "1" for crash dump
Command to collect the dump after setting the flag:
$ ethtool -w eth0 data Filename
v3: Modify set_dump to support even when CONFIG_TEE_BNXT_FW=n.
Also change log message to netdev_info().
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e07ab2021eb6b7123ec66ae1dc019afae566a56c
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 31 15:38:51 2019 +0530
bnxt_en: Add support to invoke OP-TEE API to reset firmware
In error recovery process when firmware indicates that it is
completely down, initiate a firmware reset by calling OP-TEE API.
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit acda6180e86ba9e0026287d65f30d1e2b0c8882a
Author: Saurav Girepunje <saurav.girepunje@gmail.com>
Date: Tue Oct 29 01:46:35 2019 +0530
broadcom: bnxt: Fix use true/false for bool
Use true/false for bool type in bnxt_timer function.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f6824308c4be25ba024ab942a6135aa0356acaea
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 21 01:34:29 2019 -0400
bnxt_en: Avoid disabling pci device in bnxt_remove_one() for already disabled device.
With the recently added error recovery logic, the device may already
be disabled if the firmware recovery is unsuccessful. In
bnxt_remove_one(), check that the device is still enabled first
before calling pci_disable_device().
Fixes: 3bc7d4a352ef ("bnxt_en: Add BNXT_STATE_IN_FW_RESET state.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit f255ed1c4e4c5ed8171b6e81dce1297df1f1b60c
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 21 01:34:28 2019 -0400
bnxt_en: Minor formatting changes in FW devlink_health_reporter
Minor formatting changes to diagnose cb for FW devlink health
reporter.
Suggested-by: Jiri Pirko <jiri@mellanox.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit c6a9e7aa2e8b15402022a15625284069d4fd6df0
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 21 01:34:27 2019 -0400
bnxt_en: Adjust the time to wait before polling firmware readiness.
When firmware indicates that driver needs to invoke firmware reset
which is common for both error recovery and live firmware reset path,
driver needs a different time to wait before polling for firmware
readiness.
Modify the wait time to fw_reset_min_dsecs, which is initialised to
correct timeout for error recovery and firmware reset.
Fixes: 4037eb715680 ("bnxt_en: Add a new BNXT_FW_RESET_STATE_POLL_FW_DOWN state.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit 83a46a82b96c1928ad82958752523fb0c7d9fcce
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Oct 21 01:34:26 2019 -0400
bnxt_en: Fix devlink NVRAM related byte order related issues.
The current code does not do endian swapping between the devlink
parameter and the internal NVRAM representation. Define a union to
represent the little endian NVRAM data and add 2 helper functions to
copy to and from the NVRAM data with the proper byte swapping.
Fixes: 782a624d00fa ("bnxt_en: Add bnxt_en initial port params table and register it")
Cc: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit c329230ce886f449a6e559b636096b75ab00d18a
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Oct 21 01:34:25 2019 -0400
bnxt_en: Fix the size of devlink MSIX parameters.
The current code that rounds up the NVRAM parameter bit size to the next
byte size for the devlink parameter is not always correct. The MSIX
devlink parameters are 4 bytes and we don't get the correct size
using this method.
Fix it by adding a new dl_num_bytes member to the bnxt_dl_nvm_param
structure which statically provides bytesize information according
to the devlink parameter type definition.
Fixes: 782a624d00fa ("bnxt_en: Add bnxt_en initial port params table and register it")
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
commit e7a981050a7fb9a14b652365c00d9c5a025704ce
Author: Jiri Pirko <jiri@mellanox.com>
Date: Thu Oct 10 15:18:49 2019 +0200
devlink: propagate extack down to health reporter ops
During health reporter operations, driver might want to fill-up
the extack message, so propagate extack down to the health reporter ops.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4037eb715680caa3d80075fb54dbc35d79d5f9ff
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Sep 14 00:01:41 2019 -0400
bnxt_en: Add a new BNXT_FW_RESET_STATE_POLL_FW_DOWN state.
This new state is required when firmware indicates that the error
recovery process requires polling for firmware state to be completely
down before initiating reset. For example, firmware may take some
time to collect the crash dump before it is down and ready to be
reset.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 72e0c9f91238f1f5f22954be6aea535d1d5fbf31
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Sep 14 00:01:40 2019 -0400
bnxt_en: Update firmware interface spec. to 1.10.0.100.
Some error recovery updates to the spec., among other minor changes.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 57a8730b1f7a0be7bf8a0a0bb665329074ba764f
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Sep 14 00:01:39 2019 -0400
bnxt_en: Increase timeout for HWRM_DBG_COREDUMP_XX commands
Firmware coredump messages take much longer than standard messages,
so increase the timeout accordingly.
Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 268d0895f1b9690755d91b6ced60c9d8d17a7567
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Sep 14 00:01:38 2019 -0400
bnxt_en: Don't proceed in .ndo_set_rx_mode() when device is not in open state.
Check the BNXT_STATE_OPEN flag instead of netif_running() in
bnxt_set_rx_mode(). If the driver is going through any reset, such
as firmware reset or even TX timeout, it may not be ready to set the RX
mode and may crash. The new rx mode settings will be picked up when
the device is opened again later.
Fixes: 230d1f0de754 ("bnxt_en: Handle firmware reset.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e72cb7d6245380acc11a24b75a865f7104ac8b33
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Aug 30 19:10:38 2019 -0400
bnxt_en: Fix compile error regression with CONFIG_BNXT_SRIOV not set.
Add a new function bnxt_get_registered_vfs() to handle the work
of getting the number of registered VFs under #ifdef CONFIG_BNXT_SRIOV.
The main code will call this function and will always work correctly
whether CONFIG_BNXT_SRIOV is set or not.
Fixes: 230d1f0de754 ("bnxt_en: Handle firmware reset.")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit acfb50e4e773c9a5755a3c265c7c20d37a8642e5
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Aug 29 23:55:05 2019 -0400
bnxt_en: Add FW fatal devlink_health_reporter.
Health show command example and output:
$ devlink health show pci/0000:af:00.0 reporter fw_fatal
pci/0000:af:00.0:
name fw_fatal
state healthy error 1 recover 1 grace_period 0 auto_recover true
Fatal events from firmware or missing periodic heartbeats will
be reported and recovery will be handled.
We also turn on the support flags when we register with the firmware to
enable this health and recovery feature in the firmware.
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d1db9e166bf6a50e1e6713f3fd3b4de6007e3671
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:55:04 2019 -0400
bnxt_en: Add bnxt_fw_exception() to handle fatal firmware errors.
This call will handle fatal firmware errors by forcing a reset on the
firmware. The master function driver will carry out the forced reset.
The sequence will go through the same bnxt_fw_reset_task() workqueue.
This fatal reset differs from the non-fatal reset at the beginning
stages. From the BNXT_FW_RESET_STATE_ENABLE_DEV state onwards where
the firmware is coming out of reset, it is practically identical to the
non-fatal reset.
The next patch will add the periodic heartbeat check and the devlink
reporter to report the fatal event and to initiate the bnxt_fw_exception()
call.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cbb51067a5f5fbae733283b67fc8013881eb4bb1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:55:03 2019 -0400
bnxt_en: Add RESET_FW state logic to bnxt_fw_reset_task().
This state handles driver initiated chip reset during error recovery.
Only the master function will perform this step during error recovery.
The next patch will add code to initiate this reset from the master
function.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b4fff2079d1080af7dcad8ad0e80cc89e1ee000c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:55:02 2019 -0400
bnxt_en: Do not send firmware messages if firmware is in error state.
Add a flag to mark that the firmware has encountered fatal condition.
The driver will not send any more firmware messages and will return
error to the caller. Fix up some clean up functions to continue
and not abort when the firmware message function returns error.
This is preparation work to fully handle firmware error recovery
under fatal conditions.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2cd8696850450b750f278be06ee56eb51d84621c
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Aug 29 23:55:01 2019 -0400
bnxt_en: Retain user settings on a VF after RESET_NOTIFY event.
Retain the VF MAC address, default VLAN, TX rate control, trust settings
of VFs after firmware reset.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 657a33c8a0a2342e91259b28356838dc89216b19
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Aug 29 23:55:00 2019 -0400
bnxt_en: Add devlink health reset reporter.
Add devlink health reporter for the firmware reset event. Once we get
the notification from firmware about the impending reset, the driver
will report this to devlink and the call to bnxt_fw_reset() will be
initiated to complete the reset sequence.
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 230d1f0de754b483ec6eefc1ca5aaeff2b6b9a4c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:59 2019 -0400
bnxt_en: Handle firmware reset.
Add the bnxt_fw_reset() main function to handle firmware reset. This
is triggered by firmware to initiate an orderly reset, for example
when a non-fatal exception condition has been detected. bnxt_fw_reset()
will first wait for all VFs to shutdown and then start the
bnxt_fw_reset_task() work queue to go through the sequence of reset,
re-probe, and re-initialization.
The next patch will add the devlink reporter to start the sequence and
call bnxt_fw_reset().
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2151fe0830fdb951f8ecfcfe67306fdef2366aa0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:58 2019 -0400
bnxt_en: Handle RESET_NOTIFY async event from firmware.
This event from firmware signals a coordinated reset initiated by the
firmware. It may be triggered by some error conditions encountered
in the firmware or other orderly reset conditions.
We store the parameters from this event. Subsequent patches will
add logic to handle reset itself using devlink reporters.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6763c779c2d8b568b2e174f3eeeaf644fa38b34d
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Aug 29 23:54:57 2019 -0400
bnxt_en: Add new FW devlink_health_reporter
Create new FW devlink_health_reporter, to know the current health
status of FW.
Command example and output:
$ devlink health show pci/0000:af:00.0 reporter fw
pci/0000:af:00.0:
name fw
state healthy error 0 recover 0
FW status: Healthy; Reset count: 1
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3bc7d4a352efe5b596883ef16b769055320db1f6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:56 2019 -0400
bnxt_en: Add BNXT_STATE_IN_FW_RESET state.
The new flag will be set in subsequent patches when firmware is
going through reset. If bnxt_close() is called while the new flag
is set, the FW reset sequence will have to be aborted because the
NIC is prematurely closed before FW reset has completed. We also
reject SRIOV configurations while FW reset is in progress.
v2: No longer drop rtnl_lock() in close and wait for FW reset to complete.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7e914027f757b656cd681ba4fe75f3984531ee50
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:55 2019 -0400
bnxt_en: Enable health monitoring.
Handle the async event from the firmware that enables firmware health
monitoring. Store initial health metrics.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9ffbd67734909ca8bb099e62f06387649b43d5a8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:54 2019 -0400
bnxt_en: Pre-map the firmware health monitoring registers.
Pre-map the GRC registers for periodic firmware health monitoring.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 07f83d72d238f5d41b03d6142641129e8a7a0ec4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:53 2019 -0400
bnxt_en: Discover firmware error recovery capabilities.
Call the new firmware API HWRM_ERROR_RECOVERY_QCFG if it is supported
to discover the firmware health and recovery capabilities and settings.
This feature allows the driver to reset the chip if firmware crashes and
becomes unresponsive.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ec5d31e3c15d5233b491400133c67f78a320062c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:52 2019 -0400
bnxt_en: Handle firmware reset status during IF_UP.
During IF_UP, newer firmware has a new status flag that indicates that
firmware has reset. Add new function bnxt_fw_init_one() to re-probe the
firmware and re-setup VF resources on the PF if necessary. If the
re-probe fails, set a flag to prevent bnxt_open() from proceeding again.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 91b9be487001d344a39c453ade6cdbd125e06208
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Aug 29 23:54:51 2019 -0400
bnxt_en: Register buffers for VFs before reserving resources.
When VFs need to be reconfigured dynamically after firmwware reset, the
configuration sequence on the PF needs to be changed to register the VF
buffers first. Otherwise, some VF firmware commands may not succeed as
there may not be PF buffers ready for the re-directed firmware commands.
This sequencing did not matter much before when we only supported
the normal bring-up of VFs.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 702d5011ab5e7b9afe44058d33a89d1501645a10
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:50 2019 -0400
bnxt_en: Refactor bnxt_sriov_enable().
Refactor the hardware/firmware configuration portion in
bnxt_sriov_enable() into a new function bnxt_cfg_hw_sriov(). This
new function can be called after a firmware reset to reconfigure the
VFs previously enabled.
v2: straight refactor of the code. Reordering done in the next patch.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ba642ab773db97c32293547485f562d2dfc06666
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:49 2019 -0400
bnxt_en: Prepare bnxt_init_one() to be called multiple times.
In preparation for the new firmware reset feature, some of the logic
in bnxt_init_one() and related functions will be called again after
firmware has reset. Reset some of the flags and capabilities so that
everything that can change can be re-initialized. Refactor some
functions to probe firmware versions and capabilities. Check some
buffers before allocating as they may have been allocated previously.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5bedb5296e33e889818d77c8ec69040481fab157
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:48 2019 -0400
bnxt_en: Suppress all error messages in hwrm_do_send_msg() in silent mode.
If the silent parameter is set, suppress all messages when there is
no response from firmware. When polling for firmware to come out of
reset, no response may be normal and we want to suppress the error
messages. Also, don't poll for the firmware DMA response if Bus Master
is disabled. This is in preparation for error recovery when firmware
may be in error or reset state or Bus Master is disabled.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a798302d56f56fb7ad6a01f64f495aeafeb6c0f0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:47 2019 -0400
bnxt_en: Simplify error checking in the SR-IOV message forwarding functions.
There are 4 functions handling message forwarding for SR-IOV. They
check for non-zero firmware response code and then return -1. There
is no need to do this anymore. The main messaging function will
now return standard error code. Since we don't need to examine the
response, we can use the hwrm_send_message() variant which will
take the mutex automatically.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d4f1420d365633490aa134abfe408453d1c7c238
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:46 2019 -0400
bnxt_en: Convert error code in firmware message response to standard code.
The main firmware messaging function returns the firmware defined error
code and many callers have to convert to standard error code for proper
propagation to userspace. Convert bnxt_hwrm_do_send_msg() to return
standard error code so we can do away with all the special error code
handling by the many callers.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a935cb7ec449bca1adf806d7fb00f5032b63c6e0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:45 2019 -0400
bnxt_en: Remove the -1 error return code from bnxt_hwrm_do_send_msg().
Replace the non-standard -1 code with -EBUSY when there is no firmware
response after waiting for the maximum timeout.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b3b0ddd07e63d564a3d5500938913805d06a1682
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Aug 29 23:54:44 2019 -0400
bnxt_en: Use a common function to print the same ethtool -f error message.
The same message is printed 3 times in the code, so use a common function
to do that.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fbbdbc6473070dcb3ee1d69cf1c49ff78677d716
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Aug 23 01:51:41 2019 -0400
bnxt_en: Fix allocation of zero statistics block size regression.
Recent commit added logic to determine the appropriate statistics block
size to allocate and the size is stored in bp->hw_ring_stats_size. But
if the firmware spec is older than 1.6.0, it is 0 and not initialized.
This causes the allocation to fail with size 0 and bnxt_open() to
abort. Fix it by always initializing bp->hw_ring_stats_size to the
legacy default size value.
Fixes: 4e7485066373 ("bnxt_en: Allocate the larger per-ring statistics block for 57500 chips.")
Reported-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9bf46566e80fd94845527d01ebd888eb49313551
Author: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Sat Aug 17 17:04:52 2019 -0400
bnxt_en: Fix to include flow direction in L2 key
FW expects the driver to provide unique flow reference handles
for Tx or Rx flows. When a Tx flow and an Rx flow end up sharing
a reference handle, flow offload does not seem to work.
This could happen in the case of 2 flows having their L2 fields
wildcarded but in different direction.
Fix to incorporate the flow direction as part of the L2 key
v2: Move the dir field to the end of the bnxt_tc_l2_key struct to
fix the warning reported by kbuild test robot <lkp@intel.com>.
There is existing code that initializes the structure using
nested initializer and will warn with the new u8 field added to
the beginning. The structure also packs nicer when this new u8 is
added to the end of the structure [MChan].
Fixes: abd43a13525d ("bnxt_en: Support for 64-bit flow handle.")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 685ec6a81bb0d47faf1dba49437d5bdaede2733d
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Sat Aug 17 17:04:51 2019 -0400
bnxt_en: Use correct src_fid to determine direction of the flow
Direction of the flow is determined using src_fid. For an RX flow,
src_fid is PF's fid and for TX flow, src_fid is VF's fid. Direction
of the flow must be specified, when getting statistics for that flow.
Currently, for DECAP flow, direction is determined incorrectly, i.e.,
direction is initialized as TX for DECAP flow, instead of RX. Because
of which, stats are not reported for this DECAP flow, though it is
offloaded and there is traffic for that flow, resulting in flow age out.
This patch fixes the problem by determining the DECAP flow's direction
using correct fid. Set the flow direction in all cases for consistency
even if 64-bit flow handle is not used.
Fixes: abd43a13525d ("bnxt_en: Support for 64-bit flow handle.")
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b703ba751dbb4bcd086509ed4b28102bc1670b35
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Aug 17 17:04:50 2019 -0400
bnxt_en: Suppress HWRM errors for HWRM_NVM_GET_VARIABLE command
For newly added NVM parameters, older firmware may not have the support.
Suppress the error message to avoid the unncessary error message which is
triggered when devlink calls the driver during initialization.
Fixes: 782a624d00fa ("bnxt_en: Add bnxt_en initial params table and register it.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dd2ebf3404c7c295014bc025dea23960960ceb1a
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Aug 17 17:04:49 2019 -0400
bnxt_en: Fix handling FRAG_ERR when NVM_INSTALL_UPDATE cmd fails
If FW returns FRAG_ERR in response error code, driver is resending the
command only when HWRM command returns success. Fix the code to resend
NVM_INSTALL_UPDATE command with DEFRAG install flags, if FW returns
FRAG_ERR in its response error code.
Fixes: cb4d1d626145 ("bnxt_en: Retry failed NVM_INSTALL_UPDATE with defragmentation flag enabled.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e8f267b063208372f7a329c6d5288d58944d873c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Aug 17 17:04:48 2019 -0400
bnxt_en: Improve RX doorbell sequence.
When both RX buffers and RX aggregation buffers have to be
replenished at the end of NAPI, post the RX aggregation buffers first
before RX buffers. Otherwise, we may run into a situation where
there are only RX buffers without RX aggregation buffers for a split
second. This will cause the hardware to abort the RX packet and
report buffer errors, which will cause unnecessary cleanup by the
driver.
Ringing the Aggregation ring doorbell first before the RX ring doorbell
will prevent some of these buffer errors. Use the same sequence during
ring initialization as well.
Fixes: 697197e5a173 ("bnxt_en: Re-structure doorbells.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a46ecb116fb7f722fa8cb2da01959c36e4e10c41
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Aug 17 17:04:47 2019 -0400
bnxt_en: Fix VNIC clearing logic for 57500 chips.
During device shutdown, the VNIC clearing sequence needs to be modified
to free the VNIC first before freeing the RSS contexts. The current
code is doing the reverse and we can get mis-directed RX completions
to CP ring ID 0 when the RSS contexts are freed and zeroed. The clearing
of RSS contexts is not required with the new sequence.
Refactor the VNIC clearing logic into a new function bnxt_clear_vnic()
and do the chip specific VNIC clearing sequence.
Fixes: 7b3af4f75b81 ("bnxt_en: Add RSS support for 57500 chips.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3a131e85043cf538d5e70c0f23f9d69a4dd642b9
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Sat Aug 10 12:17:20 2019 +0200
bnxt: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the
return value. The function can work or not, but the code logic should
never do something different based on this.
This cleans up a lot of unneeded code and logic around the debugfs
files, making all of this much simpler and easier to understand.
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b54c9d5bd6e38edac9ce3a3f95f14a1292b5268d
Author: Jonathan Lemon <jonathan.lemon@gmail.com>
Date: Tue Jul 30 07:40:33 2019 -0700
net: Use skb_frag_off accessors
Use accessor functions for skb fragment's page_offset instead
of direct references, in preparation for bvec conversion.
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 49c98421e6ab33665e8ee7901218a712f5b0db2e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:33 2019 -0400
bnxt_en: Add PCI IDs for 57500 series NPAR devices.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1dc88b97a020148c0eea6c595d511a19c2fab347
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:32 2019 -0400
bnxt_en: Support all variants of the 5750X chip family.
Define the 57508, 57504, and 57502 chip IDs that are all part of the
BNXT_CHIP_P5 family of chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7c3809181468a219aa2abd25910bd3b02b89b0de
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:31 2019 -0400
bnxt_en: Refactor bnxt_init_one() and turn on TPA support on 57500 chips.
With the new TPA feature in the 57500 chips, we need to discover the
feature first before setting up the netdev features. Refactor the
the firmware probe and init logic more cleanly into 2 functions and
and make these calls before setting up the netdev features.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 78e7b86605b460e8b40622d16d840f9276d58627
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:30 2019 -0400
bnxt_en: Support TPA counters on 57500 chips.
Support the new expanded TPA v2 counters on 57500 B0 chips for
ethtool -S.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4e7485066373f3e9a87fa063b65d0838990753e5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:29 2019 -0400
bnxt_en: Allocate the larger per-ring statistics block for 57500 chips.
The new TPA implemantation has additional TPA counters that extend the
per-ring statistics block. Allocate the proper size accordingly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ee79566e65945dcf557bcfb9335e46fac67fb002
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:28 2019 -0400
bnxt_en: Refactor ethtool ring statistics logic.
The current code assumes that the per ring statistics counters are
fixed. In newer chips that support a newer version of TPA, the
TPA counters are also changed. Refactor the code by defining these
counter names in arrays so that it is easy to add a new array for
a new set of counters supported by the newer chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 67912c366d4bb0a9d108459e7c845cc7ba83f76f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:27 2019 -0400
bnxt_en: Add hardware GRO setup function for 57500 chips.
Add a more optimized hardware GRO function to setup the SKB on 57500
chips. Some workaround code is no longer needed on 57500 chips and
the pseudo checksum is also calculated in hardware, so no need to
do the software pseudo checksum in the driver.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ec4d8e7cf024e42def027531676918048e5c7982
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:26 2019 -0400
bnxt_en: Add TPA ID mapping logic for 57500 chips.
The new TPA feature on 57500 supports a larger number of concurrent TPAs
(up to 1024) divided among the functions. We need to add some logic to
map the hardware TPA ID to a software index that keeps track of each TPA
in progress. A 1:1 direct mapping without translation would be too
wasteful as we would have to allocate 1024 TPA structures for each RX
ring on each PCI function.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bfcd8d791ec18496772d117774398e336917f56e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:25 2019 -0400
bnxt_en: Add fast path logic for TPA on 57500 chips.
With all the previous refactoring, the TPA fast path can now be
modified slightly to support TPA on the new chips. The main
difference is that the agg completions are retrieved differently using
the bnxt_get_tpa_agg_p5() function on the new chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f45b7b78c619cd73c7ca25b68c6ba9653b8e4a0a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:24 2019 -0400
bnxt_en: Set TPA GRO mode flags on 57500 chips properly.
On 57500 chips, hardware GRO mode cannot be determined from the TPA
end, so we need to check bp->flags to determine if we are in hardware
GRO mode or not. Modify bnxt_set_features so that the TPA flags
in bp->flags don't change until the device is closed. This will ensure
that the fast path can safely rely on bp->flags to determine the
TPA mode.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bee5a188b71657092dc9eb1a529b4e502fe51444
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:23 2019 -0400
bnxt_en: Refactor tunneled hardware GRO logic.
The 2 GRO functions to set up the hardware GRO SKB fields for 2
different hardware chips have practically identical logic for
tunneled packets. Refactor the logic into a separate bnxt_gro_tunnel()
function that can be used by both functions.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8fe88ce7ab3181a11989eb7a8bb00c42a2b7b3b0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:22 2019 -0400
bnxt_en: Handle standalone RX_AGG completions.
On the new 57500 chips, these new RX_AGG completions are not coalesced
at the TPA_END completion. Handle these by storing them in the
array in the bnxt_tpa_info struct, as they are seen when processing
the CMPL ring.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 79632e9ba38671215fb193346ef6fb8db582744d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:21 2019 -0400
bnxt_en: Expand bnxt_tpa_info struct to support 57500 chips.
Add an aggregation array to bnxt_tpa_info struct to keep track of the
aggregation completions. The aggregation completions are not
completed at the TPA_END completion on 57500 chips so we need to
keep track of them. The array is only allocated on the new chips
when required. An agg_count field is also added to keep track of the
number of these completions.
The maximum concurrent TPA is now discovered from firmware instead of
the hardcoded 64. Add a new bp->max_tpa to keep track of maximum
configured TPA.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4a228a3a5e58e5c05c6ffb5b430e5cb936865a8b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:20 2019 -0400
bnxt_en: Refactor TPA logic.
Refactor the TPA logic slightly, so that the code can be more easily
extended to support TPA on the new 57500 chips. In particular, the
logic to get the next aggregation completion is refactored into a
new function bnxt_get_agg() so that this operation is made more
generalized. This operation will be different on the new chip in TPA
mode. The logic to recycle the aggregation buffers has a new start
index parameter added for the same purpose.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 218a8a71d91ab9e52205f4098cf1fe121c98850e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:19 2019 -0400
bnxt_en: Add TPA structure definitions for BCM57500 chips.
The new chips have a slightly modified TPA interface for LRO/GRO_HW.
Modify the TPA structures so that the same structures can also be
used on the new chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2792b5b95ed5f38279da08f467a490687332324d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 29 06:10:18 2019 -0400
bnxt_en: Update firmware interface spec. to 1.10.0.89.
Among the changes are new CoS discard counters and new ctx_hw_stats_ext
struct for the latest 5750X B0 chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f06d0ca45827a5790d7508de4759aed976933d4d
Author: Yamin Friedman <yaminf@mellanox.com>
Date: Tue Jul 23 10:22:47 2019 +0300
linux/dim: Fix overflow in dim calculation
While using net_dim, a dim_sample was used without ever initializing the
comps value. Added use of DIV_ROUND_DOWN_ULL() to prevent potential
overflow, it should not be a problem to save the final result in an int
because after the division by epms the value should not be larger than a
few thousand.
[ 1040.127124] UBSAN: Undefined behaviour in lib/dim/dim.c:78:23
[ 1040.130118] signed integer overflow:
[ 1040.131643] 134718714 * 100 cannot be represented in type 'int'
Fixes: 398c2b05bbee ("linux/dim: Add completions count to dim_sample")
Signed-off-by: Yamin Friedman <yaminf@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f521eaa9d2ef6d85bc6c318148f019e9f40fc344
Author: Chuhong Yuan <hslester96@gmail.com>
Date: Tue Jul 23 21:19:29 2019 +0800
net: broadcom: Use dev_get_drvdata
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d7840976e3915669382c62ddd1700960f348328e
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
Date: Mon Jul 22 20:08:25 2019 -0700
net: Use skb accessors in network drivers
In preparation for unifying the skb_frag and bio_vec, use the fine
accessors which already exist and use skb_frag_t instead of
struct skb_frag_struct.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9b3d15e6b05e0b916be5fbd915f90300a403098b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jul 17 03:07:23 2019 -0400
bnxt_en: Fix VNIC accounting when enabling aRFS on 57500 chips.
Unlike legacy chips, 57500 chips don't need additional VNIC resources
for aRFS/ntuple. Fix the code accordingly so that we don't reserve
and allocate additional VNICs on 57500 chips. Without this patch,
the driver is failing to initialize when it tries to allocate extra
VNICs.
Fixes: ac33906c67e2 ("bnxt_en: Add support for aRFS on 57500 chips.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f9e30088d20016a224d8110d45356da253eaa26a
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue Jul 9 22:55:49 2019 +0200
net: flow_offload: rename tc_cls_flower_offload to flow_cls_offload
And any other existing fields in this structure that refer to tc.
Specifically:
* tc_cls_flower_offload_flow_rule() to flow_cls_offload_flow_rule().
* TC_CLSFLOWER_* to FLOW_CLS_*.
* tc_cls_common_offload to tc_cls_common_offload.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 955bcb6ea0df0d9ace89ac475405f1295ced5962
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue Jul 9 22:55:46 2019 +0200
drivers: net: use flow block API
This patch updates flow_block_cb_setup_simple() to use the flow block API.
Several drivers are also adjusted to use it.
This patch introduces the per-driver list of flow blocks to account for
blocks that are already in use.
Remove tc_block_offload alias.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4e95bc268b915c3a19ec8b9110f61e4ea41a1ed0
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue Jul 9 22:55:39 2019 +0200
net: flow_offload: add flow_block_cb_setup_simple()
Most drivers do the same thing to set up the flow block callbacks, this
patch adds a helper function to do this.
This preparation patch reduces the number of changes to adapt the
existing drivers to use the flow block callback API.
This new helper function takes a flow block list per-driver, which is
set to NULL until this driver list is used.
This patch also introduces the flow_block_command and
flow_block_binder_type enumerations, which are renamed to use
FLOW_BLOCK_* in follow up patches.
There are three definitions (aliases) in order to reduce the number of
updates in this patch, which go away once drivers are fully adapted to
use this flow block API.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 12479f627f7c2017e6fcd50b56c2537592674c50
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jul 9 03:50:07 2019 -0400
bnxt_en: Add page_pool_destroy() during RX ring cleanup.
Add page_pool_destroy() in bnxt_free_rx_rings() during normal RX ring
cleanup, as Ilias has informed us that the following commit has been
merged:
1da4bbeffe41 ("net: core: page_pool: add user refcnt and reintroduce page_pool_destroy")
The special error handling code to call page_pool_free() can now be
removed. bnxt_free_rx_rings() will always be called during normal
shutdown or any error paths.
Fixes: 322b87ca55f2 ("bnxt_en: add page_pool support")
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 322b87ca55f2f3936ec9f9de438ef9b2115b5c9b
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Mon Jul 8 17:53:04 2019 -0400
bnxt_en: add page_pool support
This removes contention over page allocation for XDP_REDIRECT actions by
adding page_pool support per queue for the driver. The performance for
XDP_REDIRECT actions scales linearly with the number of cores performing
redirect actions when using the page pools instead of the standard page
allocator.
v2: Fix up the error path from XDP registration, noted by Ilias Apalodimas.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f18c2b77b2e4eec2313d519ba125bd6a069513cf
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Mon Jul 8 17:53:03 2019 -0400
bnxt_en: optimized XDP_REDIRECT support
This adds basic support for XDP_REDIRECT in the bnxt_en driver. Next
patch adds the more optimized page pool support.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c1ba92a86db24dc9ca2648473d4820979a0d8a4c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 8 17:53:02 2019 -0400
bnxt_en: Refactor __bnxt_xmit_xdp().
__bnxt_xmit_xdp() is used by XDP_TX and ethtool loopback packet transmit.
Refactor it so that it can be re-used by the XDP_REDIRECT logic.
Restructure the TX interrupt handler logic to cleanly separate XDP_TX
logic in preparation for XDP_REDIRECT.
Acked-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 52c0609258658ff35b85c654c568a50abd602ac6
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Mon Jul 8 17:53:01 2019 -0400
bnxt_en: rename some xdp functions
Renaming bnxt_xmit_xdp to __bnxt_xmit_xdp to get ready for XDP_REDIRECT
support and reduce confusion/namespace collision.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4ca5fa39e1aea2f85eb9c4257075c4077c6531da
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Jun 29 11:16:48 2019 -0400
bnxt_en: Suppress error messages when querying DSCP DCB capabilities.
Some firmware versions do not support this so use the silent variant
to send the message to firmware to suppress the harmless error. This
error message is unnecessarily alarming the user.
Fixes: afdc8a84844a ("bnxt_en: Add DCBNL DSCP application protocol support.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1dbc59fa4bbaa108b641cd65a54f662b75e4ed36
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Jun 29 11:16:47 2019 -0400
bnxt_en: Cap the returned MSIX vectors to the RDMA driver.
In an earlier commit to improve NQ reservations on 57500 chips, we
set the resv_irqs on the 57500 VFs to the fixed value assigned by
the PF regardless of how many are actually used. The current
code assumes that resv_irqs minus the ones used by the network driver
must be the ones for the RDMA driver. This is no longer true and
we may return more MSIX vectors than requested, causing inconsistency.
Fix it by capping the value.
Fixes: 01989c6b69d9 ("bnxt_en: Improve NQ reservations.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d77b1ad8e87dc5a6cd0d9158b097a4817946ca3b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Jun 29 11:16:46 2019 -0400
bnxt_en: Fix statistics context reservation logic for RDMA driver.
The current logic assumes that the RDMA driver uses one statistics
context adjacent to the ones used by the network driver. This
assumption is not true and the statistics context used by the
RDMA driver is tied to its MSIX base vector. This wrong assumption
can cause RDMA driver failure after changing ethtool rings on the
network side. Fix the statistics reservation logic accordingly.
Fixes: 780baad44f0f ("bnxt_en: Reserve 1 stat_ctx for RDMA driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d27e2ca1166aefd54d9c48fb6647dee8115a5dfc
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Jun 29 11:16:45 2019 -0400
bnxt_en: Fix ethtool selftest crash under error conditions.
After ethtool loopback packet tests, we re-open the nic for the next
IRQ test. If the open fails, we must not proceed with the IRQ test
or we will crash with NULL pointer dereference. Fix it by checking
the bnxt_open_nic() return code before proceeding.
Reported-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Fixes: 67fea463fd87 ("bnxt_en: Add interrupt test to ethtool -t selftest.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c20dc142dd7b2884b8570eeab323bcd4a84294fa
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Jun 29 11:16:44 2019 -0400
bnxt_en: Disable bus master during PCI shutdown and driver unload.
Some chips with older firmware can continue to perform DMA read from
context memory even after the memory has been freed. In the PCI shutdown
method, we need to call pci_disable_device() to shutdown DMA to prevent
this DMA before we put the device into D3hot. DMA memory request in
D3hot state will generate PCI fatal error. Similarly, in the driver
remove method, the context memory should only be freed after DMA has
been shutdown for correctness.
Fixes: 98f04cf0f1fc ("bnxt_en: Check context memory requirements from firmware.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4f75da3666c0c572967729a2401ac650be5581b6
Author: Tal Gilboa <talgi@mellanox.com>
Date: Thu Jan 10 17:33:17 2019 +0200
linux/dim: Move implementation to .c files
Moved all logic from dim.h and net_dim.h to dim.c and net_dim.c.
This is both more structurally appealing and would allow to only
expose externally used functions.
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
commit 8960b38932bee8db0bc9c4d8c135f21df6cdd297
Author: Tal Gilboa <talgi@mellanox.com>
Date: Thu Jan 31 16:44:48 2019 +0200
linux/dim: Rename externally used net_dim members
Removed 'net' prefix from functions and structs used by external drivers.
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
commit e5b6ab02d7aa4118c9a36491633812dcc442acbe
Author: Tal Gilboa <talgi@mellanox.com>
Date: Mon Jan 14 15:32:49 2019 +0200
linux/dim: Rename net_dim_sample() to net_dim_update_sample()
In order to avoid confusion between the function and the similarly
named struct.
In preparation for removing the 'net' prefix from dim members.
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
commit c002bd529d719858d4cc233431c88c9efa844053
Author: Tal Gilboa <talgi@mellanox.com>
Date: Mon Nov 5 12:07:52 2018 +0200
linux/dim: Rename externally exposed macros
Renamed macros in use by external drivers.
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
commit 2e9217d1e8b72dde2c7e3e2338cc1830f68cb58d
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Wed May 22 19:12:57 2019 -0400
bnxt_en: Device serial number is supported only for PFs.
Don't read DSN on VFs that do not have the PCI capability.
Fixes: 03213a996531 ("bnxt: move bp->switch_id initialization to PF probe")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d629522e1d66561f38e5c8d4f52bb6d254ec0707
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed May 22 19:12:56 2019 -0400
bnxt_en: Reduce memory usage when running in kdump kernel.
Skip RDMA context memory allocations, reduce to 1 ring, and disable
TPA when running in the kdump kernel. Without this patch, the driver
fails to initialize with memory allocation errors when running in a
typical kdump kernel.
Fixes: cf6daed098d1 ("bnxt_en: Increase context memory allocations on 57500 chips for RDMA.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1b3f0b75c39f534278a895c117282014e9d0ae1f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed May 22 19:12:55 2019 -0400
bnxt_en: Fix possible BUG() condition when calling pci_disable_msix().
When making configuration changes, the driver calls bnxt_close_nic()
and then bnxt_open_nic() for the changes to take effect. A parameter
irq_re_init is passed to the call sequence to indicate if IRQ
should be re-initialized. This irq_re_init parameter needs to
be included in the bnxt_reserve_rings() call. bnxt_reserve_rings()
can only call pci_disable_msix() if the irq_re_init parameter is
true, otherwise it may hit BUG() because some IRQs may not have been
freed yet.
Fixes: 41e8d7983752 ("bnxt_en: Modify the ring reservation functions for 57500 series chips.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 296d5b54163964b7ae536b8b57dfbd21d4e868e1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed May 22 19:12:54 2019 -0400
bnxt_en: Fix aggregation buffer leak under OOM condition.
For every RX packet, the driver replenishes all buffers used for that
packet and puts them back into the RX ring and RX aggregation ring.
In one code path where the RX packet has one RX buffer and one or more
aggregation buffers, we missed recycling the aggregation buffer(s) if
we are unable to allocate a new SKB buffer. This leads to the
aggregation ring slowly running out of buffers over time. Fix it
by properly recycling the aggregation buffers.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reported-by: Rakesh Hemnani <rhemnani@fb.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 51fec80d3a669cdc3950973cb2a9045adeb0e7f0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 5 07:17:08 2019 -0400
bnxt_en: Add device IDs 0x1806 and 0x1752 for 57500 devices.
0x1806 and 0x1752 are VF variant and PF variant of the 57500 chip
family.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ac33906c67e22edeabe3f0150ffeb367462e754f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 5 07:17:07 2019 -0400
bnxt_en: Add support for aRFS on 57500 chips.
Set RSS ring table index of the RFS destination ring for the NTUPLE
filters on 57500 chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e969ae5bbfcf48e3ff2d159870453121d5a8441d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 5 07:17:06 2019 -0400
bnxt_en: Query firmware capability to support aRFS on 57500 chips.
Query support for the aRFS ring table index in the firmware.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 01989c6b69d91a0df0af8d5c6b5f33d82a239ae0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 5 07:17:05 2019 -0400
bnxt_en: Improve NQ reservations.
bnxt_need_reserve_rings() determines if any resources have changed and
requires new reservation with firmware. The NQ checking is currently
just an approximation. Improve the NQ checking logic to make it
accurate. NQ reservation is only needed on 57500 PFs. This fix will
eliminate unnecessary reservations and will reduce NQ reservations
when some NQs have been released on 57500 PFs.
Fixes: c0b8cda05e1d ("bnxt_en: Fix NQ/CP rings accounting on the new 57500 chips.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 53579e37d13a7a87430e2ec0171e091ebf2e63a1
Author: Devesh Sharma <devesh.sharma@broadcom.com>
Date: Sun May 5 07:17:04 2019 -0400
bnxt_en: Separate RDMA MR/AH context allocation.
In newer firmware, the context memory for MR (Memory Region)
and AH (Address Handle) to support RDMA are specified separately.
Modify driver to specify and allocate the 2 context memory types
separately when supported by the firmware.
Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2730214ddb889c54d5f6a734e2fe584c295cbd9b
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun May 5 07:17:03 2019 -0400
bnxt_en: read the clause type from the PHY ID
Currently driver hard code Clause 45 based on speed supported by the
PHY. Instead read the clause type from the PHY ID provided as input
to the mdio ioctl.
Fixes: 0ca12be99667 ("bnxt_en: Add support for mdio read/write to external PHY")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 691aa62045c2b23152ce3b64feb601502aab97c5
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun May 5 07:17:02 2019 -0400
bnxt_en: Read package version from firmware.
HWRM_VER_GET firmware command returns package name that is running
actively on the adapter. Use this version instead of parsing from
the package log in NVRAM.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6154532fe8fe4e5ec5ffb1a71f587015973f8753
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun May 5 07:17:01 2019 -0400
bnxt_en: Check new firmware capability to display extended stats.
Newer firmware now advertises the capability for extended stats
support. Check the new capability in addition to the existing
version check.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 55e4398d4ee578094fb38f25af175629a24675d5
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun May 5 07:17:00 2019 -0400
bnxt_en: Add support for PCIe statistics
Gather periodic PCIe statistics for ethtool -S.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a220eabc8887e3c02d308a9960e92a70cbd00b52
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun May 5 07:16:59 2019 -0400
bnxt_en: Refactor bnxt_alloc_stats().
Reverse the condition of the large "if" block and return early. This
will simplify the follow up patch to add PCIe statistics.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4a50ddc2d2ea81d3fcbfbe05657d73ac9a9655fd
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 5 07:16:58 2019 -0400
bnxt_en: Update firmware interface to 1.10.0.69.
PTP API updates for 57500 chips, new RX port stats counters and other
miscellaneous updates.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0b397b17a4120cb80f7bf89eb30587b3dd9b0d1d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 25 22:31:55 2019 -0400
bnxt_en: Fix uninitialized variable usage in bnxt_rx_pkt().
In bnxt_rx_pkt(), if the driver encounters BD errors, it will recycle
the buffers and jump to the end where the uninitailized variable "len"
is referenced. Fix it by adding a new jump label that will skip
the length update. This is the most correct fix since the length
may not be valid when we get this type of error.
Fixes: 6a8788f25625 ("bnxt_en: add support for software dynamic interrupt moderation")
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3f93cd3f098e284c851acb89265ebe35b994a5c8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 25 22:31:54 2019 -0400
bnxt_en: Fix statistics context reservation logic.
In an earlier commit that fixes the number of stats contexts to
reserve for the RDMA driver, we added a function parameter to pass in
the number of stats contexts to all the relevant functions. The passed
in parameter should have been used to set the enables field of the
firmware message.
Fixes: 780baad44f0f ("bnxt_en: Reserve 1 stat_ctx for RDMA driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ad361adf0d08f1135f3845c6b3a36be7cc0bfda5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 25 22:31:53 2019 -0400
bnxt_en: Pass correct extended TX port statistics size to firmware.
If driver determines that extended TX port statistics are not supported
or allocation of the data structure fails, make sure to pass 0 TX stats
size to firmware to disable it. The firmware returned TX stats size should
also be set to 0 for consistency. This will prevent
bnxt_get_ethtool_stats() from accessing the NULL TX stats pointer in
case there is mismatch between firmware and driver.
Fixes: 36e53349b60b ("bnxt_en: Add additional extended port statistics.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1f83391bd6fc48f92f627b0ec0bce686d100c6a5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 25 22:31:52 2019 -0400
bnxt_en: Fix possible crash in bnxt_hwrm_ring_free() under error conditions.
If we encounter errors during open and proceed to clean up,
bnxt_hwrm_ring_free() may crash if the rings we try to free have never
been allocated. bnxt_cp_ring_for_rx() or bnxt_cp_ring_for_tx()
may reference pointers that have not been allocated.
Fix it by checking for valid fw_ring_id first before calling
bnxt_cp_ring_for_rx() or bnxt_cp_ring_for_tx().
Fixes: 2c61d2117ecb ("bnxt_en: Add helper functions to get firmware CP ring ID.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f9099d611449836a51a65f40ea7dc9cb5f2f665e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Apr 25 22:31:51 2019 -0400
bnxt_en: Free short FW command HWRM memory in error path in bnxt_init_one()
In the bnxt_init_one() error path, short FW command request memory
is not freed. This patch fixes it.
Fixes: e605db801bde ("bnxt_en: Support for Short Firmware Message")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b4e30e8e7ea1d1e35ffd64ca46f7d9a7f227b4bf
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 25 22:31:50 2019 -0400
bnxt_en: Improve multicast address setup logic.
The driver builds a list of multicast addresses and sends it to the
firmware when the driver's ndo_set_rx_mode() is called. In rare
cases, the firmware can fail this call if internal resources to
add multicast addresses are exhausted. In that case, we should
try the call again by setting the ALL_MCAST flag which is more
guaranteed to succeed.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c43f1255b866b423d2381f77eaa2cbc64a9c49aa
Author: Stanislav Fomichev <sdf@google.com>
Date: Mon Apr 22 08:55:48 2019 -0700
net: pass net_device argument to the eth_get_headlen
Update all users of eth_get_headlen to pass network device, fetch
network namespace from it and pass it down to the flow dissector.
This commit is a noop until administrator inserts BPF flow dissector
program.
Cc: Maxim Krasnyansky <maxk@qti.qualcomm.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Cc: Yisen Zhuang <yisen.zhuang@huawei.com>
Cc: Salil Mehta <salil.mehta@huawei.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
commit 8e44e96c6c8e8fb80b84a2ca11798a8554f710f2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 8 17:39:55 2019 -0400
bnxt_en: Reset device on RX buffer errors.
If the RX completion indicates RX buffers errors, the RX ring will be
disabled by firmware and no packets will be received on that ring from
that point on. Recover by resetting the device.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a1b0e4e684e9c300b9e759b46cb7a0147e61ddff
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 8 17:39:54 2019 -0400
bnxt_en: Improve RX consumer index validity check.
There is logic to check that the RX/TPA consumer index is the expected
index to work around a hardware problem. However, the potentially bad
consumer index is first used to index into an array to reference an entry.
This can potentially crash if the bad consumer index is beyond legal
range. Improve the logic to use the consumer index for dereferencing
after the validity check and log an error message.
Fixes: fa7e28127a5a ("bnxt_en: Add workaround to detect bad opaque in rx completion (part 2)")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fb24ea52f78e0d595852e09e3a55697c8f442189
Author: Will Deacon <will.deacon@arm.com>
Date: Fri Feb 22 17:14:59 2019 +0000
drivers: Remove explicit invocations of mmiowb()
mmiowb() is now implied by spin_unlock() on architectures that require
it, so there is no reason to call it from driver code. This patch was
generated using coccinelle:
@mmiowb@
@@
- mmiowb();
and invoked as:
$ for d in drivers include/linux/qed sound; do \
spatch --include-headers --sp-file mmiowb.cocci --dir $d --in-place; done
NOTE: mmiowb() has only ever guaranteed ordering in conjunction with
spin_unlock(). However, pairing each mmiowb() removal in this patch with
the corresponding call to spin_unlock() is not at all trivial, so there
is a small chance that this change may regress any drivers incorrectly
relying on mmiowb() to order MMIO writes between CPUs using lock-free
synchronisation. If you've ended up bisecting to this commit, you can
reintroduce the mmiowb() calls using wmb() instead, which should restore
the old behaviour on all architectures other than some esoteric ia64
systems.
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
commit 56d9f4e8f70e6f47ad4da7640753cf95ae51a356
Author: Jiri Pirko <jiri@mellanox.com>
Date: Wed Apr 3 14:24:22 2019 +0200
bnxt: remove ndo_get_port_parent_id implementation for physical ports
Remove implementation of get_port_parent_id ndo and rely on core calling
into devlink for the information directly.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6605a226781eb1224c2dcf974a39eea11862b864
Author: Jiri Pirko <jiri@mellanox.com>
Date: Wed Apr 3 14:24:21 2019 +0200
bnxt: pass switch ID through devlink_port_attrs_set()
Pass the switch ID down the to devlink through devlink_port_attrs_set()
so it can be used by devlink_compat_switch_id_get().
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 03213a996531e507e03c085d411a313e34357498
Author: Jiri Pirko <jiri@mellanox.com>
Date: Wed Apr 3 14:24:20 2019 +0200
bnxt: move bp->switch_id initialization to PF probe
Currently the switch_id is being only initialized when switching eswitch
mode from "legacy" to "switchdev". However, nothing prevents the id to
be initialized from the very beginning. Physical ports can show it even
in "legacy" mode.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bec5267cded268acdf679b651778c300d204e9f2
Author: Jiri Pirko <jiri@mellanox.com>
Date: Wed Apr 3 14:24:16 2019 +0200
net: devlink: extend port attrs for switch ID
Extend devlink_port_attrs_set() to pass switch ID for ports which are
part of switch and store it in port attrs. For other ports, this is
NULL.
Note that this allows the driver to group devlink ports into one or more
switches according to the actual topology.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6b16f9ee89b8d5709f24bc3ac89ae8b5452c0d7c
Author: Florian Westphal <fw@strlen.de>
Date: Mon Apr 1 16:42:14 2019 +0200
net: move skb->xmit_more hint to softnet data
There are two reasons for this.
First, the xmit_more flag conceptually doesn't fit into the skb, as
xmit_more is not a property related to the skb.
Its only a hint to the driver that the stack is about to transmit another
packet immediately.
Second, it was only done this way to not have to pass another argument
to ndo_start_xmit().
We can place xmit_more in the softnet data, next to the device recursion.
The recursion counter is already written to on each transmit. The "more"
indicator is placed right next to it.
Drivers can use the netdev_xmit_more() helper instead of skb->xmit_more
to check the "more packets coming" hint.
skb->xmit_more is retained (but always 0) to not cause build breakage.
This change takes care of the simple s/skb->xmit_more/netdev_xmit_more()/
conversions. Remaining drivers are converted in the next patches.
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ab178b058c4354ea16a0b0be28914874f7e2972d
Author: Jiri Pirko <jiri@mellanox.com>
Date: Thu Mar 28 13:56:42 2019 +0100
bnxt: remove ndo_get_phys_port_name implementation
Rely on the previously introduced fallback and let the core
call devlink in order to get the physical port name.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c9c49a65e53ee5115bb33e3531be66ad261ab675
Author: Jiri Pirko <jiri@mellanox.com>
Date: Thu Mar 28 13:56:41 2019 +0100
bnxt: implement ndo_get_devlink_port
In order for devlink compat functions to work, implement
ndo_get_devlink_port. Legacy slaves does not have devlink port instances
created for themselves.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a0e18132ec51301414a5c92e6c258c2e62fdf08f
Author: Jiri Pirko <jiri@mellanox.com>
Date: Sun Mar 24 11:14:27 2019 +0100
bnxt: set devlink port attrs properly
Set the attrs properly so delink has enough info to generate physical
port names.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 477edb7806b652043750aa33c584b9838a7c2123
Author: Jiri Pirko <jiri@mellanox.com>
Date: Sun Mar 24 11:14:25 2019 +0100
bnxt: add missing net/devlink.h include
devlink functions are in use, so include the related header file.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2b3c6885386020b1b9d92d45e8349637e27d1f66
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Feb 27 03:58:53 2019 -0500
bnxt_en: Drop oversize TX packets to prevent errors.
There have been reports of oversize UDP packets being sent to the
driver to be transmitted, causing error conditions. The issue is
likely caused by the dst of the SKB switching between 'lo' with
64K MTU and the hardware device with a smaller MTU. Patches are
being proposed by Mahesh Bandewar <maheshb@google.com> to fix the
issue.
In the meantime, add a quick length check in the driver to prevent
the error. The driver uses the TX packet size as index to look up an
array to setup the TX BD. The array is large enough to support all MTU
sizes supported by the driver. The oversize TX packet causes the
driver to index beyond the array and put garbage values into the
TX BD. Add a simple check to prevent this.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0000b81a063b5f3ab82fa18041c28327ce72c312
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Feb 20 19:07:32 2019 -0500
bnxt_en: Wait longer for the firmware message response to complete.
The code waits up to 20 usec for the firmware response to complete
once we've seen the valid response header in the buffer. It turns
out that in some scenarios, this wait time is not long enough.
Extend it to 150 usec and use usleep_range() instead of udelay().
Fixes: 9751e8e71487 ("bnxt_en: reduce timeout on initial HWRM calls")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 67681d02aaa1db9044a16df4ca9c77cde1221a3e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Feb 20 19:07:31 2019 -0500
bnxt_en: Fix typo in firmware message timeout logic.
The logic that polls for the firmware message response uses a shorter
sleep interval for the first few passes. But there was a typo so it
was using the wrong counter (larger counter) for these short sleep
passes. The result is a slightly shorter timeout period for these
firmware messages than intended. Fix it by using the proper counter.
Fixes: 9751e8e71487 ("bnxt_en: reduce timeout on initial HWRM calls")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b2d69122fd627aa3c6c39c99b2b8706703a92634
Author: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Date: Tue Feb 19 05:31:16 2019 -0500
bnxt_en: Return relevant error code when offload fails
The driver returns -ENOSPC when tc_can_offload() check fails. Since that
routine checks for flow parameters that are not supported by the driver,
we should return the more appropriate -EOPNOTSUPP.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0ca12be99667265ef8100860601d510e78f22cea
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Tue Feb 19 05:31:15 2019 -0500
bnxt_en: Add support for mdio read/write to external PHY
Add support for SIOCGMIIREG and SIOCSMIIREG ioctls to
mdio read/write to external PHY.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2a516444434ffa4419e67c5289d5f53272cb9674
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Feb 19 05:31:14 2019 -0500
bnxt_en: Propagate trusted VF attribute to firmware.
Newer firmware understands the concept of a trusted VF, so propagate the
trusted VF attribute set by the PF admin. to the firmware. Also, check
the firmware trusted setting when considering the VF MAC address change
and reporting the trusted setting to the user.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c6cc32a2133cb1eb5aa28ced1852aab2aeaf357a
Author: Erik Burrows <erik.burrows@broadcom.com>
Date: Tue Feb 19 05:31:13 2019 -0500
bnxt_en: Add support for BCM957504
Add support for BCM957504 with device ID 1751
Signed-off-by: Erik Burrows <erik.burrows@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3293ec232123e9a648ec5b02225cd32091ae243f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Feb 19 05:31:12 2019 -0500
bnxt_en: Update firmware interface spec. to 1.10.0.47.
Firmware error recover is the major change in this spec.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit da203dfa89ce83c55b6623f73560ef7ec742aca4
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Feb 11 14:46:17 2019 +0530
Revert "devlink: Add a generic wake_on_lan port parameter"
This reverts commit b639583f9e36d044ac1b13090ae812266992cbac.
As per discussion with Jakub Kicinski and Michal Kubecek,
this will be better addressed by soon-too-come ethtool netlink
API with additional indication that given configuration request
is supposed to be persisted.
Also, remove the parameter support from bnxt_en driver.
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Michal Kubecek <mkubecek@suse.cz>
Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7c62cfb8c5744b377e9f33806e0db87a00dc6884
Author: Jiri Pirko <jiri@mellanox.com>
Date: Thu Feb 7 11:22:45 2019 +0000
devlink: publish params only after driver init is done
Currently, user can do dump or get of param values right after the
devlink params are registered. However the driver may not be initialized
which is an issue. The same problem happens during notification
upon param registration. Allow driver to publish devlink params
whenever it is ready to handle get() ops. Note that this cannot
be resolved by init reordering, as the "driverinit" params have
to be available before the driver is initialized (it needs the param
values there).
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ecb53febfcad565366762b7413b03452874643db
Author: Devesh Sharma <devesh.sharma@broadcom.com>
Date: Thu Feb 7 01:31:28 2019 -0500
RDMA/bnxt_en: Enable RDMA driver support for 57500 chip
Re-enabling RDMA driver support on 57500 chips. Removing the forced error
code for 57500 chip.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
commit 52d5254a2d045bba2a744042319c64e1fe41b5c8
Author: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed Feb 6 09:45:36 2019 -0800
bnxt: Implement ndo_get_port_parent_id()
BNXT only supports SWITCHDEV_ATTR_ID_PORT_PARENT_ID, which makes it a
great candidate to be converted to use the ndo_get_port_parent_id() NDO
instead of implementing switchdev_port_attr_get(). The conversion is
straight forward here since the PF and VF code use the same getter.
Since bnxt makes uses of switchdev_port_same_parent_id() convert it to
use netdev_port_same_parent_id().
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 738678817573ce45698e1bb13222f2e53622c555
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Sat Feb 2 12:50:48 2019 +0100
drivers: net: use flow action infrastructure
This patch updates drivers to use the new flow action infrastructure.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3b1903ef97c080a80ead3a6a2305f55108e08269
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Sat Feb 2 12:50:47 2019 +0100
flow_offload: add statistics retrieval infrastructure and use it
This patch provides the flow_stats structure that acts as container for
tc_cls_flower_offload, then we can use to restore the statistics on the
existing TC actions. Hence, tcf_exts_stats_update() is not used from
drivers anymore.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8f2566225ae2d62d532bb1810ed74fa4bbc5bbdb
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Sat Feb 2 12:50:43 2019 +0100
flow_offload: add flow_rule and flow_match structures and use them
This patch wraps the dissector key and mask - that flower uses to
represent the matching side - around the flow_match structure.
To avoid a follow up patch that would edit the same LoCs in the drivers,
this patch also wraps this new flow match structure around the flow rule
object. This new structure will also contain the flow actions in follow
up patches.
This introduces two new interfaces:
bool flow_rule_match_key(rule, dissector_id)
that returns true if a given matching key is set on, and:
flow_rule_match_XYZ(rule, &match);
To fetch the matching side XYZ into the match container structure, to
retrieve the key and the mask with one single call.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5e66e35aab335b83d9ffb220d8a3a13986a7a60e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Jan 31 14:31:48 2019 -0500
bnxt_en: Disable interrupts when allocating CP rings or NQs.
When calling firmware to allocate a CP ring or NQ, an interrupt associated
with that ring may be generated immediately before the doorbell is even
setup after the firmware call returns. When servicing the interrupt, the
driver may crash when trying to access the doorbell.
Fix it by disabling interrupt on that vector until the doorbell is
set up.
Fixes: 697197e5a173 ("bnxt_en: Re-structure doorbells.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 782a624d00fa22e7499f5abc29747501ec671313
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jan 28 18:00:27 2019 +0530
bnxt_en: Add bnxt_en initial port params table and register it
Register devlink_port with devlink and create initial port params
table for bnxt_en. The table consists of a generic parameter:
wake_on_lan: Enables Wake on Lan for this port when magic packet
is received with this port's MAC address using ACPI pattern.
If enabled, the controller asserts a wake pin upon reception of
WoL packet. ACPI (Advanced Configuration and Power Interface) is
an industry specification for the efficient handling of power
consumption in desktop and mobile computers.
v2->v3:
- Modify bnxt_dl_wol_validate(), to throw error message when user gives
value other than DEVLINK_PARAM_WAKE_MAGIC ot to disable WOL.
- Use netdev_err() instead of netdev_warn(), when devlink_port_register()
and devlink_port_params_register() returns error. Also, don't log rc
in this message.
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6ef982dec7eda9affa81a2bb84f75441deb56d06
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Jan 12 00:13:05 2019 -0500
bnxt_en: Fix context memory allocation.
When allocating memory pages for context memory, if the last page table
should be fully populated, the current code will set nr_pages to 0 when
calling bnxt_alloc_ctx_mem_blk(). This will cause the last page table
to be completely blank and causing some RDMA failures.
Fix it by setting the last page table's nr_pages to the remainder only
if it is non-zero.
Fixes: 08fe9d181606 ("bnxt_en: Add Level 2 context memory paging support.")
Reported-by: Eric Davis <eric.davis@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0b815023a1d479aa8f8851ee880d5388e53b7ae5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Jan 12 00:13:04 2019 -0500
bnxt_en: Fix ring checking logic on 57500 chips.
In bnxt_hwrm_check_pf_rings(), add the proper flag to test the NQ
resources. Without the proper flag, the firmware will change
the NQ resource allocation and remap the IRQ, causing missing
IRQs. This issue shows up when adding MQPRIO TX queues, for example.
Fixes: 36d65be9a880 ("bnxt_en: Disable MSIX before re-reserving NQs/CMPL rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit abd43a13525db70926999ebe3e272c38119fdfbe
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Thu Dec 20 03:38:52 2018 -0500
bnxt_en: Support for 64-bit flow handle.
Older firmware only supports 16-bit flow handle, because of which the
number of flows that can be offloaded cant scale beyond a point.
Newer firmware supports 64-bit flow handle enabling the host to scale
upto millions of flows. With the new 64-bit flow handle support, driver
has to query flow stats in a different way compared to the older approach.
This patch adds support for 64-bit flow handle and new way to query
flow stats.
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cf6daed098d14760d6605268d28bfdf7b3bfa375
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 20 03:38:51 2018 -0500
bnxt_en: Increase context memory allocations on 57500 chips for RDMA.
If RDMA is supported on the 57500 chip, increase context memory
allocations for the resources used by RDMA.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 08fe9d1816067170e167867d06009fb0f41cb411
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 20 03:38:50 2018 -0500
bnxt_en: Add Level 2 context memory paging support.
Add the new functions bnxt_alloc_ctx_pg_tbls()/bnxt_free_ctx_pg_tbls()
to allocate and free pages for context memory. The new functions
will handle the different levels of paging support and allocate/free
the pages accordingly using the existing functions.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4f49b2b8d4167b712ce876bff08bd9606a44f7a6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 20 03:38:49 2018 -0500
bnxt_en: Enhance bnxt_alloc_ring()/bnxt_free_ring().
To support level 2 context page memory structures, enhance the
bnxt_ring_mem_info structure with a "depth" field to specify the page
level and add a flag to specify using full pages for L1 and L2 page
tables. This is needed to support RDMA functionality on 57500 chips
since RDMA requires more context memory.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 760b6d33410cda351f236058585471cb0f417978
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Thu Dec 20 03:38:48 2018 -0500
bnxt_en: Add support for 2nd firmware message channel.
Earlier, some of the firmware commands (ex: CFA_FLOW_*) which are processed
by KONG processor were sent to the CHIMP processor from the host. This
approach was taken as there was no direct message channel to KONG.
CHIMP in turn used to send them to KONG. Newer firmware supports a new
message channel which the host can send messages directly to the KONG
processor.
This patch adds support for required changes needed in the driver
to support direct KONG message channel. This speeds up flow related
messages sent to the firmware for CLS_FLOWER offload.
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5c209fc82159f2f71e2772f28cd1d447b821e98d
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Thu Dec 20 03:38:47 2018 -0500
bnxt_en: Introduce bnxt_get_hwrm_resp_addr & bnxt_get_hwrm_seq_id routines.
These routines will be enhanced in the subsequent patch to
return the 2nd firmware comm. channel's hwrm response address &
sequence id respectively.
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 89455017fb8dd5dff0d088ecb82bccf9f9b715cd
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Thu Dec 20 03:38:46 2018 -0500
bnxt_en: Avoid arithmetic on void * pointer.
Typecast hwrm_cmd_resp_addr to (u8 *) from (void *) before doing
arithmetic.
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2e9ee3987719148308ff1794aa91f8314f839ccd
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Thu Dec 20 03:38:45 2018 -0500
bnxt_en: Use macros for firmware message doorbell offsets.
In preparation for adding a 2nd communication channel to firmware.
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fc718bb2d1efa4348995b4811c243ec59f913a59
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Thu Dec 20 03:38:44 2018 -0500
bnxt_en: Set hwrm_intr_seq_id value to its inverted value.
Set hwrm_intr_seq_id value to its inverted value instead of
HWRM_SEQ_INVALID, when an hwrm completion of type
CMPL_BASE_TYPE_HWRM_DONE is received. This will enable us to use
the complete 16-bit sequence ID space.
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3322479e6d17ea17b75848fd7c7702ccf82c9c35
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 20 03:38:43 2018 -0500
bnxt_en: Update firmware interface spec. to 1.10.0.33.
The major changes are in the flow offload firmware APIs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 84404d5fd5858588bbf694b0300dbc6310d02737
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 19 13:46:50 2018 -0500
bnxt_en: Fix ethtool self-test loopback.
The current code has 2 problems. It assumes that the RX ring for
the loopback packet is combined with the TX ring. This is not
true if the ethtool channels are set to non-combined mode. The
second problem is that it won't work on 57500 chips without
adjusting the logic to get the proper completion ring (cpr) pointer.
Fix both issues by locating the proper cpr pointer through the RX
ring.
Fixes: e44758b78ae8 ("bnxt_en: Use bnxt_cp_ring_info struct pointer as parameter for RX path.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 56d374624778652d2a999e18c87a25338b127b41
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Dec 16 18:46:31 2018 -0500
bnxt_en: query force speeds before disabling autoneg mode.
With autoneg enabled, PHY loopback test fails. To disable autoneg,
driver needs to send a valid forced speed to FW. FW is not sending
async event for invalid speeds. To fix this, query forced speeds
and send the correct speed when disabling autoneg mode.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fd3ab1c70e0b953f4f772142051d215bffada718
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 16 18:46:30 2018 -0500
bnxt_en: Do not free port statistics buffer when device is down.
Port statistics which include RDMA counters are useful even when the
netdevice is down. Do not free the port statistics DMA buffers
when the netdevice is down. This is keep the snapshot of the port
statistics and counters will just continue counting when the
netdevice goes back up.
Split the bnxt_free_stats() function into 2 functions. The port
statistics buffers will only be freed when the netdevice is
removed.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b8875ca356f1c0b17ec68be6666269373a62288e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 16 18:46:29 2018 -0500
bnxt_en: Save ring statistics before reset.
With the current driver, the statistics reported by .ndo_get_stats64()
are reset when the device goes down. Store a snapshot of the
rtnl_link_stats64 before shutdown. This snapshot is added to the
current counters in .ndo_get_stats64() so that the counters will not
get reset when the device is down.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7c675421afef18253a86ffc383f57bc15ef32ea8
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Dec 16 18:46:28 2018 -0500
bnxt_en: Return linux standard errors in bnxt_ethtool.c
Currently firmware specific errors are returned directly in flash_device
and reset ethtool hooks. Modify it to return linux standard errors
to userspace when flashing operations fail.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 24654f095ed68eafcdfdbfccbe6324ad1475c1bb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 16 18:46:27 2018 -0500
bnxt_en: Don't set ETS on unused TCs.
Currently, the code allows ETS bandwidth weight 0 to be set on unused TCs.
We should not set any DCB parameters on unused TCs at all.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e37fed790335631c57477e7bee952a039ccb7a50
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 16 18:46:26 2018 -0500
bnxt_en: Add ethtool -S priority counters.
Display the CoS counters as additional priority counters by looking up
the priority to CoS queue mapping. If the TX extended port statistics
block size returned by firmware is big enough to cover the CoS counters,
then we will display the new priority counters. We call firmware to get
the up-to-date pri2cos mapping to convert the CoS counters to
priority counters.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b16b68918674af5e7beccb567fe7ebd8b44744b8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 16 18:46:25 2018 -0500
bnxt_en: Add SR-IOV support for 57500 chips.
There are some minor differences when assigning VF resources on the
new chips. The MSIX (NQ) resource has to be assigned and ring group
is not needed on the new chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 36d65be9a88052cdfc8524eb591baf0e6c878408
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 16 18:46:24 2018 -0500
bnxt_en: Disable MSIX before re-reserving NQs/CMPL rings.
When bringing up a device, the code checks to see if the number of
MSIX has changed. pci_disable_msix() should be called first before
changing the number of reserved NQs/CMPL rings. This ensures that
the MSIX vectors associated with the NQs/CMPL rings are still
properly mapped when pci_disable_msix() masks the vectors.
This patch will prevent errors when RDMA support is added for the new
57500 chips. When the RDMA driver shuts down, the number of NQs is
decreased and we must use the new sequence to prevent MSIX errors.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 780baad44f0f1e87df5508d1ad5a87d359fb96d1
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Dec 16 18:46:23 2018 -0500
bnxt_en: Reserve 1 stat_ctx for RDMA driver.
bnxt_en requires same number of stat_ctxs as CP rings but RDMA
requires only 1 stat_ctx. Also add a new parameter resv_stat_ctxs
to better keep track of stat_ctxs reserved including resources used
by RDMA. Add a stat_ctxs parameter to all the relevant resource
reservation functions so we can reserve the correct number of
stat_ctxs.
Prior to this patch, we were not reserving the extra stat_ctx for
RDMA and RDMA would not work on the new 57500 chips.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f4e896142de8304b433fd94f7eed55750c34defd
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Dec 16 18:46:22 2018 -0500
bnxt_en: Do not modify max_stat_ctxs after RDMA driver requests/frees stat_ctxs
Calling bnxt_set_max_func_stat_ctxs() to modify max stat_ctxs requested
or freed by the RDMA driver is wrong. After introducing reservation of
resources recently, the driver has to keep track of all stat_ctxs
including the ones used by the RDMA driver. This will provide a better
foundation for accurate accounting of the stat_ctxs.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c027c6b4e91f21dfa4feab91e2155c8403f49f5c
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Dec 16 18:46:21 2018 -0500
bnxt_en: get rid of num_stat_ctxs variable
For bnxt_en driver, stat_ctxs created will always be same as
cp_nr_rings. Remove extra variable that duplicates the value.
Also introduce bnxt_get_avail_stat_ctxs_for_en() helper to get
available stat_ctxs and bnxt_get_ulp_stat_ctxs() helper to return
number of stat_ctxs used by RDMA.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e916b0815a11c6cbc82f2d8510982ea022628880
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 16 18:46:20 2018 -0500
bnxt_en: Add bnxt_get_avail_cp_rings_for_en() helper function.
The available CP rings are calculated differently on the new 57500
chips, so add this helper to do this calculation correctly. The
VFs will be assigned these available CP rings.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f7588cd89331211e2c4f0fdb94bb0ed4f92847be
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 16 18:46:19 2018 -0500
bnxt_en: Store the maximum NQs available on the PF.
The PF has a pool of NQs and MSIX vectors assigned to it based on
NVRAM configurations. The number of usable MSIX vectors on the PF
is the minimum of the NQs and MSIX vectors. Any excess NQs without
associated MSIX may be used for the VFs, so we need to store this
max_nqs value. max_nqs minus the NQs used by the PF will be the
available NQs for the VFs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2fd527b72bb6f95dfe8a1902e998cb76390c431e
Author: Petr Machata <petrm@mellanox.com>
Date: Wed Dec 12 17:02:48 2018 +0000
net: ndo_bridge_setlink: Add extack
Drivers may not be able to implement a VLAN addition or reconfiguration.
In those cases it's desirable to explain to the user that it was
rejected (and why).
To that end, add extack argument to ndo_bridge_setlink. Adapt all users
to that change.
Following patches will use the new argument in the bridge driver.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 351cbde969230a072cabca9969c68ab04e58e6b3
Author: Jonathan Toppins <jtoppins@redhat.com>
Date: Wed Dec 12 11:58:51 2018 -0500
bnxt: remove printing of hwrm message
bnxt_en 0000:19:00.0 (unregistered net_device) (uninitialized): hwrm
req_type 0x190 seq id 0x6 error 0xffff
The message above is commonly seen when a newer driver is used on
hardware with older firmware. The issue is this message means nothing to
anyone except Broadcom. Remove the message to not confuse users as this
message is really not very informative.
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e30fbc33190b8ba1d6e8ff4864627f7414b5ca99
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 9 07:01:02 2018 -0500
bnxt_en: Fix _bnxt_get_max_rings() for 57500 chips.
The CP rings are accounted differently on the new 57500 chips. There
must be enough CP rings for the sum of RX and TX rings on the new
chips. The current logic may be over-estimating the RX and TX rings.
The output parameter max_cp should be the maximum NQs capped by
MSIX vectors available for networking in the context of 57500 chips.
The existing code which uses CMPL rings capped by the MSIX vectors
works most of the time but is not always correct.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c0b8cda05e1d8151f57a79e525c2c7d51cec2f4e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 9 07:01:01 2018 -0500
bnxt_en: Fix NQ/CP rings accounting on the new 57500 chips.
The new 57500 chips have introduced the NQ structure in addition to
the existing CP rings in all chips. We need to introduce a new
bnxt_nq_rings_in_use(). On legacy chips, the 2 functions are the
same and one will just call the other. On the new chips, they
refer to the 2 separate ring structures. The new function is now
called to determine the resource (NQ or CP rings) associated with
MSIX that are in use.
On 57500 chips, the RDMA driver does not use the CP rings so
we don't need to do the subtraction adjustment.
Fixes: 41e8d7983752 ("bnxt_en: Modify the ring reservation functions for 57500 series chips.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 75720e6323a1d195ae3ebf1a7b5e17c2e687f552
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 9 07:01:00 2018 -0500
bnxt_en: Keep track of reserved IRQs.
The new 57500 chips use 1 NQ per MSIX vector, whereas legacy chips use
1 CP ring per MSIX vector. To better unify this, add a resv_irqs
field to struct bnxt_hw_resc. On legacy chips, we initialize resv_irqs
with resv_cp_rings. On new chips, we initialize it with the allocated
MSIX resources.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 804fba4e9f508c8004a4bfbdf3f300ca237c56df
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Dec 9 07:00:59 2018 -0500
bnxt_en: Fix CNP CoS queue regression.
Recent changes to support the 57500 devices have created this
regression. The bnxt_hwrm_queue_qportcfg() call was moved to be
called earlier before the RDMA support was determined, causing
the CoS queues configuration to be set before knowing whether RDMA
was supported or not. Fix it by moving it to the right place right
after RDMA support is determined.
Fixes: 98f04cf0f1fc ("bnxt_en: Check context memory requirements from firmware.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8dc5ae2d48976764cf3498e97963fa06befefb0e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Nov 15 03:25:42 2018 -0500
bnxt_en: Fix filling time in bnxt_fill_coredump_record()
Fix the year and month offset while storing it in
bnxt_fill_coredump_record().
Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 83eb5c5cff32681f3769f502cb5589c7d7509bfe
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Nov 15 03:25:41 2018 -0500
bnxt_en: Add software "missed_irqs" counter.
To keep track of the number of times the workaround code for 57500 A0
has been triggered. This is a per NQ counter.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ffd77621700ec3adcf859681e24910c38e0931f5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Nov 15 03:25:40 2018 -0500
bnxt_en: Workaround occasional TX timeout on 57500 A0.
Hardware can sometimes not generate NQ MSIX with a single pending
CP ring entry. This seems to always happen at the last entry of
the CP ring before it wraps. Add logic to check all the CP rings for
pending entries without the CP ring consumer index advancing. Calling
HWRM_DBG_RING_INFO_GET to read the context of the CP ring will flush
out the NQ entry and MSIX.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d19819297d9284bd990e22116b8b43d0abcbf488
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Nov 15 03:25:38 2018 -0500
bnxt_en: Fix rx_l4_csum_errors counter on 57500 devices.
The software counter structure is defined in both the CP ring's structure
and the NQ ring's structure on the new devices. The legacy code adds the
counter to the CP ring's structure and the counter won't get displayed
since the ethtool code is looking at the NQ ring's structure.
Since all other counters are contained in the NQ ring's structure, it
makes more sense to count rx_l4_csum_errors in the NQ.
Fixes: 50e3ab7836b5 ("bnxt_en: Allocate completion ring structures for 57500 series chips.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6ba990384e924476b5eed1734f3bcca0df6fd77e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Nov 15 03:25:37 2018 -0500
bnxt_en: Fix RSS context allocation.
Recent commit has added the reservation of RSS context. This requires
bnxt_hwrm_vnic_qcaps() to be called before allocating any RSS contexts.
The bnxt_hwrm_vnic_qcaps() call sets up proper flags that will
determine how many RSS contexts to allocate to support NTUPLE.
This causes a regression that too many RSS contexts are being reserved
and causing resource shortage when enabling many VFs. Fix it by calling
bnxt_hwrm_vnic_qcaps() earlier.
Fixes: 41e8d7983752 ("bnxt_en: Modify the ring reservation functions for 57500 series chips.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 35b842f25b603028fab7ff11b54a4410ee345c8a
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu Oct 18 11:02:39 2018 +0300
bnxt_en: Copy and paste bug in extended tx_stats
The struct type was copied from the line before but it should be "tx"
instead of "rx". I have reviewed the code and I can't immediately see
that this bug causes a runtime issue.
Fixes: 36e53349b60b ("bnxt_en: Add additional extended port statistics.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1ab968d2f1d6d654052dbbf95f9461a6428a5487
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:59 2018 -0400
bnxt_en: Add PCI ID for BCM57508 device.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0fcec9854ab478551debaef11e9c7875fc837906
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:58 2018 -0400
bnxt_en: Add new NAPI poll function for 57500 chips.
Add a new poll function that polls for NQ events. If the NQ event is
a CQ notification, we locate the CP ring from the cq_handle and call
__bnxt_poll_work() to handle RX/TX events on the CP ring.
Add a new has_more_work field in struct bnxt_cp_ring_info to indicate
budget has been reached. __bnxt_poll_cqs_done() is called to update or
ARM the CP rings if budget has not been reached or not. If budget
has been reached, the next bnxt_poll_p5() call will continue to poll
from the CQ rings directly. Otherwise, the NQ will be ARMed for the
next IRQ.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3675b92fa70ece4c9263b812fc8cbf3bd606398c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:57 2018 -0400
bnxt_en: Refactor bnxt_poll_work().
Separate the CP ring polling logic in bnxt_poll_work() into 2 separate
functions __bnxt_poll_work() and __bnxt_poll_work_done(). Since the logic
is separated, we need to add tx_pkts and events fields to struct bnxt_napi
to keep track of the events to handle between the 2 functions. We also
add had_work_done field to struct bnxt_cp_ring_info to indicate whether
some work was performed on the CP ring.
This is needed to better support the 57500 chips. We need to poll up to
2 separate CP rings before we update or ARM the CP rings on the 57500 chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 58590c8d9044dd6ff1757d9e9af63a253cc15101
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:56 2018 -0400
bnxt_en: Add coalescing setup for 57500 chips.
On legacy chips, the CP ring may be shared between RX and TX and so only
setup the RX coalescing parameters in such a case. On 57500 chips, we
always have a dedicated CP ring for TX so we can always set up the
TX coalescing parameters in bnxt_hwrm_set_coal().
Also, the min_timer coalescing parameter applies to the NQ on the new
chips and a separate firmware call needs to be made to set it up.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e44758b78ae81461a3269e7958653f1af0f78989
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:55 2018 -0400
bnxt_en: Use bnxt_cp_ring_info struct pointer as parameter for RX path.
In the RX code path, we current use the bnxt_napi struct pointer to
identify the associated RX/CP rings. Change it to use the struct
bnxt_cp_ring_info pointer instead since there are now up to 2
CP rings per MSIX.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7b3af4f75b81bec06ed5bf411039fbd0646da44e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:54 2018 -0400
bnxt_en: Add RSS support for 57500 chips.
RSS context allocation and RSS indirection table setup are very different
on the new chip. Refactor bnxt_setup_vnic() to call 2 different functions
to set up RSS for the vnic based on chip type. On the new chip, the
number of RSS contexts and the indirection table size depends on the
number of RX rings. Each indirection table entry is also different
on the new chip since ring groups are no longer used.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 44c6f72a4c30496c7378a62e13605b217e49f991
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:53 2018 -0400
bnxt_en: Increase RSS context array count and skip ring groups on 57500 chips.
On the new 57500 chips, we need to allocate one RSS context for every
64 RX rings. In previous chips, only one RSS context per vnic is
required regardless of the number of RX rings. So increase the max
RSS context array count to 8.
Hardware ring groups are not used on the new chips. Note that the
software ring group structure is still maintained in the driver to
keep track of the rings associated with the vnic.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3e08b1841bc8debf6b3d722b9d355093a1537b1e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:52 2018 -0400
bnxt_en: Allocate/Free CP rings for 57500 series chips.
On the new 57500 chips, we allocate/free one CP ring for each RX ring or
TX ring separately. Using separate CP rings for RX/TX is an improvement
as TX events will no longer be stuck behind RX events.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 23aefdd761599e42d7f1f6504ff38c558e18de2a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:51 2018 -0400
bnxt_en: Modify bnxt_ring_alloc_send_msg() to support 57500 chips.
Firmware ring allocation semantics are slightly different for most
ring types on 57500 chips. Allocation/deallocation for NQ rings are
also added for the new chips.
A CP ring handle is also added so that from the NQ interrupt event,
we can locate the CP ring.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2c61d2117ecb065aaad9e9ea9bc8bc4a6c30ec24
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:50 2018 -0400
bnxt_en: Add helper functions to get firmware CP ring ID.
On the new 57500 chips, getting the associated CP ring ID associated with
an RX ring or TX ring is different than before. On the legacy chips,
we find the associated ring group and look up the CP ring ID. On the
57500 chips, each RX ring and TX ring has a dedicated CP ring even if
they share the MSIX. Use these helper functions at appropriate places
to get the CP ring ID.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 50e3ab7836b5efdc25e935316b3a156de3ff972e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:49 2018 -0400
bnxt_en: Allocate completion ring structures for 57500 series chips.
On 57500 chips, the original bnxt_cp_ring_info struct now refers to the
NQ. bp->cp_nr_rings refer to the number of NQs on 57500 chips. There
are now 2 pointers for the CP rings associated with RX and TX rings.
Modify bnxt_alloc_cp_rings() and bnxt_free_cp_rings() accordingly.
With multiple CP rings per NAPI, we need to add a pointer in
bnxt_cp_ring_info struct to point back to the bnxt_napi struct.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 41e8d7983752f2a0ada01fac11cbac7413e7beec
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:48 2018 -0400
bnxt_en: Modify the ring reservation functions for 57500 series chips.
The ring reservation functions have to be modified for P5 chips in the
following ways:
- bnxt_cp_ring_info structs map to internal NQs as well as CP rings.
- Ring groups are not used.
- 1 CP ring must be available for each RX or TX ring.
- number of RSS contexts to reserve is multiples of 64 RX rings.
- RFS currently not supported.
Also, RX AGG rings are only used for jumbo frames, so we need to
unconditionally call bnxt_reserve_rings() in __bnxt_open_nic()
to see if we need to reserve AGG rings in case MTU has changed.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9c1fabdf424f27370790f1e0868b35cf63b70981
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:47 2018 -0400
bnxt_en: Adjust MSIX and ring groups for 57500 series chips.
Store the maximum MSIX capability in PCIe config. space earlier. When
we call firmware to query capability, we need to compare the PCIe
MSIX max count with the firmware count and use the smaller one as
the MSIX count for 57500 (P5) chips.
The new chips don't use ring groups. But previous chips do and
the existing logic limits the available rings based on resource
calculations including ring groups. Setting the max ring groups to
the max rx rings will work on the new chips without changing the
existing logic.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 697197e5a1735325c0e1ef85dde2b2986354beb9
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:46 2018 -0400
bnxt_en: Re-structure doorbells.
The 57500 series chips have a new 64-bit doorbell format. Use a new
bnxt_db_info structure to unify the new and the old 32-bit doorbells.
Add a new bnxt_set_db() function to set up the doorbell addreses and
doorbell keys ahead of time. Modify and introduce new doorbell
helpers to help abstract and unify the old and new doorbells.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e38287b72ec5455eb1e16b1de0ba4ed54e2a748c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:45 2018 -0400
bnxt_en: Add 57500 new chip ID and basic structures.
57500 series is a new chip class (P5) that requires some driver changes
in the next several patches. This adds basic chip ID, doorbells, and
the notification queue (NQ) structures. Each MSIX is associated with an
NQ instead of a CP ring in legacy chips. Each NQ has up to 2 associated
CP rings for RX and TX. The same bnxt_cp_ring_info struct will be used
for the NQ.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1b9394e5a2ad48be7906557ea6a500c5e8e91ee1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:44 2018 -0400
bnxt_en: Configure context memory on new devices.
Call firmware to configure the DMA addresses of all context memory
pages on new devices requiring context memory.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 98f04cf0f1fc26ee8401e7c06b422508acc8374c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:43 2018 -0400
bnxt_en: Check context memory requirements from firmware.
New device requires host context memory as a backing store. Call
firmware to check for context memory requirements and store the
parameters. Allocate host pages accordingly.
We also need to move the call bnxt_hwrm_queue_qportcfg() earlier
so that all the supported hardware queues and the IDs are known
before checking and allocating context memory.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 66cca20abcf742e2e39ec437144e7787ecefa037
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:42 2018 -0400
bnxt_en: Add new flags to setup new page table PTE bits on newer devices.
Newer chips require the PTU_PTE_VALID bit to be set for every page
table entry for context memory and rings. Additional bits are also
required for page table entries for all rings. Add a flags field to
bnxt_ring_mem_info struct to specify these additional bits to be used
when setting up the pages tables as needed.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6fe19886858f1c7f96a5da3420bd040c58bcaca6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:41 2018 -0400
bnxt_en: Refactor bnxt_ring_struct.
Move the DMA page table and vmem fields in bnxt_ring_struct to a new
bnxt_ring_mem_info struct. This will allow context memory management
for a new device to re-use some of the existing infrastructure.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 74706afa712d3d2aa497585af44f11319b2b6348
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:40 2018 -0400
bnxt_en: Update interrupt coalescing logic.
New firmware spec. allows interrupt coalescing parameters, such as
maximums, timer units, supported features to be queried. Update
the driver to make use of the new call to query these parameters
and provide the legacy defaults if the call is not available.
Replace the hard-coded values with these parameters.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1dfddc41ae4990b991059de8dfc8e802ab67244c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:39 2018 -0400
bnxt_en: Add maximum extended request length fw message support.
Support the max_ext_req_len field from the HWRM_VER_GET_RESPONSE.
If this field is valid and greater than the mailbox size, use the
short command format to send firmware messages greater than the
mailbox size. Newer devices use this method to send larger messages
to the firmware.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 36e53349b60bc6c629949e041567a376c9c42228
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:38 2018 -0400
bnxt_en: Add additional extended port statistics.
Latest firmware spec. has some additional rx extended port stats and new
tx extended port stats added. We now need to check the size of the
returned rx and tx extended stats and determine how many counters are
valid. New counters added include CoS byte and packet counts for rx
and tx.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 31d357c0697dadb760bf682bf1ffd9fd7053ed59
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Oct 14 07:02:37 2018 -0400
bnxt_en: Update firmware interface spec. to 1.10.0.3.
Among the new changes are trusted VF support, 200Gbps support, and new
API to dump ring information on the new chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5fc7c12ffa7fe463c4da2295cdc199da9663dce5
Author: Gustavo A. R. Silva <gustavo@embeddedor.com>
Date: Fri Oct 5 22:12:09 2018 +0200
bnxt_en: Remove unnecessary unsigned integer comparison and initialize variable
There is no need to compare *val.vu32* with < 0 because
such variable is of type u32 (32 bits, unsigned), making it
impossible to hold a negative value. Fix this by removing
such comparison.
Also, initialize variable *max_val* to -1, just in case
it is not initialized to either BNXT_MSIX_VEC_MAX or
BNXT_MSIX_VEC_MIN_MAX before using it in a comparison
with val.vu32 at line 159:
if (val.vu32 > max_val)
Addresses-Coverity-ID: 1473915 ("Unsigned compared against 0")
Addresses-Coverity-ID: 1473920 ("Uninitialized scalar variable")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c78fe058879bdea919d44f23e21da26f603e9166
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Oct 5 00:26:03 2018 -0400
bnxt_en: get the reduced max_irqs by the ones used by RDMA
When getting the max rings supported, get the reduced max_irqs
by the ones used by RDMA.
If the number MSIX is the limiting factor, this bug may cause the
max ring count to be higher than it should be when RDMA driver is
loaded and may result in ring allocation failures.
Fixes: 30f529473ec9 ("bnxt_en: Do not modify max IRQ count after RDMA driver requests/frees IRQs.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a2bf74f4e1b82395dad2b08d2a911d9151db71c1
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Fri Oct 5 00:26:02 2018 -0400
bnxt_en: free hwrm resources, if driver probe fails.
When the driver probe fails, all the resources that were allocated prior
to the failure must be freed. However, hwrm dma response memory is not
getting freed.
This patch fixes the problem described above.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5db0e0969af6501ad45fe0494039d3b9c797822b
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Oct 5 00:26:01 2018 -0400
bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request
In HWRM_QUEUE_COS2BW_CFG request, enables field should have the bits
set only for the queue ids which are having the valid parameters.
This causes firmware to return error when the TC to hardware CoS queue
mapping is not 1:1 during DCBNL ETS setup.
Fixes: 2e8ef77ee0ff ("bnxt_en: Add TC to hardware QoS queue mapping logic.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dbe80d446c859873820eedfff4abc61c71f1927b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Oct 5 00:26:00 2018 -0400
bnxt_en: Fix VNIC reservations on the PF.
The enables bit for VNIC was set wrong when calling the HWRM_FUNC_CFG
firmware call to reserve VNICs. This has the effect that the firmware
will keep a large number of VNICs for the PF, and having very few for
VFs. DPDK driver running on the VFs, which requires more VNICs, may not
work properly as a result.
Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2dc0865e9ac7150e2d3b29afdc32d04b99f37902
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 4 11:13:50 2018 +0530
bnxt_en: Add a driver specific gre_ver_check devlink parameter.
This patch adds following driver-specific permanent mode boolean
parameter.
gre_ver_check - Generic Routing Encapsulation(GRE) version check
will be enabled in the device. If disabled, device skips version
checking for GRE packets.
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f399e8497826d35e4d83785cdff33ad779ffa62f
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 4 11:13:49 2018 +0530
bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink params.
This patch adds support for following generic permanent mode
devlink parameters. They can be modified using devlink param
commands.
msix_vec_per_pf_max - This param sets the number of MSIX vectors
that the device requests from the host on driver initialization.
This value is set in the device which limits MSIX vectors per PF.
msix_vec_per_pf_min - This param sets the number of minimal MSIX
vectors required for the device initialization. Value 0 indicates
a default value is selected. This value is set in the device which
limits MSIX vectors per PF.
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3a1d52a54a6a4030b294e5f5732f0bfbae0e3815
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 4 11:13:48 2018 +0530
bnxt_en: return proper error when FW returns HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED
Return proper error code when Firmware returns
HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED for HWRM_NVM_GET/SET_VARIABLE
commands.
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7d859234875d236a363101e90aaaf52a790f4590
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 4 11:13:47 2018 +0530
bnxt_en: Use ignore_ari devlink parameter
This patch adds support for ignore_ari generic permanent mode
devlink parameter. This parameter is disabled by default. It can be
enabled using devlink param commands.
ignore_ari - If enabled, device ignores ARI(Alternate Routing ID)
capability, even when platforms has the support and creates same number
of partitions when platform does not support ARI capability.
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit db7ff19e7b119adb4618fbc6410b441d1c3b55c5
Author: Eli Britstein <elibr@mellanox.com>
Date: Wed Aug 15 16:02:18 2018 +0300
devlink: Add extack for eswitch operations
Add extack argument to the eswitch related operations.
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
commit 62b36c3ea664b34004b9d29bf541b6c6ce30e33c
Author: Oza Pawandeep <poza@codeaurora.org>
Date: Fri Sep 28 13:00:56 2018 -0500
PCI/AER: Remove pci_cleanup_aer_uncorrect_error_status() calls
After bfcb79fca19d ("PCI/ERR: Run error recovery callbacks for all affected
devices"), AER errors are always cleared by the PCI core and drivers don't
need to do it themselves.
Remove calls to pci_cleanup_aer_uncorrect_error_status() from device
driver error recovery functions.
Signed-off-by: Oza Pawandeep <poza@codeaurora.org>
[bhelgaas: changelog, remove PCI core changes, remove unused variables]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
commit 73f21c653f930f438d53eed29b5e4c65c8a0f906
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Sep 26 00:41:04 2018 -0400
bnxt_en: Fix TX timeout during netpoll.
The current netpoll implementation in the bnxt_en driver has problems
that may miss TX completion events. bnxt_poll_work() in effect is
only handling at most 1 TX packet before exiting. In addition,
there may be in flight TX completions that ->poll() may miss even
after we fix bnxt_poll_work() to handle all visible TX completions.
netpoll may not call ->poll() again and HW may not generate IRQ
because the driver does not ARM the IRQ when the budget (0 for netpoll)
is reached.
We fix it by handling all TX completions and to always ARM the IRQ
when we exit ->poll() with 0 budget.
Also, the logic to ACK the completion ring in case it is almost filled
with TX completions need to be adjusted to take care of the 0 budget
case, as discussed with Eric Dumazet <edumazet@google.com>
Reported-by: Song Liu <songliubraving@fb.com>
Reviewed-by: Song Liu <songliubraving@fb.com>
Tested-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 58e0e22bff638055278ea73e34d0d07a95260790
Author: Eric Dumazet <edumazet@google.com>
Date: Fri Sep 21 15:27:50 2018 -0700
bnxt: remove ndo_poll_controller
As diagnosed by Song Liu, ndo_poll_controller() can
be very dangerous on loaded hosts, since the cpu
calling ndo_poll_controller() might steal all NAPI
contexts (for all RX/TX queues of the NIC). This capture
can last for unlimited amount of time, since one
cpu is generally not able to drain all the queues under load.
bnxt uses NAPI for TX completions, so we better let core
networking stack call the napi->poll() to avoid the capture.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8c6ec3613e7b0aade20a3196169c0bab32ed3e3f
Author: Davide Caratti <dcaratti@redhat.com>
Date: Wed Sep 19 19:01:37 2018 +0200
bnxt_en: don't try to offload VLAN 'modify' action
bnxt offload code currently supports only 'push' and 'pop' operation: let
.ndo_setup_tc() return -EOPNOTSUPP if VLAN 'modify' action is configured.
Fixes: 2ae7408fedfe ("bnxt_en: bnxt: add TC flower filter offload support")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 65fac4fe9080714df80d430888834ce87c6716ba
Author: zhong jiang <zhongjiang@huawei.com>
Date: Tue Sep 18 15:15:44 2018 +0800
net: bnxt: Fix a uninitialized variable warning.
Fix the following compile warning:
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:49:5: warning: ‘nvm_param.dir_type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (nvm_param.dir_type == BNXT_NVM_PORT_CFG)
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 28ea334bd1657f3c43485b4a8592672fc6835fac
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Sep 14 15:41:29 2018 -0400
bnxt_en: Fix VF mac address regression.
The recent commit to always forward the VF MAC address to the PF for
approval may not work if the PF driver or the firmware is older. This
will cause the VF driver to fail during probe:
bnxt_en 0000:00:03.0 (unnamed net_device) (uninitialized): hwrm req_type 0xf seq id 0x5 error 0xffff
bnxt_en 0000:00:03.0 (unnamed net_device) (uninitialized): VF MAC address 00:00:17:02:05:d0 not approved by the PF
bnxt_en 0000:00:03.0: Unable to initialize mac address.
bnxt_en: probe of 0000:00:03.0 failed with error -99
We fix it by treating the error as fatal only if the VF MAC address is
locally generated by the VF.
Fixes: 707e7e966026 ("bnxt_en: Always forward VF MAC address to the PF.")
Reported-by: Seth Forshee <seth.forshee@canonical.com>
Reported-by: Siwei Liu <loseweigh@gmail.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 38bb4ac91bd8322cfed9d9b922ef2d8f5daa5700
Author: YueHaibing <yuehaibing@huawei.com>
Date: Wed Sep 5 11:44:10 2018 +0000
bnxt_en: remove set but not used variable 'addr_type'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c: In function 'bnxt_tc_parse_flow':
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c:186:6: warning:
variable 'addr_type' set but not used [-Wunused-but-set-variable]
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 00fe9c326d2027f2437dea38ef0e82f9d02d94c0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 3 04:23:19 2018 -0400
bnxt_en: Do not adjust max_cp_rings by the ones used by RDMA.
Currently, the driver adjusts the bp->hw_resc.max_cp_rings by the number
of MSIX vectors used by RDMA. There is one code path in open that needs
to check the true max_cp_rings including any used by RDMA. This code
is now checking for the reduced max_cp_rings which will fail when the
number of cp rings is very small.
To fix this in a clean way, we don't adjust max_cp_rings anymore.
Instead, we add a helper bnxt_get_max_func_cp_rings_for_en() to get the
reduced max_cp_rings when appropriate.
Fixes: ec86f14ea506 ("bnxt_en: Add ULP calls to stop and restart IRQs.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ad95c27bdb930105f3eea02621bda157caf2862d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 3 04:23:18 2018 -0400
bnxt_en: Clean up unused functions.
Remove unused bnxt_subtract_ulp_resources(). Change
bnxt_get_max_func_irqs() to static since it is only locally used.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6b95c3e9697254dab0c8eafc6ab9d5e10d2eca4e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 3 04:23:17 2018 -0400
bnxt_en: Fix firmware signaled resource change logic in open.
When the driver detects that resources have changed during open, it
should reset the rx and tx rings to 0. This will properly setup the
init sequence to initialize the default rings again. We also need
to signal the RDMA driver to stop and clear its interrupts. We then
call the RoCE driver to restart if a new set of default rings is
successfully reserved.
Fixes: 25e1acd6b92b ("bnxt_en: Notify firmware about IF state changes.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 181ab62311c62fdd8c450969d0b822e1b89de42a
Author: YueHaibing <yuehaibing@huawei.com>
Date: Fri Aug 31 04:08:01 2018 +0000
bnxt_en: remove set but not used variable 'rx_stats'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c: In function 'bnxt_vf_rep_rx':
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c:212:28: warning:
variable 'rx_stats' set but not used [-Wunused-but-set-variable]
struct bnxt_vf_rep_stats *rx_stats;
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 244cd96adb5f5ab39551081fb1f9009a54bb12ee
Author: Cong Wang <xiyou.wangcong@gmail.com>
Date: Sun Aug 19 12:22:09 2018 -0700
net_sched: remove list_head from tc_action
After commit 90b73b77d08e, list_head is no longer needed.
Now we just need to convert the list iteration to array
iteration for drivers.
Fixes: 90b73b77d08e ("net: sched: change action API to use array of pointers to actions")
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1bbf3aed25e0fc256e825da1f5c45d7b4daa828e
Author: Arnd Bergmann <arnd@arndb.de>
Date: Tue Aug 14 00:12:45 2018 +0200
bnxt_en: take coredump_record structure off stack
The bnxt_coredump_record structure is very long, causing a warning
about possible stack overflow on 32-bit architectures:
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c: In function 'bnxt_get_coredump':
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2989:1: error: the frame size of 1188 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
I could not see any reason to operate on an on-stack copy of the
structure before copying it back into the caller-provided buffer, which
also simplifies the code here.
Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3d46eee5a5f2f22ca04e2139e8c9a16b81d16073
Author: Arnd Bergmann <arnd@arndb.de>
Date: Mon Aug 13 23:26:54 2018 +0200
bnxt_en: avoid string overflow for record->system_name
The utsname()->nodename string may be 64 bytes long, and it gets
copied without the trailing nul byte into the shorter record->system_name,
as gcc now warns:
In file included from include/linux/bitmap.h:9,
from include/linux/ethtool.h:16,
from drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:13:
In function 'strncpy',
inlined from 'bnxt_fill_coredump_record' at drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2863:2:
include/linux/string.h:254:9: error: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
Using strlcpy() at least avoids overflowing the destination buffer
and adds proper nul-termination. It may still truncate long names
though, which probably can't be solved here.
Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8605212a7c37b5d786544263bae5e697c1aaaa16
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Aug 10 18:24:43 2018 -0400
bnxt_en: Fix strcpy() warnings in bnxt_ethtool.c
This patch fixes following smatch warnings:
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2826 bnxt_fill_coredump_seg_hdr() error: strcpy() '"sEgM"' too large for 'seg_hdr->signature' (5 vs 4)
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2858 bnxt_fill_coredump_record() error: strcpy() '"cOrE"' too large for 'record->signature' (5 vs 4)
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2879 bnxt_fill_coredump_record() error: strcpy() 'utsname()->sysname' too large for 'record->os_name' (65 vs 32)
Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bc171e87a7e29a41b119fdfccd378f7179b39c23
Author: Gustavo A. R. Silva <gustavo@embeddedor.com>
Date: Tue Aug 7 18:11:14 2018 -0500
bnx2x: Mark expected switch fall-thoughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Addresses-Coverity-ID: 114878 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit aabfc016e9a6db2a8c2da815fc84bfd5a2e8d221
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:58 2018 -0400
bnxt_en: Do not use the CNP CoS queue for networking traffic.
The CNP CoS queue is reserved for internal RDMA Congestion Notification
Packets (CNP) and should not be used for a TC. Modify the CoS queue
discovery code to skip over the CNP CoS queue and to reduce
bp->max_tc accordingly. However, if RDMA is disabled in NVRAM, the
the CNP CoS queue can be used for a TC.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit afdc8a84844a2163e25ad735f9f69d220ae02529
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:57 2018 -0400
bnxt_en: Add DCBNL DSCP application protocol support.
Expand the .ieee_setapp() and ieee_delapp() DCBNL methods to support
DSCP. This allows DSCP values to user priority mappings instead
of using VLAN priorities. Each DSCP mapping is added or deleted one
entry at a time using the firmware API. The firmware call can only be
made from a PF.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cde49a42a9bbba18d7f33550fd70037930c14e97
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Aug 5 16:51:56 2018 -0400
bnxt_en: Add hwmon sysfs support to read temperature
Export temperature sensor reading via hwmon sysfs.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 25e1acd6b92bde36c03273d883c44c4d0e8995e6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:55 2018 -0400
bnxt_en: Notify firmware about IF state changes.
Use latest firmware API to notify firmware about IF state changes.
Firmware has the option to clean up resources during IF down and
to require the driver to reserve resources again during IF up.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 97381a1831124c95801fbfaba8436b4abc7d03f5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:54 2018 -0400
bnxt_en: Move firmware related flags to a new fw_cap field in struct bnxt.
The flags field is almost getting full. Move firmware capability flags
to a new fw_cap field to better organize these firmware flags.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f1ca94de0d8760726dc615e8b4f9801f7ad9cf3b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:53 2018 -0400
bnxt_en: Add BNXT_NEW_RM() macro.
The BNXT_FLAG_NEW_RM flag is checked a lot in the code to determine if
the new resource manager is in effect. Define a macro to perform
this check.
Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6c5657d085ae8c13a8565b98e6a23fe68f0bede4
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sun Aug 5 16:51:52 2018 -0400
bnxt_en: Add support for ethtool get dump.
Add support to collect live firmware coredump via ethtool.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 50f011b63d8caab7f40de52ca6cf4807aea7a941
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:51 2018 -0400
bnxt_en: Update RSS setup and GRO-HW logic according to the latest spec.
Set the default hash mode flag in HWRM_VNIC_RSS_CFG to signal to the
firmware that the driver is compliant with the latest spec. With
that, the firmware can return expanded RSS profile IDs that the driver
checks to setup the proper gso_type for GRO-HW packets. But instead
of checking for the new profile IDs, we check the IP_TYPE flag
in TPA_START which is more straight forward than checking a list of
profile IDs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bf82736da3c376c03a42c74ea6fa971e89740d7a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:50 2018 -0400
bnxt_en: Add new VF resource allocation strategy mode.
The new mode is "minimal-static" to be used when resources are more
limited to support a large number of VFs, for example The PF driver
will provision guaranteed minimum resources of 0. Each VF has no
guranteed resources until it tries to reserve resources during device
open.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a1ef4a7920549d015128a8a49d7c9e654d197c98
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:49 2018 -0400
bnxt_en: Add PHY retry logic.
During hotplug, the driver's open function can be called almost
immediately after power on reset. The PHY may not be ready and the
firmware may return failure when the driver tries to update PHY
settings. Add retry logic fired from the driver's timer to retry
the operation for 5 seconds.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 55fd0cf320c3051f8dcb88c07ddd1e4c54b82cba
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:48 2018 -0400
bnxt_en: Add external loopback test to ethtool selftest.
Add code to detect firmware support for external loopback and the extra
test entry for external loopback.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e795892e93b6ccbda7e0f0fc476d0d4629b44f84
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:47 2018 -0400
bnxt_en: Adjust timer based on ethtool stats-block-usecs settings.
The driver gathers statistics using 2 mechanisms. Some stats are DMA'ed
directly from hardware and others are polled from the driver's timer.
Currently, we only adjust the DMA frequency based on the ethtool
stats-block-usecs setting. This patch adjusts the driver's timer
frequency as well to make everything consistent.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6fc92c33854b7844745ce424e1cb8029c06d1cf1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Aug 5 16:51:46 2018 -0400
bnxt_en: Update firmware interface version to 1.9.2.25.
New interface has firmware core dump support, new extended port
statistics, and IF state change notifications to the firmware.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6fd544c897d98bc6f185da215f1585dc144218cc
Author: YueHaibing <yuehaibing@huawei.com>
Date: Fri Aug 3 16:48:56 2018 +0800
bnxt_en: combine 'else if' and 'else' into single branch
The else-if branch and else branch set mac_ok to true similarly,
so combine the two into single else branch.
Also add comments to explain the two conditions, which
from Michael Chan and Vasundhara Volam.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6b8675897338f874c41612655a85d8e10cdb23d8
Author: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Wed Jul 11 20:36:39 2018 -0700
xdp: don't make drivers report attachment mode
prog_attached of struct netdev_bpf should have been superseded
by simply setting prog_id long time ago, but we kept it around
to allow offloading drivers to communicate attachment mode (drv
vs hw). Subsequently drivers were also allowed to report back
attachment flags (prog_flags), and since nowadays only programs
attached will XDP_FLAGS_HW_MODE can get offloaded, we can tell
the attachment mode from the flags driver reports. Remove
prog_attached member.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
commit c58387ab1614f6d7fb9e244f214b61e7631421fc
Author: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Mon Jul 9 02:24:52 2018 -0400
bnxt_en: Fix for system hang if request_irq fails
Fix bug in the error code path when bnxt_request_irq() returns failure.
bnxt_disable_napi() should not be called in this error path because
NAPI has not been enabled yet.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 30f529473ec962102e8bcd33a6a04f1e1b490ae2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 9 02:24:51 2018 -0400
bnxt_en: Do not modify max IRQ count after RDMA driver requests/frees IRQs.
Calling bnxt_set_max_func_irqs() to modify the max IRQ count requested or
freed by the RDMA driver is flawed. The max IRQ count is checked when
re-initializing the IRQ vectors and this can happen multiple times
during ifup or ethtool -L. If the max IRQ is reduced and the RDMA
driver is operational, we may not initailize IRQs correctly. This
problem shows up on VFs with very small number of MSIX.
There is no other logic that relies on the IRQ count excluding the ones
used by RDMA. So we fix it by just removing the call to subtract or
add the IRQs used by RDMA.
Fixes: a588e4580a7e ("bnxt_en: Add interface to support RDMA driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 30e338487a476aff2f12f440d1190a71c245b99c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 9 02:24:50 2018 -0400
bnxt_en: Support clearing of the IFF_BROADCAST flag.
Currently, the driver assumes IFF_BROADCAST is always set and always sets
the broadcast filter. Modify the code to set or clear the broadcast
filter according to the IFF_BROADCAST flag.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 78f058a4aa0f2280dc4d45d2c4a95728398ef857
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 9 02:24:49 2018 -0400
bnxt_en: Always set output parameters in bnxt_get_max_rings().
The current code returns -ENOMEM and does not bother to set the output
parameters to 0 when no rings are available. Some callers, such as
bnxt_get_channels() will display garbage ring numbers when that happens.
Fix it by always setting the output parameters.
Fixes: 6e6c5a57fbe1 ("bnxt_en: Modify bnxt_get_max_rings() to support shared or non shared rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 07f4fde53d12eb8d921b465bb298e964e0bdc38c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 9 02:24:48 2018 -0400
bnxt_en: Fix inconsistent BNXT_FLAG_AGG_RINGS logic.
If there aren't enough RX rings available, the driver will attempt to
use a single RX ring without the aggregation ring. If that also
fails, the BNXT_FLAG_AGG_RINGS flag is cleared but the other ring
parameters are not set consistently to reflect that. If more RX
rings become available at the next open, the RX rings will be in
an inconsistent state and may crash when freeing the RX rings.
Fix it by restoring the BNXT_FLAG_AGG_RINGS if not enough RX rings are
available to run without aggregation rings.
Fixes: bdbd1eb59c56 ("bnxt_en: Handle no aggregation ring gracefully.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e32d4e60b350124065e0ffd9c91ac13a439aee9a
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Mon Jul 9 02:24:47 2018 -0400
bnxt_en: Fix the vlan_tci exact match check.
It is possible that OVS may set dont care for DEI/CFI bit in
vlan_tci mask. Hence, checking for vlan_tci exact match will endup
in a vlan flow rejection.
This patch fixes the problem by checking for vlan_pcp and vid
separately, instead of checking for the entire vlan_tci.
Fixes: e85a9be93cf1 (bnxt_en: do not allow wildcard matches for L2 flows)
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6354b95eb871beee89b8679a1f576fccc132cf90
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Wed Jul 4 14:30:37 2018 +0300
bnxt_en: Add bnxt_en initial params table and register it.
Create initial devlink parameters table for bnxt_en.
Table consists of a permanent generic parameter.
enable_sriov - Enables Single-Root Input/Output Virtualization(SR-IOV)
characteristic of the device.
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 83607344d667315687e1a5ddd2ad2fbbff22cc43
Author: Gustavo A. R. Silva <gustavo@embeddedor.com>
Date: Wed Jun 27 20:32:23 2018 -0500
bnx2x: Mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 60513bd82c825b659c05957e4f8106ba06f0797f
Author: John Hurley <john.hurley@netronome.com>
Date: Mon Jun 25 14:30:04 2018 -0700
net: sched: pass extack pointer to block binds and cb registration
Pass the extact struct from a tc qdisc add to the block bind function and,
in turn, to the setup_tc ndo of binding device via the tc_block_offload
struct. Pass this back to any block callback registrations to allow
netlink logging of fails in the bind process.
Signed-off-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 83741bb0430465ea9f0654d4772c03d694b33ad7
Author: Jiri Pirko <jiri@mellanox.com>
Date: Sun Jun 24 10:38:37 2018 +0200
bnxt: simplify cls_flower command switch and handle default case
Currently the default case is not handled, which with future command
introductions would introduce a warning. So handle it and make the
switch a bit simplier removing unneeded "rc" variable.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6da2ec56059c3c7a7e5f729e6349e74ace1e5c57
Author: Kees Cook <keescook@chromium.org>
Date: Tue Jun 12 13:55:00 2018 -0700
treewide: kmalloc() -> kmalloc_array()
The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
patch replaces cases of:
kmalloc(a * b, gfp)
with:
kmalloc_array(a * b, gfp)
as well as handling cases of:
kmalloc(a * b * c, gfp)
with:
kmalloc(array3_size(a, b, c), gfp)
as it's slightly less ugly than:
kmalloc_array(array_size(a, b), c, gfp)
This does, however, attempt to ignore constant size factors like:
kmalloc(4 * 1024, gfp)
though any constants defined via macros get caught up in the conversion.
Any factors with a sizeof() of "unsigned char", "char", and "u8" were
dropped, since they're redundant.
The tools/ directory was manually excluded, since it has its own
implementation of kmalloc().
The Coccinelle script used for this was:
// Fix redundant parens around sizeof().
@@
type TYPE;
expression THING, E;
@@
(
kmalloc(
- (sizeof(TYPE)) * E
+ sizeof(TYPE) * E
, ...)
|
kmalloc(
- (sizeof(THING)) * E
+ sizeof(THING) * E
, ...)
)
// Drop single-byte sizes and redundant parens.
@@
expression COUNT;
typedef u8;
typedef __u8;
@@
(
kmalloc(
- sizeof(u8) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(__u8) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(char) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(unsigned char) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(u8) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(__u8) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(char) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(unsigned char) * COUNT
+ COUNT
, ...)
)
// 2-factor product with sizeof(type/expression) and identifier or constant.
@@
type TYPE;
expression THING;
identifier COUNT_ID;
constant COUNT_CONST;
@@
(
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (COUNT_ID)
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * COUNT_ID
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (COUNT_CONST)
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * COUNT_CONST
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (COUNT_ID)
+ COUNT_ID, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * COUNT_ID
+ COUNT_ID, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (COUNT_CONST)
+ COUNT_CONST, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * COUNT_CONST
+ COUNT_CONST, sizeof(THING)
, ...)
)
// 2-factor product, only identifiers.
@@
identifier SIZE, COUNT;
@@
- kmalloc
+ kmalloc_array
(
- SIZE * COUNT
+ COUNT, SIZE
, ...)
// 3-factor product with 1 sizeof(type) or sizeof(expression), with
// redundant parens removed.
@@
expression THING;
identifier STRIDE, COUNT;
type TYPE;
@@
(
kmalloc(
- sizeof(TYPE) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(THING) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
)
// 3-factor product with 2 sizeof(variable), with redundant parens removed.
@@
expression THING1, THING2;
identifier COUNT;
type TYPE1, TYPE2;
@@
(
kmalloc(
- sizeof(TYPE1) * sizeof(TYPE2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kmalloc(
- sizeof(THING1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(THING1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
)
// 3-factor product, only identifiers, with redundant parens removed.
@@
identifier STRIDE, SIZE, COUNT;
@@
(
kmalloc(
- (COUNT) * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
)
// Any remaining multi-factor products, first at least 3-factor products,
// when they're not all constants...
@@
expression E1, E2, E3;
constant C1, C2, C3;
@@
(
kmalloc(C1 * C2 * C3, ...)
|
kmalloc(
- (E1) * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- (E1) * (E2) * E3
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- (E1) * (E2) * (E3)
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- E1 * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
)
// And then all remaining 2 factors products when they're not all constants,
// keeping sizeof() as the second factor argument.
@@
expression THING, E1, E2;
type TYPE;
constant C1, C2, C3;
@@
(
kmalloc(sizeof(THING) * C2, ...)
|
kmalloc(sizeof(TYPE) * C2, ...)
|
kmalloc(C1 * C2 * C3, ...)
|
kmalloc(C1 * C2, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (E2)
+ E2, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * E2
+ E2, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (E2)
+ E2, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * E2
+ E2, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- (E1) * E2
+ E1, E2
, ...)
|
- kmalloc
+ kmalloc_array
(
- (E1) * (E2)
+ E1, E2
, ...)
|
- kmalloc
+ kmalloc_array
(
- E1 * E2
+ E1, E2
, ...)
)
Signed-off-by: Kees Cook <keescook@chromium.org>
commit af125b754e2f09e6061e65db8f4eda0f7730011d
Author: Bjorn Helgaas <bhelgaas@google.com>
Date: Fri Mar 30 14:09:54 2018 -0500
bnxt_en: Report PCIe link properties with pcie_print_link_status()
Previously the driver used pcie_get_minimum_link() to warn when the NIC
is in a slot that can't supply as much bandwidth as the NIC could use.
pcie_get_minimum_link() can be misleading because it finds the slowest link
and the narrowest link (which may be different links) without considering
the total bandwidth of each link. For a path with a 16 GT/s x1 link and a
2.5 GT/s x16 link, it returns 2.5 GT/s x1, which corresponds to 250 MB/s of
bandwidth, not the true available bandwidth of about 1969 MB/s for a
16 GT/s x1 link.
Use pcie_print_link_status() to report PCIe link speed and possible
limitations instead of implementing this in the driver itself. This finds
the slowest link in the path to the device by computing the total bandwidth
of each link and compares that with the capabilities of the device.
The dmesg change is:
- PCIe: Speed %s Width x%d
+ %u.%03u Gb/s available PCIe bandwidth (%s x%d link)
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
commit 707e7e96602675beb5e09bb994195663da6eb56d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 8 03:18:41 2018 -0400
bnxt_en: Always forward VF MAC address to the PF.
The current code already forwards the VF MAC address to the PF, except
in one case. If the VF driver gets a valid MAC address from the firmware
during probe time, it will not forward the MAC address to the PF,
incorrectly assuming that the PF already knows the MAC address. This
causes "ip link show" to show zero VF MAC addresses for this case.
This assumption is not correct. Newer firmware remembers the VF MAC
address last used by the VF and provides it to the VF driver during
probe. So we need to always forward the VF MAC address to the PF.
The forwarded MAC address may now be the PF assigned MAC address and so we
need to make sure we approve it for this case.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7328a23c063a9ecf56314fb9631889c1820bd0ce
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Tue May 8 03:18:40 2018 -0400
bnxt_en: Read phy eeprom A2h address only when optical diagnostics is supported.
For SFP+ modules, 0xA2 page is available only when Diagnostic Monitoring
Type [Address A0h, Byte 92] is implemented. Extend bnxt_get_module_info(),
to read optical diagnostics support at offset 92(0x5c) and set eeprom_len
length to ETH_MODULE_SFF_8436_LEN (to exclude A2 page), if dianostics is
not supported.
Also in bnxt_get_module_info(), module id is read from offset 0x5e which
is not correct. It was working by accident, as offset was not effective
without setting enables flag in the firmware request. SFP module id is
present at location 0. Fix this by removing the offset and read it
from location 0.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dac0490718bd17df5e3995ffca14255e5f9ed22d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 8 03:18:39 2018 -0400
bnxt_en: Check unsupported speeds in bnxt_update_link() on PF only.
Only non-NPAR PFs need to actively check and manage unsupported link
speeds. NPAR functions and VFs do not control the link speed and
should skip the unsupported speed detection logic, to avoid warning
messages from firmware rejecting the unsupported firmware calls.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cc559c1ac250a6025bd4a9528e424b8da250655b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 8 03:18:38 2018 -0400
bnxt_en: Fix firmware message delay loop regression.
A recent change to reduce delay granularity waiting for firmware
reponse has caused a regression. With a tighter delay loop,
the driver may see the beginning part of the response faster.
The original 5 usec delay to wait for the rest of the message
is not long enough and some messages are detected as invalid.
Increase the maximum wait time from 5 usec to 20 usec. Also, fix
the debug message that shows the total delay time for the response
when the message times out. With the new logic, the delay time
is not fixed per iteration of the loop, so we define a macro to
show the total delay time.
Fixes: 9751e8e71487 ("bnxt_en: reduce timeout on initial HWRM calls")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 47558acd56a74c1ac598093930a5559270bf8c09
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:44 2018 -0400
bnxt_en: Reserve rings at driver open if none was reserved at probe time.
Add logic to reserve default rings at driver open time if none was
reserved during probe time. This will happen when the PF driver did
not provision minimum rings to the VF, due to more limited resources.
Driver open will only succeed if some minimum rings can be reserved.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 86c3380d9b1e2a3fcc87d34cea12991b81032b9f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:43 2018 -0400
bnxt_en: Reserve RSS and L2 contexts for VF.
For completeness and correctness, the VF driver needs to reserve these
RSS and L2 contexts.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2773dfb201e18722265c38dacdea6ecadf933064
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:42 2018 -0400
bnxt_en: Don't reserve rings on VF when min rings were not provisioned by PF.
When rings are more limited and the PF has not provisioned minimum
guaranteed rings to the VF, do not reserve rings during driver probe.
Wait till device open before reserving rings when they will be used.
Device open will succeed if some minimum rings can be successfully
reserved and allocated.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d8c09f19accb89fc08b246339abb005455e4c846
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:41 2018 -0400
bnxt_en: Reserve rings in bnxt_set_channels() if device is down.
The current code does not reserve rings during ethtool -L when the device
is down. The rings will be reserved when the device is later opened.
Change it to reserve rings during ethtool -L when the device is down.
This provides a better guarantee that the device open will be successful
when the rings are reserved ahead of time.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cabfb09d87bd7980cb4e39bd2ce679a788eb7e7a
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Thu Apr 26 17:44:40 2018 -0400
bnxt_en: add debugfs support for DIM
This adds debugfs support for bnxt_en with the purpose of allowing users
to examine the current DIM profile in use for each receive queue. This
was instrumental in debugging issues found with DIM and ensuring that
the profiles we expect to use are the profiles being used.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9751e8e714872aa650b030e52a9fafbb694a3714
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Thu Apr 26 17:44:39 2018 -0400
bnxt_en: reduce timeout on initial HWRM calls
Testing with DIM enabled on older kernels indicated that firmware calls
were slower than expected. More detailed analysis indicated that the
default 25us delay was higher than necessary. Reducing the time spend in
usleep_range() for the first several calls would reduce the overall
latency of firmware calls on newer Intel processors.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 05abe4ddf0010e15419f5a6758b5bf44b7790982
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Thu Apr 26 17:44:38 2018 -0400
bnxt_en: Increase RING_IDLE minimum threshold to 50
This keeps the RING_IDLE flag set in hardware for higher coalesce
settings by default and improved latency.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4cebbaca12514986039b2ac7d30e36ecd2222f64
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:37 2018 -0400
bnxt_en: Do not allow VF to read EEPROM.
Firmware does not allow the operation and would return failure, causing
a warning in dmesg. So check for VF and disallow it in the driver.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 20c1d28e106c0b526ae015fcac8e1e254bff091c
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Apr 26 17:44:36 2018 -0400
bnxt_en: Display function level rx/tx_discard_pkts via ethtool
Add counters to display sum of rx/tx_discard_pkts of all rings as
function level statistics via ethtool.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2727c888f2f8bef071e9a07d6e2f018840d0a834
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:35 2018 -0400
bnxt_en: Simplify ring alloc/free error messages.
Replace switch statements printing different messages for every ring type
with a common message.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ca2c39e2ec04e78ca6eb5162621cb9a5b897ca16
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:34 2018 -0400
bnxt_en: Do not set firmware time from VF driver on older firmware.
Older firmware will reject this call and cause an error message to
be printed by the VF driver.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 59895f596b13b4b09f739bf8470a5028a5ff2b9a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:33 2018 -0400
bnxt_en: Check the lengths of encapsulated firmware responses.
Firmware messages that are forwarded from PF to VFs are encapsulated.
The size of these encapsulated messages must not exceed the maximum
defined message size. Add appropriate checks to avoid oversize
messages. Firmware messages may be expanded in future specs and
this will provide some guardrails to avoid data corruption.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d31cd579a45c44ede9e56c2f6d33537ba395a49b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:32 2018 -0400
bnxt_en: Remap TC to hardware queues when configuring PFC.
Initially, the MQPRIO TCs are mapped 1:1 directly to the hardware
queues. Some of these hardware queues are configured to be lossless.
When PFC is enabled on one of more TCs, we now need to remap the
TCs that have PFC enabled to the lossless hardware queues.
After remapping, we need to close and open the NIC for the new
mapping to take effect. We also need to reprogram all ETS parameters.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2e8ef77ee0ff1117251a48f79d2d57d65afd0495
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Apr 26 17:44:31 2018 -0400
bnxt_en: Add TC to hardware QoS queue mapping logic.
The current driver maps MQPRIO traffic classes directly 1:1 to the
internal hardware queues (TC0 maps to hardware queue 0, etc). This
direct mapping requires the internal hardware queues to be reconfigured
from lossless to lossy and vice versa when necessary. This
involves reconfiguring internal buffer thresholds which is
disruptive and not always reliable.
Implement a new scheme to map TCs to internal hardware queues by
matching up their PFC requirements. This will eliminate the need
to reconfigure a hardware queue internal buffers at run time. After
remapping, the NIC is closed and opened for the new TC to hardware
queues to take effect.
This patch only adds the basic mapping logic.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 026a807c2de37aa826748c2ffa1969fc778406b2
Author: Tal Gilboa <talgi@mellanox.com>
Date: Tue Apr 24 13:36:01 2018 +0300
net/dim: Rename *_get_profile() functions to *_get_rx_moderation()
Preparation for introducing adaptive TX to net DIM.
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a60faa60da891e311e19fd3e88d611863f431130
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Apr 19 03:16:16 2018 -0400
bnxt_en: Fix memory fault in bnxt_ethtool_init()
In some firmware images, the length of BNX_DIR_TYPE_PKG_LOG nvram type
could be greater than the fixed buffer length of 4096 bytes allocated by
the driver. This was causing HWRM_NVM_READ to copy more data to the buffer
than the allocated size, causing general protection fault.
Fix the issue by allocating the exact buffer length returned by
HWRM_NVM_FIND_DIR_ENTRY, instead of 4096. Move the kzalloc() call
into the bnxt_get_pkgver() function.
Fixes: 3ebf6f0a09a2 ("bnxt_en: Add installed-package firmware version reporting via Ethtool GDRVINFO")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b968e735c79767a3c91217fbae691581aa557d8d
Author: Nikita V. Shirokov <tehnerd@tehnerd.com>
Date: Tue Apr 17 21:42:16 2018 -0700
bpf: make bnxt compatible w/ bpf_xdp_adjust_tail
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as
well (only "decrease" of pointer's location is going to be supported).
changing of this pointer will change packet's size.
for bnxt driver we will just calculate packet's length unconditionally
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Nikita V. Shirokov <tehnerd@tehnerd.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
commit cb98526bf9b985866d648dbb9c983ba9eb59daba
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Apr 11 11:50:18 2018 -0400
bnxt_en: Fix NULL pointer dereference at bnxt_free_irq().
When open fails during ethtool -L ring change, for example, the driver
may crash at bnxt_free_irq() because bp->bnapi is NULL.
If we fail to allocate all the new rings, bnxt_open_nic() will free
all the memory including bp->bnapi. Subsequent call to bnxt_close_nic()
will try to dereference bp->bnapi in bnxt_free_irq().
Fix it by checking for !bp->bnapi in bnxt_free_irq().
Fixes: e5811b8c09df ("bnxt_en: Add IRQ remapping logic.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 11c3ec7bb940b6fa3f87f05f01b7f45eef08dfbb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Apr 11 11:50:17 2018 -0400
bnxt_en: Need to include RDMA rings in bnxt_check_rings().
With recent changes to reserve both L2 and RDMA rings, we need to include
the RDMA rings in bnxt_check_rings(). Otherwise we will under-estimate
the rings we need during ethtool -L and may lead to failure.
Fixes: fbcfc8e46741 ("bnxt_en: Reserve completion rings and MSIX for bnxt_re RDMA driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9d96465b111edd6c4f94345783e6e01db7f435d6
Author: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Date: Wed Apr 11 11:50:16 2018 -0400
bnxt_en: Support max-mtu with VF-reps
While a VF is configured with a bigger mtu (> 1500), any packets that
are punted to the VF-rep (slow-path) get dropped by OVS kernel-datapath
with the following message: "dropped over-mtu packet". Fix this by
returning the max-mtu value for a VF-rep derived from its corresponding VF.
VF-rep's mtu can be changed using 'ip' command as shown in this example:
$ ip link set bnxt0_pf0vf0 mtu 9000
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 479ca3bf91da971fcefc003cf5773e8d7db24794
Author: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Date: Wed Apr 11 11:50:15 2018 -0400
bnxt_en: Ignore src port field in decap filter nodes
The driver currently uses src port field (along with other fields) in the
decap tunnel key, while looking up and adding tunnel nodes. This leads to
redundant cfa_decap_filter_alloc() requests to the FW and flow-miss in the
flow engine. Fix this by ignoring the src port field in decap tunnel nodes.
Fixes: f484f6782e01 ("bnxt_en: add hwrm FW cmds for cfa_encap_record and decap_filter")
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e85a9be93cf144623a823a0a60e4eda6ee337aef
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Wed Apr 11 11:50:14 2018 -0400
bnxt_en: do not allow wildcard matches for L2 flows
Before this patch the following commands would succeed as far as the
user was concerned:
$ tc qdisc add dev p1p1 ingress
$ tc filter add dev p1p1 parent ffff: protocol all \
flower skip_sw action drop
$ tc filter add dev p1p1 parent ffff: protocol ipv4 \
flower skip_sw src_mac 00:02:00:00:00:01/44 action drop
The current flow offload infrastructure used does not support wildcard
matching for ethernet headers, so do not allow the second or third
commands to succeed. If a user wants to drop traffic on that interface
the protocol and MAC addresses need to be specified explicitly:
$ tc qdisc add dev p1p1 ingress
$ tc filter add dev p1p1 parent ffff: protocol arp \
flower skip_sw action drop
$ tc filter add dev p1p1 parent ffff: protocol ipv4 \
flower skip_sw action drop
...
$ tc filter add dev p1p1 parent ffff: protocol ipv4 \
flower skip_sw src_mac 00:02:00:00:00:01 action drop
$ tc filter add dev p1p1 parent ffff: protocol ipv4 \
flower skip_sw src_mac 00:02:00:00:00:02 action drop
...
There are also checks for VLAN parameters in this patch as other callers
may wildcard those parameters even if tc does not. Using different
flow infrastructure could allow this to work in the future for L2 flows,
but for now it does not.
Fixes: 2ae7408fedfe ("bnxt_en: bnxt: add TC flower filter offload support")
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7991cb9cfbce1b60ac1cff819350b05de4d902e1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Apr 11 11:50:13 2018 -0400
bnxt_en: Fix ethtool -x crash when device is down.
Fix ethtool .get_rxfh() crash by checking for valid indirection table
address before copying the data.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ec86f14ea5064e36ee111297bdb376dda4cba264
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:21 2018 -0400
bnxt_en: Add ULP calls to stop and restart IRQs.
When the driver needs to re-initailize the IRQ vectors, we make the
new ulp_irq_stop() call to tell the RDMA driver to disable and free
the IRQ vectors. After IRQ vectors have been re-initailized, we
make the ulp_irq_restart() call to tell the RDMA driver that
IRQs can be restarted.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fbcfc8e4674156cb7eb3d8054bd4332142d2cc58
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:20 2018 -0400
bnxt_en: Reserve completion rings and MSIX for bnxt_re RDMA driver.
Add additional logic to reserve completion rings for the bnxt_re driver
when it requests MSIX vectors. The function bnxt_cp_rings_in_use()
will return the total number of completion rings used by both drivers
that need to be reserved. If the network interface in up, we will
close and open the NIC to reserve the new set of completion rings and
re-initialize the vectors.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4e41dc5deb6e5c36ac5f2e49575485920037b2aa
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:19 2018 -0400
bnxt_en: Refactor bnxt_need_reserve_rings().
Refactor bnxt_need_reserve_rings() slightly so that __bnxt_reserve_rings()
can call it and remove some duplicated code.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e5811b8c09df9bc80eabc95339fceded23f16289
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:18 2018 -0400
bnxt_en: Add IRQ remapping logic.
Add remapping logic so that bnxt_en can use any arbitrary MSIX vectors.
This will allow the driver to reserve one range of MSIX vectors to be
used by both bnxt_en and bnxt_re. bnxt_en can now skip over the MSIX
vectors used by bnxt_re.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 08654eb213a8066b30c41e22067a9f066b40c80f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:17 2018 -0400
bnxt_en: Change IRQ assignment for RDMA driver.
In the current code, the range of MSIX vectors allocated for the RDMA
driver is disjoint from the network driver. This creates a problem
for the new firmware ring reservation scheme. The new scheme requires
the reserved completion rings/MSIX vectors to be in a contiguous
range.
Change the logic to allocate RDMA MSIX vectors to be contiguous with
the vectors used by bnxt_en on new firmware using the new scheme.
The new function bnxt_get_num_msix() calculates the exact number of
vectors needed by both drivers.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9899bb59ff08a50aef033b4d388d223adca58a7f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:16 2018 -0400
bnxt_en: Improve ring allocation logic.
Currently, the driver code makes some assumptions about the group index
and the map index of rings. This makes the code more difficult to
understand and less flexible.
Improve it by adding the grp_idx and map_idx fields explicitly to the
bnxt_ring_struct as a union. The grp_idx is initialized for each tx ring
and rx agg ring during init. time. We do the same for the map_idx for
each cmpl ring.
The grp_idx ties the tx ring to the ring group. The map_idx is the
doorbell index of the ring. With this new infrastructure, we can change
the ring index mapping scheme easily in the future.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 845adfe40c2a75e67ddae6639fc2b987338b7983
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:15 2018 -0400
bnxt_en: Improve valid bit checking in firmware response message.
When firmware sends a DMA response to the driver, the last byte of the
message will be set to 1 to indicate that the whole response is valid.
The driver waits for the message to be valid before reading the message.
The firmware spec allows these response messages to increase in
length by adding new fields to the end of these messages. The
older spec's valid location may become a new field in a newer
spec. To guarantee compatibility, the driver should zero the valid
byte before interpreting the entire message so that any new fields not
implemented by the older spec will be read as zero.
For messages that are forwarded to VFs, we need to set the length
and re-instate the valid bit so the VF will see the valid response.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 596f9d55feebdf31c03172fcc82cdec62bb969ea
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:14 2018 -0400
bnxt_en: Improve resource accounting for SRIOV.
When VFs are created, the current code subtracts the maximum VF
resources from the PF's pool. This under-estimates the resources
remaining in the PF pool. Instead, we should subtract the minimum
VF resources. The VF minimum resources are guaranteed to the VFs
and only these should be subtracted from the PF's pool.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit db4723b3cd2d836ae44382d16e6a4418ae8929dc
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:13 2018 -0400
bnxt_en: Check max_tx_scheduler_inputs value from firmware.
When checking for the maximum pre-set TX channels for ethtool -l, we
need to check the current max_tx_scheduler_inputs parameter from firmware.
This parameter specifies the max input for the internal QoS nodes currently
available to this function. The function's TX rings will be capped by this
parameter. By adding this logic, we provide a more accurate pre-set max
TX channels to the user.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 00db3cba35211cd7d458d378a5931fadfa86a17c
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Mar 31 13:54:12 2018 -0400
bnxt_en: Add extended port statistics support
Gather periodic extended port statistics, if the device is PF and
link is up.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 699efed00df0631e39a639b49e3b8e27e62e6c89
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Mar 31 13:54:11 2018 -0400
bnxt_en: Include additional hardware port statistics in ethtool -S.
Include additional hardware port statistics in ethtool -S, which
are useful for debugging.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 746df139646ea7fd11c26f88fd95a247d2a7c94b
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Sat Mar 31 13:54:10 2018 -0400
bnxt_en: Add support for ndo_set_vf_trust
Trusted VFs are allowed to modify MAC address, even when PF
has assigned one.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2373d8d6a7932d28b8e31ea2a70bf6c002d97ac8
Author: Scott Branden <scott.branden@broadcom.com>
Date: Sat Mar 31 13:54:09 2018 -0400
bnxt_en: fix clear flags in ethtool reset handling
Clear flags when reset command processed successfully for components
specified.
Fixes: 6502ad5963a5 ("bnxt_en: Add ETH_RESET_AP support")
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit abe93ad2e06e3c16562b5de2787e7442fa088895
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:08 2018 -0400
bnxt_en: Use a dedicated VNIC mode for RDMA.
If the RDMA driver is registered, use a new VNIC mode that allows
RDMA traffic to be seen on the netdev in promiscuous mode.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1d3ef13dd48da9177e417379644be9003bc459cc
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:07 2018 -0400
bnxt_en: Adjust default rings for multi-port NICs.
Change the default ring logic to select default number of rings to be up to
8 per port if the default rings x NIC ports <= total CPUs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d4f52de02f04f0a7dfcb1d0228a2ff58b06aa230
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Mar 31 13:54:06 2018 -0400
bnxt_en: Update firmware interface to 1.9.1.15.
Minor changes, such as new extended port statistics.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fd141fa47c03018aa1f77c335b0f444493e145d5
Author: Sinan Kaya <okaya@codeaurora.org>
Date: Sun Mar 25 10:39:20 2018 -0400
bnxt_en: Eliminate duplicate barriers on weakly-ordered archs
Code includes wmb() followed by writel(). writel() already has a barrier on
some architectures like arm64.
This ends up CPU observing two barriers back to back before executing the
register write.
Create a new wrapper function with relaxed write operator. Use the new
wrapper when a write is following a wmb().
Since code already has an explicit barrier call, changing writel() to
writel_relaxed().
Also add mmiowb() so that write code doesn't move outside of scope.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3c4fe80b32c685bdc02b280814d0cfe80d441c72
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Mar 9 23:46:10 2018 -0500
bnxt_en: Check valid VNIC ID in bnxt_hwrm_vnic_set_tpa().
During initialization, if we encounter errors, there is a code path that
calls bnxt_hwrm_vnic_set_tpa() with invalid VNIC ID. This may cause a
warning in firmware logs.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1a037782e79047ec3386d8ba94c103cbdfb851d0
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Fri Mar 9 23:46:09 2018 -0500
bnxt_en: close & open NIC, only when the interface is in running state.
bnxt_restore_pf_fw_resources routine frees PF resources by calling
close_nic and allocates the resources back, by doing open_nic. However,
this is not needed, if the PF is already in closed state.
This bug causes the driver to call open the device and call request_irq()
when it is not needed. Ultimately, pci_disable_msix() will crash
when bnxt_en is unloaded.
This patch fixes the problem by skipping __bnxt_close_nic and
__bnxt_open_nic inside bnxt_restore_pf_fw_resources routine, if the
interface is not running.
Fixes: 80fcaf46c092 ("bnxt_en: Restore MSIX after disabling SRIOV.")
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6ae777eab2f53b50d84a5d75a48d2d149f787da8
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Fri Mar 9 23:46:08 2018 -0500
bnxt_en: Return standard Linux error codes for hwrm flow cmds.
Currently, internal error value is returned by the driver, when
hwrm_cfa_flow_alloc() fails due lack of resources. We should be returning
Linux errno value -ENOSPC instead.
This patch also converts other similar command errors to standard Linux errno
code (-EIO) in bnxt_tc.c
Fixes: db1d36a27324 ("bnxt_en: add TC flower offload flow_alloc/free FW cmds")
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 832aed16ce7af2a43dafe9d4bc9080322e042cde
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Mar 9 23:46:07 2018 -0500
bnxt_en: Fix regressions when setting up MQPRIO TX rings.
Recent changes added the bnxt_init_int_mode() call in the driver's open
path whenever ring reservations are changed. This call was previously
only called in the probe path. In the open path, if MQPRIO TC has been
setup, the bnxt_init_int_mode() call would reset and mess up the MQPRIO
per TC rings.
Fix it by not re-initilizing bp->tx_nr_rings_per_tc in
bnxt_init_int_mode(). Instead, initialize it in the probe path only
after the bnxt_init_int_mode() call.
Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ed7bc602f60a653e5dea488e6917d9a75d6ac0dd
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Mar 9 23:46:06 2018 -0500
bnxt_en: Pass complete VLAN TCI to the stack.
When receiving a packet with VLAN tag, pass the entire 16-bit TCI to the
stack when calling __vlan_hwaccel_put_tag(). The current code is only
passing the 12-bit tag and it is missing the priority bits.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b9ecc3400bc418af3ba9e56ea852f4ad69c23454
Author: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Date: Fri Mar 9 23:46:05 2018 -0500
bnxt_en: Remove unwanted ovs-offload messages in some conditions
In some conditions when the driver fails to add a flow in HW and returns
an error back to the stack, the stack continues to invoke get_flow_stats()
and/or del_flow() on it. The driver fails these APIs with an error message
"no flow_node for cookie". The message gets logged repeatedly as long as
the stack keeps invoking these functions.
Fix this by removing the corresponding netdev_info() calls from these
functions.
Fixes: d7bc73053024 ("bnxt_en: add code to query TC flower offload stats")
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6fc2ffdf1001ae4fb485b3ba95ff757ae54565c9
Author: Eddie Wai <eddie.wai@broadcom.com>
Date: Fri Mar 9 23:46:04 2018 -0500
bnxt_en: Fix vnic accounting in the bnxt_check_rings() path.
The number of vnics to check must be determined ahead of time because
only standard RX rings require vnics to support RFS. The logic is
similar to the ring reservation logic and we can now use the
refactored common functions to do most of the work in setting up
the firmware message.
Fixes: 8f23d638b36b ("bnxt_en: Expand bnxt_check_rings() to check all resources.")
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4ed50ef4da4d113fe65d9f9d049c1ce7468e3ac1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Mar 9 23:46:03 2018 -0500
bnxt_en: Refactor the functions to reserve hardware rings.
The bnxt_hwrm_reserve_{pf|vf}_rings() functions are very similar to
the bnxt_hwrm_check_{pf|vf}_rings() functions. Refactor the former
so that the latter can make use of common code in the next patch.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0bc0b97fca73fca19edd0bd1463972144b44abaa
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Jan 26 10:27:47 2018 -0500
bnxt_en: cleanup DIM work on device shutdown
Make sure to cancel any pending work that might update driver coalesce
settings when taking down an interface.
Fixes: 6a8788f25625 ("bnxt_en: add support for software dynamic interrupt moderation")
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 312324f1248b47a2640469039811a04ab2f5be34
Author: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Thu Jan 25 14:00:48 2018 -0800
bnxt: use tc_cls_can_offload_and_chain0()
Make use of tc_cls_can_offload_and_chain0() to set extack msg in case
ethtool tc offload flag is not set or chain unsupported.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dd4ea1da12495e1b3c400a28df11528892199f68
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Wed Jan 17 03:21:16 2018 -0500
bnxt_en: export a common switchdev PARENT_ID for all reps of an adapter
Currently the driver exports different switchdev PARENT_IDs for
representors belonging to different SR-IOV PF-pools of an adapter.
This is not correct as the adapter can switch across all vports
of an adapter. This patch fixes this by exporting a common switchdev
PARENT_ID for all reps of an adapter. The PCIE DSN is used as the id.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c3480a603773cfc5d8aa44dbbee6c96e0f9d4d9d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:15 2018 -0500
bnxt_en: Add cache line size setting to optimize performance.
The chip supports 64-byte and 128-byte cache line size for more optimal
DMA performance when matched to the CPU cache line size. The default is 64.
If the system is using 128-byte cache line size, set it to 128.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 91cdda40714178497cbd182261b2ea6ec5cb9276
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Wed Jan 17 03:21:14 2018 -0500
bnxt_en: Forward VF MAC address to the PF.
Forward hwrm_func_vf_cfg command from VF to PF driver, to store
VF MAC address in PF's context. This will allow "ip link show"
to display all VF MAC addresses.
Maintain 2 locations of MAC address in VF info structure, one for
a PF assigned MAC and one for VF assigned MAC.
Display VF assigned MAC in "ip link show", only if PF assigned MAC is
not valid.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 92abef361bd233ea2a99db9e9a637626f523f82e
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Wed Jan 17 03:21:13 2018 -0500
bnxt_en: Add BCM5745X NPAR device IDs
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8f23d638b36b4ff0fe5785cf01f9bdc41afb9c06
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:12 2018 -0500
bnxt_en: Expand bnxt_check_rings() to check all resources.
bnxt_check_rings() is called by ethtool, XDP setup, and ndo_setup_tc()
to see if there are enough resources to support the new configuration.
Expand the call to test all resources if the firmware supports the new
API. With the more flexible resource allocation scheme, this call must
be made to check that all resources are available before committing to
allocate the resources.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4673d66468b80dc37abd1159a4bd038128173d48
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:11 2018 -0500
bnxt_en: Implement new method for the PF to assign SRIOV resources.
Instead of the old method of evenly dividing the resources to the VFs,
use the new firmware API to specify min and max resources for each VF.
This way, there is more flexibility for each VF to allocate more or less
resources.
The min is the absolute minimum for each VF to function. The max is the
global resources minus the resources used by the PF. Each VF is
guaranteed the min. Up to max resources may be available for some VFs.
The PF driver can use one of 2 strategies specified in NVRAM to assign
the resources. The old legacy strategy of evenly dividing the resources
or the new flexible strategy.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6a1eef5b9079742ecfad647892669bd5fe6b0e3f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:10 2018 -0500
bnxt_en: Reserve resources for RFS.
In bnxt_rfs_capable(), add call to reserve vnic resources to support
NTUPLE. Return true if we can successfully reserve enough vnics.
Otherwise, reserve the minimum 1 VNIC for normal operations not
supporting NTUPLE and return false.
Also, suppress warning message about not enough resources for NTUPLE when
only 1 RX ring is in use. NTUPLE filters by definition require multiple
RX rings.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 674f50a5b026151f4109992cb594d89f5334adde
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:09 2018 -0500
bnxt_en: Implement new method to reserve rings.
The new method will call firmware to reserve the desired tx, rx, cmpl
rings, ring groups, stats context, and vnic resources. A second query
call will check the actual resources that firmware is able to reserve.
The driver will then trim and adjust based on the actual resources
provided by firmware. The driver will then reserve the final resources
in use.
This method is a more flexible way of using hardware resources. The
resources are not fixed and can by adjusted by firmware. The driver
adapts to the available resources that the firmware can reserve for
the driver.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 58ea801ac4c166cdcaa399ce7f9b3e9095ff2842
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:08 2018 -0500
bnxt_en: Set initial default RX and TX ring numbers the same in combined mode.
In combined mode, the driver is currently not setting RX and TX ring
numbers the same when firmware can allocate more RX than TX or vice versa.
This will confuse the user as the ethtool convention assumes they are the
same in combined mode. Fix it by adding bnxt_trim_dflt_sh_rings() to trim
RX and TX ring numbers to be the same as the completion ring number in
combined mode.
Note that if TCs are enabled and/or XDP is enabled, the number of TX rings
will not be the same as RX rings in combined mode.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit be0dd9c4100c9549fe50258e3d928072e6c31590
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:07 2018 -0500
bnxt_en: Add the new firmware API to query hardware resources.
The new API HWRM_FUNC_RESOURCE_QCAPS provides min and max hardware
resources. Use the new API when it is supported by firmware.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6a4f29470569c5a158c1871a2f752ca22e433420
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:06 2018 -0500
bnxt_en: Refactor hardware resource data structures.
In preparation for new firmware APIs to allocate hardware resources,
add a new struct bnxt_hw_resc to hold various min, max and reserved
resources. This new structure is common for PFs and VFs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 80fcaf46c09262a71f32bb577c976814c922f864
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:05 2018 -0500
bnxt_en: Restore MSIX after disabling SRIOV.
After SRIOV has been enabled and disabled, the MSIX vectors assigned to
the VFs have to be re-initialized. Otherwise they cannot be re-used by
the PF. For example, increasing the number of PF rings after disabling
SRIOV may fail if the PF uses MSIX vectors previously assigned to the VFs.
To fix this, we add logic in bnxt_restore_pf_fw_resources() to close the
NIC, clear and re-init MSIX, and re-open the NIC.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 86e953db0114f396f916344395160aa267bf2627
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:04 2018 -0500
bnxt_en: Refactor bnxt_close_nic().
Add a new __bnxt_close_nic() function to do all the work previously done
in bnxt_close_nic() except waiting for SRIOV configuration. The new
function will be used in the next patch as part of SRIOV cleanup.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 894aa69a90932907f3de9d849ab9970884151d0e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 17 03:21:03 2018 -0500
bnxt_en: Update firmware interface to 1.9.0.
The version has new firmware APIs to allocate PF/VF resources more
flexibly.
New toolchains were used to generate this file, resulting in a one-time
large diffstat.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e7e70fa6784b48a811fdd4253c41fc7195300570
Author: Colin Ian King <colin.king@canonical.com>
Date: Tue Jan 16 10:22:50 2018 +0000
bnxt_en: don't update cpr->rx_bytes with uninitialized length len
Currently in the cases where cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP or
CMP_TYPE_RX_L2_TPA_END_CMP the exit path updates cpr->rx_bytes with an
uninitialized length len. Fix this by adding a new exit path that does
not update the cpr stats with the bogus length len and remove the unused
label next_rx_no_prod.
Detected by CoverityScan, CID#1463807 ("Uninitialized scalar variable")
Fixes: 6a8788f25625 ("bnxt_en: add support for software dynamic interrupt moderation")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6a8788f25625eab31ffa624da2db758ecae6151d
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Tue Jan 9 16:06:20 2018 -0500
bnxt_en: add support for software dynamic interrupt moderation
This implements the changes needed for the bnxt_en driver to add support
for dynamic interrupt moderation per ring.
This does add additional counters in the receive path, but testing shows
that any additional instructions are offset by throughput gain when the
default configuration is for low latency.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 78f300049335ae81a5cc6b4b232481dc5e1f9d41
Author: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Thu Jan 4 18:46:55 2018 -0500
bnxt_en: Fix the 'Invalid VF' id check in bnxt_vf_ndo_prep routine.
In bnxt_vf_ndo_prep (which is called by bnxt_get_vf_config ndo), there is a
check for "Invalid VF id". Currently, the check is done against max_vfs.
However, the user doesn't always create max_vfs. So, the check should be
against the created number of VFs. The number of bnxt_vf_info structures
that are allocated in bnxt_alloc_vf_resources routine is the "number of
requested VFs". So, if an "invalid VF id" falls between the requested
number of VFs and the max_vfs, the driver will be dereferencing an invalid
pointer.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Venkat Devvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7deea450eb912f269d999de62c8ab922d1461748
Author: Sunil Challa <sunilkumar.challa@broadcom.com>
Date: Thu Jan 4 18:46:54 2018 -0500
bnxt_en: Fix population of flow_type in bnxt_hwrm_cfa_flow_alloc()
flow_type in HWRM_FLOW_ALLOC is not being populated correctly due to
incorrect passing of pointer and size of l3_mask argument of is_wildcard().
Fixed this.
Fixes: db1d36a27324 ("bnxt_en: add TC flower offload flow_alloc/free FW cmds")
Signed-off-by: Sunil Challa <sunilkumar.challa@broadcom.com>
Reviewed-by: Sathya Perla <sathya.perla@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 96a8604f95fa216b9ddfd15c687eed42a2f56901
Author: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Wed Jan 3 11:25:44 2018 +0100
bnxt_en: setup xdp_rxq_info
Driver hook points for xdp_rxq_info:
* reg : bnxt_alloc_rx_rings
* unreg: bnxt_free_rx_rings
This driver should be updated to re-register when changing
allocation mode of RX rings.
Tested on actual hardware.
Cc: Andy Gospodarek <andy@greyhouse.net>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
commit aa006d1ad0a58f5dad0065b25263a73365319996
Author: Himanshu Jha <himanshujha199640@gmail.com>
Date: Sat Dec 30 21:14:57 2017 +0530
ethernet/broadcom: Use zeroing memory allocator than allocator/memset
Use dma_zalloc_coherent for allocating zeroed
memory and remove unnecessary memset function.
Done using Coccinelle.
Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci
0-day tested with no failures.
Suggested-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1054aee82321483dceabbb9b9e5d6512e8fe684b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Dec 16 03:09:42 2017 -0500
bnxt_en: Use NETIF_F_GRO_HW.
Advertise NETIF_F_GRO_HW in hw_features if hardware GRO is supported.
In bnxt_fix_features(), disable GRO_HW and LRO if current hardware
configuration does not allow it. GRO_HW depends on GRO. GRO_HW is
also mutually exclusive with LRO. XDP setup will now rely on
bnxt_fix_features() to turn off aggregation. During chip init, turn on
or off hardware GRO based on NETIF_F_GRO_HW in features flag.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 97a6ec4ac021f7fbec05c15a3aa0c4aaf0461af5
Author: Tom Herbert <tom@quantonium.net>
Date: Mon Dec 4 10:31:41 2017 -0800
rhashtable: Change rhashtable_walk_start to return void
Most callers of rhashtable_walk_start don't care about a resize event
which is indicated by a return value of -EAGAIN. So calls to
rhashtable_walk_start are wrapped wih code to ignore -EAGAIN. Something
like this is common:
ret = rhashtable_walk_start(rhiter);
if (ret && ret != -EAGAIN)
goto out;
Since zero and -EAGAIN are the only possible return values from the
function this check is pointless. The condition never evaluates to true.
This patch changes rhashtable_walk_start to return void. This simplifies
code for the callers that ignore -EAGAIN. For the few cases where the
caller cares about the resize event, particularly where the table can be
walked in mulitple parts for netlink or seq file dump, the function
rhashtable_walk_start_check has been added that returns -EAGAIN on a
resize event.
Signed-off-by: Tom Herbert <tom@quantonium.net>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2edbdb3159d6f6bd3a9b6e7f789f2b879699a519
Author: Calvin Owens <calvinowens@fb.com>
Date: Fri Dec 8 09:05:26 2017 -0800
bnxt_en: Fix sources of spurious netpoll warnings
After applying 2270bc5da3497945 ("bnxt_en: Fix netpoll handling") and
903649e718f80da2 ("bnxt_en: Improve -ENOMEM logic in NAPI poll loop."),
we still see the following WARN fire:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1875170 at net/core/netpoll.c:165 netpoll_poll_dev+0x15a/0x160
bnxt_poll+0x0/0xd0 exceeded budget in poll
<snip>
Call Trace:
[<ffffffff814be5cd>] dump_stack+0x4d/0x70
[<ffffffff8107e013>] __warn+0xd3/0xf0
[<ffffffff8107e07f>] warn_slowpath_fmt+0x4f/0x60
[<ffffffff8179519a>] netpoll_poll_dev+0x15a/0x160
[<ffffffff81795f38>] netpoll_send_skb_on_dev+0x168/0x250
[<ffffffff817962fc>] netpoll_send_udp+0x2dc/0x440
[<ffffffff815fa9be>] write_ext_msg+0x20e/0x250
[<ffffffff810c8125>] call_console_drivers.constprop.23+0xa5/0x110
[<ffffffff810c9549>] console_unlock+0x339/0x5b0
[<ffffffff810c9a88>] vprintk_emit+0x2c8/0x450
[<ffffffff810c9d5f>] vprintk_default+0x1f/0x30
[<ffffffff81173df5>] printk+0x48/0x50
[<ffffffffa0197713>] edac_raw_mc_handle_error+0x563/0x5c0 [edac_core]
[<ffffffffa0197b9b>] edac_mc_handle_error+0x42b/0x6e0 [edac_core]
[<ffffffffa01c3a60>] sbridge_mce_output_error+0x410/0x10d0 [sb_edac]
[<ffffffffa01c47cc>] sbridge_check_error+0xac/0x130 [sb_edac]
[<ffffffffa0197f3c>] edac_mc_workq_function+0x3c/0x90 [edac_core]
[<ffffffff81095f8b>] process_one_work+0x19b/0x480
[<ffffffff810967ca>] worker_thread+0x6a/0x520
[<ffffffff8109c7c4>] kthread+0xe4/0x100
[<ffffffff81884c52>] ret_from_fork+0x22/0x40
This happens because we increment rx_pkts on -ENOMEM and -EIO, resulting
in rx_pkts > 0. Fix this by only bumping rx_pkts if we were actually
given a non-zero budget.
Signed-off-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a8168b6cee6e9334dfebb4b9108e8d73794f6088
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 6 17:31:22 2017 -0500
bnxt_en: Don't print "Link speed -1 no longer supported" messages.
On some dual port NICs, the 2 ports have to be configured with compatible
link speeds. Under some conditions, a port's configured speed may no
longer be supported. The firmware will send a message to the driver
when this happens.
Improve this logic that prints out the warning by only printing it if
we can determine the link speed that is no longer supported. If the
speed is unknown or it is in autoneg mode, skip the warning message.
Reported-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9f8a739e72f1546fb0f8c518af1193522c45be12
Author: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue Dec 5 16:17:26 2017 -0800
act_mirred: get rid of tcfm_ifindex from struct tcf_mirred
tcfm_dev always points to the correct netdev and we already
hold a refcnt, so no need to use tcfm_ifindex to lookup again.
If we would support moving target netdev across netns, using
pointer would be better than ifindex.
This also fixes dumping obsolete ifindex, now after the
target device is gone we just dump 0 as ifindex.
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 92425c40676d498efccae6fecdb8f8e4dcf7e4a4
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue Dec 5 17:37:52 2017 +0300
bnxt_en: Uninitialized variable in bnxt_tc_parse_actions()
Smatch warns that:
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c:160 bnxt_tc_parse_actions()
error: uninitialized symbol 'rc'.
"rc" is either uninitialized or set to zero here so we can just remove
the check.
Fixes: 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ebd5818cc5d4847897d7fe872e2d9799d7b7fcbb
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Dec 1 03:13:05 2017 -0500
bnxt_en: Fix a variable scoping in bnxt_hwrm_do_send_msg()
short_input variable is assigned to another data pointer which is
referred out of its scope. Fix it by moving short_input definition
to the beginning of bnxt_hwrm_do_send_msg() function.
No failure has been reported so far due to this issue.
Fixes: e605db801bde ("bnxt_en: Support for Short Firmware Message")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e9ecc731a87912d209d6e9b4ed20ed70451c08cb
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Fri Dec 1 03:13:04 2017 -0500
bnxt_en: fix dst/src fid for vxlan encap/decap actions
For flows that involve a vxlan encap action, the vxlan sock
interface may be specified as the outgoing interface. The driver
must resolve the outgoing PF interface used by this socket and
use the dst_fid of the PF in the hwrm_cfa_encap_record_alloc cmd.
Similarily for flows that have a vxlan decap action, the
fid of the incoming PF interface must be used as the src_fid in
the hwrm_cfa_decap_filter_alloc cmd.
Fixes: 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c8fb7b8259c67b86cd93a71c85e78b34d2c96fdc
Author: Sunil Challa <sunilkumar.challa@broadcom.com>
Date: Fri Dec 1 03:13:03 2017 -0500
bnxt_en: wildcard smac while creating tunnel decap filter
While creating a decap filter the tunnel smac need not (and must not) be
specified as we cannot ascertain the neighbor in the recv path. 'ttl'
match is also not needed for the decap filter and must be wild-carded.
Fixes: f484f6782e01 ("bnxt_en: add hwrm FW cmds for cfa_encap_record and decap_filter")
Signed-off-by: Sunil Challa <sunilkumar.challa@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a7f3f939dd7d8398acebecd1ceb2e9e7ffbe91d2
Author: Ray Jui <ray.jui@broadcom.com>
Date: Fri Dec 1 03:13:02 2017 -0500
bnxt_en: Need to unconditionally shut down RoCE in bnxt_shutdown
The current 'bnxt_shutdown' implementation only invokes
'bnxt_ulp_shutdown' to shut down RoCE in the case when the system is in
the path of power off (SYSTEM_POWER_OFF). While this may work in most
cases, it does not work in the smart NIC case, when Linux 'reboot'
command is initiated from the Linux that runs on the ARM cores of the
NIC card. In this particular case, Linux 'reboot' results in a system
'L3' level reset where the entire ARM and associated subsystems are
being reset, but at the same time, Nitro core is being kept in sane state
(to allow external PCIe connected servers to continue to work). Without
properly shutting down RoCE and freeing all associated resources, it
results in the ARM core to hang immediately after the 'reboot'
By always invoking 'bnxt_ulp_shutdown' in 'bnxt_shutdown', it fixes the
above issue
Fixes: 0efd2fc65c92 ("bnxt_en: Add a callback to inform RDMA driver during PCI shutdown.")
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bd0b2e7fe611953470ec7c533b455fb2abd382cd
Author: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Fri Dec 1 15:08:57 2017 -0800
net: xdp: make the stack take care of the tear down
Since day one of XDP drivers had to remember to free the program
on the remove path. This leads to code duplication and is error
prone. Make the stack query the installed programs on unregister
and if something is installed, remove the program. Freeing of
program attached to XDP generic is moved from free_netdev() as well.
Because the remove will now be called before notifiers are
invoked, BPF offload state of the program will not get destroyed
before uninstall.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
commit 6502ad5963a5307089bed395f63173e34cb251ea
Author: Scott Branden <scott.branden@broadcom.com>
Date: Thu Nov 30 11:36:00 2017 -0800
bnxt_en: Add ETH_RESET_AP support
Add ETH_RESET_AP support handling to reset the internal
Application Processor(s) of the SmartNIC card.
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dea521a2b9f96e905fa2bb2f95e23ec00c2ec436
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Tue Nov 21 20:46:49 2017 +0100
bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()'
Error code returned by 'bnxt_read_sfp_module_eeprom_info()' is handled a
few lines above when reading the A0 portion of the EEPROM.
The same should be done when reading the A2 portion of the EEPROM.
In order to correctly propagate an error, update 'rc' in this 2nd call as
well, otherwise 0 (success) is returned.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e99e88a9d2b067465adaa9c111ada99a041bef9a
Author: Kees Cook <keescook@chromium.org>
Date: Mon Oct 16 14:43:17 2017 -0700
treewide: setup_timer() -> timer_setup()
This converts all remaining cases of the old setup_timer() API into using
timer_setup(), where the callback argument is the structure already
holding the struct timer_list. These should have no behavioral changes,
since they just change which pointer is passed into the callback with
the same available pointers after conversion. It handles the following
examples, in addition to some other variations.
Casting from unsigned long:
void my_callback(unsigned long data)
{
struct something *ptr = (struct something *)data;
...
}
...
setup_timer(&ptr->my_timer, my_callback, ptr);
and forced object casts:
void my_callback(struct something *ptr)
{
...
}
...
setup_timer(&ptr->my_timer, my_callback, (unsigned long)ptr);
become:
void my_callback(struct timer_list *t)
{
struct something *ptr = from_timer(ptr, t, my_timer);
...
}
...
timer_setup(&ptr->my_timer, my_callback, 0);
Direct function assignments:
void my_callback(unsigned long data)
{
struct something *ptr = (struct something *)data;
...
}
...
ptr->my_timer.function = my_callback;
have a temporary cast added, along with converting the args:
void my_callback(struct timer_list *t)
{
struct something *ptr = from_timer(ptr, t, my_timer);
...
}
...
ptr->my_timer.function = (TIMER_FUNC_TYPE)my_callback;
And finally, callbacks without a data assignment:
void my_callback(unsigned long data)
{
...
}
...
setup_timer(&ptr->my_timer, my_callback, 0);
have their argument renamed to verify they're unused during conversion:
void my_callback(struct timer_list *unused)
{
...
}
...
timer_setup(&ptr->my_timer, my_callback, 0);
The conversion is done with the following Coccinelle script:
spatch --very-quiet --all-includes --include-headers \
-I ./arch/x86/include -I ./arch/x86/include/generated \
-I ./include -I ./arch/x86/include/uapi \
-I ./arch/x86/include/generated/uapi -I ./include/uapi \
-I ./include/generated/uapi --include ./include/linux/kconfig.h \
--dir . \
--cocci-file ~/src/data/timer_setup.cocci
@fix_address_of@
expression e;
@@
setup_timer(
-&(e)
+&e
, ...)
// Update any raw setup_timer() usages that have a NULL callback, but
// would otherwise match change_timer_function_usage, since the latter
// will update all function assignments done in the face of a NULL
// function initialization in setup_timer().
@change_timer_function_usage_NULL@
expression _E;
identifier _timer;
type _cast_data;
@@
(
-setup_timer(&_E->_timer, NULL, _E);
+timer_setup(&_E->_timer, NULL, 0);
|
-setup_timer(&_E->_timer, NULL, (_cast_data)_E);
+timer_setup(&_E->_timer, NULL, 0);
|
-setup_timer(&_E._timer, NULL, &_E);
+timer_setup(&_E._timer, NULL, 0);
|
-setup_timer(&_E._timer, NULL, (_cast_data)&_E);
+timer_setup(&_E._timer, NULL, 0);
)
@change_timer_function_usage@
expression _E;
identifier _timer;
struct timer_list _stl;
identifier _callback;
type _cast_func, _cast_data;
@@
(
-setup_timer(&_E->_timer, _callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, &_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, &_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)&_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)&_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, &_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, &_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
_E->_timer@_stl.function = _callback;
|
_E->_timer@_stl.function = &_callback;
|
_E->_timer@_stl.function = (_cast_func)_callback;
|
_E->_timer@_stl.function = (_cast_func)&_callback;
|
_E._timer@_stl.function = _callback;
|
_E._timer@_stl.function = &_callback;
|
_E._timer@_stl.function = (_cast_func)_callback;
|
_E._timer@_stl.function = (_cast_func)&_callback;
)
// callback(unsigned long arg)
@change_callback_handle_cast
depends on change_timer_function_usage@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _origtype;
identifier _origarg;
type _handletype;
identifier _handle;
@@
void _callback(
-_origtype _origarg
+struct timer_list *t
)
{
(
... when != _origarg
_handletype *_handle =
-(_handletype *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle =
-(void *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle;
... when != _handle
_handle =
-(_handletype *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle;
... when != _handle
_handle =
-(void *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
)
}
// callback(unsigned long arg) without existing variable
@change_callback_handle_cast_no_arg
depends on change_timer_function_usage &&
!change_callback_handle_cast@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _origtype;
identifier _origarg;
type _handletype;
@@
void _callback(
-_origtype _origarg
+struct timer_list *t
)
{
+ _handletype *_origarg = from_timer(_origarg, t, _timer);
+
... when != _origarg
- (_handletype *)_origarg
+ _origarg
... when != _origarg
}
// Avoid already converted callbacks.
@match_callback_converted
depends on change_timer_function_usage &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg@
identifier change_timer_function_usage._callback;
identifier t;
@@
void _callback(struct timer_list *t)
{ ... }
// callback(struct something *handle)
@change_callback_handle_arg
depends on change_timer_function_usage &&
!match_callback_converted &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _handletype;
identifier _handle;
@@
void _callback(
-_handletype *_handle
+struct timer_list *t
)
{
+ _handletype *_handle = from_timer(_handle, t, _timer);
...
}
// If change_callback_handle_arg ran on an empty function, remove
// the added handler.
@unchange_callback_handle_arg
depends on change_timer_function_usage &&
change_callback_handle_arg@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _handletype;
identifier _handle;
identifier t;
@@
void _callback(struct timer_list *t)
{
- _handletype *_handle = from_timer(_handle, t, _timer);
}
// We only want to refactor the setup_timer() data argument if we've found
// the matching callback. This undoes changes in change_timer_function_usage.
@unchange_timer_function_usage
depends on change_timer_function_usage &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg &&
!change_callback_handle_arg@
expression change_timer_function_usage._E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type change_timer_function_usage._cast_data;
@@
(
-timer_setup(&_E->_timer, _callback, 0);
+setup_timer(&_E->_timer, _callback, (_cast_data)_E);
|
-timer_setup(&_E._timer, _callback, 0);
+setup_timer(&_E._timer, _callback, (_cast_data)&_E);
)
// If we fixed a callback from a .function assignment, fix the
// assignment cast now.
@change_timer_function_assignment
depends on change_timer_function_usage &&
(change_callback_handle_cast ||
change_callback_handle_cast_no_arg ||
change_callback_handle_arg)@
expression change_timer_function_usage._E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type _cast_func;
typedef TIMER_FUNC_TYPE;
@@
(
_E->_timer.function =
-_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-&_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-(_cast_func)_callback;
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-(_cast_func)&_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-&_callback;
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-(_cast_func)_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-(_cast_func)&_callback
+(TIMER_FUNC_TYPE)_callback
;
)
// Sometimes timer functions are called directly. Replace matched args.
@change_timer_function_calls
depends on change_timer_function_usage &&
(change_callback_handle_cast ||
change_callback_handle_cast_no_arg ||
change_callback_handle_arg)@
expression _E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type _cast_data;
@@
_callback(
(
-(_cast_data)_E
+&_E->_timer
|
-(_cast_data)&_E
+&_E._timer
|
-_E
+&_E->_timer
)
)
// If a timer has been configured without a data argument, it can be
// converted without regard to the callback argument, since it is unused.
@match_timer_function_unused_data@
expression _E;
identifier _timer;
identifier _callback;
@@
(
-setup_timer(&_E->_timer, _callback, 0);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, 0L);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, 0UL);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0L);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0UL);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0L);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0UL);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0);
+timer_setup(_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0L);
+timer_setup(_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0UL);
+timer_setup(_timer, _callback, 0);
)
@change_callback_unused_data
depends on match_timer_function_unused_data@
identifier match_timer_function_unused_data._callback;
type _origtype;
identifier _origarg;
@@
void _callback(
-_origtype _origarg
+struct timer_list *unused
)
{
... when != _origarg
}
Signed-off-by: Kees Cook <keescook@chromium.org>
commit 7dfaa7bc99498da1c6c4a48bee8d2d5265161a8c
Author: Arnd Bergmann <arnd@arndb.de>
Date: Mon Nov 6 15:04:39 2017 +0100
bnxt: fix bnxt_hwrm_fw_set_time for y2038
On 32-bit architectures, rtc_time_to_tm() returns incorrect results
in 2038 or later, and do_gettimeofday() is broken for the same reason.
This changes the code to use ktime_get_real_seconds() and time64_to_tm()
instead, both of them are 2038-safe, and we can also get rid of the
CONFIG_RTC_LIB dependency that way.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 42ca728b829b8fee8ac85adb79eaffd36f0b4e06
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date: Mon Nov 6 14:43:01 2017 +0300
bnxt: delete some unreachable code
We return on the previous line so this "return 0;" statement should just
be deleted.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 575ed7d39e2fbe602a3894bc766a8cb49af83bd3
Author: Nogah Frankel <nogahf@mellanox.com>
Date: Mon Nov 6 07:23:42 2017 +0100
net_sch: mqprio: Change TC_SETUP_MQPRIO to TC_SETUP_QDISC_MQPRIO
Change TC_SETUP_MQPRIO to TC_SETUP_QDISC_MQPRIO to match the new
convention.
Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f4e63525ee35f9c02e9f51f90571718363e9a9a9
Author: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Fri Nov 3 13:56:16 2017 -0700
net: bpf: rename ndo_xdp to ndo_bpf
ndo_xdp is a control path callback for setting up XDP in the
driver. We can reuse it for other forms of communication
between the eBPF stack and the drivers. Rename the callback
and associated structures and definitions.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b153cbc507946f52d5aa687fd64f45d82cb36a3b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Nov 3 03:32:39 2017 -0400
bnxt_en: Fix IRQ coalescing regression.
Recent IRQ coalescing clean up has removed a guard-rail for the max DMA
buffer coalescing value. This is a 6-bit value and must not be 0. We
already have a check for 0 but 64 is equivalent to 0 and will cause
non-stop interrupts. Fix it by adding the proper check.
Fixes: f8503969d27b ("bnxt_en: Refactor and simplify coalescing code.")
Reported-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit de4a10ef6eff0eb0ced97a39dc3edd0d3101b6ed
Author: Andy Gospodarek <gospo@broadcom.com>
Date: Fri Nov 3 03:32:38 2017 -0400
bnxt_en: fix typo in bnxt_set_coalesce
Recent refactoring of coalesce settings contained a typo that prevents
receive settings from being set properly.
Fixes: 18775aa8a91f ("bnxt_en: Reorganize the coalescing parameters.")
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 44ae12a768b7212976a362c590075716a77e8f28
Author: Jiri Pirko <jiri@mellanox.com>
Date: Wed Nov 1 11:47:39 2017 +0100
net: sched: move the can_offload check from binding phase to rule insertion phase
This restores the original behaviour before the block callbacks were
introduced. Allow the drivers to do binding of block always, no matter
if the NETIF_F_HW_TC feature is on or off. Move the check to the block
callback which is called for rule insertion.
Reported-by: Alexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 952c5719aac6587f1e0add97dca79f9e73887f9b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sat Oct 28 01:56:10 2017 -0400
bnxt_en: Fix randconfig build errors.
Fix undefined symbols when CONFIG_VLAN_8021Q or CONFIG_INET is not set.
Fixes: 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")
Reported-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cd66358e52f74585f043ef63089727273b3421d3
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Thu Oct 26 11:51:32 2017 -0400
bnxt_en: alloc tc_info{} struct only when tc flower is enabled
TC flower is not enabled on VFs and when there's no FW support.
Alloc the tc_info{} struct at init time only when TC flower is being
enabled.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5a84acbebb22f93dfc9ce1e5f0427c45c94acb33
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Thu Oct 26 11:51:31 2017 -0400
bnxt_en: query cfa flow stats periodically to compute 'lastused' attribute
This patch implements periodic querying of cfa flow stats
in batches to compute the 'lastused' attribute of TC flow stats.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f484f6782e013138946122ae09c100c9e4b547e3
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Thu Oct 26 11:51:30 2017 -0400
bnxt_en: add hwrm FW cmds for cfa_encap_record and decap_filter
Add routines for issuing the hwrm_cfa_encap_record_alloc/free
and hwrm_cfa_decap_filter_alloc/free FW cmds needed for
supporting vxlan encap/decap offload.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8c95f773b4a367f7b9bcca7ab5f85675cfc812e9
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Thu Oct 26 11:51:29 2017 -0400
bnxt_en: add support for Flower based vxlan encap/decap offload
This patch adds IPv4 vxlan encap/decap action support to TC-flower
offload.
For vxlan encap, the driver maintains a tunnel encap hash-table.
When a new flow with a tunnel encap action arrives, this table
is looked up; if an encap entry exists, it uses the already
programmed encap_record_handle as the tunnel_handle in the
hwrm_cfa_flow_alloc cmd. Else, a new encap node is added and the
L2 header fields are queried via a route lookup.
hwrm_cfa_encap_record_alloc cmd is used to create a new encap
record and the encap_record_handle is used as the tunnel_handle
while adding the flow.
For vxlan decap, the driver maintains a tunnel decap hash-table.
When a new flow with a tunnel decap action arrives, this table
is looked up; if a decap entry exists, it uses the already
programmed decap_filter_handle as the tunnel_handle in the
hwrm_cfa_flow_alloc cmd. Else, a new decap node is added and
a decap_filter_handle is alloc'd via the hwrm_cfa_decap_filter_alloc
cmd. This handle is used as the tunnel_handle while adding the flow.
The code to issue the HWRM FW cmds is introduced in a follow-up patch.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f8503969d27b2b26ff0adbce4b7d7cf4ba5e43c2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Oct 26 11:51:28 2017 -0400
bnxt_en: Refactor and simplify coalescing code.
The mapping of the ethtool coalescing parameters to hardware parameters
is now done in bnxt_hwrm_set_coal_params(). The same function can
handle both RX and TX settings. The code is now more clear. Some
adjustments have been made to get better hardware settings. The
coal_frames setting is now accurately set in hardware. The max_timer
is set to coal_ticks value.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 18775aa8a91fcd4cd07c722d575b4b852e3624c3
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Oct 26 11:51:27 2017 -0400
bnxt_en: Reorganize the coalescing parameters.
The current IRQ coalescing logic is a little messy. The ethtool
parameters are mapped to hardware parameters in a way that is difficult
to understand. The first step is to better organize the parameters
by adding the new structure bnxt_coal. The structure is used by both
the RX and TX sets of coalescing parameters.
Adjust the default coal_ticks to 14 us and 28 us for RX and TX.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 49f7972fd16407b3d1f03c2d447d2f1e1b95e9ba
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu Oct 26 11:51:26 2017 -0400
bnxt_en: Add ethtool reset method
This is a firmware internal reset after driver is unloaded.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7eb9bb3a0c7c29741df2249cc3b99f06a7978d61
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Oct 26 11:51:25 2017 -0400
bnxt_en: Check maximum supported MTU from firmware.
Some NICs have a firmware enforced maximum MTU setting by management
firmware. Set up netdev->max_mtu accordingly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c1a7bdff17247332ecff7f243e42d269b3f74c65
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Oct 26 11:51:24 2017 -0400
bnxt_en: Optimize .ndo_set_mac_address() for VFs.
No need to call bnxt_approve_mac() which will send a message to the
PF if the MAC address hasn't changed.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 431aa1eb20d8ae2674723292adb832b968da868e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Oct 26 11:51:23 2017 -0400
bnxt_en: Get firmware package version one time.
The current code retrieves the firmware package version from firmware
everytime ethtool -i is run. There is no reason to do that as the
firmware will not change while the driver is loaded. Get the version
once at init time.
Also, display the full 4-part firmware version string and remove the
less useful interface spec version.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e0ad8fc5980b362028cfd63ec037f4b491e726c6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Oct 26 11:51:22 2017 -0400
bnxt_en: Check for zero length value in bnxt_get_nvram_item().
Return -EINVAL if the length is zero and not proceed to do essentially
nothing.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 618784e3ee1870e43e50e1c7922cc123cc050566
Author: Rob Miller <rmiller@broadcom.com>
Date: Thu Oct 26 11:51:21 2017 -0400
bnxt_en: adding PCI ID for SMARTNIC VF support
Signed-off-by: Rob Miller <rmiller@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8ed693b7bbd179949f6947adaae5eff2e386a534
Author: Ray Jui <ray.jui@broadcom.com>
Date: Thu Oct 26 11:51:20 2017 -0400
bnxt_en: Add PCIe device ID for bcm58804
Add new PCIe device ID and chip number for bcm58804
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 57922b0a2f7ef9effbcdbbf7d1f8dad95aa567f7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Oct 26 11:51:19 2017 -0400
bnxt_en: Update firmware interface to 1.8.3.1
Vxlan encap/decap filters are added to this firmware spec.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3c467bf399106030d5a97d844ee119caec04e817
Author: Steve Lin <steven.lin1@broadcom.com>
Date: Thu Oct 19 10:45:56 2017 -0400
bnxt: Move generic devlink code to new file
Moving generic devlink code (registration) out of VF-R code
into new bnxt_devlink file, in preparation for future work
to add additional devlink functionality to bnxt.
Signed-off-by: Steve Lin <steven.lin1@broadcom.com>
Acked-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8d26d5636dff9fca30816579910aaa9a55b4d96d
Author: Jiri Pirko <jiri@mellanox.com>
Date: Thu Oct 19 15:50:46 2017 +0200
net: sched: avoid ndo_setup_tc calls for TC_SETUP_CLS*
All drivers are converted to use block callbacks for TC_SETUP_CLS*.
So it is now safe to remove the calls to ndo_setup_tc from cls_*
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9e0fd15dd6c981931a9e9f11dc0c940d17d6e051
Author: Jiri Pirko <jiri@mellanox.com>
Date: Thu Oct 19 15:50:39 2017 +0200
bnxt: Convert ndo_setup_tc offloads to block callbacks
Benefit from the newly introduced block callback infrastructure and
convert ndo_setup_tc calls for flower offloads to block callbacks.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5b1e1a9ce06fd94b563d6c3dd896589231995d89
Author: Sankar Patchineelam <sankar.patchineelam@broadcom.com>
Date: Fri Oct 13 21:09:34 2017 -0400
bnxt_en: Fix possible corruption in DCB parameters from firmware.
hwrm_send_message() is replaced with _hwrm_send_message(), and
hwrm_cmd_lock mutex lock is grabbed for the whole period of
firmware call until the firmware DCB parameters have been copied.
This will prevent possible corruption of the firmware data.
Fixes: 7df4ae9fe855 ("bnxt_en: Implement DCBNL to support host-based DCBX.")
Signed-off-by: Sankar Patchineelam <sankar.patchineelam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cc72f3b1feb4fd38d33ab7a013d5ab95041cb8ba
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Oct 13 21:09:33 2017 -0400
bnxt_en: Fix possible corrupted NVRAM parameters from firmware response.
In bnxt_find_nvram_item(), it is copying firmware response data after
releasing the mutex. This can cause the firmware response data
to be corrupted if the next firmware response overwrites the response
buffer. The rare problem shows up when running ethtool -i repeatedly.
Fix it by calling the new variant _hwrm_send_message_silent() that requires
the caller to take the mutex and to release it after the response data has
been copied.
Fixes: 3ebf6f0a09a2 ("bnxt_en: Add installed-package version reporting via Ethtool GDRVINFO")
Reported-by: Sarveswara Rao Mygapula <sarveswararao.mygapula@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 021570793d8cd86cb62ac038c535f4450586b454
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Oct 13 21:09:32 2017 -0400
bnxt_en: Fix VF resource checking.
In bnxt_sriov_enable(), we calculate to see if we have enough hardware
resources to enable the requested number of VFs. The logic to check
for minimum completion rings and statistics contexts is missing. Add
the required checks so that VF configuration won't fail.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7ab0760f5178169c4c218852f51646ea90817d7c
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Oct 13 21:09:31 2017 -0400
bnxt_en: Fix VF PCIe link speed and width logic.
PCIE PCIE_EP_REG_LINK_STATUS_CONTROL register is only defined in PF
config space, so we must read it from the PF.
Fixes: 90c4f788f6c0 ("bnxt_en: Report PCIe link speed and width during driver load")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e2dc9b6e38fa3919e63d6d7905da70ca41cbf908
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Oct 13 21:09:30 2017 -0400
bnxt_en: Don't use rtnl lock to protect link change logic in workqueue.
As a further improvement to the PF/VF link change logic, use a private
mutex instead of the rtnl lock to protect link change logic. With the
new mutex, we don't have to take the rtnl lock in the workqueue when
we have to handle link related functions. If the VF and PF drivers
are running on the same host and both take the rtnl lock and one is
waiting for the other, it will cause timeout. This patch fixes these
timeouts.
Fixes: 90c694bb7181 ("bnxt_en: Fix RTNL lock usage on bnxt_update_link().")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c213eae8d3cd4c026f348ce4fd64f4754b3acf2b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Oct 13 21:09:29 2017 -0400
bnxt_en: Improve VF/PF link change logic.
Link status query firmware messages originating from the VFs are forwarded
to the PF. The driver handles these interactions in a workqueue for the
VF and PF. The VF driver waits for the response from the PF in the
workqueue. If the PF and VF driver are running on the same host and the
work for both PF and VF are queued on the same workqueue, the VF driver
may not get the response if the PF work item is queued behind it on the
same workqueue. This will lead to the VF link query message timing out.
To prevent this, we create a private workqueue for PFs instead of using
the common workqueue. The VF query and PF response will never be on
the same workqueue.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit de8f3a83b0a0fddb2cf56e7a718127e9619ea3da
Author: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon Sep 25 02:25:51 2017 +0200
bpf: add meta pointer for direct access
This work enables generic transfer of metadata from XDP into skb. The
basic idea is that we can make use of the fact that the resulting skb
must be linear and already comes with a larger headroom for supporting
bpf_xdp_adjust_head(), which mangles xdp->data. Here, we base our work
on a similar principle and introduce a small helper bpf_xdp_adjust_meta()
for adjusting a new pointer called xdp->data_meta. Thus, the packet has
a flexible and programmable room for meta data, followed by the actual
packet data. struct xdp_buff is therefore laid out that we first point
to data_hard_start, then data_meta directly prepended to data followed
by data_end marking the end of packet. bpf_xdp_adjust_head() takes into
account whether we have meta data already prepended and if so, memmove()s
this along with the given offset provided there's enough room.
xdp->data_meta is optional and programs are not required to use it. The
rationale is that when we process the packet in XDP (e.g. as DoS filter),
we can push further meta data along with it for the XDP_PASS case, and
give the guarantee that a clsact ingress BPF program on the same device
can pick this up for further post-processing. Since we work with skb
there, we can also set skb->mark, skb->priority or other skb meta data
out of BPF, thus having this scratch space generic and programmable
allows for more flexibility than defining a direct 1:1 transfer of
potentially new XDP members into skb (it's also more efficient as we
don't need to initialize/handle each of such new members). The facility
also works together with GRO aggregation. The scratch space at the head
of the packet can be multiple of 4 byte up to 32 byte large. Drivers not
yet supporting xdp->data_meta can simply be set up with xdp->data_meta
as xdp->data + 1 as bpf_xdp_adjust_meta() will detect this and bail out,
such that the subsequent match against xdp->data for later access is
guaranteed to fail.
The verifier treats xdp->data_meta/xdp->data the same way as we treat
xdp->data/xdp->data_end pointer comparisons. The requirement for doing
the compare against xdp->data is that it hasn't been modified from it's
original address we got from ctx access. It may have a range marking
already from prior successful xdp->data/xdp->data_end pointer comparisons
though.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1fac4b2fdbccab69cb781aae68f540be94d5549e
Author: Tobias Klauser <tklauser@distanz.ch>
Date: Tue Sep 26 15:12:26 2017 +0200
bnxt_en: Remove redundant unlikely()
IS_ERR() already implies unlikely(), so it can be omitted.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6c43824477c2ac722325ba460c2ce683c48fb76b
Author: Allen Pais <allen.lkml@gmail.com>
Date: Thu Sep 21 22:35:08 2017 +0530
drivers: net: bnxt: use setup_timer() helper.
Use setup_timer function instead of initializing timer with the
function and data fields.
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1e3c5ec66119783440ed211ae527674651affa9b
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Sep 18 17:05:37 2017 +0530
bnxt_en: check for ingress qdisc in flower offload
Check for ingress-only qdisc for flower offload, as other qdiscs
are not supported for flower offload.
Suggested-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f143647a02825038d8d6251422e1d0ebdcb6d9ea
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Tue Aug 29 11:45:03 2017 +0530
bnxt_en: add a dummy definition for bnxt_vf_rep_get_fid()
When bnxt VF-reps are not compiled in (CONFIG_BNXT_SRIOV is off)
bnxt_tc.c needs a dummy definition of the routine bnxt_vf_rep_get_fid().
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 2ae7408fedfe ("bnxt_en: bnxt: add TC flower filter offload support")
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d7bc73053024eecb239a5b8644a05c7745fd87a1
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Aug 28 13:40:35 2017 -0400
bnxt_en: add code to query TC flower offload stats
This patch adds code to implement TC_CLSFLOWER_STATS TC-cmd and the
required FW code to query the stats from the HW.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit db1d36a27324d51e62944f702a4d2d50548896ee
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Aug 28 13:40:34 2017 -0400
bnxt_en: add TC flower offload flow_alloc/free FW cmds
This patch adds the hwrm_cfa_flow_alloc/free() routines
that are needed to issue the FW cmds needed for TC flower offload.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2ae7408fedfee979e01ed3801223c632bb124c46
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Aug 28 13:40:33 2017 -0400
bnxt_en: bnxt: add TC flower filter offload support
This patch adds support for offloading TC based flow
rules and actions for the 'flower' classifier in the bnxt_en driver.
It includes logic to parse flow rules and actions received from the
TC subsystem, store them and issue the corresponding
hwrm_cfa_flow_alloc/free FW cmds. L2/IPv4/IPv6 flows and drop,
redir, vlan push/pop actions are supported in this patch.
In this patch the hwrm_cfa_flow_xxx routines are just stubs.
The code for these routines is introduced in the next patch for easier
review. Also, the code to query the TC/flower action stats will
be introduced in a subsequent patch.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 70855603e0a129d1c810947a4e4dd7ecd6f4560d
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Aug 28 13:40:32 2017 -0400
bnxt_en: fix clearing devlink ptr from bnxt struct
The routine bnxt_link_bp_to_dl() is used to set the devlink ptr
in bnxt struct (bp) and also to set the bnxt back ptr in
the devlink struct. If devlink_register() fails, bp->dl must
be cleared which is not happening currently. This patch fixes
bnxt_link_bp_to_dl() to clear bp->dl by passing a NULL dl ptr.
Fixes: 4ab0c6a8ffd7 ("bnxt_en: add support to enable VF-representors")
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d5430d31ca72ec37fd539fd1c5230859509be4ef
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Aug 28 13:40:31 2017 -0400
bnxt_en: Reduce default rings on multi-port cards.
Reduce default rings from 8 to 4 on multi-port cards to reduce memory
usage.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 903649e718f80da2ba4b65a0adf6930219b4b2e5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Aug 28 13:40:30 2017 -0400
bnxt_en: Improve -ENOMEM logic in NAPI poll loop.
If we cannot allocate RX buffers in the NAPI poll loop when processing
an RX event, the current code does not count that event towards the NAPI
budget. This can cause us to potentially loop forever in NAPI if we
consistently cannot allocate new buffers. Improve it by counting
-ENOMEM event as 1 towards the NAPI budget.
Cc: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reported-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 27573a7d905a49dc756fda9c0e148372136356e6
Author: Scott Branden <scott.branden@broadcom.com>
Date: Mon Aug 28 13:40:29 2017 -0400
bnxt: initialize board_info values with proper enums
initialize board_info values with proper enums for defensive programming
purposes. This will avoid any errors of the enums being declared not
lining up with the board_info array.
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4a58139b8493624c6c6223b58a9e70ebbdf56338
Author: Ray Jui <ray.jui@broadcom.com>
Date: Mon Aug 28 13:40:28 2017 -0400
bnxt: Add PCIe device IDs for bcm58802/bcm58808
Add PCIe device ID for bcm58802 and bcm58808. Also add chip number
update to declare bcm588xx as chip class phase 4 and later
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 56f0fd80d1886479a42ac07ed239538eb145a669
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Aug 28 13:40:27 2017 -0400
bnxt_en: assign CPU affinity hints to bnxt_en IRQs
This patch provides hints to irqbalance to map bnxt_en device IRQs
to specific CPU cores. cpumask_local_spread() is used, which first
maps IRQs to near NUMA cores; when those cores are exhausted, IRQs
are mapped to far NUMA cores.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 98fdbe73bfb809b1f8eec9f27a36e737caed3a44
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Aug 28 13:40:26 2017 -0400
bnxt_en: Improve tx ring reservation logic.
When the number of TX rings is changed (e.g. ethtool -L, enabling XDP TX
rings, etc), the current code tries to reserve the new number of TX rings
before closing and re-opening the NIC. If we are unable to reserve the
new TX rings, we abort the operation and keep the current TX rings.
The problem is that the firmware will disable the current TX rings even
when it cannot reserve the new set of TX rings. We fix it as follows:
1. Instead of reserving the new set of TX rings, just ask the firmware
to check if the new set of TX rings is available. There is a flag in
the firmware message to do that. If not available, abort and the
current TX rings will not be disabled.
2. Do the actual TX ring reservation in the path that opens the NIC.
We keep the number of TX rings currently successfully reserved. If the
number of TX rings is different than the reserved TX rings, we call
firmware and reserve again.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6a17eb27bf7ece364627fcf16ad50c24b793300b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Aug 28 13:40:25 2017 -0400
bnxt_en: Update firmware interface spec. to 1.8.1.4.
Flow APIs are added in this firmware interface.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a22a6ac2ff8080c87e446e20592725c064229c71
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Aug 23 19:34:05 2017 -0400
bnxt_en: Do not setup MAC address in bnxt_hwrm_func_qcaps().
bnxt_hwrm_func_qcaps() is called during probe to get all device
resources and it also sets up the factory MAC address. The same function
is called when SRIOV is disabled to reclaim all resources. If
the MAC address has been overridden by a user administered MAC
address, calling this function will overwrite it.
Separate the logic that sets up the default MAC address into a new
function bnxt_init_mac_addr() that is only called during probe time.
Fixes: 4a21b49b34c0 ("bnxt_en: Improve VF resource accounting.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 146ed3c5b87d8c65ec31bc56df26f027fe624b8f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Aug 23 19:34:04 2017 -0400
bnxt_en: Free MSIX vectors when unregistering the device from bnxt_re.
Take back ownership of the MSIX vectors when unregistering the device
from bnxt_re.
Fixes: a588e4580a7e ("bnxt_en: Add interface to support RDMA driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 87e9b3778c94694c9e098c91a0cc05725f0e017f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Aug 23 19:34:03 2017 -0400
bnxt_en: Fix .ndo_setup_tc() to include XDP rings.
When the number of TX rings is changed in bnxt_setup_tc(), we need to
include the XDP rings in the total TX ring count.
Fixes: 38413406277f ("bnxt_en: Add support for XDP_TX action.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bd76b87962833f6e55264030a227be0f090b1286
Author: Colin Ian King <colin.king@canonical.com>
Date: Fri Aug 18 16:40:00 2017 +0100
bnxt_en: fix spelling mistake: "swtichdev" -> "switchdev"
Trivial fix to spelling mistake in a netdev_info message
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit de4784ca030fed17d527dbb2bb4e21328b12de94
Author: Jiri Pirko <jiri@mellanox.com>
Date: Mon Aug 7 10:15:32 2017 +0200
net: sched: get rid of struct tc_to_netdev
Get rid of struct tc_to_netdev which is now just unnecessary container
and rather pass per-type structures down to drivers directly.
Along with that, consolidate the naming of per-type structure variables
in cls_*.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 38cf0426e5178b1c3810bb88e65dd23882e40283
Author: Jiri Pirko <jiri@mellanox.com>
Date: Mon Aug 7 10:15:31 2017 +0200
net: sched: change return value of ndo_setup_tc for driver supporting mqprio only
Change the return value from -EINVAL to -EOPNOTSUPP. The rest of the
drivers have it like that, so be aligned.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5fd9fc4e207dba0c05cafe78417952b4c4ca02dc
Author: Jiri Pirko <jiri@mellanox.com>
Date: Mon Aug 7 10:15:29 2017 +0200
net: sched: push cls related args into cls_common structure
As ndo_setup_tc is generic offload op for whole tc subsystem, does not
really make sense to have cls-specific args. So move them under
cls_common structurure which is embedded in all cls structs.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2572ac53c46f58e500b9d8d0f99785666038c590
Author: Jiri Pirko <jiri@mellanox.com>
Date: Mon Aug 7 10:15:17 2017 +0200
net: sched: make type an argument for ndo_setup_tc
Since the type is always present, push it to be a separate argument to
ndo_setup_tc. On the way, name the type enum and use it for arg type.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 53f70b8b5aa06db53eb06f092342e6073891729a
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Tue Jul 25 13:28:41 2017 -0400
bnxt_en: fix switchdev port naming for external-port-rep and vf-reps
Fix the phys_port_name for the external physical port to be in
"pA" format and that of VF-rep to be in "pCvfD" format as
suggested by Jakub Kicinski.
Fixes: c124a62ff2dd ("bnxt_en: add support for port_attr_get and get_phys_port_name")
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e408ebdc41aa53f0aa552132384daaa5f5c6301d
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Tue Jul 25 13:28:40 2017 -0400
bnxt_en: use SWITCHDEV_SET_OPS() for setting vf_rep_switchdev_ops
This fixes the build error:
struct net_device has no member named switchdev_ops
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: c124a62ff2dd ("bnxt_en: add support for port_attr_get and and get_phys_port_name")
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d3e3becedc43adc8b8fb12e7507dd4e5aae4d17d
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Tue Jul 25 13:28:39 2017 -0400
bnxt_en: include bnxt_vfr.c code under CONFIG_BNXT_SRIOV switch
And define empty functions in bnxt_vfr.h when CONFIG_BNXT_SRIOV is not
defined.
This fixes build error when CONFIG_BNXT_SRIOV is switched off:
>> drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c:165:16: error: 'struct
>> bnxt' has no member named 'sriov_lock'
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 4ab0c6a8ffd7 ("bnxt_en: add support to enable VF-representors")
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 351bac30613378c4684d4673aac0c7917980a652
Author: stephen hemminger <stephen@networkplumber.org>
Date: Mon Jul 24 10:25:19 2017 -0700
bnxt: fix unused variable warnings
Fix a couple of warnings where variable txq set but not used
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>v, i);
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b721cfaf03bcaac0a3abf702c4240326eed9e4b1
Author: stephen hemminger <stephen@networkplumber.org>
Date: Mon Jul 24 10:25:18 2017 -0700
bnxt: fix unsigned comparsion with 0
Fixes warning because location is u32 and can never be netative
warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bc88055ab72c0eaa080926c888628b77d2055513
Author: David S. Miller <davem@davemloft.net>
Date: Mon Jul 24 21:20:16 2017 -0700
bnxt_en: Use SWITCHDEV_SET_OPS().
Suggested by Jakub Kicinski.
Fixes: c124a62ff2dd ("bnxt_en: add support for port_attr_get and and get_phys_port_name")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c124a62ff2dde9eaa9e8083de8206a142535c04e
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Jul 24 12:34:29 2017 -0400
bnxt_en: add support for port_attr_get and and get_phys_port_name
This patch adds support for the switchdev_port_attr_get() and
ndo_get_phys_port_name() methods for the PF and the VF-reps.
Using this support a user application can deduce that the PF
(when in the ESWITCH_SWDEV mode) and it's VF-reps form a switch.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ee5c7fb3404724b9e25fe24c81fbcda60f3f2659
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Jul 24 12:34:28 2017 -0400
bnxt_en: add vf-rep RX/TX and netdev implementation
This patch introduces the RX/TX and a simple netdev implementation
for VF-reps. The VF-reps use the RX/TX rings of the PF. For each VF-rep
the PF driver issues a VFR_ALLOC FW cmd that returns "cfa_code"
and "cfa_action" values. The FW sets up the filter tables in such
a way that VF traffic by default (in absence of other rules)
gets punted to the parent PF. The cfa_code value in the RX-compl
informs the driver of the source VF. For traffic being transmitted
from the VF-rep, the TX BD is tagged with a cfa_action value that
informs the HW to punt it to the corresponding VF.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4ab0c6a8ffd7d25475dd9eb06614eec1ae53a443
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Jul 24 12:34:27 2017 -0400
bnxt_en: add support to enable VF-representors
This patch is a part of a patch-set that introduces support for
VF-reps in the bnxt_en driver. The driver registers eswitch mode
get/set methods with the devlink interface that allow a user to
enable SRIOV switchdev mode. When enabled, the driver registers
a VF-rep netdev object for each VF with the stack. This can
essentially bring the VFs unders the management perview of the
hypervisor and applications such as OVS.
The next patch in the series, adds the RX/TX routines and a slim
netdev implementation for the VF-reps.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 70098a47bbf131b65c64ca935c2480e64c9c7c51
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 24 12:34:26 2017 -0400
bnxt_en: Set ETS min_bw parameter for older firmware.
In addition to the ETS weight, older firmware also requires the min_bw
parameter to be set for it to work properly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9315edca9b1d0daf41f81e1f5d4fb995d3cbc634
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 24 12:34:25 2017 -0400
bnxt_en: Report firmware DCBX agent.
Report DCB_CAP_DCBX_LLD_MANAGED only if the firmware DCBX agent is enabled
and running for PF or VF. Otherwise, if both LLDP and DCBX agents are
disabled in firmware, we report DCB_CAP_DCBX_LLD_HOST and allow host
IEEE DCB settings. This patch refines the current logic in the driver.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit adcc331e42e639ea44ac3c746db6c7207c3f69c0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 24 12:34:24 2017 -0400
bnxt_en: Allow the user to set ethtool stats-block-usecs to 0.
For debugging purpose, it is sometimes useful to disable periodic
port statistics updates, so that the firmware logs will not be
filled with statistics update messages.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5c8227d0d3b1eb1ad8f98d0b6dc619d70f2cfa04
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 24 12:34:23 2017 -0400
bnxt_en: Add bnxt_get_num_stats() to centrally get the number of ethtool stats.
Instead of duplicating the logic multiple times. Also, it is unnecessary
to zero the buffer in .get_ethtool_stats() because it is already zeroed
by the caller.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 39d8ba2e71fbdde686d7e31ad141a01994dc0793
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 24 12:34:22 2017 -0400
bnxt_en: Implement ndo_bridge_{get|set}link methods.
To allow users to set the hardware bridging mode to VEB or VEPA. Only
single function PF can change the bridging mode.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 32e8239c9138a050bc1feeea7cf41f27d79e6664
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 24 12:34:21 2017 -0400
bnxt_en: Retrieve the hardware bridge mode from the firmware.
Retrieve and store the hardware bridge mode, so that we can implement
ndo_bridge_{get|set)link methods in the next patch.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit acb2005463612930b07723e852b2483d669ff856
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 24 12:34:20 2017 -0400
bnxt_en: Update firmware interface spec to 1.8.0.
VF representors and PTP are added features in the new firmware spec.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9b0436c3f29483ca91d890b0072c0c02e2e535ed
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jul 11 13:05:36 2017 -0400
bnxt_en: Fix SRIOV on big-endian architecture.
The PF driver sets up a list of firmware commands from the VF driver that
needs to be forwarded to the PF for approval. This list is a 256-bit
bitmap. The code that sets up the bitmap falls apart on big-endian
architecture. __set_bit() does not work because it operates on long types
whereas the firmware interface is defined in u32 types, causing bits in
the wrong 32-bit word to be set.
Fix it by setting the proper bits on an array of u32.
Fixes: de68f5de5651 ("bnxt_en: Fix bitmap declaration to work on 32-bit arches.")
Reported-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3b6b34df342553a7522561e34288f5bb803aa9aa
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jul 11 13:05:35 2017 -0400
bnxt_en: Fix bug in ethtool -L.
When changing channels from combined to rx/tx or vice versa, the code
uses the wrong "sh" parameter to determine if we are reserving rings
for shared or non-shared mode. It should be using the ethtool requested
"sh" parameter instead of the current "sh" parameter.
Fix it by passing the "sh" parameter to bnxt_reserve_rings(). For
ethtool, we will pass in the requested "sh" parameter.
Fixes: 391be5c27364 ("bnxt_en: Implement new scheme to reserve tx rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f9b76ebd49f97458857568918c305a17fa7c6567
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jul 11 13:05:34 2017 -0400
bnxt_en: Fix race conditions in .ndo_get_stats64().
.ndo_get_stats64() may not be protected by RTNL and can race with
.ndo_stop() or other ethtool operations that can free the statistics
memory. Fix it by setting a new flag BNXT_STATE_READ_STATS and then
proceeding to read statistics memory only if the state is OPEN. The
close path that frees the memory clears the OPEN state and then waits
for the BNXT_STATE_READ_STATS to clear before proceeding to free the
statistics memory.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2270bc5da34979454e6f2eb133d800b635156174
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jun 23 14:01:01 2017 -0400
bnxt_en: Fix netpoll handling.
To handle netpoll properly, the driver must only handle TX packets
during NAPI. Handling RX events cause warnings and errors in
netpoll mode. The ndo_poll_controller() method should call
napi_schedule() directly so that a NAPI weight of zero will be used
during netpoll mode.
The bnxt_en driver supports 2 ring modes: combined, and separate rx/tx.
In separate rx/tx mode, the ndo_poll_controller() method will only
process the tx rings. In combined mode, the rx and tx completion
entries are mixed in the completion ring and we need to drop the rx
entries and recycle the rx buffers.
Add a function bnxt_force_rx_discard() to handle this in netpoll mode
when we see rx entries in combined ring mode.
Reported-by: Calvin Owens <calvinowens@fb.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 69c149e2e39e8d66437c9034bb4926ef2c1f7c23
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jun 23 14:01:00 2017 -0400
bnxt_en: Add missing logic to handle TPA end error conditions.
When we get a TPA_END completion to handle a completed LRO packet, it
is possible that hardware would indicate errors. The current code is
not checking for the error condition. Define the proper error bits and
the macro to check for this error and abort properly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8902965f8cb23bba8aa7f3be293ec2f3067b82c6
Author: Martin KaFai Lau <kafai@fb.com>
Date: Thu Jun 15 17:29:13 2017 -0700
bpf: bnxt: Report bpf_prog ID during XDP_QUERY_PROG
Add support to bnxt to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Acked-by: Alexei Starovoitov <ast@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a5fcf8a6c968ed8e312ff0b2a55d4c62d821eabb
Author: Jiri Pirko <jiri@mellanox.com>
Date: Tue Jun 6 17:00:16 2017 +0200
net: propagate tc filter chain index down the ndo_setup_tc call
We need to push the chain index down to the drivers, so they have the
information to which chain the rule belongs. For now, no driver supports
multichain offload, so only chain 0 is supported. This is needed to
prevent chain squashes during offload for now. Later this will be used
to implement multichain offload.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ffe406457753a7ca2061ecc8c4d3971623066911
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 30 20:03:00 2017 -0400
bnxt_en: Fix xmit_more with BQL.
We need to write the doorbell if BQL has stopped the queue and
skb->xmit_more is set. Otherwise it is possible for the tx queue to
rot and cause tx timeout.
Fixes: 4d172f21cefe ("bnxt_en: Implement xmit_more.")
Suggested-by: Yuval Mintz <yuval.mintz@cavium.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 702c221ca64060b81af4461553be19cba275da8b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 29 19:06:10 2017 -0400
bnxt_en: Pass in sh parameter to bnxt_set_dflt_rings().
In the existing code, the local variable sh is hardcoded to true to
calculate default rings for shared ring configuration. It is better
to have the caller determine the value of sh.
Reported-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4d172f21cefe896df8477940269b8d52129f8c87
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 29 19:06:09 2017 -0400
bnxt_en: Implement xmit_more.
Do not write the TX doorbell if skb->xmit_more is set unless the TX
queue is full.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 434c975a8fe2f70b70ac09ea5ddd008e0528adfa
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 29 19:06:08 2017 -0400
bnxt_en: Optimize doorbell write operations for newer chips.
Older chips require the doorbells to be written twice, but newer chips
do not. Add a new common function bnxt_db_write() to write all
doorbells appropriately depending on the chip. Eliminating the extra
doorbell on newer chips has a significant performance improvement
on pktgen.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3284f9e1ab505b41fa604c81e4b3271c6b88cdcb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 29 19:06:07 2017 -0400
bnxt_en: Add additional chip ID definitions.
Add additional chip definitions and macros for all supported chips.
Add a new macro BNXT_CHIP_P4_PLUS for the newer generation of chips and
use the macro to properly determine the features supported by these
newer chips.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0efd2fc65c922dff207ff10a776a7a33e0e3c7c5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon May 29 19:06:06 2017 -0400
bnxt_en: Add a callback to inform RDMA driver during PCI shutdown.
When bnxt_en gets a PCI shutdown call, we need to have a new callback
to inform the RDMA driver to do proper shutdown and removal.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c7ef35eb0c8d0b58d2d5ae5be599e6aa730361b2
Author: Deepak Khungar <deepak.khungar@broadcom.com>
Date: Mon May 29 19:06:05 2017 -0400
bnxt_en: Add PCI IDs for BCM57454 VF devices.
Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e605db801bdeb9d94cccbd4a2f641030067ef008
Author: Deepak Khungar <deepak.khungar@broadcom.com>
Date: Mon May 29 19:06:04 2017 -0400
bnxt_en: Support for Short Firmware Message
The new short message format is used on the new BCM57454 VFs. Each
firmware message is a fixed 16-byte message sent using the standard
firmware communication channel. The short message has a DMA address
pointing to the legacy long firmware message.
Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f667724b99ad1afc91f16064d8fb293d2805bd57
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 16 16:39:44 2017 -0400
bnxt_en: Check status of firmware DCBX agent before setting DCB_CAP_DCBX_HOST.
Otherwise, all the host based DCBX settings from lldpad will fail if the
firmware DCBX agent is running.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 87fe603274aa9889c05cca3c3e45675e1997cb13
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 16 16:39:43 2017 -0400
bnxt_en: Call bnxt_dcb_init() after getting firmware DCBX configuration.
In the current code, bnxt_dcb_init() is called too early before we
determine if the firmware DCBX agent is running or not. As a result,
we are not setting the DCB_CAP_DCBX_HOST and DCB_CAP_DCBX_LLD_MANAGED
flags properly to report to DCBNL.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c519fe9a4f0d1a1c559529c404589b8e346143f3
Author: Shannon Nelson <shannon.nelson@oracle.com>
Date: Tue May 9 18:30:12 2017 -0700
bnxt: add dma mapping attributes
On the SPARC platform we need to use the DMA_ATTR_WEAK_ORDERING attribute
in our Rx path dma mapping in order to get the expected performance out
of the receive path. Adding it to the Tx path has little effect, so
that's not a part of this patch.
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Reviewed-by: Tushar Dave <tushar.n.dave@oracle.com>
Reviewed-by: Tom Saeger <tom.saeger@oracle.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ac45bd93a5035c2f39c9862b8b6ed692db0fdc87
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date: Sat May 6 03:49:01 2017 +0300
bnxt_en: allocate enough space for ->ntp_fltr_bmap
We have the number of longs, but we need to calculate the number of
bytes required.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9e54e322ded40f424dcb5a13508e2556919ce12a
Author: Deepak Khungar <deepak.khungar@broadcom.com>
Date: Fri Apr 21 20:11:26 2017 -0400
bnxt_en: Restrict a PF in Multi-Host mode from changing port PHY configuration
This change restricts the PF in multi-host mode from setting any port
level PHY configuration. The settings are controlled by firmware in
Multi-Host mode.
Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7d63818a35851cf00867248d5ab50a8fe8df5943
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Apr 21 20:11:25 2017 -0400
bnxt_en: Check the FW_LLDP_AGENT flag before allowing DCBX host agent.
Check the additional flag in bnxt_hwrm_func_qcfg() before allowing
DCBX to be done in host mode.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 38a21b34aacd4db7b7b74c61afae42ea6718448d
Author: Deepak Khungar <deepak.khungar@broadcom.com>
Date: Fri Apr 21 20:11:24 2017 -0400
bnxt_en: Add 100G link speed reporting for BCM57454 ASIC in ethtool
Added support for 100G link speed reporting for Broadcom BCM57454
ASIC in ethtool command.
Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f0249056eaf2b9a17b2b76a6e099e9b7877e187d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Apr 21 20:11:23 2017 -0400
bnxt_en: Fix VF attributes reporting.
The .ndo_get_vf_config() is returning the wrong qos attribute. Fix
the code that checks and reports the qos and spoofchk attributes. The
BNXT_VF_QOS and BNXT_VF_LINK_UP flags should not be set by default
during init. time.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a82fba8dbfb522bd19b1644bf599135680fd0122
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Apr 21 20:11:22 2017 -0400
bnxt_en: Pass DCB RoCE app priority to firmware.
When the driver gets the RoCE app priority set/delete call through DCBNL,
the driver will send the information to the firmware to set up the
priority VLAN tag for RDMA traffic.
[ New version using the common ETH_P_IBOE constant in if_ether.h ]
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 68a946bb81e07ed0e59a99e0c068d091ed42cc1b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:17 2017 -0400
bnxt_en: Cap the msix vector with the max completion rings.
The current code enables up to the maximum MSIX vectors in the PCIE
config space without considering the max completion rings available.
An MSIX vector is only useful when it has an associated completion
ring, so it is better to cap it.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 932dbf83ba18bdb871e0c03a4ffdd9785f7a9c07
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:16 2017 -0400
bnxt_en: Use short TX BDs for the XDP TX ring.
No offload is performed on the XDP_TX ring so we can use the short TX
BDs. This has the effect of doubling the size of the XDP TX ring so
that it now matches the size of the rx ring by default.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 67fea463fd873492ab641459a6d1af0e9ea3c9ce
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:15 2017 -0400
bnxt_en: Add interrupt test to ethtool -t selftest.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 91725d89b97acea168a94c577d999801c3b3bcfb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:14 2017 -0400
bnxt_en: Add PHY loopback to ethtool self-test.
It is necessary to disable autoneg before enabling PHY loopback,
otherwise link won't come up.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f7dc1ea6c4c1f31371b7098d6fae0d49dc6cdff1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:13 2017 -0400
bnxt_en: Add ethtool mac loopback self test.
The mac loopback self test operates in polling mode. To support that,
we need to add functions to open and close the NIC half way. The half
open mode allows the rings to operate without IRQ and NAPI. We
use the XDP transmit function to send the loopback packet.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit eb51365846bc418687af4c4f41b68b6e84cdd449
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:12 2017 -0400
bnxt_en: Add basic ethtool -t selftest support.
Add the basic infrastructure and only firmware tests initially.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f65a2044a8c988adf16788c51c04ac10dbbdb494
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:11 2017 -0400
bnxt_en: Add suspend/resume callbacks.
Add suspend/resume callbacks using the newer dev_pm_ops method.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5282db6c794fed3ea8b399bc5305c4078e084f7b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:10 2017 -0400
bnxt_en: Add ethtool set_wol method.
And add functions to set and free magic packet filter.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8e202366dd752564d7f090ba280cc51cbf7bbbd9
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:09 2017 -0400
bnxt_en: Add ethtool get_wol method.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d196ece740bf337aa25731cd8cb44660a2a227dd
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:08 2017 -0400
bnxt_en: Add pci shutdown method.
Add pci shutdown method to put device in the proper WoL and power state.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c1ef146a5bd3b286d5c3eb2c9f631b38647c76d3
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:07 2017 -0400
bnxt_en: Add basic WoL infrastructure.
Add code to driver probe function to check if the device is WoL capable
and if Magic packet WoL filter is currently set.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8eb992e876a88de7539b1b9e132dd171d865cd2f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 4 18:14:06 2017 -0400
bnxt_en: Update firmware interface spec to 1.7.6.2.
Features added include WoL and selftest.
Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 282ccf6efb7c5d75b0283b66ed487957163ce8fe
Author: Florian Westphal <fw@strlen.de>
Date: Wed Mar 29 17:17:31 2017 +0200
drivers: add explicit interrupt.h includes
These files all use functions declared in interrupt.h, but currently rely
on implicit inclusion of this file (via netns/xfrm.h).
That won't work anymore when the flow cache is removed so include that
header where needed.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3ed3a83e3f3871c57b18cef09b148e96921236ed
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Mar 28 19:47:31 2017 -0400
bnxt_en: Fix DMA unmapping of the RX buffers in XDP mode during shutdown.
In bnxt_free_rx_skbs(), which is called to free up all RX buffers during
shutdown, we need to unmap the page if we are running in XDP mode.
Fixes: c61fb99cae51 ("bnxt_en: Add RX page mode support.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 23e12c893489ed12ecfccbf866fc62af1bead4b0
Author: Sankar Patchineelam <sankar.patchineelam@broadcom.com>
Date: Tue Mar 28 19:47:30 2017 -0400
bnxt_en: Correct the order of arguments to netdev_err() in bnxt_set_tpa()
Signed-off-by: Sankar Patchineelam <sankar.patchineelam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2247925f0942dc4e7c09b1cde45ca18461d94c5f
Author: Sankar Patchineelam <sankar.patchineelam@broadcom.com>
Date: Tue Mar 28 19:47:29 2017 -0400
bnxt_en: Fix NULL pointer dereference in reopen failure path
Net device reset can fail when the h/w or f/w is in a bad state.
Subsequent netdevice open fails in bnxt_hwrm_stat_ctx_alloc().
The cleanup invokes bnxt_hwrm_resource_free() which inturn
calls bnxt_disable_int(). In this routine, the code segment
if (ring->fw_ring_id != INVALID_HW_RING_ID)
BNXT_CP_DB(cpr->cp_doorbell, cpr->cp_raw_cons);
results in NULL pointer dereference as cpr->cp_doorbell is not yet
initialized, and fw_ring_id is zero.
The fix is to initialize cpr fw_ring_id to INVALID_HW_RING_ID before
bnxt_init_chip() is invoked.
Signed-off-by: Sankar Patchineelam <sankar.patchineelam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 56f36acd215cf7c28372b2fdb4f33f6900e97e05
Author: Amritha Nambiar <amritha.nambiar@intel.com>
Date: Wed Mar 15 10:39:25 2017 -0700
mqprio: Modify mqprio to pass user parameters via ndo_setup_tc.
The configurable priority to traffic class mapping and the user specified
queue ranges are used to configure the traffic class, overriding the
hardware defaults when the 'hw' option is set to 0. However, when the 'hw'
option is non-zero, the hardware QOS defaults are used.
This patch makes it so that we can pass the data the user provided to
ndo_setup_tc. This allows us to pull in the queue configuration if the
user requested it as well as any additional hardware offload type
requested by using a value other than 1 for the hw value.
Finally it also provides a means for the device driver to return the level
supported for the offload type via the qopt->hw value. Previously we were
just always assuming the value to be 1, in the future values beyond just 1
may be supported.
Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 520ad89a54edea84496695d528f73ddcf4a52ea4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Mar 8 18:44:35 2017 -0500
bnxt_en: Ignore 0 value in autoneg supported speed from firmware.
In some situations, the firmware will return 0 for autoneg supported
speed. This may happen if the firmware detects no SFP module, for
example. The driver should ignore this so that we don't end up with
an invalid autoneg setting with nothing advertised. When SFP module
is inserted, we'll get the updated settings from firmware at that time.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bc39f885a9c3bdbff0a96ecaf07b162a78eff6e4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Mar 8 18:44:34 2017 -0500
bnxt_en: Check if firmware LLDP agent is running.
Set DCB_CAP_DCBX_HOST capability flag only if the firmware LLDP agent
is not running.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b386cd362ffea09d05c56bfa85d104562e860647
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Mar 8 18:44:33 2017 -0500
bnxt_en: Call bnxt_ulp_stop() during tx timeout.
If we call bnxt_reset_task() due to tx timeout, we should call
bnxt_ulp_stop() to inform the RDMA driver about the error and the
impending reset.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3c2217a675bac22afb149166e0de71809189850d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Mar 8 18:44:32 2017 -0500
bnxt_en: Perform function reset earlier during probe.
The firmware call to do function reset is done too late. It is causing
the rings that have been reserved to be freed. In NPAR mode, this bug
is causing us to run out of rings.
Fixes: 391be5c27364 ("bnxt_en: Implement new scheme to reserve tx rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1faaa78f36cb2915ae89138ba5846f87ade85dcb
Author: Tobias Klauser <tklauser@distanz.ch>
Date: Tue Feb 21 15:27:28 2017 +0100
bnxt_en: use eth_hw_addr_random()
Use eth_hw_addr_random() to set a random MAC address in order to make
sure bp->dev->addr_assign_type will be properly set to NET_ADDR_RANDOM.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 17086399c113d933e1202697f85b8f0f82fcb8ce
Author: Sathya Perla <sathya.perla@broadcom.com>
Date: Mon Feb 20 19:25:18 2017 -0500
bnxt_en: fix pci cleanup in bnxt_init_one() failure path
In the bnxt_init_one() failure path, bar1 and bar2 are not
being unmapped. This commit fixes this issue. Reorganize the
code so that bnxt_init_one()'s failure path and bnxt_remove_one()
can call the same function to do the PCI cleanup.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit daf1f1e7841138cb0e48d52c8573a5f064d8f495
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 20 19:25:17 2017 -0500
bnxt_en: Fix NULL pointer dereference in a failure path during open.
If bnxt_hwrm_ring_free() is called during a failure path in bnxt_open(),
it is possible that the completion rings have not been allocated yet.
In that case, the completion doorbell has not been initialized, and
calling bnxt_disable_int() will crash. Fix it by checking that the
completion ring has been initialized before writing to the completion
ring doorbell.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4e00338a61998de3502d0428c4f71ffc69772316
Author: Ray Jui <ray.jui@broadcom.com>
Date: Mon Feb 20 19:25:16 2017 -0500
bnxt_en: Reject driver probe against all bridge devices
There are additional SoC devices that use the same device ID for
bridge and NIC devices. The bnxt driver should reject probe against
all bridge devices since it's meant to be used with only endpoint
devices.
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 32b40798c1b40343641f04cdfd09652af70ea0e9
Author: Deepak Khungar <deepak.khungar@broadcom.com>
Date: Sun Feb 12 19:18:18 2017 -0500
bnxt_en: Added PCI IDs for BCM57452 and BCM57454 ASICs
Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b451c8b69e70de299aa6061e1fa6afbb4d7c1f9e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 12 19:18:17 2017 -0500
bnxt_en: Fix bnxt_setup_tc() error message.
Add proper puctuation to make the message more clear.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e70c752f88ed23e6a0f081fa408282c2450c8ce9
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 12 19:18:16 2017 -0500
bnxt_en: Print FEC settings as part of the linkup dmesg.
Print FEC (Forward Error Correction) autoneg and encoding settings during
link up.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 33dac24abbd5a77eefca18fb7ebbd01a3cf1b343
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 12 19:18:15 2017 -0500
bnxt_en: Do not setup PHY unless driving a single PF.
If it is a VF or an NPAR function, the firmware call to setup the PHY
will fail. Adding this check will prevent unnecessary firmware calls
to setup the PHY unless calling from the PF. This will also eliminate
many unnecessary warning messages when the call from a VF or NPAR fails.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 61aad724ec0a685bc83b02b059a3ca0ad3bde6b0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 12 19:18:14 2017 -0500
bnxt_en: Add hardware NTUPLE filter for encapsulated packets.
If skb_flow_dissect_flow_keys() returns with the encapsulation flag
set, pass the information to the firmware to setup the NTUPLE filter
accordingly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 964fd4801d40ead69a447482c0dd0cd4be495e47
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 12 19:18:13 2017 -0500
bnxt_en: Allow NETIF_F_NTUPLE to be enabled on VFs.
Commit ae10ae740ad2 ("bnxt_en: Add new hardware RFS mode.") has added
code to allow NTUPLE to be enabled on VFs. So we now remove the
BNXT_VF() check in rfs_capable() to allow NTUPLE on VFs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a79a5276aa2f844bd368c1d3d5a625e1fbefd989
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 12 19:18:12 2017 -0500
bnxt_en: Fix ethtool -l pre-set max combined channel.
With commit d1e7925e6d80 ("bnxt_en: Centralize logic to reserve rings."),
ring allocation for combined rings has become stricter. A combined
ring must now have an rx-tx ring pair. The pre-set max. for combined
rings should now be min(rx, tx).
Fixes: d1e7925e6d80 ("bnxt_en: Centralize logic to reserve rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cb4d1d6261453677feb54e7a09c23fc7648dd6bc
Author: Kshitij Soni <kshitij.soni@broadcom.com>
Date: Sun Feb 12 19:18:11 2017 -0500
bnxt_en: Retry failed NVM_INSTALL_UPDATE with defragmentation flag.
If the HWRM_NVM_INSTALL_UPDATE command fails with the error code
NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR, retry the command with
a new flag to allow defragmentation. Since we are checking the
response for error code, we also need to take the mutex until
we finish reading the response.
Signed-off-by: Kshitij Soni <kshitij.soni@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bac9a7e0f5d6da82478d5e0a2a236158f42d5757
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun Feb 12 19:18:10 2017 -0500
bnxt_en: Update to firmware interface spec 1.7.0.
The new spec has NVRAM defragmentation support which will be used in
the next patch to improve ethtool flash operation.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 38413406277fd060f46855ad527f6f8d4cf2652d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:43 2017 -0500
bnxt_en: Add support for XDP_TX action.
Add dedicated transmit function and transmit completion handler for
XDP. The XDP transmit logic and completion logic are different than
regular TX ring. The TX buffer is recycled back to the RX ring when
it completes.
v3: Improved the buffer recyling scheme for XDP_TX.
v2: Add trace_xdp_exception().
Add dma_sync.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c6d30e8391b85e00eb544e6cf047ee0160ee9938
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:42 2017 -0500
bnxt_en: Add basic XDP support.
Add basic ndo_xdp support to setup and query program, configure the NIC
to run in rx page mode, and support XDP_PASS, XDP_DROP, XDP_ABORTED
actions only.
v3: Pass modified offset and length to stack for XDP_PASS.
Remove Kconfig option.
v2: Added trace_xdp_exception()
Added dma_syncs.
Added XDP headroom support.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fa3e93e86cc3d1809fba67cb138883ed4bb74a5f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:41 2017 -0500
bnxt_en: Refactor tx completion path.
XDP_TX requires a different function to handle completion. Add a
function pointer to handle tx completion logic. Regular TX rings
will be assigned the current bnxt_tx_int() for the ->tx_int()
function pointer.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5f4492493e75dafc5cbb96eabe0f146c2ffb1e3d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:40 2017 -0500
bnxt_en: Add a set of TX rings to support XDP.
Add logic for an extra set of TX rings for XDP. If enabled, this
set of TX rings equals the number of RX rings and shares the same
IRQ as the RX ring set. A new field bp->tx_nr_rings_xdp is added
to keep track of these TX XDP rings. Adjust all other relevant functions
to handle bp->tx_nr_rings_xdp.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a960dec98861b009b4227d2ae3b94a142c83eb96
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:39 2017 -0500
bnxt_en: Add tx ring mapping logic.
To support XDP_TX, we need to add a set of dedicated TX rings, each
associated with the NAPI of an RX ring. To assign XDP rings and regular
rings in a flexible way, we add a bp->tx_ring_map[] array to do the
remapping. The netdev txq index is stored in the new field txq_index
so that we can retrieve the netdev txq when handling TX completions.
In this patch, before we introduce XDP_TX, the mapping is 1:1.
v2: Fixed a bug in bnxt_tx_int().
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d1e7925e6d80ce5f9ef6deb8f3cec7526f5c443c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:38 2017 -0500
bnxt_en: Centralize logic to reserve rings.
Currently, bnxt_setup_tc() and bnxt_set_channels() have similar and
duplicated code to check and reserve rx and tx rings. Add a new
function bnxt_reserve_rings() to centralize the logic. This will
make it easier to add XDP_TX support which requires allocating a
new set of TX rings.
Also, the tx ring checking logic in bnxt_setup_msix() can be removed.
The rings have been reserved before hand.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4e5dbbda4c40a239e2ed4bbc98f2aa320e4dcca2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:37 2017 -0500
bnxt_en: Use event bit map in RX path.
In the current code, we have separate rx_event and agg_event parameters
to keep track of rx and aggregation events. Combine these events into
an u8 event mask with different bits defined for different events. This
way, it is easier to expand the logic to include XDP tx events.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c61fb99cae51958a9096d8540c8c05e74cfa7e59
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:36 2017 -0500
bnxt_en: Add RX page mode support.
This mode is to support XDP. In this mode, each rx ring is configured
with page sized buffers for linear placement of each packet. MTU will be
restricted to what the page sized buffers can support.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b3dba77cf0acb6e44b368979026df975658332bc
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:35 2017 -0500
bnxt_en: Parameterize RX buffer offsets.
Convert the global constants BNXT_RX_OFFSET and BNXT_RX_DMA_OFFSET to
device parameters. This will make it easier to support XDP with
headroom support which requires different RX buffer offsets.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 745fc05c9db1f17da076861c7f57507e13f28a3a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:34 2017 -0500
bnxt_en: Add bp->rx_dir field for rx buffer DMA direction.
When driver is running in XDP mode, rx buffers are DMA mapped as
DMA_BIDIRECTIONAL. Add a field so the code will map/unmap rx buffers
according to this field.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 11cd119d31a71b37c2362fc621f225e2aa12aea1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:33 2017 -0500
bnxt_en: Don't use DEFINE_DMA_UNMAP_ADDR to store DMA address in RX path.
To support XDP_TX, we need the RX buffer's DMA address to transmit the
packet. Convert the DMA address field to a permanent field in
bnxt_sw_rx_bd.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6bb19474391d17954fee9a9997ecca25b35dfd46
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 6 16:55:32 2017 -0500
bnxt_en: Refactor rx SKB function.
Minor refactoring of bnxt_rx_skb() so that it can easily be replaced by
a new function that handles packets in a single page. Also, use a
function pointer bp->rx_skb_func() to switch to a new function when
we add the new mode in the next patch.
Add a new field data_ptr that points to the packet data in the
bnxt_sw_rx_bd structure. The original data field is changed to void
pointer so that it can either hold the kmalloc'ed data or a page
pointer.
The last parameter of bnxt_rx_skb() which was the length parameter is
changed to include the payload offset of the packet in the upper 16 bit.
The offset is needed to support the rx page mode and is not used in
this existing function.
v3: Added a new data_ptr parameter to bp->rx_skb_func(). The caller
has the option to modify the starting address of the packet. This
will be needed when XDP with headroom support is added.
v2: Changed the name of the last parameter to offset_and_len to make the
code more clear.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6ad20165d376fa07919a70e4f43dfae564601829
Author: Eric Dumazet <edumazet@google.com>
Date: Mon Jan 30 08:22:01 2017 -0800
drivers: net: generalize napi_complete_done()
napi_complete_done() allows to opt-in for gro_flush_timeout,
added back in linux-3.19, commit 3b47d30396ba
("net: gro: add a per device gro flush timer")
This allows for more efficient GRO aggregation without
sacrifying latencies.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 90c694bb71819fb5bd3501ac397307d7e41ddeca
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 25 02:55:09 2017 -0500
bnxt_en: Fix RTNL lock usage on bnxt_get_port_module_status().
bnxt_get_port_module_status() calls bnxt_update_link() which expects
RTNL to be held. In bnxt_sp_task() that does not hold RTNL, we need to
call it with a prior call to bnxt_rtnl_lock_sp() and the call needs to
be moved to the end of bnxt_sp_task().
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0eaa24b971ae251ae9d3be23f77662a655532063
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 25 02:55:08 2017 -0500
bnxt_en: Fix RTNL lock usage on bnxt_update_link().
bnxt_update_link() is called from multiple code paths. Most callers,
such as open, ethtool, already hold RTNL. Only the caller bnxt_sp_task()
does not. So it is a bug to take RTNL inside bnxt_update_link().
Fix it by removing the RTNL inside bnxt_update_link(). The function
now expects the caller to always hold RTNL.
In bnxt_sp_task(), call bnxt_rtnl_lock_sp() before calling
bnxt_update_link(). We also need to move the call to the end of
bnxt_sp_task() since it will be clearing the BNXT_STATE_IN_SP_TASK bit.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a551ee94ea723b4af9b827c7460f108bc13425ee
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Jan 25 02:55:07 2017 -0500
bnxt_en: Fix bnxt_reset() in the slow path task.
In bnxt_sp_task(), we set a bit BNXT_STATE_IN_SP_TASK so that bnxt_close()
will synchronize and wait for bnxt_sp_task() to finish. Some functions
in bnxt_sp_task() require us to clear BNXT_STATE_IN_SP_TASK and then
acquire rtnl_lock() to prevent race conditions.
There are some bugs related to this logic. This patch refactors the code
to have common bnxt_rtnl_lock_sp() and bnxt_rtnl_unlock_sp() to handle
the RTNL and the clearing/setting of the bit. Multiple functions will
need the same logic. We also need to move bnxt_reset() to the end of
bnxt_sp_task(). Functions that clear BNXT_STATE_IN_SP_TASK must be the
last functions to be called in bnxt_sp_task(). The common scheme will
handle the condition properly.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 719ca8111402aa6157bd83a3c966d184db0d8956
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Jan 17 22:07:19 2017 -0500
bnxt_en: Fix "uninitialized variable" bug in TPA code path.
In the TPA GRO code path, initialize the tcp_opt_len variable to 0 so
that it will be correct for packets without TCP timestamps. The bug
caused the SKB fields to be incorrectly set up for packets without
TCP timestamps, leading to these packets being rejected by the stack.
Reported-by: Andy Gospodarek <andrew.gospodarek@broadocm.com>
Acked-by: Andy Gospodarek <andrew.gospodarek@broadocm.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2f5938467bd7f34e59a1d6d3809f5970f62e194b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jan 13 01:32:04 2017 -0500
bnxt_en: Add the ulp_sriov_cfg hooks for bnxt_re RDMA driver.
Add the ulp_sriov_cfg callbacks when the number of VFs is changing. This
allows the RDMA driver to provision RDMA resources for the VFs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5ad2cbeed74bd1e89ac4ba14288158ec7eb167da
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jan 13 01:32:03 2017 -0500
bnxt_en: Add support for ethtool -p.
Add LED blinking code to support ethtool -p on the PF.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f183886c0d798ca3cf0a51e8cab3c1902fbd1e8b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jan 13 01:32:02 2017 -0500
bnxt_en: Update to firmware interface spec to 1.6.1.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 341138c3e6afa8e77f9f3e773d72b37022dbcee8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jan 13 01:32:01 2017 -0500
bnxt_en: Clear TPA flags when BNXT_FLAG_NO_AGG_RINGS is set.
Commit bdbd1eb59c56 ("bnxt_en: Handle no aggregation ring gracefully.")
introduced the BNXT_FLAG_NO_AGG_RINGS flag. For consistency,
bnxt_set_tpa_flags() should also clear TPA flags when there are no
aggregation rings.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b742995445fbac874f5fe19ce2afc76c7a6ac2cf
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jan 13 01:32:00 2017 -0500
bnxt_en: Fix compiler warnings when CONFIG_RFS_ACCEL is not defined.
CC [M] drivers/net/ethernet/broadcom/bnxt/bnxt.o
drivers/net/ethernet/broadcom/bnxt/bnxt.c:4947:21: warning: bnxt_get_max_func_rss_ctxs defined but not used [-Wunused-function]
static unsigned int bnxt_get_max_func_rss_ctxs(struct bnxt *bp)
^
CC [M] drivers/net/ethernet/broadcom/bnxt/bnxt.o
drivers/net/ethernet/broadcom/bnxt/bnxt.c:4956:21: warning: bnxt_get_max_func_vnics defined but not used [-Wunused-function]
static unsigned int bnxt_get_max_func_vnics(struct bnxt *bp)
^
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5944701df90d9577658e2354cc27c4ceaeca30fe
Author: stephen hemminger <stephen@networkplumber.org>
Date: Fri Jan 6 19:12:53 2017 -0800
net: remove useless memset's in drivers get_stats64
In dev_get_stats() the statistic structure storage has already been
zeroed. Therefore network drivers do not need to call memset() again.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bc1f44709cf27fb2a5766cadafe7e2ad5e9cb221
Author: stephen hemminger <stephen@networkplumber.org>
Date: Fri Jan 6 19:12:52 2017 -0800
net: make ndo_get_stats64 a void function
The network device operation for reading statistics is only called
in one place, and it ignores the return value. Having a structure
return value is potentially confusing because some future driver could
incorrectly assume that the return value was used.
Fix all drivers with ndo_get_stats64 to have a void function.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bdbd1eb59c565c56a74d21076e2ae8706de00ecd
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:43 2016 -0500
bnxt_en: Handle no aggregation ring gracefully.
The current code assumes that we will always have at least 2 rx rings, 1
will be used as an aggregation ring for TPA and jumbo page placements.
However, it is possible, especially on a VF, that there is only 1 rx
ring available. In this scenario, the current code will fail to initialize.
To handle it, we need to properly set up only 1 ring without aggregation.
Set a new flag BNXT_FLAG_NO_AGG_RINGS for this condition and add logic to
set up the chip to place RX data linearly into a single buffer per packet.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 486b5c22ea1d35e00e90dd79a32a9ee530b18915
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:42 2016 -0500
bnxt_en: Set default completion ring for async events.
With the added support for the bnxt_re RDMA driver, both drivers can be
allocating completion rings in any order. The firmware does not know
which completion ring should be receiving async events. Add an
extra step to tell firmware the completion ring number for receiving
async events after bnxt_en allocates the completion rings.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 391be5c2736456f032fe0265031ecfe17aee84a0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:41 2016 -0500
bnxt_en: Implement new scheme to reserve tx rings.
In order to properly support TX rate limiting in SRIOV VF functions or
NPAR functions, firmware needs better control over tx ring allocations.
The new scheme requires the driver to reserve the number of tx rings
and to query to see if the requested number of tx rings is reserved.
The driver will use the new scheme when the firmware interface spec is
1.6.1 or newer.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dda0e7465f040ed814d4a5c98c6bf042e59cba69
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:40 2016 -0500
bnxt_en: Add IPV6 hardware RFS support.
Accept ipv6 flows in .ndo_rx_flow_steer() and support ETHTOOL_GRXCLSRULE
ipv6 flows.
Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8427af811a2fcbbf0c71a4b1f904f2442abdcf39
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:39 2016 -0500
bnxt_en: Assign additional vnics to VFs.
Assign additional vnics to VFs whenever possible so that NTUPLE can be
supported on the VFs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ae10ae740ad2befd92b6f5b2ab39220bce6e5da2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:38 2016 -0500
bnxt_en: Add new hardware RFS mode.
The existing hardware RFS mode uses one hardware RSS context block
per ring just to calculate the RSS hash. This is very wasteful and
prevents VF functions from using it. The new hardware mode shares
the same hardware RSS context for RSS placement and RFS steering.
This allows VFs to enable RFS.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8079e8f107bf02e1e5ece89239dd2fb475a4735f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:37 2016 -0500
bnxt_en: Refactor code that determines RFS capability.
Add function bnxt_rfs_supported() that determines if the chip supports
RFS. Refactor the existing function bnxt_rfs_capable() that determines
if run-time conditions support RFS.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8fdefd63c203d9b2955d679704f4ed92bf40752c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:36 2016 -0500
bnxt_en: Add function to get vnic capability.
The new vnic RSS capability will enhance NTUPLE support, to be added
in subsequent patches.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5910906ca9ee32943f67db24917f78a9ad1087db
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:35 2016 -0500
bnxt_en: Refactor TPA code path.
Call tcp_gro_complete() in the common code path instead of the chip-
specific method. The newer 5731x method is missing the call.
Signed-off-by: Michael Chan <michael.chan@broadcmo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 68515a186cf8a8f97956eaea5829277752399f58
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:34 2016 -0500
bnxt_en: Fix and clarify link_info->advertising.
The advertising field is closely related to the auto_link_speeds field.
The former is the user setting while the latter is the firmware setting.
Both should be u16. We should use the advertising field in
bnxt_get_link_ksettings because the auto_link_speeds field may not
be updated with the latest from the firmware yet.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9d8bc09766f1a229b2d204c713a1cfc6c7fa1bb1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:33 2016 -0500
bnxt_en: Improve the IRQ disable sequence during shutdown.
The IRQ is disabled by writing to the completion ring doorbell. This
should be done before the hardware completion ring is freed for correctness.
The current code disables IRQs after all the completion rings are freed.
Fix it by calling bnxt_disable_int_sync() before freeing the completion
rings. Rearrange the code to avoid forward declaration.
Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e7b9569102995ebc26821789628eef45bd9840d8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:32 2016 -0500
bnxt_en: Use napi_complete_done()
For better busy polling and GRO support. Do not re-arm IRQ if
napi_complete_done() returns false.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b356a2e729cec145a648d22ba5686357c009da25
Author: Michael Chan <michael.chan@broadcom.com>
Date: Thu Dec 29 12:13:31 2016 -0500
bnxt_en: Remove busy poll logic in the driver.
Use native NAPI polling instead. The next patch will complete the work
by switching to use napi_complete_done()
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a588e4580a7ecb715dab8bf09725b97aa0e0e3a0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 7 00:26:21 2016 -0500
bnxt_en: Add interface to support RDMA driver.
Since the network driver and RDMA driver operate on the same PCI function,
we need to create an interface to allow the RDMA driver to share resources
with the network driver.
1. Create a new bnxt_en_dev struct which will be returned by
bnxt_ulp_probe() upon success. After that, all calls from the RDMA driver
to bnxt_en will pass a pointer to this struct.
2. This struct contains additional function pointers to register, request
msix, send fw messages, register for async events.
3. If the RDMA driver wants to enable RDMA on the function, it needs to
call the function pointer bnxt_register_device(). A ulp_ops structure
is passed for RCU protected upcalls from bnxt_en to the RDMA driver.
4. The RDMA driver can call firmware APIs using the bnxt_send_fw_msg()
function pointer.
5. 1 stats context is reserved when the RDMA driver registers. MSIX
and completion rings are reserved when the RDMA driver calls
bnxt_request_msix() function pointer.
6. When the RDMA driver calls bnxt_unregister_device(), all RDMA resources
will be cleaned up.
v2: Fixed 2 uninitialized variable warnings.
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a1653b13f14c714f9bfd5e10c603a37c3bcba7b6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 7 00:26:20 2016 -0500
bnxt_en: Refactor the driver registration function with firmware.
The driver register function with firmware consists of passing version
information and registering for async events. To support the RDMA driver,
the async events that we need to register may change. Separate the
driver register function into 2 parts so that we can just update the
async events for the RDMA driver.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e4060d306b5196966d74e05dee48e6c3a52aaad4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 7 00:26:19 2016 -0500
bnxt_en: Reserve RDMA resources by default.
If the device supports RDMA, we'll setup network default rings so that
there are enough minimum resources for RDMA, if possible. However, the
user can still increase network rings to the max if he wants. The actual
RDMA resources won't be reserved until the RDMA driver registers.
v2: Fix compile warning when BNXT_CONFIG_SRIOV is not set.
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7b08f661ab80e87dcdba7ab9a460fe2c9d08bf5b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 7 00:26:18 2016 -0500
bnxt_en: Improve completion ring allocation for VFs.
All available remaining completion rings not used by the PF should be
made available for the VFs so that there are enough rings in the VF to
support RDMA. The earlier workaround code of capping the rings by the
statistics context is removed.
When SRIOV is disabled, call a new function bnxt_restore_pf_fw_resources()
to restore FW resources. Later on we need to add some logic to account
for RDMA resources.
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit aa8ed021ab515a93f2a052e9cc80320882889698
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 7 00:26:17 2016 -0500
bnxt_en: Move function reset to bnxt_init_one().
Now that MSIX is enabled in bnxt_init_one(), resources may be allocated by
the RDMA driver before the network device is opened. So we cannot do
function reset in bnxt_open() which will clear all the resources.
The proper place to do function reset now is in bnxt_init_one().
If we get AER, we'll do function reset as well.
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7809592d3e2ec79cd1feab0cc96169d22f6ffee1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 7 00:26:16 2016 -0500
bnxt_en: Enable MSIX early in bnxt_init_one().
To better support the new RDMA driver, we need to move pci_enable_msix()
from bnxt_open() to bnxt_init_one(). This way, MSIX vectors are available
to the RDMA driver whether the network device is up or down.
Part of the existing bnxt_setup_int_mode() function is now refactored into
a new bnxt_init_int_mode(). bnxt_init_int_mode() is called during
bnxt_init_one() to enable MSIX. The remaining logic in
bnxt_setup_int_mode() to map the IRQs to the completion rings is called
during bnxt_open().
v2: Fixed compile warning when CONFIG_BNXT_SRIOV is not set.
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 33c2657eb688a063ab9cbe11fd4d18c93c7945e1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Dec 7 00:26:15 2016 -0500
bnxt_en: Add bnxt_set_max_func_irqs().
By refactoring existing code into this new function. The new function
will be used in subsequent patches.
v2: Fixed compile warning when CONFIG_BNXT_SRIOV is not set.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 89aa8445cd4e8c2556c40d42dd0ceb2cbb96ba78
Author: Pan Bian <bianpan2016@163.com>
Date: Sat Dec 3 17:56:17 2016 +0800
netdev: broadcom: propagate error code
Function bnxt_hwrm_stat_ctx_alloc() always returns 0, even if the call
to _hwrm_send_message() fails. It may be better to propagate the errors
to the caller of bnxt_hwrm_stat_ctx_alloc().
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188661
Signed-off-by: Pan Bian <bianpan2016@163.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c77192f2042537b1e0e5f520db91e4d28778195f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Dec 2 21:17:18 2016 -0500
bnxt_en: Add PFC statistics.
Report PFC statistics to ethtool -S and DCBNL.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7df4ae9fe85567a1710048da8229bd85e0da9df7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Dec 2 21:17:17 2016 -0500
bnxt_en: Implement DCBNL to support host-based DCBX.
Support only IEEE DCBX initially. Add IEEE DCBNL ops and functions to
get and set the hardware DCBX parameters. The DCB code is conditional on
Kconfig CONFIG_BNXT_DCB.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 87c374ded0b2cfe50bb1e7648a4ca06df13fa399
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Dec 2 21:17:16 2016 -0500
bnxt_en: Update firmware header file to latest 1.6.0.
Latest interface has the latest DCB command structs. Get and store the
max number of lossless TCs the hardware can support.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c5e3deb8a38453037b89e0b0485d3b031896e8eb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Dec 2 21:17:15 2016 -0500
bnxt_en: Re-factor bnxt_setup_tc().
Add a new function bnxt_setup_mq_tc() to handle MQPRIO. This new function
will be called during ETS setup when we add DCBNL in the next patch.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 57aac71b3e9ed890cf2219dd980c36f859b43d6a
Author: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Date: Tue Nov 22 06:14:40 2016 +0100
bnxt_en: Fix a VXLAN vs GENEVE issue
Knowing that:
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN (0x1UL << 0)
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE (0x5UL << 0)
and that 'bnxt_hwrm_tunnel_dst_port_alloc()' is only called with one of
these 2 constants, the TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE can not
trigger.
Replace the bit test that overlap by an equality test, just as in
'bnxt_hwrm_tunnel_dst_port_free()' above.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e5f6f564fd191d365fcd775c06a732a488205588
Author: Eric Dumazet <edumazet@google.com>
Date: Wed Nov 16 06:31:52 2016 -0800
bnxt: add a missing rcu synchronization
Add a missing synchronize_net() call to avoid potential use after free,
since we explicitly call napi_hash_del() to factorize the RCU grace
period.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a011952a1a465258ab006a8613a41aa5367d2274
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Nov 16 21:13:10 2016 -0500
bnxt_en: Add ethtool -n|-N rx-flow-hash support.
To display and modify the RSS hash.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 87da7f796d5e44311ea69afb6f4220d43a89382e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Nov 16 21:13:09 2016 -0500
bnxt_en: Add UDP RSS support for 57X1X chips.
The newer chips have proper support for 4-tuple UDP RSS.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 286ef9d64ea7435a1e323d12b44a309e15cbff0e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Nov 16 21:13:08 2016 -0500
bnxt_en: Enhance autoneg support.
On some dual port NICs, the speed setting on one port can affect the
available speed on the other port. Add logic to detect these changes
and adjust the advertised speed settings when necessary.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 16d663a69f4a1f3534e780e35d50142b98cf1279
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed Nov 16 21:13:07 2016 -0500
bnxt_en: Update firmware interface spec to 1.5.4.
Use the new FORCE_LINK_DWN bit to shutdown link during close.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 73b9bad63ae3c902ce64221d10a0d371d059748d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Nov 11 00:11:43 2016 -0500
bnxt_en: Fix VF virtual link state.
If the physical link is down and the VF virtual link is set to "enable",
the current code does not always work. If the link is down but the
cable is attached, the firmware returns LINK_SIGNAL instead of
NO_LINK. The current code is treating LINK_SIGNAL as link up.
The fix is to treat link as down when the link_status != LINK.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3ffb6a39b751b635a0c50b650064c38b8d371ef2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Nov 11 00:11:42 2016 -0500
bnxt_en: Fix ring arithmetic in bnxt_setup_tc().
The logic is missing the check on whether the tx and rx rings are sharing
completion rings or not.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ef8d759b5251ee9d6784fe53d90220bd91ee477f
Author: Eric Dumazet <edumazet@google.com>
Date: Tue Nov 8 11:06:53 2016 -0800
bnxt_en: do not call napi_hash_add()
This is automatically done from netif_napi_add(), and we want to not
export napi_hash_add() anymore in the following patch.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e1c6dccaf3af291488fbad155d7ee6bc29db262a
Author: Jarod Wilson <jarod@redhat.com>
Date: Mon Oct 17 15:54:04 2016 -0400
ethernet/broadcom: use core min/max MTU checking
tg3: min_mtu 60, max_mtu 9000/1500
bnxt: min_mtu 60, max_mtu 9000
bnx2x: min_mtu 46, max_mtu 9600
- Fix up ETH_OVREHEAD -> ETH_OVERHEAD while we're in here, remove
duplicated defines from bnx2x_link.c.
bnx2: min_mtu 46, max_mtu 9000
- Use more standard ETH_* defines while we're at it.
bcm63xx_enet: min_mtu 46, max_mtu 2028
- compute_hw_mtu was made largely pointless, and thus merged back into
bcm_enet_change_mtu.
b44: min_mtu 60, max_mtu 1500
CC: netdev@vger.kernel.org
CC: Michael Chan <michael.chan@broadcom.com>
CC: Sony Chacko <sony.chacko@qlogic.com>
CC: Ariel Elior <ariel.elior@qlogic.com>
CC: Dept-HSGLinuxNICDev@qlogic.com
CC: Siva Reddy Kallam <siva.kallam@broadcom.com>
CC: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 79aab093a0b5370d7fc4e99df75996f4744dc03f
Author: Moshe Shemesh <moshe@mellanox.com>
Date: Thu Sep 22 12:11:15 2016 +0300
net: Update API for VF vlan protocol 802.1ad support
Introduce new rtnl UAPI that exposes a list of vlans per VF, giving
the ability for user-space application to specify it for the VF, as an
option to support 802.1ad.
We adjusted IP Link tool to support this option.
For future use cases, the new UAPI supports multiple vlans. For now we
limit the list size to a single vlan in kernel.
Add IFLA_VF_VLAN_LIST in addition to IFLA_VF_VLAN to keep backward
compatibility with older versions of IP Link tool.
Add a vlan protocol parameter to the ndo_set_vf_vlan callback.
We kept 802.1Q as the drivers' default vlan protocol.
Suitable ip link tool command examples:
Set vf vlan protocol 802.1ad:
ip link set eth0 vf 1 vlan 100 proto 802.1ad
Set vf to VST (802.1Q) mode:
ip link set eth0 vf 1 vlan 100 proto 802.1Q
Or by omitting the new parameter
ip link set eth0 vf 1 vlan 100
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 878786d95e07ce2f5fb6e3cd8a6c2ed320339196
Author: Rob Swindell <swindell@broadcom.com>
Date: Tue Sep 20 03:36:33 2016 -0400
bnxt_en: Fix build error for kernesl without RTC-LIB
bnxt_hwrm_fw_set_time() now returns -EOPNOTSUPP when built for kernel
without RTC_LIB. Setting the firmware time is not critical to the
successful completion of the firmware update process.
Signed-off-by: Rob Swindell <Rob.Swindell@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 350a714960eb8a980c913c9be5a96bb18b2fe9da
Author: Eddie Wai <eddie.wai@broadcom.com>
Date: Mon Sep 19 03:58:09 2016 -0400
bnxt_en: Fixed the VF link status after a link state change
The VF link state can be changed via the 'ip link set' cmd.
Currently, the new link state does not take effect immediately.
The fix is for the PF to send a link change async event to the
designated VF after a VF link state change. This async event will
trigger the VF to update the link status.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ae8e98a6fa7a73917196c507e43414ea96b6a0fc
Author: Deepak Khungar <deepak.khungar@broadcom.com>
Date: Mon Sep 19 03:58:08 2016 -0400
bnxt_en: Support for "ethtool -r" command
Restart autoneg if autoneg is enabled.
Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4ffcd582301bd020b1f9d00c55473af305ec19b5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 19 03:58:07 2016 -0400
bnxt_en: Pad TX packets below 52 bytes.
The hardware has a limitation that it won't pass host to BMC loopback
packets below 52-bytes.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 001154eb242b5a6667b74e5cf20873fb75f1b9d3
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 19 03:58:06 2016 -0400
bnxt_en: Call firmware to approve the random VF MAC address.
After generating the random MAC address for VF, call the firmware to
approve it. This step serves 2 purposes. Some hypervisor (e.g. ESX)
wants to approve the MAC address. 2nd, the call will setup the
proper forwarding database in the internal switch.
We need to unlock the hwrm_cmd_lock mutex before calling bnxt_approve_mac().
We can do that because we are at the end of the function and all the
previous firmware response data has been copied.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7cc5a20e38fcaf395ac59e7ed6c3decb575a0dc7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 19 03:58:05 2016 -0400
bnxt_en: Re-arrange bnxt_hwrm_func_qcaps().
Re-arrange the code so that the generation of the random MAC address for
the VF is at the end of the function. The next patch will add one more step
to call bnxt_approve_mac() to get the firmware to approve the random MAC
address.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 47f8e8b9bbbbe00740786bd1da0d5097d45ba46b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 19 03:58:04 2016 -0400
bnxt_en: Fix ethtool -l|-L inconsistent channel counts.
The existing code is inconsistent in reporting and accepting the combined
channel count. bnxt_get_channels() reports maximum combined as the
maximum rx count. bnxt_set_channels() accepts combined count that
cannot be bigger than max rx or max tx.
For example, if max rx = 2 and max tx = 1, we report max supported
combined to be 2. But if the user tries to set combined to 2, it will
fail because 2 is bigger than max tx which is 1.
Fix the code to be consistent. Max allowed combined = max(max_rx, max_tx).
We will accept a combined channel count <= max(max_rx, max_tx).
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5ac67d8bc753b122175e682274599338b3ee7d42
Author: Rob Swindell <Rob.Swindell@broadcom.com>
Date: Mon Sep 19 03:58:03 2016 -0400
bnxt_en: Added support for Secure Firmware Update
Using Ethtool flashdev command, entire NVM package (*.pkg) files
may now be staged into the "update" area of the NVM and subsequently
verified and installed by the firmware using the newly introduced
command: NVM_INSTALL_UPDATE.
We also introduce use of the new firmware command FW_SET_TIME so that the
NVM-resident package installation log contains valid time-stamps.
Signed-off-by: Rob Swindell <Rob.Swindell@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 441cabbbf1bd0b99e283c9116fe430e53ee67a4a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 19 03:58:02 2016 -0400
bnxt_en: Update to firmware interface spec 1.5.1.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit adbc830545003c4b7494c903654bea22e5a66bb4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 19 03:58:01 2016 -0400
bnxt_en: Simplify PCI device names and add additinal PCI IDs.
Remove "Single-port/Dual-port" from the device names. Dual-port devices
will appear as 2 separate devices, so no need to call each a dual-port
device. Use a more generic name for VF devices belonging to the same
chip fanmily. Add some remaining NPAR device IDs.
Signed-off-by: David Christensen <david.christensen@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8d6be8b627389c6dc7e0ea2455a7542c8a2a16a7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 19 03:58:00 2016 -0400
bnxt_en: Use RSS flags defined in the bnxt_hsi.h file.
And remove redundant definitions of the same flags.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9d13744bb75078175ab49408f2abb980e4dbccc9
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Sep 5 01:57:35 2016 -0400
bnxt_en: Fix TX push operation on ARM64.
There is a code path where we are calling __iowrite64_copy() on
an address that is not 64-bit aligned. This causes an exception on
some architectures such as arm64. Fix that code path by using
__iowrite32_copy().
Reported-by: JD Zheng <jiandong.zheng@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1f681688aaf1126df981615064a68a0dced458ef
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 25 12:33:37 2016 -0400
bnxt_en: Add new NPAR and dual media device IDs.
Add 5741X/5731X NPAR device IDs and dual media SFP/10GBase-T device IDs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a23049091d57f4bdc47f16fce01c371647d15dd7
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon Jul 25 12:33:36 2016 -0400
bnxt_en: Log a message, if enabling NTUPLE filtering fails.
If there are not enough resources to enable ntuple filtering,
log a warning message.
v2: Use single message and add missing newline.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a54c4d74989b769014b359e5b66f3e571d903d25
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jul 25 12:33:35 2016 -0400
bnxt_en: Improve ntuple filters by checking destination MAC address.
Include the destination MAC address in the ntuple filter structure. The
current code assumes that the destination MAC address is always the MAC
address of the NIC. This may not be true if there are macvlans, for
example. Add destination MAC address checking and configure the filter
correctly using the correct index for the destination MAC address.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cbce91cad4ee39070bf3c7873767194e4be88e16
Author: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon Jul 18 13:02:47 2016 -0700
bnxt_en: Remove locking around txr->dev_state
txr->dev_state was not consistently manipulated with the acquisition of
the per-queue lock, after further inspection the lock does not seem
necessary, either the value is read as BNXT_DEV_STATE_CLOSING or 0.
Reported-by: coverity (CID 1339583)
Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fa853dda19a1878d2a586de19f02bc9fed052425
Author: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Date: Mon Jul 18 07:15:25 2016 -0400
bnxt_en: Add BCM58700 PCI device ID for NS2 Nitro.
A bridge device in NS2 has the same device ID as the ethernet controller.
Add check to avoid probing the bridge device.
Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dc52c6c70e0066e9cef886907f820411bebe8e07
Author: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Date: Mon Jul 18 07:15:24 2016 -0400
bnxt_en: Workaround Nitro A0 RX hardware bug (part 4).
Allocate special vnic for dropping packets not matching the RX filters.
First vnic is for normal RX packets and the driver will drop all
packets on the 2nd vnic.
Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 10bbdaf5e4879fd7fc51f25c84d7b10de16cbe0e
Author: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Date: Mon Jul 18 07:15:23 2016 -0400
bnxt_en: Workaround Nitro A0 hardware RX bug (part 3).
Allocate napi for special vnic, packets arriving on this
napi will simply be dropped and the buffers will be replenished back
to the HW.
Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 765951938e2fe2e30571ef4a7de6a46659ce4c68
Author: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Date: Mon Jul 18 07:15:22 2016 -0400
bnxt_en: Workaround Nitro A0 hardware RX bug (part 2).
The hardware is unable to drop rx packets not matching the RX filters. To
workaround it, we create a special VNIC and configure the hardware to
direct all packets not matching the filters to it. We then setup the
driver to drop packets received on this VNIC.
This patch creates the infrastructure for this VNIC, reserves a
completion ring, and rx rings. Only shared completion ring mode is
supported. The next 2 patches add a NAPI to handle packets from this
VNIC and the setup of the VNIC.
Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 94ce9caa0f75b0d56e69550e84d7a1653f0ef3b0
Author: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Date: Mon Jul 18 07:15:21 2016 -0400
bnxt_en: Workaround Nitro A0 hardware RX bug (part 1).
Nitro A0 has a hardware bug in the rx path. The workaround is to create
a special COS context as a path for non-RSS (non-IP) packets. Without this
workaround, the chip may stall when receiving RSS and non-RSS packets.
Add infrastructure to allow 2 contexts (RSS and CoS) per VNIC. Allocate
and configure the CoS context for Nitro A0.
Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3e8060fa837630f6fb4acbf59ba588c6df5b2f50
Author: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Date: Mon Jul 18 07:15:20 2016 -0400
bnxt_en: Add basic support for Nitro in North Star 2.
Nitro is the embedded version of the ethernet controller in the North
Star 2 SoC. Add basic code to recognize the chip ID and disable
the features (ntuple, TPA, ring and port statistics) not supported on
Nitro A0.
Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f3ea3119ad75dde0ba3e8da4653dbd5a189688e5
Author: Colin Ian King <colin.king@canonical.com>
Date: Fri Jul 8 16:42:48 2016 +0100
bnxt_en: initialize rc to zero to avoid returning garbage
rc is not initialized so it can contain garbage if it is not
set by the call to bnxt_read_sfp_module_eeprom_info. Ensure
garbage is not returned by initializing rc to 0.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 09a7636a5b151670072de60767ddf096dc7bd12e
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu Jul 7 11:23:09 2016 +0300
bnxt: fix a condition
This code generates as static checker warning because htons(ETH_P_IPV6)
is always true. From the context it looks like the && was intended to
be !=.
Fixes: 94758f8de037 ('bnxt_en: Add GRO logic for BCM5731X chips.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 51f307856b60e6b10975654e15bc236aa87b53d7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jul 1 18:46:29 2016 -0400
bnxt_en: Allow statistics DMA to be configurable using ethtool -C.
The allowable range is 0.25 seconds to 1 second interval. Default is
1 second.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 87027db19c30aafb8ff8d98e1c8802bc920f7b32
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jul 1 18:46:28 2016 -0400
bnxt_en: Assign netdev->dev_port with port ID.
This is useful for multi-function devices.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 17c71ac38134c3369479e34911b2035a85566caf
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jul 1 18:46:27 2016 -0400
bnxt_en: Allow promiscuous mode for VF if default VLAN is enabled.
With a default VLAN, the VF has its own VLAN domain and it can receive
all traffic within that domain.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dc7aadb5133846f738c59da7af3261335af35ad3
Author: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri Jul 1 18:46:26 2016 -0400
bnxt_en: Increase maximum supported MTU to 9500.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 550feebf5cb075f7576b3cfe9bcf05abc1ffb8cd
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jul 1 18:46:25 2016 -0400
bnxt_en: Enable MRU enables bit when configuring VNIC MRU.
For correctness, the MRU enables bit must be set when passing the
MRU to firmware during vnic configuration.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 93e0b4feb90cc651f7fbdfe07c257a969c51d1bb
Author: Rob Swindell <rob.swindell@broadcom.com>
Date: Fri Jul 1 18:46:24 2016 -0400
bnxt_en: Add support for firmware updates for additional processors.
Add support to the Ethtool FLASHDEV command handler for additional
firmware types to cover all the on-chip processors.
Signed-off-by: Rob Swindell <rob.swindell@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 08141e0bf4f6cb82d51930e34e6a8e4af46c776f
Author: Rob Swindell <rob.swindell@broadcom.com>
Date: Fri Jul 1 18:46:23 2016 -0400
bnxt_en: Request firmware reset after successful firwmare update
Upon successful mgmt processor firmware update, request a self
reset upon next PCIe reset (e.g. system reboot).
Signed-off-by: Rob Swindell <rob.swindell@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a4c363471f2fa2b0f0abbd9f0563b034340585c3
Author: Rob Swindell <rob.swindell@broadcom.com>
Date: Fri Jul 1 18:46:22 2016 -0400
bnxt_en: Add support for updating flash more securely
To support Secure Firmware Update, we must be able to allocate
a staging area in the Flash. This patch adds support for the
"update" type to tell firmware to do that.
Signed-off-by: Rob Swindell <rob.swindell@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2a5bedfa674cf81d60a20a76f456778834bd2123
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jul 1 18:46:21 2016 -0400
bnxt_en: Do function reset on the 1st PF open only.
Calling the firmware to do function reset on the PF will kill all the VFs.
To prevent that, we call function reset on the 1st PF open before any VF
can be activated. On subsequent PF opens (with possibly some active VFs),
a bit has been set and we'll skip the function reset. VF driver will
always do function reset on every open. If there is an AER event, we will
always do function reset.
Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a58a3e68037647de78e3461194239a1104f76003
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jul 1 18:46:20 2016 -0400
bnxt_en: Update firmware spec. to 1.3.0.
And update driver version to 1.3.0.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 75362a3fd4e37ff8af1ef5e3d9f2d9d5ccf2f3ab
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Jul 1 18:46:19 2016 -0400
bnxt_en: VF/NPAR should return -EOPNOTSUPP for unsupported ethtool ops.
Returning 0 for doing nothing is confusing to the user.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7cdd5fc376a51cdf191895c23badd699eddbc901
Author: Alexander Duyck <aduyck@mirantis.com>
Date: Thu Jun 16 12:21:36 2016 -0700
bnxt: Move GENEVE support from hard-coded port to using port notifier
The port number for GENEVE is hard coded into the bnxt driver. This is the
kind of thing we want to avoid going forward. For now I will integrate
this back into the port notifier so that we can change the GENEVE port
number if we need to in the future.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ad51b8e9f9f4f8172eb7a6219d3005861bfb9a57
Author: Alexander Duyck <aduyck@mirantis.com>
Date: Thu Jun 16 12:21:19 2016 -0700
bnxt: Update drivers to support unified UDP encapsulation offload functions
This patch ends up doing several things. First it updates the driver to
make use of the new unified UDP tunnel offload notifier functions. In
addition I updated the code so that we can work around the bits that were
checking for if VXLAN was enabled since we are now using a notifier based
setup.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 00c04a928572991d30b2473a7e992c1be8e646f3
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:38 2016 -0400
bnxt_en: Support new ETHTOOL_{G|S}LINKSETTINGS API.
To fully support 25G and 50G link settings.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 93ed8117336485af2cedb069d28f3d4270fb90a1
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:37 2016 -0400
bnxt_en: Don't allow autoneg on cards that don't support it.
Some cards do not support autoneg. The current code does not prevent the
user from enabling autoneg with ethtool on such cards, causing confusion.
Firmware provides the autoneg capability information and we just need to
store it in the support_auto_speeds field in bnxt_link_info struct.
The ethtool set_settings() call will check this field before proceeding
with autoneg.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b24eb6ae7058ca1a42b0532489e5f5796c107d65
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:36 2016 -0400
bnxt_en: Add BCM5731X and BCM5741X device IDs.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 94758f8de037cf5c62eb56287f5d5e937cda8c9b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:35 2016 -0400
bnxt_en: Add GRO logic for BCM5731X chips.
Add bnxt_gro_func_5731x() to handle GRO packets for this chip. The
completion structures used in the new chip have new data to help determine
the header offsets. The offsets can be off by 4 if the packet is an
internal loopback packet (e.g. from one VF to another VF). Some additional
logic is added to adjust the offsets if it is a loopback packet.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 309369c9b3f6a8665e581d9014f222b602f6845a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:34 2016 -0400
bnxt_en: Refactor bnxt_gro_skb().
Newer chips require different logic to handle GRO packets. So refactor
the code so that we can call different functions depending on the chip.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 659c805cc01b3c5a6d972db0408164371a2bab4b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:33 2016 -0400
bnxt_en: Define the supported chip numbers.
Define all the supported chip numbers and chip categories. Store the
chip_num returned by firmware. If the call to get the version and chip
number fails, we should abort.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ebcd4eeb2a0b4859d7aaa3308b222a30d51a643f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:32 2016 -0400
bnxt_en: Add PCI device ID for 57404 NPAR devices.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 567b2abe68551781b725b3b739672da41cb92ef0
Author: Satish Baddipadige <sbaddipa@broadcom.com>
Date: Mon Jun 13 02:25:31 2016 -0400
bnxt_en: Enable NPAR (NIC Partitioning) Support.
NPAR type is read from bnxt_hwrm_func_qcfg. Do not allow changing link
parameters if in NPAR mode sinc ethe port is shared among multiple
partitions. The link parameters are set up by firmware.
Signed-off-by: Satish Baddipadige <sbaddipa@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fc0f19294d1ffaf9366b10d966f86e6cf13335a4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:30 2016 -0400
bnxt_en: Handle VF_CFG_CHANGE event from firmware.
When the VF driver gets this event, the VF configuration has changed (such
as default VLAN). The VF driver will initiate a silent reset to pick up
the new configuration.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6988bd920c6ea53497ed15db947408b7488c9e36
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:29 2016 -0400
bnxt_en: Add new function bnxt_reset().
When a default VLAN is added to the VF, the VF driver needs to reset to
pick up the default VLAN ID. We can use the same tx timeout reset logic
to do that, without the debug output. This new function, with the
silent parameter to suppress debug output will now serve both purposes.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit cf6645f8ebc69775a857b7c51928f3ad9e37aa66
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 13 02:25:28 2016 -0400
bnxt_en: Add function for VF driver to query default VLAN.
The PF can setup a default VLAN for a VF. The default VLAN tag is
automatically inserted and stripped without the knowledge of the
stack running on the VF. The VF driver needs to know that default
VLAN is enabled as VLAN acceleration on the RX side is no longer
supported. Call netdev_update_features() to fix up the VLAN features
as necessary. Also, VLAN strip mode must be enabled to strip out
the default VLAN tag.
Only allow VF default VLAN to be set if the firmware spec is >= 1.2.1.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8852ddb4dcdfe6f877a02f79bf2bca9ae63c039a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 6 02:37:16 2016 -0400
bnxt_en: Simplify VLAN receive logic.
Since both CTAG and STAG rx acceleration must be enabled together, we
only need to check one feature flag (NETIF_F_HW_VLAN_CTAG_RX) before
calling __vlan_hwaccel_put_tag().
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5a9f6b238e59bc05afb4cdeaf3672990bf2a5309
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 6 02:37:15 2016 -0400
bnxt_en: Enable and disable RX CTAG and RX STAG VLAN acceleration together.
The hardware can only be set to strip or not strip both the VLAN CTAG and
STAG. It cannot strip one and not strip the other. Add logic to
bnxt_fix_features() to toggle both feature flags when the user is toggling
one of them.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b9a8460a08a1e0150073cda3e7a0dd23cb888052
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Jun 6 02:37:14 2016 -0400
bnxt_en: Fix tx push race condition.
Set the is_push flag in the software BD before the tx data is pushed to
the chip. It is possible to get the tx interrupt as soon as the tx data
is pushed. The tx handler will not handle the event properly if the
is_push flag is not set and it will crash.
Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7e13318daa4a67bff2f800923a993ef3818b3c53
Author: Tom Herbert <tom@herbertland.com>
Date: Wed May 18 09:06:10 2016 -0700
net: define gso types for IPx over IPv4 and IPv6
This patch defines two new GSO definitions SKB_GSO_IPXIP4 and
SKB_GSO_IPXIP6 along with corresponding NETIF_F_GSO_IPXIP4 and
NETIF_F_GSO_IPXIP6. These are used to described IP in IP
tunnel and what the outer protocol is. The inner protocol
can be deduced from other GSO types (e.g. SKB_GSO_TCPV4 and
SKB_GSO_TCPV6). The GSO types of SKB_GSO_IPIP and SKB_GSO_SIT
are removed (these are both instances of SKB_GSO_IPXIP4).
SKB_GSO_IPXIP6 will be used when support for GSO with IP
encapsulation over IPv6 is added.
Signed-off-by: Tom Herbert <tom@herbertland.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b67daab033293b3882ba4dc926ffb084d70044e0
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 15 03:04:51 2016 -0400
bnxt_en: Use dma_rmb() instead of rmb().
Use the weaker but more appropriate dma_rmb() to order the reading of
the completion ring.
Suggested-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 5049e33b559a44e9f216d86c58c7c7fce6f5df2f
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 15 03:04:50 2016 -0400
bnxt_en: Add BCM57314 device ID.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 10289bec0072b13f629a654d94faf1dadd44f335
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 15 03:04:49 2016 -0400
bnxt_en: Simplify and improve unsupported SFP+ module reporting.
The current code is more complicated than necessary and can only report
unsupported SFP+ module if it is plugged in after the device is up.
Rename bnxt_port_module_event() to bnxt_get_port_module_status(). We
already have the current module_status in the link_info structure, so
just check that and report any unsupported SFP+ module status. Delete
the unnecessary last_port_module_event. Call this function at the
end of bnxt_open to report unsupported module already plugged in.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8578d6c19a308dea3daf3d03acdf18724ec05590
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 15 03:04:48 2016 -0400
bnxt_en: Fix length value in dmesg log firmware error message.
The len value in the hwrm error message is wrong. Use the properly adjusted
value in the variable len.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a11fa2be6d1564375dc57530680268ad569c2632
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 15 03:04:47 2016 -0400
bnxt_en: Improve the delay logic for firmware response.
The current code has 2 problems:
1. The maximum wait time is not long enough. It is about 60% of the
duration specified by the firmware. It is calling usleep_range(600, 800)
for every 1 msec we are supposed to wait.
2. The granularity of the delay is too coarse. Many simple firmware
commands finish in 25 usec or less.
We fix these 2 issues by multiplying the original 1 msec loop counter by
40 and calling usleep_range(25, 40) for each iteration.
There is also a second delay loop to wait for the last DMA word to
complete. This delay loop should be a very short 5 usec wait.
This change results in much faster bring-up/down time:
Before the patch:
time ip link set p4p1 up
real 0m0.120s
user 0m0.001s
sys 0m0.009s
After the patch:
time ip link set p4p1 up
real 0m0.030s
user 0m0.000s
sys 0m0.010s
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d0a42d6fc8eaf1b64f62b0bbc3b829b756eacf57
Author: Michael Chan <michael.chan@broadcom.com>
Date: Sun May 15 03:04:46 2016 -0400
bnxt_en: Reduce maximum ring pages if page size is 64K.
The chip supports 4K/8K/64K page sizes for the rings and we try to
match it to the CPU PAGE_SIZE. The current page size limits for the rings
are based on 4K/8K page size. If the page size is 64K, these limits are
too large. Reduce them appropriately.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 90c4f788f6c08aaa52edbb47a817403376523375
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Sun May 15 03:04:45 2016 -0400
bnxt_en: Report PCIe link speed and width during driver load
Add code to log a message during driver load indicating PCIe link
speed and width.
The log message will look like this:
bnxt_en 0000:86:00.0 eth0: PCIe: Speed 8.0GT/s Width x8
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 42ee18fe4ca2a12b8370bb1c53fa6b9f9300c70c
Author: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Sun May 15 03:04:44 2016 -0400
bnxt_en: Add Support for ETHTOOL_GMODULEINFO and ETHTOOL_GMODULEEEPRO
Add support to fetch the SFP EEPROM settings from the firmware
and display it via the ethtool -m command. We support SFP+ and QSFP
modules.
v2: Fixed a bug in bnxt_get_module_eeprom() found by Ben Hutchings.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 18d6e4e2d800cbd44a7d7d215a49f99c6508e4a5
Author: Satish Baddipadige <sbaddipa@broadcom.com>
Date: Sun May 15 03:04:43 2016 -0400
bnxt_en: Fix invalid max channel parameter in ethtool -l.
When there is only 1 MSI-X vector or in INTA mode, tx and rx pre-set
max channel parameters are shown incorrectly in ethtool -l. With only 1
vector, bnxt_get_max_rings() will return -ENOMEM. bnxt_get_channels
should check this return value, and set max_rx/max_tx to 0 if it is
non-zero.
Signed-off-by: Satish Baddipadige <sbaddipa@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fa7e28127a5ad9fd55ac9c7707d8c8b835113a7c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 10 19:18:00 2016 -0400
bnxt_en: Add workaround to detect bad opaque in rx completion (part 2)
Add detection and recovery code when the hardware returned opaque value
does not match the expected consumer index. Once the issue is detected,
we skip the processing of all RX and LRO/GRO packets. These completion
entries are discarded without sending the SKB to the stack and without
producing new buffers. The function will be reset from a workqueue.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 376a5b8647d6c56cb8f104d7ad0390b4f4057e70
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue May 10 19:17:59 2016 -0400
bnxt_en: Add workaround to detect bad opaque in rx completion (part 1)
There is a rare hardware bug that can cause a bad opaque value in the RX
or TPA completion. When this happens, the hardware may have used the
same buffer twice for 2 rx packets. In addition, the driver will also
crash later using the bad opaque as the index into the ring.
The rx opaque value is predictable and is always monotonically increasing.
The workaround is to keep track of the expected next opaque value and
compare it with the one returned by hardware during RX and TPA start
completions. If they miscompare, we will not process any more RX and
TPA completions and exit NAPI. We will then schedule a workqueue to
reset the function.
This patch adds the logic to keep track of the next rx consumer index.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7d2837dd7a3239e8201d9bef75c1a708e451e123
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed May 4 16:56:44 2016 -0400
bnxt_en: Setup multicast properly after resetting device.
The multicast/all-multicast internal flags are not properly restored
after device reset. This could lead to unreliable multicast operations
after an ethtool configuration change for example.
Call bnxt_mc_list_updated() and setup the vnic->mask in bnxt_init_chip()
to fix the issue.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 67a95e2022c7f0405408fb1f910283785ece354a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Wed May 4 16:56:43 2016 -0400
bnxt_en: Need memory barrier when processing the completion ring.
The code determines if the next ring entry is valid before proceeding
further to read the rest of the entry. The CPU can re-order and read
the rest of the entry first, possibly reading a stale entry, if DMA
of a new entry happens right after reading it. This issue can be
readily seen on a ppc64 system, causing it to crash.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 152971ee75fddbc43fb6cf7e3ada96c1324df2af
Author: Alexander Duyck <aduyck@mirantis.com>
Date: Mon May 2 09:38:55 2016 -0700
bnxt: Add support for segmentation of tunnels with outer checksums
This patch assumes that the bnxt hardware will ignore existing IPv4/v6
header fields for length and checksum as well as the length and checksum
fields for outer UDP and GRE headers.
I have been told by Michael Chan that this is working. Though this might
be somewhat redundant for IPv6 as they are forcing the checksum to be
computed for all IPv6 frames that are offloaded. A follow-up patch may be
necessary in order to fix this as it is essentially mangling the outer IPv6
headers to add a checksum where none was requested.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 89d0a06c516339c0a2b3d02677f5d6310b3319fb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 25 02:30:51 2016 -0400
bnxt_en: Divide a page into 32K buffers for the aggregation ring if necessary.
If PAGE_SIZE is bigger than BNXT_RX_PAGE_SIZE, that means the native CPU
page is bigger than the maximum length of the RX BD. Divide the page
into multiple 32K buffers for the aggregation ring.
Add an offset field in the bnxt_sw_rx_agg_bd struct to keep track of the
page offset of each buffer. Since each page can be referenced by multiple
buffer entries, call get_page() as needed to get the proper reference
count.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2839f28bd5bf8fd2ab4a1ea3a5589c8f94364cbb
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 25 02:30:50 2016 -0400
bnxt_en: Limit RX BD pages to be no bigger than 32K.
The RX BD length field of this device is 16-bit, so the largest buffer
size is 65535. For LRO and GRO, we allocate native CPU pages for the
aggregation ring buffers. It won't work if the native CPU page size is
64K or bigger.
We fix this by defining BNXT_RX_PAGE_SIZE to be native CPU page size
up to 32K. Replace PAGE_SIZE with BNXT_RX_PAGE_SIZE in all appropriate
places related to the rx aggregation ring logic.
The next patch will add additional logic to divide the page into 32K
chunks for aggrgation ring buffers if PAGE_SIZE is bigger than
BNXT_RX_PAGE_SIZE.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1fa72e29e14d97fbda15437c648d7cc4eb00bff8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 25 02:30:49 2016 -0400
bnxt_en: Don't fallback to INTA on VF.
Only MSI-X can be used on a VF. The driver should fail initialization
if it cannot successfully enable MSI-X.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8cbde1175e3c8565edbb777cd09cbfdb93c78397
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 11 04:11:14 2016 -0400
bnxt_en: Add async event handling for speed config changes.
On some dual port cards, link speeds on both ports have to be compatible.
Firmware will inform the driver when a certain speed is no longer
supported if the other port has linked up at a certain speed. Add
logic to handle this event by logging a message and getting the
updated list of supported speeds.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 84c33dd342ad596a271a61da0119bf34e80bb1c5
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 11 04:11:13 2016 -0400
bnxt_en: Call firmware to approve VF MAC address change.
Some hypervisors (e.g. ESX) require the VF MAC address to be forwarded to
the PF for approval. In Linux PF, the call is not forwarded and the
firmware will simply check and approve the MAC address if the PF has not
previously administered a valid MAC address for this VF.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 33f7d55f07ab964055d73d38774346f8d4821f00
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 11 04:11:12 2016 -0400
bnxt_en: Shutdown link when device is closed.
Let firmware know that the driver is giving up control of the link so that
it can be shutdown if no management firmware is running.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 03efbec03198a0f505c2a6c93268c3c5df321c90
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Apr 11 04:11:11 2016 -0400
bnxt_en: Disallow forced speed for 10GBaseT devices.
10GBaseT devices must autonegotiate to determine master/slave clocking.
Disallow forced speed in ethtool .set_settings() for these devices.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 29c262fed4067c52977ba279cf71520f9991a050
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:09:03 2016 -0400
bnxt_en: Improve ethtool .get_settings().
If autoneg is off, we should always report the speed and duplex settings
even if it is link down so the user knows the current settings. The
unknown speed and duplex should only be used for autoneg when link is
down.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9d9cee08fc9f5c4df84ef314158fd19c013bcec6
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:09:02 2016 -0400
bnxt_en: Check for valid forced speed during ethtool -s.
Check that the forced speed is a valid speed supported by firmware.
If not supported, return -EINVAL.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4bb13abf208cb484a9b9d1af9233b0ef850c2fe7
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:09:01 2016 -0400
bnxt_en: Add unsupported SFP+ module warnings.
Add the PORT_CONN_NOT_ALLOWED async event handling logic. The driver
will print an appropriate warning to reflect the SFP+ module enforcement
policy done in the firmware.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 25be862370031056989ee76e3c48c3ac8ff67fd4
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:09:00 2016 -0400
bnxt_en: Set async event bits when registering with the firmware.
Currently, the driver only sets bit 0 of the async_event_fwd fields.
To be compatible with the latest spec, we need to set the
appropriate event bits handled by the driver. We should be handling
link change and PF driver unload events, so these 2 bits should be
set.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 72b34f04e0b00956dd679ae18bf2163669df8b56
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:08:59 2016 -0400
bnxt_en: Add get_eee() and set_eee() ethtool support.
Allow users to get|set EEE parameters.
v2: Added comment for preserving the tx_lpi_timer value in get_eee.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 939f7f0ca442187db2a4ec7a40979c711b0c939e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:08:58 2016 -0400
bnxt_en: Add EEE setup code.
1. Add bnxt_hwrm_set_eee() function to setup EEE firmware parameters based
on the bp->eee settings.
2. The new function bnxt_eee_config_ok() will check if EEE parameters need
to be modified due to autoneg changes.
3. bnxt_hwrm_set_link() has added a new parameter to update EEE. If the
parameter is set, it will call bnxt_hwrm_set_eee().
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 170ce01301a2a1a87808765531d938fa0b023641
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:08:57 2016 -0400
bnxt_en: Add basic EEE support.
Get EEE capability and the initial EEE settings from firmware.
Add "EEE is active | not active" to link up dmesg.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c9ee9516c161da2d072e035907aa35a35dfa68a8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:08:56 2016 -0400
bnxt_en: Improve flow control autoneg with Firmware 1.2.1 interface.
Make use of the new AUTONEG_PAUSE bit in the new interface to better
control autoneg flow control settings, independent of RX and TX
advertisement settings.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 11f15ed394782dd018d60a0bb550616a8571b43c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Tue Apr 5 14:08:55 2016 -0400
bnxt_en: Update to Firmware 1.2.2 spec.
Use new field names in API structs and stop using deprecated fields
auto_link_speed and auto_duplex in phy_cfg/phy_qcfg structs.
Update copyright year to 2016.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3c02d1bb32347d0674714ee170772d771d513469
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 28 19:46:07 2016 -0400
bnxt_en: Fix ethtool -a reporting.
To report flow control tx/rx settings accurately regardless of autoneg
setting, we should use link_info->req_flow_ctrl. Before this patch,
the reported settings were only correct when autoneg was on.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 49b5c7a125201bb42c25831fda3a50305c29ef50
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 28 19:46:06 2016 -0400
bnxt_en: Fix typo in bnxt_hwrm_set_pause_common().
The typo caused the wrong flow control bit to be set.
Reported by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e6ef26991a46e20879bebb8298080eb7ceed4ae8
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 28 19:46:05 2016 -0400
bnxt_en: Implement proper firmware message padding.
The size of every padded firmware message is specified in the first
HWRM_VER_GET response message. Use this value to pad every message
after that.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 33e52d888d0c84a0c66f13357a53113fd9710bd6
Author: Prashant Sreedharan <prashant@broadcom.com>
Date: Mon Mar 28 19:46:04 2016 -0400
bnxt_en: Initialize CP doorbell value before ring allocation
The existing code does the following:
allocate completion ring
initialize completion ring doorbell
disable interrupts on this completion ring by writing to the doorbell
We can have a race where firmware sends an asynchronous event to the host
after completion ring allocation and before doorbell is initialized.
When this happens driver can crash while ringing the doorbell using
uninitialized value as part of handling the IRQ/napi request.
Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6316ea6db93d875df333e7ab205bf1aa3b3616d7
Author: Satish Baddipadige <sbaddipa@broadcom.com>
Date: Mon Mar 7 15:38:48 2016 -0500
bnxt_en: Enable AER support.
Add pci_error_handler callbacks to support for pcie advanced error
recovery.
Signed-off-by: Satish Baddipadige <sbaddipa@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8ddc9aaa725a9337fc7bbe95fe1d1499769fb9b2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 7 15:38:47 2016 -0500
bnxt_en: Include hardware port statistics in ethtool -S.
Include the more useful port statistics in ethtool -S for the PF device.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9947f83fb79ca501f5ab24c370211bfb78b6b364
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 7 15:38:46 2016 -0500
bnxt_en: Include some hardware port statistics in ndo_get_stats64().
Include some of the port error counters (e.g. crc) in ->ndo_get_stats64()
for the PF device.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3bdf56c47dfcd819ab1e73644c2eb9c72c08f29e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 7 15:38:45 2016 -0500
bnxt_en: Add port statistics support.
Gather periodic port statistics if the device is PF and link is up. This
is triggered in bnxt_timer() every one second to request firmware to DMA
the counters.
Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f1a082a6f79fd5f06b27ef05a5ba7ec8d6e83b4c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 7 15:38:44 2016 -0500
bnxt_en: Extend autoneg to all speeds.
Allow all autoneg speeds aupported by firmware to be advertised. If
the advertising parameter is 0, then all supported speeds will be
advertised.
Remove BNXT_ALL_COPPER_ETHTOOL_SPEED which is no longer used as all
supported speeds can be advertised.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4b32cacca28fe8b29bf266feff19b6fc2180402e
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 7 15:38:43 2016 -0500
bnxt_en: Use common function to get ethtool supported flags.
The supported bits and advertising bits in ethtool have the same
definitions. The same is true for the firmware bits. So use the
common function to handle the conversion for both supported and
advertising bits.
v2: Don't use parentheses on function return.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3277360eb29c6e482391975717d983060ecbd28d
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 7 15:38:42 2016 -0500
bnxt_en: Add reporting of link partner advertisement.
And report actual pause settings to ETHTOOL_GPAUSEPARAM to let ethtool
resolve the actual pause settings.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 27c4d578600c401c119c012a90920805fab05cc9
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Mar 7 15:38:41 2016 -0500
bnxt_en: Refactor bnxt_fw_to_ethtool_advertised_spds().
Include the conversion of pause bits and add one extra call layer so
that the same refactored function can be reused to get the link partner
advertisement bits.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 90e209213096110bce06ef580e1c73702fe4a288
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Feb 26 04:00:08 2016 -0500
bnxt_en: Add hwrm_send_message_silent().
This is used to send NVM_FIND_DIR_ENTRY messages which can return error
if the entry is not found. This is normal and the error message will
cause unnecessary alarm, so silence it.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fbfbc4851dd709cf1327afc283f9cca00235dcb3
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Feb 26 04:00:07 2016 -0500
bnxt_en: Refactor _hwrm_send_message().
Add a new function bnxt_do_send_msg() to do essentially the same thing
with an additional paramter to silence error response messages. All
current callers will set silent to false.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3ebf6f0a09a284adef62111c7cfca29f56d6cce7
Author: Rob Swindell <swindell@broadcom.com>
Date: Fri Feb 26 04:00:06 2016 -0500
bnxt_en: Add installed-package firmware version reporting via Ethtool GDRVINFO
For everything to fit, we remove the PHY microcode version and replace it
with the firmware package version in the fw_version string.
Signed-off-by: Rob Swindell <swindell@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a8643e1604c1f39a675c6b10a7f84260fa13590c
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Feb 26 04:00:05 2016 -0500
bnxt_en: Fix dmesg log firmware error messages.
Use appropriate firmware request header structure to prepare the
firmware messages. This avoids the unnecessary conversion of the
fields to 32-bit fields. Add appropriate endian conversion when
printing out the message fields in dmesg so that they appear correct
in the log.
Reported-by: Rob Swindell <swindell@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ff4fe81d2d49e3cad3bb45c8c5b9a49ca90ee10b
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Feb 26 04:00:04 2016 -0500
bnxt_en: Use firmware provided message timeout value.
Before this patch, we used a hardcoded value of 500 msec as the default
value for firmware message response timeout. For better portability with
future hardware or debug platforms, use the value provided by firmware in
the first response and store it for all susequent messages. Redefine the
macro HWRM_CMD_TIMEOUT to the stored value. Since we don't have the
value yet in the first message, use the 500 ms default if the stored value
is zero.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dfc9c94a83909f4be80e5d0c67e79793830aa312
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Feb 26 04:00:03 2016 -0500
bnxt_en: Add coalescing support for tx rings.
When tx and rx rings don't share the same completion ring, tx coalescing
parameters can be set differently from the rx coalescing parameters.
Otherwise, use rx coalescing parameters on shared completion rings.
Adjust rx coalescing default values to lower interrupt rate.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bb053f52a54d66a6057c2220458349f7d39ce0d2
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Feb 26 04:00:02 2016 -0500
bnxt_en: Refactor bnxt_hwrm_set_coal().
Add a function to set all the coalescing parameters. The function can
be used later to set both rx and tx coalescing parameters.
v2: Fixed function parameters formatting requested by DaveM.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit dfb5b894f87cb78168e04283e8d15626dc3e6d5a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Fri Feb 26 04:00:01 2016 -0500
bnxt_en: Store irq coalescing timer values in micro seconds.
Don't convert these to internal hardware tick values before storing
them. This avoids the confusion of ethtool -c returning slightly
different values than the ones set using ethtool -C when we convert
hardware tick values back to micro seconds. Add better comments for
the hardware settings.
Also, rename the current set of coalescing fields with rx_ prefix.
The next patch will add support of tx coalescing values.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 19241368443ff976b1924019d29eef8e972158e7
Author: Jeffrey Huang <huangjw@broadcom.com>
Date: Fri Feb 26 04:00:00 2016 -0500
bnxt_en: Send PF driver unload notification to all VFs.
During remove_one() when SRIOV is enabled, the PF driver
should broadcast PF driver unload notification to all
VFs that are attached to VMs. Upon receiving the PF
driver unload notification, the VF driver should print
a warning message to message log. Certain operations on the
VF may not succeed after the PF has unloaded.
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3874d6a8b61966a77aa743b4160ba96bf3081ce5
Author: Jeffrey Huang <huangjw@broadcom.com>
Date: Fri Feb 26 03:59:59 2016 -0500
bnxt_en: Improve bnxt_vf_update_mac().
Allow the VF to setup its own MAC address if the PF has not administratively
set it for the VF. To do that, we should always store the MAC address
from the firmware. There are 2 cases:
1. The MAC address is valid. This MAC address is assigned by the PF and
it needs to override the current VF MAC address.
2. The MAC address is zero. The VF will use a random MAC address by default.
By storing this 0 MAC address in the VF structure, it will allow the VF
user to change the MAC address later using ndo_set_mac_address() when
it sees that the stored MAC address is 0.
v2: Expanded descriptions and added more comments.
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fbb0fa8b48892a3db8f5b89fb591c741fbd2fe7a
Author: Michael Chan <michael.chan@broadcom.com>
Date: Mon Feb 22 02:10:26 2016 -0500
bnxt_en: Fix zero padding of tx push data.
The arithmetic to zero pad the last 64-bit word in the push buffer is not
correct.
1. It should be pdata + length to get to the end.
2. 'pdata' is void pointer and passing it to PTR_ALIGN() will cast the
aligned pointer to void. Pass 'end' which is u64 pointer to PTR_ALIGN()
instead so that the aligned pointer - 1 is the last 64-bit pointer to data.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit ba41d46fe03223279054e58d570069fdc62fb768
Author: Michael Chan <mchan@broadcom.com>
Date: Fri Feb 19 19:43:21 2016 -0500
bnxt_en: Failure to update PHY is not fatal condition.
If we fail to update the PHY, we should print a warning and continue.
The current code to exit is buggy as it has not freed up the NIC
resources yet.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit de73018fb5474b33dc4f6d6b8d889e40232e325b
Author: Michael Chan <mchan@broadcom.com>
Date: Fri Feb 19 19:43:20 2016 -0500
bnxt_en: Remove unnecessary call to update PHY settings.
Fix bnxt_update_phy_setting() to check the correct parameters when
determining whether to update the PHY. Requested line speed/duplex should
only be checked for forced speed mode. This avoids unnecessary link
interruptions when loading the driver.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 035a1539ab63bfdb284bdf6e8459e35897c60564
Author: Michael Chan <mchan@broadcom.com>
Date: Fri Feb 19 19:43:19 2016 -0500
bnxt_en: Poll link at the end of __bnxt_open_nic().
When shutting down the NIC, we shutdown async event processing before
freeing all the rings. If there is a link change event during reset, the
driver may miss it and the link state may be incorrect after the NIC is
re-opened. Poll the link at the end of __bnxt_open_nic() to get the
correct link status.
Signed-off-by Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 51dd55b5688e81f9f13fb520a59900d4c3959a9a
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Feb 10 17:33:50 2016 -0500
bnxt_en: Reduce default ring sizes.
The current default tx ring size of 512 causes an extra page to be
allocated for the tx ring with only 1 entry in it. Reduce it to
511. The default rx ring size is also reduced to 511 to use less
memory by default.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4419dbe6a0f031ddb2df4cd993805546a566d20e
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Feb 10 17:33:49 2016 -0500
bnxt_en: Fix implementation of tx push operation.
tx push is supported for small packets to reduce DMA latency. The
following bugs are fixed in this patch:
1. Fix the definition of the push BD which is different from the DMA BD.
2. The push buffer has to be zero padded to the next 64-bit word boundary
or tx checksum won't be correct.
3. Increase the tx push packet threshold to 164 bytes (192 bytes with the BD)
so that small tunneled packets are within the threshold.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1c49c421f3ec446f1e0eda6d965a6cb23214d7a1
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Feb 10 17:33:48 2016 -0500
bnxt_en: Remove 20G support and advertise only 40GbaseCR4.
20G is not supported by production hardware and only the 40GbaseCR4 standard
is supported.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0d8abf020199b0cbc5fb3aa309d36f0ac1b91631
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Feb 10 17:33:47 2016 -0500
bnxt_en: Cleanup and Fix flow control setup logic
Cleanup bnxt_probe_phy() to cleanly separate 2 code blocks for autoneg
on and off. Autoneg flow control is possible only if autoneg is enabled.
In bnxt_get_settings(), Pause and Asym_Pause are always supported.
Only the advertisement bits change depending on the ethtool -A setting
in auto mode.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b763499ee16b74707af0fb26ab0a26bd9719870b
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Feb 10 17:33:46 2016 -0500
bnxt_en: Fix ethtool autoneg logic.
1. Determine autoneg on|off setting from link_info->autoneg. Using the
firmware returned setting can be misleading if autoneg is changed and
there hasn't been a phy update from the firmware.
2. If autoneg is disabled, link_info->autoneg should be set to 0 to
indicate both speed and flow control autoneg are disabled.
3. To enable autoneg flow control, speed autoneg must be enabled.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d612a579771385e08f7b665063b36bfa52c03ea3
Author: Michael Chan <mchan@broadcom.com>
Date: Thu Jan 28 03:11:22 2016 -0500
bnxt_en: Fix crash in bnxt_free_tx_skbs() during tx timeout.
The ring index j is not wrapped properly at the end of the ring, causing
it to reference pointers past the end of the ring. For proper loop
termination and to access the ring properly, we need to increment j and
mask it before referencing the ring entry.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8a4d4c8dde7a4119bce3fd8287dca193ff6356da
Author: Michael Chan <mchan@broadcom.com>
Date: Thu Jan 28 03:11:21 2016 -0500
bnxt_en: Exclude rx_drop_pkts hw counter from the stack's rx_dropped counter.
This hardware counter is misleading as it counts dropped packets that
don't match the hardware filters for unicast/broadcast/multicast. We
will still report this counter in ethtool -S for diagnostics purposes.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 74608fc98d2856fa7201a498b61c9dd9455b504a
Author: Prashant Sreedharan <prashant@broadcom.com>
Date: Thu Jan 28 03:11:20 2016 -0500
bnxt_en: Ring free response from close path should use completion ring
Use completion ring for ring free response from firmware. The response
will be the last entry in the ring and we can free the ring after getting
the response. This will guarantee no spurious DMA to freed memory.
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 415b6f19e87e350b13585591859d4fdf50772229
Author: Arnd Bergmann <arnd@arndb.de>
Date: Tue Jan 12 16:05:08 2016 +0100
net: bnxt: always return values from _bnxt_get_max_rings
Newly added code in the bnxt driver uses a couple of variables that
are never initialized when CONFIG_BNXT_SRIOV is not set, and gcc
correctly warns about that:
In file included from include/linux/list.h:8:0,
from include/linux/module.h:9,
from drivers/net/ethernet/broadcom/bnxt/bnxt.c:10:
drivers/net/ethernet/broadcom/bnxt/bnxt.c: In function 'bnxt_get_max_rings':
include/linux/kernel.h:794:26: warning: 'cp' may be used uninitialized in this function [-Wmaybe-uninitialized]
include/linux/kernel.h:794:26: warning: 'tx' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/net/ethernet/broadcom/bnxt/bnxt.c:5730:11: warning: 'rx' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/net/ethernet/broadcom/bnxt/bnxt.c:5736:6: note: 'rx' was declared here
This changes the condition so that we fall back to using the PF
data if VF is not available, and always initialize the variables
to something useful.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6e6c5a57fbe1 ("bnxt_en: Modify bnxt_get_max_rings() to support shared or non shared rings.")
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d2d6318cb996f39112ba24ff23abe67578a611bc
Author: Rob Swindell <swindell@broadcom.com>
Date: Thu Jan 7 19:56:58 2016 -0500
bnxt_en: Reset embedded processor after applying firmware upgrade
Use HWRM_FW_RESET command to request a self-reset of the embedded
processor(s) after successfully applying a firmware update. For boot
processor, the self-reset is currently deferred until the next PCIe reset.
Signed-off-by: Rob Swindell <swindell@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d79979a103f7820d3107cdc04096e87b37f90008
Author: Michael Chan <mchan@broadcom.com>
Date: Thu Jan 7 19:56:57 2016 -0500
bnxt_en: Zero pad firmware messages to 128 bytes.
For future compatibility, zero pad all messages that the driver sends
to the firmware to 128 bytes. If these messages are extended in the
future with new byte enables, zero padding these messages now will
guarantee future compatibility.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 068c9ec62906b626a30526638fd36189b80b6464
Author: Michael Chan <mchan@broadcom.com>
Date: Sat Jan 2 23:45:04 2016 -0500
bnxt_en: Modify ethtool -l|-L to support combined or rx/tx rings.
The driver can support either all combined or all rx/tx rings. The
default is combined, but the user can now select rx/tx rings.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 01657bcd078b924e4599a83acd402ea6f85a1e45
Author: Michael Chan <mchan@broadcom.com>
Date: Sat Jan 2 23:45:03 2016 -0500
bnxt_en: Modify init sequence to support shared or non shared rings.
Modify ring memory allocation and MSIX setup to support shared or
non shared rings and do the proper mapping. Default is still to
use shared rings.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 6e6c5a57fbe1c77c2c55e266f87a83429adc3de7
Author: Michael Chan <mchan@broadcom.com>
Date: Sat Jan 2 23:45:02 2016 -0500
bnxt_en: Modify bnxt_get_max_rings() to support shared or non shared rings.
Add logic to calculate how many shared or non shared rings can be
supported. Default is to use shared rings.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b81a90d3028af92da61a61e2efd231a585180044
Author: Michael Chan <mchan@broadcom.com>
Date: Sat Jan 2 23:45:01 2016 -0500
bnxt_en: Re-structure ring indexing and mapping.
In order to support dedicated or shared completion rings, the ring
indexing and mapping are re-structured as below:
1. bp->grp_info[] array index is 1:1 with bp->bnapi[] array index and
completion ring index.
2. rx rings 0 to n will be mapped to completion rings 0 to n.
3. If tx and rx rings share completion rings, then tx rings 0 to m will
be mapped to completion rings 0 to m.
4. If tx and rx rings use dedicated completion rings, then tx rings 0 to
m will be mapped to completion rings n + 1 to n + m.
5. Each tx or rx ring will use the corresponding completion ring index
for doorbell mapping and MSIX mapping.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3b2b7d9db74adb95aa0bd029298a741333eb847e
Author: Michael Chan <mchan@broadcom.com>
Date: Sat Jan 2 23:45:00 2016 -0500
bnxt_en: Check for NULL rx or tx ring.
Each bnxt_napi structure may no longer be having both an rx ring and
a tx ring. Check for a valid ring before using it.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b6ab4b01f53b5f9e17dbd4f91c95fa5049fa2101
Author: Michael Chan <mchan@broadcom.com>
Date: Sat Jan 2 23:44:59 2016 -0500
bnxt_en: Separate bnxt_{rx|tx}_ring_info structs from bnxt_napi struct.
Currently, an rx and a tx ring are always paired with a completion ring.
We want to restructure it so that it is possible to have a dedicated
completion ring for tx or rx only.
The bnxt hardware uses a completion ring for rx and tx events. The driver
has to process the completion ring entries sequentially for the rx and tx
events. Using a dedicated completion ring for rx only or tx only has these
benefits:
1. A burst of rx packets can cause delay in processing tx events if the
completion ring is shared. If tx queue is stopped by BQL, this can cause
delay in re-starting the tx queue.
2. A completion ring is sized according to the rx and tx ring size rounded
up to the nearest power of 2. When the completion ring is shared, it is
sized by adding the rx and tx ring sizes and then rounded to the next power
of 2, often with a lot of wasted space.
3. Using dedicated completion ring, we can adjust the tx and rx coalescing
parameters independently for rx and tx.
The first step is to separate the rx and tx ring structures from the
bnxt_napi struct.
In this patch, an rx ring and a tx ring will point to the same bnxt_napi
struct to share the same completion ring. No change in ring assignment
and mapping yet.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 9f5545905fbcc069f6fa8030b866e967ec6a5c73
Author: Michael Chan <mchan@broadcom.com>
Date: Sat Jan 2 23:44:58 2016 -0500
bnxt_en: Refactor bnxt_dbg_dump_states().
By adding 3 separate functions to dump the different ring states.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fbc9a5237a767cada312cb07877d0992b1e34242
Author: David Christensen <davidch@broadcom.com>
Date: Sun Dec 27 18:19:29 2015 -0500
bnxt_en: Add BCM57301 & BCM57402 devices.
Added the PCI IDs for the BCM57301 and BCM57402 controllers.
Signed-off-by: David Christensen <davidch@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c193554ecd050e63753aa0ec99c188800843bca2
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Dec 27 18:19:28 2015 -0500
bnxt_en: Update to Firmware interface spec 1.0.0.
This interface will be forward compatible with future changes.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b72d4a68c443e29cb59e15a1a9b2c2f4bf802831
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Dec 27 18:19:27 2015 -0500
bnxt_en: Keep track of the ring group resource.
Newer firmware will return the ring group resource when we call
hwrm_func_qcaps(). To be compatible with older firmware, use the
number of tx rings as the number of ring groups if the older firmware
returns 0. When determining how many rx rings we can support, take
the ring group resource in account as well in _bnxt_get_max_rings().
Divide and assign the ring groups to VFs.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4a21b49b34c01137a67bf0fe185c5d0fff747e4d
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Dec 27 18:19:26 2015 -0500
bnxt_en: Improve VF resource accounting.
We need to keep track of all resources, such as rx rings, tx rings,
cmpl rings, rss contexts, stats contexts, vnics, after we have
divided them for the VFs. Otherwise, subsequent ring changes on
the PF may not work correctly.
We adjust all max resources in struct bnxt_pf_info after they have been
assigned to the VFs. There is no need to keep the separate
max_pf_tx_rings and max_pf_rx_rings.
When SR-IOV is disabled, we call bnxt_hwrm_func_qcaps() to restore the
max resources for the PF.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 92268c328a8dae4635b3deaca52a8ed329642219
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Dec 27 18:19:25 2015 -0500
bnxt_en: Cleanup bnxt_hwrm_func_cfg().
1. Use local variable pf for repeated access to this pointer.
2. The 2nd argument num_vfs was unnecessarily declared as pointer to int.
This function doesn't change num_vfs so change the argument to int.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2bcfa6f6e7cf867e4aa623f84caea4bc413d38c9
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Dec 27 18:19:24 2015 -0500
bnxt_en: Check hardware resources before enabling NTUPLE.
The hardware resources required to enable NTUPLE varies depending on
how many rx channels are configured. We need to make sure we have the
resources before we enable NTUPLE. Add bnxt_rfs_capable() to do the
checking.
In addition, we need to do the same checking in ndo_fix_features(). As
the rx channels are changed using ethtool -L, we call
netdev_update_features() to make the necessary adjustment for NTUPLE.
Calling netdev_update_features() in netif_running() state but before
calling bnxt_open_nic() would be a problem. To make this work,
bnxt_set_features() has to be modified to test for BNXT_STATE_OPEN for
the true hardware state instead of checking netif_running().
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 27e241896f2e21c96200df711659117923dec8a2
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Dec 27 18:19:23 2015 -0500
bnxt_en: Don't treat single segment rx frames as GRO frames.
If hardware completes single segment rx frames, don't bother setting
up all the GRO related fields. Pass the SKB up as a normal frame.
Reviewed-by: vasundhara volam <vvolam@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 45019a180358c3cf290c3f3dc953c44f978d5527
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Dec 27 18:19:22 2015 -0500
bnxt_en: Allocate rx_cpu_rmap only if Accelerated RFS is enabled.
Also, no need to check for bp->rx_nr_rings as it is always >= 1. If the
allocation fails, it is not a fatal error and we can still proceed.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 665e350ddbfde88c5c18142dfd7b8c64556bc964
Author: Satish Baddipadige <sbaddipa@broadcom.com>
Date: Sun Dec 27 18:19:21 2015 -0500
bnxt_en: Increment checksum error counter only if NETIF_F_RXCSUM is set.
rx_l4_csum_error is now incremented only when offload is enabled
Signed-off-by: Satish Baddipadige <sbaddipa@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2731d70fa9cbb62e45743171bf979784fb36778c
Author: Rob Swindell <swindell@broadcom.com>
Date: Sun Dec 27 18:19:20 2015 -0500
bnxt_en: Add support for upgrading APE/NC-SI firmware via Ethtool FLASHDEV
NC-SI firmware of type apeFW (10) is now supported.
Signed-off-by: Rob Swindell <swindell@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit edd0c2cc2b73ff21f356d6cbd3b5bf83e692ea9d
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Dec 27 18:19:19 2015 -0500
bnxt_en: Optimize ring alloc and ring free functions.
Remove the unnecessary "if" statement before the "for" statement:
if (x) {
for (i = 0; i < x; i++)
...
}
Also, change the ring free function to return void as it only returns 0.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit be58a0da1672391b246880450e990fe36d7ba24d
Author: Jeffrey Huang <huangjw@broadcom.com>
Date: Sun Dec 27 18:19:18 2015 -0500
bnxt_en: support hwrm_func_drv_unrgtr command
During remove_one, the driver should issue hwrm_func_drv_unrgtr
command to inform firmware that this function has been unloaded.
This is to let firmware keep track of driver present/absent state
when driver is gracefully unloaded. A keep alive timer is needed
later to keep track of driver state during abnormal shutdown.
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 028de140ffdf481d4948de663b33dae78e1e9cc8
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Dec 9 19:35:44 2015 -0500
bnxt_en: Implement missing tx timeout reset logic.
The reset logic calls bnxt_close_nic() and bnxt_open_nic() under rtnl_lock
from bnxt_sp_task. BNXT_STATE_IN_SP_TASK must be cleared before calling
bnxt_close_nic() to avoid deadlock.
v2: Fixed white space error. Thanks Dave.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4cebdcec0933bf39c0ab42e8ce8c9d72f803fbe9
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Dec 9 19:35:43 2015 -0500
bnxt_en: Don't cancel sp_task from bnxt_close_nic().
When implementing driver reset from tx_timeout in the next patch,
bnxt_close_nic() will be called from the sp_task workqueue. Calling
cancel_work() on sp_task will hang the workqueue.
Instead, set a new bit BNXT_STATE_IN_SP_TASK when bnxt_sp_task() is running.
bnxt_close_nic() will wait for BNXT_STATE_IN_SP_TASK to clear before
proceeding.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit caefe526d7b5af11d9b5977b2862eb144fa45537
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Dec 9 19:35:42 2015 -0500
bnxt_en: Change bp->state to bitmap.
This allows multiple independent bits to be set for various states.
Subsequent patches to implement tx timeout reset will require this.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit de68f5de56512a2ff5d5810ef4d54c53470c3c45
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Dec 9 19:35:41 2015 -0500
bnxt_en: Fix bitmap declaration to work on 32-bit arches.
The declaration of the bitmap vf_req_snif_bmap using fixed array of
unsigned long will only work on 64-bit archs. Use DECLARE_BITMAP instead
which will work on all archs.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b664f008b0d885db1d5617ed1c51d29a8c04da93
Author: Michael Chan <mchan@broadcom.com>
Date: Wed Dec 2 01:54:08 2015 -0500
bnxt_en: Setup uc_list mac filters after resetting the chip.
Call bnxt_cfg_rx_mode() in bnxt_init_chip() to setup uc_list and
mc_list mac address filters. Before the patch, uc_list is not
setup again after chip reset (such as ethtool ring size change)
and macvlans don't work any more after that.
Modify bnxt_cfg_rx_mode() to return error codes appropriately so
that the init chip sequence can detect any failures.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit bdd4347b33f480187b44699cf1caac9400496d6d
Author: Jeffrey Huang <huangjw@broadcom.com>
Date: Wed Dec 2 01:54:07 2015 -0500
bnxt_en: enforce proper storing of MAC address
For PF, the bp->pf.mac_addr always holds the permanent MAC
addr assigned by the HW. For VF, the bp->vf.mac_addr always
holds the administrator assigned VF MAC addr. The random
generated VF MAC addr should never get stored to bp->vf.mac_addr.
This way, when the VF wants to change the MAC address, we can tell
if the adminstrator has already set it and disallow the VF from
changing it.
v2: Fix compile error if CONFIG_BNXT_SRIOV is not set.
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 1fc2cfd03bbf8f1f8b6b90f0858faba8bd6631c4
Author: Jeffrey Huang <huangjw@broadcom.com>
Date: Wed Dec 2 01:54:06 2015 -0500
bnxt_en: Fixed incorrect implementation of ndo_set_mac_address
The existing ndo_set_mac_address only copies the new MAC addr
and didn't set the new MAC addr to the HW. The correct way is
to delete the existing default MAC filter from HW and add
the new one. Because of RFS filters are also dependent on the
default mac filter l2 context, the driver must go thru
close_nic() to delete the default MAC and RFS filters, then
open_nic() to set the default MAC address to HW.
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 93d05d4a320cb16712bb3d57a9658f395d8cecb9
Author: Eric Dumazet <edumazet@google.com>
Date: Wed Nov 18 06:31:03 2015 -0800
net: provide generic busy polling to all NAPI drivers
NAPI drivers no longer need to observe a particular protocol
to benefit from busy polling (CONFIG_NET_RX_BUSY_POLL=y)
napi_hash_add() and napi_hash_del() are automatically called
from core networking stack, respectively from
netif_napi_add() and netif_napi_del()
This patch depends on free_netdev() and netif_napi_del() being
called from process context, which seems to be the norm.
Drivers might still prefer to call napi_hash_del() on their
own, since they might combine all the rcu grace periods into
a single one, knowing their NAPI structures lifetime, while
core networking stack has no idea of a possible combining.
Once this patch proves to not bring serious regressions,
we will cleanup drivers to either remove napi_hash_del()
or provide appropriate rcu grace periods combining.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4bb6cdce386d620d10d2588ea5bf4093a3b21ab9
Author: Jeffrey Huang <huangjw@broadcom.com>
Date: Thu Nov 5 16:25:51 2015 -0500
bnxt_en: More robust SRIOV cleanup sequence.
Instead of always calling pci_sriov_disable() in remove_one(),
the driver should detect whether VFs are currently assigned
to the VMs. If the VFs are active in VMs, then it should not
disable SRIOV as it is catastrophic to the VMs. Instead,
it just leaves the VFs alone and continues to unload the PF.
The user can then cleanup the VMs even after the PF driver
has been unloaded.
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 84e86b98f6515aaeaac053b234be158b25457184
Author: Michael Chan <mchan@broadcom.com>
Date: Thu Nov 5 16:25:50 2015 -0500
bnxt_en: Fix comparison of u16 sw_id against negative value.
Assign the return value from bitmap_find_free_region() to an integer
variable and check for negative error codes first, before assigning
the bit ID to the unsigned sw_id field.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 11809490ac17810cff90c12e9f2f3e0303a72121
Author: Jeffrey Huang <huangjw@broadcom.com>
Date: Thu Nov 5 16:25:49 2015 -0500
bnxt_en: map CAG_REG_LEGACY_INT_STATUS_MASK to GRC window #4
In order to use offset 0x4014 for reading CAG interrupt status,
the actual CAG register must be mapped to GRC bar0 window #4.
Otherwise, the driver is reading garbage. This patch corrects
this issue.
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 614388ce39f3d61ad7f95db65f409d35d5943616
Author: Michael Chan <mchan@broadcom.com>
Date: Thu Nov 5 16:25:48 2015 -0500
bnxt_en: Determine tcp/ipv6 RSS hash type correctly.
The profile ID in the completion record needs to be ANDed with the
profile ID mask of 0x1f. This bug was causing the SKB hash type
and the gso_type to be wrong in some cases.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c5d7774db350e77f2506e36e1797c958d1b118c8
Author: Jeffrey Huang <huangjw@broadcom.com>
Date: Thu Nov 5 16:25:47 2015 -0500
bnxt_en: Change sp events definitions to represent bit position.
Fix the sp event bits to be bit positions instead of bit values since
the bit helper functions are expecting the former.
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit d1611c3aba11ffa281bdd027aace52f5a370b8c5
Author: Michael Chan <mchan@broadcom.com>
Date: Sun Oct 25 22:27:57 2015 -0400
bnxt_en: Fix compile warnings when CONFIG_INET is not set.
bnxt_gro_skb() has unused variables when CONFIG_INET is not set. We
really cannot support hardware GRO if CONFIG_INET is not set, so
compile out bnxt_gro_skb() completely and define BNXT_FLAG_GRO to be 0
if CONFIG_INET is not set. This will effectively always disable
hardware GRO if CONFIG_INET is not set.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 379a80a1d048dcacfc2011d5d32e16d5c804b9f4
Author: Michael Chan <mchan@broadcom.com>
Date: Fri Oct 23 15:06:19 2015 -0400
bnxt_en: Fix compile errors when CONFIG_BNXT_SRIOV is not set.
struct bnxt_pf_info needs to be always defined. Move bnxt_update_vf_mac()
to bnxt_sriov.c and add some missing #ifdef CONFIG_BNXT_SRIOV.
Reported-by: Jim Hull <jim.hull@hpe.com>
Tested-by: Jim Hull <jim.hull@hpe.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit c0c050c58d840994ba842ad1c338a98e7c12b764
Author: Michael Chan <mchan@broadcom.com>
Date: Thu Oct 22 16:01:17 2015 -0400
bnxt_en: New Broadcom ethernet driver.
Broadcom ethernet driver for the new family of NetXtreme-C/E
ethernet devices.
v5:
- Removed empty blank lines at end of files (noted by David Miller).
- Moved busy poll helper functions to bnxt.h to at least make the
.c file look less cluttered with #ifdef (noted by Stephen Hemminger).
v4:
- Broke up 2 long message strings with "\n" (suggested by John Linville)
- Constify an array of strings (suggested by Stephen Hemminger)
- Improve bnxt_vf_pciid() (suggested by Stephen Hemminger)
- Use PCI_VDEVICE() to populate pci_device_id table for more compact
source.
v3:
- Fixed 2 more sparse warnings.
- Removed some unused structures in .h files.
v2:
- Fixed all kbuild test robot reported warnings.
- Fixed many of the checkpatch.pl errors and warnings.
- Fixed the Kconfig description (noted by Dmitry Kravkov).
Acked-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>