If you're shaving your penis the bumps are most likely caused by that.
You say you have cancer? If so, then you're on medications for it, right? Those medications might be causing the constipation. Your pharmacist is a really good person to ask about this. They know what the possible side effects are from medications.
I would recommend that you stop shaving your penis to see if the bumps and irritation goes away.