"Gaetan Rivet" <[email protected]> writes:

> On Mon May 18, 2026 at 7:13 PM CEST, Aaron Conole via dev wrote:
>> Refactored TCP module to use a new ct private storage area rather than
>> an compatible extended conn struct so that future modules will have
>> access to the TCP state details.  This will be needed when getting the
>> actual tcp state of the connection for offload.
>>
>> Signed-off-by: Aaron Conole <[email protected]>
>> ---
>>  lib/automake.mk     |  1 +
>>  lib/conntrack-tcp.c | 64 +++++++++++++++++++--------------------------
>>  lib/conntrack-tcp.h | 61 ++++++++++++++++++++++++++++++++++++++++++
>>  lib/conntrack.c     |  2 ++
>>  4 files changed, 91 insertions(+), 37 deletions(-)
>>  create mode 100644 lib/conntrack-tcp.h
>>
>> diff --git a/lib/automake.mk b/lib/automake.mk
>> index 933b71226b..027dd986ba 100644
>> --- a/lib/automake.mk
>> +++ b/lib/automake.mk
>> @@ -90,6 +90,7 @@ lib_libopenvswitch_la_SOURCES = \
>>      lib/conntrack-icmp.c \
>>      lib/conntrack-private.h \
>>      lib/conntrack-tcp.c \
>> +    lib/conntrack-tcp.h \
>>      lib/conntrack-tftp.c \
>>      lib/conntrack-tp.c \
>>      lib/conntrack-tp.h \
>> diff --git a/lib/conntrack-tcp.c b/lib/conntrack-tcp.c
>> index 8a7c98cc45..696fd5c109 100644
>> --- a/lib/conntrack-tcp.c
>> +++ b/lib/conntrack-tcp.c
>> @@ -3,6 +3,7 @@
>>   * Copyright (c) 2002 - 2008 Henning Brauer
>>   * Copyright (c) 2012 Gleb Smirnoff <[email protected]>
>>   * Copyright (c) 2015, 2016 Nicira, Inc.
>> + * Copyright (c) 2026 Red Hat, Inc.
>>   * All rights reserved.
>>   *
>>   * Redistribution and use in source and binary forms, with or without
>> @@ -39,6 +40,7 @@
>>  #include <config.h>
>>  
>>  #include "conntrack-private.h"
>> +#include "conntrack-tcp.h"
>>  #include "conntrack-tp.h"
>>  #include "coverage.h"
>>  #include "ct-dpif.h"
>> @@ -49,18 +51,7 @@ COVERAGE_DEFINE(conntrack_tcp_seq_chk_bypass);
>>  COVERAGE_DEFINE(conntrack_tcp_seq_chk_failed);
>>  COVERAGE_DEFINE(conntrack_invalid_tcp_flags);
>>  
>> -struct tcp_peer {
>> -    uint32_t               seqlo;          /* Max sequence number sent     
>> */
>> -    uint32_t               seqhi;          /* Max the other end ACKd + win 
>> */
>> -    uint16_t               max_win;        /* largest window (pre scaling) 
>> */
>> -    uint8_t                wscale;         /* window scaling factor        
>> */
>> -    enum ct_dpif_tcp_state state;
>> -};
>> -
>> -struct conn_tcp {
>> -    struct conn up;
>> -    struct tcp_peer peer[2]; /* 'conn' lock protected. */
>> -};
>> +ct_private_id_t conntrack_tcp_private_id = CT_PRIVATE_ID_INVALID;
>
> Hi,
>
> Should each L4 proto register their own private ID, or could it be
> shared? I.e. have a single `conntrack_l4_private_id`, that would be used
> by all l4protos (and other modules) to access L4 private data?

I'm not sure - different L4 protocols would have different state
objects.  Ex, SCTP would track much more than this, and UDP doesn't
track near this much.  Or I guess you mean that we just reuse the ID,
because the protocol reader would determine how the block gets
interpreted.  I think that makes sense, and I can look into it.

> --
> Gaetan

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to