diff options
author | Matthieu Baerts (NGI0) <matttbe@kernel.org> | 2024-04-20 09:24:59 +0000 |
---|---|---|
committer | Matthieu Baerts (NGI0) <matttbe@kernel.org> | 2024-04-20 09:24:59 +0000 |
commit | ce2075598a763a76daf610ca49b57f5f5a8ff5fb (patch) | |
tree | b1536b9416074901c0e2fc4b6034032a9d7a8162 | |
parent | 8442f8ba269f8f7321fba47c4fd1dc22402d8975 (diff) | |
parent | 3e2c3a05edb1be8fd3a62f95cc7856ef13f58777 (diff) | |
download | mptcp_net-next-ce2075598a763a76daf610ca49b57f5f5a8ff5fb.tar.gz |
TopGit-driven merge of branches:
net-next
t/DO-NOT-MERGE-git-markup-end-common-net-net-next
-rw-r--r-- | .b4-config | 3 | ||||
-rw-r--r-- | .git_markup | 1 | ||||
-rw-r--r-- | .github/workflows/build-validation.yml | 332 | ||||
-rw-r--r-- | .github/workflows/checkpatch.yml | 183 | ||||
-rw-r--r-- | .github/workflows/notif.yml | 56 | ||||
-rw-r--r-- | .github/workflows/tests.yml | 399 | ||||
-rw-r--r-- | .github/workflows/update-tg-tree.yml | 54 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 21 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/core.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/core_env.c | 20 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/pci.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/wangxun/libwx/wx_lib.c | 2 | ||||
-rw-r--r-- | drivers/net/vxlan/vxlan_core.c | 4 | ||||
-rw-r--r-- | net/ipv4/udp.c | 5 | ||||
-rw-r--r-- | net/ipv6/udp.c | 5 | ||||
-rw-r--r-- | net/mptcp/protocol.c | 3 | ||||
-rwxr-xr-x | tools/testing/selftests/net/mptcp/simult_flows.sh | 6 |
17 files changed, 1070 insertions, 36 deletions
diff --git a/.b4-config b/.b4-config new file mode 100644 index 00000000000000..a0c682e364af5d --- /dev/null +++ b/.b4-config @@ -0,0 +1,3 @@ +[b4] + send-series-to = MPTCP Upstream <mptcp@lists.linux.dev> + send-prefixes = mptcp-net diff --git a/.git_markup b/.git_markup new file mode 100644 index 00000000000000..af78ae8cf5967d --- /dev/null +++ b/.git_markup @@ -0,0 +1 @@ +MPTCP-related modifications only needed for the -net tree. diff --git a/.github/workflows/build-validation.yml b/.github/workflows/build-validation.yml new file mode 100644 index 00000000000000..edd5bca868b865 --- /dev/null +++ b/.github/workflows/build-validation.yml @@ -0,0 +1,332 @@ +name: "MPTCP Upstream Build Validation" +on: + push: + branches-ignore: + - 'archived/**' # previous branches + - 't/**' # TopGit tree + - 'net' # part of the TopGit tree + - 'net-next' # part of the TopGit tree + - 'for-review' # part of the TopGit tree + - 'for-review-net' # part of the TopGit tree + tags: + - 'patchew/**' # patchew is using tags + # ideally, we would take 'export/**' but the cache is per branch... + # In other words, when using tags, we can only use the cache if we re-tag. + # https://github.com/actions/cache/issues/556 + # So we build the "export" branch and we try to find the tag later + +env: + CURL_OPT: "--no-progress-meter --connect-timeout 30 --retry 20 --retry-delay 10" + CURL_ACC: "Accept: application/vnd.github.v3+json" + URI: "https://api.github.com" + PW: "https://patchwork.kernel.org/api/1.2" + +permissions: {} + +jobs: + build: + name: "Build (matrix)" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + defconfig: ['x86_64', 'i386'] + ipv6: ['with_ipv6', 'without_ipv6'] + mptcp: ['with_mptcp', 'without_mptcp'] + permissions: + contents: read # to fetch code (actions/checkout) + + steps: + - name: "Checkout (light)" + if: github.ref != 'refs/heads/export' + uses: actions/checkout@v4 + with: + fetch-depth: 100 # we should not have more commits on top of export and -net + + - name: "Checkout (export)" + if: github.ref == 'refs/heads/export' + uses: actions/checkout@v4 + with: + fetch-depth: 0 # we need to fetch all commits between net and net-next, quicker to get everything + + - name: "Find base branch" + id: branch + run: | + if [ "${REF_NAME}" = "export" ]; then # just to avoid the next cmd + echo "name=export" >> ${GITHUB_OUTPUT} + elif [ -n "$(git log -1 --grep "^DO-NOT-MERGE: mptcp: enabled by default (net)$" --format="format:%H" HEAD -- net/mptcp/Kconfig)" ]; then + echo "name=export-net" >> ${GITHUB_OUTPUT} + else + echo "name=export" >> ${GITHUB_OUTPUT} + fi + env: + REF_NAME: ${{ github.ref_name }} + + - name: "Restore cache for CCache" + uses: actions/cache/restore@v4 + id: restore-ccache + with: + path: ${{ github.workspace }}/.ccache + key: ${{ runner.os }}_build_${{ matrix.defconfig }}_${{ matrix.ipv6 }}_${{ matrix.mptcp }}_${{ steps.branch.outputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}_build_${{ matrix.defconfig }}_${{ matrix.ipv6 }}_${{ matrix.mptcp }}_${{ steps.branch.outputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} + ${{ runner.os }}_build_${{ matrix.defconfig }}_${{ matrix.ipv6 }}_${{ matrix.mptcp }}_${{ steps.branch.outputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}- + ${{ runner.os }}_build_${{ matrix.defconfig }}_${{ matrix.ipv6 }}_${{ matrix.mptcp }}_${{ steps.branch.outputs.name }}-${{ github.run_id }}- + ${{ runner.os }}_build_${{ matrix.defconfig }}_${{ matrix.ipv6 }}_${{ matrix.mptcp }}_${{ steps.branch.outputs.name }}- + + - name: "Build Validation" + uses: multipath-tcp/mptcp-upstream-validate-export-action@main + with: + # we want to validate each commits on top of net-next/export (or -net) except for stable + each_commit: ${{ ! startswith(github.ref, 'refs/heads/stable/') }} + ccache_maxsize: 350M ## 10GB = project limit + defconfig: ${{ matrix.defconfig }} + ipv6: ${{ matrix.ipv6 }} + mptcp: ${{ matrix.mptcp }} + debug: ${{ runner.debug }} + + - name: "Artifacts" + if: always() + uses: actions/upload-artifact@v4 + with: + name: results-${{ matrix.defconfig }}_${{ matrix.ipv6 }}_${{ matrix.mptcp }} + path: ./build-*-results.txt + + - name: "Publish details" + if: always() + run: | + if stat ./build-*-results.txt &>/dev/null; then + echo '- Results for ${{ matrix.defconfig }} ${{ matrix.ipv6 }} ${{ matrix.mptcp }}:' >> ${GITHUB_STEP_SUMMARY} + echo "\`\`\`" >> ${GITHUB_STEP_SUMMARY} + cat ./build-*-results.txt >> ${GITHUB_STEP_SUMMARY} + echo "\`\`\`" >> ${GITHUB_STEP_SUMMARY} + fi + + - name: "Save cache for CCache" + if: github.ref == 'refs/heads/export' || github.ref == 'refs/heads/export-net' + uses: actions/cache/save@v4 + with: + path: ${{ github.workspace }}/.ccache + key: ${{ steps.restore-ccache.outputs.cache-primary-key }} + + notif-export: + name: "Notifications export branches" + needs: build + # only for the official repo, export branches + if: always() && github.repository_owner == 'multipath-tcp' && (github.ref == 'refs/heads/export' || github.ref == 'refs/heads/export-net') + runs-on: ubuntu-latest + steps: + - name: get linked tag + id: tag + run: | + TAG=$(curl ${CURL_OPT} -H "${CURL_ACC}" -H "${CURL_AUTH}" "${URL}" | jq -r ".[] | select(.object.sha == \"${SHA}\").ref" | tail -n1) + echo "Found: ${TAG} (${SHA} - ${BRANCH})" + TAG="${TAG:10}" + echo "tag=${TAG:-${BRANCH}}" >> ${GITHUB_OUTPUT} + env: + CURL_AUTH: "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" + URL: "${{ env.URI }}/repos/${{ github.repository }}/git/matching-refs/tags/" + SHA: "${{ github.sha }}" + BRANCH: "${{ github.ref_name }}" + + - name: irc build + uses: rectalogic/notify-irc@v2 + with: + server: irc.libera.chat + channel: "#mptcp-ci" + nickname: gh-build-bot + verbose: true + message: |- + New build validating ${{ steps.tag.outputs.tag }} (by ${{ github.actor }}) ended with ${{ needs.build.result }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + + - name: irc build error + if: needs.build.result == 'failure' + uses: rectalogic/notify-irc@v2 + with: + server: irc.libera.chat + channel: "#mptcp" + nickname: gh-build-bot + verbose: true + message: |- + New build validating ${{ steps.tag.outputs.tag }} (by ${{ github.actor }}) failed: ${{ needs.build.result }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + + notif-patchew: + name: "Notifications patchew tags" + needs: build + # only for the official repo, patchew tags branches + if: always() && github.repository_owner == 'multipath-tcp' && startswith(github.ref, 'refs/tags/patchew/') + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + pattern: results-* + merge-multiple: true + + - name: "Patchwork" + run: | + # $1: mid + get_status() { + case "$(awk "/^${1} /{ print \$2 }" build-*-results.txt | sort -u)" in + 'fail'*) echo "fail"; ;; + *'warning') echo "warning"; ;; + 'success') echo "success"; ;; + *) echo "fail"; ;; + esac + } + + # $1: mid, $2: status + get_desc() { + awk "/^${1} ${2} /{ + out=\$3 + for(i=4; i<=NF; i++) + out=out\" \"\$i + print out + }" build-*-results.txt | sort -u | sed '$!{:a;N;s/\n/ ; /;ta}' + } + + # $1: mid, $2: status, $3: desc + _send() { local check_url + check_url="$(curl "${URL_PW}${1}" | jq -r 'last(.[].checks)')" + if [ -z "${check_url}" ] || [ "${check_url}" = "null" ]; then + echo "URL not found: '${check_url}' '${URL_PW}${1}'" + return 1 + fi + + curl ${CURL_OPT} \ + -X POST \ + -H "Authorization: Token ${{ secrets.PW_TOKEN }}" \ + -F "state=${2}" \ + -F "target_url=${URL_GH}" \ + -F "context=build" \ + -F "description=${3}" \ + "${check_url}" | jq '.' + } + + FIRST=1 + send() { local i + # patches can take a bit of time to appear: retry the first time + if [ "${FIRST}" = "1" ]; then + FIRST=0 + + for i in $(seq 45); do + if _send "${@}"; then + echo "Successful sent after ${i} attempts" + return 0 + fi + sleep 1m + done + + curl "${URL_PW}${1}" + return 1 + else + _send "${@}" + fi + } + + if ! ls ./build-*-results.txt; then + echo "Strange, no results, please check why" + exit 1 + fi + + while read -r mid; do + status=$(get_status "${mid}") + desc=$(get_desc "${mid}" "${status}") + send "${mid}" "${status}" "${desc}" + done < <(awk '{ print $1 }' build-*-results.txt | sort -u) + env: + URL_GH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + URL_PW: "${{ env.PW }}/patches/?project=mptcp&msgid=" + + - name: get commit info + id: commit + if: needs.build.result == 'failure' + run: | + cat <<'EOF' > commit.json + ${{ toJSON(github.event.head_commit) }} + EOF + + # ignore error, just in case the MID has not been added by the author + read -r TAG MID < <(jq -r '.message' commit.json | grep "^Message-Id: " | tail -n1) || true + + # Guess the subject from the last commit + SUBJECT=$(jq -r '.message' commit.json | head -n1) + + if [ -n "${MID:1:-1}" ]; then + # get cover-letter and series' name if any + URL_PW_SERIES_API=$(curl "${URL_PW}${MID:1:-1}" | jq -er 'last(last(.[].series)[].url)' || true) + if [ -n "${URL_PW_SERIES_API}" ] && [ "${URL_PW_SERIES_API}" != "null" ]; then + echo "series=${URL_PW_SERIES}$(basename "${URL_PW_SERIES_API}")" >> ${GITHUB_OUTPUT} + if curl "${URL_PW_SERIES_API}" > pw_series.json && [ -s pw_series.json ]; then + CL="$(jq '.cover_letter' pw_series.json || true)" + if [ -n "${CL}" ] && [ "${CL}" != "null" ] && [ "${CL}" != "{}" ]; then + MID=$(echo "${CL}" | jq -er '.msgid' || echo "${MID}") + SUBJECT=$(jq -er '.name' pw_series.json || echo "${SUBJECT}") + fi + fi + fi + + # get tags from Lore: not fully available from Patchwork + SUBJECT="$(curl "${URL_LORE//MID/${MID:1:-1}}" | grep '^Subject: ' | head -n1 | sed 's/^Subject: \(\[.*\] \).*/\1/')${SUBJECT}" + fi + + echo "Found message ID: '${TAG}' '${MID}'" + echo "mid=${MID:1:-1}" >> ${GITHUB_OUTPUT} + + echo "Found subject: '${SUBJECT}'" + echo "subject=${SUBJECT}" >> ${GITHUB_OUTPUT} + + NAME=$(jq -r '.author.name' commit.json) + EMAIL=$(jq -r '.author.email' commit.json) + echo "Found author: '${NAME}' '${EMAIL}'" + echo "name=${NAME%% *}" >> ${GITHUB_OUTPUT} + echo "author=${NAME} <${EMAIL}>" >> ${GITHUB_OUTPUT} + + SHA=$(jq -r '.id' commit.json) + echo "Found SHA: '${SHA}' ('${SHA:0:12}')" + echo "sha=${SHA:0:12}" >> ${GITHUB_OUTPUT} + + COMMITTER=$(jq -r '.committer.name' commit.json) + echo "Found committer: '${COMMITTER}'" + echo "committer=${COMMITTER}" >> ${GITHUB_OUTPUT} + env: + URL_PW: "${{ env.PW }}/patches/?project=mptcp&msgid=" + URL_PW_SERIES: "https://patchwork.kernel.org/project/mptcp/list/?series=" + URL_LORE: "https://lore.kernel.org/mptcp/MID/raw" + + - name: send email + if: needs.build.result == 'failure' + uses: dawidd6/action-send-mail@v3 + with: + server_address: smtp.gmail.com + server_port: 465 + username: ${{ secrets.MAIL_USERNAME }} + password: ${{ secrets.MAIL_PASSWORD }} + to: ${{ steps.commit.outputs.author }} + cc: mptcp@lists.linux.dev + from: MPTCP CI + reply_to: mptcp@lists.linux.dev + in_reply_to: "<${{ steps.commit.outputs.mid }}>" + subject: "Re: ${{ steps.commit.outputs.subject }}" + body: | + Hi ${{ steps.commit.outputs.name }}, + + Thank you for your modifications, that's great! + + But sadly, our CI spotted some issues with it when trying to build it. + + You can find more details there: + + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + + Status: ${{ needs.build.result }} + Initiator: ${{ steps.commit.outputs.committer }} + Commits: ${{ github.server_url }}/${{ github.repository }}/commits/${{ steps.commit.outputs.sha }} + Patchwork: ${{ steps.commit.outputs.series }} + + Feel free to reply to this email if you cannot access logs, if you need + some support to fix the error, if this doesn't seem to be caused by your + modifications or if the error is a false positive one. + + Cheers, + MPTCP GH Action bot + Bot operated by Matthieu Baerts (NGI0 Core) diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml new file mode 100644 index 00000000000000..3528be8582cb10 --- /dev/null +++ b/.github/workflows/checkpatch.yml @@ -0,0 +1,183 @@ +name: "CheckPatch" +on: + push: + branches-ignore: + - 'archived/**' # previous branches + - 't/**' # TopGit tree + - 'net' # part of the TopGit tree + - 'net-next' # part of the TopGit tree + - 'for-review' # part of the TopGit tree + - 'for-review-net' # part of the TopGit tree + tags: + - 'patchew/**' # patchew is using tags + +env: + CURL_OPT: "--no-progress-meter --connect-timeout 30 --retry 20 --retry-delay 10" + PW: "https://patchwork.kernel.org/api/1.2" + CHECKPATCH_RESULTS: "./checkpatch-results.txt" + CHECKPATCH_DETAILS: "./checkpatch-details.txt" + SHELLCHECK_RESULTS: "./shellcheck-results.txt" + SHELLCHECK_DETAILS: "./shellcheck-details.txt" + +permissions: {} + +jobs: + checkpatch: + name: "Checkpatch" + # for others or for the official repo but only commits from patchew + if: github.repository_owner != 'multipath-tcp' || startswith(github.ref, 'refs/tags/patchew/') + runs-on: ubuntu-latest + permissions: + contents: read # to fetch code (actions/checkout) + + steps: + - name: "Checkout" + uses: actions/checkout@v4 + with: + fetch-depth: 0 ## to make sure a mentioned commit exists + + - name: "Checkpatch" + uses: multipath-tcp/mptcp-upstream-validate-export-action@main + with: + each_commit: true + checkpatch: true + debug: ${{ secrets.BUILD_ACTION_DEBUG }} + + - name: "Publish details" + if: always() + run: | + if [ -s "${{ env.CHECKPATCH_DETAILS }}" ]; then + echo '## CheckPatch' >> ${GITHUB_STEP_SUMMARY} + cat "${{ env.CHECKPATCH_DETAILS }}" >> ${GITHUB_STEP_SUMMARY} + fi + if [ -s "${{ env.SHELLCHECK_DETAILS }}" ]; then + echo '## ShellCheck' >> ${GITHUB_STEP_SUMMARY} + cat "${{ env.SHELLCHECK_DETAILS }}" >> ${GITHUB_STEP_SUMMARY} + fi + + - name: "Artifacts" + uses: actions/upload-artifact@v4 + with: + name: results + path: | + ${{ env.CHECKPATCH_RESULTS }} + ${{ env.SHELLCHECK_RESULTS }} + + - name: "Artifacts" + uses: actions/upload-artifact@v4 + with: + name: details + path: | + ${{ env.CHECKPATCH_DETAILS }} + ${{ env.SHELLCHECK_DETAILS }} + + notif: + name: "Notifications" + needs: checkpatch + # only for the official repo (patchew) + if: github.repository_owner == 'multipath-tcp' && startswith(github.ref, 'refs/tags/patchew/') + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: results + + - name: "Patchwork" + run: | + # $1: mid, $2: status, $3: desc, $4: context + _send() { local check_url + check_url="$(curl "${URL_PW}${1}" | jq -r 'last(.[].checks)')" + if [ -z "${check_url}" ] || [ "${check_url}" = "null" ]; then + echo "URL not found: '${check_url}' '${URL_PW}${1}'" + return 1 + fi + + curl ${CURL_OPT} \ + -X POST \ + -H "Authorization: Token ${{ secrets.PW_TOKEN }}" \ + -F "state=${2}" \ + -F "target_url=${URL_GH}" \ + -F "context=${4}" \ + -F "description=${3}" \ + "${check_url}" | jq '.' + } + + FIRST=1 + send() { local i + # patches can take a bit of time to appear: retry the first time + if [ "${FIRST}" = "1" ]; then + FIRST=0 + + for i in $(seq 45); do + if _send "${@}"; then + echo "Successful sent after ${i} attempts" + return 0 + fi + sleep 1m + done + + curl "${URL_PW}${1}" + return 1 + else + _send "${@}" + fi + } + + # $1: file, $2: context + parse_results() { + if [ ! -s "${1}" ]; then + echo "Strange, no results, please check why" + return 1 + fi + + while read -r mid status desc; do + echo "Sending: '${mid}' '${status}' '${desc}' '${2}'" + send "${mid}" "${status}" "${desc}" "${2}" + done < "${1}" + } + + rc=0 + parse_results "${CHECKPATCH_RESULTS}" "checkpatch" || rc=1 + parse_results "${SHELLCHECK_RESULTS}" "shellcheck" || rc=1 + exit ${rc} + + env: + URL_GH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + URL_PW: "${{ env.PW }}/patches/?project=mptcp&msgid=" + + status: + name: "Status" + needs: checkpatch + # for others, to report an error if patches were not OK + if: github.repository_owner != 'multipath-tcp' + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: results + - name: "Set exit status" + run: | + # $1: result file, $2: context + check() { + if [ ! -s "${1}" ]; then + echo "Strange, no results, please check why" + exit 1 + fi + + if awk '{ if ($2 != "success") exit 1 }' "${1}"; then + echo "Everything OK with ${2}, good job!" + return 0 + fi + + echo "${2} detected some issues:" + echo + cat "${1}" + echo + + return 1 + } + + rc=0 + check "${CHECKPATCH_RESULTS}" "CheckPatch" || rc=1 + check "${SHELLCHECK_RESULTS}" "ShellCheck" || rc=1 + exit ${rc} diff --git a/.github/workflows/notif.yml b/.github/workflows/notif.yml new file mode 100644 index 00000000000000..c4ca514ec0cbdf --- /dev/null +++ b/.github/workflows/notif.yml @@ -0,0 +1,56 @@ +name: "Notifications" +on: + push: + tags: + - 'export/**' # exclude patchew/** tags and branches + - 'export-net/**' + issues: + types: [opened, reopened, closed, assigned, unassigned] + +permissions: {} + +jobs: + tag: + name: "Tag" + if: github.repository_owner == 'multipath-tcp' && github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - name: tag shortner + id: tag + run: | + echo "tag=${REF:10}" >> ${GITHUB_OUTPUT} + env: + REF: ${{ github.event.ref }} + - name: irc tag + uses: rectalogic/notify-irc@v2 + with: + server: irc.libera.chat + channel: "#mptcp-ci" + nickname: gh-tag-bot + verbose: true + message: "New tag available: ${{ steps.tag.outputs.tag }} (by ${{ github.actor }})" + + issues: + name: "Issues" + if: github.repository_owner == 'multipath-tcp' && github.event_name == 'issues' + runs-on: ubuntu-latest + steps: + - name: issue info + id: info + if: github.event.action != 'opened' + run: | + echo "opener=, opened by ${OPENER}" >> ${GITHUB_OUTPUT} + echo "assignee=${ASSIGNEE:+ and assigned to ${ASSIGNEE}}" >> ${GITHUB_OUTPUT} + env: + OPENER: ${{ github.event.issue.user.login }} + ASSIGNEE: ${{ github.event.assignee.login }} + - name: irc issues + uses: rectalogic/notify-irc@v2 + with: + server: irc.libera.chat + channel: "#mptcp" + nickname: gh-issues-bot + verbose: true + message: |- + Issue #${{ github.event.issue.number }} ("${{ github.event.issue.title }}"${{ steps.info.outputs.opener }}${{ steps.info.outputs.assignee }}) has been ${{ github.event.action }} by ${{ github.actor }} + ${{ github.event.issue.html_url }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000000000..a8b0e57f09e2ab --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,399 @@ +name: "MPTCP Upstream Tests Validation" +on: + push: + branches-ignore: + - 'archived/**' # previous branches + - 't/**' # TopGit tree + - 'net' # part of the TopGit tree + - 'net-next' # part of the TopGit tree + - 'for-review' # part of the TopGit tree + - 'for-review-net' # part of the TopGit tree + tags: + - 'patchew/**' # patchew is using tags + # ideally, we would take 'export/**' but the cache is per branch... + # In other words, when using tags, we can only use the cache if we re-tag. + # https://github.com/actions/cache/issues/556 + # So we test the "export" branch and we try to find the tag later + +env: + CURL_OPT: "--no-progress-meter --connect-timeout 30 --retry 20 --retry-delay 10" + CURL_ACC: "Accept: application/vnd.github.v3+json" + URI: "https://api.github.com" + PW: "https://patchwork.kernel.org/api/1.2" + +permissions: {} + +jobs: + tests: + name: "Tests" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + mode: ['normal', 'debug', 'btf'] + permissions: + contents: read # to fetch code (actions/checkout) + checks: write # to write results + + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + #- name: "Collect Workflow Telemetry" + # uses: catchpoint/workflow-telemetry-action@v2 + + - name: "Find base branch" + id: branch + run: | + if [ "$(cat .git_markup)" = "MPTCP-related modifications only needed for our tests suite (mptcp-net)." ]; then + echo "name=export-net" >> ${GITHUB_OUTPUT} + else + echo "name=export" >> ${GITHUB_OUTPUT} + fi + + - name: "Restore cache for CCache" + uses: actions/cache/restore@v4 + id: restore-ccache + with: + path: ${{ github.workspace }}/.virtme/ccache + key: ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ matrix.mode }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ matrix.mode }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ matrix.mode }}-${{ github.run_id }}-${{ github.run_attempt }}- + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ matrix.mode }}-${{ github.run_id }}- + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ matrix.mode }}- + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}- + + - name: "Docker image" + run: | + /usr/bin/docker pull mptcp/mptcp-upstream-virtme-docker:${{ steps.branch.outputs.name == 'export' && 'latest' || 'net' }} + + - name: "Tests" + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + set -x + /usr/bin/docker run --privileged --rm \ + -e "INPUT_CCACHE_MAXSIZE=500M" \ + -e "INPUT_PACKETDRILL_STABLE=${{ steps.branch.outputs.name == 'export-net' && '1' || '0' }}" \ + -e "INPUT_EXTRA_ENV=${{ matrix.mode == 'btf' && 'INPUT_RUN_TESTS_ONLY=bpftest_all' || '' }}" \ + -e "INPUT_TRACE=${RUNNER_DEBUG}" \ + -e "INPUT_CI_TIMEOUT_SEC" \ + -e "GITHUB_SHA" -e "GITHUB_REF_NAME" -e "GITHUB_RUN_ID" \ + -e GITHUB_ACTIONS=true -e CI=true \ + --workdir /github/workspace \ + -v "${PWD}":"/github/workspace" \ + mptcp/mptcp-upstream-virtme-docker:${{ steps.branch.outputs.name == 'export' && 'latest' || 'net' }} \ + auto-${{ matrix.mode }} + + - name: "Publish conclusion" + if: always() + run: | + if [ -s "conclusion.txt" ]; then + { + echo '## Mode ${{ matrix.mode }}' + echo '### Conclusion (${{ matrix.mode }})' + cat "conclusion.txt" + echo '' + echo '### Summary (${{ matrix.mode }})' + echo '```' + cat "summary.txt" + echo '```' + } >> "${GITHUB_STEP_SUMMARY}" + fi + + - name: "Artifacts (always)" + if: always() + uses: actions/upload-artifact@v4 + with: + name: results-${{ matrix.mode }} + path: | + conclusion.txt + summary.txt + *.tap + config.zstd + *.tap.xml + results.json + + - name: "Artifacts (failure)" + if: failure() + uses: actions/upload-artifact@v4 + with: + name: debug-info-${{ matrix.mode }} + path: | + vmlinux.zstd + kmemleak.txt + + - name: "Publish Test Results" + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: | + *.tap.xml + + - name: "Save cache for CCache" + if: always() && (github.repository_owner != 'multipath-tcp' || (github.ref_name == 'export' || github.ref_name == 'export-net')) + uses: actions/cache/save@v4 + with: + path: ${{ github.workspace }}/.virtme/ccache + key: ${{ steps.restore-ccache.outputs.cache-primary-key }} + + notif: + name: "Notifications" + needs: tests + # only for the official repo (patchew) + if: always() && github.repository_owner == 'multipath-tcp' + concurrency: + group: ${{ startswith(github.ref, 'refs/heads/export') && 'ci-notif' || github.sha }} + cancel-in-progress: false + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + pattern: results-* + merge-multiple: false + + - name: get test info + id: test + run: | + for mode in normal debug btf; do + ccl="$(cat "results-${mode}/conclusion.txt")" + echo "ccl_${mode}=${ccl:-"KVM Validation: ${mode}: Critical: No conclusion ❓"}" >> ${GITHUB_OUTPUT} + echo "ccl_title_${mode}=$(echo "${ccl}" | cut -d: -f1-2)" >> ${GITHUB_OUTPUT} + echo "ccl_status_${mode}=$(echo "${ccl}" | cut -d: -f3- | sed 's/^ //')" >> ${GITHUB_OUTPUT} + done + echo "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> ${GITHUB_OUTPUT} + + - name: get linked tag + if: github.ref == 'refs/heads/export' || github.ref == 'refs/heads/export-net' + id: tag + run: | + TAG=$(curl ${CURL_OPT} -H "${CURL_ACC}" -H "${CURL_AUTH}" "${URL}" | jq -r ".[] | select(.object.sha == \"${SHA}\").ref" | tail -n1) + echo "Found: ${TAG} (${SHA} - ${BRANCH})" + TAG="${TAG:10}" + echo "tag=${TAG:-${BRANCH}}" >> ${GITHUB_OUTPUT} + env: + CURL_AUTH: "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" + URL: "${{ env.URI }}/repos/${{ github.repository }}/git/matching-refs/tags/" + SHA: "${{ github.sha }}" + BRANCH: "${{ github.ref_name }}" + + - name: irc tests + if: github.ref == 'refs/heads/export' || github.ref == 'refs/heads/export-net' + uses: rectalogic/notify-irc@v2 + with: + server: irc.libera.chat + channel: "#mptcp-ci" + nickname: gh-tests-bot + verbose: true + message: |- + New GH Actions Tests job validating ${{ steps.tag.outputs.tag }} (by ${{ github.actor }}) just ended: + - ${{ steps.test.outputs.ccl_normal }} + - ${{ steps.test.outputs.ccl_debug }} + - ${{ steps.test.outputs.ccl_btf }} + - Task: ${{ steps.test.outputs.url }} + + - name: Checkout results repo + if: github.ref == 'refs/heads/export' || github.ref == 'refs/heads/export-net' + uses: actions/checkout@v4 + with: + repository: "multipath-tcp/mptcp-upstream-tests-results" + token: '${{ secrets.PAT_MATTTBE }}' + path: results + + - name: save flakes results + if: github.ref == 'refs/heads/export' || github.ref == 'refs/heads/export-net' + run: | + for mode in normal debug btf; do + new="results-${mode}/results.json" + all="results/html/results/${{ github.ref_name }}/${mode}.json" + if [ ! -s "${new}" ]; then + echo '{"error": "all", "run_id": "${{ github.run_id }}"}' > "${new}" + fi + # append tag, merge results, limit + jq -c '.tag += "${{ steps.tag.outputs.tag }}"' "${new}" > "${new}.tag" + jq -c '. += [input]' "${all}" "${new}.tag" > "${new}.all" + jq --indent 1 '.[-100:]' "${new}.all" > "${all}" + done + + cd results + git config user.name github-actions + git config user.email github-actions@github.com + git add html/results/${{ github.ref_name }}/*.json + git commit -m "new: ${{ steps.tag.outputs.tag }}" + git push + + - name: get commit info + id: commit + if: startswith(github.ref, 'refs/tags/patchew/') + run: | + cat <<'EOF' > commit.json + ${{ toJSON(github.event.head_commit) }} + EOF + + # ignore error, just in case the MID has not been added by the author + read -r TAG MID < <(jq -r '.message' commit.json | grep "^Message-Id: " | tail -n1) || true + echo "Found message ID: '${TAG}' '${MID}'" + echo "mid=${MID:1:-1}" >> ${GITHUB_OUTPUT} + + # Guess the subject from the last commit + SUBJECT=$(jq -r '.message' commit.json | head -n1) + echo "Found subject: '${SUBJECT}'" + echo "subject=${SUBJECT}" >> ${GITHUB_OUTPUT} + + NAME=$(jq -r '.author.name' commit.json) + EMAIL=$(jq -r '.author.email' commit.json) + echo "Found author: '${NAME}' '${EMAIL}'" + echo "name=${NAME%% *}" >> ${GITHUB_OUTPUT} + echo "author=${NAME} <${EMAIL}>" >> ${GITHUB_OUTPUT} + + SHA=$(jq -r '.id' commit.json) + echo "Found SHA: '${SHA}' ('${SHA:0:12}')" + echo "sha=${SHA:0:12}" >> ${GITHUB_OUTPUT} + + COMMITTER=$(jq -r '.committer.name' commit.json) + echo "Found committer: '${COMMITTER}'" + echo "committer=${COMMITTER}" >> ${GITHUB_OUTPUT} + + - name: set patchwork check + if: startswith(github.ref, 'refs/tags/patchew/') + run: | + CHECK_URLS=() + set_url() { local series_url + series_url=$(curl ${CURL_OPT} "${URL}" | jq -r 'last(last(.[].series)[].url)') + if [ -z "${series_url}" ] || [ "${series_url}" = "null" ]; then + echo "Series not found: '${series_url}' '${URL}'" + return 1 + fi + + echo "Found Series: '${series_url}'" + + readarray -t CHECK_URLS < <(curl ${CURL_OPT} "${series_url}" | jq -r '.patches[].url + "checks/"') + } + + # $1: title, $2: status, $3: url + submit() { local check_url + if [[ "${2}" == "Success"* ]]; then + STATE="success" + elif [[ "${2}" == "Unstable"* ]]; then + STATE="warning" + else + STATE="fail" + fi + + for check_url in "${CHECK_URLS[@]}"; do + curl ${CURL_OPT} \ + -X POST \ + -H "Authorization: Token ${{ secrets.PW_TOKEN }}" \ + -F "state=${STATE}" \ + -F "target_url=${3}" \ + -F "context=${1//[ :()]/_}" \ + -F "description=${2}" \ + "${check_url}" | jq '.' + done + } + + for i in $(seq 30); do # patches can take a bit of time to appear + set_url && break + sleep 1m + done + + if [ "${#CHECK_URLS[@]}" -eq 0 ]; then + echo "Error: didn't find any URLs after ${i} attempts" + exit 1 + fi + echo "Found: ${#CHECK_URLS[@]} urls after ${i} attempts: ${CHECK_URLS[@]}" + + submit "${{ steps.test.outputs.ccl_title_normal }}" "${{ steps.test.outputs.ccl_status_normal }}" "${{ steps.test.outputs.url }}" + submit "${{ steps.test.outputs.ccl_title_debug }}" "${{ steps.test.outputs.ccl_status_debug }}" "${{ steps.test.outputs.url }}" + submit "${{ steps.test.outputs.ccl_title_btf }}" "${{ steps.test.outputs.ccl_status_btf }}" "${{ steps.test.outputs.url }}" + env: + URL: "${{ env.PW }}/patches/?project=mptcp&msgid=${{ steps.commit.outputs.mid }}" + + # do that after having set patchwork checks, so we already waited for it to be ready + - name: get series info + id: series + if: startswith(github.ref, 'refs/tags/patchew/') + run: | + if [ -n "${MID:1:-1}" ]; then + # get cover-letter and series' name if any + URL_PW_SERIES_API=$(curl "${URL_PW}${MID:1:-1}" | jq -er 'last(last(.[].series)[].url)' || true) + if [ -n "${URL_PW_SERIES_API}" ] && [ "${URL_PW_SERIES_API}" != "null" ]; then + echo "series=${URL_PW_SERIES}$(basename "${URL_PW_SERIES_API}")" >> ${GITHUB_OUTPUT} + if curl "${URL_PW_SERIES_API}" > pw_series.json && [ -s pw_series.json ]; then + CL="$(jq '.cover_letter' pw_series.json || true)" + if [ -n "${CL}" ] && [ "${CL}" != "null" ] && [ "${CL}" != "{}" ]; then + MID=$(echo "${CL}" | jq -er '.msgid' || echo "${MID}") + SUBJECT=$(jq -er '.name' pw_series.json || echo "${SUBJECT}") + fi + fi + fi + # get tags from Lore: not fully available from Patchwork + SUBJECT="$(curl "${URL_LORE//MID/${MID:1:-1}}" | grep '^Subject: ' | head -n1 | sed 's/^Subject: \(\[.*\] \).*/\1/')${SUBJECT}" + fi + + echo "Found message ID: '${MID}'" + echo "mid=${MID:1:-1}" >> ${GITHUB_OUTPUT} + echo "Found subject: '${SUBJECT}'" + echo "subject=${SUBJECT}" >> ${GITHUB_OUTPUT} + env: + URL_PW: "${{ env.PW }}/patches/?project=mptcp&msgid=" + URL_PW_SERIES: "https://patchwork.kernel.org/project/mptcp/list/?series=" + URL_LORE: "https://lore.kernel.org/mptcp/MID/raw" + MID: "<${{ steps.commit.outputs.mid }}>" + SUBJECT: "${{ steps.commit.outputs.subject }}" + + - name: send email + if: startswith(github.ref, 'refs/tags/patchew/') + uses: dawidd6/action-send-mail@v3 + with: + server_address: smtp.gmail.com + server_port: 465 + username: ${{ secrets.MAIL_USERNAME }} + password: ${{ secrets.MAIL_PASSWORD }} + to: ${{ steps.commit.outputs.author }} + cc: mptcp@lists.linux.dev + from: MPTCP CI + reply_to: mptcp@lists.linux.dev + in_reply_to: "<${{ steps.series.outputs.mid }}>" + subject: "Re: ${{ steps.series.outputs.subject }}" + body: | + Hi ${{ steps.commit.outputs.name }}, + + Thank you for your modifications, that's great! + + Our CI did some validations and here is its report: + + - ${{ steps.test.outputs.ccl_title_normal }}: ${{ steps.test.outputs.ccl_status_normal }} + - ${{ steps.test.outputs.ccl_title_debug }}: ${{ steps.test.outputs.ccl_status_debug }} + - ${{ steps.test.outputs.ccl_title_btf }}: ${{ steps.test.outputs.ccl_status_btf }} + - Task: ${{ steps.test.outputs.url }} + + Initiator: ${{ steps.commit.outputs.committer }} + Commits: ${{ github.server_url }}/${{ github.repository }}/commits/${{ steps.commit.outputs.sha }} + Patchwork: ${{ steps.series.outputs.series }} + + + If there are some issues, you can reproduce them using the same environment as + the one used by the CI thanks to a docker image, e.g.: + + $ cd [kernel source code] + $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \ + --pull always mptcp/mptcp-upstream-virtme-docker:latest \ + auto-normal + + For more details: + + https://github.com/multipath-tcp/mptcp-upstream-virtme-docker + + + Please note that despite all the efforts that have been already done to have a + stable tests suite when executed on a public CI like here, it is possible some + reported issues are not due to your modifications. Still, do not hesitate to + help us improve that ;-) + + Cheers, + MPTCP GH Action bot + Bot operated by Matthieu Baerts (NGI0 Core) diff --git a/.github/workflows/update-tg-tree.yml b/.github/workflows/update-tg-tree.yml new file mode 100644 index 00000000000000..767de620ee2cf8 --- /dev/null +++ b/.github/workflows/update-tg-tree.yml @@ -0,0 +1,54 @@ +name: "Update TopGit tree" + +on: + workflow_dispatch: + inputs: + keep_base_untouched: + description: 'Set it to 1 to force a sync without updating the base from upstream' + required: true + default: '0' + force_sync: + description: 'Set it to 1 to force a sync even if net-next is not updated' + required: true + default: '0' + force_upd_net: + description: 'Set it to 1 to force updating the -net base with upstream instead of the merge-base with net-next' + required: true + default: '1' + + schedule: + - cron: '33 5 * * 1-5' # in UTC: after US West coast's work day + +permissions: {} + +jobs: + export: + if: github.repository_owner == 'multipath-tcp' + runs-on: ubuntu-latest + permissions: + contents: write # for git push (multipath-tcp/mptcp-upstream-topgit-action) + + steps: + - name: "Checkout" + uses: actions/checkout@v4 + with: + fetch-depth: 0 # we need all commits for TopGit + token: '${{ secrets.PAT_MATTTBE }}' + + - name: "Update TG tree" + uses: multipath-tcp/mptcp-upstream-topgit-action@main + with: + not_base: "${{ github.event.inputs.keep_base_untouched || '0' }}" + force_sync: "${{ github.event.inputs.force_sync || '0' }}" + force_upd_net: "${{ github.event.inputs.force_upd_net || '1' }}" + + - name: irc topgit + if: failure() && github.repository_owner == 'multipath-tcp' + uses: rectalogic/notify-irc@v2 + with: + server: irc.libera.chat + channel: "#mptcp" + nickname: gh-topgit-bot + verbose: true + message: |- + New sync with latest net and net-next failed (initiated by ${{ github.actor }}): ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index 72ea97c5d5d424..82768b0e90262b 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -436,10 +436,8 @@ static void umac_init(struct bcmasp_intf *intf) umac_wl(intf, 0x800, UMC_RX_MAX_PKT_SZ); } -static int bcmasp_tx_poll(struct napi_struct *napi, int budget) +static int bcmasp_tx_reclaim(struct bcmasp_intf *intf) { - struct bcmasp_intf *intf = - container_of(napi, struct bcmasp_intf, tx_napi); struct bcmasp_intf_stats64 *stats = &intf->stats64; struct device *kdev = &intf->parent->pdev->dev; unsigned long read, released = 0; @@ -482,10 +480,16 @@ static int bcmasp_tx_poll(struct napi_struct *napi, int budget) DESC_RING_COUNT); } - /* Ensure all descriptors have been written to DRAM for the hardware - * to see updated contents. - */ - wmb(); + return released; +} + +static int bcmasp_tx_poll(struct napi_struct *napi, int budget) +{ + struct bcmasp_intf *intf = + container_of(napi, struct bcmasp_intf, tx_napi); + int released = 0; + + released = bcmasp_tx_reclaim(intf); napi_complete(&intf->tx_napi); @@ -797,6 +801,7 @@ static void bcmasp_init_tx(struct bcmasp_intf *intf) intf->tx_spb_dma_read = intf->tx_spb_dma_addr; intf->tx_spb_index = 0; intf->tx_spb_clean_index = 0; + memset(intf->tx_cbs, 0, sizeof(struct bcmasp_tx_cb) * DESC_RING_COUNT); /* Make sure channels are disabled */ tx_spb_ctrl_wl(intf, 0x0, TX_SPB_CTRL_ENABLE); @@ -885,6 +890,8 @@ static void bcmasp_netif_deinit(struct net_device *dev) } while (timeout-- > 0); tx_spb_dma_wl(intf, 0x0, TX_SPB_DMA_FIFO_CTRL); + bcmasp_tx_reclaim(intf); + umac_enable_set(intf, UMC_CMD_TX_EN, 0); phy_stop(dev->phydev); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index e4d7739bd7c888..4a79c0d7e7ad85 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -849,7 +849,7 @@ free_skb: static const struct mlxsw_listener mlxsw_emad_rx_listener = MLXSW_RXL(mlxsw_emad_rx_listener_func, ETHEMAD, TRAP_TO_CPU, false, - EMAD, DISCARD); + EMAD, FORWARD); static int mlxsw_emad_tlv_enable(struct mlxsw_core *mlxsw_core) { diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c index 53b150b7ae4e70..6c06b059276084 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c @@ -1357,24 +1357,20 @@ static struct mlxsw_linecards_event_ops mlxsw_env_event_ops = { .got_inactive = mlxsw_env_got_inactive, }; -static int mlxsw_env_max_module_eeprom_len_query(struct mlxsw_env *mlxsw_env) +static void mlxsw_env_max_module_eeprom_len_query(struct mlxsw_env *mlxsw_env) { char mcam_pl[MLXSW_REG_MCAM_LEN]; - bool mcia_128b_supported; + bool mcia_128b_supported = false; int err; mlxsw_reg_mcam_pack(mcam_pl, MLXSW_REG_MCAM_FEATURE_GROUP_ENHANCED_FEATURES); err = mlxsw_reg_query(mlxsw_env->core, MLXSW_REG(mcam), mcam_pl); - if (err) - return err; - - mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_MCIA_128B, - &mcia_128b_supported); + if (!err) + mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_MCIA_128B, + &mcia_128b_supported); mlxsw_env->max_eeprom_len = mcia_128b_supported ? 128 : 48; - - return 0; } int mlxsw_env_init(struct mlxsw_core *mlxsw_core, @@ -1445,15 +1441,11 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, if (err) goto err_type_set; - err = mlxsw_env_max_module_eeprom_len_query(env); - if (err) - goto err_eeprom_len_query; - + mlxsw_env_max_module_eeprom_len_query(env); env->line_cards[0]->active = true; return 0; -err_eeprom_len_query: err_type_set: mlxsw_env_module_event_disable(env, 0); err_mlxsw_env_module_event_enable: diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c index 4d617057af25cf..13fd067c39ed57 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c @@ -1545,7 +1545,7 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id) { struct pci_dev *pdev = mlxsw_pci->pdev; char mcam_pl[MLXSW_REG_MCAM_LEN]; - bool pci_reset_supported; + bool pci_reset_supported = false; u32 sys_status; int err; @@ -1563,11 +1563,9 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id) mlxsw_reg_mcam_pack(mcam_pl, MLXSW_REG_MCAM_FEATURE_GROUP_ENHANCED_FEATURES); err = mlxsw_reg_query(mlxsw_pci->core, MLXSW_REG(mcam), mcam_pl); - if (err) - return err; - - mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_PCI_RESET, - &pci_reset_supported); + if (!err) + mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_PCI_RESET, + &pci_reset_supported); if (pci_reset_supported) { pci_dbg(pdev, "Starting PCI reset flow\n"); diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c index 6dff2c85682d8b..6fae161cbcb822 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c @@ -1598,7 +1598,7 @@ static void wx_set_num_queues(struct wx *wx) */ static int wx_acquire_msix_vectors(struct wx *wx) { - struct irq_affinity affd = {0, }; + struct irq_affinity affd = { .pre_vectors = 1 }; int nvecs, i; /* We start by asking for one vector per queue pair */ diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 72ecf6cf809cbd..4bbfb516ac05bc 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -1616,6 +1616,10 @@ static bool vxlan_set_mac(struct vxlan_dev *vxlan, if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr)) return false; + /* Ignore packets from invalid src-address */ + if (!is_valid_ether_addr(eth_hdr(skb)->h_source)) + return false; + /* Get address from the outer IP header */ if (vxlan_get_sk_family(vs) == AF_INET) { saddr.sin.sin_addr.s_addr = ip_hdr(skb)->saddr; diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 944922172c9858..6e244629508975 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1134,16 +1134,17 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) if (msg->msg_controllen) { err = udp_cmsg_send(sk, msg, &ipc.gso_size); - if (err > 0) + if (err > 0) { err = ip_cmsg_send(sk, msg, &ipc, sk->sk_family == AF_INET6); + connected = 0; + } if (unlikely(err < 0)) { kfree(ipc.opt); return err; } if (ipc.opt) free = 1; - connected = 0; } if (!ipc.opt) { struct ip_options_rcu *inet_opt; diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 9914e73f478588..085ee236d9a1f8 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -1487,9 +1487,11 @@ do_udp_sendmsg: ipc6.opt = opt; err = udp_cmsg_send(sk, msg, &ipc6.gso_size); - if (err > 0) + if (err > 0) { err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, fl6, &ipc6); + connected = false; + } if (err < 0) { fl6_sock_release(flowlabel); return err; @@ -1501,7 +1503,6 @@ do_udp_sendmsg: } if (!(opt->opt_nflen|opt->opt_flen)) opt = NULL; - connected = false; } if (!opt) { opt = txopt_get(np); diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index f8bc34f0d973eb..611759b6011dda 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3730,6 +3730,9 @@ static int mptcp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_TOKENFALLBACKINIT); mptcp_subflow_early_fallback(msk, subflow); } + + WRITE_ONCE(msk->write_seq, subflow->idsn); + WRITE_ONCE(msk->snd_nxt, subflow->idsn); if (likely(!__mptcp_check_fallback(msk))) MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPCAPABLEACTIVE); diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 4b14b4412166b5..d0b39c2e38a3c6 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -290,9 +290,9 @@ run_test 10 10 0 0 "balanced bwidth" run_test 10 10 1 25 "balanced bwidth with unbalanced delay" # we still need some additional infrastructure to pass the following test-cases -run_test 10 3 0 0 "unbalanced bwidth" -run_test 10 3 1 25 "unbalanced bwidth with unbalanced delay" -run_test 10 3 25 1 "unbalanced bwidth with opposed, unbalanced delay" +run_test 15 5 0 0 "unbalanced bwidth" +run_test 15 5 1 25 "unbalanced bwidth with unbalanced delay" +run_test 15 5 25 1 "unbalanced bwidth with opposed, unbalanced delay" mptcp_lib_result_print_all_tap exit $ret |