Welcome to Health care magic.
Based on the description you might be suffering from Spermatocele
Do not worry. Spermatocele is a common condition seen in 20-30% of men.
As it is small and painless, you need not bother. Small painless spermatoceles do not require treatment.
Treatment is required only in cases where it is painful and large in size.
If you still have any doubts get a scrotal Ultrasound
done which would clear all your doubts.
Stop worrying about the swelling in the scrotum
and if possible get treated for the hernia
Hope your doubts are cleared.
Wish you a healthy life.