Commit Graph

11 Commits

Author SHA1 Message Date
Rob Sherwood
0eb330520f Added aliveSince() implementation to OSS fb303 skeleton
Summary:
fb303 is not open source, but fboss depends on it.  So, the
open source version of fboss uses its own private, mostly
stubbed out version of fb303 (in fboss/common/...).

With the changes to QsfpCache.cpp, we now depend on aliveSince()
fb303 primitive and the open source started spewing errors
about it not being implemented.

This patch implements aliveSince() for the skeleton open source
fb303 but we'll have to figure out a better, longer term fix
(e.g., open source all of fb303).

Reviewed By: aeckert

Differential Revision: D6731321

fbshipit-source-id: 6acdcd68053e7bfcada2cfd62aaa3aecf3dec3e0
2018-01-17 13:02:09 -08:00
Alex Eckert
c684fed90a fix oss sandcastle job
Summary:
My recent stack of diffs introduced a handful of oss bugs :(.

1. VLOG_EVERY_MS is an internal function.
fix: added an oss stub version

2. Forgot to add QsfpCache.cpp to CMakeLists.txt
fix: add it

3. vanilla gcc5.4 has a bug where it can't handle lambdas like:
  [this]() {
    memberFn();
  }
and instead you need to write like:
  [this]() {
    this->memberFn();
  }

fix: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 says it should
be fixed in gcc7, but I added 'this->' in the meantime.

4. The base fb303.thrift file we have in open source does not declare
aliveSince, which we now call on qsfp_service.

fix: add it to fb303.thrift

Reviewed By: ninas

Differential Revision: D6627705

fbshipit-source-id: 2100783df1ea0e9af0fed66e4e24ef85b71fc7e9
2017-12-22 09:21:44 -08:00
Philip Jameson
f18128537f Migrate TARGETS files from @/ to //
Summary:
This is a codemod to change from using @/ to // in basic cases.
- TARGETS files with lines starting with @/ (but excluding @/third-party:
- autodeps lines in source and TARGETS files ( (dep|manual)=@/ ), excluding @/third-party
- Targets in string macros

The only thing left of the old format should be @/third-party:foo:bar

drop-conflicts

Reviewed By: ttsugriy

Differential Revision: D6605560

fbshipit-source-id: 17d3a196b91045f0db5ee2a5afad467b6344be0b
2017-12-20 18:39:22 -08:00
Rob Sherwood
4c3ea3f14d Completely redo CMakeFiles.txt and getdeps.sh for new thrift
Summary:
Should make OSS build again :-(
Closes https://github.com/facebook/fboss/pull/57

Reviewed By: eduardo-elizondo

Differential Revision: D6048266

Pulled By: capveg

fbshipit-source-id: 005a9f5b2c0aa21abfcd4932b16e8ef062bb7eb0
2017-10-17 00:35:03 -07:00
Joseph Wu
6169d8c059 rename link_state_down to link_state_flap
Summary:
In this diff, the main goal is to change the old `link_state.down` to `link_state.flap`. However, the tricky part is how can we use the normalized
portName(ethX/Y/Z) instead of portX as the key name. Since, the initialization of wedge_agent will go through two stage genrally:
In such case, we need to support changing the portName for PortStats after it's created.

My last diff(D5695076) is trying to delete all the TLTimeseries of all the threads in PortUpdateHandler observer, while ThreadLocalStats will also
try to unregister(delete) the TLTimeseries before we shut down wedge_agent. Therefore, we saw this:
```
Sep 16 19:09:52 rsw1fs.17.prn2.facebook.com wedge_agent[1884398]: F0916 19:09:52.716562 1884650 ThreadLocalStats-defs.h:495] Check failed: numErased == 1 attempted to unregister a stat that was not registered
```

So I guess probably it's not a good idea to delete a TLTimeseries of some thread in a different thread, unless you can get the global lock like ThreadLocalStats
does. Thus, in this new diff, I kinda walk around it:

Differential Revision: D5914457

fbshipit-source-id: f7d47d2ececfabbab8fdc222a0f82db4184230f9
2017-10-09 10:36:47 -07:00
Jasmeet Bagga
9bbee241e6 Change API between SwSwitch and HwSwitch to indicate HwSwitch might fail some
Summary:
Depend on D4492997
Currently, we assume that changes applied to HwSwitch always succeed (or the process exits). There is a case where we want to keep moving despite failures: when we get excessive number of route (probably) because of some misconfiguration. This diff is a step towards taking care of such situation.

We change the interface between SwSwitch and HwSwitch so that HwSwitch, when asked to apply delta of old and new state, returns either the new state if it succeeds, or returns a "pruned version of new state" if some elements of new state it was not able to apply.

SwSwitch now keeps track of two states, a state that has been applied in the hardware, and another one that is desired in hardware. SwSwitch strives to catch applied state to the desired state (while desired state is also changes as move state updates are arriving).

One issue with this diff: Warmboot is not preserving "unapplied" routes, i.e., unapplied routes get lost across warmboots. This will be fixed in a seperate diff.

One naming issue: I thought about keeping SwSwitch::getState() name intact, but thought that it is not a good idea to keep distinction of states opaque to callers. So, decided to change the name.

Reviewed By: ninas

Differential Revision: D4405751

fbshipit-source-id: c933b4418445ae49d5b8e21dea95e437a8e1593d
2017-06-02 13:38:22 -07:00
Andrew Gallagher
6df267fe5c codemod: format TARGETS with buildifier [3/5] (D5092623)
Reviewed By: igorsugak

fbshipit-source-id: c3036011faa009bb2b051142b1caedfdbe77b3df
2017-06-01 16:51:16 -07:00
Saif Hasan
d792d1607c Do not set default value for ifName
Summary:
Setting default value to empty causes trouble on server if client is old as
server will think that value is set to empty and it tries to parse empty value.

This field is not being used anywhere except in `openr` for now and openr is
fully compatible with this change. Not setting default value will give us as
`__isset.ifName` to `false` instead of being empty string, which is desired
behaviour.

(Note: this ignores all push blocking failures!)

Reviewed By: anantdeepak

Differential Revision: D4934119

fbshipit-source-id: 4dd2e9307c659f1b6ccaf583964efa8df6041d24
2017-04-21 22:49:35 -07:00
Jasmeet Bagga
55812e225c Use normalized names for interface port stats
Summary:
Logical ids are so 2014. We have been thinking
about emitting stats using normalized names for some time.
Approach wise, I picked the following
- If port does not have a name - default to using port ID
- In agent if a port name get set or updated. Re init BCMPort stats. Basically
this means that the moment config gets applied, we would start emitting
normalized interface stats.

Two additional pieces of work here are
i) Update interface based alerts to also look at these new normalized
interface name stats - t17052196
ii) Update cubism to look at these new names - t17052255

I won't land till at least i) is fixed

Differential Revision: D4815561

fbshipit-source-id: c088b5a8981ea40429fedc8570652c376a374be3
2017-04-11 07:08:48 -07:00
Saif Hasan
a03676f7fb Add ifName field to BinaryAddress
Summary:
We are using `BinaryAddress` heavily within fboss codebase to represent a
nexthop as well as an IPAddres in wire format. Nexthops will need to have
a scoping identifier (iface name) for link-local address inorder to resolve
it properly.

We do this in OpenR and well tested on Arista. This seems bit hacky but it
saves a lot of time. In future we would like to have separate network util for
fboss and openr and we can get rid of this hack at that time.

Differential Revision: D4710768

fbshipit-source-id: 72092935f3738b3fb88a422462d1c995cc0acf18
2017-03-17 17:13:20 -07:00
Adam Simpkins
7f58caffe4 Add fb303 stubs in common/ to support building in the opensource repo
Summary:
This adds a common/ directory with stub files required for building
eden.  These stubs are the same ones as used in the fboss repository:
https://github.com/facebook/fboss/

Our goal is to eventually create an opensource fb303 repository with
complete implementations of these files, but for now these basic stubs
allow building eden.  (Most of the underlying stats code that supports
fb303 is already available in folly/stats/ in the folly repository.)

Test Plan:
Tested building eden on Ubuntu 16.04
2017-03-17 17:08:05 -07:00