aboutsummaryrefslogtreecommitdiffstats
BranchCommit messageAuthorAge
archive/unc-master-3.0P-FP: fix BUG_ON releated to priority inheritanceBjoern Brandenburg13 years
archived-2013.1uncachedev: mmap memory that is not cached by CPUsGlenn Elliott12 years
archived-private-masterMerge branch 'wip-2.6.34' into old-private-masterAndrea Bastoni15 years
archived-semi-partMerge branch 'wip-semi-part' of ssh://cvs/cvs/proj/litmus/repo/litmus2010 int...Andrea Bastoni15 years
demoFurther refinementsJonathan Herman14 years
ecrts-pgm-finalMerge branch 'wip-ecrts14-pgm' of ssh://rtsrv.cs.unc.edu/home/litmus/litmus-r...Glenn Elliott12 years
ecrts14-pgm-finalMerge branch 'wip-ecrts14-pgm' of ssh://rtsrv.cs.unc.edu/home/litmus/litmus-r...Glenn Elliott12 years
gpusync-rtss12Final GPUSync implementation.Glenn Elliott12 years
gpusync/stagingRename IKGLP R2DGLP.Glenn Elliott12 years
linux-tipMerge branch 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/p...Linus Torvalds15 years
litmus2008-patch-seriesadd i386 feather-trace implementationBjoern B. Brandenburg16 years
masterPSN-EDF: use inferred_sporadic_job_release_atBjoern Brandenburg9 years
pgmmake it compileGlenn Elliott12 years
prop/litmus-signalsInfrastructure for Litmus signals.Glenn Elliott13 years
prop/robust-tie-breakFixed bug in edf_higher_prio().Glenn Elliott13 years
stagingFix tracepoint compilation errorFelipe Cerqueira13 years
test9/23/2016Namhoon Kim9 years
tracing-develTest kernel tracing events capabilitiesAndrea Bastoni16 years
v2.6.34-with-arm-patchessmsc911x: Add spinlocks around registers accessCatalin Marinas15 years
v2015.1Add ARM syscall def for get_current_budgetBjoern Brandenburg10 years
wip-2011.2-bbbLitmus core: simplify np-section protocolBjoern B. Brandenburg14 years
wip-2011.2-bbb-traceRefactor sched_trace_log_message() -> debug_trace_log_message()Andrea Bastoni14 years
wip-2012.3-gpuSOBLIV draining support for C-EDF.Glenn Elliott12 years
wip-2012.3-gpu-preportpick up last C-RM fileGlenn Elliott12 years
wip-2012.3-gpu-rtss13Fix critical bug in GPU tracker.Glenn Elliott12 years
wip-2012.3-gpu-sobliv-budget-w-ksharkProper sobliv draining and many bug fixes.Glenn Elliott12 years
wip-aedzl-finalMake it easier to compile AEDZL interfaces in liblitmus.Glenn Elliott15 years
wip-aedzl-revisedAdd sched_trace data for Apative EDZLGlenn Elliott15 years
wip-arbit-deadlineFix compilation bug.Glenn Elliott13 years
wip-aux-tasksDescription of refined aux task inheritance.Glenn Elliott13 years
wip-bbbGSN-EDF & Core: improve debug TRACE'ing for NP sectionsBjoern B. Brandenburg14 years
wip-bbb-prio-donuse correct timestampBjoern B. Brandenburg14 years
wip-better-breakImplement hash-based EDF tie-breaking.Glenn Elliott13 years
wip-binary-heapMake C-EDF work with simplified binheap_deleteGlenn Elliott13 years
wip-budgetAdded support for choices in budget policy enforcement.Glenn Elliott15 years
wip-colorSummarize schedulability with final recordJonathan Herman13 years
wip-color-jlhsched_color: Fixed two bugs causing crashing on experiment restart and a rare...Jonathan Herman13 years
wip-d10-hz1000Enable HZ=1000 on District 10Bjoern B. Brandenburg15 years
wip-default-clusteringFeature: Make default C-EDF clustering compile-time configurable.Glenn Elliott15 years
wip-dissipation-jericksoUpdate from 2.6.36 to 2.6.36.4Jeremy Erickson11 years
wip-dissipation2-jericksoUpdate 2.6.36 to 2.6.36.4Jeremy Erickson11 years
wip-ecrts14-pgmMerge branch 'wip-ecrts14-pgm' of ssh://rtsrv.cs.unc.edu/home/litmus/litmus-r...Glenn Elliott12 years
wip-edf-hsblast tested versionJonathan Herman14 years
wip-edf-osLookup table EDF-osJeremy Erickson12 years
wip-edf-tie-breakMerge branch 'wip-edf-tie-break' of ssh://rtsrv.cs.unc.edu/home/litmus/litmus...Glenn Elliott13 years
wip-edzl-critiqueUse hr_timer's active checks instead of having own flag.Glenn Elliott15 years
wip-edzl-finalImplementation of the EDZL scheduler.Glenn Elliott15 years
wip-edzl-revisedClean up comments.Glenn Elliott15 years
wip-eventsAdded support for tracing arbitrary actions.Jonathan Herman15 years
wip-extra-debugDBG: add additional tracingBjoern B. Brandenburg15 years
wip-fix-switch-jericksoAttempt to fix race condition with plugin switchingJeremy Erickson15 years
wip-fix3sched: show length of runqueue clock deactivation in /proc/sched_debugBjoern B. Brandenburg15 years
wip-fmlp-dequeueImprove FMLP queue management.Glenn Elliott14 years
wip-ft-irq-flagFeather-Trace: keep track of interrupt-related interference.Bjoern B. Brandenburg14 years
wip-gpu-cleanupEnable sched_trace log injection from userspaceGlenn Elliott13 years
wip-gpu-interruptsRemove option for threading of all softirqs.Glenn Elliott13 years
wip-gpu-rtas12Generalized GPU cost predictors + EWMA. (untested)Glenn Elliott13 years
wip-gpu-rtss12Final GPUSync implementation.Glenn Elliott13 years
wip-gpu-rtss12-srpexperimental changes to support GPUs under SRPGlenn Elliott13 years
wip-gpusync-mergeCleanup priority tracking for budget enforcement.Glenn Elliott11 years
wip-ikglpMove RSM and IKGLP imp. to own .c filesGlenn Elliott13 years
wip-k-fmlpMerge branch 'mpi-master' into wip-k-fmlpGlenn Elliott13 years
wip-kernel-coloringAdded recolor syscallNamhoon Kim7 years
wip-kernthreadsKludge work-queue processing into klitirqd.Glenn Elliott15 years
wip-klmirqd-to-auxAllow klmirqd threads to be given names.Glenn Elliott13 years
wip-ksharkMerge branch 'mpi-staging' into wip-ksharkJonathan Herman13 years
wip-litmus-3.2Merge commit 'v3.2' into litmus-stagingAndrea Bastoni13 years
wip-litmus2011.2Cleanup: Coding conformance for affinity stuff.Glenn Elliott14 years
wip-litmus3.0-2011.2Feather-Trace: keep track of interrupt-related interference.Bjoern B. Brandenburg14 years
wip-master-2.6.33-rtAvoid deadlock when switching task policy to BACKGROUND (ugly)Andrea Bastoni15 years
wip-mcRemoved ARM-specific hacks which disabled less common mixed-criticality featu...Jonathan Herman12 years
wip-mc-bipasaMC-EDF addedbipasa chattopadhyay13 years
wip-mc-jericksoSplit C/D queuesJeremy Erickson15 years
wip-mc2-cache-slackManually patched mc^2 related codeMing Yang10 years
wip-mcrit-maccosmeticMac Mollison15 years
wip-merge-3.0Prevent Linux to send IPI and queue tasks on remote CPUs.Andrea Bastoni14 years
wip-merge-v3.0Prevent Linux to send IPI and queue tasks on remote CPUs.Andrea Bastoni14 years
wip-migration-affinityNULL affinity dereference in C-EDF.Glenn Elliott14 years
wip-mmap-uncacheshare branch with othersGlenn Elliott12 years
wip-modechangeRTSS 2017 submissionNamhoon Kim8 years
wip-nested-lockingAppears to be working.Bryan Ward12 years
wip-omlp-gedfFirst implementation of G-OMLP.Glenn Elliott15 years
wip-paiSome cleanup of PAIGlenn Elliott13 years
wip-percore-lib9/21/2016Namhoon Kim9 years
wip-performanceCONFIG_DONT_PREEMPT_ON_TIE: Don't preeempt a scheduled task on priority tie.Glenn Elliott14 years
wip-pgmAdd PGM support to C-FLGlenn Elliott12 years
wip-pgm-splitFirst draft of C-FL-splitNamhoon Kim12 years
wip-pm-ovdAdd preemption-and-migration overhead tracing supportAndrea Bastoni15 years
wip-prio-inhP-EDF updated to use the generic pi framework.Glenn Elliott15 years
wip-prioq-dglBUG FIX: Support DGLs with PRIOQ_MUTEXGlenn Elliott13 years
wip-refactored-gedfGeneralizd architecture for GEDF-style scheduelrs to reduce code redundancy.Glenn Elliott15 years
wip-release-master-fixbugfix: release master CPU must signal task was pickedBjoern B. Brandenburg14 years
wip-robust-tie-breakEDF priority tie-breaks.Glenn Elliott13 years
wip-rt-ksharkMove task time accounting into the complete_job method.Jonathan Herman13 years
wip-rtas12-pgmScheduling of PGM jobs.Glenn Elliott13 years
wip-semi-partFix compile error with newer GCCJeremy Erickson12 years
wip-semi-part-edfos-jericksoUse initial CPU set by clientJeremy Erickson12 years
wip-shared-libTODO: Fix condition checks in replicate_page_move_mapping()Namhoon Kim9 years
wip-shared-lib2RTAS 2017 Submission ver.Namhoon Kim9 years
wip-shared-memInitial commit for shared libraryNamhoon Kim9 years
wip-splitting-jericksoFix release behaviorJeremy Erickson13 years
wip-splitting-omlp-jericksoBjoern's Dissertation Code with Priority DonationJeremy Erickson13 years
wip-stage-binheapAn efficient binary heap implementation.Glenn Elliott13 years
wip-sun-portDynamic memory allocation and clean exit for FeatherTraceChristopher Kenna15 years
wip-timer-tracebugfix: C-EDF, clear scheduled field of the correct CPU upon task_exitAndrea Bastoni15 years
wip-tracepointsAdd kernel-style events for sched_trace_XXX() functionsAndrea Bastoni14 years
 
