diff options
| -rw-r--r-- | .idea/.name | 1 | ||||
| -rw-r--r-- | .idea/codeStyleSettings.xml | 38 | ||||
| -rw-r--r-- | .idea/dictionaries/luqiu.xml | 7 | ||||
| -rw-r--r-- | .idea/encodings.xml | 7 | ||||
| -rw-r--r-- | .idea/marsio1.iml | 13 | ||||
| -rw-r--r-- | .idea/misc.xml | 19 | ||||
| -rw-r--r-- | .idea/modules.xml | 8 | ||||
| -rw-r--r-- | .idea/vcs.xml | 6 | ||||
| -rw-r--r-- | .idea/workspace.xml | 471 | ||||
| -rw-r--r-- | driver/.vscode/.browse.VC.db | bin | 0 -> 70656 bytes | |||
| -rw-r--r-- | driver/apt.c | 290 | ||||
| -rw-r--r-- | include/internal/mr_config.h | 25 | ||||
| -rw-r--r-- | logreader/lib/.gitignore | 8 | ||||
| -rw-r--r-- | logreader/lib/libMESA_prof_load.a | bin | 0 -> 38224 bytes | |||
| -rw-r--r-- | support/MESA_prof_load/lib/libMESA_prof_load.a | bin | 0 -> 38224 bytes | |||
| -rw-r--r-- | support/MESA_prof_load/lib/libMESA_prof_load.so | bin | 0 -> 32645 bytes | |||
| -rw-r--r-- | worker/udpstack.c | 16 |
17 files changed, 769 insertions, 140 deletions
diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..b3e82bb --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +marsio1
\ No newline at end of file diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 0000000..23f6cae --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectCodeStyleSettingsManager"> + <option name="PER_PROJECT_SETTINGS"> + <value> + <Objective-C-extensions> + <option name="GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES" value="ASK" /> + <option name="RELEASE_STYLE" value="IVAR" /> + <option name="TYPE_QUALIFIERS_PLACEMENT" value="BEFORE" /> + <file> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" /> + </file> + <class> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" /> + </class> + <extensions> + <pair source="cpp" header="h" /> + <pair source="c" header="h" /> + </extensions> + </Objective-C-extensions> + </value> + </option> + <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default (1)" /> + </component> +</project>
\ No newline at end of file diff --git a/.idea/dictionaries/luqiu.xml b/.idea/dictionaries/luqiu.xml new file mode 100644 index 0000000..5a92b7b --- /dev/null +++ b/.idea/dictionaries/luqiu.xml @@ -0,0 +1,7 @@ +<component name="ProjectDictionaryState">
+ <dictionary name="luqiu">
+ <words>
+ <w>recv</w>
+ </words>
+ </dictionary>
+</component>
\ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..76667e0 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding"> + <file url="file://$PROJECT_DIR$/worker/rawio.c" charset="UTF-8" /> + <file url="PROJECT" charset="UTF-8" /> + </component> +</project>
\ No newline at end of file diff --git a/.idea/marsio1.iml b/.idea/marsio1.iml new file mode 100644 index 0000000..6774f34 --- /dev/null +++ b/.idea/marsio1.iml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="CPP_MODULE" version="4"> + <component name="NewModuleRootManager"> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library"> + <library name="Header Search Paths"> + <CLASSES /> + <SOURCES /> + </library> + </orderEntry> + </component> +</module>
\ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..87a6b24 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" /> + <component name="CidrRootsConfiguration"> + <sourceRoots /> + <libraryRoots /> + <excludeRoots /> + </component> + <component name="ProjectLevelVcsManager" settingsEditedManually="false"> + <OptionsSetting value="true" id="Add" /> + <OptionsSetting value="true" id="Remove" /> + <OptionsSetting value="true" id="Checkout" /> + <OptionsSetting value="true" id="Update" /> + <OptionsSetting value="true" id="Status" /> + <OptionsSetting value="true" id="Edit" /> + <ConfirmationsSetting value="0" id="Add" /> + <ConfirmationsSetting value="0" id="Remove" /> + </component> +</project>
\ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e24badd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/marsio1.iml" filepath="$PROJECT_DIR$/.idea/marsio1.iml" /> + </modules> + </component> +</project>
\ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project>
\ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..8bcdbd5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,471 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CMakeRunConfigurationManager" shouldGenerate="true" assignedExecutableTargets="true" buildAllGenerated="false"> + <generated /> + </component> + <component name="CMakeSettings" AUTO_RELOAD="false" GENERATION_PASS_SYSTEM_ENVIRONMENT="true"> + <ADDITIONAL_GENERATION_ENVIRONMENT> + <envs /> + </ADDITIONAL_GENERATION_ENVIRONMENT> + </component> + <component name="ChangeListManager"> + <list default="true" id="d784662e-d6dc-491e-a85a-80701bd397e8" name="Default" comment="" /> + <ignored path="marsio1.iws" /> + <ignored path=".idea/workspace.xml" /> + <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> + <option name="TRACKING_ENABLED" value="true" /> + <option name="SHOW_DIALOG" value="false" /> + <option name="HIGHLIGHT_CONFLICTS" value="true" /> + <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> + <option name="LAST_RESOLUTION" value="IGNORE" /> + </component> + <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> + <component name="CreatePatchCommitExecutor"> + <option name="PATCH_PATH" value="" /> + </component> + <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> + <component name="FavoritesManager"> + <favorites_list name="marsio1" /> + </component> + <component name="FileEditorManager"> + <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> + <file leaf-file-name="TestRawIO.c" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/test/TestRawIO.c"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="374"> + <caret line="22" column="1" selection-start-line="22" selection-start-column="1" selection-end-line="22" selection-end-column="1" /> + <folding /> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="CMakeLists.txt" pinned="false" current-in-tab="true"> + <entry file="file://$PROJECT_DIR$/CMakeLists.txt"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="492"> + <caret line="53" column="25" selection-start-line="53" selection-start-column="25" selection-end-line="53" selection-end-column="25" /> + <folding /> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="TestTradition.c" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/test/TestTradition.c"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="492"> + <caret line="45" column="1" selection-start-line="45" selection-start-column="1" selection-end-line="45" selection-end-column="1" /> + <folding /> + </state> + </provider> + </entry> + </file> + </leaf> + </component> + <component name="Git.Settings"> + <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> + </component> + <component name="IdeDocumentHistory"> + <option name="CHANGED_PATHS"> + <list> + <option value="$PROJECT_DIR$/worker/rawio.c" /> + <option value="$PROJECT_DIR$/worker/CMakeLists.txt" /> + <option value="$PROJECT_DIR$/test/CMakeLists.txt" /> + <option value="$PROJECT_DIR$/test/test.c" /> + <option value="$PROJECT_DIR$/include/extern/mr_hugepage.h" /> + <option value="$PROJECT_DIR$/test/TestRawIO.c" /> + <option value="$PROJECT_DIR$/CMakeLists.txt" /> + </list> + </option> + </component> + <component name="JsBuildToolGruntFileManager" detection-done="true" /> + <component name="JsBuildToolPackageJson" detection-done="true" /> + <component name="JsGulpfileManager"> + <detection-done>true</detection-done> + </component> + <component name="ProjectFrameBounds"> + <option name="x" value="-7" /> + <option name="y" value="2" /> + <option name="width" value="1378" /> + <option name="height" value="733" /> + </component> + <component name="ProjectInspectionProfilesVisibleTreeState"> + <entry key="Project Default"> + <profile-state> + <expanded-state> + <State> + <id /> + </State> + </expanded-state> + <selected-state> + <State> + <id>C/C++</id> + </State> + </selected-state> + </profile-state> + </entry> + </component> + <component name="ProjectLevelVcsManager" settingsEditedManually="false"> + <OptionsSetting value="true" id="Add" /> + <OptionsSetting value="true" id="Remove" /> + <OptionsSetting value="true" id="Checkout" /> + <OptionsSetting value="true" id="Update" /> + <OptionsSetting value="true" id="Status" /> + <OptionsSetting value="true" id="Edit" /> + <ConfirmationsSetting value="1" id="Add" /> + <ConfirmationsSetting value="0" id="Remove" /> + </component> + <component name="ProjectView"> + <navigator currentView="ProjectPane" proportions="" version="1"> + <flattenPackages /> + <showMembers /> + <showModules /> + <showLibraryContents /> + <hideEmptyPackages /> + <abbreviatePackageNames /> + <autoscrollToSource /> + <autoscrollFromSource /> + <sortByType /> + <manualOrder /> + <foldersAlwaysOnTop value="true" /> + </navigator> + <panes> + <pane id="ProjectPane"> + <subPane> + <PATH> + <PATH_ELEMENT> + <option name="myItemId" value="marsio1" /> + <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" /> + </PATH_ELEMENT> + </PATH> + <PATH> + <PATH_ELEMENT> + <option name="myItemId" value="marsio1" /> + <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="marsio1" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + </PATH> + </subPane> + </pane> + </panes> + </component> + <component name="PropertiesComponent"> + <property name="WebServerToolWindowFactoryState" value="false" /> + <property name="settings.editor.selected.configurable" value="reference.settingsdialog.IDE.editor.colors.Font" /> + <property name="settings.editor.splitter.proportion" value="0.2" /> + </component> + <component name="RunManager"> + <configuration default="true" type="CMakeGoogleTestRunConfigurationType" factoryName="Google Test" PASS_PARENT_ENVS_2="true" TEST_MODE="SUITE_TEST"> + <envs /> + <method /> + </configuration> + <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug"> + <method /> + </configuration> + <configuration default="true" type="PythonConfigurationType" factoryName="Python"> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs> + <env name="PYTHONUNBUFFERED" value="1" /> + </envs> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="" /> + <option name="IS_MODULE_SDK" value="false" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <module name="marsio1" /> + <option name="SCRIPT_NAME" value="" /> + <option name="PARAMETERS" value="" /> + <option name="SHOW_COMMAND_LINE" value="false" /> + <method /> + </configuration> + <configuration default="true" type="Tox" factoryName="Tox"> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs /> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="" /> + <option name="IS_MODULE_SDK" value="false" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <module name="marsio1" /> + <method /> + </configuration> + <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js"> + <node-interpreter>project</node-interpreter> + <node-options /> + <gulpfile /> + <tasks /> + <arguments /> + <envs /> + <method /> + </configuration> + <configuration default="true" type="js.build_tools.npm" factoryName="npm"> + <command value="run-script" /> + <scripts /> + <node-interpreter value="project" /> + <envs /> + <method /> + </configuration> + <configuration default="true" type="tests" factoryName="Attests"> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs /> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="" /> + <option name="IS_MODULE_SDK" value="false" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <module name="marsio1" /> + <option name="SCRIPT_NAME" value="" /> + <option name="CLASS_NAME" value="" /> + <option name="METHOD_NAME" value="" /> + <option name="FOLDER_NAME" value="" /> + <option name="TEST_TYPE" value="TEST_SCRIPT" /> + <option name="PATTERN" value="" /> + <option name="USE_PATTERN" value="false" /> + <method /> + </configuration> + <configuration default="true" type="tests" factoryName="Doctests"> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs /> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="" /> + <option name="IS_MODULE_SDK" value="false" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <module name="marsio1" /> + <option name="SCRIPT_NAME" value="" /> + <option name="CLASS_NAME" value="" /> + <option name="METHOD_NAME" value="" /> + <option name="FOLDER_NAME" value="" /> + <option name="TEST_TYPE" value="TEST_SCRIPT" /> + <option name="PATTERN" value="" /> + <option name="USE_PATTERN" value="false" /> + <method /> + </configuration> + <configuration default="true" type="tests" factoryName="Nosetests"> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs /> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="" /> + <option name="IS_MODULE_SDK" value="false" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <module name="marsio1" /> + <option name="SCRIPT_NAME" value="" /> + <option name="CLASS_NAME" value="" /> + <option name="METHOD_NAME" value="" /> + <option name="FOLDER_NAME" value="" /> + <option name="TEST_TYPE" value="TEST_SCRIPT" /> + <option name="PATTERN" value="" /> + <option name="USE_PATTERN" value="false" /> + <option name="PARAMS" value="" /> + <option name="USE_PARAM" value="false" /> + <method /> + </configuration> + <configuration default="true" type="tests" factoryName="Unittests"> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs /> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="" /> + <option name="IS_MODULE_SDK" value="false" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <module name="marsio1" /> + <option name="SCRIPT_NAME" value="" /> + <option name="CLASS_NAME" value="" /> + <option name="METHOD_NAME" value="" /> + <option name="FOLDER_NAME" value="" /> + <option name="TEST_TYPE" value="TEST_SCRIPT" /> + <option name="PATTERN" value="" /> + <option name="USE_PATTERN" value="false" /> + <option name="PUREUNITTEST" value="true" /> + <option name="PARAMS" value="" /> + <option name="USE_PARAM" value="false" /> + <method /> + </configuration> + <configuration default="true" type="tests" factoryName="py.test"> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs /> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="" /> + <option name="IS_MODULE_SDK" value="false" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <module name="marsio1" /> + <option name="SCRIPT_NAME" value="" /> + <option name="CLASS_NAME" value="" /> + <option name="METHOD_NAME" value="" /> + <option name="FOLDER_NAME" value="" /> + <option name="TEST_TYPE" value="TEST_SCRIPT" /> + <option name="PATTERN" value="" /> + <option name="USE_PATTERN" value="false" /> + <option name="testToRun" value="" /> + <option name="keywords" value="" /> + <option name="params" value="" /> + <option name="USE_PARAM" value="false" /> + <option name="USE_KEYWORD" value="false" /> + <method /> + </configuration> + </component> + <component name="ShelveChangesManager" show_recycled="false"> + <option name="remove_strategy" value="false" /> + </component> + <component name="SvnConfiguration"> + <configuration /> + </component> + <component name="TaskManager"> + <task active="true" id="Default" summary="Default task"> + <changelist id="d784662e-d6dc-491e-a85a-80701bd397e8" name="Default" comment="" /> + <created>1462889309319</created> + <option name="number" value="Default" /> + <option name="presentableId" value="Default" /> + <updated>1462889309319</updated> + </task> + <servers /> + </component> + <component name="ToolWindowManager"> + <frame x="-7" y="2" width="1378" height="733" extended-state="0" /> + <editor active="false" /> + <layout> + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18061674" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> + <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> + <window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32905295" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> + <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.329653" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> + <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> + <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> + <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> + <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> + <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> + <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> + <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> + <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> + <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> + <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> + </layout> + </component> + <component name="Vcs.Log.UiProperties"> + <option name="RECENTLY_FILTERED_USER_GROUPS"> + <collection /> + </option> + <option name="RECENTLY_FILTERED_BRANCH_GROUPS"> + <collection /> + </option> + </component> + <component name="VcsContentAnnotationSettings"> + <option name="myLimit" value="2678400000" /> + </component> + <component name="XDebuggerManager"> + <breakpoint-manager /> + <watches-manager /> + </component> + <component name="editorHistoryManager"> + <entry file="file://$PROJECT_DIR$/test/TestRawIO.c"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="0"> + <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/CMakeLists.txt"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="817"> + <caret line="43" column="46" selection-start-line="43" selection-start-column="46" selection-end-line="43" selection-end-column="46" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/include/extern/mr_rawio.h"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="912"> + <caret line="48" column="23" selection-start-line="48" selection-start-column="4" selection-end-line="48" selection-end-column="23" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/worker/rawio.c"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="0"> + <caret line="58" column="5" selection-start-line="58" selection-start-column="5" selection-end-line="58" selection-end-column="5" /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/include/extern/mr_rawio.h"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="248"> + <caret line="38" column="31" selection-start-line="38" selection-start-column="31" selection-end-line="38" selection-end-column="31" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/include/extern/mr_hugepage.h"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="306"> + <caret line="18" column="18" selection-start-line="18" selection-start-column="18" selection-end-line="18" selection-end-column="18" /> + <folding> + <element signature="e#33#45#0" expanded="false" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/worker/CMakeLists.txt"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="391"> + <caret line="23" column="32" selection-start-line="23" selection-start-column="32" selection-end-line="23" selection-end-column="32" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/test/CMakeLists.txt"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="136"> + <caret line="8" column="50" selection-start-line="8" selection-start-column="50" selection-end-line="8" selection-end-column="50" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/test/Makefile"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="0"> + <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/test/TestTradition.c"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="492"> + <caret line="45" column="1" selection-start-line="45" selection-start-column="1" selection-end-line="45" selection-end-column="1" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/test/TestRawIO.c"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="374"> + <caret line="22" column="1" selection-start-line="22" selection-start-column="1" selection-end-line="22" selection-end-column="1" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/CMakeLists.txt"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="492"> + <caret line="53" column="25" selection-start-line="53" selection-start-column="25" selection-end-line="53" selection-end-column="25" /> + <folding /> + </state> + </provider> + </entry> + </component> +</project>
\ No newline at end of file diff --git a/driver/.vscode/.browse.VC.db b/driver/.vscode/.browse.VC.db Binary files differnew file mode 100644 index 0000000..a1209a8 --- /dev/null +++ b/driver/.vscode/.browse.VC.db diff --git a/driver/apt.c b/driver/apt.c index bbdd526..1686f82 100644 --- a/driver/apt.c +++ b/driver/apt.c @@ -43,35 +43,35 @@ extern const int n_conf_path; static const char * apt_find_conffile() { - for(int i = 0; i < n_conf_path; i++) - if(access(conf_path[i],R_OK) == 0) + for (int i = 0; i < n_conf_path; i++) + if (access(conf_path[i], R_OK) == 0) return conf_path[i]; return NULL; } /* 基于PCAP的虚拟设备参数配置 */ -static int apt_paras_eal_veth(int argc_max,__out__ int * argc,__out__ char * argv[]) +static int apt_paras_eal_veth(int argc_max, __out__ int * argc, __out__ char * argv[]) { const char * conffile = apt_find_conffile(); - if(conffile == NULL) + if (conffile == NULL) return -2; int n_eth = 0; - MESA_load_profile_int_def(conffile,"pcap_compatibility","n_device",&n_eth,0); - - if(n_eth <= 0) + MESA_load_profile_int_def(conffile, "pcap_compatibility", "n_device", &n_eth, 0); + + if (n_eth <= 0) return 0; - for(int i = 0; i < n_eth; i++) + for (int i = 0; i < n_eth; i++) { char eth_section_name[APP_MAX_STRING]; char command_line[APP_MAX_STRING]; - memset(command_line,0,APP_MAX_STRING); - memset(eth_section_name,0,APP_MAX_STRING); + memset(command_line, 0, APP_MAX_STRING); + memset(eth_section_name, 0, APP_MAX_STRING); - sprintf(eth_section_name,"pcap_device_%d",i); - sprintf(command_line,"eth_pcap%d,",i); + sprintf(eth_section_name, "pcap_device_%d", i); + sprintf(command_line, "eth_pcap%d,", i); char rx_pcap[APP_MAX_STRING]; char tx_pcap[APP_MAX_STRING]; @@ -79,94 +79,94 @@ static int apt_paras_eal_veth(int argc_max,__out__ int * argc,__out__ char * arg char tx_iface[APP_MAX_STRING]; char iface[APP_MAX_STRING]; - MESA_load_profile_string_def(conffile,eth_section_name,"rx_pcap",rx_pcap,APP_MAX_STRING,""); - MESA_load_profile_string_def(conffile,eth_section_name,"tx_pcap",tx_pcap,APP_MAX_STRING,""); - MESA_load_profile_string_def(conffile,eth_section_name,"rx_iface",rx_iface,APP_MAX_STRING,""); - MESA_load_profile_string_def(conffile,eth_section_name,"tx_iface",tx_iface,APP_MAX_STRING,""); - MESA_load_profile_string_def(conffile,eth_section_name,"iface",iface,APP_MAX_STRING,""); + MESA_load_profile_string_def(conffile, eth_section_name, "rx_pcap", rx_pcap, APP_MAX_STRING, ""); + MESA_load_profile_string_def(conffile, eth_section_name, "tx_pcap", tx_pcap, APP_MAX_STRING, ""); + MESA_load_profile_string_def(conffile, eth_section_name, "rx_iface", rx_iface, APP_MAX_STRING, ""); + MESA_load_profile_string_def(conffile, eth_section_name, "tx_iface", tx_iface, APP_MAX_STRING, ""); + MESA_load_profile_string_def(conffile, eth_section_name, "iface", iface, APP_MAX_STRING, ""); - if(strnlen(rx_pcap,APP_MAX_STRING) != 0) + if (strnlen(rx_pcap, APP_MAX_STRING) != 0) { - strncat(command_line,"rx_pcap=",APP_MAX_STRING); - strncat(command_line,rx_pcap,APP_MAX_STRING); - strncat(command_line,",",APP_MAX_STRING); + strncat(command_line, "rx_pcap=", APP_MAX_STRING); + strncat(command_line, rx_pcap, APP_MAX_STRING); + strncat(command_line, ",", APP_MAX_STRING); } - if(strnlen(tx_pcap,APP_MAX_STRING) != 0) + if (strnlen(tx_pcap, APP_MAX_STRING) != 0) { - strncat(command_line,"tx_pcap=",APP_MAX_STRING); - strncat(command_line,tx_pcap,APP_MAX_STRING); - strncat(command_line,",",APP_MAX_STRING); + strncat(command_line, "tx_pcap=", APP_MAX_STRING); + strncat(command_line, tx_pcap, APP_MAX_STRING); + strncat(command_line, ",", APP_MAX_STRING); } - if(strnlen(tx_pcap,APP_MAX_STRING) != 0) + if (strnlen(tx_pcap, APP_MAX_STRING) != 0) { - strncat(command_line,"rx_iface=",APP_MAX_STRING); - strncat(command_line,rx_iface,APP_MAX_STRING); - strncat(command_line,",",APP_MAX_STRING); + strncat(command_line, "rx_iface=", APP_MAX_STRING); + strncat(command_line, rx_iface, APP_MAX_STRING); + strncat(command_line, ",", APP_MAX_STRING); } - if(strnlen(tx_pcap,APP_MAX_STRING) != 0) + if (strnlen(tx_pcap, APP_MAX_STRING) != 0) { - strncat(command_line,"tx_iface=",APP_MAX_STRING); - strncat(command_line,tx_iface,APP_MAX_STRING); - strncat(command_line,",",APP_MAX_STRING); + strncat(command_line, "tx_iface=", APP_MAX_STRING); + strncat(command_line, tx_iface, APP_MAX_STRING); + strncat(command_line, ",", APP_MAX_STRING); } - if(strnlen(tx_pcap,APP_MAX_STRING) != 0) + if (strnlen(tx_pcap, APP_MAX_STRING) != 0) { - strncat(command_line,"iface",APP_MAX_STRING); - strncat(command_line,iface,APP_MAX_STRING); + strncat(command_line, "iface", APP_MAX_STRING); + strncat(command_line, iface, APP_MAX_STRING); } - if(*argc > (argc_max - 1)) - return -2; - strncpy(argv[(*argc)++],"--vdev",STRING_MAX); + if (*argc > (argc_max - 1)) + return -2; + strncpy(argv[(*argc)++], "--vdev", STRING_MAX); - if(*argc > (argc_max - 1)) - return -2; - strncpy(argv[(*argc)++],command_line,STRING_MAX); + if (*argc > (argc_max - 1)) + return -2; + strncpy(argv[(*argc)++], command_line, STRING_MAX); } return 0; } -static int apt_paras_eal_ccpu(int argc_max,__out__ int * argc,__out__ char * argv[]) +static int apt_paras_eal_ccpu(int argc_max, __out__ int * argc, __out__ char * argv[]) { const char * conffile = apt_find_conffile(); - if(conffile == NULL) + if (conffile == NULL) return -2; - + int n_arg_rx = 0; uint64_t core_ret = 0; - - MESA_load_profile_int_def(conffile,"rx_common","rx_count",&n_arg_rx,0); - if(n_arg_rx <= 0) + MESA_load_profile_int_def(conffile, "rx_common", "rx_count", &n_arg_rx, 0); + + if (n_arg_rx <= 0) return -2; - for(int i = 0; i < n_arg_rx; i++) + for (int i = 0; i < n_arg_rx; i++) { - + char rx_section_name[STRING_MAX]; - sprintf(rx_section_name,"rx_%d",i); - + sprintf(rx_section_name, "rx_%d", i); + int lcore; - MESA_load_profile_int_def(conffile,rx_section_name,"lcore",&lcore,0); - core_ret |= 1 << lcore; + MESA_load_profile_int_def(conffile, rx_section_name, "lcore", &lcore, 0); + core_ret |= 1 << lcore; } - - if(*argc > (argc_max - 1)) + + if (*argc > (argc_max - 1)) return -2; - strncpy(argv[(*argc)++],"-c",STRING_MAX); + strncpy(argv[(*argc)++], "-c", STRING_MAX); char core_hex[STRING_MAX]; - sprintf(core_hex,"0x%x",(unsigned int)core_ret); + sprintf(core_hex, "0x%x", (unsigned int)core_ret); - if(*argc > (argc_max - 1)) - return -2; + if (*argc > (argc_max - 1)) + return -2; - strncpy(argv[(*argc)++],core_hex,STRING_MAX); + strncpy(argv[(*argc)++], core_hex, STRING_MAX); return 0; } @@ -174,7 +174,7 @@ static int apt_paras_eal_ccpu(int argc_max,__out__ int * argc,__out__ char * arg #define __APT_PARSE_EAL_WPCI_MAX_DEVICE 1024 #endif -static int apt_paras_eal_wpci(int argc_max,__out__ int * argc, __out__ char * argv[]) +static int apt_paras_eal_wpci(int argc_max, __out__ int * argc, __out__ char * argv[]) { const char * fcfg_path = apt_find_conffile(); char str_white_dev[STRING_MAX]; @@ -183,68 +183,68 @@ static int apt_paras_eal_wpci(int argc_max,__out__ int * argc, __out__ char * ar char wdev_pci[__APT_PARSE_EAL_WPCI_MAX_DEVICE][STRING_MAX]; unsigned int nb_wdev_name = 0; - MESA_load_profile_string_def(fcfg_path,"eal","enable_device",str_white_dev,APP_MAX_STRING,""); - - if(strncmp(str_white_dev,"",APP_MAX_STRING) == 0) + MESA_load_profile_string_def(fcfg_path, "eal", "enable_device", str_white_dev, APP_MAX_STRING, ""); + + if (strncmp(str_white_dev, "", APP_MAX_STRING) == 0) return -1; - + // Find existed network device's name and its PCI id. struct dirent * device_dir_p; DIR * device_dir; - if((device_dir = opendir("/sys/class/net/")) == NULL) + if ((device_dir = opendir("/sys/class/net/")) == NULL) return -1; - - while((device_dir_p = readdir(device_dir)) != NULL) + + while ((device_dir_p = readdir(device_dir)) != NULL) { - if(strcmp(device_dir_p->d_name,".") == 0 || - strcmp(device_dir_p->d_name,"..") == 0 || - strcmp(device_dir_p->d_name,"lo") == 0) + if (strcmp(device_dir_p->d_name, ".") == 0 || + strcmp(device_dir_p->d_name, "..") == 0 || + strcmp(device_dir_p->d_name, "lo") == 0) continue; char devsym_dir[STRING_MAX]; - strncpy(devsym_dir,"/sys/class/net/",STRING_MAX); - strncat(devsym_dir,device_dir_p->d_name,STRING_MAX); - strncat(devsym_dir,"/device",STRING_MAX); + strncpy(devsym_dir, "/sys/class/net/", STRING_MAX); + strncat(devsym_dir, device_dir_p->d_name, STRING_MAX); + strncat(devsym_dir, "/device", STRING_MAX); char devsym_info[STRING_MAX]; - readlink(devsym_dir,devsym_info,STRING_MAX); + readlink(devsym_dir, devsym_info, STRING_MAX); char devsym_pci[STRING_MAX]; - strncpy(devsym_pci,devsym_info + 11 ,STRING_MAX); + strncpy(devsym_pci, devsym_info + 11, STRING_MAX); - if(strcmp(devsym_pci,"") == 0) + if (strcmp(devsym_pci, "") == 0) continue; assert(nb_wdev_name < __APT_PARSE_EAL_WPCI_MAX_DEVICE); - strncpy(wdev_pci[nb_wdev_name],devsym_pci,STRING_MAX); - strncpy(wdev_name[nb_wdev_name],device_dir_p->d_name,STRING_MAX); + strncpy(wdev_pci[nb_wdev_name], devsym_pci, STRING_MAX); + strncpy(wdev_name[nb_wdev_name], device_dir_p->d_name, STRING_MAX); nb_wdev_name++; } closedir(device_dir); // Find the white device given by user, and check its PCI's ID. - for(char * str_usrtok = strtok(str_white_dev,","); - str_usrtok != NULL; str_usrtok = strtok(NULL,",")) - { + for (char * str_usrtok = strtok(str_white_dev, ","); + str_usrtok != NULL; str_usrtok = strtok(NULL, ",")) + { char str_devname[APP_MAX_STRING]; - strncpy(str_devname,str_usrtok,APP_MAX_STRING); - - for(int i = 0; i < nb_wdev_name; i++) + strncpy(str_devname, str_usrtok, APP_MAX_STRING); + + for (int i = 0; i < nb_wdev_name; i++) { - if(strncmp(str_devname,wdev_name[i],APP_MAX_STRING) != 0) + if (strncmp(str_devname, wdev_name[i], APP_MAX_STRING) != 0) continue; // write command "-w XXXX:XX:XXXX" - if(*argc > (argc_max - 1)) + if (*argc > (argc_max - 1)) return -2; - strncpy(argv[(*argc)++],"-w",STRING_MAX); - if(*argc > (argc_max - 1)) + strncpy(argv[(*argc)++], "-w", STRING_MAX); + if (*argc > (argc_max - 1)) return -2; - strncpy(argv[(*argc)++],wdev_pci[i],STRING_MAX); - + strncpy(argv[(*argc)++], wdev_pci[i], STRING_MAX); + break; } } @@ -252,43 +252,43 @@ static int apt_paras_eal_wpci(int argc_max,__out__ int * argc, __out__ char * ar return 0; } -static int apt_paras_eal_bpci(int argc_max,__out__ int * argc,__out__ char * argv[]) +static int apt_paras_eal_bpci(int argc_max, __out__ int * argc, __out__ char * argv[]) { struct dirent * device_dir_p; DIR * device_dir; - if((device_dir = opendir("/sys/class/net/")) == NULL) + if ((device_dir = opendir("/sys/class/net/")) == NULL) return -1; - - while((device_dir_p = readdir(device_dir)) != NULL) + + while ((device_dir_p = readdir(device_dir)) != NULL) { - if(strcmp(device_dir_p->d_name,".") == 0 || - strcmp(device_dir_p->d_name,"..") == 0 || - strcmp(device_dir_p->d_name,"lo") == 0) + if (strcmp(device_dir_p->d_name, ".") == 0 || + strcmp(device_dir_p->d_name, "..") == 0 || + strcmp(device_dir_p->d_name, "lo") == 0) continue; char devsym_dir[STRING_MAX]; - strncpy(devsym_dir,"/sys/class/net/",STRING_MAX); - strncat(devsym_dir,device_dir_p->d_name,STRING_MAX); - strncat(devsym_dir,"/device",STRING_MAX); + strncpy(devsym_dir, "/sys/class/net/", STRING_MAX); + strncat(devsym_dir, device_dir_p->d_name, STRING_MAX); + strncat(devsym_dir, "/device", STRING_MAX); char devsym_info[STRING_MAX]; - readlink(devsym_dir,devsym_info,STRING_MAX); + readlink(devsym_dir, devsym_info, STRING_MAX); char devsym_pci[STRING_MAX]; - strncpy(devsym_pci,devsym_info + 11 ,STRING_MAX); + strncpy(devsym_pci, devsym_info + 11, STRING_MAX); - if(strcmp(devsym_pci,"") == 0) + if (strcmp(devsym_pci, "") == 0) continue; - if(*argc > (argc_max - 1)) + if (*argc > (argc_max - 1)) return -2; - strncpy(argv[(*argc)++],"-b",STRING_MAX); + strncpy(argv[(*argc)++], "-b", STRING_MAX); - if(*argc > (argc_max - 1)) + if (*argc > (argc_max - 1)) return -2; - strncpy(argv[(*argc)++],devsym_pci,STRING_MAX); + strncpy(argv[(*argc)++], devsym_pci, STRING_MAX); } closedir(device_dir); @@ -298,35 +298,35 @@ static int apt_paras_eal_bpci(int argc_max,__out__ int * argc,__out__ char * arg /* get the -n paras from configure file. */ -int apt_paras_eal_memchannals(int argc_max,__out__ int * argc,__out__ char * argv[]) +int apt_paras_eal_memchannals(int argc_max, __out__ int * argc, __out__ char * argv[]) { int isenable_m = 0; - int n_memchal = 0; - + int n_memchal = 0; + //Read it from configure file - for(int i = 0; i < n_conf_path; i++) + for (int i = 0; i < n_conf_path; i++) { - if(access(conf_path[i],R_OK) == 0) + if (access(conf_path[i], R_OK) == 0) { - MESA_load_profile_int_def(conf_path[i],"eal","enable_spec_memc",&(isenable_m),0); - MESA_load_profile_int_def(conf_path[i],"eal","n_mem_channel",&(n_memchal),0); + MESA_load_profile_int_def(conf_path[i], "eal", "enable_spec_memc", &(isenable_m), 0); + MESA_load_profile_int_def(conf_path[i], "eal", "n_mem_channel", &(n_memchal), 0); break; } } - if(isenable_m <= 0) + if (isenable_m <= 0) return 0; char n_memchal_string[STRING_MAX]; - sprintf(n_memchal_string,"%d",n_memchal); + sprintf(n_memchal_string, "%d", n_memchal); - if(*argc > (argc_max - 1)) + if (*argc > (argc_max - 1)) return -2; - strncpy(argv[(*argc)++],"-n",STRING_MAX); + strncpy(argv[(*argc)++], "-n", STRING_MAX); - if(*argc > (argc_max - 1)) + if (*argc > (argc_max - 1)) return -2; - strncpy(argv[(*argc)++],n_memchal_string,STRING_MAX); + strncpy(argv[(*argc)++], n_memchal_string, STRING_MAX); return 0; } @@ -337,29 +337,53 @@ int apt_paras_eal_virtaddr(int argc_max, __out__ int * argc, __out__ char * argv char virtaddr[APP_MAX_STRING]; const char * fcfg_path = apt_find_conffile(); - MESA_load_profile_int_def(fcfg_path,"virtaddr","enable",&(enable),0); - MESA_load_profile_string_def(fcfg_path,"virtaddr","virtaddr",virtaddr,APP_MAX_STRING,""); + MESA_load_profile_int_def(fcfg_path, "virtaddr", "enable", &(enable), 0); + MESA_load_profile_string_def(fcfg_path, "virtaddr", "virtaddr", virtaddr, APP_MAX_STRING, ""); - if(enable > 0) + if (enable > 0) { - strncpy(argv[(*argc)++],"--base-virtaddr",STRING_MAX); - strncpy(argv[(*argc)++],virtaddr,STRING_MAX); + strncpy(argv[(*argc)++], "--base-virtaddr", STRING_MAX); + strncpy(argv[(*argc)++], virtaddr, STRING_MAX); } return 0; } -int apt_paras_eal(int argc_max,__out__ int * argc,__out__ char * argv[]) +// Raw String, In Debug Mode, Generate the EAL Parameters by Users. +int apt_paras_eal_rawstring(int argc_max, __out__ int * argc, __out__ char * argv[]) { - if(apt_paras_eal_wpci(argc_max,argc,argv) < 0 && apt_paras_eal_bpci(argc_max,argc,argv) < 0) + const char * fcfg_path = apt_find_conffile(); + char str_raw_string[APP_MAX_STRING]; + MESA_load_profile_string_def(fcfg_path, "eal", "rawstring", str_raw_string, sizeof(str_raw_string), ""); + + for (char * str_usrtok = strtok(str_raw_string, ","); + str_usrtok != NULL; str_usrtok = strtok(NULL, ",")) + { + char str_command[APP_MAX_STRING]; + + if (*argc > (argc_max - 1)) + return -2; + strncpy(argv[(*argc)++], str_usrtok, STRING_MAX); + } + + return 0; +} + + + +int apt_paras_eal(int argc_max, __out__ int * argc, __out__ char * argv[]) +{ + if (apt_paras_eal_wpci(argc_max, argc, argv) < 0 && apt_paras_eal_bpci(argc_max, argc, argv) < 0) + return -1; + if (apt_paras_eal_ccpu(argc_max, argc, argv) < 0) return -1; - if(apt_paras_eal_ccpu(argc_max,argc,argv) < 0) + if (apt_paras_eal_memchannals(argc_max, argc, argv) < 0) return -1; - if(apt_paras_eal_memchannals(argc_max,argc,argv) < 0) + if (apt_paras_eal_veth(argc_max, argc, argv) < 0) return -1; - if(apt_paras_eal_veth(argc_max,argc,argv) < 0) + if (apt_paras_eal_virtaddr(argc_max, argc, argv) < 0) return -1; - if(apt_paras_eal_virtaddr(argc_max,argc,argv) < 0) + if (apt_paras_eal_rawstring(argc_max, argc, argv) < 0) return -1; return 0; diff --git a/include/internal/mr_config.h b/include/internal/mr_config.h new file mode 100644 index 0000000..0c65435 --- /dev/null +++ b/include/internal/mr_config.h @@ -0,0 +1,25 @@ +#pragma once + +/* 函数内联编译开关 */ +#define USE_FUNCTION_INLINE 1 + +/* 严格的输入边界检查 */ +#define USE_STRICT_CHECK 1 + +/* 使用带原子操作的统计(精确)*/ +#define USE_ATOMIC_STAT 1 + +/* 木马项目专用 */ +#define USE_PROJECT_TORJAN 0 + +/* 运行时间统计 */ +#define USE_STAT_RUNTIME 0 + +/* 业务核详细统计信息 */ +#define USE_STAT_WORKER_DETAIL 1 + +/* UDP协议栈 */ +#define USE_UDPSTACK 1 + +/* 快速低延迟传递网络 */ +#define USE_FASTRING 1 diff --git a/logreader/lib/.gitignore b/logreader/lib/.gitignore new file mode 100644 index 0000000..32e3c53 --- /dev/null +++ b/logreader/lib/.gitignore @@ -0,0 +1,8 @@ +*.o
+*.ko
+*.swp
+*.tmp
+*.log
+tags
+.tags
+*.so
diff --git a/logreader/lib/libMESA_prof_load.a b/logreader/lib/libMESA_prof_load.a Binary files differnew file mode 100644 index 0000000..385e9f1 --- /dev/null +++ b/logreader/lib/libMESA_prof_load.a diff --git a/support/MESA_prof_load/lib/libMESA_prof_load.a b/support/MESA_prof_load/lib/libMESA_prof_load.a Binary files differnew file mode 100644 index 0000000..385e9f1 --- /dev/null +++ b/support/MESA_prof_load/lib/libMESA_prof_load.a diff --git a/support/MESA_prof_load/lib/libMESA_prof_load.so b/support/MESA_prof_load/lib/libMESA_prof_load.so Binary files differnew file mode 100644 index 0000000..51b7b3c --- /dev/null +++ b/support/MESA_prof_load/lib/libMESA_prof_load.so diff --git a/worker/udpstack.c b/worker/udpstack.c index ee5e754..ddcdbd5 100644 --- a/worker/udpstack.c +++ b/worker/udpstack.c @@ -180,10 +180,10 @@ static volatile uint32_t fd_seq; // 前置声明 int udpstack_route_send_burst(struct rte_mbuf * mbufs[], uint32_t dstip[], - uint32_t srcip[], uint8_t l4_proto[], int nb_mbufs, unsigned flags); + uint32_t srcip[], uint8_t l4_proto[], int nb_mbufs, unsigned flags); int udpstack_ether_send_burst(struct rte_mbuf * mbuf[], uint32_t target_ip[], - uint8_t if_out[], int nb_mbufs, unsigned flags); + uint8_t if_out[], int nb_mbufs, unsigned flags); int udpstack_ether_send(struct rte_mbuf * mbuf, uint32_t target_ip, uint8_t if_out, unsigned flags); @@ -590,7 +590,7 @@ exit: } INLINE static int arp_table_query(struct udpstack_arp_table * object, uint32_t ip, - struct ether_addr * src_eth_addr, struct ether_addr * dst_eth_addr, + struct ether_addr * src_eth_addr, struct ether_addr * dst_eth_addr, uint8_t * if_out, uint8_t* flags, void** arp_rule) { rte_rwlock_read_lock(&object->lock); @@ -1585,7 +1585,7 @@ enum // 三层发包接口 int udpstack_route_send_burst(struct rte_mbuf * mbufs[], uint32_t dstip[], - uint32_t srcip[], uint8_t l4_proto[], int nb_mbufs, unsigned flags) + uint32_t srcip[], uint8_t l4_proto[], int nb_mbufs, unsigned flags) { if (unlikely(nb_mbufs > UDPSTACK_BULK_MAX)) return -ENOBUFS; uint16_t datalen[UDPSTACK_BULK_MAX]; @@ -1654,7 +1654,7 @@ int udpstack_route_send_burst(struct rte_mbuf * mbufs[], uint32_t dstip[], // 送链路层发包 udpstack_ether_send_burst(ready_to_send, ready_to_send_ip, - ready_to_send_if, nb_ready_to_send, flags); + ready_to_send_if, nb_ready_to_send, flags); return 0; } @@ -1707,7 +1707,7 @@ int udpstack_route_init() } int udpstack_ether_send_burst(struct rte_mbuf * mbuf[], uint32_t target_ip[], - uint8_t if_out[], int nb_mbufs, unsigned flags) + uint8_t if_out[], int nb_mbufs, unsigned flags) { int burst_ret[UDPSTACK_BULK_MAX]; for (int i = 0; i < nb_mbufs; i++) @@ -2429,7 +2429,9 @@ static int udpstack_config_arp(const char * cfgfile) // 读默认ARP配置表 if (arp_config_info.en_default_arp) - return 0; + { + udpstack_config_arp_defualt_rule(cfgfile); + } return 0; } |
