Do a cylinder balance test by shorting a plug or disconnecting an injector one at a time to see if the knock noise changes. If it does, it may be piston/rod related. If it doesn't, it may be a lifter/valve train, or there may be an excess of carbon on one piston.