TagDownloadAuthorAge
2015.1commit 8e51b37822...Bjoern Brandenburg10 years
2013.1commit bcaacec1ca...Glenn Elliott12 years
2012.3commit c158b5fbe4...Jonathan Herman13 years
2012.2commit b53c479a0f...Glenn Elliott13 years
2012.1commit 83b11ea1c6...Bjoern B. Brandenburg14 years
rtas12-mc-beta-expcommit 8e236ee20f...Christopher Kenna14 years
2011.1commit d11808b5c6...Christopher Kenna15 years
v2.6.37-rc4commit e8a7e48bb2...Linus Torvalds15 years
v2.6.37-rc3commit 3561d43fd2...Linus Torvalds15 years
v2.6.37-rc2commit e53beacd23...Linus Torvalds15 years
v2.6.37-rc1commit c8ddb2713c...Linus Torvalds15 years
v2.6.36commit f6f94e2ab1...Linus Torvalds15 years
2010.2commit 5c5456402d...Bjoern B. Brandenburg15 years
v2.6.36-rc8commit cd07202cc8...Linus Torvalds15 years
v2.6.36-rc7commit cb655d0f3d...Linus Torvalds15 years
v2.6.36-rc6commit 899611ee7d...Linus Torvalds15 years
v2.6.36-rc5commit b30a3f6257...Linus Torvalds15 years
v2.6.36-rc4commit 49553c2ef8...Linus Torvalds15 years
v2.6.36-rc3commit 2bfc96a127...Linus Torvalds15 years
v2.6.36-rc2commit 76be97c1fc...Linus Torvalds15 years
v2.6.36-rc1commit da5cabf80e...Linus Torvalds15 years
v2.6.35commit 9fe6206f40...Linus Torvalds15 years
v2.6.35-rc6commit b37fa16e78...Linus Torvalds15 years
v2.6.35-rc5commit 1c5474a65b...Linus Torvalds15 years
v2.6.35-rc4commit 815c4163b6...Linus Torvalds15 years
v2.6.35-rc3commit 7e27d6e778...Linus Torvalds15 years
v2.6.35-rc2commit e44a21b726...Linus Torvalds15 years
v2.6.35-rc1commit 67a3e12b05...Linus Torvalds15 years
2010.1commit 7c1ff4c544...Andrea Bastoni15 years
v2.6.34commit e40152ee1e...Linus Torvalds15 years
v2.6.33.4commit 4640b4e7d9...Greg Kroah-Hartman15 years
v2.6.34-rc7commit b57f95a382...Linus Torvalds15 years
v2.6.34-rc6commit 66f41d4c5c...Linus Torvalds15 years
v2.6.33.3commit 3e7ad8ed97...Greg Kroah-Hartman15 years
v2.6.34-rc5commit 01bf0b6457...Linus Torvalds15 years
v2.6.34-rc4commit 0d0fb0f9c5...Linus Torvalds15 years
v2.6.33.2commit 19f00f070c...Greg Kroah-Hartman15 years
v2.6.34-rc3commit 2eaa9cfdf3...Linus Torvalds15 years
v2.6.34-rc2commit 220bf991b0...Linus Torvalds15 years
v2.6.33.1commit dbdafe5ccf...Greg Kroah-Hartman15 years
v2.6.34-rc1commit 57d54889cd...Linus Torvalds15 years
v2.6.33commit 60b341b778...Linus Torvalds16 years
v2.6.33-rc8commit 724e6d3fe8...Linus Torvalds16 years
v2.6.33-rc7commit 29275254ca...Linus Torvalds16 years
v2.6.33-rc6commit abe94c756c...Linus Torvalds16 years
v2.6.33-rc5commit 92dcffb916...Linus Torvalds16 years
v2.6.33-rc4commit 7284ce6c9f...Linus Torvalds16 years
v2.6.33-rc3commit 74d2e4f8d7...Linus Torvalds16 years
v2.6.33-rc2commit 6b7b284958...Linus Torvalds16 years
v2.6.33-rc1commit 55639353a0...Linus Torvalds16 years
v2.6.32commit 22763c5cf3...Linus Torvalds16 years
v2.6.32-rc8commit 648f4e3e50...Linus Torvalds16 years
v2.6.32-rc7commit 156171c71a...Linus Torvalds16 years
v2.6.32-rc6commit b419148e56...Linus Torvalds16 years
v2.6.32-rc5commit 012abeea66...Linus Torvalds16 years
v2.6.32-rc4commit 161291396e...Linus Torvalds16 years
v2.6.32-rc3commit 374576a8b6...Linus Torvalds16 years
v2.6.32-rc1commit 17d857be64...Linus Torvalds16 years
v2.6.32-rc2commit 17d857be64...Linus Torvalds16 years
v2.6.31commit 74fca6a428...Linus Torvalds16 years
v2.6.31-rc9commit e07cccf404...Linus Torvalds16 years
v2.6.31-rc8commit 326ba5010a...Linus Torvalds16 years
v2.6.31-rc7commit 422bef879e...Linus Torvalds16 years
v2.6.31-rc6commit 64f1607ffb...Linus Torvalds16 years
v2.6.31-rc5commit ed680c4ad4...Linus Torvalds16 years
v2.6.31-rc4commit 4be3bd7849...Linus Torvalds16 years
v2.6.31-rc3commit 6847e154e3...Linus Torvalds16 years
v2.6.31-rc2commit 8e4a718ff3...Linus Torvalds16 years
v2.6.31-rc1commit 28d0325ce6...Linus Torvalds16 years
v2.6.30commit 07a2039b8e...Linus Torvalds16 years
v2.6.30-rc8commit 9fa7eb283c...Linus Torvalds16 years
v2.6.30-rc7commit 59a3759d0f...Linus Torvalds16 years
v2.6.30-rc6commit 1406de8e11...Linus Torvalds16 years
v2.6.30-rc5commit 091bf7624d...Linus Torvalds16 years
v2.6.30-rc4commit 091438dd56...Linus Torvalds16 years
v2.6.30-rc3commit 0910697403...Linus Torvalds16 years
v2.6.30-rc2commit 0882e8dd3a...Linus Torvalds16 years
v2.6.30-rc1commit 577c9c456f...Linus Torvalds16 years
v2.6.29commit 8e0ee43bc2...Linus Torvalds16 years
v2.6.29-rc8commit 041b62374c...Linus Torvalds16 years
v2.6.29-rc7commit fec6c6fec3...Linus Torvalds17 years
v2.6.29-rc6commit 20f4d6c3a2...Linus Torvalds17 years
v2.6.29-rc5commit d2f8d7ee1a...Linus Torvalds17 years
v2.6.29-rc4commit 8e4921515c...Linus Torvalds17 years
v2.6.29-rc3commit 18e352e4a7...Linus Torvalds17 years
v2.6.29-rc2commit 1de9e8e70f...Linus Torvalds17 years
v2.6.29-rc1commit c59765042f...Linus Torvalds17 years
v2.6.28commit 4a6908a3a0...Linus Torvalds17 years
v2.6.28-rc9commit 929096fe9f...Linus Torvalds17 years
v2.6.28-rc8commit 8b1fae4e42...Linus Torvalds17 years
v2.6.28-rc7commit 061e41fdb5...Linus Torvalds17 years
v2.6.28-rc6commit 13d428afc0...Linus Torvalds17 years
v2.6.28-rc5commit 9bf1a2445f...Linus Torvalds17 years
v2.6.28-rc4commit f7160c7573...Linus Torvalds17 years
v2.6.28-rc3commit 45beca08dd...Linus Torvalds17 years
v2.6.28-rc2commit 0173a3265b...Linus Torvalds17 years
v2.6.28-rc1commit 57f8f7b60d...Linus Torvalds17 years
v2.6.27commit 3fa8749e58...Linus Torvalds17 years
v2.6.27-rc9commit 4330ed8ed4...Linus Torvalds17 years
v2.6.27-rc8commit 94aca1dac6...Linus Torvalds17 years
v2.6.27-rc7commit 72d31053f6...Linus Torvalds17 years
v2.6.27-rc6commit adee14b2e1...Linus Torvalds17 years
v2.6.27-rc5commit 24342c34a0...Linus Torvalds17 years
v2.6.27-rc4commit 6a55617ed5...Linus Torvalds17 years
v2.6.27-rc3commit 30a2f3c60a...Linus Torvalds17 years
v2.6.27-rc2commit 0967d61ea0...Linus Torvalds17 years
v2.6.27-rc1commit 6e86841d05...Linus Torvalds17 years
v2.6.26commit bce7f793da...Linus Torvalds17 years
v2.6.26-rc9commit b7279469d6...Linus Torvalds17 years
v2.6.26-rc8commit 543cf4cb3f...Linus Torvalds17 years
v2.6.26-rc7commit d70ac829b7...Linus Torvalds17 years
v2.6.26-rc6commit 5dd34572ad...Linus Torvalds17 years
v2.6.26-rc5commit 53c8ba9540...Linus Torvalds17 years
v2.6.26-rc4commit e490517a03...Linus Torvalds17 years
v2.6.26-rc3commit b8291ad07a...Linus Torvalds17 years
v2.6.26-rc2commit 492c2e476e...Linus Torvalds17 years
v2.6.26-rc1commit 2ddcca36c8...Linus Torvalds17 years
v2.6.25commit 4b119e21d0...Linus Torvalds17 years
v2.6.25-rc9commit 120dd64cac...Linus Torvalds17 years
v2.6.25-rc8commit 0e81a8ae37...Linus Torvalds17 years
v2.6.25-rc7commit 05dda977f2...Linus Torvalds17 years
v2.6.25-rc6commit a978b30af3...Linus Torvalds17 years
v2.6.25-rc5commit cdeeeae056...Linus Torvalds17 years
v2.6.25-rc4commit 29e8c3c304...Linus Torvalds18 years
v2.6.25-rc3commit bfa274e243...Linus Torvalds18 years
v2.6.25-rc2commit 101142c37b...Linus Torvalds18 years
v2.6.25-rc1commit 19af35546d...Linus Torvalds18 years
v2.6.24commit 49914084e7...Linus Torvalds18 years
v2.6.24-rc8commit cbd9c88369...Linus Torvalds18 years
v2.6.24-rc7commit 3ce5445046...Linus Torvalds18 years
v2.6.24-rc6commit ea67db4cdb...Linus Torvalds18 years
v2.6.24-rc5commit 82d29bf6dc...Linus Torvalds18 years
v2.6.24-rc4commit 09b56adc98...Linus Torvalds18 years
v2.6.24-rc3commit d9f8bcbf67...Linus Torvalds18 years
v2.6.24-rc2commit dbeeb816e8...Linus Torvalds18 years
v2.6.24-rc1commit c9927c2bf4...Linus Torvalds18 years
v2.6.23commit bbf25010f1...Linus Torvalds18 years
v2.6.23-rc9commit 3146b39c18...Linus Torvalds18 years
v2.6.23-rc8commit 4942de4a0e...Linus Torvalds18 years
v2.6.23-rc7commit 81cfe79b9c...Linus Torvalds18 years
v2.6.23-rc6commit 0d4cbb5e7f...Linus Torvalds18 years
v2.6.23-rc5commit 40ffbfad6b...Linus Torvalds18 years
v2.6.23-rc4commit b07d68b5ca...Linus Torvalds18 years
v2.6.23-rc3commit 39d3520c92...Linus Torvalds18 years
v2.6.23-rc2commit d4ac2477fa...Linus Torvalds18 years
v2.6.23-rc1commit f695baf2df...Linus Torvalds18 years
v2.6.22commit 7dcca30a32...Linus Torvalds18 years
v2.6.22-rc7commit a38d6181ff...Linus Torvalds18 years
v2.6.22-rc6commit 189548642c...Linus Torvalds18 years
v2.6.22-rc5commit 188e1f81ba...Linus Torvalds18 years
v2.6.22-rc4commit 5ecd3100e6...Linus Torvalds18 years
v2.6.22-rc3commit c420bc9f09...Linus Torvalds18 years
v2.6.22-rc2commit 55b637c6a0...Linus Torvalds18 years
v2.6.22-rc1commit 39403865d2...Linus Torvalds18 years
v2.6.21commit de46c33745...Linus Torvalds18 years
v2.6.21-rc7commit 94a05509a9...Linus Torvalds18 years
v2.6.21-rc6commit a21bd69e15...Linus Torvalds18 years
v2.6.21-rc5commit e0f2e3a06b...Linus Torvalds18 years
v2.6.21-rc4commit db98e0b434...Linus Torvalds18 years
v2.6.21-rc3commit 08e15e81a4...Linus Torvalds18 years
v2.6.21-rc2commit 606135a308...Linus Torvalds19 years
v2.6.21-rc1commit c8f71b01a5...Linus Torvalds19 years
v2.6.20commit 62d0cfcb27...Linus Torvalds19 years
v2.6.20-rc7commit f56df2f4db...Linus Torvalds19 years
v2.6.20-rc6commit 99abfeafb5...Linus Torvalds19 years
v2.6.20-rc5commit a8b3485287...Linus Torvalds19 years
v2.6.20-rc4commit bf81b46482...Linus Torvalds19 years
v2.6.20-rc3commit 669df1b478...Linus Torvalds19 years
v2.6.20-rc2commit 3bf8ba38f3...Linus Torvalds19 years
v2.6.20-rc1commit cc016448b0...Linus Torvalds19 years
v2.6.19commit 0215ffb08c...Linus Torvalds19 years
v2.6.19-rc6commit 44597f65f6...Linus Torvalds19 years
v2.6.19-rc5commit 80c2188127...Linus Torvalds19 years
v2.6.19-rc4commit ae99a78af3...Linus Torvalds19 years
v2.6.19-rc3commit 7059abedd2...Linus Torvalds19 years
v2.6.19-rc2commit b4bd8c6643...Linus Torvalds19 years
v2.6.19-rc1commit d223a60106...Linus Torvalds19 years
v2.6.18commit e478bec0ba...Linus Torvalds19 years
v2.6.18-rc7commit 95064a75eb...Linus Torvalds19 years
v2.6.18-rc6commit c336923b66...Linus Torvalds19 years
v2.6.18-rc5commit 60d4684068...Linus Torvalds19 years
v2.6.18-rc4commit 9f737633e6...Linus Torvalds19 years
v2.6.18-rc3commit b6ff50833a...Linus Torvalds19 years
v2.6.18-rc2commit 82d6897fef...Linus Torvalds19 years
v2.6.18-rc1commit 120bda20c6...Linus Torvalds19 years
v2.6.17commit 427abfa28a...Linus Torvalds19 years
v2.6.17-rc6commit 1def630a6a...Linus Torvalds19 years
v2.6.17-rc5commit a8bd60705a...Linus Torvalds19 years
v2.6.17-rc4commit d8c3291c73...Linus Torvalds19 years
v2.6.17-rc3commit 2be4d50295...Linus Torvalds19 years
v2.6.17-rc2commit 8bbde0e6d5...Linus Torvalds19 years
v2.6.17-rc1commit 6246b6128b...Linus Torvalds19 years
v2.6.16commit 7705a8792b...Linus Torvalds19 years
v2.6.16-rc6commit 535744878e...Linus Torvalds19 years
v2.6.16-rc5commit b9a33cebac...Linus Torvalds20 years
v2.6.16-rc4commit bd71c2b174...Linus Torvalds20 years
v2.6.16-rc3commit e9bb4c9929...Linus Torvalds20 years
v2.6.16-rc2commit 826eeb53a6...Linus Torvalds20 years
v2.6.16-rc1commit 2664b25051...Linus Torvalds20 years
v2.6.15commit 88026842b0...Linus Torvalds20 years
v2.6.15-rc7commit f89f5948fc...Linus Torvalds20 years
v2.6.15-rc6commit df7addbb45...Linus Torvalds20 years
v2.6.15-rc5commit 436b0f76f2...Linus Torvalds20 years
v2.6.15-rc4commit 5666c0947e...Linus Torvalds20 years
v2.6.15-rc3commit 624f54be20...Linus Torvalds20 years
v2.6.15-rc2commit 3bedff1d73...Linus Torvalds20 years
v2.6.15-rc1commit cd52d1ee9a...Linus Torvalds20 years
v2.6.14commit 741b2252a5...Linus Torvalds20 years
v2.6.14-rc5commit 93918e9afc...Linus Torvalds20 years
v2.6.14-rc4commit 907a426179...Linus Torvalds20 years
v2.6.14-rc3commit 1c9426e8a5...Linus Torvalds20 years
v2.6.14-rc2commit 676d55ae30...Linus Torvalds20 years
v2.6.14-rc1commit 2f4ba45a75...Linus Torvalds20 years
v2.6.13commit 02b3e4e2d7...Linus Torvalds20 years
v2.6.13-rc7commit 0572e3da3f...Linus Torvalds20 years
v2.6.13-rc6commit 6fc32179de...Linus Torvalds20 years
v2.6.13-rc5commit 9a351e30d7...Linus Torvalds20 years
v2.6.13-rc4commit 6395352334...Linus Torvalds20 years
v2.6.11tree c39ae07f39...
v2.6.11-treetree c39ae07f39...
v2.6.12commit 9ee1c939d1...
v2.6.12-rc2commit 1da177e4c3...
v2.6.12-rc3commit a2755a80f4...
v2.6.12-rc4commit 88d7bd8cb9...
v2.6.12-rc5commit 2a24ab628a...
v2.6.12-rc6commit 7cef5677ef...
v2.6.13-rc1commit 4c91aedb75...
v2.6.13-rc2commit a18bcb7450...
v2.6.13-rc3commit c32511e271...
TR(-EINVAL); } else if (init_attr->cap.max_send_wr > 255) { ehca_err(pd->device, "Invalid Number of " "max_send_wr=%x for UD QP_TYPE=%x", init_attr->cap.max_send_wr, qp_type); atomic_dec(&shca->num_qps); return ERR_PTR(-EINVAL); } break; default: ehca_err(pd->device, "unsupported LL QP Type=%x", qp_type); atomic_dec(&shca->num_qps); return ERR_PTR(-EINVAL); } } else { int max_sge = (qp_type == IB_QPT_UD || qp_type == IB_QPT_SMI || qp_type == IB_QPT_GSI) ? 250 : 252; if (init_attr->cap.max_send_sge > max_sge || init_attr->cap.max_recv_sge > max_sge) { ehca_err(pd->device, "Invalid number of SGEs requested " "send_sge=%x recv_sge=%x max_sge=%x", init_attr->cap.max_send_sge, init_attr->cap.max_recv_sge, max_sge); atomic_dec(&shca->num_qps); return ERR_PTR(-EINVAL); } } if (pd->uobject && udata) context = pd->uobject->context; my_qp = kmem_cache_zalloc(qp_cache, GFP_KERNEL); if (!my_qp) { ehca_err(pd->device, "pd=%p not enough memory to alloc qp", pd); atomic_dec(&shca->num_qps); return ERR_PTR(-ENOMEM); } atomic_set(&my_qp->nr_events, 0); init_waitqueue_head(&my_qp->wait_completion); spin_lock_init(&my_qp->spinlock_s); spin_lock_init(&my_qp->spinlock_r); my_qp->qp_type = qp_type; my_qp->ext_type = parms.ext_type; my_qp->state = IB_QPS_RESET; if (init_attr->recv_cq) my_qp->recv_cq = container_of(init_attr->recv_cq, struct ehca_cq, ib_cq); if (init_attr->send_cq) my_qp->send_cq = container_of(init_attr->send_cq, struct ehca_cq, ib_cq); do { if (!idr_pre_get(&ehca_qp_idr, GFP_KERNEL)) { ret = -ENOMEM; ehca_err(pd->device, "Can't reserve idr resources."); goto create_qp_exit0; } write_lock_irqsave(&ehca_qp_idr_lock, flags); ret = idr_get_new(&ehca_qp_idr, my_qp, &my_qp->token); write_unlock_irqrestore(&ehca_qp_idr_lock, flags); } while (ret == -EAGAIN); if (ret) { ret = -ENOMEM; ehca_err(pd->device, "Can't allocate new idr entry."); goto create_qp_exit0; } if (my_qp->token > 0x1FFFFFF) { ret = -EINVAL; ehca_err(pd->device, "Invalid number of qp"); goto create_qp_exit1; } if (has_srq) parms.srq_token = my_qp->token; parms.servicetype = ibqptype2servicetype(qp_type); if (parms.servicetype < 0) { ret = -EINVAL; ehca_err(pd->device, "Invalid qp_type=%x", qp_type); goto create_qp_exit1; } /* Always signal by WQE so we can hide circ. WQEs */ parms.sigtype = HCALL_SIGT_BY_WQE; /* UD_AV CIRCUMVENTION */ max_send_sge = init_attr->cap.max_send_sge; max_recv_sge = init_attr->cap.max_recv_sge; if (parms.servicetype == ST_UD && !is_llqp) { max_send_sge += 2; max_recv_sge += 2; } parms.token = my_qp->token; parms.eq_handle = shca->eq.ipz_eq_handle; parms.pd = my_pd->fw_pd; if (my_qp->send_cq) parms.send_cq_handle = my_qp->send_cq->ipz_cq_handle; if (my_qp->recv_cq) parms.recv_cq_handle = my_qp->recv_cq->ipz_cq_handle; parms.squeue.max_wr = init_attr->cap.max_send_wr; parms.rqueue.max_wr = init_attr->cap.max_recv_wr; parms.squeue.max_sge = max_send_sge; parms.rqueue.max_sge = max_recv_sge; /* RC QPs need one more SWQE for unsolicited ack circumvention */ if (qp_type == IB_QPT_RC) parms.squeue.max_wr++; if (EHCA_BMASK_GET(HCA_CAP_MINI_QP, shca->hca_cap)) { if (HAS_SQ(my_qp)) ehca_determine_small_queue( &parms.squeue, max_send_sge, is_llqp); if (HAS_RQ(my_qp)) ehca_determine_small_queue( &parms.rqueue, max_recv_sge, is_llqp); parms.qp_storage = (parms.squeue.is_small || parms.rqueue.is_small); } h_ret = hipz_h_alloc_resource_qp(shca->ipz_hca_handle, &parms); if (h_ret != H_SUCCESS) { ehca_err(pd->device, "h_alloc_resource_qp() failed h_ret=%li", h_ret); ret = ehca2ib_return_code(h_ret); goto create_qp_exit1; } ib_qp_num = my_qp->real_qp_num = parms.real_qp_num; my_qp->ipz_qp_handle = parms.qp_handle; my_qp->galpas = parms.galpas; swqe_size = ehca_calc_wqe_size(parms.squeue.act_nr_sges, is_llqp); rwqe_size = ehca_calc_wqe_size(parms.rqueue.act_nr_sges, is_llqp); switch (qp_type) { case IB_QPT_RC: if (is_llqp) { parms.squeue.act_nr_sges = 1; parms.rqueue.act_nr_sges = 1; } /* hide the extra WQE */ parms.squeue.act_nr_wqes--; break; case IB_QPT_UD: case IB_QPT_GSI: case IB_QPT_SMI: /* UD circumvention */ if (is_llqp) { parms.squeue.act_nr_sges = 1; parms.rqueue.act_nr_sges = 1; } else { parms.squeue.act_nr_sges -= 2; parms.rqueue.act_nr_sges -= 2; } if (IB_QPT_GSI == qp_type || IB_QPT_SMI == qp_type) { parms.squeue.act_nr_wqes = init_attr->cap.max_send_wr; parms.rqueue.act_nr_wqes = init_attr->cap.max_recv_wr; parms.squeue.act_nr_sges = init_attr->cap.max_send_sge; parms.rqueue.act_nr_sges = init_attr->cap.max_recv_sge; ib_qp_num = (qp_type == IB_QPT_SMI) ? 0 : 1; } break; default: break; } /* initialize r/squeue and register queue pages */ if (HAS_SQ(my_qp)) { ret = init_qp_queue( shca, my_pd, my_qp, &my_qp->ipz_squeue, 0, HAS_RQ(my_qp) ? H_PAGE_REGISTERED : H_SUCCESS, &parms.squeue, swqe_size); if (ret) { ehca_err(pd->device, "Couldn't initialize squeue " "and pages ret=%i", ret); goto create_qp_exit2; } } if (HAS_RQ(my_qp)) { ret = init_qp_queue( shca, my_pd, my_qp, &my_qp->ipz_rqueue, 1, H_SUCCESS, &parms.rqueue, rwqe_size); if (ret) { ehca_err(pd->device, "Couldn't initialize rqueue " "and pages ret=%i", ret); goto create_qp_exit3; } } if (is_srq) { my_qp->ib_srq.pd = &my_pd->ib_pd; my_qp->ib_srq.device = my_pd->ib_pd.device; my_qp->ib_srq.srq_context = init_attr->qp_context; my_qp->ib_srq.event_handler = init_attr->event_handler; } else { my_qp->ib_qp.qp_num = ib_qp_num; my_qp->ib_qp.pd = &my_pd->ib_pd; my_qp->ib_qp.device = my_pd->ib_pd.device; my_qp->ib_qp.recv_cq = init_attr->recv_cq; my_qp->ib_qp.send_cq = init_attr->send_cq; my_qp->ib_qp.qp_type = qp_type; my_qp->ib_qp.srq = init_attr->srq; my_qp->ib_qp.qp_context = init_attr->qp_context; my_qp->ib_qp.event_handler = init_attr->event_handler; } init_attr->cap.max_inline_data = 0; /* not supported yet */ init_attr->cap.max_recv_sge = parms.rqueue.act_nr_sges; init_attr->cap.max_recv_wr = parms.rqueue.act_nr_wqes; init_attr->cap.max_send_sge = parms.squeue.act_nr_sges; init_attr->cap.max_send_wr = parms.squeue.act_nr_wqes; my_qp->init_attr = *init_attr; if (qp_type == IB_QPT_SMI || qp_type == IB_QPT_GSI) { shca->sport[init_attr->port_num - 1].ibqp_sqp[qp_type] = &my_qp->ib_qp; if (ehca_nr_ports < 0) { /* alloc array to cache subsequent modify qp parms * for autodetect mode */ my_qp->mod_qp_parm = kzalloc(EHCA_MOD_QP_PARM_MAX * sizeof(*my_qp->mod_qp_parm), GFP_KERNEL); if (!my_qp->mod_qp_parm) { ehca_err(pd->device, "Could not alloc mod_qp_parm"); goto create_qp_exit4; } } } /* NOTE: define_apq0() not supported yet */ if (qp_type == IB_QPT_GSI) { h_ret = ehca_define_sqp(shca, my_qp, init_attr); if (h_ret != H_SUCCESS) { ret = ehca2ib_return_code(h_ret); goto create_qp_exit5; } } if (my_qp->send_cq) { ret = ehca_cq_assign_qp(my_qp->send_cq, my_qp); if (ret) { ehca_err(pd->device, "Couldn't assign qp to send_cq ret=%i", ret); goto create_qp_exit5; } } /* copy queues, galpa data to user space */ if (context && udata) { struct ehca_create_qp_resp resp; memset(&resp, 0, sizeof(resp)); resp.qp_num = my_qp->real_qp_num; resp.token = my_qp->token; resp.qp_type = my_qp->qp_type; resp.ext_type = my_qp->ext_type; resp.qkey = my_qp->qkey; resp.real_qp_num = my_qp->real_qp_num; if (HAS_SQ(my_qp)) queue2resp(&resp.ipz_squeue, &my_qp->ipz_squeue); if (HAS_RQ(my_qp)) queue2resp(&resp.ipz_rqueue, &my_qp->ipz_rqueue); resp.fw_handle_ofs = (u32) (my_qp->galpas.user.fw_handle & (PAGE_SIZE - 1)); if (ib_copy_to_udata(udata, &resp, sizeof resp)) { ehca_err(pd->device, "Copy to udata failed"); ret = -EINVAL; goto create_qp_exit6; } } return my_qp; create_qp_exit6: ehca_cq_unassign_qp(my_qp->send_cq, my_qp->real_qp_num); create_qp_exit5: kfree(my_qp->mod_qp_parm); create_qp_exit4: if (HAS_RQ(my_qp)) ipz_queue_dtor(my_pd, &my_qp->ipz_rqueue); create_qp_exit3: if (HAS_SQ(my_qp)) ipz_queue_dtor(my_pd, &my_qp->ipz_squeue); create_qp_exit2: hipz_h_destroy_qp(shca->ipz_hca_handle, my_qp); create_qp_exit1: write_lock_irqsave(&ehca_qp_idr_lock, flags); idr_remove(&ehca_qp_idr, my_qp->token); write_unlock_irqrestore(&ehca_qp_idr_lock, flags); create_qp_exit0: kmem_cache_free(qp_cache, my_qp); atomic_dec(&shca->num_qps); return ERR_PTR(ret); } struct ib_qp *ehca_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *qp_init_attr, struct ib_udata *udata) { struct ehca_qp *ret; ret = internal_create_qp(pd, qp_init_attr, NULL, udata, 0); return IS_ERR(ret) ? (struct ib_qp *)ret : &ret->ib_qp; } static int internal_destroy_qp(struct ib_device *dev, struct ehca_qp *my_qp, struct ib_uobject *uobject); struct ib_srq *ehca_create_srq(struct ib_pd *pd, struct ib_srq_init_attr *srq_init_attr, struct ib_udata *udata) { struct ib_qp_init_attr qp_init_attr; struct ehca_qp *my_qp; struct ib_srq *ret; struct ehca_shca *shca = container_of(pd->device, struct ehca_shca, ib_device); struct hcp_modify_qp_control_block *mqpcb; u64 hret, update_mask; /* For common attributes, internal_create_qp() takes its info * out of qp_init_attr, so copy all common attrs there. */ memset(&qp_init_attr, 0, sizeof(qp_init_attr)); qp_init_attr.event_handler = srq_init_attr->event_handler; qp_init_attr.qp_context = srq_init_attr->srq_context; qp_init_attr.sq_sig_type = IB_SIGNAL_ALL_WR; qp_init_attr.qp_type = IB_QPT_RC; qp_init_attr.cap.max_recv_wr = srq_init_attr->attr.max_wr; qp_init_attr.cap.max_recv_sge = srq_init_attr->attr.max_sge; my_qp = internal_create_qp(pd, &qp_init_attr, srq_init_attr, udata, 1); if (IS_ERR(my_qp)) return (struct ib_srq *)my_qp; /* copy back return values */ srq_init_attr->attr.max_wr = qp_init_attr.cap.max_recv_wr; srq_init_attr->attr.max_sge = 3; /* drive SRQ into RTR state */ mqpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL); if (!mqpcb) { ehca_err(pd->device, "Could not get zeroed page for mqpcb " "ehca_qp=%p qp_num=%x ", my_qp, my_qp->real_qp_num); ret = ERR_PTR(-ENOMEM); goto create_srq1; } mqpcb->qp_state = EHCA_QPS_INIT; mqpcb->prim_phys_port = 1; update_mask = EHCA_BMASK_SET(MQPCB_MASK_QP_STATE, 1); hret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle, &my_qp->pf, update_mask, mqpcb, my_qp->galpas.kernel); if (hret != H_SUCCESS) { ehca_err(pd->device, "Could not modify SRQ to INIT " "ehca_qp=%p qp_num=%x h_ret=%li", my_qp, my_qp->real_qp_num, hret); goto create_srq2; } mqpcb->qp_enable = 1; update_mask = EHCA_BMASK_SET(MQPCB_MASK_QP_ENABLE, 1); hret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle, &my_qp->pf, update_mask, mqpcb, my_qp->galpas.kernel); if (hret != H_SUCCESS) { ehca_err(pd->device, "Could not enable SRQ " "ehca_qp=%p qp_num=%x h_ret=%li", my_qp, my_qp->real_qp_num, hret); goto create_srq2; } mqpcb->qp_state = EHCA_QPS_RTR; update_mask = EHCA_BMASK_SET(MQPCB_MASK_QP_STATE, 1); hret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle, &my_qp->pf, update_mask, mqpcb, my_qp->galpas.kernel); if (hret != H_SUCCESS) { ehca_err(pd->device, "Could not modify SRQ to RTR " "ehca_qp=%p qp_num=%x h_ret=%li", my_qp, my_qp->real_qp_num, hret); goto create_srq2; } ehca_free_fw_ctrlblock(mqpcb); return &my_qp->ib_srq; create_srq2: ret = ERR_PTR(ehca2ib_return_code(hret)); ehca_free_fw_ctrlblock(mqpcb); create_srq1: internal_destroy_qp(pd->device, my_qp, my_qp->ib_srq.uobject); return ret; } /* * prepare_sqe_rts called by internal_modify_qp() at trans sqe -> rts * set purge bit of bad wqe and subsequent wqes to avoid reentering sqe * returns total number of bad wqes in bad_wqe_cnt */ static int prepare_sqe_rts(struct ehca_qp *my_qp, struct ehca_shca *shca, int *bad_wqe_cnt) { u64 h_ret; struct ipz_queue *squeue; void *bad_send_wqe_p, *bad_send_wqe_v; u64 q_ofs; struct ehca_wqe *wqe; int qp_num = my_qp->ib_qp.qp_num; /* get send wqe pointer */ h_ret = hipz_h_disable_and_get_wqe(shca->ipz_hca_handle, my_qp->ipz_qp_handle, &my_qp->pf, &bad_send_wqe_p, NULL, 2); if (h_ret != H_SUCCESS) { ehca_err(&shca->ib_device, "hipz_h_disable_and_get_wqe() failed" " ehca_qp=%p qp_num=%x h_ret=%li", my_qp, qp_num, h_ret); return ehca2ib_return_code(h_ret); } bad_send_wqe_p = (void *)((u64)bad_send_wqe_p & (~(1L << 63))); ehca_dbg(&shca->ib_device, "qp_num=%x bad_send_wqe_p=%p", qp_num, bad_send_wqe_p); /* convert wqe pointer to vadr */ bad_send_wqe_v = abs_to_virt((u64)bad_send_wqe_p); if (ehca_debug_level >= 2) ehca_dmp(bad_send_wqe_v, 32, "qp_num=%x bad_wqe", qp_num); squeue = &my_qp->ipz_squeue; if (ipz_queue_abs_to_offset(squeue, (u64)bad_send_wqe_p, &q_ofs)) { ehca_err(&shca->ib_device, "failed to get wqe offset qp_num=%x" " bad_send_wqe_p=%p", qp_num, bad_send_wqe_p); return -EFAULT; } /* loop sets wqe's purge bit */ wqe = (struct ehca_wqe *)ipz_qeit_calc(squeue, q_ofs); *bad_wqe_cnt = 0; while (wqe->optype != 0xff && wqe->wqef != 0xff) { if (ehca_debug_level >= 2) ehca_dmp(wqe, 32, "qp_num=%x wqe", qp_num); wqe->nr_of_data_seg = 0; /* suppress data access */ wqe->wqef = WQEF_PURGE; /* WQE to be purged */ q_ofs = ipz_queue_advance_offset(squeue, q_ofs); wqe = (struct ehca_wqe *)ipz_qeit_calc(squeue, q_ofs); *bad_wqe_cnt = (*bad_wqe_cnt)+1; } /* * bad wqe will be reprocessed and ignored when pol_cq() is called, * i.e. nr of wqes with flush error status is one less */ ehca_dbg(&shca->ib_device, "qp_num=%x flusherr_wqe_cnt=%x", qp_num, (*bad_wqe_cnt)-1); wqe->wqef = 0; return 0; } /* * internal_modify_qp with circumvention to handle aqp0 properly * smi_reset2init indicates if this is an internal reset-to-init-call for * smi. This flag must always be zero if called from ehca_modify_qp()! * This internal func was intorduced to avoid recursion of ehca_modify_qp()! */ static int internal_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask, int smi_reset2init) { enum ib_qp_state qp_cur_state, qp_new_state; int cnt, qp_attr_idx, ret = 0; enum ib_qp_statetrans statetrans; struct hcp_modify_qp_control_block *mqpcb; struct ehca_qp *my_qp = container_of(ibqp, struct ehca_qp, ib_qp); struct ehca_shca *shca = container_of(ibqp->pd->device, struct ehca_shca, ib_device); u64 update_mask; u64 h_ret; int bad_wqe_cnt = 0; int squeue_locked = 0; unsigned long flags = 0; /* do query_qp to obtain current attr values */ mqpcb = ehca_alloc_fw_ctrlblock(GFP_ATOMIC); if (!mqpcb) { ehca_err(ibqp->device, "Could not get zeroed page for mqpcb " "ehca_qp=%p qp_num=%x ", my_qp, ibqp->qp_num); return -ENOMEM; } h_ret = hipz_h_query_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle, &my_qp->pf, mqpcb, my_qp->galpas.kernel); if (h_ret != H_SUCCESS) { ehca_err(ibqp->device, "hipz_h_query_qp() failed " "ehca_qp=%p qp_num=%x h_ret=%li", my_qp, ibqp->qp_num, h_ret); ret = ehca2ib_return_code(h_ret); goto modify_qp_exit1; } qp_cur_state = ehca2ib_qp_state(mqpcb->qp_state); if (qp_cur_state == -EINVAL) { /* invalid qp state */ ret = -EINVAL; ehca_err(ibqp->device, "Invalid current ehca_qp_state=%x " "ehca_qp=%p qp_num=%x", mqpcb->qp_state, my_qp, ibqp->qp_num); goto modify_qp_exit1; } /* * circumvention to set aqp0 initial state to init * as expected by IB spec */ if (smi_reset2init == 0 && ibqp->qp_type == IB_QPT_SMI && qp_cur_state == IB_QPS_RESET && (attr_mask & IB_QP_STATE) && attr->qp_state == IB_QPS_INIT) { /* RESET -> INIT */ struct ib_qp_attr smiqp_attr = { .qp_state = IB_QPS_INIT, .port_num = my_qp->init_attr.port_num, .pkey_index = 0, .qkey = 0 }; int smiqp_attr_mask = IB_QP_STATE | IB_QP_PORT | IB_QP_PKEY_INDEX | IB_QP_QKEY; int smirc = internal_modify_qp( ibqp, &smiqp_attr, smiqp_attr_mask, 1); if (smirc) { ehca_err(ibqp->device, "SMI RESET -> INIT failed. " "ehca_modify_qp() rc=%i", smirc); ret = H_PARAMETER; goto modify_qp_exit1; } qp_cur_state = IB_QPS_INIT; ehca_dbg(ibqp->device, "SMI RESET -> INIT succeeded"); } /* is transmitted current state equal to "real" current state */ if ((attr_mask & IB_QP_CUR_STATE) && qp_cur_state != attr->cur_qp_state) { ret = -EINVAL; ehca_err(ibqp->device, "Invalid IB_QP_CUR_STATE attr->curr_qp_state=%x <>" " actual cur_qp_state=%x. ehca_qp=%p qp_num=%x", attr->cur_qp_state, qp_cur_state, my_qp, ibqp->qp_num); goto modify_qp_exit1; } ehca_dbg(ibqp->device, "ehca_qp=%p qp_num=%x current qp_state=%x " "new qp_state=%x attribute_mask=%x", my_qp, ibqp->qp_num, qp_cur_state, attr->qp_state, attr_mask); qp_new_state = attr_mask & IB_QP_STATE ? attr->qp_state : qp_cur_state; if (!smi_reset2init && !ib_modify_qp_is_ok(qp_cur_state, qp_new_state, ibqp->qp_type, attr_mask)) { ret = -EINVAL; ehca_err(ibqp->device, "Invalid qp transition new_state=%x cur_state=%x " "ehca_qp=%p qp_num=%x attr_mask=%x", qp_new_state, qp_cur_state, my_qp, ibqp->qp_num, attr_mask); goto modify_qp_exit1; } mqpcb->qp_state = ib2ehca_qp_state(qp_new_state); if (mqpcb->qp_state) update_mask = EHCA_BMASK_SET(MQPCB_MASK_QP_STATE, 1); else { ret = -EINVAL; ehca_err(ibqp->device, "Invalid new qp state=%x " "ehca_qp=%p qp_num=%x", qp_new_state, my_qp, ibqp->qp_num); goto modify_qp_exit1; } /* retrieve state transition struct to get req and opt attrs */ statetrans = get_modqp_statetrans(qp_cur_state, qp_new_state); if (statetrans < 0) { ret = -EINVAL; ehca_err(ibqp->device, "<INVALID STATE CHANGE> qp_cur_state=%x " "new_qp_state=%x State_xsition=%x ehca_qp=%p " "qp_num=%x", qp_cur_state, qp_new_state, statetrans, my_qp, ibqp->qp_num); goto modify_qp_exit1; } qp_attr_idx = ib2ehcaqptype(ibqp->qp_type); if (qp_attr_idx < 0) { ret = qp_attr_idx; ehca_err(ibqp->device, "Invalid QP type=%x ehca_qp=%p qp_num=%x", ibqp->qp_type, my_qp, ibqp->qp_num); goto modify_qp_exit1; } ehca_dbg(ibqp->device, "ehca_qp=%p qp_num=%x <VALID STATE CHANGE> qp_state_xsit=%x", my_qp, ibqp->qp_num, statetrans); /* eHCA2 rev2 and higher require the SEND_GRH_FLAG to be set * in non-LL UD QPs. */ if ((my_qp->qp_type == IB_QPT_UD) && (my_qp->ext_type != EQPT_LLQP) && (statetrans == IB_QPST_INIT2RTR) && (shca->hw_level >= 0x22)) { update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SEND_GRH_FLAG, 1); mqpcb->send_grh_flag = 1; } /* sqe -> rts: set purge bit of bad wqe before actual trans */ if ((my_qp->qp_type == IB_QPT_UD || my_qp->qp_type == IB_QPT_GSI || my_qp->qp_type == IB_QPT_SMI) && statetrans == IB_QPST_SQE2RTS) { /* mark next free wqe if kernel */ if (!ibqp->uobject) { struct ehca_wqe *wqe; /* lock send queue */ spin_lock_irqsave(&my_qp->spinlock_s, flags); squeue_locked = 1; /* mark next free wqe */ wqe = (struct ehca_wqe *) ipz_qeit_get(&my_qp->ipz_squeue); wqe->optype = wqe->wqef = 0xff; ehca_dbg(ibqp->device, "qp_num=%x next_free_wqe=%p", ibqp->qp_num, wqe); } ret = prepare_sqe_rts(my_qp, shca, &bad_wqe_cnt); if (ret) { ehca_err(ibqp->device, "prepare_sqe_rts() failed " "ehca_qp=%p qp_num=%x ret=%i", my_qp, ibqp->qp_num, ret); goto modify_qp_exit2; } } /* * enable RDMA_Atomic_Control if reset->init und reliable con * this is necessary since gen2 does not provide that flag, * but pHyp requires it */ if (statetrans == IB_QPST_RESET2INIT && (ibqp->qp_type == IB_QPT_RC || ibqp->qp_type == IB_QPT_UC)) { mqpcb->rdma_atomic_ctrl = 3; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_RDMA_ATOMIC_CTRL, 1); } /* circ. pHyp requires #RDMA/Atomic Resp Res for UC INIT -> RTR */ if (statetrans == IB_QPST_INIT2RTR && (ibqp->qp_type == IB_QPT_UC) && !(attr_mask & IB_QP_MAX_DEST_RD_ATOMIC)) { mqpcb->rdma_nr_atomic_resp_res = 1; /* default to 1 */ update_mask |= EHCA_BMASK_SET(MQPCB_MASK_RDMA_NR_ATOMIC_RESP_RES, 1); } if (attr_mask & IB_QP_PKEY_INDEX) { if (attr->pkey_index >= 16) { ret = -EINVAL; ehca_err(ibqp->device, "Invalid pkey_index=%x. " "ehca_qp=%p qp_num=%x max_pkey_index=f", attr->pkey_index, my_qp, ibqp->qp_num); goto modify_qp_exit2; } mqpcb->prim_p_key_idx = attr->pkey_index; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_PRIM_P_KEY_IDX, 1); } if (attr_mask & IB_QP_PORT) { struct ehca_sport *sport; struct ehca_qp *aqp1; if (attr->port_num < 1 || attr->port_num > shca->num_ports) { ret = -EINVAL; ehca_err(ibqp->device, "Invalid port=%x. " "ehca_qp=%p qp_num=%x num_ports=%x", attr->port_num, my_qp, ibqp->qp_num, shca->num_ports); goto modify_qp_exit2; } sport = &shca->sport[attr->port_num - 1]; if (!sport->ibqp_sqp[IB_QPT_GSI]) { /* should not occur */ ret = -EFAULT; ehca_err(ibqp->device, "AQP1 was not created for " "port=%x", attr->port_num); goto modify_qp_exit2; } aqp1 = container_of(sport->ibqp_sqp[IB_QPT_GSI], struct ehca_qp, ib_qp); if (ibqp->qp_type != IB_QPT_GSI && ibqp->qp_type != IB_QPT_SMI && aqp1->mod_qp_parm) { /* * firmware will reject this modify_qp() because * port is not activated/initialized fully */ ret = -EFAULT; ehca_warn(ibqp->device, "Couldn't modify qp port=%x: " "either port is being activated (try again) " "or cabling issue", attr->port_num); goto modify_qp_exit2; } mqpcb->prim_phys_port = attr->port_num; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_PRIM_PHYS_PORT, 1); } if (attr_mask & IB_QP_QKEY) { mqpcb->qkey = attr->qkey; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_QKEY, 1); } if (attr_mask & IB_QP_AV) { mqpcb->dlid = attr->ah_attr.dlid; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_DLID, 1); mqpcb->source_path_bits = attr->ah_attr.src_path_bits; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SOURCE_PATH_BITS, 1); mqpcb->service_level = attr->ah_attr.sl; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SERVICE_LEVEL, 1); if (ehca_calc_ipd(shca, mqpcb->prim_phys_port, attr->ah_attr.static_rate, &mqpcb->max_static_rate)) { ret = -EINVAL; goto modify_qp_exit2; } update_mask |= EHCA_BMASK_SET(MQPCB_MASK_MAX_STATIC_RATE, 1); /* * Always supply the GRH flag, even if it's zero, to give the * hypervisor a clear "yes" or "no" instead of a "perhaps" */ update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SEND_GRH_FLAG, 1); /* * only if GRH is TRUE we might consider SOURCE_GID_IDX * and DEST_GID otherwise phype will return H_ATTR_PARM!!! */ if (attr->ah_attr.ah_flags == IB_AH_GRH) { mqpcb->send_grh_flag = 1; mqpcb->source_gid_idx = attr->ah_attr.grh.sgid_index; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SOURCE_GID_IDX, 1); for (cnt = 0; cnt < 16; cnt++) mqpcb->dest_gid.byte[cnt] = attr->ah_attr.grh.dgid.raw[cnt]; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_DEST_GID, 1); mqpcb->flow_label = attr->ah_attr.grh.flow_label; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_FLOW_LABEL, 1); mqpcb->hop_limit = attr->ah_attr.grh.hop_limit; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_HOP_LIMIT, 1); mqpcb->traffic_class = attr->ah_attr.grh.traffic_class; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_TRAFFIC_CLASS, 1); } } if (attr_mask & IB_QP_PATH_MTU) { /* store ld(MTU) */ my_qp->mtu_shift = attr->path_mtu + 7; mqpcb->path_mtu = attr->path_mtu; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_PATH_MTU, 1); } if (attr_mask & IB_QP_TIMEOUT) { mqpcb->timeout = attr->timeout; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_TIMEOUT, 1); } if (attr_mask & IB_QP_RETRY_CNT) { mqpcb->retry_count = attr->retry_cnt; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_RETRY_COUNT, 1); } if (attr_mask & IB_QP_RNR_RETRY) { mqpcb->rnr_retry_count = attr->rnr_retry; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_RNR_RETRY_COUNT, 1); } if (attr_mask & IB_QP_RQ_PSN) { mqpcb->receive_psn = attr->rq_psn; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_RECEIVE_PSN, 1); } if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) { mqpcb->rdma_nr_atomic_resp_res = attr->max_dest_rd_atomic < 3 ? attr->max_dest_rd_atomic : 2; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_RDMA_NR_ATOMIC_RESP_RES, 1); } if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC) { mqpcb->rdma_atomic_outst_dest_qp = attr->max_rd_atomic < 3 ? attr->max_rd_atomic : 2; update_mask |= EHCA_BMASK_SET (MQPCB_MASK_RDMA_ATOMIC_OUTST_DEST_QP, 1); } if (attr_mask & IB_QP_ALT_PATH) { if (attr->alt_port_num < 1 || attr->alt_port_num > shca->num_ports) { ret = -EINVAL; ehca_err(ibqp->device, "Invalid alt_port=%x. " "ehca_qp=%p qp_num=%x num_ports=%x", attr->alt_port_num, my_qp, ibqp->qp_num, shca->num_ports); goto modify_qp_exit2; } mqpcb->alt_phys_port = attr->alt_port_num; if (attr->alt_pkey_index >= 16) { ret = -EINVAL; ehca_err(ibqp->device, "Invalid alt_pkey_index=%x. " "ehca_qp=%p qp_num=%x max_pkey_index=f", attr->pkey_index, my_qp, ibqp->qp_num); goto modify_qp_exit2; } mqpcb->alt_p_key_idx = attr->alt_pkey_index; mqpcb->timeout_al = attr->alt_timeout; mqpcb->dlid_al = attr->alt_ah_attr.dlid; mqpcb->source_path_bits_al = attr->alt_ah_attr.src_path_bits; mqpcb->service_level_al = attr->alt_ah_attr.sl; if (ehca_calc_ipd(shca, mqpcb->alt_phys_port, attr->alt_ah_attr.static_rate, &mqpcb->max_static_rate_al)) { ret = -EINVAL; goto modify_qp_exit2; } /* OpenIB doesn't support alternate retry counts - copy them */ mqpcb->retry_count_al = mqpcb->retry_count; mqpcb->rnr_retry_count_al = mqpcb->rnr_retry_count; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_ALT_PHYS_PORT, 1) | EHCA_BMASK_SET(MQPCB_MASK_ALT_P_KEY_IDX, 1) | EHCA_BMASK_SET(MQPCB_MASK_TIMEOUT_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_DLID_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_SOURCE_PATH_BITS_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_SERVICE_LEVEL_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_MAX_STATIC_RATE_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_RETRY_COUNT_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_RNR_RETRY_COUNT_AL, 1); /* * Always supply the GRH flag, even if it's zero, to give the * hypervisor a clear "yes" or "no" instead of a "perhaps" */ update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SEND_GRH_FLAG_AL, 1); /* * only if GRH is TRUE we might consider SOURCE_GID_IDX * and DEST_GID otherwise phype will return H_ATTR_PARM!!! */ if (attr->alt_ah_attr.ah_flags == IB_AH_GRH) { mqpcb->send_grh_flag_al = 1; for (cnt = 0; cnt < 16; cnt++) mqpcb->dest_gid_al.byte[cnt] = attr->alt_ah_attr.grh.dgid.raw[cnt]; mqpcb->source_gid_idx_al = attr->alt_ah_attr.grh.sgid_index; mqpcb->flow_label_al = attr->alt_ah_attr.grh.flow_label; mqpcb->hop_limit_al = attr->alt_ah_attr.grh.hop_limit; mqpcb->traffic_class_al = attr->alt_ah_attr.grh.traffic_class; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SOURCE_GID_IDX_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_DEST_GID_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_FLOW_LABEL_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_HOP_LIMIT_AL, 1) | EHCA_BMASK_SET(MQPCB_MASK_TRAFFIC_CLASS_AL, 1); } } if (attr_mask & IB_QP_MIN_RNR_TIMER) { mqpcb->min_rnr_nak_timer_field = attr->min_rnr_timer; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_MIN_RNR_NAK_TIMER_FIELD, 1); } if (attr_mask & IB_QP_SQ_PSN) { mqpcb->send_psn = attr->sq_psn; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SEND_PSN, 1); } if (attr_mask & IB_QP_DEST_QPN) { mqpcb->dest_qp_nr = attr->dest_qp_num; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_DEST_QP_NR, 1); } if (attr_mask & IB_QP_PATH_MIG_STATE) { if (attr->path_mig_state != IB_MIG_REARM && attr->path_mig_state != IB_MIG_MIGRATED) { ret = -EINVAL; ehca_err(ibqp->device, "Invalid mig_state=%x", attr->path_mig_state); goto modify_qp_exit2; } mqpcb->path_migration_state = attr->path_mig_state + 1; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_PATH_MIGRATION_STATE, 1); } if (attr_mask & IB_QP_CAP) { mqpcb->max_nr_outst_send_wr = attr->cap.max_send_wr+1; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_MAX_NR_OUTST_SEND_WR, 1); mqpcb->max_nr_outst_recv_wr = attr->cap.max_recv_wr+1; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_MAX_NR_OUTST_RECV_WR, 1); /* no support for max_send/recv_sge yet */ } if (ehca_debug_level >= 2) ehca_dmp(mqpcb, 4*70, "qp_num=%x", ibqp->qp_num); h_ret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle, &my_qp->pf, update_mask, mqpcb, my_qp->galpas.kernel); if (h_ret != H_SUCCESS) { ret = ehca2ib_return_code(h_ret); ehca_err(ibqp->device, "hipz_h_modify_qp() failed h_ret=%li " "ehca_qp=%p qp_num=%x", h_ret, my_qp, ibqp->qp_num); goto modify_qp_exit2; } if ((my_qp->qp_type == IB_QPT_UD || my_qp->qp_type == IB_QPT_GSI || my_qp->qp_type == IB_QPT_SMI) && statetrans == IB_QPST_SQE2RTS) { /* doorbell to reprocessing wqes */ iosync(); /* serialize GAL register access */ hipz_update_sqa(my_qp, bad_wqe_cnt-1); ehca_gen_dbg("doorbell for %x wqes", bad_wqe_cnt); } if (statetrans == IB_QPST_RESET2INIT || statetrans == IB_QPST_INIT2INIT) { mqpcb->qp_enable = 1; mqpcb->qp_state = EHCA_QPS_INIT; update_mask = 0; update_mask = EHCA_BMASK_SET(MQPCB_MASK_QP_ENABLE, 1); h_ret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle, &my_qp->pf, update_mask, mqpcb, my_qp->galpas.kernel); if (h_ret != H_SUCCESS) { ret = ehca2ib_return_code(h_ret); ehca_err(ibqp->device, "ENABLE in context of " "RESET_2_INIT failed! Maybe you didn't get " "a LID h_ret=%li ehca_qp=%p qp_num=%x", h_ret, my_qp, ibqp->qp_num); goto modify_qp_exit2; } } if (statetrans == IB_QPST_ANY2RESET) { ipz_qeit_reset(&my_qp->ipz_rqueue); ipz_qeit_reset(&my_qp->ipz_squeue); } if (attr_mask & IB_QP_QKEY) my_qp->qkey = attr->qkey; my_qp->state = qp_new_state; modify_qp_exit2: if (squeue_locked) { /* this means: sqe -> rts */ spin_unlock_irqrestore(&my_qp->spinlock_s, flags); my_qp->sqerr_purgeflag = 1; } modify_qp_exit1: ehca_free_fw_ctrlblock(mqpcb); return ret; } int ehca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask, struct ib_udata *udata) { struct ehca_shca *shca = container_of(ibqp->device, struct ehca_shca, ib_device); struct ehca_qp *my_qp = container_of(ibqp, struct ehca_qp, ib_qp); /* The if-block below caches qp_attr to be modified for GSI and SMI * qps during the initialization by ib_mad. When the respective port * is activated, ie we got an event PORT_ACTIVE, we'll replay the * cached modify calls sequence, see ehca_recover_sqs() below. * Why that is required: * 1) If one port is connected, older code requires that port one * to be connected and module option nr_ports=1 to be given by * user, which is very inconvenient for end user. * 2) Firmware accepts modify_qp() only if respective port has become * active. Older code had a wait loop of 30sec create_qp()/ * define_aqp1(), which is not appropriate in practice. This * code now removes that wait loop, see define_aqp1(), and always * reports all ports to ib_mad resp. users. Only activated ports * will then usable for the users. */ if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_SMI) { int port = my_qp->init_attr.port_num; struct ehca_sport *sport = &shca->sport[port - 1]; unsigned long flags; spin_lock_irqsave(&sport->mod_sqp_lock, flags); /* cache qp_attr only during init */ if (my_qp->mod_qp_parm) { struct ehca_mod_qp_parm *p; if (my_qp->mod_qp_parm_idx >= EHCA_MOD_QP_PARM_MAX) { ehca_err(&shca->ib_device, "mod_qp_parm overflow state=%x port=%x" " type=%x", attr->qp_state, my_qp->init_attr.port_num, ibqp->qp_type); spin_unlock_irqrestore(&sport->mod_sqp_lock, flags); return -EINVAL; } p = &my_qp->mod_qp_parm[my_qp->mod_qp_parm_idx]; p->mask = attr_mask; p->attr = *attr; my_qp->mod_qp_parm_idx++; ehca_dbg(&shca->ib_device, "Saved qp_attr for state=%x port=%x type=%x", attr->qp_state, my_qp->init_attr.port_num, ibqp->qp_type); spin_unlock_irqrestore(&sport->mod_sqp_lock, flags); return 0; } spin_unlock_irqrestore(&sport->mod_sqp_lock, flags); } return internal_modify_qp(ibqp, attr, attr_mask, 0); } void ehca_recover_sqp(struct ib_qp *sqp) { struct ehca_qp *my_sqp = container_of(sqp, struct ehca_qp, ib_qp); int port = my_sqp->init_attr.port_num; struct ib_qp_attr attr; struct ehca_mod_qp_parm *qp_parm; int i, qp_parm_idx, ret; unsigned long flags, wr_cnt; if (!my_sqp->mod_qp_parm) return; ehca_dbg(sqp->device, "SQP port=%x qp_num=%x", port, sqp->qp_num); qp_parm = my_sqp->mod_qp_parm; qp_parm_idx = my_sqp->mod_qp_parm_idx; for (i = 0; i < qp_parm_idx; i++) { attr = qp_parm[i].attr; ret = internal_modify_qp(sqp, &attr, qp_parm[i].mask, 0); if (ret) { ehca_err(sqp->device, "Could not modify SQP port=%x " "qp_num=%x ret=%x", port, sqp->qp_num, ret); goto free_qp_parm; } ehca_dbg(sqp->device, "SQP port=%x qp_num=%x in state=%x", port, sqp->qp_num, attr.qp_state); } /* re-trigger posted recv wrs */ wr_cnt = my_sqp->ipz_rqueue.current_q_offset / my_sqp->ipz_rqueue.qe_size; if (wr_cnt) { spin_lock_irqsave(&my_sqp->spinlock_r, flags); hipz_update_rqa(my_sqp, wr_cnt); spin_unlock_irqrestore(&my_sqp->spinlock_r, flags); ehca_dbg(sqp->device, "doorbell port=%x qp_num=%x wr_cnt=%lx", port, sqp->qp_num, wr_cnt); } free_qp_parm: kfree(qp_parm); /* this prevents subsequent calls to modify_qp() to cache qp_attr */ my_sqp->mod_qp_parm = NULL; } int ehca_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr, int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr) { struct ehca_qp *my_qp = container_of(qp, struct ehca_qp, ib_qp); struct ehca_shca *shca = container_of(qp->device, struct ehca_shca, ib_device); struct ipz_adapter_handle adapter_handle = shca->ipz_hca_handle; struct hcp_modify_qp_control_block *qpcb; int cnt, ret = 0; u64 h_ret; if (qp_attr_mask & QP_ATTR_QUERY_NOT_SUPPORTED) { ehca_err(qp->device, "Invalid attribute mask " "ehca_qp=%p qp_num=%x qp_attr_mask=%x ", my_qp, qp->qp_num, qp_attr_mask); return -EINVAL; } qpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL); if (!qpcb) { ehca_err(qp->device, "Out of memory for qpcb " "ehca_qp=%p qp_num=%x", my_qp, qp->qp_num); return -ENOMEM; } h_ret = hipz_h_query_qp(adapter_handle, my_qp->ipz_qp_handle, &my_qp->pf, qpcb, my_qp->galpas.kernel); if (h_ret != H_SUCCESS) { ret = ehca2ib_return_code(h_ret); ehca_err(qp->device, "hipz_h_query_qp() failed " "ehca_qp=%p qp_num=%x h_ret=%li", my_qp, qp->qp_num, h_ret); goto query_qp_exit1; } qp_attr->cur_qp_state = ehca2ib_qp_state(qpcb->qp_state); qp_attr->qp_state = qp_attr->cur_qp_state; if (qp_attr->cur_qp_state == -EINVAL) { ret = -EINVAL; ehca_err(qp->device, "Got invalid ehca_qp_state=%x " "ehca_qp=%p qp_num=%x", qpcb->qp_state, my_qp, qp->qp_num); goto query_qp_exit1; } if (qp_attr->qp_state == IB_QPS_SQD) qp_attr->sq_draining = 1; qp_attr->qkey = qpcb->qkey; qp_attr->path_mtu = qpcb->path_mtu; qp_attr->path_mig_state = qpcb->path_migration_state - 1; qp_attr->rq_psn = qpcb->receive_psn; qp_attr->sq_psn = qpcb->send_psn; qp_attr->min_rnr_timer = qpcb->min_rnr_nak_timer_field; qp_attr->cap.max_send_wr = qpcb->max_nr_outst_send_wr-1; qp_attr->cap.max_recv_wr = qpcb->max_nr_outst_recv_wr-1; /* UD_AV CIRCUMVENTION */ if (my_qp->qp_type == IB_QPT_UD) { qp_attr->cap.max_send_sge = qpcb->actual_nr_sges_in_sq_wqe - 2; qp_attr->cap.max_recv_sge = qpcb->actual_nr_sges_in_rq_wqe - 2; } else { qp_attr->cap.max_send_sge = qpcb->actual_nr_sges_in_sq_wqe; qp_attr->cap.max_recv_sge = qpcb->actual_nr_sges_in_rq_wqe; } qp_attr->cap.max_inline_data = my_qp->sq_max_inline_data_size; qp_attr->dest_qp_num = qpcb->dest_qp_nr; qp_attr->pkey_index = EHCA_BMASK_GET(MQPCB_PRIM_P_KEY_IDX, qpcb->prim_p_key_idx); qp_attr->port_num = EHCA_BMASK_GET(MQPCB_PRIM_PHYS_PORT, qpcb->prim_phys_port); qp_attr->timeout = qpcb->timeout; qp_attr->retry_cnt = qpcb->retry_count; qp_attr->rnr_retry = qpcb->rnr_retry_count; qp_attr->alt_pkey_index = EHCA_BMASK_GET(MQPCB_PRIM_P_KEY_IDX, qpcb->alt_p_key_idx); qp_attr->alt_port_num = qpcb->alt_phys_port; qp_attr->alt_timeout = qpcb->timeout_al; qp_attr->max_dest_rd_atomic = qpcb->rdma_nr_atomic_resp_res; qp_attr->max_rd_atomic = qpcb->rdma_atomic_outst_dest_qp; /* primary av */ qp_attr->ah_attr.sl = qpcb->service_level; if (qpcb->send_grh_flag) { qp_attr->ah_attr.ah_flags = IB_AH_GRH; } qp_attr->ah_attr.static_rate = qpcb->max_static_rate; qp_attr->ah_attr.dlid = qpcb->dlid; qp_attr->ah_attr.src_path_bits = qpcb->source_path_bits; qp_attr->ah_attr.port_num = qp_attr->port_num; /* primary GRH */ qp_attr->ah_attr.grh.traffic_class = qpcb->traffic_class; qp_attr->ah_attr.grh.hop_limit = qpcb->hop_limit; qp_attr->ah_attr.grh.sgid_index = qpcb->source_gid_idx; qp_attr->ah_attr.grh.flow_label = qpcb->flow_label; for (cnt = 0; cnt < 16; cnt++) qp_attr->ah_attr.grh.dgid.raw[cnt] = qpcb->dest_gid.byte[cnt]; /* alternate AV */ qp_attr->alt_ah_attr.sl = qpcb->service_level_al; if (qpcb->send_grh_flag_al) { qp_attr->alt_ah_attr.ah_flags = IB_AH_GRH; } qp_attr->alt_ah_attr.static_rate = qpcb->max_static_rate_al; qp_attr->alt_ah_attr.dlid = qpcb->dlid_al; qp_attr->alt_ah_attr.src_path_bits = qpcb->source_path_bits_al; /* alternate GRH */ qp_attr->alt_ah_attr.grh.traffic_class = qpcb->traffic_class_al; qp_attr->alt_ah_attr.grh.hop_limit = qpcb->hop_limit_al; qp_attr->alt_ah_attr.grh.sgid_index = qpcb->source_gid_idx_al; qp_attr->alt_ah_attr.grh.flow_label = qpcb->flow_label_al; for (cnt = 0; cnt < 16; cnt++) qp_attr->alt_ah_attr.grh.dgid.raw[cnt] = qpcb->dest_gid_al.byte[cnt]; /* return init attributes given in ehca_create_qp */ if (qp_init_attr) *qp_init_attr = my_qp->init_attr; if (ehca_debug_level >= 2) ehca_dmp(qpcb, 4*70, "qp_num=%x", qp->qp_num); query_qp_exit1: ehca_free_fw_ctrlblock(qpcb); return ret; } int ehca_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr, enum ib_srq_attr_mask attr_mask, struct ib_udata *udata) { struct ehca_qp *my_qp = container_of(ibsrq, struct ehca_qp, ib_srq); struct ehca_shca *shca = container_of(ibsrq->pd->device, struct ehca_shca, ib_device); struct hcp_modify_qp_control_block *mqpcb; u64 update_mask; u64 h_ret; int ret = 0; mqpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL); if (!mqpcb) { ehca_err(ibsrq->device, "Could not get zeroed page for mqpcb " "ehca_qp=%p qp_num=%x ", my_qp, my_qp->real_qp_num); return -ENOMEM; } update_mask = 0; if (attr_mask & IB_SRQ_LIMIT) { attr_mask &= ~IB_SRQ_LIMIT; update_mask |= EHCA_BMASK_SET(MQPCB_MASK_CURR_SRQ_LIMIT, 1) | EHCA_BMASK_SET(MQPCB_MASK_QP_AFF_ASYN_EV_LOG_REG, 1); mqpcb->curr_srq_limit = EHCA_BMASK_SET(MQPCB_CURR_SRQ_LIMIT, attr->srq_limit); mqpcb->qp_aff_asyn_ev_log_reg = EHCA_BMASK_SET(QPX_AAELOG_RESET_SRQ_LIMIT, 1); } /* by now, all bits in attr_mask should have been cleared */ if (attr_mask) { ehca_err(ibsrq->device, "invalid attribute mask bits set " "attr_mask=%x", attr_mask); ret = -EINVAL; goto modify_srq_exit0; } if (ehca_debug_level >= 2) ehca_dmp(mqpcb, 4*70, "qp_num=%x", my_qp->real_qp_num); h_ret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle, NULL, update_mask, mqpcb, my_qp->galpas.kernel); if (h_ret != H_SUCCESS) { ret = ehca2ib_return_code(h_ret); ehca_err(ibsrq->device, "hipz_h_modify_qp() failed h_ret=%li " "ehca_qp=%p qp_num=%x", h_ret, my_qp, my_qp->real_qp_num); } modify_srq_exit0: ehca_free_fw_ctrlblock(mqpcb); return ret; } int ehca_query_srq(struct ib_srq *srq, struct ib_srq_attr *srq_attr) { struct ehca_qp *my_qp = container_of(srq, struct ehca_qp, ib_srq); struct ehca_shca *shca = container_of(srq->device, struct ehca_shca, ib_device); struct ipz_adapter_handle adapter_handle = shca->ipz_hca_handle; struct hcp_modify_qp_control_block *qpcb; int ret = 0; u64 h_ret; qpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL); if (!qpcb) { ehca_err(srq->device, "Out of memory for qpcb " "ehca_qp=%p qp_num=%x", my_qp, my_qp->real_qp_num); return -ENOMEM; } h_ret = hipz_h_query_qp(adapter_handle, my_qp->ipz_qp_handle, NULL, qpcb, my_qp->galpas.kernel); if (h_ret != H_SUCCESS) { ret = ehca2ib_return_code(h_ret); ehca_err(srq->device, "hipz_h_query_qp() failed " "ehca_qp=%p qp_num=%x h_ret=%li", my_qp, my_qp->real_qp_num, h_ret); goto query_srq_exit1; } srq_attr->max_wr = qpcb->max_nr_outst_recv_wr - 1; srq_attr->max_sge = 3; srq_attr->srq_limit = EHCA_BMASK_GET( MQPCB_CURR_SRQ_LIMIT, qpcb->curr_srq_limit); if (ehca_debug_level >= 2) ehca_dmp(qpcb, 4*70, "qp_num=%x", my_qp->real_qp_num); query_srq_exit1: ehca_free_fw_ctrlblock(qpcb); return ret; } static int internal_destroy_qp(struct ib_device *dev, struct ehca_qp *my_qp, struct ib_uobject *uobject) { struct ehca_shca *shca = container_of(dev, struct ehca_shca, ib_device); struct ehca_pd *my_pd = container_of(my_qp->ib_qp.pd, struct ehca_pd, ib_pd); struct ehca_sport *sport = &shca->sport[my_qp->init_attr.port_num - 1]; u32 qp_num = my_qp->real_qp_num; int ret; u64 h_ret; u8 port_num; enum ib_qp_type qp_type; unsigned long flags; if (uobject) { if (my_qp->mm_count_galpa || my_qp->mm_count_rqueue || my_qp->mm_count_squeue) { ehca_err(dev, "Resources still referenced in " "user space qp_num=%x", qp_num); return -EINVAL; } } if (my_qp->send_cq) { ret = ehca_cq_unassign_qp(my_qp->send_cq, qp_num); if (ret) { ehca_err(dev, "Couldn't unassign qp from " "send_cq ret=%i qp_num=%x cq_num=%x", ret, qp_num, my_qp->send_cq->cq_number); return ret; } } write_lock_irqsave(&ehca_qp_idr_lock, flags); idr_remove(&ehca_qp_idr, my_qp->token); write_unlock_irqrestore(&ehca_qp_idr_lock, flags); /* now wait until all pending events have completed */ wait_event(my_qp->wait_completion, !atomic_read(&my_qp->nr_events)); h_ret = hipz_h_destroy_qp(shca->ipz_hca_handle, my_qp); if (h_ret != H_SUCCESS) { ehca_err(dev, "hipz_h_destroy_qp() failed h_ret=%li " "ehca_qp=%p qp_num=%x", h_ret, my_qp, qp_num); return ehca2ib_return_code(h_ret); } port_num = my_qp->init_attr.port_num; qp_type = my_qp->init_attr.qp_type; if (qp_type == IB_QPT_SMI || qp_type == IB_QPT_GSI) { spin_lock_irqsave(&sport->mod_sqp_lock, flags); kfree(my_qp->mod_qp_parm); my_qp->mod_qp_parm = NULL; shca->sport[port_num - 1].ibqp_sqp[qp_type] = NULL; spin_unlock_irqrestore(&sport->mod_sqp_lock, flags); } /* no support for IB_QPT_SMI yet */ if (qp_type == IB_QPT_GSI) { struct ib_event event; ehca_info(dev, "device %s: port %x is inactive.", shca->ib_device.name, port_num); event.device = &shca->ib_device; event.event = IB_EVENT_PORT_ERR; event.element.port_num = port_num; shca->sport[port_num - 1].port_state = IB_PORT_DOWN; ib_dispatch_event(&event); } if (HAS_RQ(my_qp)) ipz_queue_dtor(my_pd, &my_qp->ipz_rqueue); if (HAS_SQ(my_qp)) ipz_queue_dtor(my_pd, &my_qp->ipz_squeue); kmem_cache_free(qp_cache, my_qp); atomic_dec(&shca->num_qps); return 0; } int ehca_destroy_qp(struct ib_qp *qp) { return internal_destroy_qp(qp->device, container_of(qp, struct ehca_qp, ib_qp), qp->uobject); } int ehca_destroy_srq(struct ib_srq *srq) { return internal_destroy_qp(srq->device, container_of(srq, struct ehca_qp, ib_srq), srq->uobject); } int ehca_init_qp_cache(void) { qp_cache = kmem_cache_create("ehca_cache_qp", sizeof(struct ehca_qp), 0, SLAB_HWCACHE_ALIGN, NULL); if (!qp_cache) return -ENOMEM; return 0; } void ehca_cleanup_qp_cache(void) { if (qp_cache) kmem_cache_destroy(qp_cache); }