nx842_pseries_compress(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nx842_pseries_compress(9) β€” Kernel API Manual, but make it make sense

okay so bestie, welcome to the Kernel API Manual entry for nx842_pseries_compress ✨ this is the little function that squeezes your data down using the 842 algorithm, and honestly? she's iconic for it πŸŽ€


✨ NAME ✨

nx842_pseries_compress β€” compress data using the 842 algorithm πŸ—œοΈπŸ’–


🌸 SYNOPSIS 🌸

int nx842_pseries_compress (const unsigned char *in , unsigned int inlen
, unsigned char *out , unsigned int *outlen , void *wmem );

like, look at her. five arguments, one int coming back at you. slay πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • in β€” pointer to the input buffer 🌸 this is the stuff you're about to squish
  • inlen β€” length of the input buffer, i.e. how much stuff there is πŸ“
  • out β€” pointer to the output buffer, where the squeezed result goes πŸŽ€
  • outlen β€” length of the output buffer (and yeah, she gets updated on the way out, keep reading πŸ‘€)
  • wmem β€” ptr to a buffer for working memory, and its size is determined by nx842_pseries_driver.workmem_size 🧠✨ don't just make one up, check that field

πŸ”₯ DESCRIPTION πŸ”₯

so the compression here is provided by the NX842 coprocessor on IBM Power systems πŸ‘‘ like, actual hardware doing the work, not your sad little CPU. the input buffer gets compressed and the result is stored in the provided output buffer. that's the whole vibe πŸ’«

upon return from this function, outlen contains the length of the compressed data πŸ“¬ β€” so yes, she rewrites that variable, that's on purpose, that's the whole point.

⚠️ but if there's an error? outlen will be 0, and the error will be specified by the return code from this function 😭 so fr fr, check your return code, bestie. don't be out here reading stale outlen values and acting surprised.

πŸ’€ RETURN πŸ’€

okay so the return values, let's do a vibe check on each one:

  • 0 β€” success πŸŽ‰ output of length outlen is stored in the buffer at out. go off queen.
  • -ENOMEM β€” unable to allocate internal buffers 😭 out of memory, not it
  • -ENOSPC β€” output buffer is to small πŸ’€ there's literally no space left, she tried
  • -EIO β€” internal error πŸ™ˆ something went weird inside
  • -ENODEV β€” hardware unavailable 🫠 the coprocessor isn't there, so like… nothing to do

🌈 SEE ALSO 🌈

go read these next, iykwim πŸ‘€


🫢 that's the whole page, no cap. from ./drivers/crypto/nx, dated October 2026 β€” and this has been your girl nx842_pseries_compress(9), signing off. periodt. πŸ’…βœ¨
πŸ“¦ where this page comes from