-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make disabling TX checksum for Antrea gateway #3957
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3957 +/- ##
==========================================
+ Coverage 62.26% 62.27% +0.01%
==========================================
Files 385 361 -24
Lines 54501 52244 -2257
==========================================
- Hits 33933 32536 -1397
+ Misses 18069 17275 -794
+ Partials 2499 2433 -66
|
pkg/agent/agent.go
Outdated
return fmt.Errorf("error when disabling TX checksum offload on %s: %v", i.hostGateway, err) | ||
} | ||
} else { | ||
if err := ethtool.EthtoolTXHWCsumSwitch(i.hostGateway, ethtool.TXCSUM_ON); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if tx checksum is always turned on by default on linux platforms and always configurable?
If not, this change would affect cases in which tx checksum was off, but the default value "disabledTXChecksumOffload=false" would try to turn it on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have investigated about TX Checksum Offload
and found that TX Checksum Offload
is not always supported since the driver of a NIC may not supports that. I think TX Checksum Offload
is turned on default on Linux if the driver of a NIC supports TX Checksum Offload
.
Maybe we can remove this since TX Checksum Offload
cannot be set to on in some environment. However, I don't have a good idea how to deal with the case:
A user sets disabledTXChecksumOffload=true
, then sets it back to false, but TX Checksum Offload
of Antrea gateway is still off, maybe we could log something like "If you set disabledTXChecksumOffload=false back again and you should set TX Checksum Offload of Antrea gateway to on manually"?
|
@@ -312,3 +313,12 @@ func (i *Initializer) RestoreOVSBridge() { | |||
func (i *Initializer) setInterfaceMTU(iface string, mtu int) error { | |||
return i.ovsBridgeClient.SetInterfaceMTU(iface, mtu) | |||
} | |||
|
|||
func (i *Initializer) setTXChecksumOffload() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe name it as disableTXChecksumOffload
?
You mentioned when changing disableTXChecksumOffload from true back to false, TX checksum offload of Antrea gateway will not be enabled automatically,
If user changes disableTXChecksumOffload
in the config file, I assume Antrea agent need to be restarted? then I think we can check and enable it again automatically in codes?
Btw, you need re-base the codes and add more test cases for code coverage improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe name it as disableTXChecksumOffload?
There is variable of Initializer which is named disableTXChecksumOffload
Btw, you need re-base the codes and add more test cases for code coverage improvement.
Rebased, and could you provide some examples about such test?
This is a supplement to PR antrea-io#3832. When `disableTXChecksumOffload` is true, TX checksum offload of Antrea gateway should be also disabled, otherwise for the cases in which the datapath doesn't support TX checksum offloading, packets sent from Antrea gateway could be dropped due to bad checksum. Note that, when changing `disableTXChecksumOffload` from true back to false, TX checksum offload of Antrea gateway will not be enabled automatically, and TX checksum offload can be enabled manually with ethtool. Another way is to remove Antrea gateway interface before updating `disableTXChecksumOffload`. Signed-off-by: Hongliang Liu <[email protected]>
4f059ca
to
4454d71
Compare
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days |
This is a supplement to PR #3832. When
disableTXChecksumOffload
is true, TX checksum offload of Antrea gateway should be also
disabled, otherwise for the cases in which the datapath doesn't
support TX checksum offloading, packets sent from Antrea gateway
could be dropped due to bad checksum.
Note that, when changing
disableTXChecksumOffload
from true backto false, TX checksum offload of Antrea gateway will not be enabled
automatically, and TX checksum offload can be enabled manually with
ethtool. Another way is to remove Antrea gateway interface before
updating
disableTXChecksumOffload
.Signed-off-by: Hongliang Liu [email protected]