Skip to content

net/ice: fix memory leaks

Anurag Mandal dpdk-dev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 4 repliesIn review
  2. v17 patches 9 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7net/ice: fix DDP package double free on init failuredrivers/net/intel/ice/ice_ethdev.c+1 -10 replies
2/7net/ice: fix resource leaks on port closedrivers/net/intel/ice/ice_ethdev.c+1 -51 reply
3/7net/ice: fix DDP filename leakdrivers/net/intel/ice/ice_ethdev.c+11 -41 reply
4/7net/ice: fix main VSI leak on init failuredrivers/net/intel/ice/ice_ethdev.c+4 -10 replies
5/7net/ice: fix MAC and VLAN filter leak on VSI releasedrivers/net/intel/ice/ice_ethdev.c+9 -00 replies
6/7net/ice: fix FDIR resource leak on setup failuredrivers/net/intel/ice/ice_fdir_filter.c+8 -20 replies
7/7net/ice: fix ACL profile segment leakdrivers/net/intel/ice/ice_acl_filter.c+20 -261 reply

Reviews trailers per patch

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

PatchBruce Richardson
1/7A-b
2/7A-b
3/7A-b
4/7A-b
5/7A-b
6/7A-b
7/7A-b

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

Read the v2 thread

Cover letter [PATCH v2 0/7] net/ice: fix memory leaks

V2-changes:
- Addressed Bruce Richardson's review comments.
- Added "Cc: [email protected]" in all patches.
- Use ice_deinit_hw() on close instead of open-coding it, which also returns the FD counter block to firmware on Patch-2.
- Declare the devarg handler argument as char ** so the filename it points to is char * and can be freed without a cast on Patch-3.
- use RTE_CAST_PTR when freeing the filename in ice_dev_init() on Patch-3.
- allocate the flow segment on the stack instead of freeing it on Patch-7.

This series fixes memory leaks, and one double free, in the ice PMD.

a. The DDP package copy was freed twice when hardware table
initialization failed during probe.

b. The switch filter management structures, the DDP package copy and
any remaining VSI contexts were never freed on port close or reset.

c. The DDP filename devarg string leaked on probe failure, and when
the devarg was given more than once.

d. The main VSI leaked when probe failed after PF setup.

e. MAC and VLAN filter entries could stay allocated when a VSI was
released.

f. A failed flow director setup leaked the FDIR VSI, hash table, hash
map and counter pools.

g. The flow segment used to create the ACL profiles leaked on every
ACL engine init.

Anurag Mandal (7):
net/ice: fix DDP package double free on init failure net/ice: fix resource leaks on port close net/ice: fix DDP filename leak
net/ice: fix main VSI leak on init failure net/ice: fix MAC and VLAN filter leak on VSI release net/ice: fix FDIR resource leak on setup failure net/ice: fix ACL profile segment leak

 drivers/net/intel/ice/ice_acl_filter.c  | 46 +++++++++++--------------
 drivers/net/intel/ice/ice_ethdev.c      | 37 ++++++++++++++------
 drivers/net/intel/ice/ice_fdir_filter.c | 10 ++++--
 3 files changed, 54 insertions(+), 39 deletions(-)
Signature · 1 line
2.25.1