Hi Sandy's mum
Some boars get a build-up of gunk all around the shaft of the penis. Normally the penis is only a few mm diameter but I have seen cases were the diameter, because of all the gunk surrounding it, has effectively increased to over 1cm and if this build-up has been happening for some time then the first you know of the problem is that it can appear as a lump under the skin when the penis is still in its sheath.
Given what you describe in view of his testicles also being swollen, I would advise a vets visit to very carefully extrude and clean the penis as there may also be hardened boar glue, hay, fur, cheesy stuff and infection etc that will need to be treated - Please do not attempt to do this yourself the first time as given what "might" be up there you could damage the fragile tissue. Hopefully, your vet will find that a bit of warm water/hibiscrub together with KY jelly or other lubricant will be all that is needed to gently remove the gunk but it may require patience and regular repeated soaking.
If the penis shaft or foreskin looks inflamed or damaged, then my vet recommends topical application of flamazine cream - it is a silver salt that is both anti-fungal and anti-bacterial and is something that bacteria cannot develop a resistance to - unlike antibiotics. If there is pus or an abcess present I would discuss with the vet whether a swab/culture should be taken and tested for sensitivity to antibiotics before automatically reaching for the baytril. Sadly we have increasing numbers of examples on the forum of the bugs causing "stinky willy", URI's and UTI's being baytril resistant (and swabs taken of my stinky willy boys have not necessarily resulted in the usual types of bugs you would expect).
Once he has been cleaned up and any inflammation/infection dealt with you can then start to clean him yourself as part of his regular care. "Stinky willy" is more common in boars that have a frilly foreskin (often called cauliflower willy) as it makes it easier for debris to get trapped and more difficult for the boar to clean himself.
Please feel free to print out my post and take it with you when you see the vet.
HTH
x