2007 BMW 328 won’t accelerate past 20-25 mph

,

BMW wont accelerate more than 20-25mph even after stepping on the gas pedal all the way in. The check engine light is also on

If blinking, have it towed. If a steady light, have the codes read, usually free at auto parts store such as Autozone, and post back. Format is P0123.