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

Making cancel_sending() API robust #8299

Merged
merged 1 commit into from Oct 15, 2018

Conversation

Projects
None yet
7 participants
@hasnainvirk
Contributor

hasnainvirk commented Oct 2, 2018

Description

If the packet is already handed over to the PHY layer, we shouldn't be
able to cancel that particular transmission. In addition to that if the
backoff timer is either not applied or has been deactivated, should end
up in no-op rather than having normal termination. A new error code has
been introduced to cover no-op cases. This error code replaces the
compliance test related error code which is no longer relevant.
clear_tx_pipe() does nothing if:
- The stack cannot cancel TX (already handed over to PHY)
- The backoff timer is not active at all
- The event is disaptched to schedule

stop_sending() will only post process ongoing TX if the pipe was
definitely cleared.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change
@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented Oct 2, 2018

@0xc0170 0xc0170 requested a review from ARMmbed/mbed-os-wan Oct 2, 2018

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented Oct 2, 2018

@kivaisan @AnttiKauppila Please review.

@kivaisan

I think you should set _can_cancel_tx = true after sending. With current proposal if you first successfully send without backoff time, _can_cancel_tx is set to false in LoRaMac::schedule_tx(). If you now for some reason call cancel_sending(), clear_tx_pipe() will return LORAWAN_STATUS_BUSY instead of LORAWAN_StATUS_NO_OP.

Making cancel_sending() API robust
If the packet is already handed over to the PHY layer, we shouldn't be
able to cancel that particular transmission. In addition to that if the
backoff timer is either not applied or has been deactivated, should end
up in no-op rather than having normal termination. A new error code has
been introduced to cover no-op cases. This error code replaces the
compliance test related error code which is no longer relevant.
clear_tx_pipe() does nothing if:
	- The stack cannot cancel TX (already handed over to PHY)
        - The backoff timer is not active at all
        - The event is disaptched to schedule

stop_sending() will only post process ongoin TX if the pipe was
definitely cleared.

@hasnainvirk hasnainvirk force-pushed the hasnainvirk:issue_8285 branch from 5be28dd to 603ee28 Oct 2, 2018

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented Oct 2, 2018

@kivaisan restoring _can_cance_tx in LoRaMac::set_tx_ongoing(). Thanks for pointing that out.

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented Oct 3, 2018

@0xc0170 Could you please review ?

@0xc0170

0xc0170 approved these changes Oct 4, 2018

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Oct 4, 2018

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented Oct 8, 2018

This goes in first #8183

@NirSonnenschein

This comment has been minimized.

Contributor

NirSonnenschein commented Oct 14, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 14, 2018

Build : SUCCESS

Build number : 3348
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8299/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr

cmonr approved these changes Oct 15, 2018

@cmonr cmonr merged commit b666cd6 into ARMmbed:master Oct 15, 2018

16 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed , RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud_client_smoke_test Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Passed, 626 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 10272 cycles (+1 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@cmonr cmonr removed the ready for merge label Oct 15, 2018

cmonr added a commit to cmonr/mbed-os that referenced this pull request Oct 15, 2018

Revert "Merge pull request ARMmbed#8299 from hasnainvirk/issue_8285"
This reverts commit b666cd6, reversing
changes made to a9f4323.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment