Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] strparser: remove general mode
@ 2026-10-01  7:57 Sabrina Dubroca
  2026-10-01  7:57 ` [PATCH net-next 1/5] net: strparser: remove unused abort_parser/lock/unlock callbacks Sabrina Dubroca
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sabrina Dubroca @ 2026-10-01  7:57 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

The "general mode" of strparser was introduced in 2017 by commit
bbb03029a899 ("strparser: Generalize strparser") and has never been
used. We can simplify the code a bit (remove a few indirections and
NULL checks) by dropping this.

Sabrina Dubroca (5):
  net: strparser: remove unused abort_parser/lock/unlock callbacks
  net: strparser: remove strp->sk NULL checks
  net: strparser: remove strp_process()
  net: strparser: removed the aborted bit and aborts counter
  docs: networking: strparser: remove general mode

 Documentation/networking/strparser.rst | 120 ++++++++-----------------
 include/net/strparser.h                |  11 ---
 net/kcm/kcmproc.c                      |   2 +-
 net/strparser/strparser.c              |  93 ++++---------------
 4 files changed, 53 insertions(+), 173 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net-next 1/5] net: strparser: remove unused abort_parser/lock/unlock callbacks
  2026-10-01  7:57 [PATCH net-next 0/5] strparser: remove general mode Sabrina Dubroca
@ 2026-10-01  7:57 ` Sabrina Dubroca
  2026-10-01  7:57 ` [PATCH net-next 2/5] net: strparser: remove strp->sk NULL checks Sabrina Dubroca
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Sabrina Dubroca @ 2026-10-01  7:57 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

The lock/unlock callbacks were introduced in
2017 (bbb03029a899 ("strparser: Generalize strparser")) and haven't
been used. The abort_parser callback has existed since strp was
committed (2016) and has also never been used.

This patch replaces those indirections with the only possible direct
call.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 include/net/strparser.h   |  3 ---
 net/strparser/strparser.c | 39 +++++----------------------------------
 2 files changed, 5 insertions(+), 37 deletions(-)

diff --git a/include/net/strparser.h b/include/net/strparser.h
index 0ed73e364faa..78e8e3e12ed3 100644
--- a/include/net/strparser.h
+++ b/include/net/strparser.h
@@ -46,9 +46,6 @@ struct strp_callbacks {
 	int (*read_sock)(struct strparser *strp, read_descriptor_t *desc,
 			 sk_read_actor_t recv_actor);
 	int (*read_sock_done)(struct strparser *strp, int err);
-	void (*abort_parser)(struct strparser *strp, int err);
-	void (*lock)(struct strparser *strp);
-	void (*unlock)(struct strparser *strp);
 };
 
 struct strp_msg {
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index a23f4b4dfc67..b5319ed56857 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -75,7 +75,7 @@ static void strp_parser_err(struct strparser *strp, int err,
 	desc->error = err;
 	kfree_skb(strp->skb_head);
 	strp->skb_head = NULL;
-	strp->cb.abort_parser(strp, err);
+	strp_abort_strp(strp, err);
 }
 
 static inline int strp_peek_len(struct strparser *strp)
@@ -409,7 +409,7 @@ static void do_strp_work(struct strparser *strp)
 	/* We need the read lock to synchronize with strp_data_ready. We
 	 * need the socket lock for calling strp_read_sock.
 	 */
-	strp->cb.lock(strp);
+	lock_sock(strp->sk);
 
 	if (unlikely(strp->stopped))
 		goto out;
@@ -421,7 +421,7 @@ static void do_strp_work(struct strparser *strp)
 		queue_work(strp_wq, &strp->work);
 
 out:
-	strp->cb.unlock(strp);
+	release_sock(strp->sk);
 }
 
 static void strp_work(struct work_struct *w)
@@ -436,18 +436,8 @@ static void strp_msg_timeout(struct work_struct *w)
 
 	/* Message assembly timed out */
 	STRP_STATS_INCR(strp->stats.msg_timeouts);
-	strp->cb.lock(strp);
-	strp->cb.abort_parser(strp, -ETIMEDOUT);
-	strp->cb.unlock(strp);
-}
-
-static void strp_sock_lock(struct strparser *strp)
-{
 	lock_sock(strp->sk);
-}
-
-static void strp_sock_unlock(struct strparser *strp)
-{
+	strp_abort_strp(strp, -ETIMEDOUT);
 	release_sock(strp->sk);
 }
 
@@ -455,36 +445,17 @@ int strp_init(struct strparser *strp, struct sock *sk,
 	      const struct strp_callbacks *cb)
 {
 
-	if (!cb || !cb->rcv_msg || !cb->parse_msg)
+	if (!cb || !cb->rcv_msg || !cb->parse_msg || !sk)
 		return -EINVAL;
 
-	/* The sk (sock) arg determines the mode of the stream parser.
-	 *
-	 * If the sock is set then the strparser is in receive callback mode.
-	 * The upper layer calls strp_data_ready to kick receive processing
-	 * and strparser calls the read_sock function on the socket to
-	 * get packets.
-	 *
-	 * If the sock is not set then the strparser is in general mode.
-	 * The upper layer calls strp_process for each skb to be parsed.
-	 */
-
-	if (!sk) {
-		if (!cb->lock || !cb->unlock)
-			return -EINVAL;
-	}
-
 	memset(strp, 0, sizeof(*strp));
 
 	strp->sk = sk;
 
-	strp->cb.lock = cb->lock ? : strp_sock_lock;
-	strp->cb.unlock = cb->unlock ? : strp_sock_unlock;
 	strp->cb.rcv_msg = cb->rcv_msg;
 	strp->cb.parse_msg = cb->parse_msg;
 	strp->cb.read_sock = cb->read_sock;
 	strp->cb.read_sock_done = cb->read_sock_done ? : default_read_sock_done;
-	strp->cb.abort_parser = cb->abort_parser ? : strp_abort_strp;
 
 	INIT_DELAYED_WORK(&strp->msg_timer_work, strp_msg_timeout);
 	INIT_WORK(&strp->work, strp_work);
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 2/5] net: strparser: remove strp->sk NULL checks
  2026-10-01  7:57 [PATCH net-next 0/5] strparser: remove general mode Sabrina Dubroca
  2026-10-01  7:57 ` [PATCH net-next 1/5] net: strparser: remove unused abort_parser/lock/unlock callbacks Sabrina Dubroca
@ 2026-10-01  7:57 ` Sabrina Dubroca
  2026-10-01  7:57 ` [PATCH net-next 3/5] net: strparser: remove strp_process() Sabrina Dubroca
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Sabrina Dubroca @ 2026-10-01  7:57 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

strp_init makes sure strp->sk != NULL.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 net/strparser/strparser.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index b5319ed56857..6cdbd12f41e0 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -36,6 +36,8 @@ static inline struct _strp_msg *_strp_msg(struct sk_buff *skb)
 /* Lower lock held */
 static void strp_abort_strp(struct strparser *strp, int err)
 {
+	struct sock *sk = strp->sk;
+
 	/* Unrecoverable error in receive */
 
 	cancel_delayed_work(&strp->msg_timer_work);
@@ -53,13 +55,9 @@ static void strp_abort_strp(struct strparser *strp, int err)
 	strp->skb_nextp = NULL;
 	strp->need_bytes = 0;
 
-	if (strp->sk) {
-		struct sock *sk = strp->sk;
-
-		/* Report an error on the lower socket */
-		sk->sk_err = -err;
-		sk_error_report(sk);
-	}
+	/* Report an error on the lower socket */
+	sk->sk_err = -err;
+	sk_error_report(sk);
 }
 
 static void strp_start_timer(struct strparser *strp, long timeo)
@@ -80,17 +78,9 @@ static void strp_parser_err(struct strparser *strp, int err,
 
 static inline int strp_peek_len(struct strparser *strp)
 {
-	if (strp->sk) {
-		struct socket *sock = strp->sk->sk_socket;
-
-		return sock->ops->peek_len(sock);
-	}
-
-	/* If we don't have an associated socket there's nothing to peek.
-	 * Return int max to avoid stopping the strparser.
-	 */
+	struct socket *sock = strp->sk->sk_socket;
 
-	return INT_MAX;
+	return sock->ops->peek_len(sock);
 }
 
 /* Lower socket lock held */
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 3/5] net: strparser: remove strp_process()
  2026-10-01  7:57 [PATCH net-next 0/5] strparser: remove general mode Sabrina Dubroca
  2026-10-01  7:57 ` [PATCH net-next 1/5] net: strparser: remove unused abort_parser/lock/unlock callbacks Sabrina Dubroca
  2026-10-01  7:57 ` [PATCH net-next 2/5] net: strparser: remove strp->sk NULL checks Sabrina Dubroca
@ 2026-10-01  7:57 ` Sabrina Dubroca
  2026-10-01  7:57 ` [PATCH net-next 4/5] net: strparser: removed the aborted bit and aborts counter Sabrina Dubroca
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Sabrina Dubroca @ 2026-10-01  7:57 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

It's unused. Then we can revert the changes that commit
bbb03029a899 ("strparser: Generalize strparser") did to extract
__strp_recv().

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 include/net/strparser.h   |  3 ---
 net/strparser/strparser.c | 30 ++++--------------------------
 2 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/include/net/strparser.h b/include/net/strparser.h
index 78e8e3e12ed3..a72dff8e6a3f 100644
--- a/include/net/strparser.h
+++ b/include/net/strparser.h
@@ -160,8 +160,5 @@ void strp_check_rcv(struct strparser *strp);
 int strp_init(struct strparser *strp, struct sock *sk,
 	      const struct strp_callbacks *cb);
 void strp_data_ready(struct strparser *strp);
-int strp_process(struct strparser *strp, struct sk_buff *orig_skb,
-		 unsigned int orig_offset, size_t orig_len,
-		 size_t max_msg_size, long timeo);
 
 #endif /* __NET_STRPARSER_H_ */
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index 6cdbd12f41e0..80f7555f9670 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -84,11 +84,11 @@ static inline int strp_peek_len(struct strparser *strp)
 }
 
 /* Lower socket lock held */
-static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
-		       unsigned int orig_offset, size_t orig_len,
-		       size_t max_msg_size, long timeo)
+static int strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
+		     unsigned int orig_offset, size_t orig_len)
 {
 	struct strparser *strp = (struct strparser *)desc->arg.data;
+	long timeo = READ_ONCE(strp->sk->sk_rcvtimeo);
 	struct _strp_msg *stm;
 	struct sk_buff *head, *skb;
 	size_t eaten = 0, cand_len;
@@ -230,7 +230,7 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
 				}
 				strp_parser_err(strp, len, desc);
 				break;
-			} else if (len > max_msg_size) {
+			} else if (len > strp->sk->sk_rcvbuf) {
 				/* Message length exceeds maximum allowed */
 				STRP_STATS_INCR(strp->stats.msg_too_big);
 				strp_parser_err(strp, -EMSGSIZE, desc);
@@ -312,28 +312,6 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
 	return eaten;
 }
 
-int strp_process(struct strparser *strp, struct sk_buff *orig_skb,
-		 unsigned int orig_offset, size_t orig_len,
-		 size_t max_msg_size, long timeo)
-{
-	read_descriptor_t desc; /* Dummy arg to strp_recv */
-
-	desc.arg.data = strp;
-
-	return __strp_recv(&desc, orig_skb, orig_offset, orig_len,
-			   max_msg_size, timeo);
-}
-EXPORT_SYMBOL_GPL(strp_process);
-
-static int strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
-		     unsigned int orig_offset, size_t orig_len)
-{
-	struct strparser *strp = (struct strparser *)desc->arg.data;
-
-	return __strp_recv(desc, orig_skb, orig_offset, orig_len,
-			   strp->sk->sk_rcvbuf, READ_ONCE(strp->sk->sk_rcvtimeo));
-}
-
 static int default_read_sock_done(struct strparser *strp, int err)
 {
 	return err;
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 4/5] net: strparser: removed the aborted bit and aborts counter
  2026-10-01  7:57 [PATCH net-next 0/5] strparser: remove general mode Sabrina Dubroca
                   ` (2 preceding siblings ...)
  2026-10-01  7:57 ` [PATCH net-next 3/5] net: strparser: remove strp_process() Sabrina Dubroca
@ 2026-10-01  7:57 ` Sabrina Dubroca
  2026-10-01  7:57 ` [PATCH net-next 5/5] docs: networking: strparser: remove general mode Sabrina Dubroca
  2026-10-05 23:10 ` [PATCH net-next 0/5] " patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: Sabrina Dubroca @ 2026-10-01  7:57 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

strp->aborted is never set, so the aborts counter is also never
updated. Remove them, and hard-code a 0 in kcm_stats_seq_show() to
preserve the user-visible format.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 include/net/strparser.h | 5 -----
 net/kcm/kcmproc.c       | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/include/net/strparser.h b/include/net/strparser.h
index a72dff8e6a3f..3c9c8ca08828 100644
--- a/include/net/strparser.h
+++ b/include/net/strparser.h
@@ -32,7 +32,6 @@ struct strp_aggr_stats {
 	unsigned int msg_too_big;
 	unsigned int msg_timeouts;
 	unsigned int bad_hdr_len;
-	unsigned int aborts;
 	unsigned int interrupted;
 	unsigned int unrecov_intr;
 };
@@ -90,7 +89,6 @@ struct strparser {
 
 	u32 stopped : 1;
 	u32 paused : 1;
-	u32 aborted : 1;
 	u32 interrupted : 1;
 	u32 unrecov_intr : 1;
 
@@ -128,8 +126,6 @@ static inline void save_strp_stats(struct strparser *strp,
 	SAVE_PSOCK_STATS(bad_hdr_len);
 #undef SAVE_PSOCK_STATS
 
-	if (strp->aborted)
-		agg_stats->aborts++;
 	if (strp->interrupted)
 		agg_stats->interrupted++;
 	if (strp->unrecov_intr)
@@ -147,7 +143,6 @@ static inline void aggregate_strp_stats(struct strp_aggr_stats *stats,
 	SAVE_PSOCK_STATS(msg_too_big);
 	SAVE_PSOCK_STATS(msg_timeouts);
 	SAVE_PSOCK_STATS(bad_hdr_len);
-	SAVE_PSOCK_STATS(aborts);
 	SAVE_PSOCK_STATS(interrupted);
 	SAVE_PSOCK_STATS(unrecov_intr);
 #undef SAVE_PSOCK_STATS
diff --git a/net/kcm/kcmproc.c b/net/kcm/kcmproc.c
index 25c1007f1098..f065406f57a8 100644
--- a/net/kcm/kcmproc.c
+++ b/net/kcm/kcmproc.c
@@ -332,7 +332,7 @@ static int kcm_stats_seq_show(struct seq_file *seq, void *v)
 		   psock_stats.tx_bytes,
 		   psock_stats.reserved,
 		   psock_stats.unreserved,
-		   strp_stats.aborts,
+		   0,
 		   strp_stats.interrupted,
 		   strp_stats.unrecov_intr,
 		   strp_stats.mem_fail,
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 5/5] docs: networking: strparser: remove general mode
  2026-10-01  7:57 [PATCH net-next 0/5] strparser: remove general mode Sabrina Dubroca
                   ` (3 preceding siblings ...)
  2026-10-01  7:57 ` [PATCH net-next 4/5] net: strparser: removed the aborted bit and aborts counter Sabrina Dubroca
@ 2026-10-01  7:57 ` Sabrina Dubroca
  2026-10-05 23:10 ` [PATCH net-next 0/5] " patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: Sabrina Dubroca @ 2026-10-01  7:57 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

Now that the general mode of strp has been removed from the code,
update the documentation.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 Documentation/networking/strparser.rst | 120 ++++++++-----------------
 1 file changed, 36 insertions(+), 84 deletions(-)

diff --git a/Documentation/networking/strparser.rst b/Documentation/networking/strparser.rst
index 372106b61e65..9a21bbe93691 100644
--- a/Documentation/networking/strparser.rst
+++ b/Documentation/networking/strparser.rst
@@ -8,32 +8,24 @@ Introduction
 ============
 
 The stream parser (strparser) is a utility that parses messages of an
-application layer protocol running over a data stream. The stream
+application layer protocol running over a TCP connection. The stream
 parser works in conjunction with an upper layer in the kernel to provide
 kernel support for application layer messages. For instance, Kernel
 Connection Multiplexor (KCM) uses the Stream Parser to parse messages
 using a BPF program.
 
-The strparser works in one of two modes: receive callback or general
-mode.
-
-In receive callback mode, the strparser is called from the data_ready
-callback of a TCP socket. Messages are parsed and delivered as they are
-received on the socket.
-
-In general mode, a sequence of skbs are fed to strparser from an
-outside source. Message are parsed and delivered as the sequence is
-processed. This modes allows strparser to be applied to arbitrary
-streams of data.
+The strparser is called from the data_ready callback of a TCP
+socket. Messages are parsed and delivered as they are received on the
+socket.
 
 Interface
 =========
 
 The API includes a context structure, a set of callbacks, utility
-functions, and a data_ready function for receive callback mode. The
-callbacks include a parse_msg function that is called to perform
-parsing (e.g.  BPF parsing in case of KCM), and a rcv_msg function
-that is called when a full message has been completed.
+functions, and a data_ready function. The callbacks include a
+parse_msg function that is called to perform parsing (e.g. BPF parsing
+in case of KCM), and a rcv_msg function that is called when a full
+message has been completed.
 
 Functions
 =========
@@ -45,9 +37,8 @@ Functions
 
      Called to initialize a stream parser. strp is a struct of type
      strparser that is allocated by the upper layer. sk is the TCP
-     socket associated with the stream parser for use with receive
-     callback mode; in general mode this is set to NULL. Callbacks
-     are called by the stream parser (the callbacks are listed below).
+     socket associated with the stream parser. Callbacks are called by
+     the stream parser (the callbacks are listed below).
 
      ::
 
@@ -79,18 +70,6 @@ Functions
      parser instance. This must be called after the stream processor
      has been stopped.
 
-     ::
-
-	int strp_process(struct strparser *strp, struct sk_buff *orig_skb,
-			 unsigned int orig_offset, size_t orig_len,
-			 size_t max_msg_size, long timeo)
-
-    strp_process is called in general mode for a stream parser to
-    parse an sk_buff. The number of bytes processed or a negative
-    error number is returned. Note that strp_process does not
-    consume the sk_buff. max_msg_size is maximum size the stream
-    parser will parse. timeo is timeout for completing a message.
-
     ::
 
 	void strp_data_ready(struct strparser *strp);
@@ -112,16 +91,15 @@ Functions
 Callbacks
 =========
 
-There are seven callbacks:
+There are four callbacks:
 
     ::
 
 	int (*parse_msg)(struct strparser *strp, struct sk_buff *skb);
 
-    parse_msg is called to determine the length of the next message
-    in the stream. The upper layer must implement this function. It
-    should parse the sk_buff as containing the headers for the
-    next application layer message in the stream.
+    parse_msg is called to determine the length of the next message in
+    the stream. It should parse the sk_buff as containing the headers
+    for the next application layer message in the stream.
 
     The strparser metadata in the input skb can be accessed with
     strp_msg(skb). Only the offset field is relevant in parse_msg and
@@ -141,30 +119,13 @@ There are seven callbacks:
     =========    ===========================================================
 
     In the case that an error is returned (return value is less than
-    zero) and the parser is in receive callback mode, then it will set
-    the error on TCP socket and wake it up. If parse_msg returned
-    -ESTRPIPE and the stream parser had previously read some bytes for
-    the current message, then the error set on the attached socket is
-    ENODATA since the stream is unrecoverable in that case.
-
-    ::
-
-	void (*lock)(struct strparser *strp)
-
-    The lock callback is called to lock the strp structure when
-    the strparser is performing an asynchronous operation (such as
-    processing a timeout). In receive callback mode the default
-    function is to lock_sock for the associated socket. In general
-    mode the callback must be set appropriately.
+    zero), it will set the error on TCP socket and wake it up. If
+    parse_msg returned -ESTRPIPE and the stream parser had previously
+    read some bytes for the current message, then the error set on the
+    attached socket is ENODATA since the stream is unrecoverable in
+    that case.
 
-    ::
-
-	void (*unlock)(struct strparser *strp)
-
-    The unlock callback is called to release the lock obtained
-    by the lock callback. In receive callback mode the default
-    function is release_sock for the associated socket. In general
-    mode the callback must be set appropriately.
+    This callback must be set.
 
     ::
 
@@ -173,8 +134,7 @@ There are seven callbacks:
     rcv_msg is called when a full message has been received and
     is queued. The callee must consume the sk_buff; it can
     call strp_pause to prevent any further messages from being
-    received in rcv_msg (see strp_pause above). This callback
-    must be set.
+    received in rcv_msg (see strp_pause above).
 
     The strparser metadata in the input skb can be accessed with
     strp_msg(skb). This struct contains two fields: offset and full_len.
@@ -182,6 +142,8 @@ There are seven callbacks:
     the length of the message. skb->len - offset may be greater than
     full_len since strparser does not trim the skb.
 
+    This callback must be set.
+
     ::
 
 	int (*read_sock)(struct strparser *strp, read_descriptor_t *desc,
@@ -189,25 +151,20 @@ There are seven callbacks:
 
     The read_sock callback is used by strparser instead of
     sock->ops->read_sock, if provided.
+
+    This callback is optional.
+
     ::
 
 	int (*read_sock_done)(struct strparser *strp, int err);
 
      read_sock_done is called when the stream parser is done reading
-     the TCP socket in receive callback mode. The stream parser may
-     read multiple messages in a loop and this function allows cleanup
-     to occur when exiting the loop. If the callback is not set (NULL
-     in strp_init) a default function is used.
-
-     ::
+     the TCP socket. The stream parser may read multiple messages in a
+     loop and this function allows cleanup to occur when exiting the
+     loop. If the callback is not set (NULL in strp_init) a default
+     function is used.
 
-	void (*abort_parser)(struct strparser *strp, int err);
-
-     This function is called when stream parser encounters an error
-     in parsing. The default function stops the stream parser and
-     sets the error in the socket if the parser is in receive callback
-     mode. The default function can be changed by setting the callback
-     to non-NULL in strp_init.
+    This callback is optional.
 
 Statistics
 ==========
@@ -224,23 +181,18 @@ Message assembly limits
 The stream parser provide mechanisms to limit the resources consumed by
 message assembly.
 
-A timer is set when assembly starts for a new message. In receive
-callback mode the message timeout is taken from rcvtime for the
-associated TCP socket. In general mode, the timeout is passed as an
-argument in strp_process. If the timer fires before assembly completes
-the stream parser is aborted and the ETIMEDOUT error is set on the TCP
-socket if in receive callback mode.
+A timer is set when assembly starts for a new message. The message
+timeout is taken from rcvtime for the associated TCP socket. If the
+timer fires before assembly completes the stream parser is aborted and
+the ETIMEDOUT error is set on the TCP socket.
 
-In receive callback mode, message length is limited to the receive
+Message length is limited to the receive
 buffer size of the associated TCP socket. If the length returned by
 parse_msg is greater than the socket buffer size then the stream parser
 is aborted with EMSGSIZE error set on the TCP socket. Note that this
 makes the maximum size of receive skbuffs for a socket with a stream
 parser to be 2*sk_rcvbuf of the TCP socket.
 
-In general mode the message length limit is passed in as an argument
-to strp_process.
-
 Author
 ======
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 0/5] strparser: remove general mode
  2026-10-01  7:57 [PATCH net-next 0/5] strparser: remove general mode Sabrina Dubroca
                   ` (4 preceding siblings ...)
  2026-10-01  7:57 ` [PATCH net-next 5/5] docs: networking: strparser: remove general mode Sabrina Dubroca
@ 2026-10-05 23:10 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-05 23:10 UTC (permalink / raw)
  To: Sabrina Dubroca; +Cc: netdev

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  1 Oct 2026 09:57:24 +0200 you wrote:
> The "general mode" of strparser was introduced in 2017 by commit
> bbb03029a899 ("strparser: Generalize strparser") and has never been
> used. We can simplify the code a bit (remove a few indirections and
> NULL checks) by dropping this.
> 
> Sabrina Dubroca (5):
>   net: strparser: remove unused abort_parser/lock/unlock callbacks
>   net: strparser: remove strp->sk NULL checks
>   net: strparser: remove strp_process()
>   net: strparser: removed the aborted bit and aborts counter
>   docs: networking: strparser: remove general mode
> 
> [...]

Here is the summary with links:
  - [net-next,1/5] net: strparser: remove unused abort_parser/lock/unlock callbacks
    https://git.kernel.org/netdev/net-next/c/ed0e5b924d8f
  - [net-next,2/5] net: strparser: remove strp->sk NULL checks
    https://git.kernel.org/netdev/net-next/c/05e37190ba07
  - [net-next,3/5] net: strparser: remove strp_process()
    https://git.kernel.org/netdev/net-next/c/b5e153a5c8ee
  - [net-next,4/5] net: strparser: removed the aborted bit and aborts counter
    https://git.kernel.org/netdev/net-next/c/02fd0a211137
  - [net-next,5/5] docs: networking: strparser: remove general mode
    https://git.kernel.org/netdev/net-next/c/5f193cdabf25

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-05 23:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01  7:57 [PATCH net-next 0/5] strparser: remove general mode Sabrina Dubroca
2026-10-01  7:57 ` [PATCH net-next 1/5] net: strparser: remove unused abort_parser/lock/unlock callbacks Sabrina Dubroca
2026-10-01  7:57 ` [PATCH net-next 2/5] net: strparser: remove strp->sk NULL checks Sabrina Dubroca
2026-10-01  7:57 ` [PATCH net-next 3/5] net: strparser: remove strp_process() Sabrina Dubroca
2026-10-01  7:57 ` [PATCH net-next 4/5] net: strparser: removed the aborted bit and aborts counter Sabrina Dubroca
2026-10-01  7:57 ` [PATCH net-next 5/5] docs: networking: strparser: remove general mode Sabrina Dubroca
2026-10-05 23:10 ` [PATCH net-next 0/5] " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox