From 740dd2e13b705327963712706f553bf38503c85a Mon Sep 17 00:00:00 2001 From: Vasant Patil Date: Wed, 18 Sep 2024 01:33:23 -0700 Subject: [PATCH] Changed type some params in thrift Summary: As titled. Since we do not send this data over the wire. And also this not something that is transferred between processes/services as IPC. I think this is safe change. How we use these thrift fields. 1. In cfgr we read SI settings CSV provided by vendor and write those to plaform mapping JSON. 2. We manually copy that generated plaform mapping JSON file to FB code in a .cpp file. 3. When fboss agent process comes up, it loads the content in platform mapping. JSON into this thrift. And the reason for this change now is, new SI settings provided Cisco, has values that doesn't fit in i16. Reviewed By: harshitgulati18 Differential Revision: D62921959 fbshipit-source-id: c4d76a314b14d2f3759a0a26ffce0ac58ec738ae --- fboss/fsdb/if/oss/fsdb_model_thriftpath.h | 24 +++++++++++------------ fboss/lib/phy/phy.thrift | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fboss/fsdb/if/oss/fsdb_model_thriftpath.h b/fboss/fsdb/if/oss/fsdb_model_thriftpath.h index cee61033f25c5..de7c7ab4af615 100755 --- a/fboss/fsdb/if/oss/fsdb_model_thriftpath.h +++ b/fboss/fsdb/if/oss/fsdb_model_thriftpath.h @@ -9800,12 +9800,12 @@ class ChildThriftPath<::facebook::fboss::phy::TxSettings, ::facebook::fboss::fsd ChildTag, Self >; - using Children = fatal::tuple>, -std::pair>, -std::pair>, -std::pair>, -std::pair>, -std::pair>, + using Children = fatal::tuple>, +std::pair>, +std::pair>, +std::pair>, +std::pair>, +std::pair>, std::pair>, std::pair>, std::pair>, @@ -9824,12 +9824,12 @@ std::pair>, std::pair>, std::pair>>; - using ChildrenById = fatal::tuple< std::pair, Child<::std::int16_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i16_t>>, - std::pair, Child<::std::int16_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i16_t>>, - std::pair, Child<::std::int16_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i16_t>>, - std::pair, Child<::std::int16_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i16_t>>, - std::pair, Child<::std::int16_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i16_t>>, - std::pair, Child<::std::int16_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i16_t>>, + using ChildrenById = fatal::tuple< std::pair, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>, + std::pair, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>, + std::pair, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>, + std::pair, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>, + std::pair, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>, + std::pair, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>, std::pair, Child<::std::int16_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i16_t>>, std::pair, Child<::std::int16_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i16_t>>, std::pair, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>, diff --git a/fboss/lib/phy/phy.thrift b/fboss/lib/phy/phy.thrift index b132eac57c428..a36529335af16 100644 --- a/fboss/lib/phy/phy.thrift +++ b/fboss/lib/phy/phy.thrift @@ -122,12 +122,12 @@ enum Loopback { } struct TxSettings { - 1: i16 pre = 0; - 2: i16 pre2 = 0; - 3: i16 main = 0; - 4: i16 post = 0; - 5: i16 post2 = 0; - 6: i16 post3 = 0; + 1: i32 pre = 0; + 2: i32 pre2 = 0; + 3: i32 main = 0; + 4: i32 post = 0; + 5: i32 post2 = 0; + 6: i32 post3 = 0; 7: optional i16 lutMode; 8: optional i16 driveCurrent; 9: optional i32 diffEncoderEn;