Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added manually configuring socket prio #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nilsalon100
Copy link

The PR review is to check for sustainability and correctness. Sustainability is actually more business critical as correctness is largely tested into the code over time. Its useful to keep in mind that SW often outlives the HW it was written for and engineers move from job to job so it is critical that code developed for Intel be supportable across many years. It is up to the submitter and reviewer to look at the code from a perspective of what if we have to debug this 3 years from now after the author is no longer available and defect databases have been lost. Yes, that happens all the time when we are working with time scales of more than 2 years. When reviewing your code it is important to look at it from this perspective.

Author Mandatory (to be filled by PR Author/Submitter)

  • Developer who submits the Pull Request for merge is required to mark the checklist below as applicable for the PR changes submitted.
  • Those checklist items which are not marked are considered as not applicable for the PR change.
  • Items marked with an asterisk suffix are mandatory items to check and if not marked will be treated as non-compliant pull requests by the developers for Inner Source Development Model (ISDM) compliance

PULL DESCRIPTION (to be filled by PR Author/Submitter)

Provide a 1-2 line brief overview of the changes submitted through the Pull Request...

  • Platform Name: IOGT TSN Ref SW
  • Component Name: src/txrx.c
  • Description: Added function and flag for manually configuring the socket prio in Txrx-tsn.
  • Dependencies (Optional):
  • GIO Execution Summary Link(Optional):

REFERENCES (to be filled by PR Author/Submitter)

Reference URL for issue tracking (JIRA/HSD/Github): <URL to be filled>

  • Added label to the Pull Request following the template: ISDM_<Complexity>*
    Note-1: Depending on complexity of code changes, use the suitable word for complexity: Low/Medium/High
    Example: PR for Slim boot loader project with medium complexity can have the label as: ISDM_Medium
  • Added label to the Pull Request for easier discoverability and search

CODE MAINTAINABILITY (to be filled by PR Author/Submitter)

  • Commit Message meets guidelines as indicated in the URL*
  • Every commit is a single defect fix and does not mix feature addition or changes*
  • Added required new tests relevant to the changes
    • PR contains URL links to functional tests executed with the new tests
  • Updated Documentation as relevant to the changes
  • Updated Build steps/commands changes as relevant - (NA for STAR)
  • PR change contains code related to security - (NA for STAR)
  • PR introduces changes that breaks compatibility with other modules (If YES, please provide description)
  • Specific instructions or information for code reviewers (If any):

UPSTREAM EXPECTATIONS (NA for STAR)

  • Commit comment uses "imperative mood" (See line 89-93 of Documentation/process/submitting-patches.rs)
  • PR does not break bisect
  • PR does not break the compilation of other ISA's (i386, x86_64, AARCH64, ARM, PPC, RISCV, etc.)
  • Kconfig's are well designed
  • Signed-off-by and Reviewed-by tags are correctly formatted

Maintainer Mandatory (to be filled by PR Reviewer/Approving Maintainer)

  • Maintainer who approves the Pull Request for merge is required to mark the checklist below as appropriate for the PR change reviewed as key proof of attestation indicating reasons for merge.
  • Those checklist items which are not marked are considered as not applicable for the PR change.
  • Items marked with an asterisk suffix are mandatory items to check and if not marked will be treated as non-compliant pull requests by the maintainers for ISDM compliance.

QUALITY CHECKS (to be filled by PR Reviewer/Approving Maintainer)

  • Architectural and Design Fit
  • Quality of code (At least one should be checked as applicable)*
    • Commit Message meets guidelines
    • PR changes adhere to industry practices and standards
    • Upstream expectations are met
    • Adopted domain specific coding standards (SBL Coding Standards)
    • Error and exception code paths implemented correctly
    • Code reviewed for domain or language specific anti-patterns
    • Code is adequately commented
    • Code copyright is correct
    • Tracing output are minimized and logic
    • Confusing logic is explained in comments
    • Commit comment can be used to design a new test case for the changes
  • Test coverage shows adequate coverage with required CI functional tests pass on all supported platforms*
  • Static code scan report shows zero critical issues*

CODE REVIEW IMPACT (Optional - need to discuss with ISDM forum)

  • Summary of Defects Detected in Code Review: <%P1xx,P2xx,P3xx,P4xx%>
    Note P1/P2/P3/P4 denotes severity of defects found (Showstopper/High/Medium/Low) and xx denotes number of defects found

SECURITY CHECKS (NA for STAR)

Please check if your PR fulfills the following requirements:

  • Avoid checks that rely on the result of undefined C behavior.
    Instead, clarify the check condition using defined behaviors. Example: if (x > INT_MAX-100) instead of if (x + 100 < x)
  • Use safe arithmetic to avoid integer overflow.
  • Follow best practices when handling primitive data types
  • Follow security best practices when dealing with pointers
  • Avoid uncontrolled format strings
  • Prevent buffer overflow/underflow
  • Avoid unsafe functions
  • Configure minimal permissions when opening pipes and ports
  • Check contents within input structures are valid before use
  • All forms of input validated
  • Avoid inter-process race conditions
  • Error and exception handling implemented
  • Use keywords and #pragma to constrain gcc compiler optimization
  • Prevent compiler from optimizing out security checks

Code must act as a teacher for future developers

@ws-intel
Copy link
Contributor

ws-intel commented Apr 1, 2024

Code review in progress.

@ws-intel
Copy link
Contributor

ws-intel commented Apr 2, 2024

Hi there, can you add some explanation about your change in the commit message?

@ws-intel
Copy link
Contributor

ws-intel commented Apr 2, 2024

Besides, I think the code inside this commit https://github.com/intel/iotg_tsn_ref_sw/pull/33/commits/4f02c48f2bb0f37521d9b958ebe5b6621a113b19 seems like not part of the original code. Can you rebase to the latest code?

@@ -132,6 +132,8 @@ static struct argp_option options[] = {
{"wakeup", 'w', 0, 0, "enable need_wakeup"},
{"vlan-prio", 'q', "NUM", 0, "packet vlan priority, also socket priority\n"
" Def: 0 | Min: 0 | Max: 7"},
{"socket-prio", 'g', "NUM", 0, "packet socket priority\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unwanted indentation between socket priority

len = strlen(arg);
res = strtol((const char *)arg, &str_end, 10);
if (errno || res < 0 || res >= 15 || str_end != &arg[len])
exit_with_error("Invalid queue number/socket priority. Check --help");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this specifically for socket priority only then queue number need to be removed

@@ -188,6 +190,15 @@ static error_t parser(int key, char *arg, struct argp_state *state)
#endif
opt->vlan_prio = opt->socket_prio * 32;
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the option 'g' specifically for socket priority then the socket priority need to be decouple out from option 'q' to prevent any error occur.

@ws-intel ws-intel requested a review from HongAun-Intel April 5, 2024 13:15
@ws-intel ws-intel added the rework Rework needed label Apr 5, 2024
@YongLiang2022
Copy link
Contributor

Hi @nilsalon100,

Could you please squash all the commits into one? This would help make the history much cleaner and more useful for later inspection and analysis, such as when using git blame and git bisect.

Copy link
Contributor

@HongAun-Intel HongAun-Intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nilsalon100 - Kindly Squash all the patches, otherwise we can't proceed on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rework Rework needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants