After having many D series engine, I've noticed some common trends.
"Piston slap" happens to our engines after they have many miles on them- cylinder walls get a bit bigger after the years of use, and the piston ( while cold) will "slap" the walls of the cylinder at its TDC compression stroke until its warmed up and the piston will go from an oval shape to its fully expanded more round shape. This is some what "natural" and is the most hopeful situation that you want have.
Rod bearings like lubrication- with out it they can also begin to fail and cause a "rod knock"- this is a bad thing- if one of the bottom end bearings are making noise, its too late, and the engine needs to be rebuilt before it "spins" a bearing and seizes up your engine, and turns itself into a boat anchor. Rod knocks are most evident when first started in the morning before the engine has oil pressure. Two tests to know if your rod bearings are knocking; 1-disconect either the injector, or remove the spark plug while it is running on each cylinder, one at a time. If it is a rod knock, the noise will drastically get quieter when the cylinder pressure drops due to lack of fuel or spark, and thus you will know which cylinder is at fault. . 2- drain your oil in a clean container and look for brass shaving in it indication parts of your bearings are coming apart.
But it could also be many other things- a good mechanic would be able to listen to the noise and tell ya all about it.