I am just about to configure two SX1012 switches for a Storage Spaces Direct setup. I've previously used Cisco and Dell switches with stacking cables where the switches act as a single switch. I'm not as familiar with the SX1012 and have a few questions:
Hopefully that makes sense.
What you want to do is called MLAG on the SX1012 switches.
Yes you use two ports (best practice, though can be done with one port) on each switch - say ports 11 and 12 of each connect together.
See HowTo Configure MLAG on Mellanox Switches for a step by step guide.
As for the uplinks from the SX1012 you use LACP.