Merge branch 'rdma-copy-on-fork' into next

Gal Pressman  says:

====================

This is the userspace part for the new copy-on-fork attribute added to
the get sys netlink command.

The new attribute indicates that the kernel copies DMA pages on fork,
hence fork support through madvise and MADV_DONTFORK is not needed.

Kernel series was merged:
https://lore.kernel.org/linux-rdma/20210418121025.66849-1-galpress@amazon.com/

====================

Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
David Ahern 2021-05-03 14:45:19 +00:00
commit c79fcefaaf
2 changed files with 13 additions and 1 deletions

View File

@ -546,6 +546,9 @@ enum rdma_nldev_attr {
RDMA_NLDEV_ATTR_MIN_RANGE, /* u32 */
RDMA_NLDEV_ATTR_MAX_RANGE, /* u32 */
RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK, /* u8 */
/*
* Always the end
*/

View File

@ -20,6 +20,7 @@ static const char *netns_modes_str[] = {
static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data)
{
struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
bool cof = false;
mnl_attr_parse(nlh, 0, rd_attr_cb, tb);
@ -35,9 +36,17 @@ static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data)
else
mode_str = "unknown";
print_color_string(PRINT_ANY, COLOR_NONE, "netns", "netns %s\n",
print_color_string(PRINT_ANY, COLOR_NONE, "netns", "netns %s ",
mode_str);
}
if (tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK])
cof = mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]);
print_color_on_off(PRINT_ANY, COLOR_NONE, "copy-on-fork",
"copy-on-fork %s\n",
cof);
return MNL_CB_OK;
}