hello.
if you hv never had sex, little white bumps on the shaft of penis may be pimples, a skin cyst, or a ingrown hair. these are normal and nothing to worry about. another thing is penile papules which are little whitish bumps which are present on the glans (head) of penis along its edge.
if you r sexually active it could be a sign of
STD. Painful bumps or ulcers herpes.
syphilis wil have painless ulcers.
molluscum contagiosum could also give you painless bumps.
so I suggest you to go visit s dermatologist and STD expert and take his opinion. if you are diagnosed with STD, You should take your partner also to a doctor.
all the best.!