Commit 0974a43 1 parent e2f50e8 commit 0974a43 Copy full SHA for 0974a43
File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,33 @@ int promisc(const char *dev)
794
794
return err;
795
795
}
796
796
797
+ int vs_set_dev_mtu (
798
+ _In_ const char *name,
799
+ _In_ int mtu)
800
+ {
801
+ SWSS_LOG_ENTER ();
802
+
803
+ int sock = socket (AF_INET, SOCK_STREAM, IPPROTO_IP);
804
+
805
+ struct ifreq ifr;
806
+
807
+ strncpy (ifr.ifr_name , name, IFNAMSIZ);
808
+
809
+ ifr.ifr_mtu = mtu;
810
+
811
+ int err = ioctl (sock, SIOCSIFMTU, &ifr);
812
+
813
+ if (err == 0 )
814
+ {
815
+ SWSS_LOG_INFO (" success set mtu on %s to %d" , name, mtu);
816
+ return 0 ;
817
+ }
818
+
819
+ SWSS_LOG_WARN (" failed to set mtu on %s to %d" , name, mtu);
820
+ return err;
821
+ }
822
+
823
+
797
824
#define ETH_FRAME_BUFFER_SIZE (0x4000 )
798
825
#define CONTROL_MESSAGE_BUFFER_SIZE (0x1000 )
799
826
#define IEEE_8021Q_ETHER_TYPE (0x8100 )
@@ -1190,6 +1217,8 @@ sai_status_t vs_create_hostif_tap_interface(
1190
1217
return SAI_STATUS_FAILURE;
1191
1218
}
1192
1219
1220
+ vs_set_dev_mtu (name.c_str (), ETH_FRAME_BUFFER_SIZE);
1221
+
1193
1222
if (!hostif_create_tap_veth_forwarding (name, tapfd, obj_id))
1194
1223
{
1195
1224
SWSS_LOG_ERROR (" forwarding rule on %s was not added" , name.c_str ());
You can’t perform that action at this time.
0 commit comments