Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into vlan_incremental
Browse files Browse the repository at this point in the history
  • Loading branch information
jipanyang committed May 29, 2019
2 parents 34fb6df + 3e8ad15 commit eac5357
Show file tree
Hide file tree
Showing 37 changed files with 2,508 additions and 235 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Broadcom[![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/sonic-swss-build/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/sonic-swss-build/)
Cavium[![Cavium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/cavium/job/sonic-swss-build/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/cavium/job/sonic-swss-build/)
Mellanox[![Mellanox](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/sonic-swss-build/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/sonic-swss-build/)
P4[![P4](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/sonic-swss-build/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/sonic-swss-build/)
VS[![VS](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/sonic-swss-build/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/sonic-swss-build/)

# SONiC - SWitch State Service - SWSS

Expand Down
5 changes: 4 additions & 1 deletion cfgmgr/intfmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ bool IntfMgr::doIntfGeneralTask(const vector<string>& keys,
// Set Interface VRF except for lo
if (!is_lo)
{
setIntfVrf(alias, vrf_name);
if (!vrf_name.empty())
{
setIntfVrf(alias, vrf_name);
}
m_appIntfTableProducer.set(alias, data);
}
else
Expand Down
61 changes: 47 additions & 14 deletions doc/swss-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ For example (reorder output)
oper_status = "down" / "up" ; operating status
mtu = 1*4DIGIT ; MTU for the IP interface of the VLAN

---------------------------------------------
### VLAN_MEMBER_TABLE
;Defines interfaces which are members of a vlan
;Status: work in progress

key = VLAN_MEMBER_TABLE:"Vlan"vlanid:ifname ; physical port "ifname" is a member of a VLAN "VlanX"
tagging_mode = "untagged" / "tagged" / "priority_tagged" ; default value as untagged

---------------------------------------------
### LAG_TABLE
;a logical, link aggregation group interface (802.3ad) made of one or more ports
Expand Down Expand Up @@ -570,12 +562,13 @@ Equivalent RedisDB entry:

----------------------------------------------

### PORT\_MIRROR\_TABLE
Stores information about mirroring session and its properties.
### MIRROR\_SESSION\_TABLE
Mirror session table
Stores information about mirror sessions and their properties.

key = PORT_MIRROR_TABLE:mirror_session_name ; mirror_session_name is
; unique session
; identifier
key = MIRROR_SESSION_TABLE:mirror_session_name ; mirror_session_name is
; unique session
; identifier
; field = value
status = "active"/"inactive" ; Session state.
src_ip = ipv4_address ; Session souce IP address
Expand All @@ -584,9 +577,11 @@ Stores information about mirroring session and its properties.
dscp = h8 ; Session DSCP
ttl = h8 ; Session TTL
queue = h8 ; Session output queue
policer = policer_name ; Session policer name

;value annotations
mirror_session_name = 1*255VCHAR
policer_name = 1*255VCHAR
h8 = 1*2HEXDIG
h16 = 1*4HEXDIG
ipv4_address = dec-octet "." dec-octet "." dec-octet "." dec-octet “/” %d1-32
Expand Down Expand Up @@ -628,7 +623,45 @@ Equivalent RedisDB entry:
10) "64"
11) "queue"
12) "0"
127.0.0.1:6379>

---------------------------------------------

### POLICER_TABLE
Policer table
Stores information about policers and their properties.

packet_action = "drop" | "forward" | "copy" | "copy_cancel" | "trap" | "log" | "deny" | "transit"

;Key
key = "POLICER_TABLE:name"

;Field-Value tuples
meter_type = "packets" | "bytes"
mode = "sr_tcm" | "tr_tcm" | "storm"
color = "aware" | "blind"
cbs = number ;packets or bytes depending on the meter_type value
cir = number ;packets or bytes depending on the meter_type value
pbs = number ;packets or bytes depending on the meter_type value
pir = number ;packets or bytes depending on the meter_type value

green_action = packet_action
yellow_action = packet_action
red_action = packet_action

Example:
127.0.0.1:6379> hgetall "POLICER_TABLE:POLICER_1"
1) "cbs"
2) "600"
3) "cir"
4) "600"
5) "meter_type"
6) "packets"
7) "mode"
8) "sr_tcm"
9) "red_action"
10) "drop"

----------------------------------------------

