Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable edonr in FreeBSD #12735

Merged
merged 1 commit into from
Nov 16, 2021
Merged

Enable edonr in FreeBSD #12735

merged 1 commit into from
Nov 16, 2021

Conversation

rincebrain
Copy link
Contributor

Motivation and Context

There's no reason to not enable it, as far as I know, so let's drop a platform difference.

Description

Dropped a lot of ifdefs, included edonr.c as a thing to stuff into openzfs.ko, removed the if linux around things in tests/

How Has This Been Tested?

$ sudo zfs get checksum mypool
NAME    PROPERTY  VALUE      SOURCE
mypool  checksum  edonr      local
$ uname -a
FreeBSD freebsd12box 12.2-RELEASE-p7 FreeBSD 12.2-RELEASE-p7 GENERIC  amd64
$

A round of enabling the feature, reading, writing, and reading with zdb to confirm it actually used it, went fine...

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@rincebrain
Copy link
Contributor Author

rincebrain commented Nov 9, 2021

Huh, all of the {12,13,14} testbots die at the same spot with no logs.

Unfortunately, I nuked most of my FBSD VMs (which I foolishly had ZFS root on) in incomplete prior iterations of this patch, so I'll have to restore those from backup or reinstall them with non-ZFS root first...

(Nothing that exciting, incidentally - just unresolved symbols that I didn't find out about until load time, and load time was, on those systems, boot time...)

The code is integrated, builds fine, runs fine, there's not really
any reason not to.

Signed-off-by: Rich Ercolani <[email protected]>
@rincebrain
Copy link
Contributor Author

rincebrain commented Nov 9, 2021

Ah, heh, whoops.

I had the remnants of a prior build's objects laying around and for some reason it didn't rebuild them as expected, so when I thought I was testing the latest rev of the code, it was, in fact, not. (No ccache anywhere on the system, so I'm not really sure what happened.)

But on a clean tree, it very obviously was extremely on fire with a change I made later. Should be resolved.

Wow. That was quite the failure mode.

@ghost
Copy link

ghost commented Nov 9, 2021

This might have complications when building in the base system, so we'll want to check that as well.

@rincebrain
Copy link
Contributor Author

This might have complications when building in the base system, so we'll want to check that as well.

Which kinds of complications? Are you thinking of what might transpire if you're running new userland and old kernel bits, or something else?

@ghost
Copy link

ghost commented Nov 9, 2021

I don't know why, but we haven't used any of the ICP code in FreeBSD so far. There were a lot of gymnastics making sure things build in the base system. I just want to be sure we don't break anything like the boot loader or architectures we haven't set up CI in OpenZFS for but are still supported by the base system. It's definitely promising that it builds and passes the tests here.

@rincebrain
Copy link
Contributor Author

I don't know why, but we haven't used any of the ICP code in FreeBSD so far. There were a lot of gymnastics making sure things build in the base system. I just want to be sure we don't break anything like the boot loader or architectures we haven't set up CI in OpenZFS for but are still supported by the base system.

When I asked, I was told that it was just that nobody had wired it up, not any expectation of underlying issues.

Does FBSD have some CI that could be leveraged to run this through its paces?

@ghost
Copy link

ghost commented Nov 9, 2021

I don't think there's much in the way of public CI for FreeBSD, I'm only aware of a periodic CI that runs for things that have already been committed. If you're inclined to test this yourself, you'd run make universe or make tinderbox in the FreeBSD source tree after merging the changes and updating the FreeBSD build system, just to make sure it builds. Otherwise I can do that, probably tomorrow at the soonest.

@bghira
Copy link

bghira commented Nov 9, 2021

i think Rich was asking specifically about CI for non-common arch

@rincebrain
Copy link
Contributor Author

rincebrain commented Nov 9, 2021

I meant it more for uncommon arch, but more generally, since the statement sounded to me like "I do not think the OpenZFS CI is enough testing for this", I wanted to know if there was a set of testing this could be fed into to see if it was up to snuff.

I can probably run make universe, I do have a couple of x86 cores available. (Though I'll probably try buildkernel/buildworld first and run down issues with that...otherwise, I'd be happy to let you run it if you've got many more cores.)

As far as other arches, though, all my hardware for those is at least slow and possibly emulated and slow.

@bghira
Copy link

bghira commented Nov 9, 2021

oh there's the freebsd-arch mailing list https://lists.freebsd.org/subscription/freebsd-arch

not sure how active it is anymore. but you can find some people who may be able to help test these changes especially if it's going to impact their ability to boot sometime in the future.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tinderbox completed the builds for all the oddball architectures, so potential run time issues notwithstanding, this seems ok.

@mmatuska I applied this change to add the files to the FreeBSD build, FYI:

diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile
index 983f0aa0e994..54d53c87a7c5 100644
--- a/sys/modules/zfs/Makefile
+++ b/sys/modules/zfs/Makefile
@@ -8,6 +8,7 @@ KMOD=	zfs
 .PATH:	${SRCDIR}/avl \
 	${SRCDIR}/lua \
 	${SRCDIR}/nvpair \
+	${SRCDIR}/icp/algs/edonr \
 	${SRCDIR}/os/freebsd/spl \
 	${SRCDIR}/os/freebsd/zfs \
 	${SRCDIR}/unicode \
@@ -44,6 +45,9 @@ SRCS=	vnode_if.h device_if.h bus_if.h
 # avl
 SRCS+=	avl.c
 
+# icp
+SRCS+=	edonr.c
+
 #lua
 SRCS+=	lapi.c \
 	lauxlib.c \
@@ -191,6 +195,7 @@ SRCS+=	abd.c \
 	dsl_scan.c \
 	dsl_synctask.c \
 	dsl_userhold.c \
+	edonr_zfs.c \
 	fm.c \
 	gzip.c \
 	lzjb.c \
@@ -313,6 +318,7 @@ CFLAGS.dmu_traverse.c= -Wno-cast-qual
 CFLAGS.dsl_dir.c= -Wno-cast-qual
 CFLAGS.dsl_deadlist.c= -Wno-cast-qual
 CFLAGS.dsl_prop.c= -Wno-cast-qual
+CFLAGS.edonr.c= -Wno-cast-qual
 CFLAGS.fm.c= -Wno-cast-qual
 CFLAGS.lz4.c= -Wno-cast-qual
 CFLAGS.spa.c= -Wno-cast-qual

@ghost
Copy link

ghost commented Nov 11, 2021

Actually the LINT builds did fail because of this:

ld: error: undefined symbol: abd_checksum_edonr_native
>>> referenced by zio_checksum.c
>>>               zio_checksum.o:(zio_checksum_table)

ld: error: undefined symbol: abd_checksum_edonr_byteswap
>>> referenced by zio_checksum.c
>>>               zio_checksum.o:(zio_checksum_table)

ld: error: undefined symbol: abd_checksum_edonr_tmpl_init
>>> referenced by zio_checksum.c
>>>               zio_checksum.o:(zio_checksum_table)

ld: error: undefined symbol: abd_checksum_edonr_tmpl_free
>>> referenced by zio_checksum.c
>>>               zio_checksum.o:(zio_checksum_table)
*** [kernel] Error code 1

I'm not sure why only the LINT builds, maybe my integration of the edonr files into the FreeBSD build system is incomplete?

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Nov 11, 2021
@ghost
Copy link

ghost commented Nov 11, 2021

diff --git a/sys/conf/files b/sys/conf/files
index e1ee0e9fc9ef..712824bd637d 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -231,6 +231,7 @@ contrib/openzfs/module/unicode/uconv.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/unicode/u8_textprep.c		optional zfs compile-with "${ZFS_C}"
 
 #zfs checksums / zcommon
+contrib/openzfs/module/icp/algs/edonr/edonr.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zcommon/cityhash.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zcommon/zfeature_common.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zcommon/zfs_comutil.c		optional zfs compile-with "${ZFS_C}"
@@ -283,6 +284,7 @@ contrib/openzfs/module/zfs/dsl_prop.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/dsl_scan.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/dsl_synctask.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/dsl_userhold.c		optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/edonr_zfs.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/fm.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/gzip.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/lzjb.c		optional zfs compile-with "${ZFS_C}"

This might fix the LINT issues. Running tinderbox again now...

@ghost
Copy link

ghost commented Nov 11, 2021

All good now.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nice to see this platform discrepancy removed. This makes sense to me as long as we can confirm with the FreeBSD folks they are fine with relying on the icp for this functionality (it sounds like that's the case). One nice upside is we'll no longer need different linux and freebsd zfs/cmd/zpool/compatibility.d files.

Copy link
Contributor

@allanjude allanjude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed By: Allan Jude <[email protected]>

@tonynguien tonynguien added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Nov 15, 2021
@tonynguien tonynguien merged commit 269b5da into openzfs:master Nov 16, 2021
freebsd-git pushed a commit to freebsd/freebsd-src that referenced this pull request Nov 17, 2021
resolves: link_elf_obj: symbol abd_checksum_edonr_native undefined

The required module-build bits were originally identified in the
upstream pull request: openzfs/zfs#12735
But were missed when the code was imported (since they are not
committed upstream).

X-MFC-With:	dae1713, 09cd634
Submitted by:	freqlabs
Sponsored by:	Klara Inc.
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this pull request Dec 5, 2021
This chases 269b5da (openzfs#12735),
which touched the actual code but didn't fix the comment

Signed-off-by: Ahelenia Ziemiańska <[email protected]>
behlendorf pushed a commit that referenced this pull request Dec 9, 2021
This chases 269b5da (#12735),
which touched the actual code but didn't fix the comment

Additionally, ignore the name.

Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rich Ercolani <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #12823
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Jan 15, 2022
resolves: link_elf_obj: symbol abd_checksum_edonr_native undefined

The required module-build bits were originally identified in the
upstream pull request: openzfs/zfs#12735
But were missed when the code was imported (since they are not
committed upstream).

X-MFC-With:	dae1713, 09cd634
Submitted by:	freqlabs
Sponsored by:	Klara Inc.
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Feb 10, 2022
The code is integrated, builds fine, runs fine, there's not really
any reason not to.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Allan Jude <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Signed-off-by: Rich Ercolani <[email protected]>
Closes openzfs#12735
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
The code is integrated, builds fine, runs fine, there's not really
any reason not to.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Allan Jude <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Signed-off-by: Rich Ercolani <[email protected]>
Closes openzfs#12735
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
This chases 269b5da (openzfs#12735),
which touched the actual code but didn't fix the comment

Additionally, ignore the name.

Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rich Ercolani <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12823
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
The code is integrated, builds fine, runs fine, there's not really
any reason not to.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Allan Jude <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Signed-off-by: Rich Ercolani <[email protected]>
Closes openzfs#12735
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
This chases 269b5da (openzfs#12735),
which touched the actual code but didn't fix the comment

Additionally, ignore the name.

Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rich Ercolani <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12823
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants