code: func (h *Handle) DevLinkSetEswitchMode(Dev *DevlinkDevice, NewMode string) error {
  	mode, err := eswitchStringToMode(NewMode)
  	if err != nil {
  		return err
  	}
  
  	_, req, err := h.createCmdReq(nl.DEVLINK_CMD_ESWITCH_SET, Dev.BusName, Dev.DeviceName)
  	if err != nil {
  		return err
  	}
  
  	req.AddData(nl.NewRtAttr(nl.DEVLINK_ATTR_ESWITCH_MODE, nl.Uint16Attr(mode)))
  
  	_, err = req.Execute(unix.NETLINK_GENERIC, 0)
  	return err
  }
docs: // DevLinkSetEswitchMode sets eswitch mode if able to set successfully or
  // returns an error code.
  // Equivalent to: `devlink dev eswitch set $dev mode switchdev`
  // Equivalent to: `devlink dev eswitch set $dev mode legacy`