Integrity disables discards (TRIM).
It seems using the integrity features disables discards.
$ cryptsetup --version
cryptsetup 2.0.5
$ uname -a
Linux xxx 4.19.0-arch1-1-ARCH #1 SMP PREEMPT Fri Oct 26 12:34:53 UTC 2018 x86_64 GNU/Linux
# works
$ cryptsetup luksFormat --type luks2 /dev/nvme0n1p3
$ cryptsetup open --allow-discards /dev/nvme0n1p3 foo
$ lsblk -D /dev/nvme0n1p3
NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
nvme0n1p3 0 512B 2T 0
└─foo 0 512B 2T 0
# does not work
$ cryptsetup luksFormat --type luks2 --integrity hmac-sha1 --integrity-no-wipe /dev/nvme0n1p3
$ cryptsetup open --allow-discards /dev/nvme0n1p3 foo
$ lsblk -D /dev/nvme0n1p3
NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
└─nvme0n1p3 0 512B 2T 0
└─foo_dif 0 0B 0B 0
└─foo 0 0B 0B 0
It seems the dm-integrity layer swallows the discards.