[BFN] Remove SAI patches (#10343)

Signed-off-by: Myron Sosyak <myronx.sosyak@intel.com>
This commit is contained in:
Myron Sosyak 2022-03-31 12:49:22 -07:00 committed by GitHub
parent 0bce0a7e6d
commit eb141f2163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 0 additions and 194 deletions

View File

@ -1,7 +1,3 @@
SAITHRIFT_PATCHES = saithrift-patches
$(SAITHRIFT_PATCHES)_SRC_PATH = $(PLATFORM_PATH)/saithrift-patches
SONIC_MAKE_FILES += $(SAITHRIFT_PATCHES)
# libsaithrift-dev package
SAI_VER = 0.9.4
LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb
@ -13,7 +9,6 @@ $(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) \
#$(LIBSAIVS) $(LIBSAIVS_DEV) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV)
# $(LIBSAITHRIFT_DEV)_BUILD_ENV = platform=v
$(LIBSAITHRIFT_DEV)_AFTER_FILES = $(SAITHRIFT_PATCHES)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1) $(BFN_SAI)
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV)

View File

@ -1,70 +0,0 @@
From 6f0188ad82845ac56729d3db621b2d10bea94ddd Mon Sep 17 00:00:00 2001
From: Myron Sosyak <myronx.sosyak@intel.com>
Date: Thu, 27 Jan 2022 17:25:42 +0000
Subject: [PATCH 1/4] Replace unions with structs in thrift
---
test/saithrift/src/switch_sai.thrift | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/saithrift/src/switch_sai.thrift b/test/saithrift/src/switch_sai.thrift
index a9e1d28..0c24b71 100644
--- a/test/saithrift/src/switch_sai.thrift
+++ b/test/saithrift/src/switch_sai.thrift
@@ -48,7 +48,7 @@ struct sai_thrift_vlan_port_t {
2: sai_thrift_vlan_tagging_mode_t tagging_mode;
}
-union sai_thrift_ip_t {
+struct sai_thrift_ip_t {
1: sai_thrift_ip4_t ip4;
2: sai_thrift_ip6_t ip6;
}
@@ -79,7 +79,7 @@ struct sai_thrift_s32_list_t {
2: list<i32> s32list;
}
-union sai_thrift_acl_mask_t {
+struct sai_thrift_acl_mask_t {
1: byte u8;
2: byte s8;
3: i16 u16;
@@ -91,7 +91,7 @@ union sai_thrift_acl_mask_t {
9: sai_thrift_ip6_t ip6;
}
-union sai_thrift_acl_data_t {
+struct sai_thrift_acl_data_t {
1: byte u8;
2: byte s8;
3: i16 u16;
@@ -112,7 +112,7 @@ struct sai_thrift_acl_field_data_t
3: sai_thrift_acl_data_t data;
}
-union sai_thrift_acl_parameter_t {
+struct sai_thrift_acl_parameter_t {
1: byte u8;
2: byte s8;
3: i16 u16;
@@ -161,7 +161,7 @@ struct sai_thrift_fdb_values_t {
2: sai_thrift_fdb_entry_t thrift_fdb_entry;
}
-union sai_thrift_attribute_value_t {
+struct sai_thrift_attribute_value_t {
1: bool booldata;
2: string chardata;
3: byte u8;
@@ -207,7 +207,7 @@ struct sai_thrift_attribute_list_t {
2: i32 attr_count; // redundant
}
-union sai_thrift_result_data_t {
+struct sai_thrift_result_data_t {
1: sai_thrift_object_list_t objlist;
2: sai_thrift_object_id_t oid;
3: i16 u16;
--
2.20.1

View File

@ -1,25 +0,0 @@
From 6605dbe4906173b78f428f42f749674c2722361a Mon Sep 17 00:00:00 2001
From: Myron Sosyak <myronx.sosyak@intel.com>
Date: Thu, 27 Jan 2022 17:26:08 +0000
Subject: [PATCH 2/4] Use std::shared_ptr instead of boost
---
test/saithrift/src/switch_sai_rpc_server.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/saithrift/src/switch_sai_rpc_server.cpp b/test/saithrift/src/switch_sai_rpc_server.cpp
index 0df9b3d..e990c50 100644
--- a/test/saithrift/src/switch_sai_rpc_server.cpp
+++ b/test/saithrift/src/switch_sai_rpc_server.cpp
@@ -74,7 +74,7 @@ using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
-using boost::shared_ptr;
+using std::shared_ptr;
using namespace ::switch_sai;
--
2.20.1

View File

@ -1,24 +0,0 @@
From b468a7aa00843be9c5ead478bd074784c04b4ba2 Mon Sep 17 00:00:00 2001
From: Myron Sosyak <myronx.sosyak@intel.com>
Date: Thu, 27 Jan 2022 17:26:40 +0000
Subject: [PATCH 3/4] include algorithm
---
test/saithrift/src/saiserver.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/saithrift/src/saiserver.cpp b/test/saithrift/src/saiserver.cpp
index 846c3f1..7120b26 100644
--- a/test/saithrift/src/saiserver.cpp
+++ b/test/saithrift/src/saiserver.cpp
@@ -5,6 +5,7 @@
#include <unistd.h>
#include <sys/queue.h>
#include <sys/types.h>
+#include <algorithm>
#include <fstream>
#include <sstream>
#include <set>
--
2.20.1

View File

@ -1,47 +0,0 @@
From 58d5e21378d3fd5dd3a48adb24423c1bb9ff6f7a Mon Sep 17 00:00:00 2001
From: Myron Sosyak <myronx.sosyak@intel.com>
Date: Thu, 27 Jan 2022 17:28:05 +0000
Subject: [PATCH 4/4] Fix Thrift 0.14.1 compatibility
---
test/saithrift/Makefile | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/test/saithrift/Makefile b/test/saithrift/Makefile
index cbe6f48..3734ee7 100644
--- a/test/saithrift/Makefile
+++ b/test/saithrift/Makefile
@@ -21,8 +21,8 @@ CDEFS = -DBRCMSAI
endif
endif
endif
-DEPS = switch_sai_constants.h switch_sai_rpc.h switch_sai_types.h
-OBJS = switch_sai_constants.o switch_sai_rpc.o switch_sai_types.o
+DEPS = switch_sai_rpc.h switch_sai_types.h
+OBJS = switch_sai_rpc.o switch_sai_types.o
ODIR = ./src/obj
SAIDIR = ./include
@@ -42,8 +42,6 @@ endif
SAI_LIBRARY_DIR ?= $(SAI_PREFIX)/lib
LDFLAGS = -L$(SAI_LIBRARY_DIR) -Wl,-rpath=$(SAI_LIBRARY_DIR)
CPP_SOURCES = \
- src/gen-cpp/switch_sai_constants.cpp \
- src/gen-cpp/switch_sai_constants.h \
src/gen-cpp/switch_sai_rpc.cpp \
src/gen-cpp/switch_sai_rpc.h \
src/gen-cpp/switch_sai_types.cpp \
@@ -89,8 +87,8 @@ $(ODIR)/switch_sai_rpc_server.o: src/switch_sai_rpc_server.cpp
$(ODIR)/saiserver.o: src/saiserver.cpp
$(CXX) $(CFLAGS) -c $^ -o $@ $(CFLAGS) $(CDEFS) -I$(SRC)/gen-cpp -I$(SRC)
-$(ODIR)/librpcserver.a: $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_constants.o $(ODIR)/switch_sai_rpc_server.o
- ar rcs $(ODIR)/librpcserver.a $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_constants.o $(ODIR)/switch_sai_rpc_server.o
+$(ODIR)/librpcserver.a: $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_rpc_server.o
+ ar rcs $(ODIR)/librpcserver.a $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_rpc_server.o
saiserver: $(ODIR)/saiserver.o $(ODIR)/librpcserver.a
$(CXX) $(LDFLAGS) $(ODIR)/switch_sai_rpc_server.o $(ODIR)/saiserver.o -o $@ \
--
2.20.1

View File

@ -1,19 +0,0 @@
SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e
MAIN_TARGET = saithrift-patches
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# To add some BFN specific patches to SAI under sonic-sairedis while sai is not updated
SRC_DIR = ../saithrift-patches
DST_DIR = ../../../src/sonic-sairedis/SAI.patch/
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# copy patches to SAI
mkdir -p $(DST_DIR)
cp -f $(SRC_DIR)/* $(DST_DIR)
touch $(DEST)/saithrift-patches

View File

@ -1,4 +0,0 @@
0001-Replace-unions-with-structs-in-thrift.patch
0002-Use-std-shared_ptr-instead-of-boost.patch
0003-include-algorithm.patch
0004-Fix-Thrift-0.14.1-compatibility.patch