The -l option is for the buffer and doesn't influence the amount of data transferred.
You have to specify the desired amount of data with the client-only option -n in KByte or MByte.
So for 10GB, use -n 10240M
Example:
With the defaut buffer size of 8KB:
iperf -c 10.1.1.1 -n 10240M
------------------------------------------------------------
Client connecting to 10.1.1.1, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.1.1.2 port 56565 connected with 10.1.1.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.5 sec 10.0 GBytes 8.20 Gbits/sec
Wit the the same value for the -n option but with -l 32K
iperf -c 10.1.1.1 -n 10240M -l 32K
------------------------------------------------------------
Client connecting to 10.12.1.1, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.1.1.2 port 56568 connected with 10.1.1.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.5 sec 10.0 GBytes 8.17 Gbits/sec