Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/filesys.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern int rm_file( const_str fname, int backup ) {
has a trailing slash we assume it's a directory and bang on
the filename, otherwise we use the name as is.

We assume that the files can be moved with the rname() system
We assume that the files can be moved with the rename() system
call which might require that the files are in the same filesystem.

Returns true on success; false otherwise and errno should be
Expand Down Expand Up @@ -147,7 +147,7 @@ extern mode_t file_mode( const_str pathname ) {
}

/*
Convenience funcitons
Convenience functions
*/
extern int is_dir( const_str pathname ) {
mode_t mode;
Expand Down Expand Up @@ -201,7 +201,7 @@ extern int cp_file( const_str path1, const_str path2, int rm_src ) {
char* dest = NULL;
const_str cp = NULL;
int len = 0;
int sfd; // soruce file des
int sfd; // source file des
int dfd; // dest file des
char rbuf[4096];

Expand All @@ -226,7 +226,7 @@ extern int cp_file( const_str path1, const_str path2, int rm_src ) {

snprintf( dest, len, "%s/%s", path2, cp ); // build the full dest path
} else {
dest = strdup( path2 ); // so we can unditionally free later
dest = strdup( path2 ); // so we can unconditionally free later
}

if( (sfd = open( path1, O_RDONLY )) < 0 ) {
Expand Down
12 changes: 6 additions & 6 deletions src/lib/id_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Abstract: Functions to manage a range of numeric IDs.
Create a new id manager with mk_idm() and then the caller can allocate
new IDs in the range of 0 through num_ids-1, and can return them
when finshed so they can be allocated again.
when finished so they can be allocated again.

Author: E. Scott Daniels
Date: 28 June 2017
Expand Down Expand Up @@ -33,7 +33,7 @@ typedef struct id {
} idm_t;

/*
Make a new manager block, ititialise it and return. Num_ids is the number
Make a new manager block, initialise it and return. Num_ids is the number
of total IDs to support.
*/
extern void* mk_idm( int num_ids ) {
Expand Down Expand Up @@ -105,7 +105,7 @@ extern int idm_alloc( void* vid ) {
Allows the user to allocate a specific ID; returns 1 if
the ID was unused and is now marked in use, and 0 if the ID
was already assigned and should not otherwise be used. A return
of -1 indicated an error (bad value passed in etc.).
of -1 indicates an error (bad value passed in etc.).
*/
extern int idm_use( void* vid, int id_val ) {
idm_t* id;
Expand All @@ -122,7 +122,7 @@ extern int idm_use( void* vid, int id_val ) {
return -1;
}

i = id_val / 8; // offset into bit poool
i = id_val / 8; // offset into bit pool
if( i > id->nallocated ) { // shouldn't happen, but prevent accidents
return -1;
}
Expand Down Expand Up @@ -156,7 +156,7 @@ extern int idm_is_used( void* vid, int id_val ) {
return -1;
}

i = id_val / 8; // offset into bit poool
i = id_val / 8; // offset into bit pool
if( i > id->nallocated ) { // shouldn't happen, but prevent accidents
return -1;
}
Expand Down Expand Up @@ -188,7 +188,7 @@ extern void idm_return( void* vid, int id_val ) {
return;
}

i = id_val / 8; // offset into bit poool
i = id_val / 8; // offset into bit pool
if( i > id->nallocated ) { // shouldn't happen, but prevent accidents
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/jw_xapi.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//vi: ts=4 sw=4 noet:
/*
Mnemonic: jw_xapi.c
Abstract: This is an extended api set for the 'primatives' in jwrapper.
Abstract: This is an extended api set for the 'primitives' in jwrapper.
Author: E. Scott Daniels
Date: 11 Feb 2017

Expand Down
10 changes: 5 additions & 5 deletions src/lib/list_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extern void free_list( char** list, int size ) {
}

/*
Internal funciton which supports either a prefix or suffix match
Internal function which supports either a prefix or suffix match

Files in the directory (dname) are listed and added to the list which is
returned if:
Expand All @@ -66,7 +66,7 @@ extern void free_list( char** list, int size ) {

If len is not NULL, then the number of files placed into the list is returned.
If len is NULL, then we bail -- it's meaningless to return the list without
communicating how long it is, and free_list() requires the lenght to work
communicating how long it is, and free_list() requires the length to work
properly.
*/
static char** mk_list( char* dname, const char* match, int flags, int* len ) {
Expand All @@ -83,7 +83,7 @@ static char** mk_list( char* dname, const char* match, int flags, int* len ) {
int cmp_len; // length for prefix compare


memset( &fentry, 0, sizeof( fentry ) ); // probably unecessary, but keeps valgrind from complaining as readdir_r may not completely populate the struct
memset( &fentry, 0, sizeof( fentry ) ); // probably unnecessary, but keeps valgrind from complaining as readdir_r may not completely populate the struct

if( dname == NULL || match == NULL || len == NULL ) {
errno = ENOENT; // simulate system level error
Expand All @@ -110,7 +110,7 @@ static char** mk_list( char* dname, const char* match, int flags, int* len ) {
cmp_len = strlen( match );

while( (state = readdir_r( dfd, &fentry, &fep )) == 0 ) {
if( fep == NULL ) { // succes and nil pointer indicate no more entries
if( fep == NULL ) { // success and nil pointer indicate no more entries
list[lidx] = NULL;
if( len != NULL ) {
*len = lidx; // return the number of entries if user supplied pointer
Expand Down Expand Up @@ -178,7 +178,7 @@ static char** mk_list( char* dname, const char* match, int flags, int* len ) {
If the suffix is given as "", then all files which do NOT begin
with a dot (.) are returned.

If qualifiy is set, then each file name in the list is appended
If qualify is set, then each file name in the list is appended
to the directory name with a slant inserted. Any other value is

A NULL list is returned on error and errno set in most cases.
Expand Down
4 changes: 2 additions & 2 deletions src/system/vreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
without sudo (the intent is that this command is installed suid root).
Vreq will accept only the commands which are allowed by all users
as opposed to explicitly checking to see if the executing user is
indeed root and allowing privledged commands if the uid/euid is root;
indeed root and allowing privileged commands if the uid/euid is root;
the limit makes it easier to vet from a security point of view at the
expense of some duplication of the code with iplex (maybe iplex should
invoke this for the generic user commands).
Expand Down Expand Up @@ -108,7 +108,7 @@ extern cl_parms_t* crack_args( int argc, char** argv ) {
}
}

snprintf( wbuf, sizeof( wbuf ), "%s_vreq.%d", parms->vfd_channel, getpid() ); // base respons on the inbound channel name
snprintf( wbuf, sizeof( wbuf ), "%s_vreq.%d", parms->vfd_channel, getpid() ); // base response on the inbound channel name
parms->resp_channel = strdup( wbuf );

parms->argc = argc - parg; // set up positional parameter info
Expand Down
10 changes: 5 additions & 5 deletions src/vfd/vfd_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ struct rte_eth_conf *vfd_dcb_init( uint8_t port ) {
the index in our configuration.
*/
extern int vfd_dcb_config( sriov_port_t *pf ) {
uint8_t port; // rte port number that underlying funcitons need
uint8_t port; // rte port number that underlying functions need
struct rte_eth_dev *pf_dev; // real device info managed by dpdk
int i;
uint8_t tc_pctgs[MAX_TCS]; // collection of percentages to give to underlying funcitons
uint8_t tc_pctgs[MAX_TCS]; // collection of percentages to give to underlying functions

port = pf->rte_port_number; // vetted by caller, so assume good
pf_dev = &rte_eth_devices[port]; // device info from dpdk
Expand All @@ -95,7 +95,7 @@ extern int vfd_dcb_config( sriov_port_t *pf ) {
ixgbe_configure_dcb( pf_dev ); // set up dcb
qos_set_tdplane( port, tc_pctgs, pf->tc2bwg, pf->ntcs, pf->mtu ); // configure tc plane with our percentages
qos_set_txpplane( port, tc_pctgs, pf->tc2bwg, pf->ntcs, pf->mtu ); // configure packet plane with our percentages
qos_enable_arb( port ); // finally turn arbitors on
qos_enable_arb( port ); // finally turn arbiters on
} else {
vfd_mlx5_set_prio_trust(port);
return vfd_mlx5_set_qos_pf(port, pf->tc_config, pf->ntcs);
Expand All @@ -117,7 +117,7 @@ extern int vfd_dcb_config( sriov_port_t *pf ) {
Return 0 if there were no errors, 1 otherwise. The calling programme should
not continue if this function returns anything but 0.

This funciton is a complete replacement for port_init() and this should be invoked
This function is a complete replacement for port_init() and this should be invoked
when running in dcb (qos) mode instead of port_init().
*/
extern int dcb_port_init( sriov_port_t *pf, __attribute__((__unused__)) struct rte_mempool *mbuf_pool)
Expand Down Expand Up @@ -216,7 +216,7 @@ extern int dcb_port_init( sriov_port_t *pf, __attribute__((__unused__)) struct r

rte_eth_promiscuous_enable(port); // Enable RX in promiscuous mode for the Ethernet device.

if( vfd_dcb_config( pf ) != 0 ) { // finally set the dcb config, enable arbitors, etc.
if( vfd_dcb_config( pf ) != 0 ) { // finally set the dcb config, enable arbiters, etc.
bleat_printf( 0, "CRI: abort: dcb_port_init: dcb initialisation failed" );
return 1;
}
Expand Down