Skip to content

Commit 1bd7db5

Browse files
committed
Fix error on Del cmd for user space drivers
The DPDKMode var in conf is json ignored. The value is always false. This checks if the device is attached to a user space supported driver instead of relaying on this var. Signed-off-by: Marcelo <[email protected]>
1 parent 3271b0f commit 1bd7db5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/cnicommands/cni.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,12 @@ func CmdDel(args *skel.CmdArgs) error {
284284
return fmt.Errorf("cmdDel() error reseting VF: %q", err)
285285
}
286286

287-
if !netConf.DPDKMode {
287+
hasDpdkDriver, err := utils.HasDpdkDriver(netConf.DeviceID)
288+
if err != nil {
289+
return fmt.Errorf("cmdDel() error checking DPDK driver: %q", err)
290+
}
291+
292+
if !hasDpdkDriver {
288293
netns, err := ns.GetNS(args.Netns)
289294
if err != nil {
290295
// according to:

0 commit comments

Comments
 (0)