sperm count and diabetes may not be directly related(TMK), but erectile dysfunction and diabetes are related, your count(8 mil) is too low considering normal count(15 mil/WHO 2010), so u are infertile.
In the normal erectile process, arterial dilation and venous compression causes a buildup of blood within the corpora cavernosa. The microvascular changes secondary to longstanding hyperglycemia cause arterial insufficiency and defective smooth muscle relaxation. Arterial insufficiency prevents dilation of the penile artery, thus reducing blood inflow and defective smooth muscle relaxation prevents compression of the penile vein thus increasing blood outflow. The net result is a decrease in the volume of blood within the corpus cavernosa, causing patients to suffer from progressively flaccid erections of shorter duration.