Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two platforms supporting S3IP SYSFS (TCS8400, TCS9400) #12386

Merged
merged 5 commits into from
Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# name lanes alias index speed
Ethernet1 25,26,27,28 Eth200GE0/1 1 200000
Ethernet2 29,30,31,32 Eth200GE0/2 2 200000
Ethernet3 41,42,43,44 Eth200GE0/3 3 200000
Ethernet4 45,46,47,48 Eth200GE0/4 4 200000
Ethernet5 49,50,51,52 Eth200GE0/5 5 200000
Ethernet6 53,54,55,56 Eth200GE0/6 6 200000
Ethernet7 57,58,59,60 Eth200GE0/7 7 200000
Ethernet8 61,62,63,64 Eth200GE0/8 8 200000
Ethernet9 9,10,11,12 Eth200GE0/9 9 200000
Ethernet10 13,14,15,16 Eth200GE0/10 10 200000
Ethernet11 17,18,19,20 Eth200GE0/11 11 200000
Ethernet12 21,22,23,24 Eth200GE0/12 12 200000
Ethernet13 81,82,83,84 Eth200GE0/13 13 200000
Ethernet14 85,86,87,88 Eth200GE0/14 14 200000
Ethernet15 89,90,91,92 Eth200GE0/15 15 200000
Ethernet16 93,94,95,96 Eth200GE0/16 16 200000
Ethernet17 97,98,99,100 Eth200GE0/17 17 200000
Ethernet18 101,102,103,104 Eth200GE0/18 18 200000
Ethernet19 137,138,139,140 Eth200GE0/19 19 200000
Ethernet20 141,142,143,144 Eth200GE0/20 20 200000
Ethernet21 145,146,147,148 Eth200GE0/21 21 200000
Ethernet22 149,150,151,152 Eth200GE0/22 22 200000
Ethernet23 153,154,155,156 Eth200GE0/23 23 200000
Ethernet24 157,158,159,160 Eth200GE0/24 24 200000
Ethernet25 1,2,3,4,5,6,7,8 Eth400GE0/25 25 400000
Ethernet26 33,34,35,36,37,38,39,40 Eth400GE0/26 26 400000
Ethernet27 65,66,67,68,69,70,71,72 Eth400GE0/27 27 400000
Ethernet28 73,74,75,76,77,78,79,80 Eth400GE0/28 28 400000
Ethernet29 105,106,107,108,109,110,111,112 Eth400GE0/29 29 400000
Ethernet30 113,114,115,116,117,118,119,120 Eth400GE0/30 30 400000
Ethernet31 121,122,123,124,125,126,127,128 Eth400GE0/31 31 400000
Ethernet32 129,130,131,132,133,134,135,136 Eth400GE0/32 32 400000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/TCS8400-24CC8CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
{
"DEVICE_METADATA": {
"localhost": {
"hwsku": "TCS8400-24CC8CD",
"platform": "x86_64-tencent_tcs8400-r0",
"mac": "58:69:6c:f1:23:12",
"hostname": "sonic"
}
},
"PORT": {
"Ethernet1": {
"lanes": "25,26,27,28",
"alias": "Eth200GE0/1",
"index": "1",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet2": {
"lanes": "29,30,31,32",
"alias": "Eth200GE0/2",
"index": "2",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet3": {
"lanes": "41,42,43,44",
"alias": "Eth200GE0/3",
"index": "3",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet4": {
"lanes": "45,46,47,48",
"alias": "Eth200GE0/4",
"index": "4",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet5": {
"lanes": "49,50,51,52",
"alias": "Eth200GE0/5",
"index": "5",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet6": {
"lanes": "53,54,55,56",
"alias": "Eth200GE0/6",
"index": "6",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet7": {
"lanes": "57,58,59,60",
"alias": "Eth200GE0/7",
"index": "7",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet8": {
"lanes": "61,62,63,64",
"alias": "Eth200GE0/8",
"index": "8",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet9": {
"lanes": "9,10,11,12",
"alias": "Eth200GE0/9",
"index": "9",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet10": {
"lanes": "13,14,15,16",
"alias": "Eth200GE0/10",
"index": "10",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet11": {
"lanes": "17,18,19,20",
"alias": "Eth200GE0/11",
"index": "11",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet12": {
"lanes": "21,22,23,24",
"alias": "Eth200GE0/12",
"index": "12",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet13": {
"lanes": "81,82,83,84",
"alias": "Eth200GE0/13",
"index": "13",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet14": {
"lanes": "85,86,87,88",
"alias": "Eth200GE0/14",
"index": "14",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet15": {
"lanes": "89,90,91,92",
"alias": "Eth200GE0/15",
"index": "15",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet16": {
"lanes": "93,94,95,96",
"alias": "Eth200GE0/16",
"index": "16",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet17": {
"lanes": "97,98,99,100",
"alias": "Eth200GE0/17",
"index": "17",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet18": {
"lanes": "101,102,103,104",
"alias": "Eth200GE0/18",
"index": "18",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet19": {
"lanes": "137,138,139,140",
"alias": "Eth200GE0/19",
"index": "19",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet20": {
"lanes": "141,142,143,144",
"alias": "Eth200GE0/20",
"index": "20",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet21": {
"lanes": "145,146,147,148",
"alias": "Eth200GE0/21",
"index": "21",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet22": {
"lanes": "149,150,151,152",
"alias": "Eth200GE0/22",
"index": "22",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet23": {
"lanes": "153,154,155,156",
"alias": "Eth200GE0/23",
"index": "23",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet24": {
"lanes": "157,158,159,160",
"alias": "Eth200GE0/24",
"index": "24",
"speed": "200000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet25": {
"lanes": "1,2,3,4,5,6,7,8",
"alias": "Eth400GE0/25",
"index": "25",
"speed": "400000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet26": {
"lanes": "33,34,35,36,37,38,39,40",
"alias": "Eth400GE0/26",
"index": "26",
"speed": "400000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet27": {
"lanes": "65,66,67,68,69,70,71,72",
"alias": "Eth400GE0/27",
"index": "27",
"speed": "400000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet28": {
"lanes": "73,74,75,76,77,78,79,80",
"alias": "Eth400GE0/28",
"index": "28",
"speed": "400000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet29": {
"lanes": "105,106,107,108,109,110,111,112",
"alias": "Eth400GE0/29",
"index": "29",
"speed": "400000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet30": {
"lanes": "113,114,115,116,117,118,119,120",
"alias": "Eth400GE0/30",
"index": "30",
"speed": "400000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet31": {
"lanes": "121,122,123,124,125,126,127,128",
"alias": "Eth400GE0/31",
"index": "31",
"speed": "400000",
"admin_status": "up",
"mtu": "9100"
},
"Ethernet32": {
"lanes": "129,130,131,132,133,134,135,136",
"alias": "Eth400GE0/32",
"index": "32",
"speed": "400000",
"admin_status": "up",
"mtu": "9100"
}
}
}
85 changes: 85 additions & 0 deletions device/tencent/x86_64-tencent_tcs8400-r0/cpu.cint
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
cint_reset();

int cint_field_group_create(int unit, bcm_field_group_t grp)
{
int rv;

bcm_field_qset_t qset;
bcm_field_aset_t aset;

BCM_FIELD_QSET_INIT(qset);
BCM_FIELD_QSET_ADD(qset,bcmFieldQualifyDstMac);
BCM_FIELD_QSET_ADD(qset, bcmFieldQualifyStageIngress);

BCM_FIELD_ASET_INIT(aset);
BCM_FIELD_ASET_ADD(aset, bcmFieldActionCopyToCpu);

rv = bcm_field_group_create_mode_id(unit, qset, 103, bcmFieldGroupModeAuto, grp);
if (rv != BCM_E_NONE) {
printf("bcm_field_group_create_mode_id failed, rv = %d\r\n", rv);
return -1;
}
printf("cint_field_group_create success!!!, rv = %d\r\n", rv);

bcm_field_group_dump(unit,grp);
return 0;
}

int cint_field_entry_create1(int unit, bcm_field_group_t grp,bcm_field_entry_t entry)
{
int rv;
bcm_mac_t dst_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
bcm_mac_t mac_mask = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

rv = bcm_field_entry_create_id(unit, grp, entry);
if (rv != BCM_E_NONE) {
printf("bcm_field_entry_create_id failed, rv = %d\r\n", rv);
return -1;
}


rv =bcm_field_qualify_DstMac(unit, entry, dst_mac, mac_mask);
if (rv != BCM_E_NONE) {
printf("bcm_field_qualify_DstMac failed,ret = %d\r\n", rv);
bcm_field_entry_destroy(unit, entry);
return -1;
}

rv = bcm_field_action_add(unit, entry, bcmFieldActionCopyToCpu, 1, 0);
if (rv != BCM_E_NONE) {
printf("bcm_field_action_add failed, rv = %d \r\n", rv);
bcm_field_entry_destroy(unit, entry);
return -1;
}

rv = bcm_field_action_add(unit, entry, bcmFieldActionDrop, 1, 0);
if (rv != BCM_E_NONE) {
printf("bcm_field_action_add failed, rv = %d \r\n", rv);
bcm_field_entry_destroy(unit, entry);
return -1;
}

rv = bcm_field_entry_install(unit, entry);
if (rv != BCM_E_NONE) {
printf("bcm_field_entry_install failed,ret = %d\r\n", rv);
bcm_field_entry_destroy(unit, entry);
return -1;
}

printf("********************* BEGIN ****************************\r\n");
bcm_field_entry_dump(unit, entry);
printf("*********************** END ****************************\r\n");

return 0;
}

cint_field_group_create(0,5);
cint_field_entry_create1(0,5,2048);

//bcm_field_entry_destroy(0, 2048);
//bcm_field_group_destroy(0, 5);





Binary file not shown.
1 change: 1 addition & 0 deletions device/tencent/x86_64-tencent_tcs8400-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TCS8400-24CC8CD t1
Loading