Chapter XVII. UDP Segmentation Offload and Pacing
Software/Driver Configuration and Fine-tuning
4.1.
Modifying the Application
To use the UDP offload functionality, the application needs to be modified. Follow the steps
mentioned below:
i.
Determine the UDP socket file descriptor in the application through which data is sent
ii.
Declare and initialize two variables in the application:
int fs=1316;
int cl=1;
Here,
•
fs is the UDP packet payload size in bytes that is transmitted on the wire. The minimum
value of fs is 256 bytes.
•
cl is the UDP traffic class(scheduler-class-index) that the user wishes to assign the data
stream to. This value needs to be in the range of 0 to 14 for T4 series of adapters and a
range of 0 to 15 for T5/T6 series of adapters.
The application will function as per the parameters set for that traffic class.
iii.
Add socket option definitions:
In order to use setsockopt() to set the options to the UDP socket, the following three definitions
need to be made:
•
SO_FRAMESIZE used for setting frame size, which has the value 291.
•
SOL_SCHEDCLASS used for setting UDP traffic class, which has the value 290.
•
IPPROTO_UDP used for setting the type of IP Protocol.
# define SO_FRAMESIZE 291
# define SOL_SCHEDCLASS 290
# define IPPROTO_UDP 17
iv.
Use the setsockopt() function to set socket options:
//Get the UDP socket descriptor variable
setsockopt (sockfd , IPPROTO_UDP, SO_FRAMESIZE, &fs, sizeof(fs));
setsockopt (sockfd , IPPROTO_UDP, SOL_SCHEDCLASS, &cl, sizeof(cl));
Chelsio Unified Wire for Linux
254
Need help?
Do you have a question about the Terminator Series and is the answer not in the manual?
Questions and answers