From feed7a2137c72b165929df87904784225bf3d554 Mon Sep 17 00:00:00 2001 From: fedora Cloud User Date: Mon, 8 Apr 2024 05:45:32 +0000 Subject: [PATCH] RC1 --- LICENSE | 2 +- Makefile | 20 ++++++---- README.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++- builddeps.bash | 62 +++++++++++++++++++++++++++++ 4 files changed, 178 insertions(+), 9 deletions(-) create mode 100755 builddeps.bash diff --git a/LICENSE b/LICENSE index c9634a4..ae3132f 100644 --- a/LICENSE +++ b/LICENSE @@ -58,7 +58,7 @@ APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Jackrabbit-Labs-LLC +Copyright 2024 Jackrabbit-Founders-LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index 1df5090..dae3ee0 100644 --- a/Makefile +++ b/Makefile @@ -13,12 +13,14 @@ # ****************************************************************************** CC=gcc -CFLAGS= -g3 -O0 -Wall -Wextra -MACROS=-D JACK_VERBOSE -INCLUDE_DIR=/usr/local/include -LIB_DIR=/usr/local/lib -INCLUDE_PATH=-I $(INCLUDE_DIR) -I /usr/include/glib-2.0 -I /usr/lib/`uname -m`-linux-gnu/glib-2.0/include/ -LIB_PATH=-L $(LIB_DIR) +CFLAGS?= -g3 -O0 -Wall -Wextra +MACROS?=-D JACK_VERBOSE +INCLUDE_DIR?=/usr/local/include +LIB_DIR?=/usr/local/lib +LOCAL_INCLUDE_DIR?=./include +LOCAL_LIB_DIR?=./lib +INCLUDE_PATH=-I $(LOCAL_INCLUDE_DIR) -I $(INCLUDE_DIR) -I /usr/include/glib-2.0 -I /usr/lib/`uname -m`-linux-gnu/glib-2.0/include/ -I /usr/lib64/glib-2.0/include +LIB_PATH=-L $(LOCAL_LIB_DIR) -L $(LIB_DIR) LIBS=-l mctp -l fmapi -l emapi -l ptrqueue -l arrayutils -l uuid -l timeutils -l cxlstate -l pciutils TARGET=jack @@ -52,8 +54,12 @@ install: jack sudo cp $(TARGET) /usr/local/bin/ sudo cp completion.bash /etc/bash_completion.d/$(TARGET)-completion.bash +uninstall: + sudo rm /usr/local/bin/$(TARGET) + sudo rm /etc/bash_completion.d/$(TARGET)-completion.bash + # List all non file name targets as PHONY -.PHONY: all clean doc install +.PHONY: all clean doc install uninstall # Variables # $^ Will expand to be all the sensitivity list diff --git a/README.md b/README.md index 0523b38..f1bd175 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,103 @@ -# Jack-release +# Overview + +Jack is a CLI tool that implements the CXL 2.0 Fabric Management API +specification. It is intended to be used to configure and monitor CXL +compliant hardware devices such as switches, accelerators or memory controllers. + +# Supported Operating System Versions + +- Ubuntu 23.10 +- Fedora 38, 39 + +> Note: Ubuntu 22.04 is not supported. This is due to some newer PCI features that +> are missing from the 5.15 Linux kernel that ships with Ubuntu 22.04. + +# Building + +1. Install OS libraries + +Install the following build packages to compile the software on the following +operating systems. + +**Ubuntu:** + +```bash +apt install build-essential libglib2.0-dev libyaml-dev libpci-dev +``` + +**Fedora:** + +```bash +``` + +2. Build Dependencies + +To clone and build dependencies run: + +```bash +./builddeps.bash +``` + +3. Build + +After building the required dependencies run: + +```bash +make +``` + +# Usage + +Jack connects to a target device using MCTP over TCP. When using Jack with an +endpoint such as +[CSE (CXL Switch Emulator)](https://github.com/JackrabbitLabs/cse), the user +first starts the CSE application using a config file that defines a +virtualized CXL switch environment with the following command. + +```bash +cse -lc config.yaml +``` + +Once the target endpoint is running, Jack can be used to query or configure +the CXL endpoint. + +# Example Commands + +To obtain identity information about the endpoint: + +```bash +jack show id +``` + +To obtain information about the capabilities of the endpoint: + +```bash +jack show switch +``` + +To show the status of the ports of the endpoint use `show port`. This displays +the devices that are connected to the endpoint. + +```bash +jack show port +``` + +To show information about what ports are connected to a Virtual CXL Switch +(VCS). + +```bash +jack show vcs 0 +``` + +To unbind a port (or a Logical Device) from a VCS: + +```bash +jack port unbind -c 0 -b 4 +``` + +To bind a port (or a Logical Device) to a VCS: + +```bash +jack port bind -p 4 -l 0 -c 0 -b 4 +``` diff --git a/builddeps.bash b/builddeps.bash new file mode 100755 index 0000000..8ceb6e8 --- /dev/null +++ b/builddeps.bash @@ -0,0 +1,62 @@ +#!/bin/bash +# ****************************************************************************** +# +# @file builddeps.bash +# +# @brief script to clone and build dependencies +# +# @copyright Copyright (C) 2024 Jackrabbit Founders LLC. All rights reserved. +# +# @date Apr 2024 +# @author Barrett Edwards +# +# ****************************************************************************** + +ARG=$1 +CUR=`pwd` +HOST=https://github.com/ +ORG=JackrabbitLabs +REPOS="array_utils time_utils pci_utils ptr_queue emapi fmapi cxl_state mctp" + +SRC=src +INC=include +LIB=lib + +if [ "${ARG}" = "clean" ] ; then + echo "Removing build dependencies" + rm -rf ${SRC} + rm -rf ${INC} + rm -rf ${LIB} + exit +fi + +# Create source directory if not present +if [ ! -d ${SRC} ] ; then + mkdir ${SRC} +fi +# Create include directory if not present +if [ ! -d ${INC} ] ; then + mkdir ${INC} +fi +# Create lib directory if not present +if [ ! -d ${LIB} ] ; then + mkdir ${LIB} +fi + +# Clone sub module repos into DST directory +for REPO in $REPOS ; do + echo "Cloning build dependencies" + git clone ${HOST}${ORG}/${REPO}.git ${SRC}/${REPO} +done + +# Build sub modules +for REPO in $REPOS ; do + echo "Building dependencies" + cd ${SRC}/${REPO}/ + make INCLUDE_DIR=${CUR}/${INC} LIB_DIR=${CUR}/${LIB} CFLAGS="-g3 -O0" install + cd ${CUR} +done + +# Issue completion message +echo "Completed building dependencies" +