Check if TCP segmentation has been offloaded for a particular interface
Question
I know we can check through ethtool whether TCP segmentation has been offloaded. But I need to get this info from my own code. What is the simplest way to do this? Is there a flag that I can check for this?
Thanks Supreeth
Solution
You can use the same ioctl()
call as ethtool does.
Just look at the source code for ethtool to figure out how it does it:
struct ethtool_value eval;
eval.cmd = ETHTOOL_GGSO;
ifr->ifr_data = (caddr_t)&eval;
err = ioctl(fd, SIOCETHTOOL, ifr);
if (err)
perror("Cannot get device generic segmentation offload settings");
else {
gso = eval.data;
allfail = 0;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow