From ef46024e27f88dbc802b20fc3c86d6d4e4023cf9 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Tue, 24 Jan 2023 00:41:57 -0500 Subject: [PATCH] iptfs: impl: add state debug --- net/xfrm/xfrm_iptfs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c index 27e5a509d9e7ba..47d0a8ae47d89a 100644 --- a/net/xfrm/xfrm_iptfs.c +++ b/net/xfrm/xfrm_iptfs.c @@ -176,6 +176,8 @@ int xfrm_iptfs_init_state(struct xfrm_state *x) if (!xtfs) return -ENOMEM; + pr_devinf("init %p\n", xtfs); + xtfs->x = x; xtfs->cfg.reorder_win_size = XFRM_IPTFS_DEFAULT_REORDER_WINDOW; xtfs->cfg.max_queue_size = XFRM_IPTFS_DEFAULT_MAX_QUEUE_SIZE; @@ -198,6 +200,9 @@ int xfrm_iptfs_init_state(struct xfrm_state *x) void xfrm_iptfs_state_destroy(struct xfrm_state *x) { struct xfrm_iptfs_data *xtfs = x->tfs_data; + + pr_devinf("destroy %p\n", xtfs); + if (IS_ERR_OR_NULL(xtfs)) return; @@ -215,6 +220,8 @@ int xfrm_iptfs_user_init(struct net *net, struct xfrm_state *x, struct xfrm_iptfs_data *xtfs = x->tfs_data; struct xfrm_iptfs_config *xc; + pr_devinf("user_init %p\n", xtfs); + if (x->props.mode != XFRM_MODE_IPTFS) return EINVAL; @@ -265,6 +272,8 @@ int xfrm_iptfs_copy_to_user_state(struct xfrm_state *x, struct sk_buff *skb) struct xfrm_iptfs_config *xc = &x->tfs_data->cfg; int ret; + pr_devinf("copy state to user %p\n", x->tfs_data); + if (xc->dont_frag) { if ((ret = nla_put_flag(skb, XFRMA_IPTFS_DONT_FRAG))) return ret; @@ -824,7 +833,7 @@ static int iptfs_input_ordered(struct gro_cells *gro_cells, INIT_LIST_HEAD(&sublist); /* - * Handle fragment at start of payload / reassembly. + * Handle fragment at start of payload, and/or waiting reassembly. */ blkoff = ntohs(ipth->block_offset); @@ -1821,7 +1830,7 @@ static int iptfs_xfrm_output(struct sk_buff *skb, uint remaining) skb->len, remaining); err = xfrm_output(NULL, skb); if (err < 0) - printk("XXX got xfrm_output error: %d", err); + pr_warn_ratelimited("xfrm_output error: %d", err); return err; }