The Samsung Galaxy M40 announced back in 2019 with Android 9 Pie picked up the Android 10 update last March, and now it's receiving Android 11 with One UI 3.1. The new firmware sports version number M405FDDU2CUC6 and requires a hefty download of around 2GB. It comes with the March 2021 Android security and the usual Android 11 and One UI 3.1 goodies such as redesigned UI, chat bubbles, one-time permissions, and a newer version of the Samsung Keyboard. The update is currently seeding in India, and those who haven't received an update prompt yet can head to the Settings > Software...
Source: https://www.gsmarena.com/samsung_galaxy_m40_android_11_one_ui_3_1_update-news-48781.php