Retirement tax questions

On the solo 401 (k), she can contribute no more than her net profit from self-employment minus the deductible portion of her self-employment tax minus any deductions for self-employed health insurance premiums.

The net profit: Does this mean that the salary she paid herfelf or the company net profit? For example: Net Revenue of company: 10K
She paid 4K to her in Salary
The net profit on Company is 6K

In this case the employer can contribute 25% of the salary paid:  1000 from employer side
She can contribute a max of 4K or 6K( net company profit) from her ( employee side) for the 18 K bucket in FY2017?

Please clarify

Thanks