Skip to content

ice: refactor mailbox overflow detection

Jacob Keller intel-wired-lan 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14ice: re-order ice_mbx_reset_snapshot functiondrivers/net/ethernet/intel/ice/ice_vf_mbx.c+24 -241 reply
2/14ice: convert ice_mbx_clear_malvf to void and use WARNdrivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_vf_lib.c drivers/net/ethernet/intel/ice/ice_vf_mbx.c +1 more+14 -221 reply
3/14ice: track malicious VFs in new ice_mbx_vf_info structuredrivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_type.h drivers/net/ethernet/intel/ice/ice_vf_lib.c +3 more+53 -531 reply
4/14ice: move VF overflow message count into struct ice_mbx_vf_infodrivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_type.h drivers/net/ethernet/intel/ice/ice_vf_lib.c +2 more+69 -1401 reply
5/14ice: remove ice_mbx_deinit_snapshotdrivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_vf_mbx.c drivers/net/ethernet/intel/ice/ice_vf_mbx.h+1 -191 reply
6/14ice: merge ice_mbx_report_malvf with ice_mbx_vf_state_handlerdrivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_vf_mbx.c drivers/net/ethernet/intel/ice/ice_vf_mbx.h+28 -621 reply
7/14ice: initialize mailbox snapshot earlier in PF initdrivers/net/ethernet/intel/ice/ice_main.c drivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_vf_mbx.h+5 -21 reply
8/14ice: declare ice_vc_process_vf_msg in ice_virtchnl.hdrivers/net/ethernet/intel/ice/ice_sriov.h drivers/net/ethernet/intel/ice/ice_virtchnl.h+6 -31 reply
9/14ice: always report VF overflowing mailbox even without PF VSIdrivers/net/ethernet/intel/ice/ice_sriov.c+4 -41 reply
10/14ice: remove unnecessary &array[0] and just use arraydrivers/net/ethernet/intel/ice/ice_sriov.c+1 -11 reply
11/14ice: pass mbxdata to ice_is_malicious_vf()drivers/net/ethernet/intel/ice/ice_main.c drivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_sriov.h+14 -151 reply
12/14ice: print message if ice_mbx_vf_state_handler returns an errordrivers/net/ethernet/intel/ice/ice_sriov.c+2 -11 reply
13/14ice: move ice_is_malicious_vf() to ice_virtchnl.cdrivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_sriov.h drivers/net/ethernet/intel/ice/ice_virtchnl.c +1 more+56 -561 reply
14/14ice: call ice_is_malicious_vf() from ice_vc_process_vf_msg()drivers/net/ethernet/intel/ice/ice_main.c drivers/net/ethernet/intel/ice/ice_virtchnl.c drivers/net/ethernet/intel/ice/ice_virtchnl.h+24 -321 reply

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by.

PatchMichal SwiatkowskiMarek Szlosek
1/14R-b T-b
2/14R-b T-b
3/14R-b T-b
4/14R-b T-b
5/14R-b T-b
6/14R-b T-b
7/14R-b T-b
8/14R-b T-b
9/14R-b T-b
10/14R-b T-b
11/14R-b T-b
12/14R-b T-b
13/14R-b T-b
14/14R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Intel-wired-lan] [intel-next PATCH 00/14] ice: refactor mailbox overflow detection

The primary motivation of this series is to cleanup and refactor the mailbox overflow detection logic such that it will work with Scalable IOV. In addition a few other minor cleanups are done while I was working on the code in the area.

First, the mailbox overflow functions in ice_vf_mbx.c are refactored to store the data per-VF as an embedded structure in struct ice_vf, rather than stored separately as a fixed-size array which only works with Single Root IOV. This reduces the overall memory footprint when only a handful of VFs are used.

The overflow detection functions are also cleaned up to reduce the need for multiple separate calls to determine when to report a VF as potentially malicious.

Finally, the ice_is_malicious_vf function is cleaned up and moved into ice_virtchnl.c since it is not Single Root IOV specific, and thus does not belong in ice_sriov.c

I could probably have done this in fewer patches, but I split pieces out to hopefully aid in reviewing the overall sequence of changes. This does cause some additional thrash as it results in intermediate versions of the refactor, but I think its worth it for making each step easier to understand.

Jacob Keller (14):
ice: re-order ice_mbx_reset_snapshot function
ice: convert ice_mbx_clear_malvf to void and use WARN
ice: track malicious VFs in new ice_mbx_vf_info structure
ice: move VF overflow message count into struct ice_mbx_vf_info
ice: remove ice_mbx_deinit_snapshot
ice: merge ice_mbx_report_malvf with ice_mbx_vf_state_handler
ice: initialize mailbox snapshot earlier in PF init
ice: declare ice_vc_process_vf_msg in ice_virtchnl.h
ice: always report VF overflowing mailbox even without PF VSI
ice: remove unnecessary &array[0] and just use array
ice: pass mbxdata to ice_is_malicious_vf()
ice: print message if ice_mbx_vf_state_handler returns an error
ice: move ice_is_malicious_vf() to ice_virtchnl.c
ice: call ice_is_malicious_vf() from ice_vc_process_vf_msg()

 drivers/net/ethernet/intel/ice/ice_main.c     |  12 +-
 drivers/net/ethernet/intel/ice/ice_sriov.c    |  77 +-----
 drivers/net/ethernet/intel/ice/ice_sriov.h    |  14 -
 drivers/net/ethernet/intel/ice/ice_type.h     |  17 +-
 drivers/net/ethernet/intel/ice/ice_vf_lib.c   |  15 +-
 drivers/net/ethernet/intel/ice/ice_vf_lib.h   |   2 +-
 drivers/net/ethernet/intel/ice/ice_vf_mbx.c   | 251 ++++++------------
 drivers/net/ethernet/intel/ice/ice_vf_mbx.h   |  17 +-
 drivers/net/ethernet/intel/ice/ice_virtchnl.c |  49 +++-
 drivers/net/ethernet/intel/ice/ice_virtchnl.h |   8 +
 10 files changed, 165 insertions(+), 297 deletions(-)

base-commit: c6ce92e9dcb102b82599f9be908c3a9ad815d6dd

Signature · 6 lines
2.39.1.405.gd4c25cc71f83

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan