Comment 4 for bug 1929035

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2022-03-16 13:19 EDT-------
(In reply to comment #9)
> Thx for the list of commits.
>
> Looks like LP#1929060 "[22.04 FEAT] smc: Add User-defined EID (Enterprise
> ID) Support - kernel" is a prereq - if not worked based on that, I run into
> EID issues already starting with 42042dbbc2eb.
>
> Applying the patches based on LP#1929060 I get further down, but still run
> into conflicts, this time with 8799e310fb3f ("net/smc: add v2 support to the
> work request layer").
>
> $ git cherry-pick -s -e -x 8799e310fb3f
> Auto-merging net/smc/smc_wr.h
> Auto-merging net/smc/smc_wr.c
> CONFLICT (content): Merge conflict in net/smc/smc_wr.c
> Auto-merging net/smc/smc_ib.c
> Auto-merging net/smc/smc_core.h
> Auto-merging net/smc/smc_core.c
> error: could not apply 8799e310fb3f... net/smc: add v2 support to the work
> request layer
> hint: after resolving the conflicts, mark the corrected paths
> hint: with 'git add <paths>' or 'git rm <paths>'
> hint: and commit the result with 'git commit'
> fheimes@T570:~/ubuntu-jammy-master-next/jammy-lp1929035$ git status
> On branch master-next
> Your branch is ahead of 'origin/master-next' by 9 commits.
> (use "git push" to publish your local commits)
>
> You are currently cherry-picking commit 8799e310fb3f.
> (fix conflicts and run "git cherry-pick --continue")
> (use "git cherry-pick --skip" to skip this patch)
> (use "git cherry-pick --abort" to cancel the cherry-pick operation)
>
> Changes to be committed:
> modified: net/smc/smc_core.c
> modified: net/smc/smc_core.h
> modified: net/smc/smc_ib.c
> modified: net/smc/smc_wr.h
>
> Unmerged paths:
> (use "git add <file>..." to mark resolution)
> both modified: net/smc/smc_wr.c
> $
>
> $ git diff
> diff --cc net/smc/smc_wr.c
> index 59ca1a2d5c65,22d7324969cd..000000000000
> --- a/net/smc/smc_wr.c
> +++ b/net/smc/smc_wr.c
> @@@ -96,20 -101,47 +96,59 @@@ static inline void smc_wr_tx_process_cq
> }
>
> pnd_snd_idx = smc_wr_tx_find_pending_index(link, wc->wr_id);
> - if (pnd_snd_idx == link->wr_tx_cnt)
> - return;
> - link->wr_tx_pends[pnd_snd_idx].wc_status = wc->status;
> - if (link->wr_tx_pends[pnd_snd_idx].compl_requested)
> - complete(&link->wr_tx_compl[pnd_snd_idx]);
> - memcpy(&pnd_snd, &link->wr_tx_pends[pnd_snd_idx], sizeof(pnd_snd));
> - /* clear the full struct smc_wr_tx_pend including .priv */
> - memset(&link->wr_tx_pends[pnd_snd_idx], 0,
> - sizeof(link->wr_tx_pends[pnd_snd_idx]));
> - memset(&link->wr_tx_bufs[pnd_snd_idx], 0,
> - sizeof(link->wr_tx_bufs[pnd_snd_idx]));
> - if (!test_and_clear_bit(pnd_snd_idx, link->wr_tx_mask))
> - return;
> + if (pnd_snd_idx == link->wr_tx_cnt) {
> + if (link->lgr->smc_version != SMC_V2 ||
> + link->wr_tx_v2_pend->wr_id != wc->wr_id)
> + return;
> + link->wr_tx_v2_pend->wc_status = wc->status;
> + memcpy(&pnd_snd, link->wr_tx_v2_pend, sizeof(pnd_snd));
> + /* clear the full struct smc_wr_tx_pend including .priv */
> + memset(link->wr_tx_v2_pend, 0,
> + sizeof(*link->wr_tx_v2_pend));
> + memset(link->lgr->wr_tx_buf_v2, 0,
> + sizeof(*link->lgr->wr_tx_buf_v2));
> + } else {
> + link->wr_tx_pends[pnd_snd_idx].wc_status = wc->status;
> + if (link->wr_tx_pends[pnd_snd_idx].compl_requested)
> + complete(&link->wr_tx_compl[pnd_snd_idx]);
> + memcpy(&pnd_snd, &link->wr_tx_pends[pnd_snd_idx],
> + sizeof(pnd_snd));
> + /* clear the full struct smc_wr_tx_pend including .priv */
> + memset(&link->wr_tx_pends[pnd_snd_idx], 0,
> + sizeof(link->wr_tx_pends[pnd_snd_idx]));
> + memset(&link->wr_tx_bufs[pnd_snd_idx], 0,
> + sizeof(link->wr_tx_bufs[pnd_snd_idx]));
> + if (!test_and_clear_bit(pnd_snd_idx, link->wr_tx_mask))
> + return;
> + }
> +
> if (wc->status) {
> ++<<<<<<< HEAD
> ++||||||| parent of 8799e310fb3f... net/smc: add v2 support to the work
> request layer
> ++ for_each_set_bit(i, link->wr_tx_mask, link->wr_tx_cnt) {
> ++ /* clear full struct smc_wr_tx_pend including .priv
> */
> ++ memset(&link->wr_tx_pends[i], 0,
> ++ sizeof(link->wr_tx_pends[i]));
> ++ memset(&link->wr_tx_bufs[i], 0,
> ++ sizeof(link->wr_tx_bufs[i]));
> ++ clear_bit(i, link->wr_tx_mask);
> ++ }
> ++=======
> + for_each_set_bit(i, link->wr_tx_mask, link->wr_tx_cnt) {
> + /* clear full struct smc_wr_tx_pend including .priv
> */
> + memset(&link->wr_tx_pends[i], 0,
> + sizeof(link->wr_tx_pends[i]));
> + memset(&link->wr_tx_bufs[i], 0,
> + sizeof(link->wr_tx_bufs[i]));
> + clear_bit(i, link->wr_tx_mask);
> + }
> + if (link->lgr->smc_version == SMC_V2) {
> + memset(link->wr_tx_v2_pend, 0,
> + sizeof(*link->wr_tx_v2_pend));
> + memset(link->lgr->wr_tx_buf_v2, 0,
> + sizeof(*link->lgr->wr_tx_buf_v2));
> + }
> ++>>>>>>> 8799e310fb3f... net/smc: add v2 support to the work request layer
> /* terminate link */
> smcr_link_down_cond_sched(link);
> }
>
> I can start fixing this and converting the cherry-pick into a backport,
> but I hope thee is a cleaner solution, e.g. a missing pre-req or so?

That is ok, no pre-req.
Additionally, pls don't just cherry-pick the certain patches mentioned above. All of the smc related patches till the date 2021-10-28 on the list (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/net/smc?h=v5.16) should be taken for U22.04