### VXLAN\_TUNNEL\_MAP
;Stores vxlan tunnel map configuration. Defines mapping between vxlan vni and vrf
Expand Down
6 changes: 4 additions & 2 deletions fpmsyncd/routesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ RouteSync::RouteSync(RedisPipeline *pipeline) :
m_routeTable(pipeline, APP_ROUTE_TABLE_NAME, true),
m_vnet_routeTable(pipeline, APP_VNET_RT_TABLE_NAME, true),
m_vnet_tunnelTable(pipeline, APP_VNET_RT_TUNNEL_TABLE_NAME, true),
m_warmStartHelper(pipeline, &m_routeTable, APP_ROUTE_TABLE_NAME, "bgp", "bgp")
m_warmStartHelper(pipeline, &m_routeTable, APP_ROUTE_TABLE_NAME, "bgp", "bgp"),
m_nl_sock(NULL), m_link_cache(NULL)
{
m_nl_sock = nl_socket_alloc();
nl_connect(m_nl_sock, NETLINK_ROUTE);
Expand Down Expand Up @@ -291,7 +292,8 @@ bool RouteSync::getIfName(int if_index, char *if_name, size_t name_len)
/* Cannot get interface name. Possibly the interface gets re-created. */
if (!rtnl_link_i2name(m_link_cache, if_index, if_name, name_len))
{
rtnl_link_alloc_cache(m_nl_sock, AF_UNSPEC, &m_link_cache);
/* Trying to refill cache */
nl_cache_refill(m_nl_sock, m_link_cache);
if (!rtnl_link_i2name(m_link_cache, if_index, if_name, name_len))
{
return false;
Expand Down
8 changes: 8 additions & 0 deletions neighsyncd/neighsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ipaddress.h"
#include "netmsg.h"
#include "linkcache.h"
#include "macaddress.h"

#include "neighsync.h"
#include "warm_restart.h"
Expand Down Expand Up @@ -78,6 +79,13 @@ void NeighSync::onMsg(int nlmsg_type, struct nl_object *obj)

nl_addr2str(rtnl_neigh_get_lladdr(neigh), macStr, MAX_ADDR_SIZE);

/* Ignore neighbor entries with Broadcast Mac - Trigger for directed broadcast */
if (!delete_key && (MacAddress(macStr) == MacAddress("ff:ff:ff:ff:ff:ff")))
{
SWSS_LOG_INFO("Broadcast Mac recieved, ignoring for %s", ipStr);
return;
}

std::vector<FieldValueTuple> fvVector;
FieldValueTuple f("family", family);
FieldValueTuple nh("neigh", macStr);
Expand Down
2 changes: 1 addition & 1 deletion neighsyncd/restore_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def set_neigh_in_kernel(ipclass, family, intf_idx, dst_ip, dmac):
def build_arp_ns_pkt(family, smac, src_ip, dst_ip):
if family == 'IPv4':
eth = Ether(src=smac, dst='ff:ff:ff:ff:ff:ff')
pkt = eth/ARP(op=ARP.who_has, pdst=dst_ip)
pkt = eth/ARP(op='who-has', pdst=dst_ip)
elif family == 'IPv6':
nsma = in6_getnsma(inet_pton(AF_INET6, dst_ip))
mcast_dst_ip = inet_ntop(AF_INET6, nsma)
Expand Down
35 changes: 2 additions & 33 deletions orchagent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,8 @@ orchagent_SOURCES = \
vnetorch.cpp \
dtelorch.cpp \
flexcounterorch.cpp \
watermarkorch.cpp \
acltable.h \
aclorch.h \
bufferorch.h \
copporch.h \
directory.h \
fdborch.h \
intfsorch.h \
mirrororch.h \
neighorch.h \
notifications.h \
observer.h \
orch.h \
orchdaemon.h \
pfcactionhandler.h \
pfcwdorch.h \
port.h \
portsorch.h \
qosorch.h \
routeorch.h \
saihelper.h \
switchorch.h \
swssnet.h \
tunneldecaporch.h \
crmorch.h \
request_parser.h \
vrforch.h \
dtelorch.h \
countercheckorch.h \
vxlanorch.h \
vnetorch.h \
flexcounterorch.h \
watermarkorch.h
watermarkorch.cpp \
policerorch.cpp

orchagent_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
orchagent_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
Expand Down
Loading

0 comments on commit eac5357

Please sign in to comment.