Skip to content

Commit cac81bf

Browse files
committed
Merge branch 'master_devel'
2 parents 1e91ce8 + e0bda78 commit cac81bf

File tree

169 files changed

+112871
-119473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+112871
-119473
lines changed

adb_parser/adb_parser.cpp

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,13 +1872,34 @@ string Adb::evalExpr(string expr, AttrsMap *vars) {
18721872
string vvalue;
18731873
regex singleVar("^[a-zA-Z_][a-zA-Z0-9_]*$");
18741874

1875+
//Need to change to array-like initialization when we'll move to c++11
1876+
vector<string> specialVars;
1877+
specialVars.push_back("NAME");
1878+
specialVars.push_back("ARR_IDX");
1879+
specialVars.push_back("BN");
1880+
specialVars.push_back("parent");
1881+
18751882
if (regex_search(vname, what2, singleVar)) {
1876-
AttrsMap::iterator it = vars->find(vname);
1877-
if (it == vars->end()) {
1878-
throw AdbException("Can't find the variable: " + vname);
1883+
if (find(specialVars.begin(), specialVars.end(), vname) == specialVars.end()) {
1884+
return expr;
1885+
} else {
1886+
AttrsMap::iterator it = vars->find(vname);
1887+
if (it == vars->end()) {
1888+
throw AdbException("Can't find the variable: " + vname);
1889+
}
1890+
vvalue = it->second;
18791891
}
1880-
vvalue = it->second;
18811892
} else {
1893+
string vnameCopy = vname;
1894+
regex singleVarInExpr("[a-zA-Z_][a-zA-Z0-9_]*");
1895+
smatch matches;
1896+
while (regex_search(vnameCopy, matches, singleVarInExpr)) {
1897+
if (find(specialVars.begin(), specialVars.end(), matches[0]) == specialVars.end()) {
1898+
return expr;
1899+
}
1900+
vnameCopy = matches.suffix();
1901+
}
1902+
18821903
char exp[vname.size() + 1];
18831904
char *expPtr = exp;
18841905
strcpy(exp, vname.c_str());
@@ -2499,10 +2520,15 @@ void AdbParser::includeFile(AdbParser *adbParser, string fileName,
24992520
void AdbParser::includeAllFilesInDir(AdbParser *adbParser, string dirPath,
25002521
int lineNumber) {
25012522
vector < string > paths;
2523+
boost::filesystem::path mainFile(adbParser->_fileName);
25022524
boost::algorithm::split(paths, dirPath, boost::is_any_of(string(";")));
2503-
25042525
for (StringVector::iterator pathIt = paths.begin(); pathIt != paths.end(); pathIt++) {
2505-
boost::filesystem::path fsPath(*pathIt);
2526+
//first look in the main file's path
2527+
boost::filesystem::path fsPath (mainFile.parent_path().string() + "/" + *pathIt);
2528+
if (!boost::filesystem::exists(fsPath)) {
2529+
fsPath = boost::filesystem::path(*pathIt);
2530+
}
2531+
25062532
if (boost::filesystem::exists(fsPath)
25072533
&& boost::filesystem::is_directory(fsPath)) {
25082534
addIncludePaths(adbParser->_adbCtxt, *pathIt);

adb_parser/adb_parser.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class AdbInstance {
201201
bool operator<(const AdbInstance& other);
202202
bool isConditionalNode();
203203
bool isConditionValid(map<string, string> *valuesMap);
204-
205204
// DB like access methods
206205
AdbInstance
207206
* getChildByPath(const string& path, bool isCaseSensitive = true);
@@ -234,7 +233,6 @@ class AdbInstance {
234233
u_int32_t arrIdx;
235234
AdbInstance *unionSelector; // For union instances only
236235
bool isDiff;
237-
238236
// FOR USER USAGE
239237
void *userData;
240238
private:

cmdif/cmdif.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ def multiHostSyncStatus(self):
154154

155155
##########################
156156
class QUERY_CAP_ST(Structure):
157-
_fields_ = [("virtual_link_down", c_uint8),
157+
_fields_ = [("golden_tlv_version", c_uint8),
158+
("cwcam_reg", c_uint8),
159+
("capability_groups", c_uint8),
160+
("virtual_link_down", c_uint8),
158161
("icmd_exmb", c_uint8),
159162
("capi", c_uint8),
160163
("qcam_reg", c_uint8),
@@ -173,7 +176,8 @@ class QUERY_CAP_ST(Structure):
173176
("wol_s", c_uint8),
174177
("rol_g", c_uint8),
175178
("rol_s", c_uint8),
176-
("fpga", c_uint8)]
179+
("fpga", c_uint8),
180+
("num_of_diagnostic_counters", c_uint16)]
177181

178182
##########################
179183
def isMultiHostSyncSupported(self):

cmdif/icmd_cif_open.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ int gcif_get_fw_info(mfile *mf,
5454
/*
5555
* get_icmd_query_cap
5656
*/
57-
int get_icmd_query_cap(mfile *mf, struct connectx4_icmd_query_cap_general *icmd_query_caps)
57+
int get_icmd_query_cap(mfile *mf, struct icmd_hca_icmd_query_cap_general *icmd_query_caps)
5858
{
59-
SEND_ICMD_FLOW(mf, GET_ICMD_QUERY_CAP, connectx4_icmd_query_cap_general, icmd_query_caps, 1, 0);
59+
SEND_ICMD_FLOW(mf, GET_ICMD_QUERY_CAP, icmd_hca_icmd_query_cap_general,
60+
icmd_query_caps, 1, 0);
6061
}
6162

6263
int gcif_mh_sync(mfile *mf, struct connectx4_icmd_mh_sync *mh_sync)
@@ -75,7 +76,3 @@ int gcif_set_itrace(mfile *mf, struct connectib_itrace *itrace)
7576
SEND_ICMD_FLOW(mf, SET_ITRACE, connectib_itrace, itrace, 1, 0);
7677
}
7778

78-
int gcif_set_port_sniffer(mfile *mf, struct connectib_icmd_set_port_sniffer *set_port_sniffer)
79-
{
80-
SEND_ICMD_FLOW(mf, SET_PORT_SNIFFER, connectib_icmd_set_port_sniffer, set_port_sniffer, 1, 0);
81-
}

cmdif/icmd_cif_open.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ extern "C" {
4444
#else
4545
#include <tools_layouts/connectib_layouts.h>
4646
#include <tools_layouts/connectx4_layouts.h>
47+
#include <tools_layouts/icmd_hca_layouts.h>
4748
#include "cib_cif.h"
4849
#endif
4950
#include "icmd_cif_common.h"
@@ -64,20 +65,19 @@ enum {
6465
enum {
6566
GET_ICMD_QUERY_CAP = 0x8400,
6667
SET_ITRACE = 0xf003,
67-
SET_PORT_SNIFFER = 0xc002,
6868
};
6969
#endif
7070

7171
int gcif_get_fw_info(mfile *mf,
7272
OUT struct connectib_icmd_get_fw_info *fw_info);
7373

74-
int get_icmd_query_cap(mfile *mf, struct connectx4_icmd_query_cap_general *icmd_query_caps);
74+
int get_icmd_query_cap(mfile *mf,
75+
struct icmd_hca_icmd_query_cap_general *icmd_query_caps);
7576

7677
int gcif_mh_sync(mfile *mf, struct connectx4_icmd_mh_sync *mh_sync);
7778

7879
int gcif_mh_sync_status(mfile *mf, struct connectx4_icmd_mh_sync *mh_sync);
7980

80-
int gcif_set_port_sniffer(mfile *mf, struct connectib_icmd_set_port_sniffer *set_port_sniffer);
8181

8282
#ifdef __cplusplus
8383
}

cmdparser/cmdparser.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,12 @@ ParseStatus CommandLineParser::ParseOptions(int argc, char **argv,
575575
}
576576
}
577577
if (ignore_this_req == false) {
578-
curr_result = p_req->HandleOption(long_opt_name, (tools_optarg == NULL) ? "" : tools_optarg);
578+
try{
579+
curr_result = p_req->HandleOption(long_opt_name, (tools_optarg == NULL) ? "" : tools_optarg);
580+
}catch (std::exception){
581+
this->SetLastError("Failed to handle option %s", long_opt_name.c_str());
582+
goto parse_exit;
583+
}
579584
if (curr_result) {
580585
rc = curr_result;
581586
this->SetLastError("Failed to handle option %s", long_opt_name.c_str());

common/compatibility.h

Lines changed: 62 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,52 @@
4040

4141
#include <stdio.h>
4242

43+
#if defined(__ia64__) || defined(__x86_64__) || defined(__PPC64__) || defined(__arm__)
44+
#define U64L "l"
45+
#else
46+
#define U64L "ll"
47+
#endif
48+
49+
50+
/* define macros to the architecture of the CPU */
51+
#if defined(__linux__) || defined(__FreeBSD__)
52+
# if defined(__i386__)
53+
# define ARCH_x86
54+
# elif defined(__x86_64__)
55+
# define ARCH_x86_64
56+
# elif defined(__ia64__)
57+
# define ARCH_ia64
58+
# elif defined(__PPC64__) || defined(__s390x__)
59+
# define ARCH_ppc64
60+
# elif defined(__PPC__)
61+
# define ARCH_ppc
62+
# elif defined(__aarch64__)
63+
# define ARCH_arm64
64+
# elif defined(__arm__)
65+
# define ARCH_arm6l
66+
# else
67+
# error Unknown CPU architecture using the linux OS
68+
# endif
69+
#elif defined(__MINGW32__) || defined(__MINGW64__) /* Windows MINGW */
70+
# if defined(__MINGW32__)
71+
# define ARCH_x86
72+
# elif defined(__MINGW64__)
73+
# define ARCH_x86_64
74+
# else
75+
# error Unknown CPU architecture using the windows-mingw OS
76+
# endif
77+
#elif defined(_WIN32) || defined(_WIN64) /* Windows */
78+
# if defined(_WIN32)
79+
# define ARCH_x86
80+
# elif defined(_WIN64)
81+
# define ARCH_x86_64
82+
# else
83+
# error Unknown CPU architecture using the windows OS
84+
# endif
85+
#else /* Unknown */
86+
# error Unknown OS
87+
#endif
88+
4389
/* define macros for print fields */
4490
#define U32D_FMT "%u"
4591
#define U32H_FMT "0x%08x"
@@ -48,33 +94,30 @@
4894
#define U16H_FMT "0x%04x"
4995
#define U8H_FMT "0x%02x"
5096

51-
#if defined(__linux) || defined(__FreeBSD__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(_WIN32) || defined(_WIN64)
52-
# include <stdint.h>
53-
# include <inttypes.h>
54-
# if defined(PRId64) && defined(PRIx64)
55-
# define U64D_FMT "%" PRId64
97+
#if defined(ARCH_x86) || defined(ARCH_ppc) || defined(UEFI_BUILD) || defined(ARCH_arm6l)
98+
# if defined(__MINGW32__) || defined(__MINGW64__)
99+
# include <inttypes.h>
100+
# define U64D_FMT "0x%" PRId64
56101
# define U64H_FMT "0x%" PRIx64
57-
# define U64H_FMT_GEN PRIx64
102+
# define U64H_FMT_GEN "" PRIx64
58103
# define U48H_FMT "0x%" PRIx64
59-
# define U64D_FMT_GEN PRId64
60-
# elif defined(__MINGW32__) || defined(_WIN32) || defined(__i386__) || defined(__PPC__) || defined(UEFI_BUILD) || defined(__arm__)
61-
# define U64L "ll"
104+
# define U64D_FMT_GEN "" PRId64
105+
# else
62106
# define U64D_FMT "%llu"
63107
# define U64H_FMT "0x%016llx"
64108
# define U64H_FMT_GEN "llx"
65109
# define U48H_FMT "0x%012llx"
66110
# define U64D_FMT_GEN "llu"
67-
# else
68-
# define U64L "l"
69-
# define U64D_FMT "%lu"
70-
# define U64H_FMT "0x%016lx"
71-
# define U48H_FMT "0x%012lx"
72-
# define U64H_FMT_GEN "lx"
73-
# define U64D_FMT_GEN "lu"
74111
# endif
112+
#elif defined(ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64)
113+
# define U64D_FMT "%lu"
114+
# define U64H_FMT "0x%016lx"
115+
# define U48H_FMT "0x%012lx"
116+
# define U64H_FMT_GEN "lx"
117+
# define U64D_FMT_GEN "lu"
75118
#else
76-
# error Unknown OS or Architecture
77-
#endif
119+
# error Unknown architecture
120+
#endif /* ARCH */
78121

79122
/*
80123
* Only for architectures which can't do swab by themselves
@@ -386,7 +429,7 @@ typedef uint8_t u_int8_t;
386429
#include <inttypes.h>
387430
#endif
388431

389-
#if defined(__VMKERNEL_UW_VMKLINUX__) || defined(__VMKERNEL_UW_NATIVE__)
432+
#if defined(__VMKERNEL_UW_NATIVE__)
390433
#define ROOT_PATH "/opt/mellanox/"
391434
#else
392435
#define ROOT_PATH "/"

common/python_wrapper.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,16 @@ else
3232
fi
3333
fi
3434

35-
exec $PYTHON_EXEC $MSTFLINT_PYTHON_TOOLS/$EXEC_NAME/${EXEC_NAME}.py "$@"
35+
SCRIPT_PATH=$MSTFLINT_PYTHON_TOOLS/${EXEC_NAME}/${EXEC_NAME}.py
36+
37+
if test ! -f $SCRIPT_PATH; then
38+
SCRIPT_PATH=$(find $MSTFLINT_PYTHON_TOOLS -name ${EXEC_NAME}.py)
39+
fi
40+
41+
if test -z "${SCRIPT_PATH=}"; then
42+
>&2 echo "-E- Couldn't find ${EXEC_NAME}.py"
43+
exit 2
44+
fi
45+
46+
exec $PYTHON_EXEC $SCRIPT_PATH "$@"
47+

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131

3232
dnl Process this file with autoconf to produce a configure script.
3333

34-
AC_INIT(mstflint, 4.15.0, [email protected])
34+
AC_INIT(mstflint, 4.16.0, [email protected])
3535

3636
AC_DEFINE_UNQUOTED([PROJECT], ["mstflint"], [Define the project name.])
3737
AC_SUBST([PROJECT])
3838

39-
AC_DEFINE_UNQUOTED([VERSION], ["4.15.0"], [Define the project version.])
39+
AC_DEFINE_UNQUOTED([VERSION], ["4.16.0"], [Define the project version.])
4040
AC_SUBST([VERSION])
4141

4242
AC_CONFIG_MACRO_DIR([m4])

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
mstflint (4.16.0-1) unstable; urgency=low
2+
3+
* Updated from MFT-4.16.0
4+
5+
-- Kostiantyn Maksatov <kostiantynm@unknown> Thu, 17 Dec 2020 04:58:33 +0300
6+
17
mstflint (4.15.0-1) unstable; urgency=low
28

39
* Ported ConnectX6Dx EFUSE programming from MFT 4.16.0

0 commit comments

Comments
 (0)