-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Copp Manager Changes #4861
Copp Manager Changes #4861
Changes from 6 commits
13e55dc
aa1b85b
e059294
b24ed96
3474847
2fb24ad
4117628
2bbd56b
3e7113a
12a9990
dce281d
599e9c9
fd9914c
1dbc830
1a7e57a
d9889f3
05eee92
6077a93
0d3e4e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ program:buffermgrd | |
program:vrfmgrd | ||
program:nbrmgrd | ||
program:vxlanmgrd | ||
program:coppmgrd |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,18 @@ stderr_logfile=syslog | |
dependent_startup=true | ||
dependent_startup_wait_for=orchagent:running | ||
|
||
[program:coppmgrd] | ||
command=/usr/bin/coppmgrd | ||
priority=6 | ||
autostart=false | ||
autorestart=unexpected | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dgsudharsan For the process |
||
startretries=0 | ||
startsecs=0 | ||
stdout_logfile=syslog | ||
stderr_logfile=syslog | ||
dependent_startup=true | ||
dependent_startup_wait_for=orchagent:running | ||
|
||
[program:neighsyncd] | ||
command=/usr/bin/neighsyncd | ||
priority=7 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ if [[ "$SYSTEM_WARM_START" == "true" ]] || [[ "$SWSS_WARM_START" == "true" ]]; t | |
exit 0 | ||
fi | ||
|
||
SWSSCONFIG_ARGS="00-copp.config.json ipinip.json ports.json switch.json " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this file from the source location also. |
||
SWSSCONFIG_ARGS="ipinip.json ports.json switch.json " | ||
|
||
for file in $SWSSCONFIG_ARGS; do | ||
swssconfig /etc/swss/config.d/$file | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,6 +286,12 @@ sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.sh $FILESYSTEM_ROOT/usr/bin/ | |
sudo cp $IMAGE_CONFIGS/interfaces/*.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ | ||
echo "interfaces-config.service" | sudo tee -a $GENERATED_SERVICE_FILE | ||
|
||
# Copy CoPP configuration files and templates | ||
sudo cp $IMAGE_CONFIGS/copp/copp-config.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM | ||
sudo cp $IMAGE_CONFIGS/copp/copp-config.sh $FILESYSTEM_ROOT/usr/bin/ | ||
sudo cp $IMAGE_CONFIGS/copp/copp_cfg.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ | ||
echo "copp-config.service" | sudo tee -a $GENERATED_SERVICE_FILE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of having a service to generate copp_cfg.json, can we do it as part of docker-orchagent/docker-init.sh? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The file is in the host and not inside the docker and hence we need it to be created through a one shot task. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
|
||
# Copy dhcp client configuration template and create an initial configuration | ||
sudo cp files/dhcp/dhclient.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ | ||
j2 files/dhcp/dhclient.conf.j2 | sudo tee $FILESYSTEM_ROOT/etc/dhcp/dhclient.conf | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Update CoPP configuration | ||
Requires=updategraph.service | ||
After=updategraph.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/bin/copp-config.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
sonic-cfggen -d -t /usr/share/sonic/templates/copp_cfg.j2 > /etc/sonic/copp_cfg.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"COPP_GROUP": { | ||
"default": { | ||
"queue": "0", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"600", | ||
"cbs":"600", | ||
"red_action":"drop" | ||
}, | ||
"queue4_group1": { | ||
"trap_action":"trap", | ||
"trap_priority":"4", | ||
"queue": "4" | ||
}, | ||
"queue4_group2": { | ||
"trap_action":"copy", | ||
"trap_priority":"4", | ||
"queue": "4", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"600", | ||
"cbs":"600", | ||
"red_action":"drop" | ||
}, | ||
"queue4_group3": { | ||
"trap_action":"trap", | ||
"trap_priority":"4", | ||
"queue": "4" | ||
}, | ||
"queue1_group1": { | ||
"trap_action":"trap", | ||
"trap_priority":"1", | ||
"queue": "1", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"6000", | ||
"cbs":"6000", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please align these two lines There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
"red_action":"drop" | ||
}, | ||
"queue1_group2": { | ||
"trap_action":"trap", | ||
"trap_priority":"1", | ||
"queue": "1", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"600", | ||
"cbs":"600", | ||
"red_action":"drop" | ||
}, | ||
"queue2_group1": { | ||
"cbs": "1000", | ||
"cir": "1000", | ||
"genetlink_mcgrp_name": "packets", | ||
"genetlink_name": "psample", | ||
"meter_type": "packets", | ||
"mode": "sr_tcm", | ||
"queue": "2", | ||
"red_action": "drop", | ||
"trap_action": "trap", | ||
"trap_priority": "1" | ||
|
||
} | ||
}, | ||
"COPP_TRAP": { | ||
"bgp": { | ||
"trap_ids": "bgp,bgpv6", | ||
"trap_group": "queue4_group1" | ||
}, | ||
"lacp": { | ||
"trap_ids": "lacp", | ||
"trap_group": "queue4_group1" | ||
}, | ||
"arp": { | ||
"trap_ids": "arp_req,arp_resp,neigh_discovery", | ||
"trap_group": "queue4_group2" | ||
}, | ||
"lldp": { | ||
"trap_ids": "lldp", | ||
"trap_group": "queue4_group3" | ||
}, | ||
{% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] != "ToRRouter") %} | ||
"dhcp": { | ||
"trap_ids": "dhcp,dhcpv6", | ||
"trap_group": "queue4_group3" | ||
}, | ||
{% endif %} | ||
"udld": { | ||
"trap_ids": "udld", | ||
"trap_group": "queue4_group3" | ||
}, | ||
"ip2me": { | ||
"trap_ids": "ip2me", | ||
"trap_group": "queue1_group1" | ||
}, | ||
"nat": { | ||
"trap_ids": "src_nat_miss,dest_nat_miss", | ||
"trap_group": "queue1_group2" | ||
}, | ||
"sflow": { | ||
"trap_group": "queue2_group1", | ||
"trap_ids": "sample_packet" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on HLD, coppmgrd shall be started before other processes. Is there any reason for starting at priority 6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its starting immediately after the orchagent. The initial idea was to start coppmgrd at the same priority as start.sh which was earlier programming copp