When flow_indr_dev_register() fails, bnxt_init_tc will free
bp->tc_info through kfree(). However, the caller function
bnxt_init_one() will ignore this failure and call
bnxt_shutdown_tc() on failure of bnxt_dl_register(), where
a use-after-free happens. Fix this issue by setting
bp->tc_info to NULL after kfree().
Fixes: 627c89d00fb9 ("bnxt_en: flow_offload: offload tunnel decap rules via indirect callbacks")
Signed-off-by: Dinghao Liu <email address hidden>
Reviewed-by: Pavan Chebbi <email address hidden>
Reviewed-by: Michael Chan <email address hidden>
Reviewed-by: Somnath Kotur <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Jakub Kicinski <email address hidden>
(cherry picked from commit d007caaaf052f82ca2340d4c7b32d04a3f5dbf3f linux-next)
Signed-off-by: Jeff Lane <email address hidden>
Newer firmware supporting PAM4 112Gbps speeds use new parameters in
firmware message structures. Detect the new firmware capability and
add basic logic to report and store these new fields.
Reviewed-by: Hongguang Gao <email address hidden>
Reviewed-by: Damodharam Ammepalli <email address hidden>
Reviewed-by: Ajit Khaparde <email address hidden>
Signed-off-by: Michael Chan <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Jakub Kicinski <email address hidden>
(cherry picked from commit 30c0bb63c2ea0d7b8a9057afff2317d7b40846b1 linux-next)
Signed-off-by: Jeff Lane <email address hidden>
Add helper functions to refactor the logic that converts firmware
speed masks to ethtool speeds. Pass the phy_flags to
bnxt_get_ethtool_speeds() and the call chain. The refactoring and the
phy_flags will be needed when adding support for the new speeds in the
next patches.
Reviewed-by: Ajit Khaparde <email address hidden>
Signed-off-by: Michael Chan <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Jakub Kicinski <email address hidden>
(cherry picked from commit cf47fa5ca5bb095c3d7b8222b959f54d952cf9e5 linux-next)
Signed-off-by: Jeff Lane <email address hidden>
These new completion types are supported on the new P7 chips.
These new types have commonalities with the legacy types. After
the refactoring, we mainly have to add new functions to handle the
the new meta data formats and the RX hash information in the new
types.
Signed-off-by: Michael Chan <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Jakub Kicinski <email address hidden>
(cherry picked from commit a7445d69809fe33619c451a8bf68d6b9cf335909 linux-next)
Signed-off-by: Jeff Lane <email address hidden>
Refactor bnxt_tpa_start() by adding bnxt_tpa_metadata() to gather the
metadata from the TPA_START completion. This makes it easier to
support the new P7 chip which has a modified TPA_START completion
structure with different metadata formats. We also add vlan_valid
and cfa_code_valid fields to the bnxt_tpa_info structure so that the
VLAN and VF rep logic can be common for all chips. The VLAN metadata
is now collected in bnxt_tpa_start() only when it is valid and the
vlan_valid field will be set. bnxt_tpa_end() can now use common VLAN
logic for all chips.
Signed-off-by: Michael Chan <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Jakub Kicinski <email address hidden>
(cherry picked from commit 39b2e62be3704d358c2c82eb326ae4b82a23ce1a linux-next)
Signed-off-by: Jeff Lane <email address hidden>
Refactor the logic in the RX path that checks for the accelerated VLAN
tag by adding a new function. This will make it easier to support
the new receive logic on P7 chips.
Reviewed-by: Pavan Chebbi <email address hidden>
Signed-off-by: Michael Chan <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Jakub Kicinski <email address hidden>
(cherry picked from commit c2f8063309da9be81679e27cabd4a9dbf9be43cc linux-next)
Signed-off-by: Jeff Lane <email address hidden>